diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index fa22e803c6b3c..f1b030298342d 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -0de1233fd180969f7ffdfc98151922f2466ceb1f +220dece92b9ab5f8867a589f8104b15717d68d2f diff --git a/compiled/facebook-www/REVISION_TRANSFORMS b/compiled/facebook-www/REVISION_TRANSFORMS index fa22e803c6b3c..f1b030298342d 100644 --- a/compiled/facebook-www/REVISION_TRANSFORMS +++ b/compiled/facebook-www/REVISION_TRANSFORMS @@ -1 +1 @@ -0de1233fd180969f7ffdfc98151922f2466ceb1f +220dece92b9ab5f8867a589f8104b15717d68d2f diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index da357439eba51..e7f918aa9da18 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -1942,7 +1942,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.1.0-www-classic-0de1233f-20250102"; + exports.version = "19.1.0-www-classic-220dece9-20250102"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-dev.modern.js b/compiled/facebook-www/React-dev.modern.js index 024336f3f17f5..1043958c2d7ad 100644 --- a/compiled/facebook-www/React-dev.modern.js +++ b/compiled/facebook-www/React-dev.modern.js @@ -1942,7 +1942,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.1.0-www-modern-0de1233f-20250102"; + exports.version = "19.1.0-www-modern-220dece9-20250102"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-prod.classic.js b/compiled/facebook-www/React-prod.classic.js index 0e625f12c68c4..2a4a461c72673 100644 --- a/compiled/facebook-www/React-prod.classic.js +++ b/compiled/facebook-www/React-prod.classic.js @@ -630,4 +630,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-www-classic-0de1233f-20250102"; +exports.version = "19.1.0-www-classic-220dece9-20250102"; diff --git a/compiled/facebook-www/React-prod.modern.js b/compiled/facebook-www/React-prod.modern.js index 06e1c1c65e38e..5bba31636836c 100644 --- a/compiled/facebook-www/React-prod.modern.js +++ b/compiled/facebook-www/React-prod.modern.js @@ -630,4 +630,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-www-modern-0de1233f-20250102"; +exports.version = "19.1.0-www-modern-220dece9-20250102"; diff --git a/compiled/facebook-www/React-profiling.classic.js b/compiled/facebook-www/React-profiling.classic.js index 0d10487ac2ccd..68c7dbccc3dc9 100644 --- a/compiled/facebook-www/React-profiling.classic.js +++ b/compiled/facebook-www/React-profiling.classic.js @@ -634,7 +634,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-www-classic-0de1233f-20250102"; +exports.version = "19.1.0-www-classic-220dece9-20250102"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-profiling.modern.js b/compiled/facebook-www/React-profiling.modern.js index cf312fcd256b3..ea750d611e700 100644 --- a/compiled/facebook-www/React-profiling.modern.js +++ b/compiled/facebook-www/React-profiling.modern.js @@ -634,7 +634,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-www-modern-0de1233f-20250102"; +exports.version = "19.1.0-www-modern-220dece9-20250102"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index 5b4c3f49f645d..8ea33d863e667 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -751,41 +751,6 @@ __DEV__ && } return hook.checkDCE ? !0 : !1; } - function onCommitRoot(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), - error$jscomp$0( - "React instrumentation encountered an error: %s", - err - )); - } - } function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && (unstable_setDisableYieldValue(newIsStrictMode), @@ -923,14 +888,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -940,29 +904,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2325,7 +2290,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + -1 !== root.timeoutHandle )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -2388,7 +2355,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2453,7 +2421,10 @@ __DEV__ && workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -10208,6 +10179,7 @@ __DEV__ && } function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = null; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -10291,10 +10263,7 @@ __DEV__ && nextEffect = root.return; } } - root = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return root; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -10938,12 +10907,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -11304,12 +11267,6 @@ __DEV__ && } flags & 4096 && (finishedWork.flags &= -4097); } - function commitLayoutEffects(finishedWork, root, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -12484,9 +12441,8 @@ __DEV__ && break; } a: { - renderWasConcurrent = root; - shouldTimeSlice = exitStatus; - switch (shouldTimeSlice) { + shouldTimeSlice = root; + switch (exitStatus) { case RootInProgress: case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); @@ -12494,7 +12450,7 @@ __DEV__ && if ((lanes & 4194176) !== lanes) break; case RootSuspendedAtTheShell: markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings @@ -12509,63 +12465,39 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - renderWasConcurrent.finishedWork = forceSync; - renderWasConcurrent.finishedLanes = lanes; - if (null !== ReactSharedInternals.actQueue) { - lanes = renderWasConcurrent; - forceSync = workInProgressRootRecoverableErrors; - exitStatus = workInProgressTransitions; - renderWasConcurrent = - workInProgressRootDidIncludeRecursiveRenderUpdate; - lanesThatJustErrored = workInProgressDeferredLane; - originallyAttemptedLanes = - workInProgressRootInterleavedUpdatedLanes; - var suspendedRetryLanes = workInProgressSuspendedRetryLanes, - suspendedCommitReason = IMMEDIATE_COMMIT, - prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - lanes, - forceSync, - exitStatus, - renderWasConcurrent, - previousUpdateLanePriority, - lanesThatJustErrored, - originallyAttemptedLanes, - suspendedRetryLanes, - shouldTimeSlice, - suspendedCommitReason, - -0, - 0 - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); - } - } else { + if (null !== ReactSharedInternals.actQueue) + commitRoot( + shouldTimeSlice, + forceSync, + lanes, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes + ); + else { if ( (lanes & 62914560) === lanes && - (alwaysThrottleRetries || shouldTimeSlice === RootSuspended) && - ((exitStatus = + (alwaysThrottleRetries || exitStatus === RootSuspended) && + ((renderWasConcurrent = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now$1()), - 10 < exitStatus) + 10 < renderWasConcurrent) ) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, - renderWasConcurrent, + shouldTimeSlice, forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, @@ -12575,17 +12507,17 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, - shouldTimeSlice, + exitStatus, THROTTLED_COMMIT, -0, 0 ), - exitStatus + renderWasConcurrent ); break a; } commitRootWhenReady( - renderWasConcurrent, + shouldTimeSlice, forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, @@ -12595,7 +12527,7 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, - shouldTimeSlice, + exitStatus, IMMEDIATE_COMMIT, -0, 0 @@ -12616,39 +12548,23 @@ __DEV__ && lanes, spawnedLane, updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - lanes = finishedWork.subtreeFlags; - (lanes & 8192 || 16785408 === (lanes & 16785408)) && + root.timeoutHandle = -1; + var subtreeFlags = finishedWork.subtreeFlags; + (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); - finishedWork = ReactSharedInternals.T; - lanes = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = finishedWork), - (currentUpdatePriority = lanes); - } + commitRoot( + root, + finishedWork, + lanes, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -12743,8 +12659,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -13381,133 +13295,236 @@ __DEV__ && workInProgressRootExitStatus = RootSuspendedAtTheShell; workInProgress = null; } - function commitRootImpl( + function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - renderPriorityLevel, spawnedLane, updatedLanes, suspendedRetryLanes ) { + root.cancelPendingCommit = 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.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + 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." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - 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." + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + updatedLanes = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (currentUpdatePriority = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (updatedLanes = currentUpdatePriority), - (currentUpdatePriority = DiscreteEventPriority), - (suspendedRetryLanes = executionContext), - (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffects(root, finishedWork, lanes), - (root.current = finishedWork), + } + } + function flushMutationEffects(root, finishedWork, lanes) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + (inProgressLanes = lanes), + (inProgressRoot = root), + commitMutationEffectsOnFiber(finishedWork, root), + (inProgressRoot = inProgressLanes = null); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + } + function flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ) { + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && injectedProfilingHooks.markLayoutEffectsStarted(lanes), - commitLayoutEffects(finishedWork, root, lanes), - enableSchedulingProfiler && + (inProgressLanes = lanes), + (inProgressRoot = root), + commitLayoutEffectOnFiber( + root, + finishedWork.alternate, + finishedWork + ), + (inProgressRoot = inProgressLanes = null), enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(), - requestPaint(), - (executionContext = suspendedRetryLanes), - (currentUpdatePriority = updatedLanes), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), + : (releaseRootPooledCache(root, root.pendingLanes), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); + previousPriority = root.pendingLanes; + 0 === previousPriority && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + finishedWork = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + var didError = 128 === (finishedWork.current.flags & 128); + switch (rootHasLayoutEffect) { + 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, + finishedWork, + schedulerPriority, + didError + ); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + error$jscomp$0( + "React instrumentation encountered an error: %s", + err + )); + } isDevToolsPresent && root.memoizedUpdaters.clear(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), + if (null !== recoverableErrors) { + didError = ReactSharedInternals.T; + schedulerPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) { + var recoverableError = recoverableErrors[finishedWork], + errorInfo = makeErrorInfo(recoverableError.stack); runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo ); + } + } finally { + (ReactSharedInternals.T = didError), + (currentUpdatePriority = schedulerPriority); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + previousPriority = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -13515,7 +13532,6 @@ __DEV__ && : (nestedUpdateCount = 0); flushSyncWorkAcrossRoots_impl(0, !1); enableSchedulingProfiler && markCommitStopped(); - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -14462,11 +14478,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -14479,7 +14491,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -16903,10 +16914,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-www-classic-0de1233f-20250102", + version: "19.1.0-www-classic-220dece9-20250102", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-classic-220dece9-20250102" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -16940,7 +16951,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; - exports.version = "19.1.0-www-classic-0de1233f-20250102"; + exports.version = "19.1.0-www-classic-220dece9-20250102"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index 80c4082f51765..60462102aaaad 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -737,41 +737,6 @@ __DEV__ && } return hook.checkDCE ? !0 : !1; } - function onCommitRoot(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), - error$jscomp$0( - "React instrumentation encountered an error: %s", - err - )); - } - } function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && (unstable_setDisableYieldValue(newIsStrictMode), @@ -909,14 +874,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -926,29 +890,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2217,7 +2182,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + -1 !== root.timeoutHandle )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -2280,7 +2247,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2345,7 +2313,10 @@ __DEV__ && workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -10012,6 +9983,7 @@ __DEV__ && } function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = null; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -10095,10 +10067,7 @@ __DEV__ && nextEffect = root.return; } } - root = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return root; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -10742,12 +10711,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -11108,12 +11071,6 @@ __DEV__ && } flags & 4096 && (finishedWork.flags &= -4097); } - function commitLayoutEffects(finishedWork, root, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -12288,9 +12245,8 @@ __DEV__ && break; } a: { - renderWasConcurrent = root; - shouldTimeSlice = exitStatus; - switch (shouldTimeSlice) { + shouldTimeSlice = root; + switch (exitStatus) { case RootInProgress: case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); @@ -12298,7 +12254,7 @@ __DEV__ && if ((lanes & 4194176) !== lanes) break; case RootSuspendedAtTheShell: markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings @@ -12313,63 +12269,39 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - renderWasConcurrent.finishedWork = forceSync; - renderWasConcurrent.finishedLanes = lanes; - if (null !== ReactSharedInternals.actQueue) { - lanes = renderWasConcurrent; - forceSync = workInProgressRootRecoverableErrors; - exitStatus = workInProgressTransitions; - renderWasConcurrent = - workInProgressRootDidIncludeRecursiveRenderUpdate; - lanesThatJustErrored = workInProgressDeferredLane; - originallyAttemptedLanes = - workInProgressRootInterleavedUpdatedLanes; - var suspendedRetryLanes = workInProgressSuspendedRetryLanes, - suspendedCommitReason = IMMEDIATE_COMMIT, - prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - lanes, - forceSync, - exitStatus, - renderWasConcurrent, - previousUpdateLanePriority, - lanesThatJustErrored, - originallyAttemptedLanes, - suspendedRetryLanes, - shouldTimeSlice, - suspendedCommitReason, - -0, - 0 - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); - } - } else { + if (null !== ReactSharedInternals.actQueue) + commitRoot( + shouldTimeSlice, + forceSync, + lanes, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes + ); + else { if ( (lanes & 62914560) === lanes && - (alwaysThrottleRetries || shouldTimeSlice === RootSuspended) && - ((exitStatus = + (alwaysThrottleRetries || exitStatus === RootSuspended) && + ((renderWasConcurrent = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now$1()), - 10 < exitStatus) + 10 < renderWasConcurrent) ) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, - renderWasConcurrent, + shouldTimeSlice, forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, @@ -12379,17 +12311,17 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, - shouldTimeSlice, + exitStatus, THROTTLED_COMMIT, -0, 0 ), - exitStatus + renderWasConcurrent ); break a; } commitRootWhenReady( - renderWasConcurrent, + shouldTimeSlice, forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, @@ -12399,7 +12331,7 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, - shouldTimeSlice, + exitStatus, IMMEDIATE_COMMIT, -0, 0 @@ -12420,39 +12352,23 @@ __DEV__ && lanes, spawnedLane, updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - lanes = finishedWork.subtreeFlags; - (lanes & 8192 || 16785408 === (lanes & 16785408)) && + root.timeoutHandle = -1; + var subtreeFlags = finishedWork.subtreeFlags; + (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); - finishedWork = ReactSharedInternals.T; - lanes = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = finishedWork), - (currentUpdatePriority = lanes); - } + commitRoot( + root, + finishedWork, + lanes, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -12547,8 +12463,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -13181,133 +13095,236 @@ __DEV__ && workInProgressRootExitStatus = RootSuspendedAtTheShell; workInProgress = null; } - function commitRootImpl( + function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - renderPriorityLevel, spawnedLane, updatedLanes, suspendedRetryLanes ) { + root.cancelPendingCommit = 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.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + 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." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - 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." + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + updatedLanes = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (currentUpdatePriority = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (updatedLanes = currentUpdatePriority), - (currentUpdatePriority = DiscreteEventPriority), - (suspendedRetryLanes = executionContext), - (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffects(root, finishedWork, lanes), - (root.current = finishedWork), + } + } + function flushMutationEffects(root, finishedWork, lanes) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + (inProgressLanes = lanes), + (inProgressRoot = root), + commitMutationEffectsOnFiber(finishedWork, root), + (inProgressRoot = inProgressLanes = null); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + } + function flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ) { + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && injectedProfilingHooks.markLayoutEffectsStarted(lanes), - commitLayoutEffects(finishedWork, root, lanes), - enableSchedulingProfiler && + (inProgressLanes = lanes), + (inProgressRoot = root), + commitLayoutEffectOnFiber( + root, + finishedWork.alternate, + finishedWork + ), + (inProgressRoot = inProgressLanes = null), enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(), - requestPaint(), - (executionContext = suspendedRetryLanes), - (currentUpdatePriority = updatedLanes), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), + : (releaseRootPooledCache(root, root.pendingLanes), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); + previousPriority = root.pendingLanes; + 0 === previousPriority && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + finishedWork = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + var didError = 128 === (finishedWork.current.flags & 128); + switch (rootHasLayoutEffect) { + 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, + finishedWork, + schedulerPriority, + didError + ); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + error$jscomp$0( + "React instrumentation encountered an error: %s", + err + )); + } isDevToolsPresent && root.memoizedUpdaters.clear(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), + if (null !== recoverableErrors) { + didError = ReactSharedInternals.T; + schedulerPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) { + var recoverableError = recoverableErrors[finishedWork], + errorInfo = makeErrorInfo(recoverableError.stack); runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo ); + } + } finally { + (ReactSharedInternals.T = didError), + (currentUpdatePriority = schedulerPriority); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + previousPriority = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -13315,7 +13332,6 @@ __DEV__ && : (nestedUpdateCount = 0); flushSyncWorkAcrossRoots_impl(0, !1); enableSchedulingProfiler && markCommitStopped(); - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -14262,11 +14278,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -14279,7 +14291,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -16666,10 +16677,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-www-modern-0de1233f-20250102", + version: "19.1.0-www-modern-220dece9-20250102", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-modern-220dece9-20250102" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -16703,7 +16714,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; - exports.version = "19.1.0-www-modern-0de1233f-20250102"; + exports.version = "19.1.0-www-modern-220dece9-20250102"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js index cf971762bb009..cde6ac92e894b 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -498,17 +498,6 @@ var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, 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) @@ -578,14 +567,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -595,29 +583,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -1383,7 +1371,8 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root, - root === workInProgressRoot ? JSCompiler_inline_result : 0 + root === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root, JSCompiler_inline_result) || @@ -1440,7 +1429,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -1497,7 +1487,8 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -7287,6 +7278,7 @@ var offscreenSubtreeIsHidden = !1, shouldFireAfterActiveInstanceBlur = !1; function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = null; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -7389,10 +7381,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = root.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -9271,8 +9260,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -9285,7 +9272,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -9317,12 +9304,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { lanes, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - renderWasConcurrent, - 0, - -0, - 0 + workInProgressSuspendedRetryLanes ); } } @@ -9339,38 +9321,23 @@ function commitRootWhenReady( lanes, spawnedLane, updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - lanes = finishedWork.subtreeFlags; - (lanes & 8192 || 16785408 === (lanes & 16785408)) && + root.timeoutHandle = -1; + var subtreeFlags = finishedWork.subtreeFlags; + (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); - finishedWork = ReactSharedInternals.T; - lanes = currentUpdatePriority; - try { - (currentUpdatePriority = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = finishedWork), (currentUpdatePriority = lanes); - } + commitRoot( + root, + finishedWork, + lanes, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -9462,8 +9429,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -9940,102 +9905,168 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { workInProgressRootExitStatus = 6; workInProgress = null; } -function commitRootImpl( +function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - renderPriorityLevel, spawnedLane, updatedLanes, suspendedRetryLanes ) { + root.cancelPendingCommit = null; do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; + if (null !== finishedWork) { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = currentUpdatePriority; + currentUpdatePriority = 2; + updatedLanes = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (currentUpdatePriority = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ); + } +} +function flushMutationEffects(root, finishedWork) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; +} +function flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate +) { + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); 0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (updatedLanes = currentUpdatePriority), - (currentUpdatePriority = 2), - (suspendedRetryLanes = executionContext), - (executionContext |= 4), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffectsOnFiber(finishedWork, root), - (root.current = finishedWork), - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), - requestPaint(), - (executionContext = suspendedRetryLanes), - (currentUpdatePriority = updatedLanes), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + : releaseRootPooledCache(root, root.pendingLanes); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && (legacyErrorBoundariesThatAlreadyFailed = null); + lanesToEventPriority(lanes); + finishedWork = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + injectedHook.onCommitFiberRoot( + rendererID, + finishedWork, + void 0, + 128 === (finishedWork.current.flags & 128) + ); + } catch (err) {} + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = currentUpdatePriority; + currentUpdatePriority = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (currentUpdatePriority = rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + rootHasLayoutEffect = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) : (nestedUpdateCount = 0); flushSyncWorkAcrossRoots_impl(0, !1); - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -10556,11 +10587,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -10573,7 +10600,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -10785,24 +10811,24 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component); -var internals$jscomp$inline_1507 = { +var internals$jscomp$inline_1510 = { bundleType: 0, - version: "19.1.0-www-classic-0de1233f-20250102", + version: "19.1.0-www-classic-220dece9-20250102", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-classic-220dece9-20250102" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1508 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1511 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1508.isDisabled && - hook$jscomp$inline_1508.supportsFiber + !hook$jscomp$inline_1511.isDisabled && + hook$jscomp$inline_1511.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1508.inject( - internals$jscomp$inline_1507 + (rendererID = hook$jscomp$inline_1511.inject( + internals$jscomp$inline_1510 )), - (injectedHook = hook$jscomp$inline_1508); + (injectedHook = hook$jscomp$inline_1511); } catch (err) {} } var Path = Mode$1.Path; @@ -10816,4 +10842,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; -exports.version = "19.1.0-www-classic-0de1233f-20250102"; +exports.version = "19.1.0-www-classic-220dece9-20250102"; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index da5f97047f793..6ae61dc031804 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -419,17 +419,6 @@ var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, 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) @@ -499,14 +488,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -516,29 +504,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -1230,7 +1218,8 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root, - root === workInProgressRoot ? JSCompiler_inline_result : 0 + root === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root, JSCompiler_inline_result) || @@ -1287,7 +1276,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -1344,7 +1334,8 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -7047,6 +7038,7 @@ var offscreenSubtreeIsHidden = !1, shouldFireAfterActiveInstanceBlur = !1; function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = null; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -7149,10 +7141,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = root.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -9031,8 +9020,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -9045,7 +9032,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -9077,12 +9064,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { lanes, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - renderWasConcurrent, - 0, - -0, - 0 + workInProgressSuspendedRetryLanes ); } } @@ -9099,38 +9081,23 @@ function commitRootWhenReady( lanes, spawnedLane, updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - lanes = finishedWork.subtreeFlags; - (lanes & 8192 || 16785408 === (lanes & 16785408)) && + root.timeoutHandle = -1; + var subtreeFlags = finishedWork.subtreeFlags; + (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); - finishedWork = ReactSharedInternals.T; - lanes = currentUpdatePriority; - try { - (currentUpdatePriority = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = finishedWork), (currentUpdatePriority = lanes); - } + commitRoot( + root, + finishedWork, + lanes, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -9222,8 +9189,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -9696,102 +9661,168 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { workInProgressRootExitStatus = 6; workInProgress = null; } -function commitRootImpl( +function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - renderPriorityLevel, spawnedLane, updatedLanes, suspendedRetryLanes ) { + root.cancelPendingCommit = null; do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; + if (null !== finishedWork) { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = currentUpdatePriority; + currentUpdatePriority = 2; + updatedLanes = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (currentUpdatePriority = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ); + } +} +function flushMutationEffects(root, finishedWork) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; +} +function flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate +) { + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); 0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (updatedLanes = currentUpdatePriority), - (currentUpdatePriority = 2), - (suspendedRetryLanes = executionContext), - (executionContext |= 4), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffectsOnFiber(finishedWork, root), - (root.current = finishedWork), - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), - requestPaint(), - (executionContext = suspendedRetryLanes), - (currentUpdatePriority = updatedLanes), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + : releaseRootPooledCache(root, root.pendingLanes); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && (legacyErrorBoundariesThatAlreadyFailed = null); + lanesToEventPriority(lanes); + finishedWork = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + injectedHook.onCommitFiberRoot( + rendererID, + finishedWork, + void 0, + 128 === (finishedWork.current.flags & 128) + ); + } catch (err) {} + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = currentUpdatePriority; + currentUpdatePriority = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (currentUpdatePriority = rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + rootHasLayoutEffect = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) : (nestedUpdateCount = 0); flushSyncWorkAcrossRoots_impl(0, !1); - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -10312,11 +10343,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -10329,7 +10356,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -10501,24 +10527,24 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component); -var internals$jscomp$inline_1486 = { +var internals$jscomp$inline_1489 = { bundleType: 0, - version: "19.1.0-www-modern-0de1233f-20250102", + version: "19.1.0-www-modern-220dece9-20250102", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-modern-220dece9-20250102" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1487 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1490 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1487.isDisabled && - hook$jscomp$inline_1487.supportsFiber + !hook$jscomp$inline_1490.isDisabled && + hook$jscomp$inline_1490.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1487.inject( - internals$jscomp$inline_1486 + (rendererID = hook$jscomp$inline_1490.inject( + internals$jscomp$inline_1489 )), - (injectedHook = hook$jscomp$inline_1487); + (injectedHook = hook$jscomp$inline_1490); } catch (err) {} } var Path = Mode$1.Path; @@ -10532,4 +10558,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; -exports.version = "19.1.0-www-modern-0de1233f-20250102"; +exports.version = "19.1.0-www-modern-220dece9-20250102"; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index 09dedd59bf4f4..7054c3c65379a 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -1007,14 +1007,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -1024,29 +1023,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -4114,7 +4114,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -4183,7 +4185,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -4248,7 +4251,10 @@ __DEV__ && workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -9533,32 +9539,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2490; - var JSCompiler_object_inline_stack_2491 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2519; + var JSCompiler_object_inline_stack_2520 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2492 = !1; + var JSCompiler_object_inline_componentStack_2521 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2490 = didSuspend) || - (JSCompiler_object_inline_digest_2490 = + (JSCompiler_object_inline_digest_2519 = didSuspend) || + (JSCompiler_object_inline_digest_2519 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2490 && - ((JSCompiler_object_inline_componentStack_2492 = !0), + JSCompiler_object_inline_digest_2519 && + ((JSCompiler_object_inline_componentStack_2521 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2490 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2519 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2492 + JSCompiler_object_inline_componentStack_2521 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2489 = nextHydratableInstance; + var JSCompiler_object_inline_message_2518 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2489)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2518)) { c: { - var instance = JSCompiler_object_inline_message_2489; + var instance = JSCompiler_object_inline_message_2518; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9600,46 +9606,46 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2489 + JSCompiler_object_inline_message_2518 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2489 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2518 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2489 && - ((JSCompiler_object_inline_message_2489 = - JSCompiler_object_inline_message_2489.dehydrated), - null !== JSCompiler_object_inline_message_2489) + null !== JSCompiler_object_inline_message_2518 && + ((JSCompiler_object_inline_message_2518 = + JSCompiler_object_inline_message_2518.dehydrated), + null !== JSCompiler_object_inline_message_2518) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2489) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2518) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2489 = - JSCompiler_object_inline_stack_2491.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2491.fallback; - if (JSCompiler_object_inline_componentStack_2492) + JSCompiler_object_inline_message_2518 = + JSCompiler_object_inline_stack_2520.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2520.fallback; + if (JSCompiler_object_inline_componentStack_2521) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2491 = + (JSCompiler_object_inline_stack_2520 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2489, + JSCompiler_object_inline_message_2518, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2492 = + (JSCompiler_object_inline_componentStack_2521 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2492.memoizedState = + (JSCompiler_object_inline_componentStack_2521.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2492.childLanes = + (JSCompiler_object_inline_componentStack_2521.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2490, + JSCompiler_object_inline_digest_2519, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9652,9 +9658,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2492.updateQueue), + JSCompiler_object_inline_componentStack_2521.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2492.updateQueue = + ? (JSCompiler_object_inline_componentStack_2521.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -9662,46 +9668,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2491 + JSCompiler_object_inline_stack_2520 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2491.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2520.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2491 = + (JSCompiler_object_inline_stack_2520 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2489, + JSCompiler_object_inline_message_2518, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2492 = + (JSCompiler_object_inline_componentStack_2521 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2492.memoizedState = + (JSCompiler_object_inline_componentStack_2521.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2492.childLanes = + (JSCompiler_object_inline_componentStack_2521.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2490, + JSCompiler_object_inline_digest_2519, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2491 + JSCompiler_object_inline_stack_2520 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2489 + JSCompiler_object_inline_message_2518 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2489 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2489) + ((JSCompiler_object_inline_message_2518 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2518) ) { if (didSuspend) workInProgress.flags & 256 @@ -9718,94 +9724,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2492 = - JSCompiler_object_inline_stack_2491.fallback), - (JSCompiler_object_inline_message_2489 = workInProgress.mode), - (JSCompiler_object_inline_stack_2491 = + (JSCompiler_object_inline_componentStack_2521 = + JSCompiler_object_inline_stack_2520.fallback), + (JSCompiler_object_inline_message_2518 = workInProgress.mode), + (JSCompiler_object_inline_stack_2520 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2491.children + children: JSCompiler_object_inline_stack_2520.children }, - JSCompiler_object_inline_message_2489 + JSCompiler_object_inline_message_2518 )), - (JSCompiler_object_inline_componentStack_2492 = + (JSCompiler_object_inline_componentStack_2521 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2492, - JSCompiler_object_inline_message_2489, + JSCompiler_object_inline_componentStack_2521, + JSCompiler_object_inline_message_2518, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2492.flags |= 2), - (JSCompiler_object_inline_stack_2491.return = workInProgress), - (JSCompiler_object_inline_componentStack_2492.return = + (JSCompiler_object_inline_componentStack_2521.flags |= 2), + (JSCompiler_object_inline_stack_2520.return = workInProgress), + (JSCompiler_object_inline_componentStack_2521.return = workInProgress), - (JSCompiler_object_inline_stack_2491.sibling = - JSCompiler_object_inline_componentStack_2492), - (workInProgress.child = JSCompiler_object_inline_stack_2491), + (JSCompiler_object_inline_stack_2520.sibling = + JSCompiler_object_inline_componentStack_2521), + (workInProgress.child = JSCompiler_object_inline_stack_2520), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2491 = workInProgress.child), - (JSCompiler_object_inline_stack_2491.memoizedState = + (JSCompiler_object_inline_stack_2520 = workInProgress.child), + (JSCompiler_object_inline_stack_2520.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2491.childLanes = + (JSCompiler_object_inline_stack_2520.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2490, + JSCompiler_object_inline_digest_2519, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2492)); + JSCompiler_object_inline_componentStack_2521)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2489)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2518)) ) { - JSCompiler_object_inline_digest_2490 = - JSCompiler_object_inline_message_2489.nextSibling && - JSCompiler_object_inline_message_2489.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2490) { - JSCompiler_temp = JSCompiler_object_inline_digest_2490.dgst; - var message = JSCompiler_object_inline_digest_2490.msg; - instance = JSCompiler_object_inline_digest_2490.stck; - var componentStack = JSCompiler_object_inline_digest_2490.cstck; + JSCompiler_object_inline_digest_2519 = + JSCompiler_object_inline_message_2518.nextSibling && + JSCompiler_object_inline_message_2518.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2519) { + JSCompiler_temp = JSCompiler_object_inline_digest_2519.dgst; + var message = JSCompiler_object_inline_digest_2519.msg; + instance = JSCompiler_object_inline_digest_2519.stck; + var componentStack = JSCompiler_object_inline_digest_2519.cstck; } - JSCompiler_object_inline_message_2489 = message; - JSCompiler_object_inline_digest_2490 = JSCompiler_temp; - JSCompiler_object_inline_stack_2491 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2492 = + JSCompiler_object_inline_message_2518 = message; + JSCompiler_object_inline_digest_2519 = JSCompiler_temp; + JSCompiler_object_inline_stack_2520 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2521 = componentStack; - JSCompiler_object_inline_componentStack_2492 = - JSCompiler_object_inline_message_2489 - ? Error(JSCompiler_object_inline_message_2489) + JSCompiler_object_inline_componentStack_2521 = + JSCompiler_object_inline_message_2518 + ? Error(JSCompiler_object_inline_message_2518) : 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_2492.stack = - JSCompiler_object_inline_stack_2491 || ""; - JSCompiler_object_inline_componentStack_2492.digest = - JSCompiler_object_inline_digest_2490; - JSCompiler_object_inline_digest_2490 = + JSCompiler_object_inline_componentStack_2521.stack = + JSCompiler_object_inline_stack_2520 || ""; + JSCompiler_object_inline_componentStack_2521.digest = + JSCompiler_object_inline_digest_2519; + JSCompiler_object_inline_digest_2519 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2491 = { - value: JSCompiler_object_inline_componentStack_2492, + JSCompiler_object_inline_stack_2520 = { + value: JSCompiler_object_inline_componentStack_2521, source: null, - stack: JSCompiler_object_inline_digest_2490 + stack: JSCompiler_object_inline_digest_2519 }; - "string" === typeof JSCompiler_object_inline_digest_2490 && + "string" === typeof JSCompiler_object_inline_digest_2519 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2492, - JSCompiler_object_inline_stack_2491 + JSCompiler_object_inline_componentStack_2521, + JSCompiler_object_inline_stack_2520 ); - queueHydrationError(JSCompiler_object_inline_stack_2491); + queueHydrationError(JSCompiler_object_inline_stack_2520); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9819,44 +9825,44 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2490 = + (JSCompiler_object_inline_digest_2519 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2490) + didReceiveUpdate || JSCompiler_object_inline_digest_2519) ) { - JSCompiler_object_inline_digest_2490 = workInProgressRoot; + JSCompiler_object_inline_digest_2519 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_digest_2490 && - ((JSCompiler_object_inline_stack_2491 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2491 = - 0 !== (JSCompiler_object_inline_stack_2491 & 42) + null !== JSCompiler_object_inline_digest_2519 && + ((JSCompiler_object_inline_stack_2520 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2520 = + 0 !== (JSCompiler_object_inline_stack_2520 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2491 + JSCompiler_object_inline_stack_2520 )), - (JSCompiler_object_inline_stack_2491 = + (JSCompiler_object_inline_stack_2520 = 0 !== - (JSCompiler_object_inline_stack_2491 & - (JSCompiler_object_inline_digest_2490.suspendedLanes | + (JSCompiler_object_inline_stack_2520 & + (JSCompiler_object_inline_digest_2519.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2491), - 0 !== JSCompiler_object_inline_stack_2491 && - JSCompiler_object_inline_stack_2491 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2520), + 0 !== JSCompiler_object_inline_stack_2520 && + JSCompiler_object_inline_stack_2520 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2491), + ((prevState.retryLane = JSCompiler_object_inline_stack_2520), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2491 + JSCompiler_object_inline_stack_2520 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2490, + JSCompiler_object_inline_digest_2519, current, - JSCompiler_object_inline_stack_2491 + JSCompiler_object_inline_stack_2520 ), SelectiveHydrationException) ); - JSCompiler_object_inline_message_2489.data === + JSCompiler_object_inline_message_2518.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9864,14 +9870,14 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2489.data === + JSCompiler_object_inline_message_2518.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2489.nextSibling + JSCompiler_object_inline_message_2518.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9889,57 +9895,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2491.children + JSCompiler_object_inline_stack_2520.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2492) + if (JSCompiler_object_inline_componentStack_2521) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2492 = - JSCompiler_object_inline_stack_2491.fallback), - (JSCompiler_object_inline_message_2489 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2521 = + JSCompiler_object_inline_stack_2520.fallback), + (JSCompiler_object_inline_message_2518 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2491 = createWorkInProgress( + (JSCompiler_object_inline_stack_2520 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2491.children + children: JSCompiler_object_inline_stack_2520.children } )), - (JSCompiler_object_inline_stack_2491.subtreeFlags = + (JSCompiler_object_inline_stack_2520.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_componentStack_2492 = + ? (JSCompiler_object_inline_componentStack_2521 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2492 + JSCompiler_object_inline_componentStack_2521 )) - : ((JSCompiler_object_inline_componentStack_2492 = + : ((JSCompiler_object_inline_componentStack_2521 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2492, - JSCompiler_object_inline_message_2489, + JSCompiler_object_inline_componentStack_2521, + JSCompiler_object_inline_message_2518, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2492.flags |= 2)), - (JSCompiler_object_inline_componentStack_2492.return = + (JSCompiler_object_inline_componentStack_2521.flags |= 2)), + (JSCompiler_object_inline_componentStack_2521.return = workInProgress), - (JSCompiler_object_inline_stack_2491.return = workInProgress), - (JSCompiler_object_inline_stack_2491.sibling = - JSCompiler_object_inline_componentStack_2492), - (workInProgress.child = JSCompiler_object_inline_stack_2491), - (JSCompiler_object_inline_stack_2491 = - JSCompiler_object_inline_componentStack_2492), - (JSCompiler_object_inline_componentStack_2492 = workInProgress.child), - (JSCompiler_object_inline_message_2489 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2489 - ? (JSCompiler_object_inline_message_2489 = + (JSCompiler_object_inline_stack_2520.return = workInProgress), + (JSCompiler_object_inline_stack_2520.sibling = + JSCompiler_object_inline_componentStack_2521), + (workInProgress.child = JSCompiler_object_inline_stack_2520), + (JSCompiler_object_inline_stack_2520 = + JSCompiler_object_inline_componentStack_2521), + (JSCompiler_object_inline_componentStack_2521 = workInProgress.child), + (JSCompiler_object_inline_message_2518 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2518 + ? (JSCompiler_object_inline_message_2518 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2489.cachePool), + JSCompiler_object_inline_message_2518.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9947,34 +9953,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2489 = { + (JSCompiler_object_inline_message_2518 = { baseLanes: - JSCompiler_object_inline_message_2489.baseLanes | renderLanes, + JSCompiler_object_inline_message_2518.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2492.memoizedState = - JSCompiler_object_inline_message_2489), + (JSCompiler_object_inline_componentStack_2521.memoizedState = + JSCompiler_object_inline_message_2518), enableTransitionTracing && - ((JSCompiler_object_inline_message_2489 = enableTransitionTracing + ((JSCompiler_object_inline_message_2518 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2489 && + null !== JSCompiler_object_inline_message_2518 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2492.updateQueue), + JSCompiler_object_inline_componentStack_2521.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2492.updateQueue = { - transitions: JSCompiler_object_inline_message_2489, + ? (JSCompiler_object_inline_componentStack_2521.updateQueue = { + transitions: JSCompiler_object_inline_message_2518, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2492.updateQueue = + ? (JSCompiler_object_inline_componentStack_2521.updateQueue = { - transitions: JSCompiler_object_inline_message_2489, + transitions: JSCompiler_object_inline_message_2518, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9982,32 +9988,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2489), + JSCompiler_object_inline_message_2518), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2492.childLanes = + (JSCompiler_object_inline_componentStack_2521.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2490, + JSCompiler_object_inline_digest_2519, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2491 + JSCompiler_object_inline_stack_2520 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2491.children + children: JSCompiler_object_inline_stack_2520.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2490 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2490 + ((JSCompiler_object_inline_digest_2519 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2519 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2490.push(current)); + : JSCompiler_object_inline_digest_2519.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -12967,6 +12973,7 @@ __DEV__ && (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -13078,10 +13085,7 @@ __DEV__ && nextEffect = firstChild.return; } } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return firstChild; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -13818,12 +13822,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -15648,21 +15646,17 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( shouldTimeSlice, + forceSync, + lanes, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - exitStatus, - IMMEDIATE_COMMIT, - renderStartTime, - 0 + workInProgressSuspendedRetryLanes ); else { if ( @@ -15680,7 +15674,7 @@ __DEV__ && workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -15742,18 +15736,24 @@ __DEV__ && completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -15776,16 +15776,14 @@ __DEV__ && } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -15881,8 +15879,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -16518,179 +16514,303 @@ __DEV__ && } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { + root.cancelPendingCommit = 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.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + 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." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - 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." + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = Internals.p; + Internals.p = DiscreteEventPriority; + updatedLanes = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (Internals.p = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; + } + } + function flushMutationEffects(root, finishedWork, lanes) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; ReactSharedInternals.T = null; - updatedLanes = Internals.p; + var previousPriority = Internals.p; Internals.p = DiscreteEventPriority; - suspendedRetryLanes = executionContext; + var prevExecutionContext = executionContext; executionContext |= CommitContext; - var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && + try { + inProgressLanes = lanes; + inProgressRoot = root; + commitMutationEffectsOnFiber(finishedWork, root); + inProgressRoot = inProgressLanes = null; + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + lanes = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = lanes.focusedElem, + priorSelectionRange = lanes.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 = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.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.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.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for ( + selection = priorFocusedElem; + (selection = selection.parentNode); + + ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.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; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + } + function flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ) { + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), + : (releaseRootPooledCache(root, root.pendingLanes), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); + previousPriority = root.pendingLanes; + 0 === previousPriority && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot$1(finishedWork.stateNode, rootHasLayoutEffect); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority], + errorInfo = makeErrorInfo(recoverableError.stack); runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo ); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + previousPriority = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -16716,7 +16836,6 @@ __DEV__ && : (currentEndTime = endTime); }); } - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -17664,11 +17783,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -17681,7 +17796,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -18358,100 +18472,6 @@ __DEV__ && "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, @@ -21747,11 +21767,6 @@ __DEV__ && event.initEvent(type, bubbles, !1); return event; } - function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); - } function removeChild(parentInstance, child) { parentInstance.removeChild(child); } @@ -27386,11 +27401,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-www-classic-0de1233f-20250102" !== isomorphicReactPackageVersion) + if ("19.1.0-www-classic-220dece9-20250102" !== 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.1.0-www-classic-0de1233f-20250102\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-www-classic-220dece9-20250102\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27433,10 +27448,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-www-classic-0de1233f-20250102", + version: "19.1.0-www-classic-220dece9-20250102", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-classic-220dece9-20250102" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -28034,7 +28049,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-www-classic-0de1233f-20250102"; + exports.version = "19.1.0-www-classic-220dece9-20250102"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index c5ac70ee306b6..9b238ee80af86 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -1007,14 +1007,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -1024,29 +1023,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -4001,7 +4001,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -4070,7 +4072,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -4135,7 +4138,10 @@ __DEV__ && workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -9345,32 +9351,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2482; - var JSCompiler_object_inline_stack_2483 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2511; + var JSCompiler_object_inline_stack_2512 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2484 = !1; + var JSCompiler_object_inline_componentStack_2513 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2482 = didSuspend) || - (JSCompiler_object_inline_digest_2482 = + (JSCompiler_object_inline_digest_2511 = didSuspend) || + (JSCompiler_object_inline_digest_2511 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2482 && - ((JSCompiler_object_inline_componentStack_2484 = !0), + JSCompiler_object_inline_digest_2511 && + ((JSCompiler_object_inline_componentStack_2513 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2482 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2511 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2484 + JSCompiler_object_inline_componentStack_2513 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2481 = nextHydratableInstance; + var JSCompiler_object_inline_message_2510 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2481)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2510)) { c: { - var instance = JSCompiler_object_inline_message_2481; + var instance = JSCompiler_object_inline_message_2510; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9412,46 +9418,46 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2481 + JSCompiler_object_inline_message_2510 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2481 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2510 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2481 && - ((JSCompiler_object_inline_message_2481 = - JSCompiler_object_inline_message_2481.dehydrated), - null !== JSCompiler_object_inline_message_2481) + null !== JSCompiler_object_inline_message_2510 && + ((JSCompiler_object_inline_message_2510 = + JSCompiler_object_inline_message_2510.dehydrated), + null !== JSCompiler_object_inline_message_2510) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2481) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2510) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2481 = - JSCompiler_object_inline_stack_2483.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2483.fallback; - if (JSCompiler_object_inline_componentStack_2484) + JSCompiler_object_inline_message_2510 = + JSCompiler_object_inline_stack_2512.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2512.fallback; + if (JSCompiler_object_inline_componentStack_2513) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2483 = + (JSCompiler_object_inline_stack_2512 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2481, + JSCompiler_object_inline_message_2510, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2484 = + (JSCompiler_object_inline_componentStack_2513 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2484.memoizedState = + (JSCompiler_object_inline_componentStack_2513.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2484.childLanes = + (JSCompiler_object_inline_componentStack_2513.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2482, + JSCompiler_object_inline_digest_2511, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9464,9 +9470,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2484.updateQueue), + JSCompiler_object_inline_componentStack_2513.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2484.updateQueue = + ? (JSCompiler_object_inline_componentStack_2513.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -9474,46 +9480,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2483 + JSCompiler_object_inline_stack_2512 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2483.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2512.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2483 = + (JSCompiler_object_inline_stack_2512 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2481, + JSCompiler_object_inline_message_2510, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2484 = + (JSCompiler_object_inline_componentStack_2513 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2484.memoizedState = + (JSCompiler_object_inline_componentStack_2513.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2484.childLanes = + (JSCompiler_object_inline_componentStack_2513.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2482, + JSCompiler_object_inline_digest_2511, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2483 + JSCompiler_object_inline_stack_2512 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2481 + JSCompiler_object_inline_message_2510 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2481 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2481) + ((JSCompiler_object_inline_message_2510 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2510) ) { if (didSuspend) workInProgress.flags & 256 @@ -9530,94 +9536,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2484 = - JSCompiler_object_inline_stack_2483.fallback), - (JSCompiler_object_inline_message_2481 = workInProgress.mode), - (JSCompiler_object_inline_stack_2483 = + (JSCompiler_object_inline_componentStack_2513 = + JSCompiler_object_inline_stack_2512.fallback), + (JSCompiler_object_inline_message_2510 = workInProgress.mode), + (JSCompiler_object_inline_stack_2512 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2483.children + children: JSCompiler_object_inline_stack_2512.children }, - JSCompiler_object_inline_message_2481 + JSCompiler_object_inline_message_2510 )), - (JSCompiler_object_inline_componentStack_2484 = + (JSCompiler_object_inline_componentStack_2513 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2484, - JSCompiler_object_inline_message_2481, + JSCompiler_object_inline_componentStack_2513, + JSCompiler_object_inline_message_2510, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2484.flags |= 2), - (JSCompiler_object_inline_stack_2483.return = workInProgress), - (JSCompiler_object_inline_componentStack_2484.return = + (JSCompiler_object_inline_componentStack_2513.flags |= 2), + (JSCompiler_object_inline_stack_2512.return = workInProgress), + (JSCompiler_object_inline_componentStack_2513.return = workInProgress), - (JSCompiler_object_inline_stack_2483.sibling = - JSCompiler_object_inline_componentStack_2484), - (workInProgress.child = JSCompiler_object_inline_stack_2483), + (JSCompiler_object_inline_stack_2512.sibling = + JSCompiler_object_inline_componentStack_2513), + (workInProgress.child = JSCompiler_object_inline_stack_2512), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2483 = workInProgress.child), - (JSCompiler_object_inline_stack_2483.memoizedState = + (JSCompiler_object_inline_stack_2512 = workInProgress.child), + (JSCompiler_object_inline_stack_2512.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2483.childLanes = + (JSCompiler_object_inline_stack_2512.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2482, + JSCompiler_object_inline_digest_2511, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2484)); + JSCompiler_object_inline_componentStack_2513)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2481)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2510)) ) { - JSCompiler_object_inline_digest_2482 = - JSCompiler_object_inline_message_2481.nextSibling && - JSCompiler_object_inline_message_2481.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2482) { - JSCompiler_temp = JSCompiler_object_inline_digest_2482.dgst; - var message = JSCompiler_object_inline_digest_2482.msg; - instance = JSCompiler_object_inline_digest_2482.stck; - var componentStack = JSCompiler_object_inline_digest_2482.cstck; + JSCompiler_object_inline_digest_2511 = + JSCompiler_object_inline_message_2510.nextSibling && + JSCompiler_object_inline_message_2510.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2511) { + JSCompiler_temp = JSCompiler_object_inline_digest_2511.dgst; + var message = JSCompiler_object_inline_digest_2511.msg; + instance = JSCompiler_object_inline_digest_2511.stck; + var componentStack = JSCompiler_object_inline_digest_2511.cstck; } - JSCompiler_object_inline_message_2481 = message; - JSCompiler_object_inline_digest_2482 = JSCompiler_temp; - JSCompiler_object_inline_stack_2483 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2484 = + JSCompiler_object_inline_message_2510 = message; + JSCompiler_object_inline_digest_2511 = JSCompiler_temp; + JSCompiler_object_inline_stack_2512 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2513 = componentStack; - JSCompiler_object_inline_componentStack_2484 = - JSCompiler_object_inline_message_2481 - ? Error(JSCompiler_object_inline_message_2481) + JSCompiler_object_inline_componentStack_2513 = + JSCompiler_object_inline_message_2510 + ? Error(JSCompiler_object_inline_message_2510) : 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_2484.stack = - JSCompiler_object_inline_stack_2483 || ""; - JSCompiler_object_inline_componentStack_2484.digest = - JSCompiler_object_inline_digest_2482; - JSCompiler_object_inline_digest_2482 = + JSCompiler_object_inline_componentStack_2513.stack = + JSCompiler_object_inline_stack_2512 || ""; + JSCompiler_object_inline_componentStack_2513.digest = + JSCompiler_object_inline_digest_2511; + JSCompiler_object_inline_digest_2511 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2483 = { - value: JSCompiler_object_inline_componentStack_2484, + JSCompiler_object_inline_stack_2512 = { + value: JSCompiler_object_inline_componentStack_2513, source: null, - stack: JSCompiler_object_inline_digest_2482 + stack: JSCompiler_object_inline_digest_2511 }; - "string" === typeof JSCompiler_object_inline_digest_2482 && + "string" === typeof JSCompiler_object_inline_digest_2511 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2484, - JSCompiler_object_inline_stack_2483 + JSCompiler_object_inline_componentStack_2513, + JSCompiler_object_inline_stack_2512 ); - queueHydrationError(JSCompiler_object_inline_stack_2483); + queueHydrationError(JSCompiler_object_inline_stack_2512); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9631,44 +9637,44 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2482 = + (JSCompiler_object_inline_digest_2511 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2482) + didReceiveUpdate || JSCompiler_object_inline_digest_2511) ) { - JSCompiler_object_inline_digest_2482 = workInProgressRoot; + JSCompiler_object_inline_digest_2511 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_digest_2482 && - ((JSCompiler_object_inline_stack_2483 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2483 = - 0 !== (JSCompiler_object_inline_stack_2483 & 42) + null !== JSCompiler_object_inline_digest_2511 && + ((JSCompiler_object_inline_stack_2512 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2512 = + 0 !== (JSCompiler_object_inline_stack_2512 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2483 + JSCompiler_object_inline_stack_2512 )), - (JSCompiler_object_inline_stack_2483 = + (JSCompiler_object_inline_stack_2512 = 0 !== - (JSCompiler_object_inline_stack_2483 & - (JSCompiler_object_inline_digest_2482.suspendedLanes | + (JSCompiler_object_inline_stack_2512 & + (JSCompiler_object_inline_digest_2511.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2483), - 0 !== JSCompiler_object_inline_stack_2483 && - JSCompiler_object_inline_stack_2483 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2512), + 0 !== JSCompiler_object_inline_stack_2512 && + JSCompiler_object_inline_stack_2512 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2483), + ((prevState.retryLane = JSCompiler_object_inline_stack_2512), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2483 + JSCompiler_object_inline_stack_2512 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2482, + JSCompiler_object_inline_digest_2511, current, - JSCompiler_object_inline_stack_2483 + JSCompiler_object_inline_stack_2512 ), SelectiveHydrationException) ); - JSCompiler_object_inline_message_2481.data === + JSCompiler_object_inline_message_2510.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9676,14 +9682,14 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2481.data === + JSCompiler_object_inline_message_2510.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2481.nextSibling + JSCompiler_object_inline_message_2510.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9701,57 +9707,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2483.children + JSCompiler_object_inline_stack_2512.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2484) + if (JSCompiler_object_inline_componentStack_2513) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2484 = - JSCompiler_object_inline_stack_2483.fallback), - (JSCompiler_object_inline_message_2481 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2513 = + JSCompiler_object_inline_stack_2512.fallback), + (JSCompiler_object_inline_message_2510 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2483 = createWorkInProgress( + (JSCompiler_object_inline_stack_2512 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2483.children + children: JSCompiler_object_inline_stack_2512.children } )), - (JSCompiler_object_inline_stack_2483.subtreeFlags = + (JSCompiler_object_inline_stack_2512.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_componentStack_2484 = + ? (JSCompiler_object_inline_componentStack_2513 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2484 + JSCompiler_object_inline_componentStack_2513 )) - : ((JSCompiler_object_inline_componentStack_2484 = + : ((JSCompiler_object_inline_componentStack_2513 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2484, - JSCompiler_object_inline_message_2481, + JSCompiler_object_inline_componentStack_2513, + JSCompiler_object_inline_message_2510, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2484.flags |= 2)), - (JSCompiler_object_inline_componentStack_2484.return = + (JSCompiler_object_inline_componentStack_2513.flags |= 2)), + (JSCompiler_object_inline_componentStack_2513.return = workInProgress), - (JSCompiler_object_inline_stack_2483.return = workInProgress), - (JSCompiler_object_inline_stack_2483.sibling = - JSCompiler_object_inline_componentStack_2484), - (workInProgress.child = JSCompiler_object_inline_stack_2483), - (JSCompiler_object_inline_stack_2483 = - JSCompiler_object_inline_componentStack_2484), - (JSCompiler_object_inline_componentStack_2484 = workInProgress.child), - (JSCompiler_object_inline_message_2481 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2481 - ? (JSCompiler_object_inline_message_2481 = + (JSCompiler_object_inline_stack_2512.return = workInProgress), + (JSCompiler_object_inline_stack_2512.sibling = + JSCompiler_object_inline_componentStack_2513), + (workInProgress.child = JSCompiler_object_inline_stack_2512), + (JSCompiler_object_inline_stack_2512 = + JSCompiler_object_inline_componentStack_2513), + (JSCompiler_object_inline_componentStack_2513 = workInProgress.child), + (JSCompiler_object_inline_message_2510 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2510 + ? (JSCompiler_object_inline_message_2510 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2481.cachePool), + JSCompiler_object_inline_message_2510.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9759,34 +9765,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2481 = { + (JSCompiler_object_inline_message_2510 = { baseLanes: - JSCompiler_object_inline_message_2481.baseLanes | renderLanes, + JSCompiler_object_inline_message_2510.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2484.memoizedState = - JSCompiler_object_inline_message_2481), + (JSCompiler_object_inline_componentStack_2513.memoizedState = + JSCompiler_object_inline_message_2510), enableTransitionTracing && - ((JSCompiler_object_inline_message_2481 = enableTransitionTracing + ((JSCompiler_object_inline_message_2510 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2481 && + null !== JSCompiler_object_inline_message_2510 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2484.updateQueue), + JSCompiler_object_inline_componentStack_2513.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2484.updateQueue = { - transitions: JSCompiler_object_inline_message_2481, + ? (JSCompiler_object_inline_componentStack_2513.updateQueue = { + transitions: JSCompiler_object_inline_message_2510, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2484.updateQueue = + ? (JSCompiler_object_inline_componentStack_2513.updateQueue = { - transitions: JSCompiler_object_inline_message_2481, + transitions: JSCompiler_object_inline_message_2510, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9794,32 +9800,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2481), + JSCompiler_object_inline_message_2510), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2484.childLanes = + (JSCompiler_object_inline_componentStack_2513.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2482, + JSCompiler_object_inline_digest_2511, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2483 + JSCompiler_object_inline_stack_2512 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2483.children + children: JSCompiler_object_inline_stack_2512.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2482 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2482 + ((JSCompiler_object_inline_digest_2511 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2511 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2482.push(current)); + : JSCompiler_object_inline_digest_2511.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -12766,6 +12772,7 @@ __DEV__ && (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -12877,10 +12884,7 @@ __DEV__ && nextEffect = firstChild.return; } } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return firstChild; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -13617,12 +13621,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -15447,21 +15445,17 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( shouldTimeSlice, + forceSync, + lanes, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - exitStatus, - IMMEDIATE_COMMIT, - renderStartTime, - 0 + workInProgressSuspendedRetryLanes ); else { if ( @@ -15479,7 +15473,7 @@ __DEV__ && workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -15541,18 +15535,24 @@ __DEV__ && completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -15575,16 +15575,14 @@ __DEV__ && } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -15680,8 +15678,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -16313,179 +16309,303 @@ __DEV__ && } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { + root.cancelPendingCommit = 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.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + 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." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - 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." + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = Internals.p; + Internals.p = DiscreteEventPriority; + updatedLanes = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (Internals.p = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; + } + } + function flushMutationEffects(root, finishedWork, lanes) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; ReactSharedInternals.T = null; - updatedLanes = Internals.p; + var previousPriority = Internals.p; Internals.p = DiscreteEventPriority; - suspendedRetryLanes = executionContext; + var prevExecutionContext = executionContext; executionContext |= CommitContext; - var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && + try { + inProgressLanes = lanes; + inProgressRoot = root; + commitMutationEffectsOnFiber(finishedWork, root); + inProgressRoot = inProgressLanes = null; + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + lanes = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = lanes.focusedElem, + priorSelectionRange = lanes.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 = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.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.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.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for ( + selection = priorFocusedElem; + (selection = selection.parentNode); + + ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.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; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + } + function flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ) { + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), + : (releaseRootPooledCache(root, root.pendingLanes), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); + previousPriority = root.pendingLanes; + 0 === previousPriority && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot$1(finishedWork.stateNode, rootHasLayoutEffect); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority], + errorInfo = makeErrorInfo(recoverableError.stack); runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo ); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + previousPriority = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -16511,7 +16631,6 @@ __DEV__ && : (currentEndTime = endTime); }); } - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -17459,11 +17578,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -17476,7 +17591,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -18149,100 +18263,6 @@ __DEV__ && "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, @@ -21534,11 +21554,6 @@ __DEV__ && event.initEvent(type, bubbles, !1); return event; } - function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); - } function removeChild(parentInstance, child) { parentInstance.removeChild(child); } @@ -27165,11 +27180,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-www-modern-0de1233f-20250102" !== isomorphicReactPackageVersion) + if ("19.1.0-www-modern-220dece9-20250102" !== 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.1.0-www-modern-0de1233f-20250102\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-www-modern-220dece9-20250102\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27212,10 +27227,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-www-modern-0de1233f-20250102", + version: "19.1.0-www-modern-220dece9-20250102", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-modern-220dece9-20250102" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27813,7 +27828,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-www-modern-0de1233f-20250102"; + exports.version = "19.1.0-www-modern-220dece9-20250102"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index c5fe714d81fe7..5b3a6c86cb6ae 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -626,14 +626,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -643,29 +642,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2166,7 +2165,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root$27, - root$27 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$27 === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root$27.cancelPendingCommit || + -1 !== root$27.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$27, JSCompiler_inline_result) || @@ -2232,7 +2233,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2289,7 +2291,8 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -8767,6 +8770,7 @@ function commitBeforeMutationEffects(root, firstChild) { (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -8898,10 +8902,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -11137,8 +11138,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -11151,7 +11150,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -11212,18 +11211,24 @@ function commitRootWhenReady( completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = -1; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -11241,16 +11246,14 @@ function commitRootWhenReady( } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -11343,8 +11346,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -11819,141 +11820,253 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); + root.cancelPendingCommit = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); + if (null !== finishedWork) { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = Internals.p; + Internals.p = 2; + updatedLanes = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (Internals.p = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ); } } -function commitRootImpl( +function flushMutationEffects(root, finishedWork) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root); + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + target = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = target.focusedElem, + priorSelectionRange = target.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 = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.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.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.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for (selection = priorFocusedElem; (selection = selection.parentNode); ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.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; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; +} +function flushLayoutEffects( root, + finishedWork, + lanes, recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes + didIncludeRenderPhaseUpdate ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; ReactSharedInternals.T = null; - updatedLanes = Internals.p; + var previousPriority = Internals.p; Internals.p = 2; - suspendedRetryLanes = executionContext; + var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$196 = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$196 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + : releaseRootPooledCache(root, root.pendingLanes); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + rootHasLayoutEffect = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) @@ -11976,7 +12089,6 @@ function commitRootImpl( : (currentEndTime = endTime); }); } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -12506,11 +12618,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -12523,7 +12631,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -13238,14 +13345,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$352; if (canUseDOM) { - var isSupported$jscomp$inline_1556 = "oninput" in document; - if (!isSupported$jscomp$inline_1556) { - var element$jscomp$inline_1557 = document.createElement("div"); - element$jscomp$inline_1557.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1556 = - "function" === typeof element$jscomp$inline_1557.oninput; + var isSupported$jscomp$inline_1568 = "oninput" in document; + if (!isSupported$jscomp$inline_1568) { + var element$jscomp$inline_1569 = document.createElement("div"); + element$jscomp$inline_1569.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1568 = + "function" === typeof element$jscomp$inline_1569.oninput; } - JSCompiler_inline_result$jscomp$352 = isSupported$jscomp$inline_1556; + JSCompiler_inline_result$jscomp$352 = isSupported$jscomp$inline_1568; } else JSCompiler_inline_result$jscomp$352 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$352 && @@ -13374,97 +13481,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, @@ -13659,20 +13675,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1597 = 0; - i$jscomp$inline_1597 < simpleEventPluginEvents.length; - i$jscomp$inline_1597++ + var i$jscomp$inline_1609 = 0; + i$jscomp$inline_1609 < simpleEventPluginEvents.length; + i$jscomp$inline_1609++ ) { - var eventName$jscomp$inline_1598 = - simpleEventPluginEvents[i$jscomp$inline_1597], - domEventName$jscomp$inline_1599 = - eventName$jscomp$inline_1598.toLowerCase(), - capitalizedEvent$jscomp$inline_1600 = - eventName$jscomp$inline_1598[0].toUpperCase() + - eventName$jscomp$inline_1598.slice(1); + var eventName$jscomp$inline_1610 = + simpleEventPluginEvents[i$jscomp$inline_1609], + domEventName$jscomp$inline_1611 = + eventName$jscomp$inline_1610.toLowerCase(), + capitalizedEvent$jscomp$inline_1612 = + eventName$jscomp$inline_1610[0].toUpperCase() + + eventName$jscomp$inline_1610.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1599, - "on" + capitalizedEvent$jscomp$inline_1600 + domEventName$jscomp$inline_1611, + "on" + capitalizedEvent$jscomp$inline_1612 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15573,11 +15589,6 @@ function createEvent(type, bubbles) { event.initEvent(type, bubbles, !1); return event; } -function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); -} function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -17255,16 +17266,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1770 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1782 = React.version; if ( - "19.1.0-www-classic-0de1233f-20250102" !== - isomorphicReactPackageVersion$jscomp$inline_1770 + "19.1.0-www-classic-220dece9-20250102" !== + isomorphicReactPackageVersion$jscomp$inline_1782 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1770, - "19.1.0-www-classic-0de1233f-20250102" + isomorphicReactPackageVersion$jscomp$inline_1782, + "19.1.0-www-classic-220dece9-20250102" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17280,24 +17291,24 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2307 = { +var internals$jscomp$inline_2317 = { bundleType: 0, - version: "19.1.0-www-classic-0de1233f-20250102", + version: "19.1.0-www-classic-220dece9-20250102", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-classic-220dece9-20250102" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2308 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2318 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2308.isDisabled && - hook$jscomp$inline_2308.supportsFiber + !hook$jscomp$inline_2318.isDisabled && + hook$jscomp$inline_2318.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2308.inject( - internals$jscomp$inline_2307 + (rendererID = hook$jscomp$inline_2318.inject( + internals$jscomp$inline_2317 )), - (injectedHook = hook$jscomp$inline_2308); + (injectedHook = hook$jscomp$inline_2318); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17650,4 +17661,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-classic-0de1233f-20250102"; +exports.version = "19.1.0-www-classic-220dece9-20250102"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 1ab7047d98434..ac22a80af7fda 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -561,14 +561,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -578,29 +577,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2017,7 +2016,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root$27, - root$27 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$27 === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root$27.cancelPendingCommit || + -1 !== root$27.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$27, JSCompiler_inline_result) || @@ -2083,7 +2084,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2140,7 +2142,8 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -8518,6 +8521,7 @@ function commitBeforeMutationEffects(root, firstChild) { (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -8649,10 +8653,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -10888,8 +10889,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -10902,7 +10901,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -10963,18 +10962,24 @@ function commitRootWhenReady( completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = -1; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -10992,16 +10997,14 @@ function commitRootWhenReady( } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -11094,8 +11097,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -11566,141 +11567,253 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); + root.cancelPendingCommit = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); + if (null !== finishedWork) { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = Internals.p; + Internals.p = 2; + updatedLanes = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (Internals.p = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ); } } -function commitRootImpl( +function flushMutationEffects(root, finishedWork) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root); + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + target = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = target.focusedElem, + priorSelectionRange = target.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 = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.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.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.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for (selection = priorFocusedElem; (selection = selection.parentNode); ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.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; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; +} +function flushLayoutEffects( root, + finishedWork, + lanes, recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes + didIncludeRenderPhaseUpdate ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; ReactSharedInternals.T = null; - updatedLanes = Internals.p; + var previousPriority = Internals.p; Internals.p = 2; - suspendedRetryLanes = executionContext; + var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$196 = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$196 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + : releaseRootPooledCache(root, root.pendingLanes); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + rootHasLayoutEffect = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) @@ -11723,7 +11836,6 @@ function commitRootImpl( : (currentEndTime = endTime); }); } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -12253,11 +12365,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -12270,7 +12378,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -12974,14 +13081,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$355; if (canUseDOM) { - var isSupported$jscomp$inline_1546 = "oninput" in document; - if (!isSupported$jscomp$inline_1546) { - var element$jscomp$inline_1547 = document.createElement("div"); - element$jscomp$inline_1547.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1546 = - "function" === typeof element$jscomp$inline_1547.oninput; + var isSupported$jscomp$inline_1558 = "oninput" in document; + if (!isSupported$jscomp$inline_1558) { + var element$jscomp$inline_1559 = document.createElement("div"); + element$jscomp$inline_1559.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1558 = + "function" === typeof element$jscomp$inline_1559.oninput; } - JSCompiler_inline_result$jscomp$355 = isSupported$jscomp$inline_1546; + JSCompiler_inline_result$jscomp$355 = isSupported$jscomp$inline_1558; } else JSCompiler_inline_result$jscomp$355 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$355 && @@ -13110,97 +13217,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, @@ -13395,20 +13411,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1587 = 0; - i$jscomp$inline_1587 < simpleEventPluginEvents.length; - i$jscomp$inline_1587++ + var i$jscomp$inline_1599 = 0; + i$jscomp$inline_1599 < simpleEventPluginEvents.length; + i$jscomp$inline_1599++ ) { - var eventName$jscomp$inline_1588 = - simpleEventPluginEvents[i$jscomp$inline_1587], - domEventName$jscomp$inline_1589 = - eventName$jscomp$inline_1588.toLowerCase(), - capitalizedEvent$jscomp$inline_1590 = - eventName$jscomp$inline_1588[0].toUpperCase() + - eventName$jscomp$inline_1588.slice(1); + var eventName$jscomp$inline_1600 = + simpleEventPluginEvents[i$jscomp$inline_1599], + domEventName$jscomp$inline_1601 = + eventName$jscomp$inline_1600.toLowerCase(), + capitalizedEvent$jscomp$inline_1602 = + eventName$jscomp$inline_1600[0].toUpperCase() + + eventName$jscomp$inline_1600.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1589, - "on" + capitalizedEvent$jscomp$inline_1590 + domEventName$jscomp$inline_1601, + "on" + capitalizedEvent$jscomp$inline_1602 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15304,11 +15320,6 @@ function createEvent(type, bubbles) { event.initEvent(type, bubbles, !1); return event; } -function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); -} function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -16986,16 +16997,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1760 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1772 = React.version; if ( - "19.1.0-www-modern-0de1233f-20250102" !== - isomorphicReactPackageVersion$jscomp$inline_1760 + "19.1.0-www-modern-220dece9-20250102" !== + isomorphicReactPackageVersion$jscomp$inline_1772 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1760, - "19.1.0-www-modern-0de1233f-20250102" + isomorphicReactPackageVersion$jscomp$inline_1772, + "19.1.0-www-modern-220dece9-20250102" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17011,24 +17022,24 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2289 = { +var internals$jscomp$inline_2299 = { bundleType: 0, - version: "19.1.0-www-modern-0de1233f-20250102", + version: "19.1.0-www-modern-220dece9-20250102", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-modern-220dece9-20250102" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2290 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2300 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2290.isDisabled && - hook$jscomp$inline_2290.supportsFiber + !hook$jscomp$inline_2300.isDisabled && + hook$jscomp$inline_2300.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2290.inject( - internals$jscomp$inline_2289 + (rendererID = hook$jscomp$inline_2300.inject( + internals$jscomp$inline_2299 )), - (injectedHook = hook$jscomp$inline_2290); + (injectedHook = hook$jscomp$inline_2300); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17381,4 +17392,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-modern-0de1233f-20250102"; +exports.version = "19.1.0-www-modern-220dece9-20250102"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index eda66a8b11582..b7477ebb2fc93 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -707,14 +707,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -724,29 +723,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2331,7 +2330,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root$29, - root$29 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$29 === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root$29.cancelPendingCommit || + -1 !== root$29.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$29, JSCompiler_inline_result) || @@ -2397,7 +2398,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2455,7 +2457,8 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -9209,6 +9212,7 @@ function commitBeforeMutationEffects(root, firstChild) { (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -9340,10 +9344,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -9982,12 +9983,6 @@ function attachSuspenseRetryListeners(finishedWork, wakeables) { } }); } -function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; -} function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -11670,8 +11665,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -11684,7 +11677,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -11745,18 +11738,24 @@ function commitRootWhenReady( completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = -1; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -11774,16 +11773,14 @@ function commitRootWhenReady( } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -11876,8 +11873,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -12427,159 +12422,275 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime -) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } -} -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { + root.cancelPendingCommit = null; do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); - if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; + if (null === finishedWork) enableSchedulingProfiler && markCommitStopped(); + else { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = Internals.p; + Internals.p = 2; + updatedLanes = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (Internals.p = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ); + } +} +function flushMutationEffects(root, finishedWork, lanes) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; ReactSharedInternals.T = null; - updatedLanes = Internals.p; + var previousPriority = Internals.p; Internals.p = 2; - suspendedRetryLanes = executionContext; + var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$211 = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur$211 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && + try { + inProgressLanes = lanes; + inProgressRoot = root; + commitMutationEffectsOnFiber(finishedWork, root); + inProgressRoot = inProgressLanes = null; + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + lanes = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = lanes.focusedElem, + priorSelectionRange = lanes.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 = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.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.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.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for (selection = priorFocusedElem; (selection = selection.parentNode); ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.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; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; +} +function flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate +) { + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); + : releaseRootPooledCache(root, root.pendingLanes); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); isDevToolsPresent && root.memoizedUpdaters.clear(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + rootHasLayoutEffect = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -12604,7 +12715,6 @@ function commitRootImpl( : (currentEndTime = endTime); }); } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -13170,11 +13280,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -13187,7 +13293,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -13927,14 +14032,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$369; if (canUseDOM) { - var isSupported$jscomp$inline_1649 = "oninput" in document; - if (!isSupported$jscomp$inline_1649) { - var element$jscomp$inline_1650 = document.createElement("div"); - element$jscomp$inline_1650.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1649 = - "function" === typeof element$jscomp$inline_1650.oninput; + var isSupported$jscomp$inline_1665 = "oninput" in document; + if (!isSupported$jscomp$inline_1665) { + var element$jscomp$inline_1666 = document.createElement("div"); + element$jscomp$inline_1666.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1665 = + "function" === typeof element$jscomp$inline_1666.oninput; } - JSCompiler_inline_result$jscomp$369 = isSupported$jscomp$inline_1649; + JSCompiler_inline_result$jscomp$369 = isSupported$jscomp$inline_1665; } else JSCompiler_inline_result$jscomp$369 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$369 && @@ -14063,97 +14168,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, @@ -14348,20 +14362,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1690 = 0; - i$jscomp$inline_1690 < simpleEventPluginEvents.length; - i$jscomp$inline_1690++ + var i$jscomp$inline_1706 = 0; + i$jscomp$inline_1706 < simpleEventPluginEvents.length; + i$jscomp$inline_1706++ ) { - var eventName$jscomp$inline_1691 = - simpleEventPluginEvents[i$jscomp$inline_1690], - domEventName$jscomp$inline_1692 = - eventName$jscomp$inline_1691.toLowerCase(), - capitalizedEvent$jscomp$inline_1693 = - eventName$jscomp$inline_1691[0].toUpperCase() + - eventName$jscomp$inline_1691.slice(1); + var eventName$jscomp$inline_1707 = + simpleEventPluginEvents[i$jscomp$inline_1706], + domEventName$jscomp$inline_1708 = + eventName$jscomp$inline_1707.toLowerCase(), + capitalizedEvent$jscomp$inline_1709 = + eventName$jscomp$inline_1707[0].toUpperCase() + + eventName$jscomp$inline_1707.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1692, - "on" + capitalizedEvent$jscomp$inline_1693 + domEventName$jscomp$inline_1708, + "on" + capitalizedEvent$jscomp$inline_1709 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -16262,11 +16276,6 @@ function createEvent(type, bubbles) { event.initEvent(type, bubbles, !1); return event; } -function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); -} function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -17944,16 +17953,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1863 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1879 = React.version; if ( - "19.1.0-www-classic-0de1233f-20250102" !== - isomorphicReactPackageVersion$jscomp$inline_1863 + "19.1.0-www-classic-220dece9-20250102" !== + isomorphicReactPackageVersion$jscomp$inline_1879 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1863, - "19.1.0-www-classic-0de1233f-20250102" + isomorphicReactPackageVersion$jscomp$inline_1879, + "19.1.0-www-classic-220dece9-20250102" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17969,27 +17978,27 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_1865 = { +var internals$jscomp$inline_1881 = { bundleType: 0, - version: "19.1.0-www-classic-0de1233f-20250102", + version: "19.1.0-www-classic-220dece9-20250102", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-classic-220dece9-20250102" }; enableSchedulingProfiler && - ((internals$jscomp$inline_1865.getLaneLabelMap = getLaneLabelMap), - (internals$jscomp$inline_1865.injectProfilingHooks = injectProfilingHooks)); + ((internals$jscomp$inline_1881.getLaneLabelMap = getLaneLabelMap), + (internals$jscomp$inline_1881.injectProfilingHooks = injectProfilingHooks)); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2359 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2371 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2359.isDisabled && - hook$jscomp$inline_2359.supportsFiber + !hook$jscomp$inline_2371.isDisabled && + hook$jscomp$inline_2371.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2359.inject( - internals$jscomp$inline_1865 + (rendererID = hook$jscomp$inline_2371.inject( + internals$jscomp$inline_1881 )), - (injectedHook = hook$jscomp$inline_2359); + (injectedHook = hook$jscomp$inline_2371); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -18342,7 +18351,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-classic-0de1233f-20250102"; +exports.version = "19.1.0-www-classic-220dece9-20250102"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-profiling.modern.js b/compiled/facebook-www/ReactDOM-profiling.modern.js index f75f92adbde76..3fa65991d4db6 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -642,14 +642,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -659,29 +658,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2182,7 +2181,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root$29, - root$29 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$29 === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root$29.cancelPendingCommit || + -1 !== root$29.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$29, JSCompiler_inline_result) || @@ -2248,7 +2249,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2306,7 +2308,8 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -8959,6 +8962,7 @@ function commitBeforeMutationEffects(root, firstChild) { (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -9090,10 +9094,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -9732,12 +9733,6 @@ function attachSuspenseRetryListeners(finishedWork, wakeables) { } }); } -function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; -} function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -11420,8 +11415,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -11434,7 +11427,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -11495,18 +11488,24 @@ function commitRootWhenReady( completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = -1; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -11524,16 +11523,14 @@ function commitRootWhenReady( } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -11626,8 +11623,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -12173,159 +12168,275 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime -) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } -} -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { + root.cancelPendingCommit = null; do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); - if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; + if (null === finishedWork) enableSchedulingProfiler && markCommitStopped(); + else { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = Internals.p; + Internals.p = 2; + updatedLanes = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (Internals.p = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ); + } +} +function flushMutationEffects(root, finishedWork, lanes) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; ReactSharedInternals.T = null; - updatedLanes = Internals.p; + var previousPriority = Internals.p; Internals.p = 2; - suspendedRetryLanes = executionContext; + var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$211 = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur$211 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && + try { + inProgressLanes = lanes; + inProgressRoot = root; + commitMutationEffectsOnFiber(finishedWork, root); + inProgressRoot = inProgressLanes = null; + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + lanes = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = lanes.focusedElem, + priorSelectionRange = lanes.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 = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.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.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.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for (selection = priorFocusedElem; (selection = selection.parentNode); ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.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; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; +} +function flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate +) { + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); + : releaseRootPooledCache(root, root.pendingLanes); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); isDevToolsPresent && root.memoizedUpdaters.clear(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + rootHasLayoutEffect = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -12350,7 +12461,6 @@ function commitRootImpl( : (currentEndTime = endTime); }); } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -12916,11 +13026,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -12933,7 +13039,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -13662,14 +13767,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$372; if (canUseDOM) { - var isSupported$jscomp$inline_1639 = "oninput" in document; - if (!isSupported$jscomp$inline_1639) { - var element$jscomp$inline_1640 = document.createElement("div"); - element$jscomp$inline_1640.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1639 = - "function" === typeof element$jscomp$inline_1640.oninput; + var isSupported$jscomp$inline_1655 = "oninput" in document; + if (!isSupported$jscomp$inline_1655) { + var element$jscomp$inline_1656 = document.createElement("div"); + element$jscomp$inline_1656.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1655 = + "function" === typeof element$jscomp$inline_1656.oninput; } - JSCompiler_inline_result$jscomp$372 = isSupported$jscomp$inline_1639; + JSCompiler_inline_result$jscomp$372 = isSupported$jscomp$inline_1655; } else JSCompiler_inline_result$jscomp$372 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$372 && @@ -13798,97 +13903,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, @@ -14083,20 +14097,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1680 = 0; - i$jscomp$inline_1680 < simpleEventPluginEvents.length; - i$jscomp$inline_1680++ + var i$jscomp$inline_1696 = 0; + i$jscomp$inline_1696 < simpleEventPluginEvents.length; + i$jscomp$inline_1696++ ) { - var eventName$jscomp$inline_1681 = - simpleEventPluginEvents[i$jscomp$inline_1680], - domEventName$jscomp$inline_1682 = - eventName$jscomp$inline_1681.toLowerCase(), - capitalizedEvent$jscomp$inline_1683 = - eventName$jscomp$inline_1681[0].toUpperCase() + - eventName$jscomp$inline_1681.slice(1); + var eventName$jscomp$inline_1697 = + simpleEventPluginEvents[i$jscomp$inline_1696], + domEventName$jscomp$inline_1698 = + eventName$jscomp$inline_1697.toLowerCase(), + capitalizedEvent$jscomp$inline_1699 = + eventName$jscomp$inline_1697[0].toUpperCase() + + eventName$jscomp$inline_1697.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1682, - "on" + capitalizedEvent$jscomp$inline_1683 + domEventName$jscomp$inline_1698, + "on" + capitalizedEvent$jscomp$inline_1699 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15992,11 +16006,6 @@ function createEvent(type, bubbles) { event.initEvent(type, bubbles, !1); return event; } -function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); -} function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -17674,16 +17683,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1853 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1869 = React.version; if ( - "19.1.0-www-modern-0de1233f-20250102" !== - isomorphicReactPackageVersion$jscomp$inline_1853 + "19.1.0-www-modern-220dece9-20250102" !== + isomorphicReactPackageVersion$jscomp$inline_1869 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1853, - "19.1.0-www-modern-0de1233f-20250102" + isomorphicReactPackageVersion$jscomp$inline_1869, + "19.1.0-www-modern-220dece9-20250102" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17699,27 +17708,27 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_1855 = { +var internals$jscomp$inline_1871 = { bundleType: 0, - version: "19.1.0-www-modern-0de1233f-20250102", + version: "19.1.0-www-modern-220dece9-20250102", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-modern-220dece9-20250102" }; enableSchedulingProfiler && - ((internals$jscomp$inline_1855.getLaneLabelMap = getLaneLabelMap), - (internals$jscomp$inline_1855.injectProfilingHooks = injectProfilingHooks)); + ((internals$jscomp$inline_1871.getLaneLabelMap = getLaneLabelMap), + (internals$jscomp$inline_1871.injectProfilingHooks = injectProfilingHooks)); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2341 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2353 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2341.isDisabled && - hook$jscomp$inline_2341.supportsFiber + !hook$jscomp$inline_2353.isDisabled && + hook$jscomp$inline_2353.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2341.inject( - internals$jscomp$inline_1855 + (rendererID = hook$jscomp$inline_2353.inject( + internals$jscomp$inline_1871 )), - (injectedHook = hook$jscomp$inline_2341); + (injectedHook = hook$jscomp$inline_2353); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -18072,7 +18081,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-modern-0de1233f-20250102"; +exports.version = "19.1.0-www-modern-220dece9-20250102"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOMServer-dev.classic.js b/compiled/facebook-www/ReactDOMServer-dev.classic.js index af016b69f8228..c604540a5d8c5 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.classic.js +++ b/compiled/facebook-www/ReactDOMServer-dev.classic.js @@ -9150,5 +9150,5 @@ __DEV__ && '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.1.0-www-classic-0de1233f-20250102"; + exports.version = "19.1.0-www-classic-220dece9-20250102"; })(); diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js index 843177782f926..899d7b98a02a4 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js @@ -8976,5 +8976,5 @@ __DEV__ && '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.1.0-www-modern-0de1233f-20250102"; + exports.version = "19.1.0-www-modern-220dece9-20250102"; })(); diff --git a/compiled/facebook-www/ReactDOMServer-prod.classic.js b/compiled/facebook-www/ReactDOMServer-prod.classic.js index b0da5a1a17cd5..dc3c021ea666e 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.classic.js +++ b/compiled/facebook-www/ReactDOMServer-prod.classic.js @@ -5898,4 +5898,4 @@ exports.renderToString = function (children, options) { '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.1.0-www-classic-0de1233f-20250102"; +exports.version = "19.1.0-www-classic-220dece9-20250102"; diff --git a/compiled/facebook-www/ReactDOMServer-prod.modern.js b/compiled/facebook-www/ReactDOMServer-prod.modern.js index a4293a0f5488b..a5d78caf659fb 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.modern.js +++ b/compiled/facebook-www/ReactDOMServer-prod.modern.js @@ -5810,4 +5810,4 @@ exports.renderToString = function (children, options) { '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.1.0-www-modern-0de1233f-20250102"; +exports.version = "19.1.0-www-modern-220dece9-20250102"; diff --git a/compiled/facebook-www/ReactDOMTesting-dev.classic.js b/compiled/facebook-www/ReactDOMTesting-dev.classic.js index a0e7d330af87d..00b4f41ccfd06 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -1007,14 +1007,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -1024,29 +1023,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -4155,7 +4155,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -4224,7 +4226,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -4289,7 +4292,10 @@ __DEV__ && workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -9574,32 +9580,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2524; - var JSCompiler_object_inline_stack_2525 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2553; + var JSCompiler_object_inline_stack_2554 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2526 = !1; + var JSCompiler_object_inline_componentStack_2555 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2524 = didSuspend) || - (JSCompiler_object_inline_digest_2524 = + (JSCompiler_object_inline_digest_2553 = didSuspend) || + (JSCompiler_object_inline_digest_2553 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2524 && - ((JSCompiler_object_inline_componentStack_2526 = !0), + JSCompiler_object_inline_digest_2553 && + ((JSCompiler_object_inline_componentStack_2555 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2524 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2553 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2526 + JSCompiler_object_inline_componentStack_2555 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2523 = nextHydratableInstance; + var JSCompiler_object_inline_message_2552 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2523)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2552)) { c: { - var instance = JSCompiler_object_inline_message_2523; + var instance = JSCompiler_object_inline_message_2552; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9641,46 +9647,46 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2523 + JSCompiler_object_inline_message_2552 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2523 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2552 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2523 && - ((JSCompiler_object_inline_message_2523 = - JSCompiler_object_inline_message_2523.dehydrated), - null !== JSCompiler_object_inline_message_2523) + null !== JSCompiler_object_inline_message_2552 && + ((JSCompiler_object_inline_message_2552 = + JSCompiler_object_inline_message_2552.dehydrated), + null !== JSCompiler_object_inline_message_2552) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2523) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2552) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2523 = - JSCompiler_object_inline_stack_2525.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2525.fallback; - if (JSCompiler_object_inline_componentStack_2526) + JSCompiler_object_inline_message_2552 = + JSCompiler_object_inline_stack_2554.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2554.fallback; + if (JSCompiler_object_inline_componentStack_2555) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2525 = + (JSCompiler_object_inline_stack_2554 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2523, + JSCompiler_object_inline_message_2552, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2526 = + (JSCompiler_object_inline_componentStack_2555 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2526.memoizedState = + (JSCompiler_object_inline_componentStack_2555.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2526.childLanes = + (JSCompiler_object_inline_componentStack_2555.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2524, + JSCompiler_object_inline_digest_2553, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9693,9 +9699,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2526.updateQueue), + JSCompiler_object_inline_componentStack_2555.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2526.updateQueue = + ? (JSCompiler_object_inline_componentStack_2555.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -9703,46 +9709,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2525 + JSCompiler_object_inline_stack_2554 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2525.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2554.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2525 = + (JSCompiler_object_inline_stack_2554 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2523, + JSCompiler_object_inline_message_2552, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2526 = + (JSCompiler_object_inline_componentStack_2555 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2526.memoizedState = + (JSCompiler_object_inline_componentStack_2555.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2526.childLanes = + (JSCompiler_object_inline_componentStack_2555.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2524, + JSCompiler_object_inline_digest_2553, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2525 + JSCompiler_object_inline_stack_2554 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2523 + JSCompiler_object_inline_message_2552 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2523 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2523) + ((JSCompiler_object_inline_message_2552 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2552) ) { if (didSuspend) workInProgress.flags & 256 @@ -9759,94 +9765,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2526 = - JSCompiler_object_inline_stack_2525.fallback), - (JSCompiler_object_inline_message_2523 = workInProgress.mode), - (JSCompiler_object_inline_stack_2525 = + (JSCompiler_object_inline_componentStack_2555 = + JSCompiler_object_inline_stack_2554.fallback), + (JSCompiler_object_inline_message_2552 = workInProgress.mode), + (JSCompiler_object_inline_stack_2554 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2525.children + children: JSCompiler_object_inline_stack_2554.children }, - JSCompiler_object_inline_message_2523 + JSCompiler_object_inline_message_2552 )), - (JSCompiler_object_inline_componentStack_2526 = + (JSCompiler_object_inline_componentStack_2555 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2526, - JSCompiler_object_inline_message_2523, + JSCompiler_object_inline_componentStack_2555, + JSCompiler_object_inline_message_2552, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2526.flags |= 2), - (JSCompiler_object_inline_stack_2525.return = workInProgress), - (JSCompiler_object_inline_componentStack_2526.return = + (JSCompiler_object_inline_componentStack_2555.flags |= 2), + (JSCompiler_object_inline_stack_2554.return = workInProgress), + (JSCompiler_object_inline_componentStack_2555.return = workInProgress), - (JSCompiler_object_inline_stack_2525.sibling = - JSCompiler_object_inline_componentStack_2526), - (workInProgress.child = JSCompiler_object_inline_stack_2525), + (JSCompiler_object_inline_stack_2554.sibling = + JSCompiler_object_inline_componentStack_2555), + (workInProgress.child = JSCompiler_object_inline_stack_2554), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2525 = workInProgress.child), - (JSCompiler_object_inline_stack_2525.memoizedState = + (JSCompiler_object_inline_stack_2554 = workInProgress.child), + (JSCompiler_object_inline_stack_2554.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2525.childLanes = + (JSCompiler_object_inline_stack_2554.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2524, + JSCompiler_object_inline_digest_2553, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2526)); + JSCompiler_object_inline_componentStack_2555)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2523)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2552)) ) { - JSCompiler_object_inline_digest_2524 = - JSCompiler_object_inline_message_2523.nextSibling && - JSCompiler_object_inline_message_2523.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2524) { - JSCompiler_temp = JSCompiler_object_inline_digest_2524.dgst; - var message = JSCompiler_object_inline_digest_2524.msg; - instance = JSCompiler_object_inline_digest_2524.stck; - var componentStack = JSCompiler_object_inline_digest_2524.cstck; + JSCompiler_object_inline_digest_2553 = + JSCompiler_object_inline_message_2552.nextSibling && + JSCompiler_object_inline_message_2552.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2553) { + JSCompiler_temp = JSCompiler_object_inline_digest_2553.dgst; + var message = JSCompiler_object_inline_digest_2553.msg; + instance = JSCompiler_object_inline_digest_2553.stck; + var componentStack = JSCompiler_object_inline_digest_2553.cstck; } - JSCompiler_object_inline_message_2523 = message; - JSCompiler_object_inline_digest_2524 = JSCompiler_temp; - JSCompiler_object_inline_stack_2525 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2526 = + JSCompiler_object_inline_message_2552 = message; + JSCompiler_object_inline_digest_2553 = JSCompiler_temp; + JSCompiler_object_inline_stack_2554 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2555 = componentStack; - JSCompiler_object_inline_componentStack_2526 = - JSCompiler_object_inline_message_2523 - ? Error(JSCompiler_object_inline_message_2523) + JSCompiler_object_inline_componentStack_2555 = + JSCompiler_object_inline_message_2552 + ? Error(JSCompiler_object_inline_message_2552) : 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_2526.stack = - JSCompiler_object_inline_stack_2525 || ""; - JSCompiler_object_inline_componentStack_2526.digest = - JSCompiler_object_inline_digest_2524; - JSCompiler_object_inline_digest_2524 = + JSCompiler_object_inline_componentStack_2555.stack = + JSCompiler_object_inline_stack_2554 || ""; + JSCompiler_object_inline_componentStack_2555.digest = + JSCompiler_object_inline_digest_2553; + JSCompiler_object_inline_digest_2553 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2525 = { - value: JSCompiler_object_inline_componentStack_2526, + JSCompiler_object_inline_stack_2554 = { + value: JSCompiler_object_inline_componentStack_2555, source: null, - stack: JSCompiler_object_inline_digest_2524 + stack: JSCompiler_object_inline_digest_2553 }; - "string" === typeof JSCompiler_object_inline_digest_2524 && + "string" === typeof JSCompiler_object_inline_digest_2553 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2526, - JSCompiler_object_inline_stack_2525 + JSCompiler_object_inline_componentStack_2555, + JSCompiler_object_inline_stack_2554 ); - queueHydrationError(JSCompiler_object_inline_stack_2525); + queueHydrationError(JSCompiler_object_inline_stack_2554); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9860,44 +9866,44 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2524 = + (JSCompiler_object_inline_digest_2553 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2524) + didReceiveUpdate || JSCompiler_object_inline_digest_2553) ) { - JSCompiler_object_inline_digest_2524 = workInProgressRoot; + JSCompiler_object_inline_digest_2553 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_digest_2524 && - ((JSCompiler_object_inline_stack_2525 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2525 = - 0 !== (JSCompiler_object_inline_stack_2525 & 42) + null !== JSCompiler_object_inline_digest_2553 && + ((JSCompiler_object_inline_stack_2554 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2554 = + 0 !== (JSCompiler_object_inline_stack_2554 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2525 + JSCompiler_object_inline_stack_2554 )), - (JSCompiler_object_inline_stack_2525 = + (JSCompiler_object_inline_stack_2554 = 0 !== - (JSCompiler_object_inline_stack_2525 & - (JSCompiler_object_inline_digest_2524.suspendedLanes | + (JSCompiler_object_inline_stack_2554 & + (JSCompiler_object_inline_digest_2553.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2525), - 0 !== JSCompiler_object_inline_stack_2525 && - JSCompiler_object_inline_stack_2525 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2554), + 0 !== JSCompiler_object_inline_stack_2554 && + JSCompiler_object_inline_stack_2554 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2525), + ((prevState.retryLane = JSCompiler_object_inline_stack_2554), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2525 + JSCompiler_object_inline_stack_2554 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2524, + JSCompiler_object_inline_digest_2553, current, - JSCompiler_object_inline_stack_2525 + JSCompiler_object_inline_stack_2554 ), SelectiveHydrationException) ); - JSCompiler_object_inline_message_2523.data === + JSCompiler_object_inline_message_2552.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9905,14 +9911,14 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2523.data === + JSCompiler_object_inline_message_2552.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2523.nextSibling + JSCompiler_object_inline_message_2552.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9930,57 +9936,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2525.children + JSCompiler_object_inline_stack_2554.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2526) + if (JSCompiler_object_inline_componentStack_2555) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2526 = - JSCompiler_object_inline_stack_2525.fallback), - (JSCompiler_object_inline_message_2523 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2555 = + JSCompiler_object_inline_stack_2554.fallback), + (JSCompiler_object_inline_message_2552 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2525 = createWorkInProgress( + (JSCompiler_object_inline_stack_2554 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2525.children + children: JSCompiler_object_inline_stack_2554.children } )), - (JSCompiler_object_inline_stack_2525.subtreeFlags = + (JSCompiler_object_inline_stack_2554.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_componentStack_2526 = + ? (JSCompiler_object_inline_componentStack_2555 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2526 + JSCompiler_object_inline_componentStack_2555 )) - : ((JSCompiler_object_inline_componentStack_2526 = + : ((JSCompiler_object_inline_componentStack_2555 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2526, - JSCompiler_object_inline_message_2523, + JSCompiler_object_inline_componentStack_2555, + JSCompiler_object_inline_message_2552, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2526.flags |= 2)), - (JSCompiler_object_inline_componentStack_2526.return = + (JSCompiler_object_inline_componentStack_2555.flags |= 2)), + (JSCompiler_object_inline_componentStack_2555.return = workInProgress), - (JSCompiler_object_inline_stack_2525.return = workInProgress), - (JSCompiler_object_inline_stack_2525.sibling = - JSCompiler_object_inline_componentStack_2526), - (workInProgress.child = JSCompiler_object_inline_stack_2525), - (JSCompiler_object_inline_stack_2525 = - JSCompiler_object_inline_componentStack_2526), - (JSCompiler_object_inline_componentStack_2526 = workInProgress.child), - (JSCompiler_object_inline_message_2523 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2523 - ? (JSCompiler_object_inline_message_2523 = + (JSCompiler_object_inline_stack_2554.return = workInProgress), + (JSCompiler_object_inline_stack_2554.sibling = + JSCompiler_object_inline_componentStack_2555), + (workInProgress.child = JSCompiler_object_inline_stack_2554), + (JSCompiler_object_inline_stack_2554 = + JSCompiler_object_inline_componentStack_2555), + (JSCompiler_object_inline_componentStack_2555 = workInProgress.child), + (JSCompiler_object_inline_message_2552 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2552 + ? (JSCompiler_object_inline_message_2552 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2523.cachePool), + JSCompiler_object_inline_message_2552.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9988,34 +9994,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2523 = { + (JSCompiler_object_inline_message_2552 = { baseLanes: - JSCompiler_object_inline_message_2523.baseLanes | renderLanes, + JSCompiler_object_inline_message_2552.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2526.memoizedState = - JSCompiler_object_inline_message_2523), + (JSCompiler_object_inline_componentStack_2555.memoizedState = + JSCompiler_object_inline_message_2552), enableTransitionTracing && - ((JSCompiler_object_inline_message_2523 = enableTransitionTracing + ((JSCompiler_object_inline_message_2552 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2523 && + null !== JSCompiler_object_inline_message_2552 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2526.updateQueue), + JSCompiler_object_inline_componentStack_2555.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2526.updateQueue = { - transitions: JSCompiler_object_inline_message_2523, + ? (JSCompiler_object_inline_componentStack_2555.updateQueue = { + transitions: JSCompiler_object_inline_message_2552, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2526.updateQueue = + ? (JSCompiler_object_inline_componentStack_2555.updateQueue = { - transitions: JSCompiler_object_inline_message_2523, + transitions: JSCompiler_object_inline_message_2552, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -10023,32 +10029,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2523), + JSCompiler_object_inline_message_2552), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2526.childLanes = + (JSCompiler_object_inline_componentStack_2555.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2524, + JSCompiler_object_inline_digest_2553, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2525 + JSCompiler_object_inline_stack_2554 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2525.children + children: JSCompiler_object_inline_stack_2554.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2524 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2524 + ((JSCompiler_object_inline_digest_2553 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2553 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2524.push(current)); + : JSCompiler_object_inline_digest_2553.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -13008,6 +13014,7 @@ __DEV__ && (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -13119,10 +13126,7 @@ __DEV__ && nextEffect = firstChild.return; } } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return firstChild; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -13859,12 +13863,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -15871,21 +15869,17 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( shouldTimeSlice, + forceSync, + lanes, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - exitStatus, - IMMEDIATE_COMMIT, - renderStartTime, - 0 + workInProgressSuspendedRetryLanes ); else { if ( @@ -15903,7 +15897,7 @@ __DEV__ && workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -15965,18 +15959,24 @@ __DEV__ && completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -15999,16 +15999,14 @@ __DEV__ && } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -16104,8 +16102,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -16741,179 +16737,303 @@ __DEV__ && } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { + root.cancelPendingCommit = 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.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + 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." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - 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." + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = Internals.p; + Internals.p = DiscreteEventPriority; + updatedLanes = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (Internals.p = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; + } + } + function flushMutationEffects(root, finishedWork, lanes) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; ReactSharedInternals.T = null; - updatedLanes = Internals.p; + var previousPriority = Internals.p; Internals.p = DiscreteEventPriority; - suspendedRetryLanes = executionContext; + var prevExecutionContext = executionContext; executionContext |= CommitContext; - var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && + try { + inProgressLanes = lanes; + inProgressRoot = root; + commitMutationEffectsOnFiber(finishedWork, root); + inProgressRoot = inProgressLanes = null; + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + lanes = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = lanes.focusedElem, + priorSelectionRange = lanes.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 = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.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.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.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for ( + selection = priorFocusedElem; + (selection = selection.parentNode); + + ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.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; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + } + function flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ) { + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), + : (releaseRootPooledCache(root, root.pendingLanes), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); + previousPriority = root.pendingLanes; + 0 === previousPriority && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot$1(finishedWork.stateNode, rootHasLayoutEffect); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority], + errorInfo = makeErrorInfo(recoverableError.stack); runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo ); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + previousPriority = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -16939,7 +17059,6 @@ __DEV__ && : (currentEndTime = endTime); }); } - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -17887,11 +18006,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -17904,7 +18019,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -18581,100 +18695,6 @@ __DEV__ && "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, @@ -21970,11 +21990,6 @@ __DEV__ && event.initEvent(type, bubbles, !1); return event; } - function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); - } function removeChild(parentInstance, child) { parentInstance.removeChild(child); } @@ -27720,11 +27735,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-www-classic-0de1233f-20250102" !== isomorphicReactPackageVersion) + if ("19.1.0-www-classic-220dece9-20250102" !== 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.1.0-www-classic-0de1233f-20250102\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-www-classic-220dece9-20250102\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27767,10 +27782,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-www-classic-0de1233f-20250102", + version: "19.1.0-www-classic-220dece9-20250102", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-classic-220dece9-20250102" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -28534,5 +28549,5 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-www-classic-0de1233f-20250102"; + exports.version = "19.1.0-www-classic-220dece9-20250102"; })(); diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index eb6cf77396b7b..804929771cfbc 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -1007,14 +1007,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -1024,29 +1023,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -4042,7 +4042,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -4111,7 +4113,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -4176,7 +4179,10 @@ __DEV__ && workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -9386,32 +9392,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2516; - var JSCompiler_object_inline_stack_2517 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2545; + var JSCompiler_object_inline_stack_2546 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2518 = !1; + var JSCompiler_object_inline_componentStack_2547 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2516 = didSuspend) || - (JSCompiler_object_inline_digest_2516 = + (JSCompiler_object_inline_digest_2545 = didSuspend) || + (JSCompiler_object_inline_digest_2545 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2516 && - ((JSCompiler_object_inline_componentStack_2518 = !0), + JSCompiler_object_inline_digest_2545 && + ((JSCompiler_object_inline_componentStack_2547 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2516 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2545 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2518 + JSCompiler_object_inline_componentStack_2547 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2515 = nextHydratableInstance; + var JSCompiler_object_inline_message_2544 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2515)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2544)) { c: { - var instance = JSCompiler_object_inline_message_2515; + var instance = JSCompiler_object_inline_message_2544; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9453,46 +9459,46 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2515 + JSCompiler_object_inline_message_2544 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2515 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2544 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2515 && - ((JSCompiler_object_inline_message_2515 = - JSCompiler_object_inline_message_2515.dehydrated), - null !== JSCompiler_object_inline_message_2515) + null !== JSCompiler_object_inline_message_2544 && + ((JSCompiler_object_inline_message_2544 = + JSCompiler_object_inline_message_2544.dehydrated), + null !== JSCompiler_object_inline_message_2544) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2515) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2544) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2515 = - JSCompiler_object_inline_stack_2517.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2517.fallback; - if (JSCompiler_object_inline_componentStack_2518) + JSCompiler_object_inline_message_2544 = + JSCompiler_object_inline_stack_2546.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2546.fallback; + if (JSCompiler_object_inline_componentStack_2547) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2517 = + (JSCompiler_object_inline_stack_2546 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2515, + JSCompiler_object_inline_message_2544, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2518 = + (JSCompiler_object_inline_componentStack_2547 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2518.memoizedState = + (JSCompiler_object_inline_componentStack_2547.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2518.childLanes = + (JSCompiler_object_inline_componentStack_2547.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2516, + JSCompiler_object_inline_digest_2545, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9505,9 +9511,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2518.updateQueue), + JSCompiler_object_inline_componentStack_2547.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2518.updateQueue = + ? (JSCompiler_object_inline_componentStack_2547.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -9515,46 +9521,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2517 + JSCompiler_object_inline_stack_2546 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2517.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2546.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2517 = + (JSCompiler_object_inline_stack_2546 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2515, + JSCompiler_object_inline_message_2544, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2518 = + (JSCompiler_object_inline_componentStack_2547 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2518.memoizedState = + (JSCompiler_object_inline_componentStack_2547.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2518.childLanes = + (JSCompiler_object_inline_componentStack_2547.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2516, + JSCompiler_object_inline_digest_2545, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2517 + JSCompiler_object_inline_stack_2546 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2515 + JSCompiler_object_inline_message_2544 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2515 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2515) + ((JSCompiler_object_inline_message_2544 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2544) ) { if (didSuspend) workInProgress.flags & 256 @@ -9571,94 +9577,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2518 = - JSCompiler_object_inline_stack_2517.fallback), - (JSCompiler_object_inline_message_2515 = workInProgress.mode), - (JSCompiler_object_inline_stack_2517 = + (JSCompiler_object_inline_componentStack_2547 = + JSCompiler_object_inline_stack_2546.fallback), + (JSCompiler_object_inline_message_2544 = workInProgress.mode), + (JSCompiler_object_inline_stack_2546 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2517.children + children: JSCompiler_object_inline_stack_2546.children }, - JSCompiler_object_inline_message_2515 + JSCompiler_object_inline_message_2544 )), - (JSCompiler_object_inline_componentStack_2518 = + (JSCompiler_object_inline_componentStack_2547 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2518, - JSCompiler_object_inline_message_2515, + JSCompiler_object_inline_componentStack_2547, + JSCompiler_object_inline_message_2544, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2518.flags |= 2), - (JSCompiler_object_inline_stack_2517.return = workInProgress), - (JSCompiler_object_inline_componentStack_2518.return = + (JSCompiler_object_inline_componentStack_2547.flags |= 2), + (JSCompiler_object_inline_stack_2546.return = workInProgress), + (JSCompiler_object_inline_componentStack_2547.return = workInProgress), - (JSCompiler_object_inline_stack_2517.sibling = - JSCompiler_object_inline_componentStack_2518), - (workInProgress.child = JSCompiler_object_inline_stack_2517), + (JSCompiler_object_inline_stack_2546.sibling = + JSCompiler_object_inline_componentStack_2547), + (workInProgress.child = JSCompiler_object_inline_stack_2546), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2517 = workInProgress.child), - (JSCompiler_object_inline_stack_2517.memoizedState = + (JSCompiler_object_inline_stack_2546 = workInProgress.child), + (JSCompiler_object_inline_stack_2546.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2517.childLanes = + (JSCompiler_object_inline_stack_2546.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2516, + JSCompiler_object_inline_digest_2545, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2518)); + JSCompiler_object_inline_componentStack_2547)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2515)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2544)) ) { - JSCompiler_object_inline_digest_2516 = - JSCompiler_object_inline_message_2515.nextSibling && - JSCompiler_object_inline_message_2515.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2516) { - JSCompiler_temp = JSCompiler_object_inline_digest_2516.dgst; - var message = JSCompiler_object_inline_digest_2516.msg; - instance = JSCompiler_object_inline_digest_2516.stck; - var componentStack = JSCompiler_object_inline_digest_2516.cstck; + JSCompiler_object_inline_digest_2545 = + JSCompiler_object_inline_message_2544.nextSibling && + JSCompiler_object_inline_message_2544.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2545) { + JSCompiler_temp = JSCompiler_object_inline_digest_2545.dgst; + var message = JSCompiler_object_inline_digest_2545.msg; + instance = JSCompiler_object_inline_digest_2545.stck; + var componentStack = JSCompiler_object_inline_digest_2545.cstck; } - JSCompiler_object_inline_message_2515 = message; - JSCompiler_object_inline_digest_2516 = JSCompiler_temp; - JSCompiler_object_inline_stack_2517 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2518 = + JSCompiler_object_inline_message_2544 = message; + JSCompiler_object_inline_digest_2545 = JSCompiler_temp; + JSCompiler_object_inline_stack_2546 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2547 = componentStack; - JSCompiler_object_inline_componentStack_2518 = - JSCompiler_object_inline_message_2515 - ? Error(JSCompiler_object_inline_message_2515) + JSCompiler_object_inline_componentStack_2547 = + JSCompiler_object_inline_message_2544 + ? Error(JSCompiler_object_inline_message_2544) : 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_2518.stack = - JSCompiler_object_inline_stack_2517 || ""; - JSCompiler_object_inline_componentStack_2518.digest = - JSCompiler_object_inline_digest_2516; - JSCompiler_object_inline_digest_2516 = + JSCompiler_object_inline_componentStack_2547.stack = + JSCompiler_object_inline_stack_2546 || ""; + JSCompiler_object_inline_componentStack_2547.digest = + JSCompiler_object_inline_digest_2545; + JSCompiler_object_inline_digest_2545 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2517 = { - value: JSCompiler_object_inline_componentStack_2518, + JSCompiler_object_inline_stack_2546 = { + value: JSCompiler_object_inline_componentStack_2547, source: null, - stack: JSCompiler_object_inline_digest_2516 + stack: JSCompiler_object_inline_digest_2545 }; - "string" === typeof JSCompiler_object_inline_digest_2516 && + "string" === typeof JSCompiler_object_inline_digest_2545 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2518, - JSCompiler_object_inline_stack_2517 + JSCompiler_object_inline_componentStack_2547, + JSCompiler_object_inline_stack_2546 ); - queueHydrationError(JSCompiler_object_inline_stack_2517); + queueHydrationError(JSCompiler_object_inline_stack_2546); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9672,44 +9678,44 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2516 = + (JSCompiler_object_inline_digest_2545 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2516) + didReceiveUpdate || JSCompiler_object_inline_digest_2545) ) { - JSCompiler_object_inline_digest_2516 = workInProgressRoot; + JSCompiler_object_inline_digest_2545 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_digest_2516 && - ((JSCompiler_object_inline_stack_2517 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2517 = - 0 !== (JSCompiler_object_inline_stack_2517 & 42) + null !== JSCompiler_object_inline_digest_2545 && + ((JSCompiler_object_inline_stack_2546 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2546 = + 0 !== (JSCompiler_object_inline_stack_2546 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2517 + JSCompiler_object_inline_stack_2546 )), - (JSCompiler_object_inline_stack_2517 = + (JSCompiler_object_inline_stack_2546 = 0 !== - (JSCompiler_object_inline_stack_2517 & - (JSCompiler_object_inline_digest_2516.suspendedLanes | + (JSCompiler_object_inline_stack_2546 & + (JSCompiler_object_inline_digest_2545.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2517), - 0 !== JSCompiler_object_inline_stack_2517 && - JSCompiler_object_inline_stack_2517 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2546), + 0 !== JSCompiler_object_inline_stack_2546 && + JSCompiler_object_inline_stack_2546 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2517), + ((prevState.retryLane = JSCompiler_object_inline_stack_2546), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2517 + JSCompiler_object_inline_stack_2546 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2516, + JSCompiler_object_inline_digest_2545, current, - JSCompiler_object_inline_stack_2517 + JSCompiler_object_inline_stack_2546 ), SelectiveHydrationException) ); - JSCompiler_object_inline_message_2515.data === + JSCompiler_object_inline_message_2544.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9717,14 +9723,14 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2515.data === + JSCompiler_object_inline_message_2544.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2515.nextSibling + JSCompiler_object_inline_message_2544.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9742,57 +9748,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2517.children + JSCompiler_object_inline_stack_2546.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2518) + if (JSCompiler_object_inline_componentStack_2547) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2518 = - JSCompiler_object_inline_stack_2517.fallback), - (JSCompiler_object_inline_message_2515 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2547 = + JSCompiler_object_inline_stack_2546.fallback), + (JSCompiler_object_inline_message_2544 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2517 = createWorkInProgress( + (JSCompiler_object_inline_stack_2546 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2517.children + children: JSCompiler_object_inline_stack_2546.children } )), - (JSCompiler_object_inline_stack_2517.subtreeFlags = + (JSCompiler_object_inline_stack_2546.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_componentStack_2518 = + ? (JSCompiler_object_inline_componentStack_2547 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2518 + JSCompiler_object_inline_componentStack_2547 )) - : ((JSCompiler_object_inline_componentStack_2518 = + : ((JSCompiler_object_inline_componentStack_2547 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2518, - JSCompiler_object_inline_message_2515, + JSCompiler_object_inline_componentStack_2547, + JSCompiler_object_inline_message_2544, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2518.flags |= 2)), - (JSCompiler_object_inline_componentStack_2518.return = + (JSCompiler_object_inline_componentStack_2547.flags |= 2)), + (JSCompiler_object_inline_componentStack_2547.return = workInProgress), - (JSCompiler_object_inline_stack_2517.return = workInProgress), - (JSCompiler_object_inline_stack_2517.sibling = - JSCompiler_object_inline_componentStack_2518), - (workInProgress.child = JSCompiler_object_inline_stack_2517), - (JSCompiler_object_inline_stack_2517 = - JSCompiler_object_inline_componentStack_2518), - (JSCompiler_object_inline_componentStack_2518 = workInProgress.child), - (JSCompiler_object_inline_message_2515 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2515 - ? (JSCompiler_object_inline_message_2515 = + (JSCompiler_object_inline_stack_2546.return = workInProgress), + (JSCompiler_object_inline_stack_2546.sibling = + JSCompiler_object_inline_componentStack_2547), + (workInProgress.child = JSCompiler_object_inline_stack_2546), + (JSCompiler_object_inline_stack_2546 = + JSCompiler_object_inline_componentStack_2547), + (JSCompiler_object_inline_componentStack_2547 = workInProgress.child), + (JSCompiler_object_inline_message_2544 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2544 + ? (JSCompiler_object_inline_message_2544 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2515.cachePool), + JSCompiler_object_inline_message_2544.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9800,34 +9806,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2515 = { + (JSCompiler_object_inline_message_2544 = { baseLanes: - JSCompiler_object_inline_message_2515.baseLanes | renderLanes, + JSCompiler_object_inline_message_2544.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2518.memoizedState = - JSCompiler_object_inline_message_2515), + (JSCompiler_object_inline_componentStack_2547.memoizedState = + JSCompiler_object_inline_message_2544), enableTransitionTracing && - ((JSCompiler_object_inline_message_2515 = enableTransitionTracing + ((JSCompiler_object_inline_message_2544 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2515 && + null !== JSCompiler_object_inline_message_2544 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2518.updateQueue), + JSCompiler_object_inline_componentStack_2547.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2518.updateQueue = { - transitions: JSCompiler_object_inline_message_2515, + ? (JSCompiler_object_inline_componentStack_2547.updateQueue = { + transitions: JSCompiler_object_inline_message_2544, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2518.updateQueue = + ? (JSCompiler_object_inline_componentStack_2547.updateQueue = { - transitions: JSCompiler_object_inline_message_2515, + transitions: JSCompiler_object_inline_message_2544, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9835,32 +9841,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2515), + JSCompiler_object_inline_message_2544), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2518.childLanes = + (JSCompiler_object_inline_componentStack_2547.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2516, + JSCompiler_object_inline_digest_2545, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2517 + JSCompiler_object_inline_stack_2546 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2517.children + children: JSCompiler_object_inline_stack_2546.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2516 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2516 + ((JSCompiler_object_inline_digest_2545 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2545 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2516.push(current)); + : JSCompiler_object_inline_digest_2545.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -12807,6 +12813,7 @@ __DEV__ && (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -12918,10 +12925,7 @@ __DEV__ && nextEffect = firstChild.return; } } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return firstChild; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -13658,12 +13662,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -15670,21 +15668,17 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( shouldTimeSlice, + forceSync, + lanes, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - exitStatus, - IMMEDIATE_COMMIT, - renderStartTime, - 0 + workInProgressSuspendedRetryLanes ); else { if ( @@ -15702,7 +15696,7 @@ __DEV__ && workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -15764,18 +15758,24 @@ __DEV__ && completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -15798,16 +15798,14 @@ __DEV__ && } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -15903,8 +15901,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -16536,179 +16532,303 @@ __DEV__ && } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { + root.cancelPendingCommit = 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.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + 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." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - 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." + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = Internals.p; + Internals.p = DiscreteEventPriority; + updatedLanes = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (Internals.p = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; + } + } + function flushMutationEffects(root, finishedWork, lanes) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; ReactSharedInternals.T = null; - updatedLanes = Internals.p; + var previousPriority = Internals.p; Internals.p = DiscreteEventPriority; - suspendedRetryLanes = executionContext; + var prevExecutionContext = executionContext; executionContext |= CommitContext; - var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && + try { + inProgressLanes = lanes; + inProgressRoot = root; + commitMutationEffectsOnFiber(finishedWork, root); + inProgressRoot = inProgressLanes = null; + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + lanes = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = lanes.focusedElem, + priorSelectionRange = lanes.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 = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.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.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.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for ( + selection = priorFocusedElem; + (selection = selection.parentNode); + + ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.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; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + } + function flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ) { + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), + : (releaseRootPooledCache(root, root.pendingLanes), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); + previousPriority = root.pendingLanes; + 0 === previousPriority && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot$1(finishedWork.stateNode, rootHasLayoutEffect); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority], + errorInfo = makeErrorInfo(recoverableError.stack); runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo ); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + previousPriority = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -16734,7 +16854,6 @@ __DEV__ && : (currentEndTime = endTime); }); } - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -17682,11 +17801,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -17699,7 +17814,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -18372,100 +18486,6 @@ __DEV__ && "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, @@ -21757,11 +21777,6 @@ __DEV__ && event.initEvent(type, bubbles, !1); return event; } - function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); - } function removeChild(parentInstance, child) { parentInstance.removeChild(child); } @@ -27499,11 +27514,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-www-modern-0de1233f-20250102" !== isomorphicReactPackageVersion) + if ("19.1.0-www-modern-220dece9-20250102" !== 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.1.0-www-modern-0de1233f-20250102\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-www-modern-220dece9-20250102\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27546,10 +27561,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-www-modern-0de1233f-20250102", + version: "19.1.0-www-modern-220dece9-20250102", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-modern-220dece9-20250102" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -28313,5 +28328,5 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-www-modern-0de1233f-20250102"; + exports.version = "19.1.0-www-modern-220dece9-20250102"; })(); diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index 6bdbfb2b3fa20..f1c68429f1e0e 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -626,14 +626,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -643,29 +642,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2252,7 +2251,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root$27, - root$27 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$27 === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root$27.cancelPendingCommit || + -1 !== root$27.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$27, JSCompiler_inline_result) || @@ -2318,7 +2319,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2375,7 +2377,8 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -8853,6 +8856,7 @@ function commitBeforeMutationEffects(root, firstChild) { (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -8984,10 +8988,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -11409,8 +11410,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -11423,7 +11422,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -11484,18 +11483,24 @@ function commitRootWhenReady( completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = -1; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -11513,16 +11518,14 @@ function commitRootWhenReady( } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -11615,8 +11618,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -12091,141 +12092,253 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); + root.cancelPendingCommit = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); + if (null !== finishedWork) { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = Internals.p; + Internals.p = 2; + updatedLanes = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (Internals.p = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ); } } -function commitRootImpl( +function flushMutationEffects(root, finishedWork) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root); + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + target = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = target.focusedElem, + priorSelectionRange = target.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 = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.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.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.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for (selection = priorFocusedElem; (selection = selection.parentNode); ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.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; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; +} +function flushLayoutEffects( root, + finishedWork, + lanes, recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes + didIncludeRenderPhaseUpdate ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; ReactSharedInternals.T = null; - updatedLanes = Internals.p; + var previousPriority = Internals.p; Internals.p = 2; - suspendedRetryLanes = executionContext; + var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$197 = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$197 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + : releaseRootPooledCache(root, root.pendingLanes); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + rootHasLayoutEffect = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) @@ -12248,7 +12361,6 @@ function commitRootImpl( : (currentEndTime = endTime); }); } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -12778,11 +12890,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -12795,7 +12903,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -13510,14 +13617,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$354; if (canUseDOM) { - var isSupported$jscomp$inline_1585 = "oninput" in document; - if (!isSupported$jscomp$inline_1585) { - var element$jscomp$inline_1586 = document.createElement("div"); - element$jscomp$inline_1586.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1585 = - "function" === typeof element$jscomp$inline_1586.oninput; + var isSupported$jscomp$inline_1597 = "oninput" in document; + if (!isSupported$jscomp$inline_1597) { + var element$jscomp$inline_1598 = document.createElement("div"); + element$jscomp$inline_1598.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1597 = + "function" === typeof element$jscomp$inline_1598.oninput; } - JSCompiler_inline_result$jscomp$354 = isSupported$jscomp$inline_1585; + JSCompiler_inline_result$jscomp$354 = isSupported$jscomp$inline_1597; } else JSCompiler_inline_result$jscomp$354 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$354 && @@ -13646,97 +13753,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, @@ -13931,20 +13947,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1626 = 0; - i$jscomp$inline_1626 < simpleEventPluginEvents.length; - i$jscomp$inline_1626++ + var i$jscomp$inline_1638 = 0; + i$jscomp$inline_1638 < simpleEventPluginEvents.length; + i$jscomp$inline_1638++ ) { - var eventName$jscomp$inline_1627 = - simpleEventPluginEvents[i$jscomp$inline_1626], - domEventName$jscomp$inline_1628 = - eventName$jscomp$inline_1627.toLowerCase(), - capitalizedEvent$jscomp$inline_1629 = - eventName$jscomp$inline_1627[0].toUpperCase() + - eventName$jscomp$inline_1627.slice(1); + var eventName$jscomp$inline_1639 = + simpleEventPluginEvents[i$jscomp$inline_1638], + domEventName$jscomp$inline_1640 = + eventName$jscomp$inline_1639.toLowerCase(), + capitalizedEvent$jscomp$inline_1641 = + eventName$jscomp$inline_1639[0].toUpperCase() + + eventName$jscomp$inline_1639.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1628, - "on" + capitalizedEvent$jscomp$inline_1629 + domEventName$jscomp$inline_1640, + "on" + capitalizedEvent$jscomp$inline_1641 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15845,11 +15861,6 @@ function createEvent(type, bubbles) { event.initEvent(type, bubbles, !1); return event; } -function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); -} function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -17584,16 +17595,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1799 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1811 = React.version; if ( - "19.1.0-www-classic-0de1233f-20250102" !== - isomorphicReactPackageVersion$jscomp$inline_1799 + "19.1.0-www-classic-220dece9-20250102" !== + isomorphicReactPackageVersion$jscomp$inline_1811 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1799, - "19.1.0-www-classic-0de1233f-20250102" + isomorphicReactPackageVersion$jscomp$inline_1811, + "19.1.0-www-classic-220dece9-20250102" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17609,24 +17620,24 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2341 = { +var internals$jscomp$inline_2351 = { bundleType: 0, - version: "19.1.0-www-classic-0de1233f-20250102", + version: "19.1.0-www-classic-220dece9-20250102", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-classic-220dece9-20250102" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2342 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2352 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2342.isDisabled && - hook$jscomp$inline_2342.supportsFiber + !hook$jscomp$inline_2352.isDisabled && + hook$jscomp$inline_2352.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2342.inject( - internals$jscomp$inline_2341 + (rendererID = hook$jscomp$inline_2352.inject( + internals$jscomp$inline_2351 )), - (injectedHook = hook$jscomp$inline_2342); + (injectedHook = hook$jscomp$inline_2352); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -18130,4 +18141,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-classic-0de1233f-20250102"; +exports.version = "19.1.0-www-classic-220dece9-20250102"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index e2560df9d0b2b..3f4d07b86aada 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -561,14 +561,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -578,29 +577,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2103,7 +2102,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root$27, - root$27 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$27 === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root$27.cancelPendingCommit || + -1 !== root$27.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$27, JSCompiler_inline_result) || @@ -2169,7 +2170,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2226,7 +2228,8 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -8604,6 +8607,7 @@ function commitBeforeMutationEffects(root, firstChild) { (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -8735,10 +8739,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -11160,8 +11161,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -11174,7 +11173,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -11235,18 +11234,24 @@ function commitRootWhenReady( completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = -1; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -11264,16 +11269,14 @@ function commitRootWhenReady( } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -11366,8 +11369,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -11838,141 +11839,253 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); + root.cancelPendingCommit = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); + if (null !== finishedWork) { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = Internals.p; + Internals.p = 2; + updatedLanes = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (Internals.p = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ); } } -function commitRootImpl( +function flushMutationEffects(root, finishedWork) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root); + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + target = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = target.focusedElem, + priorSelectionRange = target.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 = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.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.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.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for (selection = priorFocusedElem; (selection = selection.parentNode); ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.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; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; +} +function flushLayoutEffects( root, + finishedWork, + lanes, recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes + didIncludeRenderPhaseUpdate ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; ReactSharedInternals.T = null; - updatedLanes = Internals.p; + var previousPriority = Internals.p; Internals.p = 2; - suspendedRetryLanes = executionContext; + var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$197 = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$197 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + : releaseRootPooledCache(root, root.pendingLanes); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + rootHasLayoutEffect = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) @@ -11995,7 +12108,6 @@ function commitRootImpl( : (currentEndTime = endTime); }); } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -12525,11 +12637,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -12542,7 +12650,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -13246,14 +13353,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$357; if (canUseDOM) { - var isSupported$jscomp$inline_1575 = "oninput" in document; - if (!isSupported$jscomp$inline_1575) { - var element$jscomp$inline_1576 = document.createElement("div"); - element$jscomp$inline_1576.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1575 = - "function" === typeof element$jscomp$inline_1576.oninput; + var isSupported$jscomp$inline_1587 = "oninput" in document; + if (!isSupported$jscomp$inline_1587) { + var element$jscomp$inline_1588 = document.createElement("div"); + element$jscomp$inline_1588.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1587 = + "function" === typeof element$jscomp$inline_1588.oninput; } - JSCompiler_inline_result$jscomp$357 = isSupported$jscomp$inline_1575; + JSCompiler_inline_result$jscomp$357 = isSupported$jscomp$inline_1587; } else JSCompiler_inline_result$jscomp$357 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$357 && @@ -13382,97 +13489,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, @@ -13667,20 +13683,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1616 = 0; - i$jscomp$inline_1616 < simpleEventPluginEvents.length; - i$jscomp$inline_1616++ + var i$jscomp$inline_1628 = 0; + i$jscomp$inline_1628 < simpleEventPluginEvents.length; + i$jscomp$inline_1628++ ) { - var eventName$jscomp$inline_1617 = - simpleEventPluginEvents[i$jscomp$inline_1616], - domEventName$jscomp$inline_1618 = - eventName$jscomp$inline_1617.toLowerCase(), - capitalizedEvent$jscomp$inline_1619 = - eventName$jscomp$inline_1617[0].toUpperCase() + - eventName$jscomp$inline_1617.slice(1); + var eventName$jscomp$inline_1629 = + simpleEventPluginEvents[i$jscomp$inline_1628], + domEventName$jscomp$inline_1630 = + eventName$jscomp$inline_1629.toLowerCase(), + capitalizedEvent$jscomp$inline_1631 = + eventName$jscomp$inline_1629[0].toUpperCase() + + eventName$jscomp$inline_1629.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1618, - "on" + capitalizedEvent$jscomp$inline_1619 + domEventName$jscomp$inline_1630, + "on" + capitalizedEvent$jscomp$inline_1631 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15576,11 +15592,6 @@ function createEvent(type, bubbles) { event.initEvent(type, bubbles, !1); return event; } -function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); -} function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -17315,16 +17326,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1789 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1801 = React.version; if ( - "19.1.0-www-modern-0de1233f-20250102" !== - isomorphicReactPackageVersion$jscomp$inline_1789 + "19.1.0-www-modern-220dece9-20250102" !== + isomorphicReactPackageVersion$jscomp$inline_1801 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1789, - "19.1.0-www-modern-0de1233f-20250102" + isomorphicReactPackageVersion$jscomp$inline_1801, + "19.1.0-www-modern-220dece9-20250102" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17340,24 +17351,24 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2323 = { +var internals$jscomp$inline_2333 = { bundleType: 0, - version: "19.1.0-www-modern-0de1233f-20250102", + version: "19.1.0-www-modern-220dece9-20250102", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-modern-220dece9-20250102" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2324 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2334 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2324.isDisabled && - hook$jscomp$inline_2324.supportsFiber + !hook$jscomp$inline_2334.isDisabled && + hook$jscomp$inline_2334.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2324.inject( - internals$jscomp$inline_2323 + (rendererID = hook$jscomp$inline_2334.inject( + internals$jscomp$inline_2333 )), - (injectedHook = hook$jscomp$inline_2324); + (injectedHook = hook$jscomp$inline_2334); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17861,4 +17872,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-modern-0de1233f-20250102"; +exports.version = "19.1.0-www-modern-220dece9-20250102"; diff --git a/compiled/facebook-www/ReactReconciler-dev.classic.js b/compiled/facebook-www/ReactReconciler-dev.classic.js index a338193846f9a..4472ed7295e20 100644 --- a/compiled/facebook-www/ReactReconciler-dev.classic.js +++ b/compiled/facebook-www/ReactReconciler-dev.classic.js @@ -998,14 +998,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -1015,29 +1014,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2501,7 +2501,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -2570,7 +2572,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -2635,7 +2638,10 @@ __DEV__ && workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -11245,6 +11251,7 @@ __DEV__ && } function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = prepareForCommit(root.containerInfo); + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -11339,10 +11346,7 @@ __DEV__ && nextEffect = root.return; } } - root = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return root; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -12093,12 +12097,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -14006,21 +14004,17 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( shouldTimeSlice, + forceSync, + lanes, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - exitStatus, - IMMEDIATE_COMMIT, - -0, - 0 + workInProgressSuspendedRetryLanes ); else { if ( @@ -14038,7 +14032,7 @@ __DEV__ && workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -14100,18 +14094,24 @@ __DEV__ && completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( (startSuspendingCommit(), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -14134,16 +14134,14 @@ __DEV__ && } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -14239,8 +14237,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -14882,174 +14878,197 @@ __DEV__ && } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = getCurrentUpdatePriority(); - try { - setCurrentUpdatePriority(2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - setCurrentUpdatePriority(previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { + root.cancelPendingCommit = 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.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + 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." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - 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." + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + updatedLanes = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + setCurrentUpdatePriority(spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; + } + } + function flushMutationEffects(root, finishedWork, lanes) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; ReactSharedInternals.T = null; - updatedLanes = getCurrentUpdatePriority(); + var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority(2); - suspendedRetryLanes = executionContext; + var prevExecutionContext = executionContext; executionContext |= CommitContext; - var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur && afterActiveInstanceBlur(); - resetAfterCommit(root.containerInfo); - root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && + try { + (inProgressLanes = lanes), + (inProgressRoot = root), + commitMutationEffectsOnFiber(finishedWork, root), + (inProgressRoot = inProgressLanes = null), + shouldFireAfterActiveInstanceBlur && afterActiveInstanceBlur(), + resetAfterCommit(root.containerInfo); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + } + function flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ) { + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = suspendedRetryLanes; - setCurrentUpdatePriority(updatedLanes); - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), + : (releaseRootPooledCache(root, root.pendingLanes), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); + previousPriority = root.pendingLanes; + 0 === previousPriority && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot$1(finishedWork.stateNode, rootHasLayoutEffect); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority], + errorInfo = makeErrorInfo(recoverableError.stack); runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo ); + } + } finally { + (ReactSharedInternals.T = finishedWork), + setCurrentUpdatePriority(rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + previousPriority = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -15075,7 +15094,6 @@ __DEV__ && : (currentEndTime = endTime); }); } - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -16036,11 +16054,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -16053,7 +16067,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -19064,7 +19077,7 @@ __DEV__ && version: rendererVersion, rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-classic-220dece9-20250102" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled/facebook-www/ReactReconciler-dev.modern.js b/compiled/facebook-www/ReactReconciler-dev.modern.js index cc06f5f4831a0..f044dd6bf83d0 100644 --- a/compiled/facebook-www/ReactReconciler-dev.modern.js +++ b/compiled/facebook-www/ReactReconciler-dev.modern.js @@ -904,14 +904,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -921,29 +920,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2407,7 +2407,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -2476,7 +2478,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -2541,7 +2544,10 @@ __DEV__ && workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -11063,6 +11069,7 @@ __DEV__ && } function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = prepareForCommit(root.containerInfo); + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -11157,10 +11164,7 @@ __DEV__ && nextEffect = root.return; } } - root = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return root; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -11911,12 +11915,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -13824,21 +13822,17 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( shouldTimeSlice, + forceSync, + lanes, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - exitStatus, - IMMEDIATE_COMMIT, - -0, - 0 + workInProgressSuspendedRetryLanes ); else { if ( @@ -13856,7 +13850,7 @@ __DEV__ && workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -13918,18 +13912,24 @@ __DEV__ && completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( (startSuspendingCommit(), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -13952,16 +13952,14 @@ __DEV__ && } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -14057,8 +14055,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -14696,174 +14692,197 @@ __DEV__ && } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = getCurrentUpdatePriority(); - try { - setCurrentUpdatePriority(2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - setCurrentUpdatePriority(previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { + root.cancelPendingCommit = 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.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + 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." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - 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." + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + updatedLanes = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + setCurrentUpdatePriority(spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; + } + } + function flushMutationEffects(root, finishedWork, lanes) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; ReactSharedInternals.T = null; - updatedLanes = getCurrentUpdatePriority(); + var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority(2); - suspendedRetryLanes = executionContext; + var prevExecutionContext = executionContext; executionContext |= CommitContext; - var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur && afterActiveInstanceBlur(); - resetAfterCommit(root.containerInfo); - root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && + try { + (inProgressLanes = lanes), + (inProgressRoot = root), + commitMutationEffectsOnFiber(finishedWork, root), + (inProgressRoot = inProgressLanes = null), + shouldFireAfterActiveInstanceBlur && afterActiveInstanceBlur(), + resetAfterCommit(root.containerInfo); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + } + function flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ) { + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = suspendedRetryLanes; - setCurrentUpdatePriority(updatedLanes); - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), + : (releaseRootPooledCache(root, root.pendingLanes), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); + previousPriority = root.pendingLanes; + 0 === previousPriority && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot$1(finishedWork.stateNode, rootHasLayoutEffect); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority], + errorInfo = makeErrorInfo(recoverableError.stack); runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo ); + } + } finally { + (ReactSharedInternals.T = finishedWork), + setCurrentUpdatePriority(rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + previousPriority = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -14889,7 +14908,6 @@ __DEV__ && : (currentEndTime = endTime); }); } - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -15850,11 +15868,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -15867,7 +15881,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -18838,7 +18851,7 @@ __DEV__ && version: rendererVersion, rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-modern-220dece9-20250102" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled/facebook-www/ReactReconciler-prod.classic.js b/compiled/facebook-www/ReactReconciler-prod.classic.js index b7446291c0a0a..4cac102c9888f 100644 --- a/compiled/facebook-www/ReactReconciler-prod.classic.js +++ b/compiled/facebook-www/ReactReconciler-prod.classic.js @@ -615,14 +615,13 @@ module.exports = function ($$$config) { return lanes; } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -632,29 +631,29 @@ module.exports = function ($$$config) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -1311,7 +1310,9 @@ module.exports = function ($$$config) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root, - root === workInProgressRoot ? JSCompiler_inline_result : 0 + root === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root, JSCompiler_inline_result) || @@ -1377,7 +1378,8 @@ module.exports = function ($$$config) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -1436,7 +1438,8 @@ module.exports = function ($$$config) { var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -7657,6 +7660,7 @@ module.exports = function ($$$config) { } function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = prepareForCommit(root.containerInfo); + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -7761,10 +7765,7 @@ module.exports = function ($$$config) { nextEffect = root.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -10076,8 +10077,6 @@ module.exports = function ($$$config) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -10090,7 +10089,7 @@ module.exports = function ($$$config) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -10151,18 +10150,24 @@ module.exports = function ($$$config) { completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( (startSuspendingCommit(), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -10180,16 +10185,14 @@ module.exports = function ($$$config) { } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -10282,8 +10285,6 @@ module.exports = function ($$$config) { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -10776,136 +10777,156 @@ module.exports = function ($$$config) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = getCurrentUpdatePriority(); - try { - setCurrentUpdatePriority(2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - setCurrentUpdatePriority(previousUpdateLanePriority); + root.cancelPendingCommit = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); + if (null !== finishedWork) { + if (finishedWork === root.current) + throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + updatedLanes = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + setCurrentUpdatePriority(spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ); + } + } + function flushMutationEffects(root, finishedWork) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root), + shouldFireAfterActiveInstanceBlur && afterActiveInstanceBlur(), + resetAfterCommit(root.containerInfo); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } } + root.current = finishedWork; } - function commitRootImpl( + function flushLayoutEffects( root, + finishedWork, + lanes, recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes + didIncludeRenderPhaseUpdate ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; ReactSharedInternals.T = null; - updatedLanes = getCurrentUpdatePriority(); + var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority(2); - suspendedRetryLanes = executionContext; + var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$180 = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$180 && afterActiveInstanceBlur(); - resetAfterCommit(root.containerInfo); - root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - requestPaint(); - executionContext = suspendedRetryLanes; - setCurrentUpdatePriority(updatedLanes); - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + : releaseRootPooledCache(root, root.pendingLanes); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + setCurrentUpdatePriority(rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + rootHasLayoutEffect = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) @@ -10929,7 +10950,6 @@ module.exports = function ($$$config) { : (currentEndTime = endTime); }); } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -11483,11 +11503,7 @@ module.exports = function ($$$config) { ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -11500,7 +11516,6 @@ module.exports = function ($$$config) { this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -12821,7 +12836,7 @@ module.exports = function ($$$config) { version: rendererVersion, rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-classic-220dece9-20250102" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled/facebook-www/ReactReconciler-prod.modern.js b/compiled/facebook-www/ReactReconciler-prod.modern.js index a18fe39677686..5898680b56c92 100644 --- a/compiled/facebook-www/ReactReconciler-prod.modern.js +++ b/compiled/facebook-www/ReactReconciler-prod.modern.js @@ -481,14 +481,13 @@ module.exports = function ($$$config) { return lanes; } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -498,29 +497,29 @@ module.exports = function ($$$config) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -1177,7 +1176,9 @@ module.exports = function ($$$config) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root, - root === workInProgressRoot ? JSCompiler_inline_result : 0 + root === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root, JSCompiler_inline_result) || @@ -1243,7 +1244,8 @@ module.exports = function ($$$config) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -1302,7 +1304,8 @@ module.exports = function ($$$config) { var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -7419,6 +7422,7 @@ module.exports = function ($$$config) { } function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = prepareForCommit(root.containerInfo); + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -7523,10 +7527,7 @@ module.exports = function ($$$config) { nextEffect = root.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -9838,8 +9839,6 @@ module.exports = function ($$$config) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -9852,7 +9851,7 @@ module.exports = function ($$$config) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -9913,18 +9912,24 @@ module.exports = function ($$$config) { completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( (startSuspendingCommit(), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -9942,16 +9947,14 @@ module.exports = function ($$$config) { } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -10044,8 +10047,6 @@ module.exports = function ($$$config) { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -10534,136 +10535,156 @@ module.exports = function ($$$config) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = getCurrentUpdatePriority(); - try { - setCurrentUpdatePriority(2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - setCurrentUpdatePriority(previousUpdateLanePriority); + root.cancelPendingCommit = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); + if (null !== finishedWork) { + if (finishedWork === root.current) + throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + updatedLanes = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + setCurrentUpdatePriority(spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects( + root, + finishedWork, + lanes, + recoverableErrors, + didIncludeRenderPhaseUpdate + ); + } + } + function flushMutationEffects(root, finishedWork) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root), + shouldFireAfterActiveInstanceBlur && afterActiveInstanceBlur(), + resetAfterCommit(root.containerInfo); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } } + root.current = finishedWork; } - function commitRootImpl( + function flushLayoutEffects( root, + finishedWork, + lanes, recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes + didIncludeRenderPhaseUpdate ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; ReactSharedInternals.T = null; - updatedLanes = getCurrentUpdatePriority(); + var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority(2); - suspendedRetryLanes = executionContext; + var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$180 = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$180 && afterActiveInstanceBlur(); - resetAfterCommit(root.containerInfo); - root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - requestPaint(); - executionContext = suspendedRetryLanes; - setCurrentUpdatePriority(updatedLanes); - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + : releaseRootPooledCache(root, root.pendingLanes); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + setCurrentUpdatePriority(rootHasLayoutEffect); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; + rootHasLayoutEffect = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) @@ -10687,7 +10708,6 @@ module.exports = function ($$$config) { : (currentEndTime = endTime); }); } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -11241,11 +11261,7 @@ module.exports = function ($$$config) { ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -11258,7 +11274,6 @@ module.exports = function ($$$config) { this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -12540,7 +12555,7 @@ module.exports = function ($$$config) { version: rendererVersion, rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-modern-220dece9-20250102" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled/facebook-www/ReactTestRenderer-dev.classic.js b/compiled/facebook-www/ReactTestRenderer-dev.classic.js index 12ccd5c898d99..af27bf9c62a54 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.classic.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.classic.js @@ -13,7 +13,7 @@ "use strict"; __DEV__ && (function () { - function JSCompiler_object_inline_createNodeMock_1097() { + function JSCompiler_object_inline_createNodeMock_1116() { return null; } function findHook(fiber, id) { @@ -702,41 +702,6 @@ __DEV__ && } return hook.checkDCE ? !0 : !1; } - function onCommitRoot(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), - error$jscomp$0( - "React instrumentation encountered an error: %s", - err - )); - } - } function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && (unstable_setDisableYieldValue(newIsStrictMode), @@ -815,14 +780,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -831,28 +795,29 @@ __DEV__ && : ((pingedLanes &= nonIdlePendingLanes), 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + : rootHasPendingCommit || + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + : rootHasPendingCommit || + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2049,7 +2014,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + -1 !== root.timeoutHandle )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -2109,7 +2076,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2173,7 +2141,10 @@ __DEV__ && workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -9125,7 +9096,7 @@ __DEV__ && if ( ((root = nextEffect), (firstChild = root.child), - 0 !== (root.subtreeFlags & 1028) && null !== firstChild) + 0 !== (root.subtreeFlags & 1024) && null !== firstChild) ) (firstChild.return = root), (nextEffect = firstChild); else @@ -9169,9 +9140,6 @@ __DEV__ && } nextEffect = root.return; } - root = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return root; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -10860,9 +10828,8 @@ __DEV__ && break; } a: { - renderWasConcurrent = root; - shouldTimeSlice = exitStatus; - switch (shouldTimeSlice) { + shouldTimeSlice = root; + switch (exitStatus) { case RootInProgress: case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); @@ -10870,7 +10837,7 @@ __DEV__ && if ((lanes & 4194176) !== lanes) break; case RootSuspendedAtTheShell: markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings @@ -10885,62 +10852,38 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - renderWasConcurrent.finishedWork = forceSync; - renderWasConcurrent.finishedLanes = lanes; - if (null !== ReactSharedInternals.actQueue) { - lanes = renderWasConcurrent; - forceSync = workInProgressRootRecoverableErrors; - exitStatus = workInProgressTransitions; - renderWasConcurrent = - workInProgressRootDidIncludeRecursiveRenderUpdate; - lanesThatJustErrored = workInProgressDeferredLane; - originallyAttemptedLanes = - workInProgressRootInterleavedUpdatedLanes; - var suspendedRetryLanes = workInProgressSuspendedRetryLanes, - suspendedCommitReason = IMMEDIATE_COMMIT, - prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - lanes, - forceSync, - exitStatus, - renderWasConcurrent, - previousUpdateLanePriority, - lanesThatJustErrored, - originallyAttemptedLanes, - suspendedRetryLanes, - shouldTimeSlice, - suspendedCommitReason, - -0, - 0 - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); - } - } else { + if (null !== ReactSharedInternals.actQueue) + commitRoot( + shouldTimeSlice, + forceSync, + lanes, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes + ); + else { if ( (lanes & 62914560) === lanes && - ((exitStatus = + ((renderWasConcurrent = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now$1()), - 10 < exitStatus) + 10 < renderWasConcurrent) ) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, - renderWasConcurrent, + shouldTimeSlice, forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, @@ -10950,17 +10893,17 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, - shouldTimeSlice, + exitStatus, THROTTLED_COMMIT, -0, 0 ), - exitStatus + renderWasConcurrent ); break a; } commitRootWhenReady( - renderWasConcurrent, + shouldTimeSlice, forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, @@ -10970,7 +10913,7 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, - shouldTimeSlice, + exitStatus, IMMEDIATE_COMMIT, -0, 0 @@ -10991,39 +10934,23 @@ __DEV__ && lanes, spawnedLane, updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - lanes = finishedWork.subtreeFlags; - (lanes & 8192 || 16785408 === (lanes & 16785408)) && + root.timeoutHandle = -1; + var subtreeFlags = finishedWork.subtreeFlags; + (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); - finishedWork = ReactSharedInternals.T; - lanes = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = finishedWork), - (currentUpdatePriority = lanes); - } + commitRoot( + root, + finishedWork, + lanes, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -11123,8 +11050,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -11649,119 +11574,199 @@ __DEV__ && workInProgressRootExitStatus = RootSuspendedAtTheShell; workInProgress = null; } - function commitRootImpl( + function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - renderPriorityLevel, spawnedLane, updatedLanes, suspendedRetryLanes ) { + root.cancelPendingCommit = 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.finishedWork; - didIncludeRenderPhaseUpdate = root.finishedLanes; - if (null === finishedWork) return null; - 0 === didIncludeRenderPhaseUpdate && - error$jscomp$0( - "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." + if (null !== finishedWork) { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + 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." + ); + didIncludeRenderPhaseUpdate = + finishedWork.lanes | finishedWork.childLanes; + didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - didIncludeRenderPhaseUpdate, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (updatedLanes = currentUpdatePriority), - (currentUpdatePriority = DiscreteEventPriority), - (suspendedRetryLanes = executionContext), - (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffectsOnFiber(finishedWork, root), - (root.current = finishedWork), - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), - requestPaint(), - (executionContext = suspendedRetryLanes), - (currentUpdatePriority = updatedLanes), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) - : (releaseRootPooledCache(root, remainingLanes), + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = + didIncludeRenderPhaseUpdate), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + updatedLanes = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (currentUpdatePriority = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects(root, finishedWork, lanes, recoverableErrors); + } + } + function flushMutationEffects(root, finishedWork) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + commitMutationEffectsOnFiber(finishedWork, root); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + } + function flushLayoutEffects(root, finishedWork, lanes, recoverableErrors) { + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? ((rootWithPendingPassiveEffects = root), + (pendingPassiveEffectsLanes = lanes)) + : (releaseRootPooledCache(root, root.pendingLanes), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), + previousPriority = root.pendingLanes; + 0 === previousPriority && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + finishedWork = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + var didError = 128 === (finishedWork.current.flags & 128); + switch (rootHasLayoutEffect) { + 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, + finishedWork, + schedulerPriority, + didError + ); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + error$jscomp$0( + "React instrumentation encountered an error: %s", + err + )); + } + if (null !== recoverableErrors) { + didError = ReactSharedInternals.T; + schedulerPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) { + var recoverableError = recoverableErrors[finishedWork], + errorInfo = makeErrorInfo(recoverableError.stack); runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo ); + } + } finally { + (ReactSharedInternals.T = didError), + (currentUpdatePriority = schedulerPriority); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - 0 !== (didIncludeRenderPhaseUpdate & 4194218) && - 0 !== (remainingLanes & 42) + previousPriority = root.pendingLanes; + 0 !== (lanes & 4194218) && 0 !== (previousPriority & 42) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); flushSyncWorkAcrossRoots_impl(0, !1); - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -12585,11 +12590,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -12602,7 +12603,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -14660,7 +14660,6 @@ __DEV__ && offscreenSubtreeWasHidden = !1, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, nextEffect = null, - shouldFireAfterActiveInstanceBlur = !1, hostParent = null, hostParentIsContainer = !1, suspenseyCommitFlag = 8192, @@ -14963,10 +14962,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-www-classic-0de1233f-20250102", + version: "19.1.0-www-classic-220dece9-20250102", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-classic-220dece9-20250102" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -14986,7 +14985,7 @@ __DEV__ && exports._Scheduler = Scheduler; exports.act = act; exports.create = function (element, options) { - var createNodeMock = JSCompiler_object_inline_createNodeMock_1097, + var createNodeMock = JSCompiler_object_inline_createNodeMock_1116, isConcurrentOnly = !0 !== global.IS_REACT_NATIVE_TEST_ENVIRONMENT, isConcurrent = isConcurrentOnly, isStrictMode = !1; @@ -15101,5 +15100,5 @@ __DEV__ && exports.unstable_batchedUpdates = function (fn, a) { return fn(a); }; - exports.version = "19.1.0-www-classic-0de1233f-20250102"; + exports.version = "19.1.0-www-classic-220dece9-20250102"; })(); diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index 79b9980371b27..4297b5ac9318b 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -13,7 +13,7 @@ "use strict"; __DEV__ && (function () { - function JSCompiler_object_inline_createNodeMock_1097() { + function JSCompiler_object_inline_createNodeMock_1116() { return null; } function findHook(fiber, id) { @@ -702,41 +702,6 @@ __DEV__ && } return hook.checkDCE ? !0 : !1; } - function onCommitRoot(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), - error$jscomp$0( - "React instrumentation encountered an error: %s", - err - )); - } - } function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && (unstable_setDisableYieldValue(newIsStrictMode), @@ -815,14 +780,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -831,28 +795,29 @@ __DEV__ && : ((pingedLanes &= nonIdlePendingLanes), 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + : rootHasPendingCommit || + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + : rootHasPendingCommit || + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2049,7 +2014,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + -1 !== root.timeoutHandle )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -2109,7 +2076,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2173,7 +2141,10 @@ __DEV__ && workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -9125,7 +9096,7 @@ __DEV__ && if ( ((root = nextEffect), (firstChild = root.child), - 0 !== (root.subtreeFlags & 1028) && null !== firstChild) + 0 !== (root.subtreeFlags & 1024) && null !== firstChild) ) (firstChild.return = root), (nextEffect = firstChild); else @@ -9169,9 +9140,6 @@ __DEV__ && } nextEffect = root.return; } - root = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return root; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -10860,9 +10828,8 @@ __DEV__ && break; } a: { - renderWasConcurrent = root; - shouldTimeSlice = exitStatus; - switch (shouldTimeSlice) { + shouldTimeSlice = root; + switch (exitStatus) { case RootInProgress: case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); @@ -10870,7 +10837,7 @@ __DEV__ && if ((lanes & 4194176) !== lanes) break; case RootSuspendedAtTheShell: markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings @@ -10885,62 +10852,38 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - renderWasConcurrent.finishedWork = forceSync; - renderWasConcurrent.finishedLanes = lanes; - if (null !== ReactSharedInternals.actQueue) { - lanes = renderWasConcurrent; - forceSync = workInProgressRootRecoverableErrors; - exitStatus = workInProgressTransitions; - renderWasConcurrent = - workInProgressRootDidIncludeRecursiveRenderUpdate; - lanesThatJustErrored = workInProgressDeferredLane; - originallyAttemptedLanes = - workInProgressRootInterleavedUpdatedLanes; - var suspendedRetryLanes = workInProgressSuspendedRetryLanes, - suspendedCommitReason = IMMEDIATE_COMMIT, - prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - lanes, - forceSync, - exitStatus, - renderWasConcurrent, - previousUpdateLanePriority, - lanesThatJustErrored, - originallyAttemptedLanes, - suspendedRetryLanes, - shouldTimeSlice, - suspendedCommitReason, - -0, - 0 - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); - } - } else { + if (null !== ReactSharedInternals.actQueue) + commitRoot( + shouldTimeSlice, + forceSync, + lanes, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes + ); + else { if ( (lanes & 62914560) === lanes && - ((exitStatus = + ((renderWasConcurrent = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now$1()), - 10 < exitStatus) + 10 < renderWasConcurrent) ) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, - renderWasConcurrent, + shouldTimeSlice, forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, @@ -10950,17 +10893,17 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, - shouldTimeSlice, + exitStatus, THROTTLED_COMMIT, -0, 0 ), - exitStatus + renderWasConcurrent ); break a; } commitRootWhenReady( - renderWasConcurrent, + shouldTimeSlice, forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, @@ -10970,7 +10913,7 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, - shouldTimeSlice, + exitStatus, IMMEDIATE_COMMIT, -0, 0 @@ -10991,39 +10934,23 @@ __DEV__ && lanes, spawnedLane, updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - lanes = finishedWork.subtreeFlags; - (lanes & 8192 || 16785408 === (lanes & 16785408)) && + root.timeoutHandle = -1; + var subtreeFlags = finishedWork.subtreeFlags; + (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); - finishedWork = ReactSharedInternals.T; - lanes = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = finishedWork), - (currentUpdatePriority = lanes); - } + commitRoot( + root, + finishedWork, + lanes, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -11123,8 +11050,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -11649,119 +11574,199 @@ __DEV__ && workInProgressRootExitStatus = RootSuspendedAtTheShell; workInProgress = null; } - function commitRootImpl( + function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - renderPriorityLevel, spawnedLane, updatedLanes, suspendedRetryLanes ) { + root.cancelPendingCommit = 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.finishedWork; - didIncludeRenderPhaseUpdate = root.finishedLanes; - if (null === finishedWork) return null; - 0 === didIncludeRenderPhaseUpdate && - error$jscomp$0( - "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." + if (null !== finishedWork) { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + 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." + ); + didIncludeRenderPhaseUpdate = + finishedWork.lanes | finishedWork.childLanes; + didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - didIncludeRenderPhaseUpdate, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (updatedLanes = currentUpdatePriority), - (currentUpdatePriority = DiscreteEventPriority), - (suspendedRetryLanes = executionContext), - (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffectsOnFiber(finishedWork, root), - (root.current = finishedWork), - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), - requestPaint(), - (executionContext = suspendedRetryLanes), - (currentUpdatePriority = updatedLanes), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) - : (releaseRootPooledCache(root, remainingLanes), + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((pendingPassiveEffectsRemainingLanes = + didIncludeRenderPhaseUpdate), + (pendingPassiveTransitions = transitions), + (root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + transitions = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + updatedLanes = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = updatedLanes), + (currentUpdatePriority = spawnedLane), + (ReactSharedInternals.T = transitions); + } + } + flushMutationEffects(root, finishedWork, lanes); + flushLayoutEffects(root, finishedWork, lanes, recoverableErrors); + } + } + function flushMutationEffects(root, finishedWork) { + var rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + commitMutationEffectsOnFiber(finishedWork, root); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + } + function flushLayoutEffects(root, finishedWork, lanes, recoverableErrors) { + var rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? ((rootWithPendingPassiveEffects = root), + (pendingPassiveEffectsLanes = lanes)) + : (releaseRootPooledCache(root, root.pendingLanes), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), + previousPriority = root.pendingLanes; + 0 === previousPriority && (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + finishedWork = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + var didError = 128 === (finishedWork.current.flags & 128); + switch (rootHasLayoutEffect) { + 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, + finishedWork, + schedulerPriority, + didError + ); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + error$jscomp$0( + "React instrumentation encountered an error: %s", + err + )); + } + if (null !== recoverableErrors) { + didError = ReactSharedInternals.T; + schedulerPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) { + var recoverableError = recoverableErrors[finishedWork], + errorInfo = makeErrorInfo(recoverableError.stack); runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo ); + } + } finally { + (ReactSharedInternals.T = didError), + (currentUpdatePriority = schedulerPriority); + } + } 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - 0 !== (didIncludeRenderPhaseUpdate & 4194218) && - 0 !== (remainingLanes & 42) + previousPriority = root.pendingLanes; + 0 !== (lanes & 4194218) && 0 !== (previousPriority & 42) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); flushSyncWorkAcrossRoots_impl(0, !1); - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -12585,11 +12590,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -12602,7 +12603,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -14660,7 +14660,6 @@ __DEV__ && offscreenSubtreeWasHidden = !1, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, nextEffect = null, - shouldFireAfterActiveInstanceBlur = !1, hostParent = null, hostParentIsContainer = !1, suspenseyCommitFlag = 8192, @@ -14963,10 +14962,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-www-modern-0de1233f-20250102", + version: "19.1.0-www-modern-220dece9-20250102", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0de1233f-20250102" + reconcilerVersion: "19.1.0-www-modern-220dece9-20250102" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -14986,7 +14985,7 @@ __DEV__ && exports._Scheduler = Scheduler; exports.act = act; exports.create = function (element, options) { - var createNodeMock = JSCompiler_object_inline_createNodeMock_1097, + var createNodeMock = JSCompiler_object_inline_createNodeMock_1116, isConcurrentOnly = !0 !== global.IS_REACT_NATIVE_TEST_ENVIRONMENT, isConcurrent = isConcurrentOnly, isStrictMode = !1; @@ -15101,5 +15100,5 @@ __DEV__ && exports.unstable_batchedUpdates = function (fn, a) { return fn(a); }; - exports.version = "19.1.0-www-modern-0de1233f-20250102"; + exports.version = "19.1.0-www-modern-220dece9-20250102"; })(); diff --git a/compiled/facebook-www/VERSION_CLASSIC b/compiled/facebook-www/VERSION_CLASSIC index 7bf86c7bf2fcf..75f286d474be1 100644 --- a/compiled/facebook-www/VERSION_CLASSIC +++ b/compiled/facebook-www/VERSION_CLASSIC @@ -1 +1 @@ -19.1.0-www-classic-0de1233f-20250102 \ No newline at end of file +19.1.0-www-classic-220dece9-20250102 \ No newline at end of file diff --git a/compiled/facebook-www/VERSION_MODERN b/compiled/facebook-www/VERSION_MODERN index a4a1165a53b54..9b877313e4bff 100644 --- a/compiled/facebook-www/VERSION_MODERN +++ b/compiled/facebook-www/VERSION_MODERN @@ -1 +1 @@ -19.1.0-www-modern-0de1233f-20250102 \ No newline at end of file +19.1.0-www-modern-220dece9-20250102 \ No newline at end of file diff --git a/compiled/facebook-www/__test_utils__/ReactAllWarnings.js b/compiled/facebook-www/__test_utils__/ReactAllWarnings.js index 5d5b294caf548..4e2d45505f05c 100644 --- a/compiled/facebook-www/__test_utils__/ReactAllWarnings.js +++ b/compiled/facebook-www/__test_utils__/ReactAllWarnings.js @@ -368,6 +368,7 @@ export default [ "dispatchCommand was called with a ref that isn't a native component. Use React.forwardRef to get access to the underlying native component", "does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().", "does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().", + "finishedLanes should not be empty during a commit. This is a bug in React.", "flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.", "forwardRef render functions accept exactly two parameters: props and ref. %s", "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?", @@ -385,7 +386,6 @@ export default [ "react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer", "ref.measureLayout must be called with a node handle or a ref to a native component.", "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition.", - "root.finishedLanes should not be empty during a commit. This is a bug in React.", "sendAccessibilityEvent was called with a ref that isn't a native component. Use React.forwardRef to get access to the underlying native component", "unmountComponentAtNode was removed in React 19. Use root.unmount() instead.", "unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",