From a56f5cf224eab26839d1287f8e35dce18f4decfa Mon Sep 17 00:00:00 2001 From: acdlite Date: Mon, 3 Jun 2024 15:25:35 +0000 Subject: [PATCH] useActionState: Transfer transition context (#29694) Mini-refactor of useActionState to only wrap the action in a transition context if the dispatch is called during a transition. Conceptually, the action starts as soon as the dispatch is called, even if the action is queued until earlier ones finish. We will also warn if an async action is dispatched outside of a transition, since that is almost certainly a mistake. Ideally we would automatically upgrade these to a transition, but we don't have a great way to tell if the action is async until after it's already run. DiffTrain build for [67b05be0d216c4efebc4bb5acb12c861a18bd87c](https://github.com/facebook/react/commit/67b05be0d216c4efebc4bb5acb12c861a18bd87c) --- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/REVISION_TRANSFORMS | 2 +- compiled/facebook-www/React-dev.classic.js | 2 +- compiled/facebook-www/React-dev.modern.js | 2 +- compiled/facebook-www/React-prod.classic.js | 2 +- compiled/facebook-www/React-prod.modern.js | 2 +- .../facebook-www/React-profiling.classic.js | 2 +- .../facebook-www/React-profiling.modern.js | 2 +- compiled/facebook-www/ReactART-dev.classic.js | 221 ++++-- compiled/facebook-www/ReactART-dev.modern.js | 221 ++++-- .../facebook-www/ReactART-prod.classic.js | 305 ++++---- compiled/facebook-www/ReactART-prod.modern.js | 303 ++++---- compiled/facebook-www/ReactDOM-dev.classic.js | 221 ++++-- compiled/facebook-www/ReactDOM-dev.modern.js | 221 ++++-- .../facebook-www/ReactDOM-prod.classic.js | 629 ++++++++-------- compiled/facebook-www/ReactDOM-prod.modern.js | 601 +++++++-------- .../ReactDOM-profiling.classic.js | 689 +++++++++--------- .../facebook-www/ReactDOM-profiling.modern.js | 661 +++++++++-------- .../ReactDOMServer-dev.classic.js | 2 +- .../facebook-www/ReactDOMServer-dev.modern.js | 2 +- .../ReactDOMServer-prod.classic.js | 2 +- .../ReactDOMServer-prod.modern.js | 2 +- .../ReactDOMTesting-dev.classic.js | 221 ++++-- .../ReactDOMTesting-dev.modern.js | 221 ++++-- .../ReactDOMTesting-prod.classic.js | 637 ++++++++-------- .../ReactDOMTesting-prod.modern.js | 609 ++++++++-------- .../ReactReconciler-dev.classic.js | 221 ++++-- .../ReactReconciler-dev.modern.js | 221 ++++-- .../ReactReconciler-prod.classic.js | 409 ++++++----- .../ReactReconciler-prod.modern.js | 407 ++++++----- .../ReactTestRenderer-dev.classic.js | 221 ++++-- .../ReactTestRenderer-dev.modern.js | 221 ++++-- compiled/facebook-www/VERSION_CLASSIC | 2 +- compiled/facebook-www/VERSION_MODERN | 2 +- .../__test_utils__/ReactAllWarnings.js | 1 + 35 files changed, 4247 insertions(+), 3242 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 6790c9b3a688d..0bb7302f2a8e8 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -def67b9b329c8aa204e611cd510c5a64680aee58 +67b05be0d216c4efebc4bb5acb12c861a18bd87c diff --git a/compiled/facebook-www/REVISION_TRANSFORMS b/compiled/facebook-www/REVISION_TRANSFORMS index 6790c9b3a688d..0bb7302f2a8e8 100644 --- a/compiled/facebook-www/REVISION_TRANSFORMS +++ b/compiled/facebook-www/REVISION_TRANSFORMS @@ -1 +1 @@ -def67b9b329c8aa204e611cd510c5a64680aee58 +67b05be0d216c4efebc4bb5acb12c861a18bd87c diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index 45df79f5b5ecc..22b070f5ec880 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -22,7 +22,7 @@ if ( ) { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); } -var ReactVersion = '19.0.0-www-classic-def67b9b32-20240603'; +var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603'; // Re-export dynamic flags from the www version. var dynamicFeatureFlags = require('ReactFeatureFlags'); diff --git a/compiled/facebook-www/React-dev.modern.js b/compiled/facebook-www/React-dev.modern.js index 1624fb4f2e76b..190c8de2d2a97 100644 --- a/compiled/facebook-www/React-dev.modern.js +++ b/compiled/facebook-www/React-dev.modern.js @@ -22,7 +22,7 @@ if ( ) { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); } -var ReactVersion = '19.0.0-www-modern-def67b9b32-20240603'; +var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603'; // Re-export dynamic flags from the www version. var dynamicFeatureFlags = require('ReactFeatureFlags'); diff --git a/compiled/facebook-www/React-prod.classic.js b/compiled/facebook-www/React-prod.classic.js index c2972b811d4d3..c84fb10250233 100644 --- a/compiled/facebook-www/React-prod.classic.js +++ b/compiled/facebook-www/React-prod.classic.js @@ -684,4 +684,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-classic-def67b9b32-20240603"; +exports.version = "19.0.0-www-classic-67b05be0d2-20240603"; diff --git a/compiled/facebook-www/React-prod.modern.js b/compiled/facebook-www/React-prod.modern.js index 9fb165217b7e9..9753e26803af7 100644 --- a/compiled/facebook-www/React-prod.modern.js +++ b/compiled/facebook-www/React-prod.modern.js @@ -684,4 +684,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-modern-def67b9b32-20240603"; +exports.version = "19.0.0-www-modern-67b05be0d2-20240603"; diff --git a/compiled/facebook-www/React-profiling.classic.js b/compiled/facebook-www/React-profiling.classic.js index 0158352a2676d..f5d2001d3fb33 100644 --- a/compiled/facebook-www/React-profiling.classic.js +++ b/compiled/facebook-www/React-profiling.classic.js @@ -688,7 +688,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-classic-def67b9b32-20240603"; +exports.version = "19.0.0-www-classic-67b05be0d2-20240603"; "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 0927871bd6a18..2f79119cf71af 100644 --- a/compiled/facebook-www/React-profiling.modern.js +++ b/compiled/facebook-www/React-profiling.modern.js @@ -688,7 +688,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-modern-def67b9b32-20240603"; +exports.version = "19.0.0-www-modern-67b05be0d2-20240603"; "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 80c94d40174f0..cd9e2296186b9 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -60,7 +60,7 @@ function _assertThisInitialized(self) { return self; } -var ReactVersion = '19.0.0-www-classic-def67b9b32-20240603'; +var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603'; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -9272,112 +9272,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl throw new Error('Cannot update form state while rendering.'); } + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + // circular + isTransition: true, + status: 'pending', + value: null, + reason: null, + listeners: [], + then: function (listener) { + // We know the only thing that subscribes to these promises is `use` so + // this implementation is simpler than a generic thenable. E.g. we don't + // bother to check if the thenable is still pending because `use` already + // does that. + actionNode.listeners.push(listener); + } + }; // Check if we're inside a transition. If so, we'll need to restore the + // transition context when the action is run. + + var prevTransition = ReactSharedInternals.T; + + if (prevTransition !== null) { + // Optimistically update the pending state, similar to useTransition. + // This will be reverted automatically when all actions are finished. + setPendingState(true); // `actionNode` is a thenable that resolves to the return value of + // the action. + + setState(actionNode); + } else { + // This is not a transition. + actionNode.isTransition = false; + setState(actionNode); + } + var last = actionQueue.pending; if (last === null) { // There are no pending actions; this is the first one. We can run // it immediately. - var newLast = { - payload: payload, - action: actionQueue.action, - next: null // circular - - }; - newLast.next = actionQueue.pending = newLast; - runActionStateAction(actionQueue, setPendingState, setState, newLast); + actionNode.next = actionQueue.pending = actionNode; + runActionStateAction(actionQueue, actionNode); } else { // There's already an action running. Add to the queue. var first = last.next; - var _newLast = { - payload: payload, - action: actionQueue.action, - next: first - }; - actionQueue.pending = last.next = _newLast; + actionNode.next = first; + actionQueue.pending = last.next = actionNode; } } -function runActionStateAction(actionQueue, setPendingState, setState, node) { - // This is a fork of startTransition - var prevTransition = ReactSharedInternals.T; - var currentTransition = {}; - ReactSharedInternals.T = currentTransition; - - { - ReactSharedInternals.T._updatedFibers = new Set(); - } // Optimistically update the pending state, similar to useTransition. - // This will be reverted automatically when all actions are finished. - - - setPendingState(true); // `node.action` represents the action function at the time it was dispatched. +function runActionStateAction(actionQueue, node) { + // `node.action` represents the action function at the time it was dispatched. // If this action was queued, it might be stale, i.e. it's not necessarily the // most current implementation of the action, stored on `actionQueue`. This is // intentional. The conceptual model for queued actions is that they are // queued in a remote worker; the dispatch happens immediately, only the // execution is delayed. - var action = node.action; var payload = node.payload; var prevState = actionQueue.state; - try { - var returnValue = action(prevState, payload); - var onStartTransitionFinish = ReactSharedInternals.S; + if (node.isTransition) { + // The original dispatch was part of a transition. We restore its + // transition context here. + // This is a fork of startTransition + var prevTransition = ReactSharedInternals.T; + var currentTransition = {}; + ReactSharedInternals.T = currentTransition; - if (onStartTransitionFinish !== null) { - onStartTransitionFinish(currentTransition, returnValue); + { + ReactSharedInternals.T._updatedFibers = new Set(); } - if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] - typeof returnValue.then === 'function') { - var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as - // this resolves, we can run the next action in the sequence. + try { + var returnValue = action(prevState, payload); + var onStartTransitionFinish = ReactSharedInternals.S; - thenable.then(function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - }, function () { - return finishRunningActionStateAction(actionQueue, setPendingState, setState); - }); - setState(thenable); - } else { - setState(returnValue); - var nextState = returnValue; - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } - } catch (error) { - // This is a trick to get the `useActionState` hook to rethrow the error. - // When it unwraps the thenable with the `use` algorithm, the error - // will be thrown. - var rejectedThenable = { - then: function () {}, - status: 'rejected', - reason: error // $FlowFixMe: Not sure why this doesn't work + if (onStartTransitionFinish !== null) { + onStartTransitionFinish(currentTransition, returnValue); + } - }; - setState(rejectedThenable); - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; - { - if (prevTransition === null && currentTransition._updatedFibers) { - var updatedFibersCount = currentTransition._updatedFibers.size; + { + if (prevTransition === null && currentTransition._updatedFibers) { + var updatedFibersCount = currentTransition._updatedFibers.size; - currentTransition._updatedFibers.clear(); + currentTransition._updatedFibers.clear(); - if (updatedFibersCount > 10) { - warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + if (updatedFibersCount > 10) { + warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + } } } } + } else { + // The original dispatch was not part of a transition. + try { + var _returnValue = action(prevState, payload); + + handleActionReturnValue(actionQueue, node, _returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } + } +} + +function handleActionReturnValue(actionQueue, node, returnValue) { + if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] + typeof returnValue.then === 'function') { + var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as + // this resolves, we can run the next action in the sequence. + + thenable.then(function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, function (error) { + return onActionError(actionQueue, node, error); + }); + + { + if (!node.isTransition) { + error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`'); + } + } + } else { + var nextState = returnValue; + onActionSuccess(actionQueue, node, nextState); } } -function finishRunningActionStateAction(actionQueue, setPendingState, setState) { - // The action finished running. Pop it from the queue and run the next pending - // action, if there are any. +function onActionSuccess(actionQueue, actionNode, nextState) { + // The action finished running. + actionNode.status = 'fulfilled'; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there + // are any. + var last = actionQueue.pending; if (last !== null) { @@ -9391,11 +9427,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState) var next = first.next; last.next = next; // Run the next action. - runActionStateAction(actionQueue, setPendingState, setState, next); + runActionStateAction(actionQueue, next); } } } +function onActionError(actionQueue, actionNode, error) { + actionNode.status = 'rejected'; + actionNode.reason = error; + notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there + // are any. + // TODO: We should instead abort all the remaining actions in the queue. + + var last = actionQueue.pending; + + if (last !== null) { + var first = last.next; + + if (first === last) { + // This was the last action in the queue. + actionQueue.pending = null; + } else { + // Remove the first node from the circular queue. + var next = first.next; + last.next = next; // Run the next action. + + runActionStateAction(actionQueue, next); + } + } +} + +function notifyActionListeners(actionNode) { + // Notify React that the action has finished. + var listeners = actionNode.listeners; + + for (var i = 0; i < listeners.length; i++) { + // This is always a React internal listener, so we don't need to worry + // about it throwing. + var listener = listeners[i]; + listener(); + } +} + function actionStateReducer(oldState, newState) { return newState; } diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index cf1369babbd60..23fe2f0072dee 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -60,7 +60,7 @@ function _assertThisInitialized(self) { return self; } -var ReactVersion = '19.0.0-www-modern-def67b9b32-20240603'; +var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603'; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -9061,112 +9061,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl throw new Error('Cannot update form state while rendering.'); } + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + // circular + isTransition: true, + status: 'pending', + value: null, + reason: null, + listeners: [], + then: function (listener) { + // We know the only thing that subscribes to these promises is `use` so + // this implementation is simpler than a generic thenable. E.g. we don't + // bother to check if the thenable is still pending because `use` already + // does that. + actionNode.listeners.push(listener); + } + }; // Check if we're inside a transition. If so, we'll need to restore the + // transition context when the action is run. + + var prevTransition = ReactSharedInternals.T; + + if (prevTransition !== null) { + // Optimistically update the pending state, similar to useTransition. + // This will be reverted automatically when all actions are finished. + setPendingState(true); // `actionNode` is a thenable that resolves to the return value of + // the action. + + setState(actionNode); + } else { + // This is not a transition. + actionNode.isTransition = false; + setState(actionNode); + } + var last = actionQueue.pending; if (last === null) { // There are no pending actions; this is the first one. We can run // it immediately. - var newLast = { - payload: payload, - action: actionQueue.action, - next: null // circular - - }; - newLast.next = actionQueue.pending = newLast; - runActionStateAction(actionQueue, setPendingState, setState, newLast); + actionNode.next = actionQueue.pending = actionNode; + runActionStateAction(actionQueue, actionNode); } else { // There's already an action running. Add to the queue. var first = last.next; - var _newLast = { - payload: payload, - action: actionQueue.action, - next: first - }; - actionQueue.pending = last.next = _newLast; + actionNode.next = first; + actionQueue.pending = last.next = actionNode; } } -function runActionStateAction(actionQueue, setPendingState, setState, node) { - // This is a fork of startTransition - var prevTransition = ReactSharedInternals.T; - var currentTransition = {}; - ReactSharedInternals.T = currentTransition; - - { - ReactSharedInternals.T._updatedFibers = new Set(); - } // Optimistically update the pending state, similar to useTransition. - // This will be reverted automatically when all actions are finished. - - - setPendingState(true); // `node.action` represents the action function at the time it was dispatched. +function runActionStateAction(actionQueue, node) { + // `node.action` represents the action function at the time it was dispatched. // If this action was queued, it might be stale, i.e. it's not necessarily the // most current implementation of the action, stored on `actionQueue`. This is // intentional. The conceptual model for queued actions is that they are // queued in a remote worker; the dispatch happens immediately, only the // execution is delayed. - var action = node.action; var payload = node.payload; var prevState = actionQueue.state; - try { - var returnValue = action(prevState, payload); - var onStartTransitionFinish = ReactSharedInternals.S; + if (node.isTransition) { + // The original dispatch was part of a transition. We restore its + // transition context here. + // This is a fork of startTransition + var prevTransition = ReactSharedInternals.T; + var currentTransition = {}; + ReactSharedInternals.T = currentTransition; - if (onStartTransitionFinish !== null) { - onStartTransitionFinish(currentTransition, returnValue); + { + ReactSharedInternals.T._updatedFibers = new Set(); } - if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] - typeof returnValue.then === 'function') { - var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as - // this resolves, we can run the next action in the sequence. + try { + var returnValue = action(prevState, payload); + var onStartTransitionFinish = ReactSharedInternals.S; - thenable.then(function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - }, function () { - return finishRunningActionStateAction(actionQueue, setPendingState, setState); - }); - setState(thenable); - } else { - setState(returnValue); - var nextState = returnValue; - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } - } catch (error) { - // This is a trick to get the `useActionState` hook to rethrow the error. - // When it unwraps the thenable with the `use` algorithm, the error - // will be thrown. - var rejectedThenable = { - then: function () {}, - status: 'rejected', - reason: error // $FlowFixMe: Not sure why this doesn't work + if (onStartTransitionFinish !== null) { + onStartTransitionFinish(currentTransition, returnValue); + } - }; - setState(rejectedThenable); - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; - { - if (prevTransition === null && currentTransition._updatedFibers) { - var updatedFibersCount = currentTransition._updatedFibers.size; + { + if (prevTransition === null && currentTransition._updatedFibers) { + var updatedFibersCount = currentTransition._updatedFibers.size; - currentTransition._updatedFibers.clear(); + currentTransition._updatedFibers.clear(); - if (updatedFibersCount > 10) { - warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + if (updatedFibersCount > 10) { + warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + } } } } + } else { + // The original dispatch was not part of a transition. + try { + var _returnValue = action(prevState, payload); + + handleActionReturnValue(actionQueue, node, _returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } + } +} + +function handleActionReturnValue(actionQueue, node, returnValue) { + if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] + typeof returnValue.then === 'function') { + var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as + // this resolves, we can run the next action in the sequence. + + thenable.then(function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, function (error) { + return onActionError(actionQueue, node, error); + }); + + { + if (!node.isTransition) { + error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`'); + } + } + } else { + var nextState = returnValue; + onActionSuccess(actionQueue, node, nextState); } } -function finishRunningActionStateAction(actionQueue, setPendingState, setState) { - // The action finished running. Pop it from the queue and run the next pending - // action, if there are any. +function onActionSuccess(actionQueue, actionNode, nextState) { + // The action finished running. + actionNode.status = 'fulfilled'; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there + // are any. + var last = actionQueue.pending; if (last !== null) { @@ -9180,11 +9216,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState) var next = first.next; last.next = next; // Run the next action. - runActionStateAction(actionQueue, setPendingState, setState, next); + runActionStateAction(actionQueue, next); } } } +function onActionError(actionQueue, actionNode, error) { + actionNode.status = 'rejected'; + actionNode.reason = error; + notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there + // are any. + // TODO: We should instead abort all the remaining actions in the queue. + + var last = actionQueue.pending; + + if (last !== null) { + var first = last.next; + + if (first === last) { + // This was the last action in the queue. + actionQueue.pending = null; + } else { + // Remove the first node from the circular queue. + var next = first.next; + last.next = next; // Run the next action. + + runActionStateAction(actionQueue, next); + } + } +} + +function notifyActionListeners(actionNode) { + // Notify React that the action has finished. + var listeners = actionNode.listeners; + + for (var i = 0; i < listeners.length; i++) { + // This is always a React internal listener, so we don't need to worry + // about it throwing. + var listener = listeners[i]; + listener(); + } +} + function actionStateReducer(oldState, newState) { return newState; } diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js index 2f3bfff3473c9..0a68f5c3acfa3 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -3018,72 +3018,101 @@ function dispatchActionState( payload ) { if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); fiber = actionQueue.pending; null === fiber - ? ((payload = { payload: payload, action: actionQueue.action, next: null }), - (payload.next = actionQueue.pending = payload), - runActionStateAction(actionQueue, setPendingState, setState, payload)) - : (actionQueue.pending = fiber.next = - { payload: payload, action: actionQueue.action, next: fiber.next }); -} -function runActionStateAction(actionQueue, setPendingState, setState, node) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - setPendingState(!0); - var action = node.action; - node = node.payload; - var prevState = actionQueue.state; - try { - var returnValue = action(prevState, node), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - }, - function () { - return finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - } - ), - setState(returnValue)) - : (setState(returnValue), - (actionQueue.state = returnValue), - finishRunningActionStateAction(actionQueue, setPendingState, setState)); - } catch (error) { - setState({ then: function () {}, status: "rejected", reason: error }), - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; - } + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = fiber.next), + (actionQueue.pending = fiber.next = actionNode)); +} +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; + } + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$39) { + onActionError(actionQueue, node, error$39); + } } -function finishRunningActionStateAction( - actionQueue, - setPendingState, - setState -) { - var last = actionQueue.pending; - if (null !== last) { - var first = last.next; - first === last +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); +} +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode ? (actionQueue.pending = null) - : ((first = first.next), - (last.next = first), - runActionStateAction(actionQueue, setPendingState, setState, first)); - } + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + actionNode.status = "rejected"; + actionNode.reason = error; + notifyActionListeners(actionNode); + actionNode = actionQueue.pending; + null !== actionNode && + ((error = actionNode.next), + error === actionNode + ? (actionQueue.pending = null) + : ((error = error.next), + (actionNode.next = error), + runActionStateAction(actionQueue, error))); +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); } function actionStateReducer(oldState, newState) { return newState; @@ -3955,9 +3984,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$40 in Component) - void 0 === newProps[propName$40] && - (newProps[propName$40] = Component[propName$40]); + for (var propName$41 in Component) + void 0 === newProps[propName$41] && + (newProps[propName$41] = Component[propName$41]); } return newProps; } @@ -6538,14 +6567,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$87 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$87 = lastTailNode), + for (var lastTailNode$88 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$88 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$87 + null === lastTailNode$88 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$87.sibling = null); + : (lastTailNode$88.sibling = null); } } function bubbleProperties(completedWork) { @@ -6555,19 +6584,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$88 = completedWork.child; null !== child$88; ) - (newChildLanes |= child$88.lanes | child$88.childLanes), - (subtreeFlags |= child$88.subtreeFlags & 31457280), - (subtreeFlags |= child$88.flags & 31457280), - (child$88.return = completedWork), - (child$88 = child$88.sibling); + for (var child$89 = completedWork.child; null !== child$89; ) + (newChildLanes |= child$89.lanes | child$89.childLanes), + (subtreeFlags |= child$89.subtreeFlags & 31457280), + (subtreeFlags |= child$89.flags & 31457280), + (child$89.return = completedWork), + (child$89 = child$89.sibling); else - for (child$88 = completedWork.child; null !== child$88; ) - (newChildLanes |= child$88.lanes | child$88.childLanes), - (subtreeFlags |= child$88.subtreeFlags), - (subtreeFlags |= child$88.flags), - (child$88.return = completedWork), - (child$88 = child$88.sibling); + for (child$89 = completedWork.child; null !== child$89; ) + (newChildLanes |= child$89.lanes | child$89.childLanes), + (subtreeFlags |= child$89.subtreeFlags), + (subtreeFlags |= child$89.flags), + (child$89.return = completedWork), + (child$89 = child$89.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -6745,11 +6774,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (instance = newProps.alternate.memoizedState.cachePool.pool); - var cache$92 = null; + var cache$93 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$92 = newProps.memoizedState.cachePool.pool); - cache$92 !== instance && (newProps.flags |= 2048); + (cache$93 = newProps.memoizedState.cachePool.pool); + cache$93 !== instance && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -6783,8 +6812,8 @@ function completeWork(current, workInProgress, renderLanes) { instance = workInProgress.memoizedState; if (null === instance) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$92 = instance.rendering; - if (null === cache$92) + cache$93 = instance.rendering; + if (null === cache$93) if (newProps) cutOffTailIfNeeded(instance, !1); else { if ( @@ -6792,11 +6821,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$92 = findFirstSuspended(current); - if (null !== cache$92) { + cache$93 = findFirstSuspended(current); + if (null !== cache$93) { workInProgress.flags |= 128; cutOffTailIfNeeded(instance, !1); - current = cache$92.updateQueue; + current = cache$93.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6821,7 +6850,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$92)), null !== current)) { + if (((current = findFirstSuspended(cache$93)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6831,7 +6860,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !0), null === instance.tail && "hidden" === instance.tailMode && - !cache$92.alternate) + !cache$93.alternate) ) return bubbleProperties(workInProgress), null; } else @@ -6843,13 +6872,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !1), (workInProgress.lanes = 4194304)); instance.isBackwards - ? ((cache$92.sibling = workInProgress.child), - (workInProgress.child = cache$92)) + ? ((cache$93.sibling = workInProgress.child), + (workInProgress.child = cache$93)) : ((current = instance.last), null !== current - ? (current.sibling = cache$92) - : (workInProgress.child = cache$92), - (instance.last = cache$92)); + ? (current.sibling = cache$93) + : (workInProgress.child = cache$93), + (instance.last = cache$93)); } if (null !== instance.tail) return ( @@ -7121,8 +7150,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$110) { - captureCommitPhaseError(current, nearestMountedAncestor, error$110); + } catch (error$111) { + captureCommitPhaseError(current, nearestMountedAncestor, error$111); } else ref.current = null; } @@ -7326,11 +7355,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$111) { + } catch (error$112) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$111 + error$112 ); } } @@ -7921,8 +7950,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$119) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$119); + } catch (error$120) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$120); } } break; @@ -7955,8 +7984,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { current = null !== current ? current.memoizedProps : newProps; try { flags._applyProps(flags, newProps, current); - } catch (error$122) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$122); + } catch (error$123) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$123); } } break; @@ -7992,8 +8021,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$124) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$124); + } catch (error$125) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$125); } flags = finishedWork.updateQueue; null !== flags && @@ -8133,12 +8162,12 @@ function commitReconciliationEffects(finishedWork) { break; case 3: case 4: - var parent$114 = JSCompiler_inline_result.stateNode.containerInfo, - before$115 = getHostSibling(finishedWork); + var parent$115 = JSCompiler_inline_result.stateNode.containerInfo, + before$116 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$115, - parent$114 + before$116, + parent$115 ); break; default: @@ -8596,9 +8625,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$134 = finishedWork.stateNode; + var instance$135 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$134._visibility & 4 + ? instance$135._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8611,7 +8640,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$134._visibility |= 4), + : ((instance$135._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8619,7 +8648,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$134._visibility |= 4), + : ((instance$135._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8632,7 +8661,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$134 + instance$135 ); break; case 24: @@ -8726,12 +8755,12 @@ function accumulateSuspenseyCommitOnFiber(fiber) { break; case 22: if (null === fiber.memoizedState) { - var current$139 = fiber.alternate; - null !== current$139 && null !== current$139.memoizedState - ? ((current$139 = suspenseyCommitFlag), + var current$140 = fiber.alternate; + null !== current$140 && null !== current$140.memoizedState + ? ((current$140 = suspenseyCommitFlag), (suspenseyCommitFlag = 16777216), recursivelyAccumulateSuspenseyCommit(fiber), - (suspenseyCommitFlag = current$139)) + (suspenseyCommitFlag = current$140)) : recursivelyAccumulateSuspenseyCommit(fiber); } break; @@ -9539,8 +9568,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$145) { - handleThrow(root, thrownValue$145); + } catch (thrownValue$146) { + handleThrow(root, thrownValue$146); } while (1); lanes && root.shellSuspendCounter++; @@ -9649,8 +9678,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$147) { - handleThrow(root, thrownValue$147); + } catch (thrownValue$148) { + handleThrow(root, thrownValue$148); } while (1); resetContextDependencies(); @@ -10640,19 +10669,19 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component), - devToolsConfig$jscomp$inline_1158 = { + devToolsConfig$jscomp$inline_1159 = { findFiberByHostInstance: function () { return null; }, bundleType: 0, - version: "19.0.0-www-classic-def67b9b32-20240603", + version: "19.0.0-www-classic-67b05be0d2-20240603", rendererPackageName: "react-art" }; -var internals$jscomp$inline_1370 = { - bundleType: devToolsConfig$jscomp$inline_1158.bundleType, - version: devToolsConfig$jscomp$inline_1158.version, - rendererPackageName: devToolsConfig$jscomp$inline_1158.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1158.rendererConfig, +var internals$jscomp$inline_1371 = { + bundleType: devToolsConfig$jscomp$inline_1159.bundleType, + version: devToolsConfig$jscomp$inline_1159.version, + rendererPackageName: devToolsConfig$jscomp$inline_1159.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1159.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10669,26 +10698,26 @@ var internals$jscomp$inline_1370 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1158.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1159.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-def67b9b32-20240603" + reconcilerVersion: "19.0.0-www-classic-67b05be0d2-20240603" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1371 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1372 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1371.isDisabled && - hook$jscomp$inline_1371.supportsFiber + !hook$jscomp$inline_1372.isDisabled && + hook$jscomp$inline_1372.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1371.inject( - internals$jscomp$inline_1370 + (rendererID = hook$jscomp$inline_1372.inject( + internals$jscomp$inline_1371 )), - (injectedHook = hook$jscomp$inline_1371); + (injectedHook = hook$jscomp$inline_1372); } catch (err) {} } var Path = Mode$1.Path; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index a1794b6362ce9..049ec474301dd 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -2816,72 +2816,101 @@ function dispatchActionState( payload ) { if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); fiber = actionQueue.pending; null === fiber - ? ((payload = { payload: payload, action: actionQueue.action, next: null }), - (payload.next = actionQueue.pending = payload), - runActionStateAction(actionQueue, setPendingState, setState, payload)) - : (actionQueue.pending = fiber.next = - { payload: payload, action: actionQueue.action, next: fiber.next }); -} -function runActionStateAction(actionQueue, setPendingState, setState, node) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - setPendingState(!0); - var action = node.action; - node = node.payload; - var prevState = actionQueue.state; - try { - var returnValue = action(prevState, node), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - }, - function () { - return finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - } - ), - setState(returnValue)) - : (setState(returnValue), - (actionQueue.state = returnValue), - finishRunningActionStateAction(actionQueue, setPendingState, setState)); - } catch (error) { - setState({ then: function () {}, status: "rejected", reason: error }), - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; - } + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = fiber.next), + (actionQueue.pending = fiber.next = actionNode)); +} +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; + } + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$39) { + onActionError(actionQueue, node, error$39); + } } -function finishRunningActionStateAction( - actionQueue, - setPendingState, - setState -) { - var last = actionQueue.pending; - if (null !== last) { - var first = last.next; - first === last +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); +} +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode ? (actionQueue.pending = null) - : ((first = first.next), - (last.next = first), - runActionStateAction(actionQueue, setPendingState, setState, first)); - } + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + actionNode.status = "rejected"; + actionNode.reason = error; + notifyActionListeners(actionNode); + actionNode = actionQueue.pending; + null !== actionNode && + ((error = actionNode.next), + error === actionNode + ? (actionQueue.pending = null) + : ((error = error.next), + (actionNode.next = error), + runActionStateAction(actionQueue, error))); +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); } function actionStateReducer(oldState, newState) { return newState; @@ -3691,9 +3720,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$40 in Component) - void 0 === newProps[propName$40] && - (newProps[propName$40] = Component[propName$40]); + for (var propName$41 in Component) + void 0 === newProps[propName$41] && + (newProps[propName$41] = Component[propName$41]); } return newProps; } @@ -6122,14 +6151,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$79 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$79 = lastTailNode), + for (var lastTailNode$80 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$80 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$79 + null === lastTailNode$80 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$79.sibling = null); + : (lastTailNode$80.sibling = null); } } function bubbleProperties(completedWork) { @@ -6139,19 +6168,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$80 = completedWork.child; null !== child$80; ) - (newChildLanes |= child$80.lanes | child$80.childLanes), - (subtreeFlags |= child$80.subtreeFlags & 31457280), - (subtreeFlags |= child$80.flags & 31457280), - (child$80.return = completedWork), - (child$80 = child$80.sibling); + for (var child$81 = completedWork.child; null !== child$81; ) + (newChildLanes |= child$81.lanes | child$81.childLanes), + (subtreeFlags |= child$81.subtreeFlags & 31457280), + (subtreeFlags |= child$81.flags & 31457280), + (child$81.return = completedWork), + (child$81 = child$81.sibling); else - for (child$80 = completedWork.child; null !== child$80; ) - (newChildLanes |= child$80.lanes | child$80.childLanes), - (subtreeFlags |= child$80.subtreeFlags), - (subtreeFlags |= child$80.flags), - (child$80.return = completedWork), - (child$80 = child$80.sibling); + for (child$81 = completedWork.child; null !== child$81; ) + (newChildLanes |= child$81.lanes | child$81.childLanes), + (subtreeFlags |= child$81.subtreeFlags), + (subtreeFlags |= child$81.flags), + (child$81.return = completedWork), + (child$81 = child$81.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -6322,11 +6351,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (instance = newProps.alternate.memoizedState.cachePool.pool); - var cache$84 = null; + var cache$85 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$84 = newProps.memoizedState.cachePool.pool); - cache$84 !== instance && (newProps.flags |= 2048); + (cache$85 = newProps.memoizedState.cachePool.pool); + cache$85 !== instance && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -6354,8 +6383,8 @@ function completeWork(current, workInProgress, renderLanes) { instance = workInProgress.memoizedState; if (null === instance) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$84 = instance.rendering; - if (null === cache$84) + cache$85 = instance.rendering; + if (null === cache$85) if (newProps) cutOffTailIfNeeded(instance, !1); else { if ( @@ -6363,11 +6392,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$84 = findFirstSuspended(current); - if (null !== cache$84) { + cache$85 = findFirstSuspended(current); + if (null !== cache$85) { workInProgress.flags |= 128; cutOffTailIfNeeded(instance, !1); - current = cache$84.updateQueue; + current = cache$85.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6392,7 +6421,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$84)), null !== current)) { + if (((current = findFirstSuspended(cache$85)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6402,7 +6431,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !0), null === instance.tail && "hidden" === instance.tailMode && - !cache$84.alternate) + !cache$85.alternate) ) return bubbleProperties(workInProgress), null; } else @@ -6414,13 +6443,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !1), (workInProgress.lanes = 4194304)); instance.isBackwards - ? ((cache$84.sibling = workInProgress.child), - (workInProgress.child = cache$84)) + ? ((cache$85.sibling = workInProgress.child), + (workInProgress.child = cache$85)) : ((current = instance.last), null !== current - ? (current.sibling = cache$84) - : (workInProgress.child = cache$84), - (instance.last = cache$84)); + ? (current.sibling = cache$85) + : (workInProgress.child = cache$85), + (instance.last = cache$85)); } if (null !== instance.tail) return ( @@ -6683,8 +6712,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$101) { - captureCommitPhaseError(current, nearestMountedAncestor, error$101); + } catch (error$102) { + captureCommitPhaseError(current, nearestMountedAncestor, error$102); } else ref.current = null; } @@ -6888,11 +6917,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$102) { + } catch (error$103) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$102 + error$103 ); } } @@ -7472,8 +7501,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$110) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$110); + } catch (error$111) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$111); } } break; @@ -7506,8 +7535,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { current = null !== current ? current.memoizedProps : newProps; try { flags._applyProps(flags, newProps, current); - } catch (error$113) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$113); + } catch (error$114) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$114); } } break; @@ -7543,8 +7572,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$115) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$115); + } catch (error$116) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$116); } flags = finishedWork.updateQueue; null !== flags && @@ -7681,12 +7710,12 @@ function commitReconciliationEffects(finishedWork) { break; case 3: case 4: - var parent$105 = JSCompiler_inline_result.stateNode.containerInfo, - before$106 = getHostSibling(finishedWork); + var parent$106 = JSCompiler_inline_result.stateNode.containerInfo, + before$107 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$106, - parent$105 + before$107, + parent$106 ); break; default: @@ -8136,9 +8165,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$125 = finishedWork.stateNode; + var instance$126 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$125._visibility & 4 + ? instance$126._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8150,7 +8179,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$125._visibility |= 4), + : ((instance$126._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8163,7 +8192,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$125 + instance$126 ); break; case 24: @@ -8257,12 +8286,12 @@ function accumulateSuspenseyCommitOnFiber(fiber) { break; case 22: if (null === fiber.memoizedState) { - var current$130 = fiber.alternate; - null !== current$130 && null !== current$130.memoizedState - ? ((current$130 = suspenseyCommitFlag), + var current$131 = fiber.alternate; + null !== current$131 && null !== current$131.memoizedState + ? ((current$131 = suspenseyCommitFlag), (suspenseyCommitFlag = 16777216), recursivelyAccumulateSuspenseyCommit(fiber), - (suspenseyCommitFlag = current$130)) + (suspenseyCommitFlag = current$131)) : recursivelyAccumulateSuspenseyCommit(fiber); } break; @@ -9063,8 +9092,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$136) { - handleThrow(root, thrownValue$136); + } catch (thrownValue$137) { + handleThrow(root, thrownValue$137); } while (1); lanes && root.shellSuspendCounter++; @@ -9173,8 +9202,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$138) { - handleThrow(root, thrownValue$138); + } catch (thrownValue$139) { + handleThrow(root, thrownValue$139); } while (1); resetContextDependencies(); @@ -10115,19 +10144,19 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component), - devToolsConfig$jscomp$inline_1122 = { + devToolsConfig$jscomp$inline_1123 = { findFiberByHostInstance: function () { return null; }, bundleType: 0, - version: "19.0.0-www-modern-def67b9b32-20240603", + version: "19.0.0-www-modern-67b05be0d2-20240603", rendererPackageName: "react-art" }; -var internals$jscomp$inline_1356 = { - bundleType: devToolsConfig$jscomp$inline_1122.bundleType, - version: devToolsConfig$jscomp$inline_1122.version, - rendererPackageName: devToolsConfig$jscomp$inline_1122.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1122.rendererConfig, +var internals$jscomp$inline_1357 = { + bundleType: devToolsConfig$jscomp$inline_1123.bundleType, + version: devToolsConfig$jscomp$inline_1123.version, + rendererPackageName: devToolsConfig$jscomp$inline_1123.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1123.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10144,26 +10173,26 @@ var internals$jscomp$inline_1356 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1122.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1123.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-def67b9b32-20240603" + reconcilerVersion: "19.0.0-www-modern-67b05be0d2-20240603" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1357 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1358 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1357.isDisabled && - hook$jscomp$inline_1357.supportsFiber + !hook$jscomp$inline_1358.isDisabled && + hook$jscomp$inline_1358.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1357.inject( - internals$jscomp$inline_1356 + (rendererID = hook$jscomp$inline_1358.inject( + internals$jscomp$inline_1357 )), - (injectedHook = hook$jscomp$inline_1357); + (injectedHook = hook$jscomp$inline_1358); } catch (err) {} } var Path = Mode$1.Path; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index d38349423522f..78e89cf530260 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -12972,112 +12972,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl throw new Error('Cannot update form state while rendering.'); } + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + // circular + isTransition: true, + status: 'pending', + value: null, + reason: null, + listeners: [], + then: function (listener) { + // We know the only thing that subscribes to these promises is `use` so + // this implementation is simpler than a generic thenable. E.g. we don't + // bother to check if the thenable is still pending because `use` already + // does that. + actionNode.listeners.push(listener); + } + }; // Check if we're inside a transition. If so, we'll need to restore the + // transition context when the action is run. + + var prevTransition = ReactSharedInternals.T; + + if (prevTransition !== null) { + // Optimistically update the pending state, similar to useTransition. + // This will be reverted automatically when all actions are finished. + setPendingState(true); // `actionNode` is a thenable that resolves to the return value of + // the action. + + setState(actionNode); + } else { + // This is not a transition. + actionNode.isTransition = false; + setState(actionNode); + } + var last = actionQueue.pending; if (last === null) { // There are no pending actions; this is the first one. We can run // it immediately. - var newLast = { - payload: payload, - action: actionQueue.action, - next: null // circular - - }; - newLast.next = actionQueue.pending = newLast; - runActionStateAction(actionQueue, setPendingState, setState, newLast); + actionNode.next = actionQueue.pending = actionNode; + runActionStateAction(actionQueue, actionNode); } else { // There's already an action running. Add to the queue. var first = last.next; - var _newLast = { - payload: payload, - action: actionQueue.action, - next: first - }; - actionQueue.pending = last.next = _newLast; + actionNode.next = first; + actionQueue.pending = last.next = actionNode; } } -function runActionStateAction(actionQueue, setPendingState, setState, node) { - // This is a fork of startTransition - var prevTransition = ReactSharedInternals.T; - var currentTransition = {}; - ReactSharedInternals.T = currentTransition; - - { - ReactSharedInternals.T._updatedFibers = new Set(); - } // Optimistically update the pending state, similar to useTransition. - // This will be reverted automatically when all actions are finished. - - - setPendingState(true); // `node.action` represents the action function at the time it was dispatched. +function runActionStateAction(actionQueue, node) { + // `node.action` represents the action function at the time it was dispatched. // If this action was queued, it might be stale, i.e. it's not necessarily the // most current implementation of the action, stored on `actionQueue`. This is // intentional. The conceptual model for queued actions is that they are // queued in a remote worker; the dispatch happens immediately, only the // execution is delayed. - var action = node.action; var payload = node.payload; var prevState = actionQueue.state; - try { - var returnValue = action(prevState, payload); - var onStartTransitionFinish = ReactSharedInternals.S; + if (node.isTransition) { + // The original dispatch was part of a transition. We restore its + // transition context here. + // This is a fork of startTransition + var prevTransition = ReactSharedInternals.T; + var currentTransition = {}; + ReactSharedInternals.T = currentTransition; - if (onStartTransitionFinish !== null) { - onStartTransitionFinish(currentTransition, returnValue); + { + ReactSharedInternals.T._updatedFibers = new Set(); } - if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] - typeof returnValue.then === 'function') { - var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as - // this resolves, we can run the next action in the sequence. + try { + var returnValue = action(prevState, payload); + var onStartTransitionFinish = ReactSharedInternals.S; - thenable.then(function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - }, function () { - return finishRunningActionStateAction(actionQueue, setPendingState, setState); - }); - setState(thenable); - } else { - setState(returnValue); - var nextState = returnValue; - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } - } catch (error) { - // This is a trick to get the `useActionState` hook to rethrow the error. - // When it unwraps the thenable with the `use` algorithm, the error - // will be thrown. - var rejectedThenable = { - then: function () {}, - status: 'rejected', - reason: error // $FlowFixMe: Not sure why this doesn't work + if (onStartTransitionFinish !== null) { + onStartTransitionFinish(currentTransition, returnValue); + } - }; - setState(rejectedThenable); - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; - { - if (prevTransition === null && currentTransition._updatedFibers) { - var updatedFibersCount = currentTransition._updatedFibers.size; + { + if (prevTransition === null && currentTransition._updatedFibers) { + var updatedFibersCount = currentTransition._updatedFibers.size; - currentTransition._updatedFibers.clear(); + currentTransition._updatedFibers.clear(); - if (updatedFibersCount > 10) { - warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + if (updatedFibersCount > 10) { + warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + } } } } + } else { + // The original dispatch was not part of a transition. + try { + var _returnValue = action(prevState, payload); + + handleActionReturnValue(actionQueue, node, _returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } + } +} + +function handleActionReturnValue(actionQueue, node, returnValue) { + if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] + typeof returnValue.then === 'function') { + var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as + // this resolves, we can run the next action in the sequence. + + thenable.then(function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, function (error) { + return onActionError(actionQueue, node, error); + }); + + { + if (!node.isTransition) { + error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`'); + } + } + } else { + var nextState = returnValue; + onActionSuccess(actionQueue, node, nextState); } } -function finishRunningActionStateAction(actionQueue, setPendingState, setState) { - // The action finished running. Pop it from the queue and run the next pending - // action, if there are any. +function onActionSuccess(actionQueue, actionNode, nextState) { + // The action finished running. + actionNode.status = 'fulfilled'; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there + // are any. + var last = actionQueue.pending; if (last !== null) { @@ -13091,11 +13127,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState) var next = first.next; last.next = next; // Run the next action. - runActionStateAction(actionQueue, setPendingState, setState, next); + runActionStateAction(actionQueue, next); } } } +function onActionError(actionQueue, actionNode, error) { + actionNode.status = 'rejected'; + actionNode.reason = error; + notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there + // are any. + // TODO: We should instead abort all the remaining actions in the queue. + + var last = actionQueue.pending; + + if (last !== null) { + var first = last.next; + + if (first === last) { + // This was the last action in the queue. + actionQueue.pending = null; + } else { + // Remove the first node from the circular queue. + var next = first.next; + last.next = next; // Run the next action. + + runActionStateAction(actionQueue, next); + } + } +} + +function notifyActionListeners(actionNode) { + // Notify React that the action has finished. + var listeners = actionNode.listeners; + + for (var i = 0; i < listeners.length; i++) { + // This is always a React internal listener, so we don't need to worry + // about it throwing. + var listener = listeners[i]; + listener(); + } +} + function actionStateReducer(oldState, newState) { return newState; } @@ -31090,7 +31163,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-www-classic-def67b9b32-20240603'; +var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603'; function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation. implementation) { diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index 76ab4df4e4ad2..73e66bd21bad8 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -12713,112 +12713,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl throw new Error('Cannot update form state while rendering.'); } + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + // circular + isTransition: true, + status: 'pending', + value: null, + reason: null, + listeners: [], + then: function (listener) { + // We know the only thing that subscribes to these promises is `use` so + // this implementation is simpler than a generic thenable. E.g. we don't + // bother to check if the thenable is still pending because `use` already + // does that. + actionNode.listeners.push(listener); + } + }; // Check if we're inside a transition. If so, we'll need to restore the + // transition context when the action is run. + + var prevTransition = ReactSharedInternals.T; + + if (prevTransition !== null) { + // Optimistically update the pending state, similar to useTransition. + // This will be reverted automatically when all actions are finished. + setPendingState(true); // `actionNode` is a thenable that resolves to the return value of + // the action. + + setState(actionNode); + } else { + // This is not a transition. + actionNode.isTransition = false; + setState(actionNode); + } + var last = actionQueue.pending; if (last === null) { // There are no pending actions; this is the first one. We can run // it immediately. - var newLast = { - payload: payload, - action: actionQueue.action, - next: null // circular - - }; - newLast.next = actionQueue.pending = newLast; - runActionStateAction(actionQueue, setPendingState, setState, newLast); + actionNode.next = actionQueue.pending = actionNode; + runActionStateAction(actionQueue, actionNode); } else { // There's already an action running. Add to the queue. var first = last.next; - var _newLast = { - payload: payload, - action: actionQueue.action, - next: first - }; - actionQueue.pending = last.next = _newLast; + actionNode.next = first; + actionQueue.pending = last.next = actionNode; } } -function runActionStateAction(actionQueue, setPendingState, setState, node) { - // This is a fork of startTransition - var prevTransition = ReactSharedInternals.T; - var currentTransition = {}; - ReactSharedInternals.T = currentTransition; - - { - ReactSharedInternals.T._updatedFibers = new Set(); - } // Optimistically update the pending state, similar to useTransition. - // This will be reverted automatically when all actions are finished. - - - setPendingState(true); // `node.action` represents the action function at the time it was dispatched. +function runActionStateAction(actionQueue, node) { + // `node.action` represents the action function at the time it was dispatched. // If this action was queued, it might be stale, i.e. it's not necessarily the // most current implementation of the action, stored on `actionQueue`. This is // intentional. The conceptual model for queued actions is that they are // queued in a remote worker; the dispatch happens immediately, only the // execution is delayed. - var action = node.action; var payload = node.payload; var prevState = actionQueue.state; - try { - var returnValue = action(prevState, payload); - var onStartTransitionFinish = ReactSharedInternals.S; + if (node.isTransition) { + // The original dispatch was part of a transition. We restore its + // transition context here. + // This is a fork of startTransition + var prevTransition = ReactSharedInternals.T; + var currentTransition = {}; + ReactSharedInternals.T = currentTransition; - if (onStartTransitionFinish !== null) { - onStartTransitionFinish(currentTransition, returnValue); + { + ReactSharedInternals.T._updatedFibers = new Set(); } - if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] - typeof returnValue.then === 'function') { - var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as - // this resolves, we can run the next action in the sequence. + try { + var returnValue = action(prevState, payload); + var onStartTransitionFinish = ReactSharedInternals.S; - thenable.then(function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - }, function () { - return finishRunningActionStateAction(actionQueue, setPendingState, setState); - }); - setState(thenable); - } else { - setState(returnValue); - var nextState = returnValue; - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } - } catch (error) { - // This is a trick to get the `useActionState` hook to rethrow the error. - // When it unwraps the thenable with the `use` algorithm, the error - // will be thrown. - var rejectedThenable = { - then: function () {}, - status: 'rejected', - reason: error // $FlowFixMe: Not sure why this doesn't work + if (onStartTransitionFinish !== null) { + onStartTransitionFinish(currentTransition, returnValue); + } - }; - setState(rejectedThenable); - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; - { - if (prevTransition === null && currentTransition._updatedFibers) { - var updatedFibersCount = currentTransition._updatedFibers.size; + { + if (prevTransition === null && currentTransition._updatedFibers) { + var updatedFibersCount = currentTransition._updatedFibers.size; - currentTransition._updatedFibers.clear(); + currentTransition._updatedFibers.clear(); - if (updatedFibersCount > 10) { - warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + if (updatedFibersCount > 10) { + warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + } } } } + } else { + // The original dispatch was not part of a transition. + try { + var _returnValue = action(prevState, payload); + + handleActionReturnValue(actionQueue, node, _returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } + } +} + +function handleActionReturnValue(actionQueue, node, returnValue) { + if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] + typeof returnValue.then === 'function') { + var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as + // this resolves, we can run the next action in the sequence. + + thenable.then(function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, function (error) { + return onActionError(actionQueue, node, error); + }); + + { + if (!node.isTransition) { + error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`'); + } + } + } else { + var nextState = returnValue; + onActionSuccess(actionQueue, node, nextState); } } -function finishRunningActionStateAction(actionQueue, setPendingState, setState) { - // The action finished running. Pop it from the queue and run the next pending - // action, if there are any. +function onActionSuccess(actionQueue, actionNode, nextState) { + // The action finished running. + actionNode.status = 'fulfilled'; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there + // are any. + var last = actionQueue.pending; if (last !== null) { @@ -12832,11 +12868,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState) var next = first.next; last.next = next; // Run the next action. - runActionStateAction(actionQueue, setPendingState, setState, next); + runActionStateAction(actionQueue, next); } } } +function onActionError(actionQueue, actionNode, error) { + actionNode.status = 'rejected'; + actionNode.reason = error; + notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there + // are any. + // TODO: We should instead abort all the remaining actions in the queue. + + var last = actionQueue.pending; + + if (last !== null) { + var first = last.next; + + if (first === last) { + // This was the last action in the queue. + actionQueue.pending = null; + } else { + // Remove the first node from the circular queue. + var next = first.next; + last.next = next; // Run the next action. + + runActionStateAction(actionQueue, next); + } + } +} + +function notifyActionListeners(actionNode) { + // Notify React that the action has finished. + var listeners = actionNode.listeners; + + for (var i = 0; i < listeners.length; i++) { + // This is always a React internal listener, so we don't need to worry + // about it throwing. + var listener = listeners[i]; + listener(); + } +} + function actionStateReducer(oldState, newState) { return newState; } @@ -30267,7 +30340,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-www-modern-def67b9b32-20240603'; +var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603'; function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation. implementation) { diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index 15ec76210bf96..942c85cd99aa2 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -3739,72 +3739,101 @@ function dispatchActionState( payload ) { if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); fiber = actionQueue.pending; null === fiber - ? ((payload = { payload: payload, action: actionQueue.action, next: null }), - (payload.next = actionQueue.pending = payload), - runActionStateAction(actionQueue, setPendingState, setState, payload)) - : (actionQueue.pending = fiber.next = - { payload: payload, action: actionQueue.action, next: fiber.next }); -} -function runActionStateAction(actionQueue, setPendingState, setState, node) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - setPendingState(!0); - var action = node.action; - node = node.payload; - var prevState = actionQueue.state; - try { - var returnValue = action(prevState, node), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - }, - function () { - return finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - } - ), - setState(returnValue)) - : (setState(returnValue), - (actionQueue.state = returnValue), - finishRunningActionStateAction(actionQueue, setPendingState, setState)); - } catch (error) { - setState({ then: function () {}, status: "rejected", reason: error }), - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; - } + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = fiber.next), + (actionQueue.pending = fiber.next = actionNode)); +} +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; + } + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$62) { + onActionError(actionQueue, node, error$62); + } } -function finishRunningActionStateAction( - actionQueue, - setPendingState, - setState -) { - var last = actionQueue.pending; - if (null !== last) { - var first = last.next; - first === last +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); +} +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode ? (actionQueue.pending = null) - : ((first = first.next), - (last.next = first), - runActionStateAction(actionQueue, setPendingState, setState, first)); - } + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + actionNode.status = "rejected"; + actionNode.reason = error; + notifyActionListeners(actionNode); + actionNode = actionQueue.pending; + null !== actionNode && + ((error = actionNode.next), + error === actionNode + ? (actionQueue.pending = null) + : ((error = error.next), + (actionNode.next = error), + runActionStateAction(actionQueue, error))); +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); } function actionStateReducer(oldState, newState) { return newState; @@ -4209,14 +4238,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(provider); fiber = createUpdate(lane); - var root$64 = enqueueUpdate(provider, fiber, lane); - null !== root$64 && - (scheduleUpdateOnFiber(root$64, provider, lane), - entangleTransitions(root$64, provider, lane)); + var root$65 = enqueueUpdate(provider, fiber, lane); + null !== root$65 && + (scheduleUpdateOnFiber(root$65, provider, lane), + entangleTransitions(root$65, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$64 && + null !== root$65 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4809,9 +4838,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$68 in Component) - void 0 === newProps[propName$68] && - (newProps[propName$68] = Component[propName$68]); + for (var propName$69 in Component) + void 0 === newProps[propName$69] && + (newProps[propName$69] = Component[propName$69]); } return newProps; } @@ -5256,10 +5285,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$81 = workInProgress.stateNode; + root$82 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$81.incompleteTransitions.has(transition)) { + if (!root$82.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -5267,11 +5296,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$81.incompleteTransitions.set(transition, markerInstance); + root$82.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$81.incompleteTransitions.forEach(function (markerInstance) { + root$82.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -7731,14 +7760,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$124 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$124 = lastTailNode), + for (var lastTailNode$125 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$125 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$124 + null === lastTailNode$125 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$124.sibling = null); + : (lastTailNode$125.sibling = null); } } function bubbleProperties(completedWork) { @@ -7748,19 +7777,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$125 = completedWork.child; null !== child$125; ) - (newChildLanes |= child$125.lanes | child$125.childLanes), - (subtreeFlags |= child$125.subtreeFlags & 31457280), - (subtreeFlags |= child$125.flags & 31457280), - (child$125.return = completedWork), - (child$125 = child$125.sibling); + for (var child$126 = completedWork.child; null !== child$126; ) + (newChildLanes |= child$126.lanes | child$126.childLanes), + (subtreeFlags |= child$126.subtreeFlags & 31457280), + (subtreeFlags |= child$126.flags & 31457280), + (child$126.return = completedWork), + (child$126 = child$126.sibling); else - for (child$125 = completedWork.child; null !== child$125; ) - (newChildLanes |= child$125.lanes | child$125.childLanes), - (subtreeFlags |= child$125.subtreeFlags), - (subtreeFlags |= child$125.flags), - (child$125.return = completedWork), - (child$125 = child$125.sibling); + for (child$126 = completedWork.child; null !== child$126; ) + (newChildLanes |= child$126.lanes | child$126.childLanes), + (subtreeFlags |= child$126.subtreeFlags), + (subtreeFlags |= child$126.flags), + (child$126.return = completedWork), + (child$126 = child$126.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -8056,11 +8085,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$137 = null; + var cache$138 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$137 = newProps.memoizedState.cachePool.pool); - cache$137 !== type && (newProps.flags |= 2048); + (cache$138 = newProps.memoizedState.cachePool.pool); + cache$138 !== type && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -8100,8 +8129,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$137 = type.rendering; - if (null === cache$137) + cache$138 = type.rendering; + if (null === cache$138) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -8109,11 +8138,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$137 = findFirstSuspended(current); - if (null !== cache$137) { + cache$138 = findFirstSuspended(current); + if (null !== cache$138) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$137.updateQueue; + current = cache$138.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -8138,7 +8167,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$137)), null !== current)) { + if (((current = findFirstSuspended(cache$138)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -8148,7 +8177,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$137.alternate && + !cache$138.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -8161,13 +8190,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$137.sibling = workInProgress.child), - (workInProgress.child = cache$137)) + ? ((cache$138.sibling = workInProgress.child), + (workInProgress.child = cache$138)) : ((current = type.last), null !== current - ? (current.sibling = cache$137) - : (workInProgress.child = cache$137), - (type.last = cache$137)); + ? (current.sibling = cache$138) + : (workInProgress.child = cache$138), + (type.last = cache$138)); } if (null !== type.tail) return ( @@ -8442,8 +8471,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$155) { - captureCommitPhaseError(current, nearestMountedAncestor, error$155); + } catch (error$156) { + captureCommitPhaseError(current, nearestMountedAncestor, error$156); } else ref.current = null; } @@ -8480,7 +8509,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$215) { + } catch (e$216) { JSCompiler_temp = null; break a; } @@ -8748,11 +8777,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$157) { + } catch (error$158) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$157 + error$158 ); } } @@ -9301,19 +9330,19 @@ function commitDeletionEffectsOnFiber( } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { if (null === finishedWork.memoizedState) { - var current$169 = finishedWork.alternate; + var current$170 = finishedWork.alternate; if ( - null !== current$169 && - ((current$169 = current$169.memoizedState), - null !== current$169 && - ((current$169 = current$169.dehydrated), null !== current$169)) + null !== current$170 && + ((current$170 = current$170.memoizedState), + null !== current$170 && + ((current$170 = current$170.dehydrated), null !== current$170)) ) try { - retryIfBlockedOn(current$169); + retryIfBlockedOn(current$170); var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; - onHydrated && onHydrated(current$169); + onHydrated && onHydrated(current$170); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -9431,8 +9460,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$171) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$171); + } catch (error$172) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$172); } } break; @@ -9605,11 +9634,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$172) { + } catch (error$173) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$172 + error$173 ); } break; @@ -9646,8 +9675,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$173) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$173); + } catch (error$174) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$174); } } if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { @@ -9657,8 +9686,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { updateProperties(root, maybeNodes, current, hoistableRoot), (root[internalPropsKey] = hoistableRoot); - } catch (error$175) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$175); + } catch (error$176) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$176); } } flags & 1024 && (needsFormReset = !0); @@ -9673,8 +9702,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { current = finishedWork.memoizedProps; try { flags.nodeValue = current; - } catch (error$176) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$176); + } catch (error$177) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$177); } } break; @@ -9688,8 +9717,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$177) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$177); + } catch (error$178) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$178); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -9721,8 +9750,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$179) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$179); + } catch (error$180) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$180); } flags = finishedWork.updateQueue; null !== flags && @@ -9800,11 +9829,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$160) { + } catch (error$161) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$160 + error$161 ); } } else if ( @@ -9879,21 +9908,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$161 = JSCompiler_inline_result.stateNode; + var parent$162 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$161, ""), + (setTextContent(parent$162, ""), (JSCompiler_inline_result.flags &= -33)); - var before$162 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$162, parent$161); + var before$163 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$163, parent$162); break; case 3: case 4: - var parent$163 = JSCompiler_inline_result.stateNode.containerInfo, - before$164 = getHostSibling(finishedWork); + var parent$164 = JSCompiler_inline_result.stateNode.containerInfo, + before$165 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$164, - parent$163 + before$165, + parent$164 ); break; default: @@ -9972,7 +10001,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$183 = parentFiber.alternate, + var current$184 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -10000,16 +10029,16 @@ function recursivelyTraverseReappearLayoutEffects( } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - current$183 = finishedWork.updateQueue; - if (null !== current$183) { - var hiddenCallbacks = current$183.shared.hiddenCallbacks; + current$184 = finishedWork.updateQueue; + if (null !== current$184) { + var hiddenCallbacks = current$184.shared.hiddenCallbacks; if (null !== hiddenCallbacks) for ( - current$183.shared.hiddenCallbacks = null, current$183 = 0; - current$183 < hiddenCallbacks.length; - current$183++ + current$184.shared.hiddenCallbacks = null, current$184 = 0; + current$184 < hiddenCallbacks.length; + current$184++ ) - callCallback(hiddenCallbacks[current$183], finishedRoot); + callCallback(hiddenCallbacks[current$184], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -10025,7 +10054,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$183 && + null === current$184 && flags & 4 && commitHostComponentMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); @@ -10369,9 +10398,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$190 = finishedWork.stateNode; + var instance$191 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$190._visibility & 4 + ? instance$191._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10384,7 +10413,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$190._visibility |= 4), + : ((instance$191._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10392,7 +10421,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$190._visibility |= 4), + : ((instance$191._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10405,7 +10434,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$190 + instance$191 ); break; case 24: @@ -11369,8 +11398,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$201) { - handleThrow(root, thrownValue$201); + } catch (thrownValue$202) { + handleThrow(root, thrownValue$202); } while (1); lanes && root.shellSuspendCounter++; @@ -11479,8 +11508,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$203) { - handleThrow(root, thrownValue$203); + } catch (thrownValue$204) { + handleThrow(root, thrownValue$204); } while (1); resetContextDependencies(); @@ -11705,12 +11734,12 @@ function commitRootImpl( Internals.p = 2; var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$209 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$210 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$209 && + shouldFireAfterActiveInstanceBlur$210 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -11782,7 +11811,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$210 = rootWithPendingPassiveEffects, + var root$211 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11797,7 +11826,7 @@ function flushPassiveEffects() { } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$210, remainingLanes); + releaseRootPooledCache(root$211, remainingLanes); } } return !1; @@ -13083,19 +13112,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$371; + var JSCompiler_inline_result$jscomp$372; if (canUseDOM) { - var isSupported$jscomp$inline_1539 = "oninput" in document; - if (!isSupported$jscomp$inline_1539) { - var element$jscomp$inline_1540 = document.createElement("div"); - element$jscomp$inline_1540.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1539 = - "function" === typeof element$jscomp$inline_1540.oninput; + var isSupported$jscomp$inline_1540 = "oninput" in document; + if (!isSupported$jscomp$inline_1540) { + var element$jscomp$inline_1541 = document.createElement("div"); + element$jscomp$inline_1541.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1540 = + "function" === typeof element$jscomp$inline_1541.oninput; } - JSCompiler_inline_result$jscomp$371 = isSupported$jscomp$inline_1539; - } else JSCompiler_inline_result$jscomp$371 = !1; + JSCompiler_inline_result$jscomp$372 = isSupported$jscomp$inline_1540; + } else JSCompiler_inline_result$jscomp$372 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$371 && + JSCompiler_inline_result$jscomp$372 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13504,20 +13533,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1580 = 0; - i$jscomp$inline_1580 < simpleEventPluginEvents.length; - i$jscomp$inline_1580++ + var i$jscomp$inline_1581 = 0; + i$jscomp$inline_1581 < simpleEventPluginEvents.length; + i$jscomp$inline_1581++ ) { - var eventName$jscomp$inline_1581 = - simpleEventPluginEvents[i$jscomp$inline_1580], - domEventName$jscomp$inline_1582 = - eventName$jscomp$inline_1581.toLowerCase(), - capitalizedEvent$jscomp$inline_1583 = - eventName$jscomp$inline_1581[0].toUpperCase() + - eventName$jscomp$inline_1581.slice(1); + var eventName$jscomp$inline_1582 = + simpleEventPluginEvents[i$jscomp$inline_1581], + domEventName$jscomp$inline_1583 = + eventName$jscomp$inline_1582.toLowerCase(), + capitalizedEvent$jscomp$inline_1584 = + eventName$jscomp$inline_1582[0].toUpperCase() + + eventName$jscomp$inline_1582.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1582, - "on" + capitalizedEvent$jscomp$inline_1583 + domEventName$jscomp$inline_1583, + "on" + capitalizedEvent$jscomp$inline_1584 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14995,14 +15024,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$244 in nextProps) { - var propKey = nextProps[propKey$244]; - lastProp = lastProps[propKey$244]; + for (var propKey$245 in nextProps) { + var propKey = nextProps[propKey$245]; + lastProp = lastProps[propKey$245]; if ( - nextProps.hasOwnProperty(propKey$244) && + nextProps.hasOwnProperty(propKey$245) && (null != propKey || null != lastProp) ) - switch (propKey$244) { + switch (propKey$245) { case "type": type = propKey; break; @@ -15031,7 +15060,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$244, + propKey$245, propKey, nextProps, lastProp @@ -15050,7 +15079,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$244 = null; + propKey = value = defaultValue = propKey$245 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15081,7 +15110,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$244 = type; + propKey$245 = type; break; case "defaultValue": defaultValue = type; @@ -15102,15 +15131,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$244 - ? updateOptions(domElement, !!lastProps, propKey$244, !1) + null != propKey$245 + ? updateOptions(domElement, !!lastProps, propKey$245, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$244 = null; + propKey = propKey$245 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15134,7 +15163,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$244 = name; + propKey$245 = name; break; case "defaultValue": propKey = name; @@ -15148,17 +15177,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$244, propKey); + updateTextarea(domElement, propKey$245, propKey); return; case "option": - for (var propKey$260 in lastProps) + for (var propKey$261 in lastProps) if ( - ((propKey$244 = lastProps[propKey$260]), - lastProps.hasOwnProperty(propKey$260) && - null != propKey$244 && - !nextProps.hasOwnProperty(propKey$260)) + ((propKey$245 = lastProps[propKey$261]), + lastProps.hasOwnProperty(propKey$261) && + null != propKey$245 && + !nextProps.hasOwnProperty(propKey$261)) ) - switch (propKey$260) { + switch (propKey$261) { case "selected": domElement.selected = !1; break; @@ -15166,33 +15195,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$260, + propKey$261, null, nextProps, - propKey$244 + propKey$245 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$244 = nextProps[lastDefaultValue]), + ((propKey$245 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$244 !== propKey && - (null != propKey$244 || null != propKey)) + propKey$245 !== propKey && + (null != propKey$245 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$244 && - "function" !== typeof propKey$244 && - "symbol" !== typeof propKey$244; + propKey$245 && + "function" !== typeof propKey$245 && + "symbol" !== typeof propKey$245; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$244, + propKey$245, nextProps, propKey ); @@ -15213,24 +15242,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$265 in lastProps) - (propKey$244 = lastProps[propKey$265]), - lastProps.hasOwnProperty(propKey$265) && - null != propKey$244 && - !nextProps.hasOwnProperty(propKey$265) && - setProp(domElement, tag, propKey$265, null, nextProps, propKey$244); + for (var propKey$266 in lastProps) + (propKey$245 = lastProps[propKey$266]), + lastProps.hasOwnProperty(propKey$266) && + null != propKey$245 && + !nextProps.hasOwnProperty(propKey$266) && + setProp(domElement, tag, propKey$266, null, nextProps, propKey$245); for (checked in nextProps) if ( - ((propKey$244 = nextProps[checked]), + ((propKey$245 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$244 !== propKey && - (null != propKey$244 || null != propKey)) + propKey$245 !== propKey && + (null != propKey$245 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$244) + if (null != propKey$245) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15238,7 +15267,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$244, + propKey$245, nextProps, propKey ); @@ -15246,49 +15275,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$270 in lastProps) - (propKey$244 = lastProps[propKey$270]), - lastProps.hasOwnProperty(propKey$270) && - void 0 !== propKey$244 && - !nextProps.hasOwnProperty(propKey$270) && + for (var propKey$271 in lastProps) + (propKey$245 = lastProps[propKey$271]), + lastProps.hasOwnProperty(propKey$271) && + void 0 !== propKey$245 && + !nextProps.hasOwnProperty(propKey$271) && setPropOnCustomElement( domElement, tag, - propKey$270, + propKey$271, void 0, nextProps, - propKey$244 + propKey$245 ); for (defaultChecked in nextProps) - (propKey$244 = nextProps[defaultChecked]), + (propKey$245 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$244 === propKey || - (void 0 === propKey$244 && void 0 === propKey) || + propKey$245 === propKey || + (void 0 === propKey$245 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$244, + propKey$245, nextProps, propKey ); return; } } - for (var propKey$275 in lastProps) - (propKey$244 = lastProps[propKey$275]), - lastProps.hasOwnProperty(propKey$275) && - null != propKey$244 && - !nextProps.hasOwnProperty(propKey$275) && - setProp(domElement, tag, propKey$275, null, nextProps, propKey$244); + for (var propKey$276 in lastProps) + (propKey$245 = lastProps[propKey$276]), + lastProps.hasOwnProperty(propKey$276) && + null != propKey$245 && + !nextProps.hasOwnProperty(propKey$276) && + setProp(domElement, tag, propKey$276, null, nextProps, propKey$245); for (lastProp in nextProps) - (propKey$244 = nextProps[lastProp]), + (propKey$245 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$244 === propKey || - (null == propKey$244 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$244, nextProps, propKey); + propKey$245 === propKey || + (null == propKey$245 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$245, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15875,20 +15904,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$283 = getResourcesFromRoot( + var styles$284 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$284 = styles$283.get(type); - resource$284 || + resource$285 = styles$284.get(type); + resource$285 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$284 = { + (resource$285 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$283.set(type, resource$284), + styles$284.set(type, resource$285), preloadPropsMap.has(type) || preloadStylesheet( JSCompiler_inline_result, @@ -15903,11 +15932,11 @@ function getResource(type, currentProps, pendingProps, currentResource) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$284.state + resource$285.state )); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$284; + return resource$285; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -16006,37 +16035,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$289 = hoistableRoot.querySelector( + var instance$290 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$289) + if (instance$290) return ( (resource.state.loading |= 4), - (resource.instance = instance$289), - markNodeAsHoistable(instance$289), - instance$289 + (resource.instance = instance$290), + markNodeAsHoistable(instance$290), + instance$290 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$289 = ( + instance$290 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$289); - var linkInstance = instance$289; + markNodeAsHoistable(instance$290); + var linkInstance = instance$290; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$289, "link", instance); + setInitialProperties(instance$290, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$289, props.precedence, hoistableRoot); - return (resource.instance = instance$289); + insertStylesheet(instance$290, props.precedence, hoistableRoot); + return (resource.instance = instance$290); case "script": - instance$289 = getScriptKey(props.src); + instance$290 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$289) + getScriptSelectorFromKey(instance$290) )) ) return ( @@ -16045,7 +16074,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$289))) + if ((styleProps = preloadPropsMap.get(instance$290))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17050,16 +17079,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1753 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1754 = React.version; if ( - "19.0.0-www-classic-def67b9b32-20240603" !== - isomorphicReactPackageVersion$jscomp$inline_1753 + "19.0.0-www-classic-67b05be0d2-20240603" !== + isomorphicReactPackageVersion$jscomp$inline_1754 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1753, - "19.0.0-www-classic-def67b9b32-20240603" + isomorphicReactPackageVersion$jscomp$inline_1754, + "19.0.0-www-classic-67b05be0d2-20240603" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17075,17 +17104,17 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1760 = { +var devToolsConfig$jscomp$inline_1761 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-def67b9b32-20240603", + version: "19.0.0-www-classic-67b05be0d2-20240603", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2204 = { - bundleType: devToolsConfig$jscomp$inline_1760.bundleType, - version: devToolsConfig$jscomp$inline_1760.version, - rendererPackageName: devToolsConfig$jscomp$inline_1760.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1760.rendererConfig, +var internals$jscomp$inline_2205 = { + bundleType: devToolsConfig$jscomp$inline_1761.bundleType, + version: devToolsConfig$jscomp$inline_1761.version, + rendererPackageName: devToolsConfig$jscomp$inline_1761.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1761.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17101,26 +17130,26 @@ var internals$jscomp$inline_2204 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1760.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1761.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-def67b9b32-20240603" + reconcilerVersion: "19.0.0-www-classic-67b05be0d2-20240603" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2205 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2206 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2205.isDisabled && - hook$jscomp$inline_2205.supportsFiber + !hook$jscomp$inline_2206.isDisabled && + hook$jscomp$inline_2206.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2205.inject( - internals$jscomp$inline_2204 + (rendererID = hook$jscomp$inline_2206.inject( + internals$jscomp$inline_2205 )), - (injectedHook = hook$jscomp$inline_2205); + (injectedHook = hook$jscomp$inline_2206); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17194,11 +17223,11 @@ function legacyCreateRootFromDOMContainer( if ("function" === typeof callback) { var originalCallback = callback; callback = function () { - var instance = getPublicRootInstance(root$310); + var instance = getPublicRootInstance(root$311); originalCallback.call(instance); }; } - var root$310 = createHydrationContainer( + var root$311 = createHydrationContainer( initialChildren, callback, container, @@ -17213,23 +17242,23 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$310; - container[internalContainerInstanceKey] = root$310.current; + container._reactRootContainer = root$311; + container[internalContainerInstanceKey] = root$311.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSyncWork(); - return root$310; + return root$311; } clearContainer(container); if ("function" === typeof callback) { - var originalCallback$311 = callback; + var originalCallback$312 = callback; callback = function () { - var instance = getPublicRootInstance(root$312); - originalCallback$311.call(instance); + var instance = getPublicRootInstance(root$313); + originalCallback$312.call(instance); }; } - var root$312 = createFiberRoot( + var root$313 = createFiberRoot( container, 0, !1, @@ -17244,14 +17273,14 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$312; - container[internalContainerInstanceKey] = root$312.current; + container._reactRootContainer = root$313; + container[internalContainerInstanceKey] = root$313.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); - updateContainerSync(initialChildren, root$312, parentComponent, callback); + updateContainerSync(initialChildren, root$313, parentComponent, callback); flushSyncWork(); - return root$312; + return root$313; } function legacyRenderSubtreeIntoContainer( parentComponent, @@ -17612,4 +17641,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-def67b9b32-20240603"; +exports.version = "19.0.0-www-classic-67b05be0d2-20240603"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index a56c83b5fb8d4..67d28b9a6ed7a 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -3527,72 +3527,101 @@ function dispatchActionState( payload ) { if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); fiber = actionQueue.pending; null === fiber - ? ((payload = { payload: payload, action: actionQueue.action, next: null }), - (payload.next = actionQueue.pending = payload), - runActionStateAction(actionQueue, setPendingState, setState, payload)) - : (actionQueue.pending = fiber.next = - { payload: payload, action: actionQueue.action, next: fiber.next }); -} -function runActionStateAction(actionQueue, setPendingState, setState, node) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - setPendingState(!0); - var action = node.action; - node = node.payload; - var prevState = actionQueue.state; - try { - var returnValue = action(prevState, node), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - }, - function () { - return finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - } - ), - setState(returnValue)) - : (setState(returnValue), - (actionQueue.state = returnValue), - finishRunningActionStateAction(actionQueue, setPendingState, setState)); - } catch (error) { - setState({ then: function () {}, status: "rejected", reason: error }), - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; - } + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = fiber.next), + (actionQueue.pending = fiber.next = actionNode)); +} +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; + } + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$62) { + onActionError(actionQueue, node, error$62); + } } -function finishRunningActionStateAction( - actionQueue, - setPendingState, - setState -) { - var last = actionQueue.pending; - if (null !== last) { - var first = last.next; - first === last +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); +} +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode ? (actionQueue.pending = null) - : ((first = first.next), - (last.next = first), - runActionStateAction(actionQueue, setPendingState, setState, first)); - } + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + actionNode.status = "rejected"; + actionNode.reason = error; + notifyActionListeners(actionNode); + actionNode = actionQueue.pending; + null !== actionNode && + ((error = actionNode.next), + error === actionNode + ? (actionQueue.pending = null) + : ((error = error.next), + (actionNode.next = error), + runActionStateAction(actionQueue, error))); +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); } function actionStateReducer(oldState, newState) { return newState; @@ -3997,14 +4026,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$64 = enqueueUpdate(provider, fiber, lane); - null !== root$64 && - (scheduleUpdateOnFiber(root$64, provider, lane), - entangleTransitions(root$64, provider, lane)); + var root$65 = enqueueUpdate(provider, fiber, lane); + null !== root$65 && + (scheduleUpdateOnFiber(root$65, provider, lane), + entangleTransitions(root$65, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$64 && + null !== root$65 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4535,9 +4564,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$68 in Component) - void 0 === newProps[propName$68] && - (newProps[propName$68] = Component[propName$68]); + for (var propName$69 in Component) + void 0 === newProps[propName$69] && + (newProps[propName$69] = Component[propName$69]); } return newProps; } @@ -4914,10 +4943,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$80 = workInProgress.stateNode; + root$81 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$80.incompleteTransitions.has(transition)) { + if (!root$81.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -4925,11 +4954,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$80.incompleteTransitions.set(transition, markerInstance); + root$81.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$80.incompleteTransitions.forEach(function (markerInstance) { + root$81.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -7273,14 +7302,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$116 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$116 = lastTailNode), + for (var lastTailNode$117 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$117 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$116 + null === lastTailNode$117 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$116.sibling = null); + : (lastTailNode$117.sibling = null); } } function bubbleProperties(completedWork) { @@ -7290,19 +7319,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$117 = completedWork.child; null !== child$117; ) - (newChildLanes |= child$117.lanes | child$117.childLanes), - (subtreeFlags |= child$117.subtreeFlags & 31457280), - (subtreeFlags |= child$117.flags & 31457280), - (child$117.return = completedWork), - (child$117 = child$117.sibling); + for (var child$118 = completedWork.child; null !== child$118; ) + (newChildLanes |= child$118.lanes | child$118.childLanes), + (subtreeFlags |= child$118.subtreeFlags & 31457280), + (subtreeFlags |= child$118.flags & 31457280), + (child$118.return = completedWork), + (child$118 = child$118.sibling); else - for (child$117 = completedWork.child; null !== child$117; ) - (newChildLanes |= child$117.lanes | child$117.childLanes), - (subtreeFlags |= child$117.subtreeFlags), - (subtreeFlags |= child$117.flags), - (child$117.return = completedWork), - (child$117 = child$117.sibling); + for (child$118 = completedWork.child; null !== child$118; ) + (newChildLanes |= child$118.lanes | child$118.childLanes), + (subtreeFlags |= child$118.subtreeFlags), + (subtreeFlags |= child$118.flags), + (child$118.return = completedWork), + (child$118 = child$118.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -7591,11 +7620,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$129 = null; + var cache$130 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$129 = newProps.memoizedState.cachePool.pool); - cache$129 !== type && (newProps.flags |= 2048); + (cache$130 = newProps.memoizedState.cachePool.pool); + cache$130 !== type && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -7629,8 +7658,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$129 = type.rendering; - if (null === cache$129) + cache$130 = type.rendering; + if (null === cache$130) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -7638,11 +7667,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$129 = findFirstSuspended(current); - if (null !== cache$129) { + cache$130 = findFirstSuspended(current); + if (null !== cache$130) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$129.updateQueue; + current = cache$130.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -7667,7 +7696,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$129)), null !== current)) { + if (((current = findFirstSuspended(cache$130)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -7677,7 +7706,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$129.alternate && + !cache$130.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -7690,13 +7719,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$129.sibling = workInProgress.child), - (workInProgress.child = cache$129)) + ? ((cache$130.sibling = workInProgress.child), + (workInProgress.child = cache$130)) : ((current = type.last), null !== current - ? (current.sibling = cache$129) - : (workInProgress.child = cache$129), - (type.last = cache$129)); + ? (current.sibling = cache$130) + : (workInProgress.child = cache$130), + (type.last = cache$130)); } if (null !== type.tail) return ( @@ -7962,8 +7991,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$146) { - captureCommitPhaseError(current, nearestMountedAncestor, error$146); + } catch (error$147) { + captureCommitPhaseError(current, nearestMountedAncestor, error$147); } else ref.current = null; } @@ -8000,7 +8029,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$206) { + } catch (e$207) { JSCompiler_temp = null; break a; } @@ -8281,11 +8310,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$148) { + } catch (error$149) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$148 + error$149 ); } } @@ -8823,19 +8852,19 @@ function commitDeletionEffectsOnFiber( } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { if (null === finishedWork.memoizedState) { - var current$160 = finishedWork.alternate; + var current$161 = finishedWork.alternate; if ( - null !== current$160 && - ((current$160 = current$160.memoizedState), - null !== current$160 && - ((current$160 = current$160.dehydrated), null !== current$160)) + null !== current$161 && + ((current$161 = current$161.memoizedState), + null !== current$161 && + ((current$161 = current$161.dehydrated), null !== current$161)) ) try { - retryIfBlockedOn(current$160); + retryIfBlockedOn(current$161); var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; - onHydrated && onHydrated(current$160); + onHydrated && onHydrated(current$161); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -8953,8 +8982,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$162) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$162); + } catch (error$163) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$163); } } break; @@ -9127,11 +9156,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$163) { + } catch (error$164) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$163 + error$164 ); } break; @@ -9168,8 +9197,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$164) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$164); + } catch (error$165) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$165); } } if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { @@ -9179,8 +9208,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { updateProperties(root, maybeNodes, current, hoistableRoot), (root[internalPropsKey] = hoistableRoot); - } catch (error$166) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$166); + } catch (error$167) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$167); } } flags & 1024 && (needsFormReset = !0); @@ -9195,8 +9224,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { current = finishedWork.memoizedProps; try { flags.nodeValue = current; - } catch (error$167) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$167); + } catch (error$168) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$168); } } break; @@ -9210,8 +9239,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$168) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$168); + } catch (error$169) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$169); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -9243,8 +9272,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$170) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$170); + } catch (error$171) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$171); } flags = finishedWork.updateQueue; null !== flags && @@ -9319,11 +9348,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$151) { + } catch (error$152) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$151 + error$152 ); } } else if ( @@ -9398,21 +9427,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$152 = JSCompiler_inline_result.stateNode; + var parent$153 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$152, ""), + (setTextContent(parent$153, ""), (JSCompiler_inline_result.flags &= -33)); - var before$153 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$153, parent$152); + var before$154 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$154, parent$153); break; case 3: case 4: - var parent$154 = JSCompiler_inline_result.stateNode.containerInfo, - before$155 = getHostSibling(finishedWork); + var parent$155 = JSCompiler_inline_result.stateNode.containerInfo, + before$156 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$155, - parent$154 + before$156, + parent$155 ); break; default: @@ -9491,7 +9520,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$174 = parentFiber.alternate, + var current$175 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -9519,16 +9548,16 @@ function recursivelyTraverseReappearLayoutEffects( } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - current$174 = finishedWork.updateQueue; - if (null !== current$174) { - var hiddenCallbacks = current$174.shared.hiddenCallbacks; + current$175 = finishedWork.updateQueue; + if (null !== current$175) { + var hiddenCallbacks = current$175.shared.hiddenCallbacks; if (null !== hiddenCallbacks) for ( - current$174.shared.hiddenCallbacks = null, current$174 = 0; - current$174 < hiddenCallbacks.length; - current$174++ + current$175.shared.hiddenCallbacks = null, current$175 = 0; + current$175 < hiddenCallbacks.length; + current$175++ ) - callCallback(hiddenCallbacks[current$174], finishedRoot); + callCallback(hiddenCallbacks[current$175], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -9544,7 +9573,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$174 && + null === current$175 && flags & 4 && commitHostComponentMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); @@ -9880,9 +9909,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$181 = finishedWork.stateNode; + var instance$182 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$181._visibility & 4 + ? instance$182._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9894,7 +9923,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$181._visibility |= 4), + : ((instance$182._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9907,7 +9936,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$181 + instance$182 ); break; case 24: @@ -10852,8 +10881,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$192) { - handleThrow(root, thrownValue$192); + } catch (thrownValue$193) { + handleThrow(root, thrownValue$193); } while (1); lanes && root.shellSuspendCounter++; @@ -10962,8 +10991,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$194) { - handleThrow(root, thrownValue$194); + } catch (thrownValue$195) { + handleThrow(root, thrownValue$195); } while (1); resetContextDependencies(); @@ -11184,12 +11213,12 @@ function commitRootImpl( Internals.p = 2; var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$200 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$201 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$200 && + shouldFireAfterActiveInstanceBlur$201 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -11259,7 +11288,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$201 = rootWithPendingPassiveEffects, + var root$202 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11274,7 +11303,7 @@ function flushPassiveEffects() { } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$201, remainingLanes); + releaseRootPooledCache(root$202, remainingLanes); } } return !1; @@ -12466,19 +12495,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$358; + var JSCompiler_inline_result$jscomp$359; if (canUseDOM) { - var isSupported$jscomp$inline_1510 = "oninput" in document; - if (!isSupported$jscomp$inline_1510) { - var element$jscomp$inline_1511 = document.createElement("div"); - element$jscomp$inline_1511.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1510 = - "function" === typeof element$jscomp$inline_1511.oninput; + var isSupported$jscomp$inline_1511 = "oninput" in document; + if (!isSupported$jscomp$inline_1511) { + var element$jscomp$inline_1512 = document.createElement("div"); + element$jscomp$inline_1512.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1511 = + "function" === typeof element$jscomp$inline_1512.oninput; } - JSCompiler_inline_result$jscomp$358 = isSupported$jscomp$inline_1510; - } else JSCompiler_inline_result$jscomp$358 = !1; + JSCompiler_inline_result$jscomp$359 = isSupported$jscomp$inline_1511; + } else JSCompiler_inline_result$jscomp$359 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$358 && + JSCompiler_inline_result$jscomp$359 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -12887,20 +12916,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1551 = 0; - i$jscomp$inline_1551 < simpleEventPluginEvents.length; - i$jscomp$inline_1551++ + var i$jscomp$inline_1552 = 0; + i$jscomp$inline_1552 < simpleEventPluginEvents.length; + i$jscomp$inline_1552++ ) { - var eventName$jscomp$inline_1552 = - simpleEventPluginEvents[i$jscomp$inline_1551], - domEventName$jscomp$inline_1553 = - eventName$jscomp$inline_1552.toLowerCase(), - capitalizedEvent$jscomp$inline_1554 = - eventName$jscomp$inline_1552[0].toUpperCase() + - eventName$jscomp$inline_1552.slice(1); + var eventName$jscomp$inline_1553 = + simpleEventPluginEvents[i$jscomp$inline_1552], + domEventName$jscomp$inline_1554 = + eventName$jscomp$inline_1553.toLowerCase(), + capitalizedEvent$jscomp$inline_1555 = + eventName$jscomp$inline_1553[0].toUpperCase() + + eventName$jscomp$inline_1553.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1553, - "on" + capitalizedEvent$jscomp$inline_1554 + domEventName$jscomp$inline_1554, + "on" + capitalizedEvent$jscomp$inline_1555 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14377,14 +14406,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$235 in nextProps) { - var propKey = nextProps[propKey$235]; - lastProp = lastProps[propKey$235]; + for (var propKey$236 in nextProps) { + var propKey = nextProps[propKey$236]; + lastProp = lastProps[propKey$236]; if ( - nextProps.hasOwnProperty(propKey$235) && + nextProps.hasOwnProperty(propKey$236) && (null != propKey || null != lastProp) ) - switch (propKey$235) { + switch (propKey$236) { case "type": type = propKey; break; @@ -14413,7 +14442,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$235, + propKey$236, propKey, nextProps, lastProp @@ -14432,7 +14461,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$235 = null; + propKey = value = defaultValue = propKey$236 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -14463,7 +14492,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$235 = type; + propKey$236 = type; break; case "defaultValue": defaultValue = type; @@ -14484,15 +14513,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$235 - ? updateOptions(domElement, !!lastProps, propKey$235, !1) + null != propKey$236 + ? updateOptions(domElement, !!lastProps, propKey$236, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$235 = null; + propKey = propKey$236 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -14516,7 +14545,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$235 = name; + propKey$236 = name; break; case "defaultValue": propKey = name; @@ -14530,17 +14559,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$235, propKey); + updateTextarea(domElement, propKey$236, propKey); return; case "option": - for (var propKey$251 in lastProps) + for (var propKey$252 in lastProps) if ( - ((propKey$235 = lastProps[propKey$251]), - lastProps.hasOwnProperty(propKey$251) && - null != propKey$235 && - !nextProps.hasOwnProperty(propKey$251)) + ((propKey$236 = lastProps[propKey$252]), + lastProps.hasOwnProperty(propKey$252) && + null != propKey$236 && + !nextProps.hasOwnProperty(propKey$252)) ) - switch (propKey$251) { + switch (propKey$252) { case "selected": domElement.selected = !1; break; @@ -14548,33 +14577,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$251, + propKey$252, null, nextProps, - propKey$235 + propKey$236 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$235 = nextProps[lastDefaultValue]), + ((propKey$236 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$235 !== propKey && - (null != propKey$235 || null != propKey)) + propKey$236 !== propKey && + (null != propKey$236 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$235 && - "function" !== typeof propKey$235 && - "symbol" !== typeof propKey$235; + propKey$236 && + "function" !== typeof propKey$236 && + "symbol" !== typeof propKey$236; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$235, + propKey$236, nextProps, propKey ); @@ -14595,24 +14624,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$256 in lastProps) - (propKey$235 = lastProps[propKey$256]), - lastProps.hasOwnProperty(propKey$256) && - null != propKey$235 && - !nextProps.hasOwnProperty(propKey$256) && - setProp(domElement, tag, propKey$256, null, nextProps, propKey$235); + for (var propKey$257 in lastProps) + (propKey$236 = lastProps[propKey$257]), + lastProps.hasOwnProperty(propKey$257) && + null != propKey$236 && + !nextProps.hasOwnProperty(propKey$257) && + setProp(domElement, tag, propKey$257, null, nextProps, propKey$236); for (checked in nextProps) if ( - ((propKey$235 = nextProps[checked]), + ((propKey$236 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$235 !== propKey && - (null != propKey$235 || null != propKey)) + propKey$236 !== propKey && + (null != propKey$236 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$235) + if (null != propKey$236) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -14620,7 +14649,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$235, + propKey$236, nextProps, propKey ); @@ -14628,49 +14657,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$261 in lastProps) - (propKey$235 = lastProps[propKey$261]), - lastProps.hasOwnProperty(propKey$261) && - void 0 !== propKey$235 && - !nextProps.hasOwnProperty(propKey$261) && + for (var propKey$262 in lastProps) + (propKey$236 = lastProps[propKey$262]), + lastProps.hasOwnProperty(propKey$262) && + void 0 !== propKey$236 && + !nextProps.hasOwnProperty(propKey$262) && setPropOnCustomElement( domElement, tag, - propKey$261, + propKey$262, void 0, nextProps, - propKey$235 + propKey$236 ); for (defaultChecked in nextProps) - (propKey$235 = nextProps[defaultChecked]), + (propKey$236 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$235 === propKey || - (void 0 === propKey$235 && void 0 === propKey) || + propKey$236 === propKey || + (void 0 === propKey$236 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$235, + propKey$236, nextProps, propKey ); return; } } - for (var propKey$266 in lastProps) - (propKey$235 = lastProps[propKey$266]), - lastProps.hasOwnProperty(propKey$266) && - null != propKey$235 && - !nextProps.hasOwnProperty(propKey$266) && - setProp(domElement, tag, propKey$266, null, nextProps, propKey$235); + for (var propKey$267 in lastProps) + (propKey$236 = lastProps[propKey$267]), + lastProps.hasOwnProperty(propKey$267) && + null != propKey$236 && + !nextProps.hasOwnProperty(propKey$267) && + setProp(domElement, tag, propKey$267, null, nextProps, propKey$236); for (lastProp in nextProps) - (propKey$235 = nextProps[lastProp]), + (propKey$236 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$235 === propKey || - (null == propKey$235 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$235, nextProps, propKey); + propKey$236 === propKey || + (null == propKey$236 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$236, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15248,20 +15277,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$274 = getResourcesFromRoot( + var styles$275 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$275 = styles$274.get(type); - resource$275 || + resource$276 = styles$275.get(type); + resource$276 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$275 = { + (resource$276 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$274.set(type, resource$275), + styles$275.set(type, resource$276), preloadPropsMap.has(type) || preloadStylesheet( JSCompiler_inline_result, @@ -15276,11 +15305,11 @@ function getResource(type, currentProps, pendingProps, currentResource) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$275.state + resource$276.state )); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$275; + return resource$276; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -15379,37 +15408,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$280 = hoistableRoot.querySelector( + var instance$281 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$280) + if (instance$281) return ( (resource.state.loading |= 4), - (resource.instance = instance$280), - markNodeAsHoistable(instance$280), - instance$280 + (resource.instance = instance$281), + markNodeAsHoistable(instance$281), + instance$281 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$280 = ( + instance$281 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$280); - var linkInstance = instance$280; + markNodeAsHoistable(instance$281); + var linkInstance = instance$281; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$280, "link", instance); + setInitialProperties(instance$281, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$280, props.precedence, hoistableRoot); - return (resource.instance = instance$280); + insertStylesheet(instance$281, props.precedence, hoistableRoot); + return (resource.instance = instance$281); case "script": - instance$280 = getScriptKey(props.src); + instance$281 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$280) + getScriptSelectorFromKey(instance$281) )) ) return ( @@ -15418,7 +15447,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$280))) + if ((styleProps = preloadPropsMap.get(instance$281))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16413,16 +16442,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1724 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1725 = React.version; if ( - "19.0.0-www-modern-def67b9b32-20240603" !== - isomorphicReactPackageVersion$jscomp$inline_1724 + "19.0.0-www-modern-67b05be0d2-20240603" !== + isomorphicReactPackageVersion$jscomp$inline_1725 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1724, - "19.0.0-www-modern-def67b9b32-20240603" + isomorphicReactPackageVersion$jscomp$inline_1725, + "19.0.0-www-modern-67b05be0d2-20240603" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -16438,17 +16467,17 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1726 = { +var devToolsConfig$jscomp$inline_1727 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-def67b9b32-20240603", + version: "19.0.0-www-modern-67b05be0d2-20240603", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2195 = { - bundleType: devToolsConfig$jscomp$inline_1726.bundleType, - version: devToolsConfig$jscomp$inline_1726.version, - rendererPackageName: devToolsConfig$jscomp$inline_1726.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1726.rendererConfig, +var internals$jscomp$inline_2196 = { + bundleType: devToolsConfig$jscomp$inline_1727.bundleType, + version: devToolsConfig$jscomp$inline_1727.version, + rendererPackageName: devToolsConfig$jscomp$inline_1727.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1727.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16464,26 +16493,26 @@ var internals$jscomp$inline_2195 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1726.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1727.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-def67b9b32-20240603" + reconcilerVersion: "19.0.0-www-modern-67b05be0d2-20240603" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2196 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2197 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2196.isDisabled && - hook$jscomp$inline_2196.supportsFiber + !hook$jscomp$inline_2197.isDisabled && + hook$jscomp$inline_2197.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2196.inject( - internals$jscomp$inline_2195 + (rendererID = hook$jscomp$inline_2197.inject( + internals$jscomp$inline_2196 )), - (injectedHook = hook$jscomp$inline_2196); + (injectedHook = hook$jscomp$inline_2197); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -16845,4 +16874,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-def67b9b32-20240603"; +exports.version = "19.0.0-www-modern-67b05be0d2-20240603"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index 377de8ac19180..8d58433fa6828 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -3875,72 +3875,101 @@ function dispatchActionState( payload ) { if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); fiber = actionQueue.pending; null === fiber - ? ((payload = { payload: payload, action: actionQueue.action, next: null }), - (payload.next = actionQueue.pending = payload), - runActionStateAction(actionQueue, setPendingState, setState, payload)) - : (actionQueue.pending = fiber.next = - { payload: payload, action: actionQueue.action, next: fiber.next }); -} -function runActionStateAction(actionQueue, setPendingState, setState, node) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - setPendingState(!0); - var action = node.action; - node = node.payload; - var prevState = actionQueue.state; - try { - var returnValue = action(prevState, node), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - }, - function () { - return finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - } - ), - setState(returnValue)) - : (setState(returnValue), - (actionQueue.state = returnValue), - finishRunningActionStateAction(actionQueue, setPendingState, setState)); - } catch (error) { - setState({ then: function () {}, status: "rejected", reason: error }), - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; - } + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = fiber.next), + (actionQueue.pending = fiber.next = actionNode)); +} +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; + } + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$65) { + onActionError(actionQueue, node, error$65); + } } -function finishRunningActionStateAction( - actionQueue, - setPendingState, - setState -) { - var last = actionQueue.pending; - if (null !== last) { - var first = last.next; - first === last +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); +} +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode ? (actionQueue.pending = null) - : ((first = first.next), - (last.next = first), - runActionStateAction(actionQueue, setPendingState, setState, first)); - } + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + actionNode.status = "rejected"; + actionNode.reason = error; + notifyActionListeners(actionNode); + actionNode = actionQueue.pending; + null !== actionNode && + ((error = actionNode.next), + error === actionNode + ? (actionQueue.pending = null) + : ((error = error.next), + (actionNode.next = error), + runActionStateAction(actionQueue, error))); +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); } function actionStateReducer(oldState, newState) { return newState; @@ -4345,14 +4374,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(provider); fiber = createUpdate(lane); - var root$67 = enqueueUpdate(provider, fiber, lane); - null !== root$67 && - (scheduleUpdateOnFiber(root$67, provider, lane), - entangleTransitions(root$67, provider, lane)); + var root$68 = enqueueUpdate(provider, fiber, lane); + null !== root$68 && + (scheduleUpdateOnFiber(root$68, provider, lane), + entangleTransitions(root$68, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$67 && + null !== root$68 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -5017,9 +5046,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$73 in Component) - void 0 === newProps[propName$73] && - (newProps[propName$73] = Component[propName$73]); + for (var propName$74 in Component) + void 0 === newProps[propName$74] && + (newProps[propName$74] = Component[propName$74]); } return newProps; } @@ -5465,10 +5494,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$86 = workInProgress.stateNode; + root$87 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$86.incompleteTransitions.has(transition)) { + if (!root$87.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -5476,11 +5505,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$86.incompleteTransitions.set(transition, markerInstance); + root$87.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$86.incompleteTransitions.forEach(function (markerInstance) { + root$87.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -7979,14 +8008,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$130 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$130 = lastTailNode), + for (var lastTailNode$131 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$131 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$130 + null === lastTailNode$131 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$130.sibling = null); + : (lastTailNode$131.sibling = null); } } function bubbleProperties(completedWork) { @@ -7998,53 +8027,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$132 = completedWork.selfBaseDuration, - child$133 = completedWork.child; - null !== child$133; + var treeBaseDuration$133 = completedWork.selfBaseDuration, + child$134 = completedWork.child; + null !== child$134; ) - (newChildLanes |= child$133.lanes | child$133.childLanes), - (subtreeFlags |= child$133.subtreeFlags & 31457280), - (subtreeFlags |= child$133.flags & 31457280), - (treeBaseDuration$132 += child$133.treeBaseDuration), - (child$133 = child$133.sibling); - completedWork.treeBaseDuration = treeBaseDuration$132; + (newChildLanes |= child$134.lanes | child$134.childLanes), + (subtreeFlags |= child$134.subtreeFlags & 31457280), + (subtreeFlags |= child$134.flags & 31457280), + (treeBaseDuration$133 += child$134.treeBaseDuration), + (child$134 = child$134.sibling); + completedWork.treeBaseDuration = treeBaseDuration$133; } else for ( - treeBaseDuration$132 = completedWork.child; - null !== treeBaseDuration$132; + treeBaseDuration$133 = completedWork.child; + null !== treeBaseDuration$133; ) (newChildLanes |= - treeBaseDuration$132.lanes | treeBaseDuration$132.childLanes), - (subtreeFlags |= treeBaseDuration$132.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$132.flags & 31457280), - (treeBaseDuration$132.return = completedWork), - (treeBaseDuration$132 = treeBaseDuration$132.sibling); + treeBaseDuration$133.lanes | treeBaseDuration$133.childLanes), + (subtreeFlags |= treeBaseDuration$133.subtreeFlags & 31457280), + (subtreeFlags |= treeBaseDuration$133.flags & 31457280), + (treeBaseDuration$133.return = completedWork), + (treeBaseDuration$133 = treeBaseDuration$133.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$132 = completedWork.actualDuration; - child$133 = completedWork.selfBaseDuration; + treeBaseDuration$133 = completedWork.actualDuration; + child$134 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$132 += child.actualDuration), - (child$133 += child.treeBaseDuration), + (treeBaseDuration$133 += child.actualDuration), + (child$134 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$132; - completedWork.treeBaseDuration = child$133; + completedWork.actualDuration = treeBaseDuration$133; + completedWork.treeBaseDuration = child$134; } else for ( - treeBaseDuration$132 = completedWork.child; - null !== treeBaseDuration$132; + treeBaseDuration$133 = completedWork.child; + null !== treeBaseDuration$133; ) (newChildLanes |= - treeBaseDuration$132.lanes | treeBaseDuration$132.childLanes), - (subtreeFlags |= treeBaseDuration$132.subtreeFlags), - (subtreeFlags |= treeBaseDuration$132.flags), - (treeBaseDuration$132.return = completedWork), - (treeBaseDuration$132 = treeBaseDuration$132.sibling); + treeBaseDuration$133.lanes | treeBaseDuration$133.childLanes), + (subtreeFlags |= treeBaseDuration$133.subtreeFlags), + (subtreeFlags |= treeBaseDuration$133.flags), + (treeBaseDuration$133.return = completedWork), + (treeBaseDuration$133 = treeBaseDuration$133.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -8356,11 +8385,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$148 = null; + var cache$149 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$148 = newProps.memoizedState.cachePool.pool); - cache$148 !== type && (newProps.flags |= 2048); + (cache$149 = newProps.memoizedState.cachePool.pool); + cache$149 !== type && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -8405,8 +8434,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$148 = type.rendering; - if (null === cache$148) + cache$149 = type.rendering; + if (null === cache$149) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -8414,11 +8443,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$148 = findFirstSuspended(current); - if (null !== cache$148) { + cache$149 = findFirstSuspended(current); + if (null !== cache$149) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$148.updateQueue; + current = cache$149.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -8443,7 +8472,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$148)), null !== current)) { + if (((current = findFirstSuspended(cache$149)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -8453,7 +8482,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$148.alternate && + !cache$149.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -8466,13 +8495,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$148.sibling = workInProgress.child), - (workInProgress.child = cache$148)) + ? ((cache$149.sibling = workInProgress.child), + (workInProgress.child = cache$149)) : ((current = type.last), null !== current - ? (current.sibling = cache$148) - : (workInProgress.child = cache$148), - (type.last = cache$148)); + ? (current.sibling = cache$149) + : (workInProgress.child = cache$149), + (type.last = cache$149)); } if (null !== type.tail) return ( @@ -8785,8 +8814,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { recordLayoutEffectDuration(current); } else ref(null); - } catch (error$166) { - captureCommitPhaseError(current, nearestMountedAncestor, error$166); + } catch (error$167) { + captureCommitPhaseError(current, nearestMountedAncestor, error$167); } else ref.current = null; } @@ -8823,7 +8852,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$236) { + } catch (e$237) { JSCompiler_temp = null; break a; } @@ -9081,11 +9110,11 @@ function commitPassiveEffectDurations(finishedRoot, finishedWork) { var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id; _finishedWork$memoize = _finishedWork$memoize.onPostCommit; - var commitTime$168 = commitTime, + var commitTime$169 = commitTime, phase = null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof _finishedWork$memoize && - _finishedWork$memoize(id, phase, finishedRoot, commitTime$168); + _finishedWork$memoize(id, phase, finishedRoot, commitTime$169); finishedWork = finishedWork.return; a: for (; null !== finishedWork; ) { switch (finishedWork.tag) { @@ -9112,8 +9141,8 @@ function commitHookLayoutEffects(finishedWork, hookFlags) { } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$170) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$170); + } catch (error$171) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$171); } } function commitClassCallbacks(finishedWork) { @@ -9212,11 +9241,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$171) { + } catch (error$172) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$171 + error$172 ); } else { @@ -9234,11 +9263,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$172) { + } catch (error$173) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$172 + error$173 ); } recordLayoutEffectDuration(finishedWork); @@ -9249,11 +9278,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$173) { + } catch (error$174) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$173 + error$174 ); } } @@ -9816,19 +9845,19 @@ function commitDeletionEffectsOnFiber( } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { if (null === finishedWork.memoizedState) { - var current$187 = finishedWork.alternate; + var current$188 = finishedWork.alternate; if ( - null !== current$187 && - ((current$187 = current$187.memoizedState), - null !== current$187 && - ((current$187 = current$187.dehydrated), null !== current$187)) + null !== current$188 && + ((current$188 = current$188.memoizedState), + null !== current$188 && + ((current$188 = current$188.dehydrated), null !== current$188)) ) try { - retryIfBlockedOn(current$187); + retryIfBlockedOn(current$188); var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; - onHydrated && onHydrated(current$187); + onHydrated && onHydrated(current$188); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -9960,22 +9989,22 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { startLayoutEffectTimer(), commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$189) { + } catch (error$190) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$189 + error$190 ); } recordLayoutEffectDuration(finishedWork); } else try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$190) { + } catch (error$191) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$190 + error$191 ); } } @@ -10149,11 +10178,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$191) { + } catch (error$192) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$191 + error$192 ); } break; @@ -10190,8 +10219,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$192) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$192); + } catch (error$193) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$193); } } if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { @@ -10201,8 +10230,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { updateProperties(root, maybeNodes, current, hoistableRoot), (root[internalPropsKey] = hoistableRoot); - } catch (error$194) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$194); + } catch (error$195) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$195); } } flags & 1024 && (needsFormReset = !0); @@ -10217,8 +10246,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { current = finishedWork.memoizedProps; try { flags.nodeValue = current; - } catch (error$195) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$195); + } catch (error$196) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$196); } } break; @@ -10232,8 +10261,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$196) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$196); + } catch (error$197) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$197); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -10265,8 +10294,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$198) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$198); + } catch (error$199) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$199); } flags = finishedWork.updateQueue; null !== flags && @@ -10344,11 +10373,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$178) { + } catch (error$179) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$178 + error$179 ); } } else if ( @@ -10423,21 +10452,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$179 = JSCompiler_inline_result.stateNode; + var parent$180 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$179, ""), + (setTextContent(parent$180, ""), (JSCompiler_inline_result.flags &= -33)); - var before$180 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$180, parent$179); + var before$181 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$181, parent$180); break; case 3: case 4: - var parent$181 = JSCompiler_inline_result.stateNode.containerInfo, - before$182 = getHostSibling(finishedWork); + var parent$182 = JSCompiler_inline_result.stateNode.containerInfo, + before$183 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$182, - parent$181 + before$183, + parent$182 ); break; default: @@ -10529,7 +10558,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$202 = parentFiber.alternate, + var current$203 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -10557,16 +10586,16 @@ function recursivelyTraverseReappearLayoutEffects( } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - current$202 = finishedWork.updateQueue; - if (null !== current$202) { - var hiddenCallbacks = current$202.shared.hiddenCallbacks; + current$203 = finishedWork.updateQueue; + if (null !== current$203) { + var hiddenCallbacks = current$203.shared.hiddenCallbacks; if (null !== hiddenCallbacks) for ( - current$202.shared.hiddenCallbacks = null, current$202 = 0; - current$202 < hiddenCallbacks.length; - current$202++ + current$203.shared.hiddenCallbacks = null, current$203 = 0; + current$203 < hiddenCallbacks.length; + current$203++ ) - callCallback(hiddenCallbacks[current$202], finishedRoot); + callCallback(hiddenCallbacks[current$203], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -10582,7 +10611,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$202 && + null === current$203 && flags & 4 && commitHostComponentMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); @@ -10595,7 +10624,7 @@ function recursivelyTraverseReappearLayoutEffects( ); includeWorkInProgressEffects && flags & 4 && - commitProfilerUpdate(finishedWork, current$202); + commitProfilerUpdate(finishedWork, current$203); break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -10638,8 +10667,8 @@ function commitHookPassiveMountEffects(finishedWork, hookFlags) { } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$203) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$203); + } catch (error$204) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$204); } } function commitOffscreenPassiveMountEffects(current, finishedWork, instance) { @@ -10938,9 +10967,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$210 = finishedWork.stateNode; + var instance$211 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$210._visibility & 4 + ? instance$211._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10953,7 +10982,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$210._visibility |= 4), + : ((instance$211._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10961,7 +10990,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$210._visibility |= 4), + : ((instance$211._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10974,7 +11003,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$210 + instance$211 ); break; case 24: @@ -12001,8 +12030,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$221) { - handleThrow(root, thrownValue$221); + } catch (thrownValue$222) { + handleThrow(root, thrownValue$222); } while (1); lanes && root.shellSuspendCounter++; @@ -12122,8 +12151,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$223) { - handleThrow(root, thrownValue$223); + } catch (thrownValue$224) { + handleThrow(root, thrownValue$224); } while (1); resetContextDependencies(); @@ -12298,23 +12327,23 @@ function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - var current$227 = completedWork.alternate; + var current$228 = completedWork.alternate; unitOfWork = completedWork.return; 0 === (completedWork.mode & 2) - ? (current$227 = completeWork( - current$227, + ? (current$228 = completeWork( + current$228, completedWork, entangledRenderLanes )) : (startProfilerTimer(completedWork), - (current$227 = completeWork( - current$227, + (current$228 = completeWork( + current$228, completedWork, entangledRenderLanes )), stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1)); - if (null !== current$227) { - workInProgress = current$227; + if (null !== current$228) { + workInProgress = current$228; return; } completedWork = completedWork.sibling; @@ -12403,13 +12432,13 @@ function commitRootImpl( Internals.p = 2; var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$229 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$230 = commitBeforeMutationEffects( root, finishedWork ); commitTime = now(); commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur$229 && + shouldFireAfterActiveInstanceBlur$230 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -12494,7 +12523,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$230 = rootWithPendingPassiveEffects, + var root$231 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -12509,7 +12538,7 @@ function flushPassiveEffects() { } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$230, remainingLanes); + releaseRootPooledCache(root$231, remainingLanes); } } return !1; @@ -13850,19 +13879,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$392; + var JSCompiler_inline_result$jscomp$393; if (canUseDOM) { - var isSupported$jscomp$inline_1626 = "oninput" in document; - if (!isSupported$jscomp$inline_1626) { - var element$jscomp$inline_1627 = document.createElement("div"); - element$jscomp$inline_1627.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1626 = - "function" === typeof element$jscomp$inline_1627.oninput; + var isSupported$jscomp$inline_1627 = "oninput" in document; + if (!isSupported$jscomp$inline_1627) { + var element$jscomp$inline_1628 = document.createElement("div"); + element$jscomp$inline_1628.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1627 = + "function" === typeof element$jscomp$inline_1628.oninput; } - JSCompiler_inline_result$jscomp$392 = isSupported$jscomp$inline_1626; - } else JSCompiler_inline_result$jscomp$392 = !1; + JSCompiler_inline_result$jscomp$393 = isSupported$jscomp$inline_1627; + } else JSCompiler_inline_result$jscomp$393 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$392 && + JSCompiler_inline_result$jscomp$393 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -14271,20 +14300,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1667 = 0; - i$jscomp$inline_1667 < simpleEventPluginEvents.length; - i$jscomp$inline_1667++ + var i$jscomp$inline_1668 = 0; + i$jscomp$inline_1668 < simpleEventPluginEvents.length; + i$jscomp$inline_1668++ ) { - var eventName$jscomp$inline_1668 = - simpleEventPluginEvents[i$jscomp$inline_1667], - domEventName$jscomp$inline_1669 = - eventName$jscomp$inline_1668.toLowerCase(), - capitalizedEvent$jscomp$inline_1670 = - eventName$jscomp$inline_1668[0].toUpperCase() + - eventName$jscomp$inline_1668.slice(1); + var eventName$jscomp$inline_1669 = + simpleEventPluginEvents[i$jscomp$inline_1668], + domEventName$jscomp$inline_1670 = + eventName$jscomp$inline_1669.toLowerCase(), + capitalizedEvent$jscomp$inline_1671 = + eventName$jscomp$inline_1669[0].toUpperCase() + + eventName$jscomp$inline_1669.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1669, - "on" + capitalizedEvent$jscomp$inline_1670 + domEventName$jscomp$inline_1670, + "on" + capitalizedEvent$jscomp$inline_1671 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15762,14 +15791,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$265 in nextProps) { - var propKey = nextProps[propKey$265]; - lastProp = lastProps[propKey$265]; + for (var propKey$266 in nextProps) { + var propKey = nextProps[propKey$266]; + lastProp = lastProps[propKey$266]; if ( - nextProps.hasOwnProperty(propKey$265) && + nextProps.hasOwnProperty(propKey$266) && (null != propKey || null != lastProp) ) - switch (propKey$265) { + switch (propKey$266) { case "type": type = propKey; break; @@ -15798,7 +15827,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$265, + propKey$266, propKey, nextProps, lastProp @@ -15817,7 +15846,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$265 = null; + propKey = value = defaultValue = propKey$266 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15848,7 +15877,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$265 = type; + propKey$266 = type; break; case "defaultValue": defaultValue = type; @@ -15869,15 +15898,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$265 - ? updateOptions(domElement, !!lastProps, propKey$265, !1) + null != propKey$266 + ? updateOptions(domElement, !!lastProps, propKey$266, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$265 = null; + propKey = propKey$266 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15901,7 +15930,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$265 = name; + propKey$266 = name; break; case "defaultValue": propKey = name; @@ -15915,17 +15944,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$265, propKey); + updateTextarea(domElement, propKey$266, propKey); return; case "option": - for (var propKey$281 in lastProps) + for (var propKey$282 in lastProps) if ( - ((propKey$265 = lastProps[propKey$281]), - lastProps.hasOwnProperty(propKey$281) && - null != propKey$265 && - !nextProps.hasOwnProperty(propKey$281)) + ((propKey$266 = lastProps[propKey$282]), + lastProps.hasOwnProperty(propKey$282) && + null != propKey$266 && + !nextProps.hasOwnProperty(propKey$282)) ) - switch (propKey$281) { + switch (propKey$282) { case "selected": domElement.selected = !1; break; @@ -15933,33 +15962,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$281, + propKey$282, null, nextProps, - propKey$265 + propKey$266 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$265 = nextProps[lastDefaultValue]), + ((propKey$266 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$265 !== propKey && - (null != propKey$265 || null != propKey)) + propKey$266 !== propKey && + (null != propKey$266 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$265 && - "function" !== typeof propKey$265 && - "symbol" !== typeof propKey$265; + propKey$266 && + "function" !== typeof propKey$266 && + "symbol" !== typeof propKey$266; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$265, + propKey$266, nextProps, propKey ); @@ -15980,24 +16009,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$286 in lastProps) - (propKey$265 = lastProps[propKey$286]), - lastProps.hasOwnProperty(propKey$286) && - null != propKey$265 && - !nextProps.hasOwnProperty(propKey$286) && - setProp(domElement, tag, propKey$286, null, nextProps, propKey$265); + for (var propKey$287 in lastProps) + (propKey$266 = lastProps[propKey$287]), + lastProps.hasOwnProperty(propKey$287) && + null != propKey$266 && + !nextProps.hasOwnProperty(propKey$287) && + setProp(domElement, tag, propKey$287, null, nextProps, propKey$266); for (checked in nextProps) if ( - ((propKey$265 = nextProps[checked]), + ((propKey$266 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$265 !== propKey && - (null != propKey$265 || null != propKey)) + propKey$266 !== propKey && + (null != propKey$266 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$265) + if (null != propKey$266) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -16005,7 +16034,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$265, + propKey$266, nextProps, propKey ); @@ -16013,49 +16042,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$291 in lastProps) - (propKey$265 = lastProps[propKey$291]), - lastProps.hasOwnProperty(propKey$291) && - void 0 !== propKey$265 && - !nextProps.hasOwnProperty(propKey$291) && + for (var propKey$292 in lastProps) + (propKey$266 = lastProps[propKey$292]), + lastProps.hasOwnProperty(propKey$292) && + void 0 !== propKey$266 && + !nextProps.hasOwnProperty(propKey$292) && setPropOnCustomElement( domElement, tag, - propKey$291, + propKey$292, void 0, nextProps, - propKey$265 + propKey$266 ); for (defaultChecked in nextProps) - (propKey$265 = nextProps[defaultChecked]), + (propKey$266 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$265 === propKey || - (void 0 === propKey$265 && void 0 === propKey) || + propKey$266 === propKey || + (void 0 === propKey$266 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$265, + propKey$266, nextProps, propKey ); return; } } - for (var propKey$296 in lastProps) - (propKey$265 = lastProps[propKey$296]), - lastProps.hasOwnProperty(propKey$296) && - null != propKey$265 && - !nextProps.hasOwnProperty(propKey$296) && - setProp(domElement, tag, propKey$296, null, nextProps, propKey$265); + for (var propKey$297 in lastProps) + (propKey$266 = lastProps[propKey$297]), + lastProps.hasOwnProperty(propKey$297) && + null != propKey$266 && + !nextProps.hasOwnProperty(propKey$297) && + setProp(domElement, tag, propKey$297, null, nextProps, propKey$266); for (lastProp in nextProps) - (propKey$265 = nextProps[lastProp]), + (propKey$266 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$265 === propKey || - (null == propKey$265 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$265, nextProps, propKey); + propKey$266 === propKey || + (null == propKey$266 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$266, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -16642,20 +16671,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$304 = getResourcesFromRoot( + var styles$305 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$305 = styles$304.get(type); - resource$305 || + resource$306 = styles$305.get(type); + resource$306 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$305 = { + (resource$306 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$304.set(type, resource$305), + styles$305.set(type, resource$306), preloadPropsMap.has(type) || preloadStylesheet( JSCompiler_inline_result, @@ -16670,11 +16699,11 @@ function getResource(type, currentProps, pendingProps, currentResource) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$305.state + resource$306.state )); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$305; + return resource$306; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -16773,37 +16802,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$310 = hoistableRoot.querySelector( + var instance$311 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$310) + if (instance$311) return ( (resource.state.loading |= 4), - (resource.instance = instance$310), - markNodeAsHoistable(instance$310), - instance$310 + (resource.instance = instance$311), + markNodeAsHoistable(instance$311), + instance$311 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$310 = ( + instance$311 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$310); - var linkInstance = instance$310; + markNodeAsHoistable(instance$311); + var linkInstance = instance$311; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$310, "link", instance); + setInitialProperties(instance$311, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$310, props.precedence, hoistableRoot); - return (resource.instance = instance$310); + insertStylesheet(instance$311, props.precedence, hoistableRoot); + return (resource.instance = instance$311); case "script": - instance$310 = getScriptKey(props.src); + instance$311 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$310) + getScriptSelectorFromKey(instance$311) )) ) return ( @@ -16812,7 +16841,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$310))) + if ((styleProps = preloadPropsMap.get(instance$311))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17817,16 +17846,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1840 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1841 = React.version; if ( - "19.0.0-www-classic-def67b9b32-20240603" !== - isomorphicReactPackageVersion$jscomp$inline_1840 + "19.0.0-www-classic-67b05be0d2-20240603" !== + isomorphicReactPackageVersion$jscomp$inline_1841 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1840, - "19.0.0-www-classic-def67b9b32-20240603" + isomorphicReactPackageVersion$jscomp$inline_1841, + "19.0.0-www-classic-67b05be0d2-20240603" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17842,10 +17871,10 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1847 = { +var devToolsConfig$jscomp$inline_1848 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-def67b9b32-20240603", + version: "19.0.0-www-classic-67b05be0d2-20240603", rendererPackageName: "react-dom" }; (function (internals) { @@ -17863,10 +17892,10 @@ var devToolsConfig$jscomp$inline_1847 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1847.bundleType, - version: devToolsConfig$jscomp$inline_1847.version, - rendererPackageName: devToolsConfig$jscomp$inline_1847.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1847.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1848.bundleType, + version: devToolsConfig$jscomp$inline_1848.version, + rendererPackageName: devToolsConfig$jscomp$inline_1848.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1848.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17882,14 +17911,14 @@ var devToolsConfig$jscomp$inline_1847 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1847.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1848.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-def67b9b32-20240603" + reconcilerVersion: "19.0.0-www-classic-67b05be0d2-20240603" }); function ReactDOMRoot(internalRoot) { this._internalRoot = internalRoot; @@ -17962,11 +17991,11 @@ function legacyCreateRootFromDOMContainer( if ("function" === typeof callback) { var originalCallback = callback; callback = function () { - var instance = getPublicRootInstance(root$331); + var instance = getPublicRootInstance(root$332); originalCallback.call(instance); }; } - var root$331 = createHydrationContainer( + var root$332 = createHydrationContainer( initialChildren, callback, container, @@ -17981,23 +18010,23 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$331; - container[internalContainerInstanceKey] = root$331.current; + container._reactRootContainer = root$332; + container[internalContainerInstanceKey] = root$332.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSyncWork(); - return root$331; + return root$332; } clearContainer(container); if ("function" === typeof callback) { - var originalCallback$332 = callback; + var originalCallback$333 = callback; callback = function () { - var instance = getPublicRootInstance(root$333); - originalCallback$332.call(instance); + var instance = getPublicRootInstance(root$334); + originalCallback$333.call(instance); }; } - var root$333 = createFiberRoot( + var root$334 = createFiberRoot( container, 0, !1, @@ -18012,14 +18041,14 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$333; - container[internalContainerInstanceKey] = root$333.current; + container._reactRootContainer = root$334; + container[internalContainerInstanceKey] = root$334.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); - updateContainerSync(initialChildren, root$333, parentComponent, callback); + updateContainerSync(initialChildren, root$334, parentComponent, callback); flushSyncWork(); - return root$333; + return root$334; } function legacyRenderSubtreeIntoContainer( parentComponent, @@ -18380,7 +18409,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-def67b9b32-20240603"; +exports.version = "19.0.0-www-classic-67b05be0d2-20240603"; "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 e67c59740a0a0..879f570b7a39a 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -3663,72 +3663,101 @@ function dispatchActionState( payload ) { if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); fiber = actionQueue.pending; null === fiber - ? ((payload = { payload: payload, action: actionQueue.action, next: null }), - (payload.next = actionQueue.pending = payload), - runActionStateAction(actionQueue, setPendingState, setState, payload)) - : (actionQueue.pending = fiber.next = - { payload: payload, action: actionQueue.action, next: fiber.next }); -} -function runActionStateAction(actionQueue, setPendingState, setState, node) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - setPendingState(!0); - var action = node.action; - node = node.payload; - var prevState = actionQueue.state; - try { - var returnValue = action(prevState, node), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - }, - function () { - return finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - } - ), - setState(returnValue)) - : (setState(returnValue), - (actionQueue.state = returnValue), - finishRunningActionStateAction(actionQueue, setPendingState, setState)); - } catch (error) { - setState({ then: function () {}, status: "rejected", reason: error }), - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; - } + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = fiber.next), + (actionQueue.pending = fiber.next = actionNode)); +} +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; + } + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$65) { + onActionError(actionQueue, node, error$65); + } } -function finishRunningActionStateAction( - actionQueue, - setPendingState, - setState -) { - var last = actionQueue.pending; - if (null !== last) { - var first = last.next; - first === last +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); +} +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode ? (actionQueue.pending = null) - : ((first = first.next), - (last.next = first), - runActionStateAction(actionQueue, setPendingState, setState, first)); - } + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + actionNode.status = "rejected"; + actionNode.reason = error; + notifyActionListeners(actionNode); + actionNode = actionQueue.pending; + null !== actionNode && + ((error = actionNode.next), + error === actionNode + ? (actionQueue.pending = null) + : ((error = error.next), + (actionNode.next = error), + runActionStateAction(actionQueue, error))); +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); } function actionStateReducer(oldState, newState) { return newState; @@ -4133,14 +4162,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$67 = enqueueUpdate(provider, fiber, lane); - null !== root$67 && - (scheduleUpdateOnFiber(root$67, provider, lane), - entangleTransitions(root$67, provider, lane)); + var root$68 = enqueueUpdate(provider, fiber, lane); + null !== root$68 && + (scheduleUpdateOnFiber(root$68, provider, lane), + entangleTransitions(root$68, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$67 && + null !== root$68 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4743,9 +4772,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$73 in Component) - void 0 === newProps[propName$73] && - (newProps[propName$73] = Component[propName$73]); + for (var propName$74 in Component) + void 0 === newProps[propName$74] && + (newProps[propName$74] = Component[propName$74]); } return newProps; } @@ -5123,10 +5152,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$85 = workInProgress.stateNode; + root$86 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$85.incompleteTransitions.has(transition)) { + if (!root$86.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -5134,11 +5163,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$85.incompleteTransitions.set(transition, markerInstance); + root$86.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$85.incompleteTransitions.forEach(function (markerInstance) { + root$86.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -7504,14 +7533,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$122 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$122 = lastTailNode), + for (var lastTailNode$123 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$123 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$122 + null === lastTailNode$123 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$122.sibling = null); + : (lastTailNode$123.sibling = null); } } function bubbleProperties(completedWork) { @@ -7523,53 +7552,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$124 = completedWork.selfBaseDuration, - child$125 = completedWork.child; - null !== child$125; + var treeBaseDuration$125 = completedWork.selfBaseDuration, + child$126 = completedWork.child; + null !== child$126; ) - (newChildLanes |= child$125.lanes | child$125.childLanes), - (subtreeFlags |= child$125.subtreeFlags & 31457280), - (subtreeFlags |= child$125.flags & 31457280), - (treeBaseDuration$124 += child$125.treeBaseDuration), - (child$125 = child$125.sibling); - completedWork.treeBaseDuration = treeBaseDuration$124; + (newChildLanes |= child$126.lanes | child$126.childLanes), + (subtreeFlags |= child$126.subtreeFlags & 31457280), + (subtreeFlags |= child$126.flags & 31457280), + (treeBaseDuration$125 += child$126.treeBaseDuration), + (child$126 = child$126.sibling); + completedWork.treeBaseDuration = treeBaseDuration$125; } else for ( - treeBaseDuration$124 = completedWork.child; - null !== treeBaseDuration$124; + treeBaseDuration$125 = completedWork.child; + null !== treeBaseDuration$125; ) (newChildLanes |= - treeBaseDuration$124.lanes | treeBaseDuration$124.childLanes), - (subtreeFlags |= treeBaseDuration$124.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$124.flags & 31457280), - (treeBaseDuration$124.return = completedWork), - (treeBaseDuration$124 = treeBaseDuration$124.sibling); + treeBaseDuration$125.lanes | treeBaseDuration$125.childLanes), + (subtreeFlags |= treeBaseDuration$125.subtreeFlags & 31457280), + (subtreeFlags |= treeBaseDuration$125.flags & 31457280), + (treeBaseDuration$125.return = completedWork), + (treeBaseDuration$125 = treeBaseDuration$125.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$124 = completedWork.actualDuration; - child$125 = completedWork.selfBaseDuration; + treeBaseDuration$125 = completedWork.actualDuration; + child$126 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$124 += child.actualDuration), - (child$125 += child.treeBaseDuration), + (treeBaseDuration$125 += child.actualDuration), + (child$126 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$124; - completedWork.treeBaseDuration = child$125; + completedWork.actualDuration = treeBaseDuration$125; + completedWork.treeBaseDuration = child$126; } else for ( - treeBaseDuration$124 = completedWork.child; - null !== treeBaseDuration$124; + treeBaseDuration$125 = completedWork.child; + null !== treeBaseDuration$125; ) (newChildLanes |= - treeBaseDuration$124.lanes | treeBaseDuration$124.childLanes), - (subtreeFlags |= treeBaseDuration$124.subtreeFlags), - (subtreeFlags |= treeBaseDuration$124.flags), - (treeBaseDuration$124.return = completedWork), - (treeBaseDuration$124 = treeBaseDuration$124.sibling); + treeBaseDuration$125.lanes | treeBaseDuration$125.childLanes), + (subtreeFlags |= treeBaseDuration$125.subtreeFlags), + (subtreeFlags |= treeBaseDuration$125.flags), + (treeBaseDuration$125.return = completedWork), + (treeBaseDuration$125 = treeBaseDuration$125.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -7874,11 +7903,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$140 = null; + var cache$141 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$140 = newProps.memoizedState.cachePool.pool); - cache$140 !== type && (newProps.flags |= 2048); + (cache$141 = newProps.memoizedState.cachePool.pool); + cache$141 !== type && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -7917,8 +7946,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$140 = type.rendering; - if (null === cache$140) + cache$141 = type.rendering; + if (null === cache$141) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -7926,11 +7955,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$140 = findFirstSuspended(current); - if (null !== cache$140) { + cache$141 = findFirstSuspended(current); + if (null !== cache$141) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$140.updateQueue; + current = cache$141.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -7955,7 +7984,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$140)), null !== current)) { + if (((current = findFirstSuspended(cache$141)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -7965,7 +7994,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$140.alternate && + !cache$141.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -7978,13 +8007,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$140.sibling = workInProgress.child), - (workInProgress.child = cache$140)) + ? ((cache$141.sibling = workInProgress.child), + (workInProgress.child = cache$141)) : ((current = type.last), null !== current - ? (current.sibling = cache$140) - : (workInProgress.child = cache$140), - (type.last = cache$140)); + ? (current.sibling = cache$141) + : (workInProgress.child = cache$141), + (type.last = cache$141)); } if (null !== type.tail) return ( @@ -8288,8 +8317,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { recordLayoutEffectDuration(current); } else ref(null); - } catch (error$157) { - captureCommitPhaseError(current, nearestMountedAncestor, error$157); + } catch (error$158) { + captureCommitPhaseError(current, nearestMountedAncestor, error$158); } else ref.current = null; } @@ -8326,7 +8355,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$227) { + } catch (e$228) { JSCompiler_temp = null; break a; } @@ -8597,11 +8626,11 @@ function commitPassiveEffectDurations(finishedRoot, finishedWork) { var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id; _finishedWork$memoize = _finishedWork$memoize.onPostCommit; - var commitTime$159 = commitTime, + var commitTime$160 = commitTime, phase = null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof _finishedWork$memoize && - _finishedWork$memoize(id, phase, finishedRoot, commitTime$159); + _finishedWork$memoize(id, phase, finishedRoot, commitTime$160); finishedWork = finishedWork.return; a: for (; null !== finishedWork; ) { switch (finishedWork.tag) { @@ -8628,8 +8657,8 @@ function commitHookLayoutEffects(finishedWork, hookFlags) { } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$161) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$161); + } catch (error$162) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$162); } } function commitClassCallbacks(finishedWork) { @@ -8728,11 +8757,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$162) { + } catch (error$163) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$162 + error$163 ); } else { @@ -8750,11 +8779,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$163) { + } catch (error$164) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$163 + error$164 ); } recordLayoutEffectDuration(finishedWork); @@ -8765,11 +8794,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$164) { + } catch (error$165) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$164 + error$165 ); } } @@ -9321,19 +9350,19 @@ function commitDeletionEffectsOnFiber( } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { if (null === finishedWork.memoizedState) { - var current$178 = finishedWork.alternate; + var current$179 = finishedWork.alternate; if ( - null !== current$178 && - ((current$178 = current$178.memoizedState), - null !== current$178 && - ((current$178 = current$178.dehydrated), null !== current$178)) + null !== current$179 && + ((current$179 = current$179.memoizedState), + null !== current$179 && + ((current$179 = current$179.dehydrated), null !== current$179)) ) try { - retryIfBlockedOn(current$178); + retryIfBlockedOn(current$179); var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; - onHydrated && onHydrated(current$178); + onHydrated && onHydrated(current$179); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -9465,22 +9494,22 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { startLayoutEffectTimer(), commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$180) { + } catch (error$181) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$180 + error$181 ); } recordLayoutEffectDuration(finishedWork); } else try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$181) { + } catch (error$182) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$181 + error$182 ); } } @@ -9654,11 +9683,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$182) { + } catch (error$183) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$182 + error$183 ); } break; @@ -9695,8 +9724,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$183) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$183); + } catch (error$184) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$184); } } if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { @@ -9706,8 +9735,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { updateProperties(root, maybeNodes, current, hoistableRoot), (root[internalPropsKey] = hoistableRoot); - } catch (error$185) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$185); + } catch (error$186) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$186); } } flags & 1024 && (needsFormReset = !0); @@ -9722,8 +9751,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { current = finishedWork.memoizedProps; try { flags.nodeValue = current; - } catch (error$186) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$186); + } catch (error$187) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$187); } } break; @@ -9737,8 +9766,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$187) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$187); + } catch (error$188) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$188); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -9770,8 +9799,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$189) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$189); + } catch (error$190) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$190); } flags = finishedWork.updateQueue; null !== flags && @@ -9846,11 +9875,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$169) { + } catch (error$170) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$169 + error$170 ); } } else if ( @@ -9925,21 +9954,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$170 = JSCompiler_inline_result.stateNode; + var parent$171 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$170, ""), + (setTextContent(parent$171, ""), (JSCompiler_inline_result.flags &= -33)); - var before$171 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$171, parent$170); + var before$172 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$172, parent$171); break; case 3: case 4: - var parent$172 = JSCompiler_inline_result.stateNode.containerInfo, - before$173 = getHostSibling(finishedWork); + var parent$173 = JSCompiler_inline_result.stateNode.containerInfo, + before$174 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$173, - parent$172 + before$174, + parent$173 ); break; default: @@ -10031,7 +10060,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$193 = parentFiber.alternate, + var current$194 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -10059,16 +10088,16 @@ function recursivelyTraverseReappearLayoutEffects( } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - current$193 = finishedWork.updateQueue; - if (null !== current$193) { - var hiddenCallbacks = current$193.shared.hiddenCallbacks; + current$194 = finishedWork.updateQueue; + if (null !== current$194) { + var hiddenCallbacks = current$194.shared.hiddenCallbacks; if (null !== hiddenCallbacks) for ( - current$193.shared.hiddenCallbacks = null, current$193 = 0; - current$193 < hiddenCallbacks.length; - current$193++ + current$194.shared.hiddenCallbacks = null, current$194 = 0; + current$194 < hiddenCallbacks.length; + current$194++ ) - callCallback(hiddenCallbacks[current$193], finishedRoot); + callCallback(hiddenCallbacks[current$194], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -10084,7 +10113,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$193 && + null === current$194 && flags & 4 && commitHostComponentMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); @@ -10097,7 +10126,7 @@ function recursivelyTraverseReappearLayoutEffects( ); includeWorkInProgressEffects && flags & 4 && - commitProfilerUpdate(finishedWork, current$193); + commitProfilerUpdate(finishedWork, current$194); break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -10140,8 +10169,8 @@ function commitHookPassiveMountEffects(finishedWork, hookFlags) { } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$194) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$194); + } catch (error$195) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$195); } } function commitOffscreenPassiveMountEffects(current, finishedWork, instance) { @@ -10432,9 +10461,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$201 = finishedWork.stateNode; + var instance$202 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$201._visibility & 4 + ? instance$202._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10446,7 +10475,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$201._visibility |= 4), + : ((instance$202._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10459,7 +10488,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$201 + instance$202 ); break; case 24: @@ -11467,8 +11496,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$212) { - handleThrow(root, thrownValue$212); + } catch (thrownValue$213) { + handleThrow(root, thrownValue$213); } while (1); lanes && root.shellSuspendCounter++; @@ -11588,8 +11617,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$214) { - handleThrow(root, thrownValue$214); + } catch (thrownValue$215) { + handleThrow(root, thrownValue$215); } while (1); resetContextDependencies(); @@ -11760,23 +11789,23 @@ function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - var current$218 = completedWork.alternate; + var current$219 = completedWork.alternate; unitOfWork = completedWork.return; 0 === (completedWork.mode & 2) - ? (current$218 = completeWork( - current$218, + ? (current$219 = completeWork( + current$219, completedWork, entangledRenderLanes )) : (startProfilerTimer(completedWork), - (current$218 = completeWork( - current$218, + (current$219 = completeWork( + current$219, completedWork, entangledRenderLanes )), stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1)); - if (null !== current$218) { - workInProgress = current$218; + if (null !== current$219) { + workInProgress = current$219; return; } completedWork = completedWork.sibling; @@ -11865,13 +11894,13 @@ function commitRootImpl( Internals.p = 2; var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$220 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$221 = commitBeforeMutationEffects( root, finishedWork ); commitTime = now(); commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur$220 && + shouldFireAfterActiveInstanceBlur$221 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -11954,7 +11983,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$221 = rootWithPendingPassiveEffects, + var root$222 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11969,7 +11998,7 @@ function flushPassiveEffects() { } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$221, remainingLanes); + releaseRootPooledCache(root$222, remainingLanes); } } return !1; @@ -13216,19 +13245,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$379; + var JSCompiler_inline_result$jscomp$380; if (canUseDOM) { - 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; + var isSupported$jscomp$inline_1598 = "oninput" in document; + if (!isSupported$jscomp$inline_1598) { + var element$jscomp$inline_1599 = document.createElement("div"); + element$jscomp$inline_1599.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1598 = + "function" === typeof element$jscomp$inline_1599.oninput; } - JSCompiler_inline_result$jscomp$379 = isSupported$jscomp$inline_1597; - } else JSCompiler_inline_result$jscomp$379 = !1; + JSCompiler_inline_result$jscomp$380 = isSupported$jscomp$inline_1598; + } else JSCompiler_inline_result$jscomp$380 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$379 && + JSCompiler_inline_result$jscomp$380 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13637,20 +13666,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1638 = 0; - i$jscomp$inline_1638 < simpleEventPluginEvents.length; - i$jscomp$inline_1638++ + var i$jscomp$inline_1639 = 0; + i$jscomp$inline_1639 < simpleEventPluginEvents.length; + i$jscomp$inline_1639++ ) { - 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); + var eventName$jscomp$inline_1640 = + simpleEventPluginEvents[i$jscomp$inline_1639], + domEventName$jscomp$inline_1641 = + eventName$jscomp$inline_1640.toLowerCase(), + capitalizedEvent$jscomp$inline_1642 = + eventName$jscomp$inline_1640[0].toUpperCase() + + eventName$jscomp$inline_1640.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1640, - "on" + capitalizedEvent$jscomp$inline_1641 + domEventName$jscomp$inline_1641, + "on" + capitalizedEvent$jscomp$inline_1642 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15127,14 +15156,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$256 in nextProps) { - var propKey = nextProps[propKey$256]; - lastProp = lastProps[propKey$256]; + for (var propKey$257 in nextProps) { + var propKey = nextProps[propKey$257]; + lastProp = lastProps[propKey$257]; if ( - nextProps.hasOwnProperty(propKey$256) && + nextProps.hasOwnProperty(propKey$257) && (null != propKey || null != lastProp) ) - switch (propKey$256) { + switch (propKey$257) { case "type": type = propKey; break; @@ -15163,7 +15192,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$256, + propKey$257, propKey, nextProps, lastProp @@ -15182,7 +15211,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$256 = null; + propKey = value = defaultValue = propKey$257 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15213,7 +15242,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$256 = type; + propKey$257 = type; break; case "defaultValue": defaultValue = type; @@ -15234,15 +15263,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$256 - ? updateOptions(domElement, !!lastProps, propKey$256, !1) + null != propKey$257 + ? updateOptions(domElement, !!lastProps, propKey$257, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$256 = null; + propKey = propKey$257 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15266,7 +15295,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$256 = name; + propKey$257 = name; break; case "defaultValue": propKey = name; @@ -15280,17 +15309,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$256, propKey); + updateTextarea(domElement, propKey$257, propKey); return; case "option": - for (var propKey$272 in lastProps) + for (var propKey$273 in lastProps) if ( - ((propKey$256 = lastProps[propKey$272]), - lastProps.hasOwnProperty(propKey$272) && - null != propKey$256 && - !nextProps.hasOwnProperty(propKey$272)) + ((propKey$257 = lastProps[propKey$273]), + lastProps.hasOwnProperty(propKey$273) && + null != propKey$257 && + !nextProps.hasOwnProperty(propKey$273)) ) - switch (propKey$272) { + switch (propKey$273) { case "selected": domElement.selected = !1; break; @@ -15298,33 +15327,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$272, + propKey$273, null, nextProps, - propKey$256 + propKey$257 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$256 = nextProps[lastDefaultValue]), + ((propKey$257 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$256 !== propKey && - (null != propKey$256 || null != propKey)) + propKey$257 !== propKey && + (null != propKey$257 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$256 && - "function" !== typeof propKey$256 && - "symbol" !== typeof propKey$256; + propKey$257 && + "function" !== typeof propKey$257 && + "symbol" !== typeof propKey$257; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$256, + propKey$257, nextProps, propKey ); @@ -15345,24 +15374,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$277 in lastProps) - (propKey$256 = lastProps[propKey$277]), - lastProps.hasOwnProperty(propKey$277) && - null != propKey$256 && - !nextProps.hasOwnProperty(propKey$277) && - setProp(domElement, tag, propKey$277, null, nextProps, propKey$256); + for (var propKey$278 in lastProps) + (propKey$257 = lastProps[propKey$278]), + lastProps.hasOwnProperty(propKey$278) && + null != propKey$257 && + !nextProps.hasOwnProperty(propKey$278) && + setProp(domElement, tag, propKey$278, null, nextProps, propKey$257); for (checked in nextProps) if ( - ((propKey$256 = nextProps[checked]), + ((propKey$257 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$256 !== propKey && - (null != propKey$256 || null != propKey)) + propKey$257 !== propKey && + (null != propKey$257 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$256) + if (null != propKey$257) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15370,7 +15399,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$256, + propKey$257, nextProps, propKey ); @@ -15378,49 +15407,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$282 in lastProps) - (propKey$256 = lastProps[propKey$282]), - lastProps.hasOwnProperty(propKey$282) && - void 0 !== propKey$256 && - !nextProps.hasOwnProperty(propKey$282) && + for (var propKey$283 in lastProps) + (propKey$257 = lastProps[propKey$283]), + lastProps.hasOwnProperty(propKey$283) && + void 0 !== propKey$257 && + !nextProps.hasOwnProperty(propKey$283) && setPropOnCustomElement( domElement, tag, - propKey$282, + propKey$283, void 0, nextProps, - propKey$256 + propKey$257 ); for (defaultChecked in nextProps) - (propKey$256 = nextProps[defaultChecked]), + (propKey$257 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$256 === propKey || - (void 0 === propKey$256 && void 0 === propKey) || + propKey$257 === propKey || + (void 0 === propKey$257 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$256, + propKey$257, nextProps, propKey ); return; } } - for (var propKey$287 in lastProps) - (propKey$256 = lastProps[propKey$287]), - lastProps.hasOwnProperty(propKey$287) && - null != propKey$256 && - !nextProps.hasOwnProperty(propKey$287) && - setProp(domElement, tag, propKey$287, null, nextProps, propKey$256); + for (var propKey$288 in lastProps) + (propKey$257 = lastProps[propKey$288]), + lastProps.hasOwnProperty(propKey$288) && + null != propKey$257 && + !nextProps.hasOwnProperty(propKey$288) && + setProp(domElement, tag, propKey$288, null, nextProps, propKey$257); for (lastProp in nextProps) - (propKey$256 = nextProps[lastProp]), + (propKey$257 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$256 === propKey || - (null == propKey$256 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$256, nextProps, propKey); + propKey$257 === propKey || + (null == propKey$257 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$257, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15998,20 +16027,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$295 = getResourcesFromRoot( + var styles$296 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$296 = styles$295.get(type); - resource$296 || + resource$297 = styles$296.get(type); + resource$297 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$296 = { + (resource$297 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$295.set(type, resource$296), + styles$296.set(type, resource$297), preloadPropsMap.has(type) || preloadStylesheet( JSCompiler_inline_result, @@ -16026,11 +16055,11 @@ function getResource(type, currentProps, pendingProps, currentResource) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$296.state + resource$297.state )); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$296; + return resource$297; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -16129,37 +16158,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$301 = hoistableRoot.querySelector( + var instance$302 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$301) + if (instance$302) return ( (resource.state.loading |= 4), - (resource.instance = instance$301), - markNodeAsHoistable(instance$301), - instance$301 + (resource.instance = instance$302), + markNodeAsHoistable(instance$302), + instance$302 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$301 = ( + instance$302 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$301); - var linkInstance = instance$301; + markNodeAsHoistable(instance$302); + var linkInstance = instance$302; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$301, "link", instance); + setInitialProperties(instance$302, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$301, props.precedence, hoistableRoot); - return (resource.instance = instance$301); + insertStylesheet(instance$302, props.precedence, hoistableRoot); + return (resource.instance = instance$302); case "script": - instance$301 = getScriptKey(props.src); + instance$302 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$301) + getScriptSelectorFromKey(instance$302) )) ) return ( @@ -16168,7 +16197,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$301))) + if ((styleProps = preloadPropsMap.get(instance$302))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17163,16 +17192,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1811 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1812 = React.version; if ( - "19.0.0-www-modern-def67b9b32-20240603" !== - isomorphicReactPackageVersion$jscomp$inline_1811 + "19.0.0-www-modern-67b05be0d2-20240603" !== + isomorphicReactPackageVersion$jscomp$inline_1812 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1811, - "19.0.0-www-modern-def67b9b32-20240603" + isomorphicReactPackageVersion$jscomp$inline_1812, + "19.0.0-www-modern-67b05be0d2-20240603" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17188,10 +17217,10 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1813 = { +var devToolsConfig$jscomp$inline_1814 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-def67b9b32-20240603", + version: "19.0.0-www-modern-67b05be0d2-20240603", rendererPackageName: "react-dom" }; (function (internals) { @@ -17209,10 +17238,10 @@ var devToolsConfig$jscomp$inline_1813 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1813.bundleType, - version: devToolsConfig$jscomp$inline_1813.version, - rendererPackageName: devToolsConfig$jscomp$inline_1813.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1813.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1814.bundleType, + version: devToolsConfig$jscomp$inline_1814.version, + rendererPackageName: devToolsConfig$jscomp$inline_1814.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1814.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17228,14 +17257,14 @@ var devToolsConfig$jscomp$inline_1813 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1813.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1814.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-def67b9b32-20240603" + reconcilerVersion: "19.0.0-www-modern-67b05be0d2-20240603" }); function ReactDOMRoot(internalRoot) { this._internalRoot = internalRoot; @@ -17596,7 +17625,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-def67b9b32-20240603"; +exports.version = "19.0.0-www-modern-67b05be0d2-20240603"; "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 7c3153ce1fd0b..5c821d9de5a8f 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.classic.js +++ b/compiled/facebook-www/ReactDOMServer-dev.classic.js @@ -19,7 +19,7 @@ if (__DEV__) { var React = require('react'); var ReactDOM = require('react-dom'); -var ReactVersion = '19.0.0-www-classic-def67b9b32-20240603'; +var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603'; // This refers to a WWW module. var warningWWW = require('warning'); diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js index c3357883f7fdb..e6fd0cdec243e 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js @@ -19,7 +19,7 @@ if (__DEV__) { var React = require('react'); var ReactDOM = require('react-dom'); -var ReactVersion = '19.0.0-www-modern-def67b9b32-20240603'; +var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603'; // This refers to a WWW module. var warningWWW = require('warning'); diff --git a/compiled/facebook-www/ReactDOMServer-prod.classic.js b/compiled/facebook-www/ReactDOMServer-prod.classic.js index be2c8a65be2f6..457b304ae0b88 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.classic.js +++ b/compiled/facebook-www/ReactDOMServer-prod.classic.js @@ -5699,4 +5699,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.0.0-www-classic-def67b9b32-20240603"; +exports.version = "19.0.0-www-classic-67b05be0d2-20240603"; diff --git a/compiled/facebook-www/ReactDOMServer-prod.modern.js b/compiled/facebook-www/ReactDOMServer-prod.modern.js index e969d84f6d601..7e86edb439431 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.modern.js +++ b/compiled/facebook-www/ReactDOMServer-prod.modern.js @@ -5677,4 +5677,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.0.0-www-modern-def67b9b32-20240603"; +exports.version = "19.0.0-www-modern-67b05be0d2-20240603"; diff --git a/compiled/facebook-www/ReactDOMTesting-dev.classic.js b/compiled/facebook-www/ReactDOMTesting-dev.classic.js index fea0d7080fb5b..01817ef46f422 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -13113,112 +13113,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl throw new Error('Cannot update form state while rendering.'); } + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + // circular + isTransition: true, + status: 'pending', + value: null, + reason: null, + listeners: [], + then: function (listener) { + // We know the only thing that subscribes to these promises is `use` so + // this implementation is simpler than a generic thenable. E.g. we don't + // bother to check if the thenable is still pending because `use` already + // does that. + actionNode.listeners.push(listener); + } + }; // Check if we're inside a transition. If so, we'll need to restore the + // transition context when the action is run. + + var prevTransition = ReactSharedInternals.T; + + if (prevTransition !== null) { + // Optimistically update the pending state, similar to useTransition. + // This will be reverted automatically when all actions are finished. + setPendingState(true); // `actionNode` is a thenable that resolves to the return value of + // the action. + + setState(actionNode); + } else { + // This is not a transition. + actionNode.isTransition = false; + setState(actionNode); + } + var last = actionQueue.pending; if (last === null) { // There are no pending actions; this is the first one. We can run // it immediately. - var newLast = { - payload: payload, - action: actionQueue.action, - next: null // circular - - }; - newLast.next = actionQueue.pending = newLast; - runActionStateAction(actionQueue, setPendingState, setState, newLast); + actionNode.next = actionQueue.pending = actionNode; + runActionStateAction(actionQueue, actionNode); } else { // There's already an action running. Add to the queue. var first = last.next; - var _newLast = { - payload: payload, - action: actionQueue.action, - next: first - }; - actionQueue.pending = last.next = _newLast; + actionNode.next = first; + actionQueue.pending = last.next = actionNode; } } -function runActionStateAction(actionQueue, setPendingState, setState, node) { - // This is a fork of startTransition - var prevTransition = ReactSharedInternals.T; - var currentTransition = {}; - ReactSharedInternals.T = currentTransition; - - { - ReactSharedInternals.T._updatedFibers = new Set(); - } // Optimistically update the pending state, similar to useTransition. - // This will be reverted automatically when all actions are finished. - - - setPendingState(true); // `node.action` represents the action function at the time it was dispatched. +function runActionStateAction(actionQueue, node) { + // `node.action` represents the action function at the time it was dispatched. // If this action was queued, it might be stale, i.e. it's not necessarily the // most current implementation of the action, stored on `actionQueue`. This is // intentional. The conceptual model for queued actions is that they are // queued in a remote worker; the dispatch happens immediately, only the // execution is delayed. - var action = node.action; var payload = node.payload; var prevState = actionQueue.state; - try { - var returnValue = action(prevState, payload); - var onStartTransitionFinish = ReactSharedInternals.S; + if (node.isTransition) { + // The original dispatch was part of a transition. We restore its + // transition context here. + // This is a fork of startTransition + var prevTransition = ReactSharedInternals.T; + var currentTransition = {}; + ReactSharedInternals.T = currentTransition; - if (onStartTransitionFinish !== null) { - onStartTransitionFinish(currentTransition, returnValue); + { + ReactSharedInternals.T._updatedFibers = new Set(); } - if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] - typeof returnValue.then === 'function') { - var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as - // this resolves, we can run the next action in the sequence. + try { + var returnValue = action(prevState, payload); + var onStartTransitionFinish = ReactSharedInternals.S; - thenable.then(function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - }, function () { - return finishRunningActionStateAction(actionQueue, setPendingState, setState); - }); - setState(thenable); - } else { - setState(returnValue); - var nextState = returnValue; - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } - } catch (error) { - // This is a trick to get the `useActionState` hook to rethrow the error. - // When it unwraps the thenable with the `use` algorithm, the error - // will be thrown. - var rejectedThenable = { - then: function () {}, - status: 'rejected', - reason: error // $FlowFixMe: Not sure why this doesn't work + if (onStartTransitionFinish !== null) { + onStartTransitionFinish(currentTransition, returnValue); + } - }; - setState(rejectedThenable); - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; - { - if (prevTransition === null && currentTransition._updatedFibers) { - var updatedFibersCount = currentTransition._updatedFibers.size; + { + if (prevTransition === null && currentTransition._updatedFibers) { + var updatedFibersCount = currentTransition._updatedFibers.size; - currentTransition._updatedFibers.clear(); + currentTransition._updatedFibers.clear(); - if (updatedFibersCount > 10) { - warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + if (updatedFibersCount > 10) { + warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + } } } } + } else { + // The original dispatch was not part of a transition. + try { + var _returnValue = action(prevState, payload); + + handleActionReturnValue(actionQueue, node, _returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } + } +} + +function handleActionReturnValue(actionQueue, node, returnValue) { + if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] + typeof returnValue.then === 'function') { + var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as + // this resolves, we can run the next action in the sequence. + + thenable.then(function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, function (error) { + return onActionError(actionQueue, node, error); + }); + + { + if (!node.isTransition) { + error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`'); + } + } + } else { + var nextState = returnValue; + onActionSuccess(actionQueue, node, nextState); } } -function finishRunningActionStateAction(actionQueue, setPendingState, setState) { - // The action finished running. Pop it from the queue and run the next pending - // action, if there are any. +function onActionSuccess(actionQueue, actionNode, nextState) { + // The action finished running. + actionNode.status = 'fulfilled'; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there + // are any. + var last = actionQueue.pending; if (last !== null) { @@ -13232,11 +13268,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState) var next = first.next; last.next = next; // Run the next action. - runActionStateAction(actionQueue, setPendingState, setState, next); + runActionStateAction(actionQueue, next); } } } +function onActionError(actionQueue, actionNode, error) { + actionNode.status = 'rejected'; + actionNode.reason = error; + notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there + // are any. + // TODO: We should instead abort all the remaining actions in the queue. + + var last = actionQueue.pending; + + if (last !== null) { + var first = last.next; + + if (first === last) { + // This was the last action in the queue. + actionQueue.pending = null; + } else { + // Remove the first node from the circular queue. + var next = first.next; + last.next = next; // Run the next action. + + runActionStateAction(actionQueue, next); + } + } +} + +function notifyActionListeners(actionNode) { + // Notify React that the action has finished. + var listeners = actionNode.listeners; + + for (var i = 0; i < listeners.length; i++) { + // This is always a React internal listener, so we don't need to worry + // about it throwing. + var listener = listeners[i]; + listener(); + } +} + function actionStateReducer(oldState, newState) { return newState; } @@ -31656,7 +31729,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-www-classic-def67b9b32-20240603'; +var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603'; function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation. implementation) { diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index f2ae492ca906a..23649cd6f8705 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -12854,112 +12854,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl throw new Error('Cannot update form state while rendering.'); } + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + // circular + isTransition: true, + status: 'pending', + value: null, + reason: null, + listeners: [], + then: function (listener) { + // We know the only thing that subscribes to these promises is `use` so + // this implementation is simpler than a generic thenable. E.g. we don't + // bother to check if the thenable is still pending because `use` already + // does that. + actionNode.listeners.push(listener); + } + }; // Check if we're inside a transition. If so, we'll need to restore the + // transition context when the action is run. + + var prevTransition = ReactSharedInternals.T; + + if (prevTransition !== null) { + // Optimistically update the pending state, similar to useTransition. + // This will be reverted automatically when all actions are finished. + setPendingState(true); // `actionNode` is a thenable that resolves to the return value of + // the action. + + setState(actionNode); + } else { + // This is not a transition. + actionNode.isTransition = false; + setState(actionNode); + } + var last = actionQueue.pending; if (last === null) { // There are no pending actions; this is the first one. We can run // it immediately. - var newLast = { - payload: payload, - action: actionQueue.action, - next: null // circular - - }; - newLast.next = actionQueue.pending = newLast; - runActionStateAction(actionQueue, setPendingState, setState, newLast); + actionNode.next = actionQueue.pending = actionNode; + runActionStateAction(actionQueue, actionNode); } else { // There's already an action running. Add to the queue. var first = last.next; - var _newLast = { - payload: payload, - action: actionQueue.action, - next: first - }; - actionQueue.pending = last.next = _newLast; + actionNode.next = first; + actionQueue.pending = last.next = actionNode; } } -function runActionStateAction(actionQueue, setPendingState, setState, node) { - // This is a fork of startTransition - var prevTransition = ReactSharedInternals.T; - var currentTransition = {}; - ReactSharedInternals.T = currentTransition; - - { - ReactSharedInternals.T._updatedFibers = new Set(); - } // Optimistically update the pending state, similar to useTransition. - // This will be reverted automatically when all actions are finished. - - - setPendingState(true); // `node.action` represents the action function at the time it was dispatched. +function runActionStateAction(actionQueue, node) { + // `node.action` represents the action function at the time it was dispatched. // If this action was queued, it might be stale, i.e. it's not necessarily the // most current implementation of the action, stored on `actionQueue`. This is // intentional. The conceptual model for queued actions is that they are // queued in a remote worker; the dispatch happens immediately, only the // execution is delayed. - var action = node.action; var payload = node.payload; var prevState = actionQueue.state; - try { - var returnValue = action(prevState, payload); - var onStartTransitionFinish = ReactSharedInternals.S; + if (node.isTransition) { + // The original dispatch was part of a transition. We restore its + // transition context here. + // This is a fork of startTransition + var prevTransition = ReactSharedInternals.T; + var currentTransition = {}; + ReactSharedInternals.T = currentTransition; - if (onStartTransitionFinish !== null) { - onStartTransitionFinish(currentTransition, returnValue); + { + ReactSharedInternals.T._updatedFibers = new Set(); } - if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] - typeof returnValue.then === 'function') { - var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as - // this resolves, we can run the next action in the sequence. + try { + var returnValue = action(prevState, payload); + var onStartTransitionFinish = ReactSharedInternals.S; - thenable.then(function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - }, function () { - return finishRunningActionStateAction(actionQueue, setPendingState, setState); - }); - setState(thenable); - } else { - setState(returnValue); - var nextState = returnValue; - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } - } catch (error) { - // This is a trick to get the `useActionState` hook to rethrow the error. - // When it unwraps the thenable with the `use` algorithm, the error - // will be thrown. - var rejectedThenable = { - then: function () {}, - status: 'rejected', - reason: error // $FlowFixMe: Not sure why this doesn't work + if (onStartTransitionFinish !== null) { + onStartTransitionFinish(currentTransition, returnValue); + } - }; - setState(rejectedThenable); - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; - { - if (prevTransition === null && currentTransition._updatedFibers) { - var updatedFibersCount = currentTransition._updatedFibers.size; + { + if (prevTransition === null && currentTransition._updatedFibers) { + var updatedFibersCount = currentTransition._updatedFibers.size; - currentTransition._updatedFibers.clear(); + currentTransition._updatedFibers.clear(); - if (updatedFibersCount > 10) { - warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + if (updatedFibersCount > 10) { + warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + } } } } + } else { + // The original dispatch was not part of a transition. + try { + var _returnValue = action(prevState, payload); + + handleActionReturnValue(actionQueue, node, _returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } + } +} + +function handleActionReturnValue(actionQueue, node, returnValue) { + if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] + typeof returnValue.then === 'function') { + var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as + // this resolves, we can run the next action in the sequence. + + thenable.then(function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, function (error) { + return onActionError(actionQueue, node, error); + }); + + { + if (!node.isTransition) { + error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`'); + } + } + } else { + var nextState = returnValue; + onActionSuccess(actionQueue, node, nextState); } } -function finishRunningActionStateAction(actionQueue, setPendingState, setState) { - // The action finished running. Pop it from the queue and run the next pending - // action, if there are any. +function onActionSuccess(actionQueue, actionNode, nextState) { + // The action finished running. + actionNode.status = 'fulfilled'; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there + // are any. + var last = actionQueue.pending; if (last !== null) { @@ -12973,11 +13009,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState) var next = first.next; last.next = next; // Run the next action. - runActionStateAction(actionQueue, setPendingState, setState, next); + runActionStateAction(actionQueue, next); } } } +function onActionError(actionQueue, actionNode, error) { + actionNode.status = 'rejected'; + actionNode.reason = error; + notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there + // are any. + // TODO: We should instead abort all the remaining actions in the queue. + + var last = actionQueue.pending; + + if (last !== null) { + var first = last.next; + + if (first === last) { + // This was the last action in the queue. + actionQueue.pending = null; + } else { + // Remove the first node from the circular queue. + var next = first.next; + last.next = next; // Run the next action. + + runActionStateAction(actionQueue, next); + } + } +} + +function notifyActionListeners(actionNode) { + // Notify React that the action has finished. + var listeners = actionNode.listeners; + + for (var i = 0; i < listeners.length; i++) { + // This is always a React internal listener, so we don't need to worry + // about it throwing. + var listener = listeners[i]; + listener(); + } +} + function actionStateReducer(oldState, newState) { return newState; } @@ -30833,7 +30906,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-www-modern-def67b9b32-20240603'; +var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603'; function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation. implementation) { diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index e5160b5f98b8f..5adaab5cf7d3c 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -3825,72 +3825,101 @@ function dispatchActionState( payload ) { if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); fiber = actionQueue.pending; null === fiber - ? ((payload = { payload: payload, action: actionQueue.action, next: null }), - (payload.next = actionQueue.pending = payload), - runActionStateAction(actionQueue, setPendingState, setState, payload)) - : (actionQueue.pending = fiber.next = - { payload: payload, action: actionQueue.action, next: fiber.next }); -} -function runActionStateAction(actionQueue, setPendingState, setState, node) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - setPendingState(!0); - var action = node.action; - node = node.payload; - var prevState = actionQueue.state; - try { - var returnValue = action(prevState, node), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - }, - function () { - return finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - } - ), - setState(returnValue)) - : (setState(returnValue), - (actionQueue.state = returnValue), - finishRunningActionStateAction(actionQueue, setPendingState, setState)); - } catch (error) { - setState({ then: function () {}, status: "rejected", reason: error }), - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; - } + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = fiber.next), + (actionQueue.pending = fiber.next = actionNode)); +} +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; + } + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$62) { + onActionError(actionQueue, node, error$62); + } } -function finishRunningActionStateAction( - actionQueue, - setPendingState, - setState -) { - var last = actionQueue.pending; - if (null !== last) { - var first = last.next; - first === last +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); +} +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode ? (actionQueue.pending = null) - : ((first = first.next), - (last.next = first), - runActionStateAction(actionQueue, setPendingState, setState, first)); - } + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + actionNode.status = "rejected"; + actionNode.reason = error; + notifyActionListeners(actionNode); + actionNode = actionQueue.pending; + null !== actionNode && + ((error = actionNode.next), + error === actionNode + ? (actionQueue.pending = null) + : ((error = error.next), + (actionNode.next = error), + runActionStateAction(actionQueue, error))); +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); } function actionStateReducer(oldState, newState) { return newState; @@ -4295,14 +4324,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(provider); fiber = createUpdate(lane); - var root$64 = enqueueUpdate(provider, fiber, lane); - null !== root$64 && - (scheduleUpdateOnFiber(root$64, provider, lane), - entangleTransitions(root$64, provider, lane)); + var root$65 = enqueueUpdate(provider, fiber, lane); + null !== root$65 && + (scheduleUpdateOnFiber(root$65, provider, lane), + entangleTransitions(root$65, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$64 && + null !== root$65 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4895,9 +4924,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$68 in Component) - void 0 === newProps[propName$68] && - (newProps[propName$68] = Component[propName$68]); + for (var propName$69 in Component) + void 0 === newProps[propName$69] && + (newProps[propName$69] = Component[propName$69]); } return newProps; } @@ -5342,10 +5371,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$81 = workInProgress.stateNode; + root$82 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$81.incompleteTransitions.has(transition)) { + if (!root$82.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -5353,11 +5382,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$81.incompleteTransitions.set(transition, markerInstance); + root$82.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$81.incompleteTransitions.forEach(function (markerInstance) { + root$82.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -7817,14 +7846,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$124 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$124 = lastTailNode), + for (var lastTailNode$125 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$125 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$124 + null === lastTailNode$125 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$124.sibling = null); + : (lastTailNode$125.sibling = null); } } function bubbleProperties(completedWork) { @@ -7834,19 +7863,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$125 = completedWork.child; null !== child$125; ) - (newChildLanes |= child$125.lanes | child$125.childLanes), - (subtreeFlags |= child$125.subtreeFlags & 31457280), - (subtreeFlags |= child$125.flags & 31457280), - (child$125.return = completedWork), - (child$125 = child$125.sibling); + for (var child$126 = completedWork.child; null !== child$126; ) + (newChildLanes |= child$126.lanes | child$126.childLanes), + (subtreeFlags |= child$126.subtreeFlags & 31457280), + (subtreeFlags |= child$126.flags & 31457280), + (child$126.return = completedWork), + (child$126 = child$126.sibling); else - for (child$125 = completedWork.child; null !== child$125; ) - (newChildLanes |= child$125.lanes | child$125.childLanes), - (subtreeFlags |= child$125.subtreeFlags), - (subtreeFlags |= child$125.flags), - (child$125.return = completedWork), - (child$125 = child$125.sibling); + for (child$126 = completedWork.child; null !== child$126; ) + (newChildLanes |= child$126.lanes | child$126.childLanes), + (subtreeFlags |= child$126.subtreeFlags), + (subtreeFlags |= child$126.flags), + (child$126.return = completedWork), + (child$126 = child$126.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -8142,11 +8171,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$137 = null; + var cache$138 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$137 = newProps.memoizedState.cachePool.pool); - cache$137 !== type && (newProps.flags |= 2048); + (cache$138 = newProps.memoizedState.cachePool.pool); + cache$138 !== type && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -8186,8 +8215,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$137 = type.rendering; - if (null === cache$137) + cache$138 = type.rendering; + if (null === cache$138) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -8195,11 +8224,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$137 = findFirstSuspended(current); - if (null !== cache$137) { + cache$138 = findFirstSuspended(current); + if (null !== cache$138) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$137.updateQueue; + current = cache$138.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -8224,7 +8253,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$137)), null !== current)) { + if (((current = findFirstSuspended(cache$138)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -8234,7 +8263,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$137.alternate && + !cache$138.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -8247,13 +8276,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$137.sibling = workInProgress.child), - (workInProgress.child = cache$137)) + ? ((cache$138.sibling = workInProgress.child), + (workInProgress.child = cache$138)) : ((current = type.last), null !== current - ? (current.sibling = cache$137) - : (workInProgress.child = cache$137), - (type.last = cache$137)); + ? (current.sibling = cache$138) + : (workInProgress.child = cache$138), + (type.last = cache$138)); } if (null !== type.tail) return ( @@ -8528,8 +8557,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$155) { - captureCommitPhaseError(current, nearestMountedAncestor, error$155); + } catch (error$156) { + captureCommitPhaseError(current, nearestMountedAncestor, error$156); } else ref.current = null; } @@ -8566,7 +8595,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$216) { + } catch (e$217) { JSCompiler_temp = null; break a; } @@ -8834,11 +8863,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$157) { + } catch (error$158) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$157 + error$158 ); } } @@ -9387,19 +9416,19 @@ function commitDeletionEffectsOnFiber( } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { if (null === finishedWork.memoizedState) { - var current$169 = finishedWork.alternate; + var current$170 = finishedWork.alternate; if ( - null !== current$169 && - ((current$169 = current$169.memoizedState), - null !== current$169 && - ((current$169 = current$169.dehydrated), null !== current$169)) + null !== current$170 && + ((current$170 = current$170.memoizedState), + null !== current$170 && + ((current$170 = current$170.dehydrated), null !== current$170)) ) try { - retryIfBlockedOn(current$169); + retryIfBlockedOn(current$170); var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; - onHydrated && onHydrated(current$169); + onHydrated && onHydrated(current$170); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -9517,8 +9546,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$171) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$171); + } catch (error$172) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$172); } } break; @@ -9691,11 +9720,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$172) { + } catch (error$173) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$172 + error$173 ); } break; @@ -9732,8 +9761,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$173) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$173); + } catch (error$174) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$174); } } if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { @@ -9743,8 +9772,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { updateProperties(root, maybeNodes, current, hoistableRoot), (root[internalPropsKey] = hoistableRoot); - } catch (error$175) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$175); + } catch (error$176) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$176); } } flags & 1024 && (needsFormReset = !0); @@ -9759,8 +9788,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { current = finishedWork.memoizedProps; try { flags.nodeValue = current; - } catch (error$176) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$176); + } catch (error$177) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$177); } } break; @@ -9774,8 +9803,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$177) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$177); + } catch (error$178) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$178); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -9807,8 +9836,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$179) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$179); + } catch (error$180) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$180); } flags = finishedWork.updateQueue; null !== flags && @@ -9886,11 +9915,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$160) { + } catch (error$161) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$160 + error$161 ); } } else if ( @@ -9965,21 +9994,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$161 = JSCompiler_inline_result.stateNode; + var parent$162 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$161, ""), + (setTextContent(parent$162, ""), (JSCompiler_inline_result.flags &= -33)); - var before$162 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$162, parent$161); + var before$163 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$163, parent$162); break; case 3: case 4: - var parent$163 = JSCompiler_inline_result.stateNode.containerInfo, - before$164 = getHostSibling(finishedWork); + var parent$164 = JSCompiler_inline_result.stateNode.containerInfo, + before$165 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$164, - parent$163 + before$165, + parent$164 ); break; default: @@ -10058,7 +10087,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$183 = parentFiber.alternate, + var current$184 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -10086,16 +10115,16 @@ function recursivelyTraverseReappearLayoutEffects( } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - current$183 = finishedWork.updateQueue; - if (null !== current$183) { - var hiddenCallbacks = current$183.shared.hiddenCallbacks; + current$184 = finishedWork.updateQueue; + if (null !== current$184) { + var hiddenCallbacks = current$184.shared.hiddenCallbacks; if (null !== hiddenCallbacks) for ( - current$183.shared.hiddenCallbacks = null, current$183 = 0; - current$183 < hiddenCallbacks.length; - current$183++ + current$184.shared.hiddenCallbacks = null, current$184 = 0; + current$184 < hiddenCallbacks.length; + current$184++ ) - callCallback(hiddenCallbacks[current$183], finishedRoot); + callCallback(hiddenCallbacks[current$184], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -10111,7 +10140,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$183 && + null === current$184 && flags & 4 && commitHostComponentMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); @@ -10455,9 +10484,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$190 = finishedWork.stateNode; + var instance$191 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$190._visibility & 4 + ? instance$191._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10470,7 +10499,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$190._visibility |= 4), + : ((instance$191._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10478,7 +10507,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$190._visibility |= 4), + : ((instance$191._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10491,7 +10520,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$190 + instance$191 ); break; case 24: @@ -10831,12 +10860,12 @@ function findFiberRootForHostRoot(hostRoot) { a: { hostRoot = [hostRoot]; for (maybeFiber = 0; maybeFiber < hostRoot.length; ) { - var current$283 = hostRoot[maybeFiber++]; - if (current$283[internalContainerInstanceKey]) { - hostRoot = getInstanceFromNode(current$283); + var current$284 = hostRoot[maybeFiber++]; + if (current$284[internalContainerInstanceKey]) { + hostRoot = getInstanceFromNode(current$284); break a; } - hostRoot.push.apply(hostRoot, current$283.children); + hostRoot.push.apply(hostRoot, current$284.children); } hostRoot = null; } @@ -11641,8 +11670,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$202) { - handleThrow(root, thrownValue$202); + } catch (thrownValue$203) { + handleThrow(root, thrownValue$203); } while (1); lanes && root.shellSuspendCounter++; @@ -11751,8 +11780,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$204) { - handleThrow(root, thrownValue$204); + } catch (thrownValue$205) { + handleThrow(root, thrownValue$205); } while (1); resetContextDependencies(); @@ -11977,12 +12006,12 @@ function commitRootImpl( Internals.p = 2; var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$210 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$211 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$210 && + shouldFireAfterActiveInstanceBlur$211 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -12054,7 +12083,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$211 = rootWithPendingPassiveEffects, + var root$212 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -12069,7 +12098,7 @@ function flushPassiveEffects() { } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$211, remainingLanes); + releaseRootPooledCache(root$212, remainingLanes); } } return !1; @@ -13355,19 +13384,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$374; + var JSCompiler_inline_result$jscomp$375; if (canUseDOM) { - var isSupported$jscomp$inline_1569 = "oninput" in document; - if (!isSupported$jscomp$inline_1569) { - var element$jscomp$inline_1570 = document.createElement("div"); - element$jscomp$inline_1570.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1569 = - "function" === typeof element$jscomp$inline_1570.oninput; + var isSupported$jscomp$inline_1570 = "oninput" in document; + if (!isSupported$jscomp$inline_1570) { + var element$jscomp$inline_1571 = document.createElement("div"); + element$jscomp$inline_1571.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1570 = + "function" === typeof element$jscomp$inline_1571.oninput; } - JSCompiler_inline_result$jscomp$374 = isSupported$jscomp$inline_1569; - } else JSCompiler_inline_result$jscomp$374 = !1; + JSCompiler_inline_result$jscomp$375 = isSupported$jscomp$inline_1570; + } else JSCompiler_inline_result$jscomp$375 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$374 && + JSCompiler_inline_result$jscomp$375 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13776,20 +13805,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1610 = 0; - i$jscomp$inline_1610 < simpleEventPluginEvents.length; - i$jscomp$inline_1610++ + var i$jscomp$inline_1611 = 0; + i$jscomp$inline_1611 < simpleEventPluginEvents.length; + i$jscomp$inline_1611++ ) { - var eventName$jscomp$inline_1611 = - simpleEventPluginEvents[i$jscomp$inline_1610], - domEventName$jscomp$inline_1612 = - eventName$jscomp$inline_1611.toLowerCase(), - capitalizedEvent$jscomp$inline_1613 = - eventName$jscomp$inline_1611[0].toUpperCase() + - eventName$jscomp$inline_1611.slice(1); + var eventName$jscomp$inline_1612 = + simpleEventPluginEvents[i$jscomp$inline_1611], + domEventName$jscomp$inline_1613 = + eventName$jscomp$inline_1612.toLowerCase(), + capitalizedEvent$jscomp$inline_1614 = + eventName$jscomp$inline_1612[0].toUpperCase() + + eventName$jscomp$inline_1612.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1612, - "on" + capitalizedEvent$jscomp$inline_1613 + domEventName$jscomp$inline_1613, + "on" + capitalizedEvent$jscomp$inline_1614 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15267,14 +15296,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$245 in nextProps) { - var propKey = nextProps[propKey$245]; - lastProp = lastProps[propKey$245]; + for (var propKey$246 in nextProps) { + var propKey = nextProps[propKey$246]; + lastProp = lastProps[propKey$246]; if ( - nextProps.hasOwnProperty(propKey$245) && + nextProps.hasOwnProperty(propKey$246) && (null != propKey || null != lastProp) ) - switch (propKey$245) { + switch (propKey$246) { case "type": type = propKey; break; @@ -15303,7 +15332,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$245, + propKey$246, propKey, nextProps, lastProp @@ -15322,7 +15351,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$245 = null; + propKey = value = defaultValue = propKey$246 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15353,7 +15382,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$245 = type; + propKey$246 = type; break; case "defaultValue": defaultValue = type; @@ -15374,15 +15403,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$245 - ? updateOptions(domElement, !!lastProps, propKey$245, !1) + null != propKey$246 + ? updateOptions(domElement, !!lastProps, propKey$246, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$245 = null; + propKey = propKey$246 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15406,7 +15435,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$245 = name; + propKey$246 = name; break; case "defaultValue": propKey = name; @@ -15420,17 +15449,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$245, propKey); + updateTextarea(domElement, propKey$246, propKey); return; case "option": - for (var propKey$261 in lastProps) + for (var propKey$262 in lastProps) if ( - ((propKey$245 = lastProps[propKey$261]), - lastProps.hasOwnProperty(propKey$261) && - null != propKey$245 && - !nextProps.hasOwnProperty(propKey$261)) + ((propKey$246 = lastProps[propKey$262]), + lastProps.hasOwnProperty(propKey$262) && + null != propKey$246 && + !nextProps.hasOwnProperty(propKey$262)) ) - switch (propKey$261) { + switch (propKey$262) { case "selected": domElement.selected = !1; break; @@ -15438,33 +15467,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$261, + propKey$262, null, nextProps, - propKey$245 + propKey$246 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$245 = nextProps[lastDefaultValue]), + ((propKey$246 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$245 !== propKey && - (null != propKey$245 || null != propKey)) + propKey$246 !== propKey && + (null != propKey$246 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$245 && - "function" !== typeof propKey$245 && - "symbol" !== typeof propKey$245; + propKey$246 && + "function" !== typeof propKey$246 && + "symbol" !== typeof propKey$246; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$245, + propKey$246, nextProps, propKey ); @@ -15485,24 +15514,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$266 in lastProps) - (propKey$245 = lastProps[propKey$266]), - lastProps.hasOwnProperty(propKey$266) && - null != propKey$245 && - !nextProps.hasOwnProperty(propKey$266) && - setProp(domElement, tag, propKey$266, null, nextProps, propKey$245); + for (var propKey$267 in lastProps) + (propKey$246 = lastProps[propKey$267]), + lastProps.hasOwnProperty(propKey$267) && + null != propKey$246 && + !nextProps.hasOwnProperty(propKey$267) && + setProp(domElement, tag, propKey$267, null, nextProps, propKey$246); for (checked in nextProps) if ( - ((propKey$245 = nextProps[checked]), + ((propKey$246 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$245 !== propKey && - (null != propKey$245 || null != propKey)) + propKey$246 !== propKey && + (null != propKey$246 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$245) + if (null != propKey$246) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15510,7 +15539,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$245, + propKey$246, nextProps, propKey ); @@ -15518,49 +15547,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$271 in lastProps) - (propKey$245 = lastProps[propKey$271]), - lastProps.hasOwnProperty(propKey$271) && - void 0 !== propKey$245 && - !nextProps.hasOwnProperty(propKey$271) && + for (var propKey$272 in lastProps) + (propKey$246 = lastProps[propKey$272]), + lastProps.hasOwnProperty(propKey$272) && + void 0 !== propKey$246 && + !nextProps.hasOwnProperty(propKey$272) && setPropOnCustomElement( domElement, tag, - propKey$271, + propKey$272, void 0, nextProps, - propKey$245 + propKey$246 ); for (defaultChecked in nextProps) - (propKey$245 = nextProps[defaultChecked]), + (propKey$246 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$245 === propKey || - (void 0 === propKey$245 && void 0 === propKey) || + propKey$246 === propKey || + (void 0 === propKey$246 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$245, + propKey$246, nextProps, propKey ); return; } } - for (var propKey$276 in lastProps) - (propKey$245 = lastProps[propKey$276]), - lastProps.hasOwnProperty(propKey$276) && - null != propKey$245 && - !nextProps.hasOwnProperty(propKey$276) && - setProp(domElement, tag, propKey$276, null, nextProps, propKey$245); + for (var propKey$277 in lastProps) + (propKey$246 = lastProps[propKey$277]), + lastProps.hasOwnProperty(propKey$277) && + null != propKey$246 && + !nextProps.hasOwnProperty(propKey$277) && + setProp(domElement, tag, propKey$277, null, nextProps, propKey$246); for (lastProp in nextProps) - (propKey$245 = nextProps[lastProp]), + (propKey$246 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$245 === propKey || - (null == propKey$245 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$245, nextProps, propKey); + propKey$246 === propKey || + (null == propKey$246 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$246, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -16204,20 +16233,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$285 = getResourcesFromRoot( + var styles$286 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$286 = styles$285.get(type); - resource$286 || + resource$287 = styles$286.get(type); + resource$287 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$286 = { + (resource$287 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$285.set(type, resource$286), + styles$286.set(type, resource$287), preloadPropsMap.has(type) || preloadStylesheet( JSCompiler_inline_result, @@ -16232,11 +16261,11 @@ function getResource(type, currentProps, pendingProps, currentResource) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$286.state + resource$287.state )); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$286; + return resource$287; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -16335,37 +16364,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$291 = hoistableRoot.querySelector( + var instance$292 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$291) + if (instance$292) return ( (resource.state.loading |= 4), - (resource.instance = instance$291), - markNodeAsHoistable(instance$291), - instance$291 + (resource.instance = instance$292), + markNodeAsHoistable(instance$292), + instance$292 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$291 = ( + instance$292 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$291); - var linkInstance = instance$291; + markNodeAsHoistable(instance$292); + var linkInstance = instance$292; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$291, "link", instance); + setInitialProperties(instance$292, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$291, props.precedence, hoistableRoot); - return (resource.instance = instance$291); + insertStylesheet(instance$292, props.precedence, hoistableRoot); + return (resource.instance = instance$292); case "script": - instance$291 = getScriptKey(props.src); + instance$292 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$291) + getScriptSelectorFromKey(instance$292) )) ) return ( @@ -16374,7 +16403,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$291))) + if ((styleProps = preloadPropsMap.get(instance$292))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17379,16 +17408,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1783 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1784 = React.version; if ( - "19.0.0-www-classic-def67b9b32-20240603" !== - isomorphicReactPackageVersion$jscomp$inline_1783 + "19.0.0-www-classic-67b05be0d2-20240603" !== + isomorphicReactPackageVersion$jscomp$inline_1784 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1783, - "19.0.0-www-classic-def67b9b32-20240603" + isomorphicReactPackageVersion$jscomp$inline_1784, + "19.0.0-www-classic-67b05be0d2-20240603" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17404,17 +17433,17 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1790 = { +var devToolsConfig$jscomp$inline_1791 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-def67b9b32-20240603", + version: "19.0.0-www-classic-67b05be0d2-20240603", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2239 = { - bundleType: devToolsConfig$jscomp$inline_1790.bundleType, - version: devToolsConfig$jscomp$inline_1790.version, - rendererPackageName: devToolsConfig$jscomp$inline_1790.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1790.rendererConfig, +var internals$jscomp$inline_2240 = { + bundleType: devToolsConfig$jscomp$inline_1791.bundleType, + version: devToolsConfig$jscomp$inline_1791.version, + rendererPackageName: devToolsConfig$jscomp$inline_1791.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1791.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17430,26 +17459,26 @@ var internals$jscomp$inline_2239 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1790.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1791.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-def67b9b32-20240603" + reconcilerVersion: "19.0.0-www-classic-67b05be0d2-20240603" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2240 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2241 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2240.isDisabled && - hook$jscomp$inline_2240.supportsFiber + !hook$jscomp$inline_2241.isDisabled && + hook$jscomp$inline_2241.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2240.inject( - internals$jscomp$inline_2239 + (rendererID = hook$jscomp$inline_2241.inject( + internals$jscomp$inline_2240 )), - (injectedHook = hook$jscomp$inline_2240); + (injectedHook = hook$jscomp$inline_2241); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17523,11 +17552,11 @@ function legacyCreateRootFromDOMContainer( if ("function" === typeof callback) { var originalCallback = callback; callback = function () { - var instance = getPublicRootInstance(root$312); + var instance = getPublicRootInstance(root$313); originalCallback.call(instance); }; } - var root$312 = createHydrationContainer( + var root$313 = createHydrationContainer( initialChildren, callback, container, @@ -17542,23 +17571,23 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$312; - container[internalContainerInstanceKey] = root$312.current; + container._reactRootContainer = root$313; + container[internalContainerInstanceKey] = root$313.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSyncWork(); - return root$312; + return root$313; } clearContainer(container); if ("function" === typeof callback) { - var originalCallback$313 = callback; + var originalCallback$314 = callback; callback = function () { - var instance = getPublicRootInstance(root$314); - originalCallback$313.call(instance); + var instance = getPublicRootInstance(root$315); + originalCallback$314.call(instance); }; } - var root$314 = createFiberRoot( + var root$315 = createFiberRoot( container, 0, !1, @@ -17573,14 +17602,14 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$314; - container[internalContainerInstanceKey] = root$314.current; + container._reactRootContainer = root$315; + container[internalContainerInstanceKey] = root$315.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); - updateContainerSync(initialChildren, root$314, parentComponent, callback); + updateContainerSync(initialChildren, root$315, parentComponent, callback); flushSyncWork(); - return root$314; + return root$315; } function legacyRenderSubtreeIntoContainer( parentComponent, @@ -18092,4 +18121,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-def67b9b32-20240603"; +exports.version = "19.0.0-www-classic-67b05be0d2-20240603"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index cd04a32bd68c5..99374d181c54c 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -3672,72 +3672,101 @@ function dispatchActionState( payload ) { if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); fiber = actionQueue.pending; null === fiber - ? ((payload = { payload: payload, action: actionQueue.action, next: null }), - (payload.next = actionQueue.pending = payload), - runActionStateAction(actionQueue, setPendingState, setState, payload)) - : (actionQueue.pending = fiber.next = - { payload: payload, action: actionQueue.action, next: fiber.next }); -} -function runActionStateAction(actionQueue, setPendingState, setState, node) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - setPendingState(!0); - var action = node.action; - node = node.payload; - var prevState = actionQueue.state; - try { - var returnValue = action(prevState, node), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - }, - function () { - return finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - } - ), - setState(returnValue)) - : (setState(returnValue), - (actionQueue.state = returnValue), - finishRunningActionStateAction(actionQueue, setPendingState, setState)); - } catch (error) { - setState({ then: function () {}, status: "rejected", reason: error }), - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; - } + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = fiber.next), + (actionQueue.pending = fiber.next = actionNode)); +} +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; + } + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$62) { + onActionError(actionQueue, node, error$62); + } } -function finishRunningActionStateAction( - actionQueue, - setPendingState, - setState -) { - var last = actionQueue.pending; - if (null !== last) { - var first = last.next; - first === last +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); +} +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode ? (actionQueue.pending = null) - : ((first = first.next), - (last.next = first), - runActionStateAction(actionQueue, setPendingState, setState, first)); - } + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + actionNode.status = "rejected"; + actionNode.reason = error; + notifyActionListeners(actionNode); + actionNode = actionQueue.pending; + null !== actionNode && + ((error = actionNode.next), + error === actionNode + ? (actionQueue.pending = null) + : ((error = error.next), + (actionNode.next = error), + runActionStateAction(actionQueue, error))); +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); } function actionStateReducer(oldState, newState) { return newState; @@ -4142,14 +4171,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$64 = enqueueUpdate(provider, fiber, lane); - null !== root$64 && - (scheduleUpdateOnFiber(root$64, provider, lane), - entangleTransitions(root$64, provider, lane)); + var root$65 = enqueueUpdate(provider, fiber, lane); + null !== root$65 && + (scheduleUpdateOnFiber(root$65, provider, lane), + entangleTransitions(root$65, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$64 && + null !== root$65 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4680,9 +4709,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$68 in Component) - void 0 === newProps[propName$68] && - (newProps[propName$68] = Component[propName$68]); + for (var propName$69 in Component) + void 0 === newProps[propName$69] && + (newProps[propName$69] = Component[propName$69]); } return newProps; } @@ -5059,10 +5088,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$80 = workInProgress.stateNode; + root$81 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$80.incompleteTransitions.has(transition)) { + if (!root$81.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -5070,11 +5099,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$80.incompleteTransitions.set(transition, markerInstance); + root$81.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$80.incompleteTransitions.forEach(function (markerInstance) { + root$81.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -7418,14 +7447,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$116 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$116 = lastTailNode), + for (var lastTailNode$117 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$117 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$116 + null === lastTailNode$117 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$116.sibling = null); + : (lastTailNode$117.sibling = null); } } function bubbleProperties(completedWork) { @@ -7435,19 +7464,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$117 = completedWork.child; null !== child$117; ) - (newChildLanes |= child$117.lanes | child$117.childLanes), - (subtreeFlags |= child$117.subtreeFlags & 31457280), - (subtreeFlags |= child$117.flags & 31457280), - (child$117.return = completedWork), - (child$117 = child$117.sibling); + for (var child$118 = completedWork.child; null !== child$118; ) + (newChildLanes |= child$118.lanes | child$118.childLanes), + (subtreeFlags |= child$118.subtreeFlags & 31457280), + (subtreeFlags |= child$118.flags & 31457280), + (child$118.return = completedWork), + (child$118 = child$118.sibling); else - for (child$117 = completedWork.child; null !== child$117; ) - (newChildLanes |= child$117.lanes | child$117.childLanes), - (subtreeFlags |= child$117.subtreeFlags), - (subtreeFlags |= child$117.flags), - (child$117.return = completedWork), - (child$117 = child$117.sibling); + for (child$118 = completedWork.child; null !== child$118; ) + (newChildLanes |= child$118.lanes | child$118.childLanes), + (subtreeFlags |= child$118.subtreeFlags), + (subtreeFlags |= child$118.flags), + (child$118.return = completedWork), + (child$118 = child$118.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -7736,11 +7765,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$129 = null; + var cache$130 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$129 = newProps.memoizedState.cachePool.pool); - cache$129 !== type && (newProps.flags |= 2048); + (cache$130 = newProps.memoizedState.cachePool.pool); + cache$130 !== type && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -7774,8 +7803,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$129 = type.rendering; - if (null === cache$129) + cache$130 = type.rendering; + if (null === cache$130) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -7783,11 +7812,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$129 = findFirstSuspended(current); - if (null !== cache$129) { + cache$130 = findFirstSuspended(current); + if (null !== cache$130) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$129.updateQueue; + current = cache$130.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -7812,7 +7841,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$129)), null !== current)) { + if (((current = findFirstSuspended(cache$130)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -7822,7 +7851,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$129.alternate && + !cache$130.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -7835,13 +7864,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$129.sibling = workInProgress.child), - (workInProgress.child = cache$129)) + ? ((cache$130.sibling = workInProgress.child), + (workInProgress.child = cache$130)) : ((current = type.last), null !== current - ? (current.sibling = cache$129) - : (workInProgress.child = cache$129), - (type.last = cache$129)); + ? (current.sibling = cache$130) + : (workInProgress.child = cache$130), + (type.last = cache$130)); } if (null !== type.tail) return ( @@ -8107,8 +8136,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$146) { - captureCommitPhaseError(current, nearestMountedAncestor, error$146); + } catch (error$147) { + captureCommitPhaseError(current, nearestMountedAncestor, error$147); } else ref.current = null; } @@ -8145,7 +8174,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$207) { + } catch (e$208) { JSCompiler_temp = null; break a; } @@ -8426,11 +8455,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$148) { + } catch (error$149) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$148 + error$149 ); } } @@ -8968,19 +8997,19 @@ function commitDeletionEffectsOnFiber( } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { if (null === finishedWork.memoizedState) { - var current$160 = finishedWork.alternate; + var current$161 = finishedWork.alternate; if ( - null !== current$160 && - ((current$160 = current$160.memoizedState), - null !== current$160 && - ((current$160 = current$160.dehydrated), null !== current$160)) + null !== current$161 && + ((current$161 = current$161.memoizedState), + null !== current$161 && + ((current$161 = current$161.dehydrated), null !== current$161)) ) try { - retryIfBlockedOn(current$160); + retryIfBlockedOn(current$161); var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; - onHydrated && onHydrated(current$160); + onHydrated && onHydrated(current$161); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -9098,8 +9127,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$162) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$162); + } catch (error$163) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$163); } } break; @@ -9272,11 +9301,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { newProps ); domElement[internalPropsKey] = newProps; - } catch (error$163) { + } catch (error$164) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$163 + error$164 ); } break; @@ -9313,8 +9342,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$164) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$164); + } catch (error$165) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$165); } } if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { @@ -9324,8 +9353,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { updateProperties(root, maybeNodes, current, hoistableRoot), (root[internalPropsKey] = hoistableRoot); - } catch (error$166) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$166); + } catch (error$167) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$167); } } flags & 1024 && (needsFormReset = !0); @@ -9340,8 +9369,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { current = finishedWork.memoizedProps; try { flags.nodeValue = current; - } catch (error$167) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$167); + } catch (error$168) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$168); } } break; @@ -9355,8 +9384,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$168) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$168); + } catch (error$169) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$169); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -9388,8 +9417,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$170) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$170); + } catch (error$171) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$171); } flags = finishedWork.updateQueue; null !== flags && @@ -9464,11 +9493,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) try { root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$151) { + } catch (error$152) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$151 + error$152 ); } } else if ( @@ -9543,21 +9572,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$152 = JSCompiler_inline_result.stateNode; + var parent$153 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$152, ""), + (setTextContent(parent$153, ""), (JSCompiler_inline_result.flags &= -33)); - var before$153 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$153, parent$152); + var before$154 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$154, parent$153); break; case 3: case 4: - var parent$154 = JSCompiler_inline_result.stateNode.containerInfo, - before$155 = getHostSibling(finishedWork); + var parent$155 = JSCompiler_inline_result.stateNode.containerInfo, + before$156 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$155, - parent$154 + before$156, + parent$155 ); break; default: @@ -9636,7 +9665,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$174 = parentFiber.alternate, + var current$175 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -9664,16 +9693,16 @@ function recursivelyTraverseReappearLayoutEffects( } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - current$174 = finishedWork.updateQueue; - if (null !== current$174) { - var hiddenCallbacks = current$174.shared.hiddenCallbacks; + current$175 = finishedWork.updateQueue; + if (null !== current$175) { + var hiddenCallbacks = current$175.shared.hiddenCallbacks; if (null !== hiddenCallbacks) for ( - current$174.shared.hiddenCallbacks = null, current$174 = 0; - current$174 < hiddenCallbacks.length; - current$174++ + current$175.shared.hiddenCallbacks = null, current$175 = 0; + current$175 < hiddenCallbacks.length; + current$175++ ) - callCallback(hiddenCallbacks[current$174], finishedRoot); + callCallback(hiddenCallbacks[current$175], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -9689,7 +9718,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$174 && + null === current$175 && flags & 4 && commitHostComponentMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); @@ -10025,9 +10054,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$181 = finishedWork.stateNode; + var instance$182 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$181._visibility & 4 + ? instance$182._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10039,7 +10068,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$181._visibility |= 4), + : ((instance$182._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10052,7 +10081,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$181 + instance$182 ); break; case 24: @@ -10392,12 +10421,12 @@ function findFiberRootForHostRoot(hostRoot) { a: { hostRoot = [hostRoot]; for (maybeFiber = 0; maybeFiber < hostRoot.length; ) { - var current$274 = hostRoot[maybeFiber++]; - if (current$274[internalContainerInstanceKey]) { - hostRoot = getInstanceFromNode(current$274); + var current$275 = hostRoot[maybeFiber++]; + if (current$275[internalContainerInstanceKey]) { + hostRoot = getInstanceFromNode(current$275); break a; } - hostRoot.push.apply(hostRoot, current$274.children); + hostRoot.push.apply(hostRoot, current$275.children); } hostRoot = null; } @@ -11183,8 +11212,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$193) { - handleThrow(root, thrownValue$193); + } catch (thrownValue$194) { + handleThrow(root, thrownValue$194); } while (1); lanes && root.shellSuspendCounter++; @@ -11293,8 +11322,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$195) { - handleThrow(root, thrownValue$195); + } catch (thrownValue$196) { + handleThrow(root, thrownValue$196); } while (1); resetContextDependencies(); @@ -11515,12 +11544,12 @@ function commitRootImpl( Internals.p = 2; var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$201 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$202 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$201 && + shouldFireAfterActiveInstanceBlur$202 && ((_enabled = !0), dispatchAfterDetachedBlur(selectionInformation.focusedElem), (_enabled = !1)); @@ -11590,7 +11619,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$202 = rootWithPendingPassiveEffects, + var root$203 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11605,7 +11634,7 @@ function flushPassiveEffects() { } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$202, remainingLanes); + releaseRootPooledCache(root$203, remainingLanes); } } return !1; @@ -12797,19 +12826,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$361; + var JSCompiler_inline_result$jscomp$362; if (canUseDOM) { - var isSupported$jscomp$inline_1540 = "oninput" in document; - if (!isSupported$jscomp$inline_1540) { - var element$jscomp$inline_1541 = document.createElement("div"); - element$jscomp$inline_1541.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1540 = - "function" === typeof element$jscomp$inline_1541.oninput; + var isSupported$jscomp$inline_1541 = "oninput" in document; + if (!isSupported$jscomp$inline_1541) { + var element$jscomp$inline_1542 = document.createElement("div"); + element$jscomp$inline_1542.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1541 = + "function" === typeof element$jscomp$inline_1542.oninput; } - JSCompiler_inline_result$jscomp$361 = isSupported$jscomp$inline_1540; - } else JSCompiler_inline_result$jscomp$361 = !1; + JSCompiler_inline_result$jscomp$362 = isSupported$jscomp$inline_1541; + } else JSCompiler_inline_result$jscomp$362 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$361 && + JSCompiler_inline_result$jscomp$362 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13218,20 +13247,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1581 = 0; - i$jscomp$inline_1581 < simpleEventPluginEvents.length; - i$jscomp$inline_1581++ + var i$jscomp$inline_1582 = 0; + i$jscomp$inline_1582 < simpleEventPluginEvents.length; + i$jscomp$inline_1582++ ) { - var eventName$jscomp$inline_1582 = - simpleEventPluginEvents[i$jscomp$inline_1581], - domEventName$jscomp$inline_1583 = - eventName$jscomp$inline_1582.toLowerCase(), - capitalizedEvent$jscomp$inline_1584 = - eventName$jscomp$inline_1582[0].toUpperCase() + - eventName$jscomp$inline_1582.slice(1); + var eventName$jscomp$inline_1583 = + simpleEventPluginEvents[i$jscomp$inline_1582], + domEventName$jscomp$inline_1584 = + eventName$jscomp$inline_1583.toLowerCase(), + capitalizedEvent$jscomp$inline_1585 = + eventName$jscomp$inline_1583[0].toUpperCase() + + eventName$jscomp$inline_1583.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1583, - "on" + capitalizedEvent$jscomp$inline_1584 + domEventName$jscomp$inline_1584, + "on" + capitalizedEvent$jscomp$inline_1585 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14708,14 +14737,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$236 in nextProps) { - var propKey = nextProps[propKey$236]; - lastProp = lastProps[propKey$236]; + for (var propKey$237 in nextProps) { + var propKey = nextProps[propKey$237]; + lastProp = lastProps[propKey$237]; if ( - nextProps.hasOwnProperty(propKey$236) && + nextProps.hasOwnProperty(propKey$237) && (null != propKey || null != lastProp) ) - switch (propKey$236) { + switch (propKey$237) { case "type": type = propKey; break; @@ -14744,7 +14773,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$236, + propKey$237, propKey, nextProps, lastProp @@ -14763,7 +14792,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$236 = null; + propKey = value = defaultValue = propKey$237 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -14794,7 +14823,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$236 = type; + propKey$237 = type; break; case "defaultValue": defaultValue = type; @@ -14815,15 +14844,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$236 - ? updateOptions(domElement, !!lastProps, propKey$236, !1) + null != propKey$237 + ? updateOptions(domElement, !!lastProps, propKey$237, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$236 = null; + propKey = propKey$237 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -14847,7 +14876,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$236 = name; + propKey$237 = name; break; case "defaultValue": propKey = name; @@ -14861,17 +14890,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$236, propKey); + updateTextarea(domElement, propKey$237, propKey); return; case "option": - for (var propKey$252 in lastProps) + for (var propKey$253 in lastProps) if ( - ((propKey$236 = lastProps[propKey$252]), - lastProps.hasOwnProperty(propKey$252) && - null != propKey$236 && - !nextProps.hasOwnProperty(propKey$252)) + ((propKey$237 = lastProps[propKey$253]), + lastProps.hasOwnProperty(propKey$253) && + null != propKey$237 && + !nextProps.hasOwnProperty(propKey$253)) ) - switch (propKey$252) { + switch (propKey$253) { case "selected": domElement.selected = !1; break; @@ -14879,33 +14908,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$252, + propKey$253, null, nextProps, - propKey$236 + propKey$237 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$236 = nextProps[lastDefaultValue]), + ((propKey$237 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$236 !== propKey && - (null != propKey$236 || null != propKey)) + propKey$237 !== propKey && + (null != propKey$237 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$236 && - "function" !== typeof propKey$236 && - "symbol" !== typeof propKey$236; + propKey$237 && + "function" !== typeof propKey$237 && + "symbol" !== typeof propKey$237; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$236, + propKey$237, nextProps, propKey ); @@ -14926,24 +14955,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$257 in lastProps) - (propKey$236 = lastProps[propKey$257]), - lastProps.hasOwnProperty(propKey$257) && - null != propKey$236 && - !nextProps.hasOwnProperty(propKey$257) && - setProp(domElement, tag, propKey$257, null, nextProps, propKey$236); + for (var propKey$258 in lastProps) + (propKey$237 = lastProps[propKey$258]), + lastProps.hasOwnProperty(propKey$258) && + null != propKey$237 && + !nextProps.hasOwnProperty(propKey$258) && + setProp(domElement, tag, propKey$258, null, nextProps, propKey$237); for (checked in nextProps) if ( - ((propKey$236 = nextProps[checked]), + ((propKey$237 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$236 !== propKey && - (null != propKey$236 || null != propKey)) + propKey$237 !== propKey && + (null != propKey$237 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$236) + if (null != propKey$237) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -14951,7 +14980,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$236, + propKey$237, nextProps, propKey ); @@ -14959,49 +14988,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$262 in lastProps) - (propKey$236 = lastProps[propKey$262]), - lastProps.hasOwnProperty(propKey$262) && - void 0 !== propKey$236 && - !nextProps.hasOwnProperty(propKey$262) && + for (var propKey$263 in lastProps) + (propKey$237 = lastProps[propKey$263]), + lastProps.hasOwnProperty(propKey$263) && + void 0 !== propKey$237 && + !nextProps.hasOwnProperty(propKey$263) && setPropOnCustomElement( domElement, tag, - propKey$262, + propKey$263, void 0, nextProps, - propKey$236 + propKey$237 ); for (defaultChecked in nextProps) - (propKey$236 = nextProps[defaultChecked]), + (propKey$237 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$236 === propKey || - (void 0 === propKey$236 && void 0 === propKey) || + propKey$237 === propKey || + (void 0 === propKey$237 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$236, + propKey$237, nextProps, propKey ); return; } } - for (var propKey$267 in lastProps) - (propKey$236 = lastProps[propKey$267]), - lastProps.hasOwnProperty(propKey$267) && - null != propKey$236 && - !nextProps.hasOwnProperty(propKey$267) && - setProp(domElement, tag, propKey$267, null, nextProps, propKey$236); + for (var propKey$268 in lastProps) + (propKey$237 = lastProps[propKey$268]), + lastProps.hasOwnProperty(propKey$268) && + null != propKey$237 && + !nextProps.hasOwnProperty(propKey$268) && + setProp(domElement, tag, propKey$268, null, nextProps, propKey$237); for (lastProp in nextProps) - (propKey$236 = nextProps[lastProp]), + (propKey$237 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$236 === propKey || - (null == propKey$236 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$236, nextProps, propKey); + propKey$237 === propKey || + (null == propKey$237 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$237, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15636,20 +15665,20 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$276 = getResourcesFromRoot( + var styles$277 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$277 = styles$276.get(type); - resource$277 || + resource$278 = styles$277.get(type); + resource$278 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$277 = { + (resource$278 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$276.set(type, resource$277), + styles$277.set(type, resource$278), preloadPropsMap.has(type) || preloadStylesheet( JSCompiler_inline_result, @@ -15664,11 +15693,11 @@ function getResource(type, currentProps, pendingProps, currentResource) { hrefLang: pendingProps.hrefLang, referrerPolicy: pendingProps.referrerPolicy }, - resource$277.state + resource$278.state )); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$277; + return resource$278; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -15767,37 +15796,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$282 = hoistableRoot.querySelector( + var instance$283 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$282) + if (instance$283) return ( (resource.state.loading |= 4), - (resource.instance = instance$282), - markNodeAsHoistable(instance$282), - instance$282 + (resource.instance = instance$283), + markNodeAsHoistable(instance$283), + instance$283 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$282 = ( + instance$283 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$282); - var linkInstance = instance$282; + markNodeAsHoistable(instance$283); + var linkInstance = instance$283; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$282, "link", instance); + setInitialProperties(instance$283, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$282, props.precedence, hoistableRoot); - return (resource.instance = instance$282); + insertStylesheet(instance$283, props.precedence, hoistableRoot); + return (resource.instance = instance$283); case "script": - instance$282 = getScriptKey(props.src); + instance$283 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$282) + getScriptSelectorFromKey(instance$283) )) ) return ( @@ -15806,7 +15835,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$282))) + if ((styleProps = preloadPropsMap.get(instance$283))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16801,16 +16830,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1754 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1755 = React.version; if ( - "19.0.0-www-modern-def67b9b32-20240603" !== - isomorphicReactPackageVersion$jscomp$inline_1754 + "19.0.0-www-modern-67b05be0d2-20240603" !== + isomorphicReactPackageVersion$jscomp$inline_1755 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1754, - "19.0.0-www-modern-def67b9b32-20240603" + isomorphicReactPackageVersion$jscomp$inline_1755, + "19.0.0-www-modern-67b05be0d2-20240603" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -16826,17 +16855,17 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1756 = { +var devToolsConfig$jscomp$inline_1757 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-def67b9b32-20240603", + version: "19.0.0-www-modern-67b05be0d2-20240603", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2230 = { - bundleType: devToolsConfig$jscomp$inline_1756.bundleType, - version: devToolsConfig$jscomp$inline_1756.version, - rendererPackageName: devToolsConfig$jscomp$inline_1756.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1756.rendererConfig, +var internals$jscomp$inline_2231 = { + bundleType: devToolsConfig$jscomp$inline_1757.bundleType, + version: devToolsConfig$jscomp$inline_1757.version, + rendererPackageName: devToolsConfig$jscomp$inline_1757.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1757.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16852,26 +16881,26 @@ var internals$jscomp$inline_2230 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1756.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1757.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-def67b9b32-20240603" + reconcilerVersion: "19.0.0-www-modern-67b05be0d2-20240603" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2231 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2232 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2231.isDisabled && - hook$jscomp$inline_2231.supportsFiber + !hook$jscomp$inline_2232.isDisabled && + hook$jscomp$inline_2232.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2231.inject( - internals$jscomp$inline_2230 + (rendererID = hook$jscomp$inline_2232.inject( + internals$jscomp$inline_2231 )), - (injectedHook = hook$jscomp$inline_2231); + (injectedHook = hook$jscomp$inline_2232); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17384,4 +17413,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-def67b9b32-20240603"; +exports.version = "19.0.0-www-modern-67b05be0d2-20240603"; diff --git a/compiled/facebook-www/ReactReconciler-dev.classic.js b/compiled/facebook-www/ReactReconciler-dev.classic.js index 9ea01ad9ed9b2..5749edadd0d04 100644 --- a/compiled/facebook-www/ReactReconciler-dev.classic.js +++ b/compiled/facebook-www/ReactReconciler-dev.classic.js @@ -9873,112 +9873,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl throw new Error('Cannot update form state while rendering.'); } + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + // circular + isTransition: true, + status: 'pending', + value: null, + reason: null, + listeners: [], + then: function (listener) { + // We know the only thing that subscribes to these promises is `use` so + // this implementation is simpler than a generic thenable. E.g. we don't + // bother to check if the thenable is still pending because `use` already + // does that. + actionNode.listeners.push(listener); + } + }; // Check if we're inside a transition. If so, we'll need to restore the + // transition context when the action is run. + + var prevTransition = ReactSharedInternals.T; + + if (prevTransition !== null) { + // Optimistically update the pending state, similar to useTransition. + // This will be reverted automatically when all actions are finished. + setPendingState(true); // `actionNode` is a thenable that resolves to the return value of + // the action. + + setState(actionNode); + } else { + // This is not a transition. + actionNode.isTransition = false; + setState(actionNode); + } + var last = actionQueue.pending; if (last === null) { // There are no pending actions; this is the first one. We can run // it immediately. - var newLast = { - payload: payload, - action: actionQueue.action, - next: null // circular - - }; - newLast.next = actionQueue.pending = newLast; - runActionStateAction(actionQueue, setPendingState, setState, newLast); + actionNode.next = actionQueue.pending = actionNode; + runActionStateAction(actionQueue, actionNode); } else { // There's already an action running. Add to the queue. var first = last.next; - var _newLast = { - payload: payload, - action: actionQueue.action, - next: first - }; - actionQueue.pending = last.next = _newLast; + actionNode.next = first; + actionQueue.pending = last.next = actionNode; } } -function runActionStateAction(actionQueue, setPendingState, setState, node) { - // This is a fork of startTransition - var prevTransition = ReactSharedInternals.T; - var currentTransition = {}; - ReactSharedInternals.T = currentTransition; - - { - ReactSharedInternals.T._updatedFibers = new Set(); - } // Optimistically update the pending state, similar to useTransition. - // This will be reverted automatically when all actions are finished. - - - setPendingState(true); // `node.action` represents the action function at the time it was dispatched. +function runActionStateAction(actionQueue, node) { + // `node.action` represents the action function at the time it was dispatched. // If this action was queued, it might be stale, i.e. it's not necessarily the // most current implementation of the action, stored on `actionQueue`. This is // intentional. The conceptual model for queued actions is that they are // queued in a remote worker; the dispatch happens immediately, only the // execution is delayed. - var action = node.action; var payload = node.payload; var prevState = actionQueue.state; - try { - var returnValue = action(prevState, payload); - var onStartTransitionFinish = ReactSharedInternals.S; + if (node.isTransition) { + // The original dispatch was part of a transition. We restore its + // transition context here. + // This is a fork of startTransition + var prevTransition = ReactSharedInternals.T; + var currentTransition = {}; + ReactSharedInternals.T = currentTransition; - if (onStartTransitionFinish !== null) { - onStartTransitionFinish(currentTransition, returnValue); + { + ReactSharedInternals.T._updatedFibers = new Set(); } - if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] - typeof returnValue.then === 'function') { - var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as - // this resolves, we can run the next action in the sequence. + try { + var returnValue = action(prevState, payload); + var onStartTransitionFinish = ReactSharedInternals.S; - thenable.then(function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - }, function () { - return finishRunningActionStateAction(actionQueue, setPendingState, setState); - }); - setState(thenable); - } else { - setState(returnValue); - var nextState = returnValue; - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } - } catch (error) { - // This is a trick to get the `useActionState` hook to rethrow the error. - // When it unwraps the thenable with the `use` algorithm, the error - // will be thrown. - var rejectedThenable = { - then: function () {}, - status: 'rejected', - reason: error // $FlowFixMe: Not sure why this doesn't work + if (onStartTransitionFinish !== null) { + onStartTransitionFinish(currentTransition, returnValue); + } - }; - setState(rejectedThenable); - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; - { - if (prevTransition === null && currentTransition._updatedFibers) { - var updatedFibersCount = currentTransition._updatedFibers.size; + { + if (prevTransition === null && currentTransition._updatedFibers) { + var updatedFibersCount = currentTransition._updatedFibers.size; - currentTransition._updatedFibers.clear(); + currentTransition._updatedFibers.clear(); - if (updatedFibersCount > 10) { - warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + if (updatedFibersCount > 10) { + warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + } } } } + } else { + // The original dispatch was not part of a transition. + try { + var _returnValue = action(prevState, payload); + + handleActionReturnValue(actionQueue, node, _returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } + } +} + +function handleActionReturnValue(actionQueue, node, returnValue) { + if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] + typeof returnValue.then === 'function') { + var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as + // this resolves, we can run the next action in the sequence. + + thenable.then(function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, function (error) { + return onActionError(actionQueue, node, error); + }); + + { + if (!node.isTransition) { + error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`'); + } + } + } else { + var nextState = returnValue; + onActionSuccess(actionQueue, node, nextState); } } -function finishRunningActionStateAction(actionQueue, setPendingState, setState) { - // The action finished running. Pop it from the queue and run the next pending - // action, if there are any. +function onActionSuccess(actionQueue, actionNode, nextState) { + // The action finished running. + actionNode.status = 'fulfilled'; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there + // are any. + var last = actionQueue.pending; if (last !== null) { @@ -9992,11 +10028,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState) var next = first.next; last.next = next; // Run the next action. - runActionStateAction(actionQueue, setPendingState, setState, next); + runActionStateAction(actionQueue, next); } } } +function onActionError(actionQueue, actionNode, error) { + actionNode.status = 'rejected'; + actionNode.reason = error; + notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there + // are any. + // TODO: We should instead abort all the remaining actions in the queue. + + var last = actionQueue.pending; + + if (last !== null) { + var first = last.next; + + if (first === last) { + // This was the last action in the queue. + actionQueue.pending = null; + } else { + // Remove the first node from the circular queue. + var next = first.next; + last.next = next; // Run the next action. + + runActionStateAction(actionQueue, next); + } + } +} + +function notifyActionListeners(actionNode) { + // Notify React that the action has finished. + var listeners = actionNode.listeners; + + for (var i = 0; i < listeners.length; i++) { + // This is always a React internal listener, so we don't need to worry + // about it throwing. + var listener = listeners[i]; + listener(); + } +} + function actionStateReducer(oldState, newState) { return newState; } @@ -28858,7 +28931,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-www-classic-def67b9b32-20240603'; +var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603'; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol diff --git a/compiled/facebook-www/ReactReconciler-dev.modern.js b/compiled/facebook-www/ReactReconciler-dev.modern.js index e7615c4841940..a87fc02ff392e 100644 --- a/compiled/facebook-www/ReactReconciler-dev.modern.js +++ b/compiled/facebook-www/ReactReconciler-dev.modern.js @@ -9664,112 +9664,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl throw new Error('Cannot update form state while rendering.'); } + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + // circular + isTransition: true, + status: 'pending', + value: null, + reason: null, + listeners: [], + then: function (listener) { + // We know the only thing that subscribes to these promises is `use` so + // this implementation is simpler than a generic thenable. E.g. we don't + // bother to check if the thenable is still pending because `use` already + // does that. + actionNode.listeners.push(listener); + } + }; // Check if we're inside a transition. If so, we'll need to restore the + // transition context when the action is run. + + var prevTransition = ReactSharedInternals.T; + + if (prevTransition !== null) { + // Optimistically update the pending state, similar to useTransition. + // This will be reverted automatically when all actions are finished. + setPendingState(true); // `actionNode` is a thenable that resolves to the return value of + // the action. + + setState(actionNode); + } else { + // This is not a transition. + actionNode.isTransition = false; + setState(actionNode); + } + var last = actionQueue.pending; if (last === null) { // There are no pending actions; this is the first one. We can run // it immediately. - var newLast = { - payload: payload, - action: actionQueue.action, - next: null // circular - - }; - newLast.next = actionQueue.pending = newLast; - runActionStateAction(actionQueue, setPendingState, setState, newLast); + actionNode.next = actionQueue.pending = actionNode; + runActionStateAction(actionQueue, actionNode); } else { // There's already an action running. Add to the queue. var first = last.next; - var _newLast = { - payload: payload, - action: actionQueue.action, - next: first - }; - actionQueue.pending = last.next = _newLast; + actionNode.next = first; + actionQueue.pending = last.next = actionNode; } } -function runActionStateAction(actionQueue, setPendingState, setState, node) { - // This is a fork of startTransition - var prevTransition = ReactSharedInternals.T; - var currentTransition = {}; - ReactSharedInternals.T = currentTransition; - - { - ReactSharedInternals.T._updatedFibers = new Set(); - } // Optimistically update the pending state, similar to useTransition. - // This will be reverted automatically when all actions are finished. - - - setPendingState(true); // `node.action` represents the action function at the time it was dispatched. +function runActionStateAction(actionQueue, node) { + // `node.action` represents the action function at the time it was dispatched. // If this action was queued, it might be stale, i.e. it's not necessarily the // most current implementation of the action, stored on `actionQueue`. This is // intentional. The conceptual model for queued actions is that they are // queued in a remote worker; the dispatch happens immediately, only the // execution is delayed. - var action = node.action; var payload = node.payload; var prevState = actionQueue.state; - try { - var returnValue = action(prevState, payload); - var onStartTransitionFinish = ReactSharedInternals.S; + if (node.isTransition) { + // The original dispatch was part of a transition. We restore its + // transition context here. + // This is a fork of startTransition + var prevTransition = ReactSharedInternals.T; + var currentTransition = {}; + ReactSharedInternals.T = currentTransition; - if (onStartTransitionFinish !== null) { - onStartTransitionFinish(currentTransition, returnValue); + { + ReactSharedInternals.T._updatedFibers = new Set(); } - if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] - typeof returnValue.then === 'function') { - var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as - // this resolves, we can run the next action in the sequence. + try { + var returnValue = action(prevState, payload); + var onStartTransitionFinish = ReactSharedInternals.S; - thenable.then(function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - }, function () { - return finishRunningActionStateAction(actionQueue, setPendingState, setState); - }); - setState(thenable); - } else { - setState(returnValue); - var nextState = returnValue; - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } - } catch (error) { - // This is a trick to get the `useActionState` hook to rethrow the error. - // When it unwraps the thenable with the `use` algorithm, the error - // will be thrown. - var rejectedThenable = { - then: function () {}, - status: 'rejected', - reason: error // $FlowFixMe: Not sure why this doesn't work + if (onStartTransitionFinish !== null) { + onStartTransitionFinish(currentTransition, returnValue); + } - }; - setState(rejectedThenable); - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; - { - if (prevTransition === null && currentTransition._updatedFibers) { - var updatedFibersCount = currentTransition._updatedFibers.size; + { + if (prevTransition === null && currentTransition._updatedFibers) { + var updatedFibersCount = currentTransition._updatedFibers.size; - currentTransition._updatedFibers.clear(); + currentTransition._updatedFibers.clear(); - if (updatedFibersCount > 10) { - warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + if (updatedFibersCount > 10) { + warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + } } } } + } else { + // The original dispatch was not part of a transition. + try { + var _returnValue = action(prevState, payload); + + handleActionReturnValue(actionQueue, node, _returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } + } +} + +function handleActionReturnValue(actionQueue, node, returnValue) { + if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] + typeof returnValue.then === 'function') { + var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as + // this resolves, we can run the next action in the sequence. + + thenable.then(function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, function (error) { + return onActionError(actionQueue, node, error); + }); + + { + if (!node.isTransition) { + error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`'); + } + } + } else { + var nextState = returnValue; + onActionSuccess(actionQueue, node, nextState); } } -function finishRunningActionStateAction(actionQueue, setPendingState, setState) { - // The action finished running. Pop it from the queue and run the next pending - // action, if there are any. +function onActionSuccess(actionQueue, actionNode, nextState) { + // The action finished running. + actionNode.status = 'fulfilled'; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there + // are any. + var last = actionQueue.pending; if (last !== null) { @@ -9783,11 +9819,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState) var next = first.next; last.next = next; // Run the next action. - runActionStateAction(actionQueue, setPendingState, setState, next); + runActionStateAction(actionQueue, next); } } } +function onActionError(actionQueue, actionNode, error) { + actionNode.status = 'rejected'; + actionNode.reason = error; + notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there + // are any. + // TODO: We should instead abort all the remaining actions in the queue. + + var last = actionQueue.pending; + + if (last !== null) { + var first = last.next; + + if (first === last) { + // This was the last action in the queue. + actionQueue.pending = null; + } else { + // Remove the first node from the circular queue. + var next = first.next; + last.next = next; // Run the next action. + + runActionStateAction(actionQueue, next); + } + } +} + +function notifyActionListeners(actionNode) { + // Notify React that the action has finished. + var listeners = actionNode.listeners; + + for (var i = 0; i < listeners.length; i++) { + // This is always a React internal listener, so we don't need to worry + // about it throwing. + var listener = listeners[i]; + listener(); + } +} + function actionStateReducer(oldState, newState) { return newState; } @@ -28126,7 +28199,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-www-modern-def67b9b32-20240603'; +var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603'; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol diff --git a/compiled/facebook-www/ReactReconciler-prod.classic.js b/compiled/facebook-www/ReactReconciler-prod.classic.js index 00f8a5d711500..fa796008be67a 100644 --- a/compiled/facebook-www/ReactReconciler-prod.classic.js +++ b/compiled/facebook-www/ReactReconciler-prod.classic.js @@ -2881,80 +2881,101 @@ module.exports = function ($$$config) { payload ) { if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); fiber = actionQueue.pending; null === fiber - ? ((payload = { - payload: payload, - action: actionQueue.action, - next: null - }), - (payload.next = actionQueue.pending = payload), - runActionStateAction(actionQueue, setPendingState, setState, payload)) - : (actionQueue.pending = fiber.next = - { payload: payload, action: actionQueue.action, next: fiber.next }); - } - function runActionStateAction(actionQueue, setPendingState, setState, node) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - setPendingState(!0); - var action = node.action; - node = node.payload; - var prevState = actionQueue.state; - try { - var returnValue = action(prevState, node), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - }, - function () { - return finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - } - ), - setState(returnValue)) - : (setState(returnValue), - (actionQueue.state = returnValue), - finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - )); - } catch (error) { - setState({ then: function () {}, status: "rejected", reason: error }), - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; - } + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = fiber.next), + (actionQueue.pending = fiber.next = actionNode)); + } + function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; + } + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$47) { + onActionError(actionQueue, node, error$47); + } } - function finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ) { - var last = actionQueue.pending; - if (null !== last) { - var first = last.next; - first === last + function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); + } + function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode ? (actionQueue.pending = null) - : ((first = first.next), - (last.next = first), - runActionStateAction(actionQueue, setPendingState, setState, first)); - } + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); + } + function onActionError(actionQueue, actionNode, error) { + actionNode.status = "rejected"; + actionNode.reason = error; + notifyActionListeners(actionNode); + actionNode = actionQueue.pending; + null !== actionNode && + ((error = actionNode.next), + error === actionNode + ? (actionQueue.pending = null) + : ((error = error.next), + (actionNode.next = error), + runActionStateAction(actionQueue, error))); + } + function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); } function actionStateReducer(oldState, newState) { return newState; @@ -3573,9 +3594,9 @@ module.exports = function ($$$config) { (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$48 in Component) - void 0 === newProps[propName$48] && - (newProps[propName$48] = Component[propName$48]); + for (var propName$49 in Component) + void 0 === newProps[propName$49] && + (newProps[propName$49] = Component[propName$49]); } return newProps; } @@ -6508,44 +6529,44 @@ module.exports = function ($$$config) { needsVisibilityToggle = needsVisibilityToggle.sibling; } else if (supportsPersistence) - for (var node$101 = workInProgress.child; null !== node$101; ) { - if (5 === node$101.tag) { - var instance = node$101.stateNode; + for (var node$102 = workInProgress.child; null !== node$102; ) { + if (5 === node$102.tag) { + var instance = node$102.stateNode; needsVisibilityToggle && isHidden && (instance = cloneHiddenInstance( instance, - node$101.type, - node$101.memoizedProps + node$102.type, + node$102.memoizedProps )); appendInitialChild(parent, instance); - } else if (6 === node$101.tag) - (instance = node$101.stateNode), + } else if (6 === node$102.tag) + (instance = node$102.stateNode), needsVisibilityToggle && isHidden && (instance = cloneHiddenTextInstance( instance, - node$101.memoizedProps + node$102.memoizedProps )), appendInitialChild(parent, instance); - else if (4 !== node$101.tag) - if (22 === node$101.tag && null !== node$101.memoizedState) - (instance = node$101.child), - null !== instance && (instance.return = node$101), - appendAllChildren(parent, node$101, !0, !0); - else if (null !== node$101.child) { - node$101.child.return = node$101; - node$101 = node$101.child; + else if (4 !== node$102.tag) + if (22 === node$102.tag && null !== node$102.memoizedState) + (instance = node$102.child), + null !== instance && (instance.return = node$102), + appendAllChildren(parent, node$102, !0, !0); + else if (null !== node$102.child) { + node$102.child.return = node$102; + node$102 = node$102.child; continue; } - if (node$101 === workInProgress) break; - for (; null === node$101.sibling; ) { - if (null === node$101.return || node$101.return === workInProgress) + if (node$102 === workInProgress) break; + for (; null === node$102.sibling; ) { + if (null === node$102.return || node$102.return === workInProgress) return; - node$101 = node$101.return; + node$102 = node$102.return; } - node$101.sibling.return = node$101.return; - node$101 = node$101.sibling; + node$102.sibling.return = node$102.return; + node$102 = node$102.sibling; } } function appendAllChildrenToContainer( @@ -6618,31 +6639,31 @@ module.exports = function ($$$config) { current.memoizedProps !== newProps && markUpdate(workInProgress); else if (supportsPersistence) { var currentInstance = current.stateNode, - oldProps$104 = current.memoizedProps; + oldProps$105 = current.memoizedProps; if ( (current = doesRequireClone(current, workInProgress)) || - oldProps$104 !== newProps + oldProps$105 !== newProps ) { var currentHostContext = contextStackCursor.current; - oldProps$104 = cloneInstance( + oldProps$105 = cloneInstance( currentInstance, type, - oldProps$104, + oldProps$105, newProps, !current, null ); - oldProps$104 === currentInstance + oldProps$105 === currentInstance ? (workInProgress.stateNode = currentInstance) : (finalizeInitialChildren( - oldProps$104, + oldProps$105, type, newProps, currentHostContext ) && markUpdate(workInProgress), - (workInProgress.stateNode = oldProps$104), + (workInProgress.stateNode = oldProps$105), current - ? appendAllChildren(oldProps$104, workInProgress, !1, !1) + ? appendAllChildren(oldProps$105, workInProgress, !1, !1) : markUpdate(workInProgress)); } else workInProgress.stateNode = currentInstance; } @@ -6692,15 +6713,15 @@ module.exports = function ($$$config) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$106 = null; null !== lastTailNode; ) + for (var lastTailNode$107 = null; null !== lastTailNode; ) null !== lastTailNode.alternate && - (lastTailNode$106 = lastTailNode), + (lastTailNode$107 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$106 + null === lastTailNode$107 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$106.sibling = null); + : (lastTailNode$107.sibling = null); } } function bubbleProperties(completedWork) { @@ -6710,19 +6731,19 @@ module.exports = function ($$$config) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$107 = completedWork.child; null !== child$107; ) - (newChildLanes |= child$107.lanes | child$107.childLanes), - (subtreeFlags |= child$107.subtreeFlags & 31457280), - (subtreeFlags |= child$107.flags & 31457280), - (child$107.return = completedWork), - (child$107 = child$107.sibling); + for (var child$108 = completedWork.child; null !== child$108; ) + (newChildLanes |= child$108.lanes | child$108.childLanes), + (subtreeFlags |= child$108.subtreeFlags & 31457280), + (subtreeFlags |= child$108.flags & 31457280), + (child$108.return = completedWork), + (child$108 = child$108.sibling); else - for (child$107 = completedWork.child; null !== child$107; ) - (newChildLanes |= child$107.lanes | child$107.childLanes), - (subtreeFlags |= child$107.subtreeFlags), - (subtreeFlags |= child$107.flags), - (child$107.return = completedWork), - (child$107 = child$107.sibling); + for (child$108 = completedWork.child; null !== child$108; ) + (newChildLanes |= child$108.lanes | child$108.childLanes), + (subtreeFlags |= child$108.subtreeFlags), + (subtreeFlags |= child$108.flags), + (child$108.return = completedWork), + (child$108 = child$108.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -6999,11 +7020,11 @@ module.exports = function ($$$config) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (nextResource = newProps.alternate.memoizedState.cachePool.pool); - var cache$120 = null; + var cache$121 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$120 = newProps.memoizedState.cachePool.pool); - cache$120 !== nextResource && (newProps.flags |= 2048); + (cache$121 = newProps.memoizedState.cachePool.pool); + cache$121 !== nextResource && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -7045,8 +7066,8 @@ module.exports = function ($$$config) { if (null === nextResource) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$120 = nextResource.rendering; - if (null === cache$120) + cache$121 = nextResource.rendering; + if (null === cache$121) if (newProps) cutOffTailIfNeeded(nextResource, !1); else { if ( @@ -7054,11 +7075,11 @@ module.exports = function ($$$config) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$120 = findFirstSuspended(current); - if (null !== cache$120) { + cache$121 = findFirstSuspended(current); + if (null !== cache$121) { workInProgress.flags |= 128; cutOffTailIfNeeded(nextResource, !1); - current = cache$120.updateQueue; + current = cache$121.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -7087,7 +7108,7 @@ module.exports = function ($$$config) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$120)), null !== current)) { + if (((current = findFirstSuspended(cache$121)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -7097,7 +7118,7 @@ module.exports = function ($$$config) { cutOffTailIfNeeded(nextResource, !0), null === nextResource.tail && "hidden" === nextResource.tailMode && - !cache$120.alternate && + !cache$121.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -7110,13 +7131,13 @@ module.exports = function ($$$config) { cutOffTailIfNeeded(nextResource, !1), (workInProgress.lanes = 4194304)); nextResource.isBackwards - ? ((cache$120.sibling = workInProgress.child), - (workInProgress.child = cache$120)) + ? ((cache$121.sibling = workInProgress.child), + (workInProgress.child = cache$121)) : ((current = nextResource.last), null !== current - ? (current.sibling = cache$120) - : (workInProgress.child = cache$120), - (nextResource.last = cache$120)); + ? (current.sibling = cache$121) + : (workInProgress.child = cache$121), + (nextResource.last = cache$121)); } if (null !== nextResource.tail) return ( @@ -7392,8 +7413,8 @@ module.exports = function ($$$config) { else if ("function" === typeof ref) try { ref(null); - } catch (error$138) { - captureCommitPhaseError(current, nearestMountedAncestor, error$138); + } catch (error$139) { + captureCommitPhaseError(current, nearestMountedAncestor, error$139); } else ref.current = null; } @@ -7616,11 +7637,11 @@ module.exports = function ($$$config) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$139) { + } catch (error$140) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$139 + error$140 ); } } @@ -8193,19 +8214,19 @@ module.exports = function ($$$config) { } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { if (supportsHydration && null === finishedWork.memoizedState) { - var current$150 = finishedWork.alternate; + var current$151 = finishedWork.alternate; if ( - null !== current$150 && - ((current$150 = current$150.memoizedState), - null !== current$150 && - ((current$150 = current$150.dehydrated), null !== current$150)) + null !== current$151 && + ((current$151 = current$151.memoizedState), + null !== current$151 && + ((current$151 = current$151.dehydrated), null !== current$151)) ) try { - commitHydratedSuspenseInstance(current$150); + commitHydratedSuspenseInstance(current$151); var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; - onHydrated && onHydrated(current$150); + onHydrated && onHydrated(current$151); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -8324,11 +8345,11 @@ module.exports = function ($$$config) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$152) { + } catch (error$153) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$152 + error$153 ); } } @@ -8406,11 +8427,11 @@ module.exports = function ($$$config) { finishedWork.memoizedProps, finishedWork ); - } catch (error$153) { + } catch (error$154) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$153 + error$154 ); } break; @@ -8442,11 +8463,11 @@ module.exports = function ($$$config) { root = finishedWork.stateNode; try { resetTextContent(root); - } catch (error$154) { + } catch (error$155) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$154 + error$155 ); } } @@ -8456,11 +8477,11 @@ module.exports = function ($$$config) { props = finishedWork.type; try { commitUpdate(root, props, current, hoistableRoot, finishedWork); - } catch (error$156) { + } catch (error$157) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$156 + error$157 ); } } @@ -8478,11 +8499,11 @@ module.exports = function ($$$config) { current = null !== current ? current.memoizedProps : root; try { commitTextUpdate(flags, current, root); - } catch (error$157) { + } catch (error$158) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$157 + error$158 ); } } @@ -8505,11 +8526,11 @@ module.exports = function ($$$config) { ) try { commitHydratedContainer(root.containerInfo); - } catch (error$158) { + } catch (error$159) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$158 + error$159 ); } if (supportsPersistence) { @@ -8517,11 +8538,11 @@ module.exports = function ($$$config) { current = root.pendingChildren; try { replaceContainerChildren(flags, current); - } catch (error$159) { + } catch (error$160) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$159 + error$160 ); } } @@ -8546,11 +8567,11 @@ module.exports = function ($$$config) { current = current.pendingChildren; try { replaceContainerChildren(flags, current); - } catch (error$163) { + } catch (error$164) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$163 + error$164 ); } } @@ -8574,11 +8595,11 @@ module.exports = function ($$$config) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$164) { + } catch (error$165) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$164 + error$165 ); } flags = finishedWork.updateQueue; @@ -8654,11 +8675,11 @@ module.exports = function ($$$config) { suspenseCallback ? hideTextInstance(props) : unhideTextInstance(props, root.memoizedProps); - } catch (error$141) { + } catch (error$142) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$141 + error$142 ); } } else if ( @@ -8744,21 +8765,21 @@ module.exports = function ($$$config) { break; } case 5: - var parent$142 = JSCompiler_inline_result.stateNode; + var parent$143 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (resetTextContent(parent$142), + (resetTextContent(parent$143), (JSCompiler_inline_result.flags &= -33)); - var before$143 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$143, parent$142); + var before$144 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$144, parent$143); break; case 3: case 4: - var parent$144 = JSCompiler_inline_result.stateNode.containerInfo, - before$145 = getHostSibling(finishedWork); + var parent$145 = JSCompiler_inline_result.stateNode.containerInfo, + before$146 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$145, - parent$144 + before$146, + parent$145 ); break; default: @@ -8839,7 +8860,7 @@ module.exports = function ($$$config) { includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$168 = parentFiber.alternate, + var current$169 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -8867,16 +8888,16 @@ module.exports = function ($$$config) { } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - current$168 = finishedWork.updateQueue; - if (null !== current$168) { - var hiddenCallbacks = current$168.shared.hiddenCallbacks; + current$169 = finishedWork.updateQueue; + if (null !== current$169) { + var hiddenCallbacks = current$169.shared.hiddenCallbacks; if (null !== hiddenCallbacks) for ( - current$168.shared.hiddenCallbacks = null, current$168 = 0; - current$168 < hiddenCallbacks.length; - current$168++ + current$169.shared.hiddenCallbacks = null, current$169 = 0; + current$169 < hiddenCallbacks.length; + current$169++ ) - callCallback(hiddenCallbacks[current$168], finishedRoot); + callCallback(hiddenCallbacks[current$169], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -8892,7 +8913,7 @@ module.exports = function ($$$config) { includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$168 && + null === current$169 && flags & 4 && commitHostComponentMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); @@ -9243,9 +9264,9 @@ module.exports = function ($$$config) { ); break; case 22: - var instance$174 = finishedWork.stateNode; + var instance$175 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$174._visibility & 4 + ? instance$175._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9258,7 +9279,7 @@ module.exports = function ($$$config) { finishedRoot, finishedWork ) - : ((instance$174._visibility |= 4), + : ((instance$175._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9266,7 +9287,7 @@ module.exports = function ($$$config) { committedTransitions, includeWorkInProgressEffects )) - : ((instance$174._visibility |= 4), + : ((instance$175._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9279,7 +9300,7 @@ module.exports = function ($$$config) { commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$174 + instance$175 ); break; case 24: @@ -10343,8 +10364,8 @@ module.exports = function ($$$config) { } workLoopSync(); break; - } catch (thrownValue$188) { - handleThrow(root, thrownValue$188); + } catch (thrownValue$189) { + handleThrow(root, thrownValue$189); } while (1); lanes && root.shellSuspendCounter++; @@ -10459,8 +10480,8 @@ module.exports = function ($$$config) { } workLoopConcurrent(); break; - } catch (thrownValue$190) { - handleThrow(root, thrownValue$190); + } catch (thrownValue$191) { + handleThrow(root, thrownValue$191); } while (1); resetContextDependencies(); @@ -10695,12 +10716,12 @@ module.exports = function ($$$config) { setCurrentUpdatePriority(2); var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$196 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$197 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$196 && afterActiveInstanceBlur(); + shouldFireAfterActiveInstanceBlur$197 && afterActiveInstanceBlur(); resetAfterCommit(root.containerInfo); root.current = finishedWork; commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); @@ -12640,7 +12661,7 @@ module.exports = function ($$$config) { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-def67b9b32-20240603" + reconcilerVersion: "19.0.0-www-classic-67b05be0d2-20240603" }; if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) devToolsConfig = !1; diff --git a/compiled/facebook-www/ReactReconciler-prod.modern.js b/compiled/facebook-www/ReactReconciler-prod.modern.js index bbc5c7b16534b..97a601c2838d7 100644 --- a/compiled/facebook-www/ReactReconciler-prod.modern.js +++ b/compiled/facebook-www/ReactReconciler-prod.modern.js @@ -2741,80 +2741,101 @@ module.exports = function ($$$config) { payload ) { if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); fiber = actionQueue.pending; null === fiber - ? ((payload = { - payload: payload, - action: actionQueue.action, - next: null - }), - (payload.next = actionQueue.pending = payload), - runActionStateAction(actionQueue, setPendingState, setState, payload)) - : (actionQueue.pending = fiber.next = - { payload: payload, action: actionQueue.action, next: fiber.next }); - } - function runActionStateAction(actionQueue, setPendingState, setState, node) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - setPendingState(!0); - var action = node.action; - node = node.payload; - var prevState = actionQueue.state; - try { - var returnValue = action(prevState, node), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - }, - function () { - return finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ); - } - ), - setState(returnValue)) - : (setState(returnValue), - (actionQueue.state = returnValue), - finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - )); - } catch (error) { - setState({ then: function () {}, status: "rejected", reason: error }), - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; - } + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = fiber.next), + (actionQueue.pending = fiber.next = actionNode)); + } + function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; + } + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$47) { + onActionError(actionQueue, node, error$47); + } } - function finishRunningActionStateAction( - actionQueue, - setPendingState, - setState - ) { - var last = actionQueue.pending; - if (null !== last) { - var first = last.next; - first === last + function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); + } + function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode ? (actionQueue.pending = null) - : ((first = first.next), - (last.next = first), - runActionStateAction(actionQueue, setPendingState, setState, first)); - } + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); + } + function onActionError(actionQueue, actionNode, error) { + actionNode.status = "rejected"; + actionNode.reason = error; + notifyActionListeners(actionNode); + actionNode = actionQueue.pending; + null !== actionNode && + ((error = actionNode.next), + error === actionNode + ? (actionQueue.pending = null) + : ((error = error.next), + (actionNode.next = error), + runActionStateAction(actionQueue, error))); + } + function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); } function actionStateReducer(oldState, newState) { return newState; @@ -3366,9 +3387,9 @@ module.exports = function ($$$config) { (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$48 in Component) - void 0 === newProps[propName$48] && - (newProps[propName$48] = Component[propName$48]); + for (var propName$49 in Component) + void 0 === newProps[propName$49] && + (newProps[propName$49] = Component[propName$49]); } return newProps; } @@ -6142,44 +6163,44 @@ module.exports = function ($$$config) { needsVisibilityToggle = needsVisibilityToggle.sibling; } else if (supportsPersistence) - for (var node$93 = workInProgress.child; null !== node$93; ) { - if (5 === node$93.tag) { - var instance = node$93.stateNode; + for (var node$94 = workInProgress.child; null !== node$94; ) { + if (5 === node$94.tag) { + var instance = node$94.stateNode; needsVisibilityToggle && isHidden && (instance = cloneHiddenInstance( instance, - node$93.type, - node$93.memoizedProps + node$94.type, + node$94.memoizedProps )); appendInitialChild(parent, instance); - } else if (6 === node$93.tag) - (instance = node$93.stateNode), + } else if (6 === node$94.tag) + (instance = node$94.stateNode), needsVisibilityToggle && isHidden && (instance = cloneHiddenTextInstance( instance, - node$93.memoizedProps + node$94.memoizedProps )), appendInitialChild(parent, instance); - else if (4 !== node$93.tag) - if (22 === node$93.tag && null !== node$93.memoizedState) - (instance = node$93.child), - null !== instance && (instance.return = node$93), - appendAllChildren(parent, node$93, !0, !0); - else if (null !== node$93.child) { - node$93.child.return = node$93; - node$93 = node$93.child; + else if (4 !== node$94.tag) + if (22 === node$94.tag && null !== node$94.memoizedState) + (instance = node$94.child), + null !== instance && (instance.return = node$94), + appendAllChildren(parent, node$94, !0, !0); + else if (null !== node$94.child) { + node$94.child.return = node$94; + node$94 = node$94.child; continue; } - if (node$93 === workInProgress) break; - for (; null === node$93.sibling; ) { - if (null === node$93.return || node$93.return === workInProgress) + if (node$94 === workInProgress) break; + for (; null === node$94.sibling; ) { + if (null === node$94.return || node$94.return === workInProgress) return; - node$93 = node$93.return; + node$94 = node$94.return; } - node$93.sibling.return = node$93.return; - node$93 = node$93.sibling; + node$94.sibling.return = node$94.return; + node$94 = node$94.sibling; } } function appendAllChildrenToContainer( @@ -6252,31 +6273,31 @@ module.exports = function ($$$config) { current.memoizedProps !== newProps && markUpdate(workInProgress); else if (supportsPersistence) { var currentInstance = current.stateNode, - oldProps$96 = current.memoizedProps; + oldProps$97 = current.memoizedProps; if ( (current = doesRequireClone(current, workInProgress)) || - oldProps$96 !== newProps + oldProps$97 !== newProps ) { var currentHostContext = contextStackCursor.current; - oldProps$96 = cloneInstance( + oldProps$97 = cloneInstance( currentInstance, type, - oldProps$96, + oldProps$97, newProps, !current, null ); - oldProps$96 === currentInstance + oldProps$97 === currentInstance ? (workInProgress.stateNode = currentInstance) : (finalizeInitialChildren( - oldProps$96, + oldProps$97, type, newProps, currentHostContext ) && markUpdate(workInProgress), - (workInProgress.stateNode = oldProps$96), + (workInProgress.stateNode = oldProps$97), current - ? appendAllChildren(oldProps$96, workInProgress, !1, !1) + ? appendAllChildren(oldProps$97, workInProgress, !1, !1) : markUpdate(workInProgress)); } else workInProgress.stateNode = currentInstance; } @@ -6326,14 +6347,14 @@ module.exports = function ($$$config) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$98 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$98 = lastTailNode), + for (var lastTailNode$99 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$99 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$98 + null === lastTailNode$99 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$98.sibling = null); + : (lastTailNode$99.sibling = null); } } function bubbleProperties(completedWork) { @@ -6343,19 +6364,19 @@ module.exports = function ($$$config) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$99 = completedWork.child; null !== child$99; ) - (newChildLanes |= child$99.lanes | child$99.childLanes), - (subtreeFlags |= child$99.subtreeFlags & 31457280), - (subtreeFlags |= child$99.flags & 31457280), - (child$99.return = completedWork), - (child$99 = child$99.sibling); + for (var child$100 = completedWork.child; null !== child$100; ) + (newChildLanes |= child$100.lanes | child$100.childLanes), + (subtreeFlags |= child$100.subtreeFlags & 31457280), + (subtreeFlags |= child$100.flags & 31457280), + (child$100.return = completedWork), + (child$100 = child$100.sibling); else - for (child$99 = completedWork.child; null !== child$99; ) - (newChildLanes |= child$99.lanes | child$99.childLanes), - (subtreeFlags |= child$99.subtreeFlags), - (subtreeFlags |= child$99.flags), - (child$99.return = completedWork), - (child$99 = child$99.sibling); + for (child$100 = completedWork.child; null !== child$100; ) + (newChildLanes |= child$100.lanes | child$100.childLanes), + (subtreeFlags |= child$100.subtreeFlags), + (subtreeFlags |= child$100.flags), + (child$100.return = completedWork), + (child$100 = child$100.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -6625,11 +6646,11 @@ module.exports = function ($$$config) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (nextResource = newProps.alternate.memoizedState.cachePool.pool); - var cache$112 = null; + var cache$113 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$112 = newProps.memoizedState.cachePool.pool); - cache$112 !== nextResource && (newProps.flags |= 2048); + (cache$113 = newProps.memoizedState.cachePool.pool); + cache$113 !== nextResource && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -6665,8 +6686,8 @@ module.exports = function ($$$config) { if (null === nextResource) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$112 = nextResource.rendering; - if (null === cache$112) + cache$113 = nextResource.rendering; + if (null === cache$113) if (newProps) cutOffTailIfNeeded(nextResource, !1); else { if ( @@ -6674,11 +6695,11 @@ module.exports = function ($$$config) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$112 = findFirstSuspended(current); - if (null !== cache$112) { + cache$113 = findFirstSuspended(current); + if (null !== cache$113) { workInProgress.flags |= 128; cutOffTailIfNeeded(nextResource, !1); - current = cache$112.updateQueue; + current = cache$113.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6707,7 +6728,7 @@ module.exports = function ($$$config) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$112)), null !== current)) { + if (((current = findFirstSuspended(cache$113)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6717,7 +6738,7 @@ module.exports = function ($$$config) { cutOffTailIfNeeded(nextResource, !0), null === nextResource.tail && "hidden" === nextResource.tailMode && - !cache$112.alternate && + !cache$113.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -6730,13 +6751,13 @@ module.exports = function ($$$config) { cutOffTailIfNeeded(nextResource, !1), (workInProgress.lanes = 4194304)); nextResource.isBackwards - ? ((cache$112.sibling = workInProgress.child), - (workInProgress.child = cache$112)) + ? ((cache$113.sibling = workInProgress.child), + (workInProgress.child = cache$113)) : ((current = nextResource.last), null !== current - ? (current.sibling = cache$112) - : (workInProgress.child = cache$112), - (nextResource.last = cache$112)); + ? (current.sibling = cache$113) + : (workInProgress.child = cache$113), + (nextResource.last = cache$113)); } if (null !== nextResource.tail) return ( @@ -7003,8 +7024,8 @@ module.exports = function ($$$config) { else if ("function" === typeof ref) try { ref(null); - } catch (error$129) { - captureCommitPhaseError(current, nearestMountedAncestor, error$129); + } catch (error$130) { + captureCommitPhaseError(current, nearestMountedAncestor, error$130); } else ref.current = null; } @@ -7227,11 +7248,11 @@ module.exports = function ($$$config) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$130) { + } catch (error$131) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$130 + error$131 ); } } @@ -7794,19 +7815,19 @@ module.exports = function ($$$config) { } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { if (supportsHydration && null === finishedWork.memoizedState) { - var current$141 = finishedWork.alternate; + var current$142 = finishedWork.alternate; if ( - null !== current$141 && - ((current$141 = current$141.memoizedState), - null !== current$141 && - ((current$141 = current$141.dehydrated), null !== current$141)) + null !== current$142 && + ((current$142 = current$142.memoizedState), + null !== current$142 && + ((current$142 = current$142.dehydrated), null !== current$142)) ) try { - commitHydratedSuspenseInstance(current$141); + commitHydratedSuspenseInstance(current$142); var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; - onHydrated && onHydrated(current$141); + onHydrated && onHydrated(current$142); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -7925,11 +7946,11 @@ module.exports = function ($$$config) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$143) { + } catch (error$144) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$143 + error$144 ); } } @@ -8007,11 +8028,11 @@ module.exports = function ($$$config) { finishedWork.memoizedProps, finishedWork ); - } catch (error$144) { + } catch (error$145) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$144 + error$145 ); } break; @@ -8043,11 +8064,11 @@ module.exports = function ($$$config) { root = finishedWork.stateNode; try { resetTextContent(root); - } catch (error$145) { + } catch (error$146) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$145 + error$146 ); } } @@ -8057,11 +8078,11 @@ module.exports = function ($$$config) { props = finishedWork.type; try { commitUpdate(root, props, current, hoistableRoot, finishedWork); - } catch (error$147) { + } catch (error$148) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$147 + error$148 ); } } @@ -8079,11 +8100,11 @@ module.exports = function ($$$config) { current = null !== current ? current.memoizedProps : root; try { commitTextUpdate(flags, current, root); - } catch (error$148) { + } catch (error$149) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$148 + error$149 ); } } @@ -8106,11 +8127,11 @@ module.exports = function ($$$config) { ) try { commitHydratedContainer(root.containerInfo); - } catch (error$149) { + } catch (error$150) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$149 + error$150 ); } if (supportsPersistence) { @@ -8118,11 +8139,11 @@ module.exports = function ($$$config) { current = root.pendingChildren; try { replaceContainerChildren(flags, current); - } catch (error$150) { + } catch (error$151) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$150 + error$151 ); } } @@ -8147,11 +8168,11 @@ module.exports = function ($$$config) { current = current.pendingChildren; try { replaceContainerChildren(flags, current); - } catch (error$154) { + } catch (error$155) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$154 + error$155 ); } } @@ -8175,11 +8196,11 @@ module.exports = function ($$$config) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$155) { + } catch (error$156) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$155 + error$156 ); } flags = finishedWork.updateQueue; @@ -8251,11 +8272,11 @@ module.exports = function ($$$config) { suspenseCallback ? hideTextInstance(props) : unhideTextInstance(props, root.memoizedProps); - } catch (error$132) { + } catch (error$133) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$132 + error$133 ); } } else if ( @@ -8341,21 +8362,21 @@ module.exports = function ($$$config) { break; } case 5: - var parent$133 = JSCompiler_inline_result.stateNode; + var parent$134 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (resetTextContent(parent$133), + (resetTextContent(parent$134), (JSCompiler_inline_result.flags &= -33)); - var before$134 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$134, parent$133); + var before$135 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$135, parent$134); break; case 3: case 4: - var parent$135 = JSCompiler_inline_result.stateNode.containerInfo, - before$136 = getHostSibling(finishedWork); + var parent$136 = JSCompiler_inline_result.stateNode.containerInfo, + before$137 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$136, - parent$135 + before$137, + parent$136 ); break; default: @@ -8436,7 +8457,7 @@ module.exports = function ($$$config) { includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$159 = parentFiber.alternate, + var current$160 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -8464,16 +8485,16 @@ module.exports = function ($$$config) { } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - current$159 = finishedWork.updateQueue; - if (null !== current$159) { - var hiddenCallbacks = current$159.shared.hiddenCallbacks; + current$160 = finishedWork.updateQueue; + if (null !== current$160) { + var hiddenCallbacks = current$160.shared.hiddenCallbacks; if (null !== hiddenCallbacks) for ( - current$159.shared.hiddenCallbacks = null, current$159 = 0; - current$159 < hiddenCallbacks.length; - current$159++ + current$160.shared.hiddenCallbacks = null, current$160 = 0; + current$160 < hiddenCallbacks.length; + current$160++ ) - callCallback(hiddenCallbacks[current$159], finishedRoot); + callCallback(hiddenCallbacks[current$160], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -8489,7 +8510,7 @@ module.exports = function ($$$config) { includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$159 && + null === current$160 && flags & 4 && commitHostComponentMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); @@ -8832,9 +8853,9 @@ module.exports = function ($$$config) { ); break; case 22: - var instance$165 = finishedWork.stateNode; + var instance$166 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$165._visibility & 4 + ? instance$166._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8846,7 +8867,7 @@ module.exports = function ($$$config) { finishedRoot, finishedWork ) - : ((instance$165._visibility |= 4), + : ((instance$166._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8859,7 +8880,7 @@ module.exports = function ($$$config) { commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$165 + instance$166 ); break; case 24: @@ -9914,8 +9935,8 @@ module.exports = function ($$$config) { } workLoopSync(); break; - } catch (thrownValue$179) { - handleThrow(root, thrownValue$179); + } catch (thrownValue$180) { + handleThrow(root, thrownValue$180); } while (1); lanes && root.shellSuspendCounter++; @@ -10030,8 +10051,8 @@ module.exports = function ($$$config) { } workLoopConcurrent(); break; - } catch (thrownValue$181) { - handleThrow(root, thrownValue$181); + } catch (thrownValue$182) { + handleThrow(root, thrownValue$182); } while (1); resetContextDependencies(); @@ -10262,12 +10283,12 @@ module.exports = function ($$$config) { setCurrentUpdatePriority(2); var prevExecutionContext = executionContext; executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$187 = commitBeforeMutationEffects( + var shouldFireAfterActiveInstanceBlur$188 = commitBeforeMutationEffects( root, finishedWork ); commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$187 && afterActiveInstanceBlur(); + shouldFireAfterActiveInstanceBlur$188 && afterActiveInstanceBlur(); resetAfterCommit(root.containerInfo); root.current = finishedWork; commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); @@ -12153,7 +12174,7 @@ module.exports = function ($$$config) { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-def67b9b32-20240603" + reconcilerVersion: "19.0.0-www-modern-67b05be0d2-20240603" }; if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) devToolsConfig = !1; diff --git a/compiled/facebook-www/ReactTestRenderer-dev.classic.js b/compiled/facebook-www/ReactTestRenderer-dev.classic.js index 9cd2d858fac8c..8dc8f5fb12d90 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.classic.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.classic.js @@ -8403,112 +8403,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl throw new Error('Cannot update form state while rendering.'); } + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + // circular + isTransition: true, + status: 'pending', + value: null, + reason: null, + listeners: [], + then: function (listener) { + // We know the only thing that subscribes to these promises is `use` so + // this implementation is simpler than a generic thenable. E.g. we don't + // bother to check if the thenable is still pending because `use` already + // does that. + actionNode.listeners.push(listener); + } + }; // Check if we're inside a transition. If so, we'll need to restore the + // transition context when the action is run. + + var prevTransition = ReactSharedInternals.T; + + if (prevTransition !== null) { + // Optimistically update the pending state, similar to useTransition. + // This will be reverted automatically when all actions are finished. + setPendingState(true); // `actionNode` is a thenable that resolves to the return value of + // the action. + + setState(actionNode); + } else { + // This is not a transition. + actionNode.isTransition = false; + setState(actionNode); + } + var last = actionQueue.pending; if (last === null) { // There are no pending actions; this is the first one. We can run // it immediately. - var newLast = { - payload: payload, - action: actionQueue.action, - next: null // circular - - }; - newLast.next = actionQueue.pending = newLast; - runActionStateAction(actionQueue, setPendingState, setState, newLast); + actionNode.next = actionQueue.pending = actionNode; + runActionStateAction(actionQueue, actionNode); } else { // There's already an action running. Add to the queue. var first = last.next; - var _newLast = { - payload: payload, - action: actionQueue.action, - next: first - }; - actionQueue.pending = last.next = _newLast; + actionNode.next = first; + actionQueue.pending = last.next = actionNode; } } -function runActionStateAction(actionQueue, setPendingState, setState, node) { - // This is a fork of startTransition - var prevTransition = ReactSharedInternals.T; - var currentTransition = {}; - ReactSharedInternals.T = currentTransition; - - { - ReactSharedInternals.T._updatedFibers = new Set(); - } // Optimistically update the pending state, similar to useTransition. - // This will be reverted automatically when all actions are finished. - - - setPendingState(true); // `node.action` represents the action function at the time it was dispatched. +function runActionStateAction(actionQueue, node) { + // `node.action` represents the action function at the time it was dispatched. // If this action was queued, it might be stale, i.e. it's not necessarily the // most current implementation of the action, stored on `actionQueue`. This is // intentional. The conceptual model for queued actions is that they are // queued in a remote worker; the dispatch happens immediately, only the // execution is delayed. - var action = node.action; var payload = node.payload; var prevState = actionQueue.state; - try { - var returnValue = action(prevState, payload); - var onStartTransitionFinish = ReactSharedInternals.S; + if (node.isTransition) { + // The original dispatch was part of a transition. We restore its + // transition context here. + // This is a fork of startTransition + var prevTransition = ReactSharedInternals.T; + var currentTransition = {}; + ReactSharedInternals.T = currentTransition; - if (onStartTransitionFinish !== null) { - onStartTransitionFinish(currentTransition, returnValue); + { + ReactSharedInternals.T._updatedFibers = new Set(); } - if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] - typeof returnValue.then === 'function') { - var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as - // this resolves, we can run the next action in the sequence. + try { + var returnValue = action(prevState, payload); + var onStartTransitionFinish = ReactSharedInternals.S; - thenable.then(function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - }, function () { - return finishRunningActionStateAction(actionQueue, setPendingState, setState); - }); - setState(thenable); - } else { - setState(returnValue); - var nextState = returnValue; - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } - } catch (error) { - // This is a trick to get the `useActionState` hook to rethrow the error. - // When it unwraps the thenable with the `use` algorithm, the error - // will be thrown. - var rejectedThenable = { - then: function () {}, - status: 'rejected', - reason: error // $FlowFixMe: Not sure why this doesn't work + if (onStartTransitionFinish !== null) { + onStartTransitionFinish(currentTransition, returnValue); + } - }; - setState(rejectedThenable); - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; - { - if (prevTransition === null && currentTransition._updatedFibers) { - var updatedFibersCount = currentTransition._updatedFibers.size; + { + if (prevTransition === null && currentTransition._updatedFibers) { + var updatedFibersCount = currentTransition._updatedFibers.size; - currentTransition._updatedFibers.clear(); + currentTransition._updatedFibers.clear(); - if (updatedFibersCount > 10) { - warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + if (updatedFibersCount > 10) { + warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + } } } } + } else { + // The original dispatch was not part of a transition. + try { + var _returnValue = action(prevState, payload); + + handleActionReturnValue(actionQueue, node, _returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } + } +} + +function handleActionReturnValue(actionQueue, node, returnValue) { + if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] + typeof returnValue.then === 'function') { + var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as + // this resolves, we can run the next action in the sequence. + + thenable.then(function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, function (error) { + return onActionError(actionQueue, node, error); + }); + + { + if (!node.isTransition) { + error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`'); + } + } + } else { + var nextState = returnValue; + onActionSuccess(actionQueue, node, nextState); } } -function finishRunningActionStateAction(actionQueue, setPendingState, setState) { - // The action finished running. Pop it from the queue and run the next pending - // action, if there are any. +function onActionSuccess(actionQueue, actionNode, nextState) { + // The action finished running. + actionNode.status = 'fulfilled'; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there + // are any. + var last = actionQueue.pending; if (last !== null) { @@ -8522,11 +8558,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState) var next = first.next; last.next = next; // Run the next action. - runActionStateAction(actionQueue, setPendingState, setState, next); + runActionStateAction(actionQueue, next); } } } +function onActionError(actionQueue, actionNode, error) { + actionNode.status = 'rejected'; + actionNode.reason = error; + notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there + // are any. + // TODO: We should instead abort all the remaining actions in the queue. + + var last = actionQueue.pending; + + if (last !== null) { + var first = last.next; + + if (first === last) { + // This was the last action in the queue. + actionQueue.pending = null; + } else { + // Remove the first node from the circular queue. + var next = first.next; + last.next = next; // Run the next action. + + runActionStateAction(actionQueue, next); + } + } +} + +function notifyActionListeners(actionNode) { + // Notify React that the action has finished. + var listeners = actionNode.listeners; + + for (var i = 0; i < listeners.length; i++) { + // This is always a React internal listener, so we don't need to worry + // about it throwing. + var listener = listeners[i]; + listener(); + } +} + function actionStateReducer(oldState, newState) { return newState; } @@ -23337,7 +23410,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-www-classic-def67b9b32-20240603'; +var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603'; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index 7fcbf22bda820..3bdce259f14a3 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -8403,112 +8403,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl throw new Error('Cannot update form state while rendering.'); } + var actionNode = { + payload: payload, + action: actionQueue.action, + next: null, + // circular + isTransition: true, + status: 'pending', + value: null, + reason: null, + listeners: [], + then: function (listener) { + // We know the only thing that subscribes to these promises is `use` so + // this implementation is simpler than a generic thenable. E.g. we don't + // bother to check if the thenable is still pending because `use` already + // does that. + actionNode.listeners.push(listener); + } + }; // Check if we're inside a transition. If so, we'll need to restore the + // transition context when the action is run. + + var prevTransition = ReactSharedInternals.T; + + if (prevTransition !== null) { + // Optimistically update the pending state, similar to useTransition. + // This will be reverted automatically when all actions are finished. + setPendingState(true); // `actionNode` is a thenable that resolves to the return value of + // the action. + + setState(actionNode); + } else { + // This is not a transition. + actionNode.isTransition = false; + setState(actionNode); + } + var last = actionQueue.pending; if (last === null) { // There are no pending actions; this is the first one. We can run // it immediately. - var newLast = { - payload: payload, - action: actionQueue.action, - next: null // circular - - }; - newLast.next = actionQueue.pending = newLast; - runActionStateAction(actionQueue, setPendingState, setState, newLast); + actionNode.next = actionQueue.pending = actionNode; + runActionStateAction(actionQueue, actionNode); } else { // There's already an action running. Add to the queue. var first = last.next; - var _newLast = { - payload: payload, - action: actionQueue.action, - next: first - }; - actionQueue.pending = last.next = _newLast; + actionNode.next = first; + actionQueue.pending = last.next = actionNode; } } -function runActionStateAction(actionQueue, setPendingState, setState, node) { - // This is a fork of startTransition - var prevTransition = ReactSharedInternals.T; - var currentTransition = {}; - ReactSharedInternals.T = currentTransition; - - { - ReactSharedInternals.T._updatedFibers = new Set(); - } // Optimistically update the pending state, similar to useTransition. - // This will be reverted automatically when all actions are finished. - - - setPendingState(true); // `node.action` represents the action function at the time it was dispatched. +function runActionStateAction(actionQueue, node) { + // `node.action` represents the action function at the time it was dispatched. // If this action was queued, it might be stale, i.e. it's not necessarily the // most current implementation of the action, stored on `actionQueue`. This is // intentional. The conceptual model for queued actions is that they are // queued in a remote worker; the dispatch happens immediately, only the // execution is delayed. - var action = node.action; var payload = node.payload; var prevState = actionQueue.state; - try { - var returnValue = action(prevState, payload); - var onStartTransitionFinish = ReactSharedInternals.S; + if (node.isTransition) { + // The original dispatch was part of a transition. We restore its + // transition context here. + // This is a fork of startTransition + var prevTransition = ReactSharedInternals.T; + var currentTransition = {}; + ReactSharedInternals.T = currentTransition; - if (onStartTransitionFinish !== null) { - onStartTransitionFinish(currentTransition, returnValue); + { + ReactSharedInternals.T._updatedFibers = new Set(); } - if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] - typeof returnValue.then === 'function') { - var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as - // this resolves, we can run the next action in the sequence. + try { + var returnValue = action(prevState, payload); + var onStartTransitionFinish = ReactSharedInternals.S; - thenable.then(function (nextState) { - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - }, function () { - return finishRunningActionStateAction(actionQueue, setPendingState, setState); - }); - setState(thenable); - } else { - setState(returnValue); - var nextState = returnValue; - actionQueue.state = nextState; - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } - } catch (error) { - // This is a trick to get the `useActionState` hook to rethrow the error. - // When it unwraps the thenable with the `use` algorithm, the error - // will be thrown. - var rejectedThenable = { - then: function () {}, - status: 'rejected', - reason: error // $FlowFixMe: Not sure why this doesn't work + if (onStartTransitionFinish !== null) { + onStartTransitionFinish(currentTransition, returnValue); + } - }; - setState(rejectedThenable); - finishRunningActionStateAction(actionQueue, setPendingState, setState); - } finally { - ReactSharedInternals.T = prevTransition; + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; - { - if (prevTransition === null && currentTransition._updatedFibers) { - var updatedFibersCount = currentTransition._updatedFibers.size; + { + if (prevTransition === null && currentTransition._updatedFibers) { + var updatedFibersCount = currentTransition._updatedFibers.size; - currentTransition._updatedFibers.clear(); + currentTransition._updatedFibers.clear(); - if (updatedFibersCount > 10) { - warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + if (updatedFibersCount > 10) { + warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + } } } } + } else { + // The original dispatch was not part of a transition. + try { + var _returnValue = action(prevState, payload); + + handleActionReturnValue(actionQueue, node, _returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } + } +} + +function handleActionReturnValue(actionQueue, node, returnValue) { + if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding] + typeof returnValue.then === 'function') { + var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as + // this resolves, we can run the next action in the sequence. + + thenable.then(function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, function (error) { + return onActionError(actionQueue, node, error); + }); + + { + if (!node.isTransition) { + error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`'); + } + } + } else { + var nextState = returnValue; + onActionSuccess(actionQueue, node, nextState); } } -function finishRunningActionStateAction(actionQueue, setPendingState, setState) { - // The action finished running. Pop it from the queue and run the next pending - // action, if there are any. +function onActionSuccess(actionQueue, actionNode, nextState) { + // The action finished running. + actionNode.status = 'fulfilled'; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there + // are any. + var last = actionQueue.pending; if (last !== null) { @@ -8522,11 +8558,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState) var next = first.next; last.next = next; // Run the next action. - runActionStateAction(actionQueue, setPendingState, setState, next); + runActionStateAction(actionQueue, next); } } } +function onActionError(actionQueue, actionNode, error) { + actionNode.status = 'rejected'; + actionNode.reason = error; + notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there + // are any. + // TODO: We should instead abort all the remaining actions in the queue. + + var last = actionQueue.pending; + + if (last !== null) { + var first = last.next; + + if (first === last) { + // This was the last action in the queue. + actionQueue.pending = null; + } else { + // Remove the first node from the circular queue. + var next = first.next; + last.next = next; // Run the next action. + + runActionStateAction(actionQueue, next); + } + } +} + +function notifyActionListeners(actionNode) { + // Notify React that the action has finished. + var listeners = actionNode.listeners; + + for (var i = 0; i < listeners.length; i++) { + // This is always a React internal listener, so we don't need to worry + // about it throwing. + var listener = listeners[i]; + listener(); + } +} + function actionStateReducer(oldState, newState) { return newState; } @@ -23337,7 +23410,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-www-modern-def67b9b32-20240603'; +var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603'; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol diff --git a/compiled/facebook-www/VERSION_CLASSIC b/compiled/facebook-www/VERSION_CLASSIC index a5fe007da0f9d..df7ff9bc763a9 100644 --- a/compiled/facebook-www/VERSION_CLASSIC +++ b/compiled/facebook-www/VERSION_CLASSIC @@ -1 +1 @@ -19.0.0-www-classic-def67b9b32-20240603 \ No newline at end of file +19.0.0-www-classic-67b05be0d2-20240603 \ No newline at end of file diff --git a/compiled/facebook-www/VERSION_MODERN b/compiled/facebook-www/VERSION_MODERN index dd2441ae5bf3c..d0f86e6e7d92a 100644 --- a/compiled/facebook-www/VERSION_MODERN +++ b/compiled/facebook-www/VERSION_MODERN @@ -1 +1 @@ -19.0.0-www-modern-def67b9b32-20240603 \ No newline at end of file +19.0.0-www-modern-67b05be0d2-20240603 \ 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 8fea02394446b..36c21b6aa949d 100644 --- a/compiled/facebook-www/__test_utils__/ReactAllWarnings.js +++ b/compiled/facebook-www/__test_utils__/ReactAllWarnings.js @@ -82,6 +82,7 @@ export default [ "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s", "A view is reporting that a touch occurred on tag zero.", "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.", + "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`", "An empty string (\"\") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.", "An empty string (\"\") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.", "An input can only specify a formAction along with type=\"submit\" or type=\"image\".",