From 3375e2c91cd2d6c535f367f0fcb50925317cf7dc Mon Sep 17 00:00:00 2001 From: Sebastian Sebbie Silbermann Date: Wed, 18 Dec 2024 20:54:38 +0100 Subject: [PATCH 1/7] sync-react: Handle version bumps across SemVer minors and release channels --- scripts/sync-react.js | 86 +++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/scripts/sync-react.js b/scripts/sync-react.js index 89d624a4e9b5f..7c35e81bb057f 100644 --- a/scripts/sync-react.js +++ b/scripts/sync-react.js @@ -21,6 +21,7 @@ const pullRequestReviewers = ['eps1lon'] */ const pagesRouterReact = '^19.0.0' +const defaultLatestChannel = 'canary' const filesReferencingReactPeerDependencyVersion = [ 'run-tests.js', 'packages/create-next-app/templates/index.ts', @@ -38,6 +39,24 @@ const appManifestsInstallingNextjsPeerDependencies = [ 'test/e2e/next-test/first-time-setup-ts/package.json', ] +async function getSchedulerVersion(reactVersion) { + const url = `https://registry.npmjs.org/react-dom/${reactVersion}` + const response = await fetch(url, { + headers: { + Accept: 'application/json', + }, + }) + if (!response.ok) { + throw new Error( + `${url}: ${response.status} ${response.statusText}\n${await response.text()}` + ) + } + + const manifest = await response.json() + + return manifest.dependencies['scheduler'] +} + // Use this script to update Next's vendored copy of React and related packages: // // Basic usage (defaults to most recent React canary version): @@ -46,13 +65,7 @@ const appManifestsInstallingNextjsPeerDependencies = [ // Update package.json but skip installing the dependencies automatically: // pnpm run sync-react --no-install -async function sync({ - channel, - newVersionStr, - newSha, - newDateString, - noInstall, -}) { +async function sync({ channel, newVersionStr, noInstall }) { const useExperimental = channel === 'experimental' const cwd = process.cwd() const pkgJson = JSON.parse( @@ -64,38 +77,35 @@ async function sync({ useExperimental ? 'react-experimental-builtin' : 'react-builtin' ].replace(/^npm:react@/, '') - const baseVersionInfo = extractInfoFromReactVersion(baseVersionStr) - if (!baseVersionInfo) { - throw new Error( - 'Base react version does not match expected format: ' + baseVersionStr - ) - } - - const { - sha: baseSha, - releaseLabel: baseReleaseLabel, - dateString: baseDateString, - } = baseVersionInfo - - console.log(`Updating "react@${channel}" to ${newSha}...\n`) - if (newSha === baseSha) { + console.log(`Updating "react@${channel}" to ${newVersionStr}...`) + if (newVersionStr === baseVersionStr) { console.log('Already up to date.') return } + const baseSchedulerVersionStr = devDependencies[ + useExperimental ? 'scheduler-experimental-builtin' : 'scheduler-builtin' + ].replace(/^npm:scheduler@/, '') + const newSchedulerVersionStr = await getSchedulerVersion(newVersionStr) + console.log(`Updating "scheduler@${channel}" to ${newSchedulerVersionStr}...`) + for (const [dep, version] of Object.entries(devDependencies)) { - if (version.endsWith(`${baseReleaseLabel}-${baseSha}-${baseDateString}`)) { + if (version.endsWith(baseVersionStr)) { + devDependencies[dep] = version.replace(baseVersionStr, newVersionStr) + } else if (version.endsWith(baseSchedulerVersionStr)) { devDependencies[dep] = version.replace( - `${baseReleaseLabel}-${baseSha}-${baseDateString}`, - `${channel}-${newSha}-${newDateString}` + baseSchedulerVersionStr, + newSchedulerVersionStr ) } } for (const [dep, version] of Object.entries(pnpmOverrides)) { - if (version.endsWith(`${baseReleaseLabel}-${baseSha}-${baseDateString}`)) { + if (version.endsWith(baseVersionStr)) { + pnpmOverrides[dep] = version.replace(baseVersionStr, newVersionStr) + } else if (version.endsWith(baseSchedulerVersionStr)) { pnpmOverrides[dep] = version.replace( - `${baseReleaseLabel}-${baseSha}-${baseDateString}`, - `${channel}-${newSha}-${newDateString}` + baseSchedulerVersionStr, + newSchedulerVersionStr ) } } @@ -224,7 +234,7 @@ async function main() { ) { const { stdout, stderr } = await execa( 'npm', - ['--silent', 'view', 'react@canary', 'version'], + ['--silent', 'view', `react@${defaultLatestChannel}`, 'version'], { // Avoid "Usage Error: This project is configured to use pnpm". cwd: '/tmp', @@ -236,7 +246,7 @@ async function main() { } newVersionStr = stdout.trim() console.log( - `--version was not provided. Using react@canary: ${newVersionStr}` + `--version was not provided. Using react@${defaultLatestChannel}: ${newVersionStr}` ) } @@ -253,7 +263,7 @@ Or, run this command with no arguments to use the most recently published versio } const { sha: newSha, dateString: newDateString } = newVersionInfo - const branchName = `update/react/${newSha}-${newDateString}` + const branchName = `update/react/${newVersionStr}` if (createPull) { const { exitCode, all, command } = await execa( 'git', @@ -292,9 +302,7 @@ Or, run this command with no arguments to use the most recently published versio ) await sync({ - newDateString, - newSha, - newVersionStr, + newVersionStr: `0.0.0-experimental-${newSha}-${newDateString}`, noInstall: !install, channel: 'experimental', }) @@ -302,14 +310,12 @@ Or, run this command with no arguments to use the most recently published versio await commitEverything('Update `react@experimental`') } await sync({ - newDateString, - newSha, newVersionStr, noInstall: !install, - channel: 'rc', + channel: '', }) if (commit) { - await commitEverything('Update `react@rc`') + await commitEverything('Update `react`') } const baseVersionInfo = extractInfoFromReactVersion(baseVersionStr) @@ -394,9 +400,9 @@ Or, run this command with no arguments to use the most recently published versio // Install the updated dependencies and build the vendored React files. if (!install) { - console.log('Skipping install step because --no-install flag was passed.\n') + console.log('Skipping install step because --no-install flag was passed.') } else { - console.log('Installing dependencies...\n') + console.log('Installing dependencies...') const installSubprocess = execa('pnpm', [ 'install', From 3c77f124747bf65bb92ae0aff7e73f589f0ab88f Mon Sep 17 00:00:00 2001 From: vercel-release-bot Date: Wed, 18 Dec 2024 20:34:50 +0000 Subject: [PATCH 2/7] Update `react@experimental` --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 67b43e996008b..f3fb23bae3bf4 100644 --- a/package.json +++ b/package.json @@ -214,13 +214,13 @@ "react-builtin": "npm:react@19.0.0-rc-7283a213-20241206", "react-dom": "19.0.0", "react-dom-builtin": "npm:react-dom@19.0.0-rc-7283a213-20241206", - "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-7283a213-20241206", - "react-experimental-builtin": "npm:react@0.0.0-experimental-7283a213-20241206", + "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-7eb8234f-20241218", + "react-experimental-builtin": "npm:react@0.0.0-experimental-7eb8234f-20241218", "react-is-builtin": "npm:react-is@19.0.0-rc-7283a213-20241206", "react-server-dom-turbopack": "19.0.0-rc-7283a213-20241206", - "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-7283a213-20241206", + "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-7eb8234f-20241218", "react-server-dom-webpack": "19.0.0-rc-7283a213-20241206", - "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-7283a213-20241206", + "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-7eb8234f-20241218", "react-ssr-prepass": "1.0.8", "react-virtualized": "9.22.3", "relay-compiler": "13.0.2", @@ -231,7 +231,7 @@ "sass": "1.54.0", "satori": "0.10.9", "scheduler-builtin": "npm:scheduler@0.25.0-rc-7283a213-20241206", - "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-7283a213-20241206", + "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-7eb8234f-20241218", "seedrandom": "3.0.5", "semver": "7.3.7", "shell-quote": "1.7.3", From 781e13e0df78a5ff813fe975af73f7a1ba1c36e7 Mon Sep 17 00:00:00 2001 From: vercel-release-bot Date: Wed, 18 Dec 2024 20:34:51 +0000 Subject: [PATCH 3/7] Update `react` --- package.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index f3fb23bae3bf4..768d0295db2b2 100644 --- a/package.json +++ b/package.json @@ -211,15 +211,15 @@ "pretty-ms": "7.0.0", "random-seed": "0.3.0", "react": "19.0.0", - "react-builtin": "npm:react@19.0.0-rc-7283a213-20241206", + "react-builtin": "npm:react@19.1.0-canary-7eb8234f-20241218", "react-dom": "19.0.0", - "react-dom-builtin": "npm:react-dom@19.0.0-rc-7283a213-20241206", + "react-dom-builtin": "npm:react-dom@19.1.0-canary-7eb8234f-20241218", "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-7eb8234f-20241218", "react-experimental-builtin": "npm:react@0.0.0-experimental-7eb8234f-20241218", - "react-is-builtin": "npm:react-is@19.0.0-rc-7283a213-20241206", - "react-server-dom-turbopack": "19.0.0-rc-7283a213-20241206", + "react-is-builtin": "npm:react-is@19.1.0-canary-7eb8234f-20241218", + "react-server-dom-turbopack": "19.1.0-canary-7eb8234f-20241218", "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-7eb8234f-20241218", - "react-server-dom-webpack": "19.0.0-rc-7283a213-20241206", + "react-server-dom-webpack": "19.1.0-canary-7eb8234f-20241218", "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-7eb8234f-20241218", "react-ssr-prepass": "1.0.8", "react-virtualized": "9.22.3", @@ -230,7 +230,7 @@ "resolve-from": "5.0.0", "sass": "1.54.0", "satori": "0.10.9", - "scheduler-builtin": "npm:scheduler@0.25.0-rc-7283a213-20241206", + "scheduler-builtin": "npm:scheduler@0.26.0-canary-7eb8234f-20241218", "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-7eb8234f-20241218", "seedrandom": "3.0.5", "semver": "7.3.7", @@ -272,10 +272,10 @@ "@types/react": "19.0.0", "@types/react-dom": "19.0.0", "jest-snapshot": "30.0.0-alpha.6", - "react": "19.0.0-rc-7283a213-20241206", - "react-dom": "19.0.0-rc-7283a213-20241206", - "react-is": "19.0.0-rc-7283a213-20241206", - "scheduler": "0.25.0-rc-7283a213-20241206" + "react": "19.1.0-canary-7eb8234f-20241218", + "react-dom": "19.1.0-canary-7eb8234f-20241218", + "react-is": "19.1.0-canary-7eb8234f-20241218", + "scheduler": "0.26.0-canary-7eb8234f-20241218" }, "patchedDependencies": { "webpack-sources@3.2.3": "patches/webpack-sources@3.2.3.patch" From cb3b371336cc16c671bdaeec8c9995e2349840dd Mon Sep 17 00:00:00 2001 From: vercel-release-bot Date: Wed, 18 Dec 2024 20:34:51 +0000 Subject: [PATCH 4/7] Updated peer dependency references in apps From 066baaccc9339c9b1086a2c597c17f2238045905 Mon Sep 17 00:00:00 2001 From: vercel-release-bot Date: Wed, 18 Dec 2024 20:34:51 +0000 Subject: [PATCH 5/7] Updated peer dependency references in libraries From 79077e18a5e5ebd8ab5c2f25fbe2b0cc136d5974 Mon Sep 17 00:00:00 2001 From: vercel-release-bot Date: Wed, 18 Dec 2024 20:35:03 +0000 Subject: [PATCH 6/7] Update lockfile --- pnpm-lock.yaml | 605 +++++++++++++++++++++++-------------------------- 1 file changed, 289 insertions(+), 316 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 811fa6e00dc64..7fe8232058da6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,10 +16,10 @@ overrides: '@types/react': 19.0.0 '@types/react-dom': 19.0.0 jest-snapshot: 30.0.0-alpha.6 - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 - react-is: 19.0.0-rc-7283a213-20241206 - scheduler: 0.25.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 + react-is: 19.1.0-canary-7eb8234f-20241218 + scheduler: 0.26.0-canary-7eb8234f-20241218 patchedDependencies: webpack-sources@3.2.3: @@ -68,7 +68,7 @@ importers: version: 11.11.0 '@emotion/react': specifier: 11.11.1 - version: 11.11.1(@types/react@19.0.0)(react@19.0.0-rc-7283a213-20241206) + version: 11.11.1(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218) '@fullhuman/postcss-purgecss': specifier: 1.3.0 version: 1.3.0 @@ -77,7 +77,7 @@ importers: version: 2.2.1(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))) '@mdx-js/react': specifier: 2.2.1 - version: 2.2.1(react@19.0.0-rc-7283a213-20241206) + version: 2.2.1(react@19.1.0-canary-7eb8234f-20241218) '@next/bundle-analyzer': specifier: workspace:* version: link:packages/next-bundle-analyzer @@ -137,7 +137,7 @@ importers: version: 6.1.2(@jest/globals@29.7.0)(@types/jest@29.5.5)(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0)) '@testing-library/react': specifier: ^15.0.5 - version: 15.0.7(@types/react@19.0.0)(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206) + version: 15.0.7(@types/react@19.0.0)(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218) '@types/busboy': specifier: 1.5.3 version: 1.5.3 @@ -451,44 +451,44 @@ importers: specifier: 0.3.0 version: 0.3.0 react: - specifier: 19.0.0-rc-7283a213-20241206 - version: 19.0.0-rc-7283a213-20241206 + specifier: 19.1.0-canary-7eb8234f-20241218 + version: 19.1.0-canary-7eb8234f-20241218 react-builtin: - specifier: npm:react@19.0.0-rc-7283a213-20241206 - version: react@19.0.0-rc-7283a213-20241206 + specifier: npm:react@19.1.0-canary-7eb8234f-20241218 + version: react@19.1.0-canary-7eb8234f-20241218 react-dom: - specifier: 19.0.0-rc-7283a213-20241206 - version: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + specifier: 19.1.0-canary-7eb8234f-20241218 + version: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) react-dom-builtin: - specifier: npm:react-dom@19.0.0-rc-7283a213-20241206 - version: react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + specifier: npm:react-dom@19.1.0-canary-7eb8234f-20241218 + version: react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) react-dom-experimental-builtin: - specifier: npm:react-dom@0.0.0-experimental-7283a213-20241206 - version: react-dom@0.0.0-experimental-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + specifier: npm:react-dom@0.0.0-experimental-7eb8234f-20241218 + version: react-dom@0.0.0-experimental-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) react-experimental-builtin: - specifier: npm:react@0.0.0-experimental-7283a213-20241206 - version: react@0.0.0-experimental-7283a213-20241206 + specifier: npm:react@0.0.0-experimental-7eb8234f-20241218 + version: react@0.0.0-experimental-7eb8234f-20241218 react-is-builtin: - specifier: npm:react-is@19.0.0-rc-7283a213-20241206 - version: react-is@19.0.0-rc-7283a213-20241206 + specifier: npm:react-is@19.1.0-canary-7eb8234f-20241218 + version: react-is@19.1.0-canary-7eb8234f-20241218 react-server-dom-turbopack: - specifier: 19.0.0-rc-7283a213-20241206 - version: 19.0.0-rc-7283a213-20241206(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206) + specifier: 19.1.0-canary-7eb8234f-20241218 + version: 19.1.0-canary-7eb8234f-20241218(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218) react-server-dom-turbopack-experimental: - specifier: npm:react-server-dom-turbopack@0.0.0-experimental-7283a213-20241206 - version: react-server-dom-turbopack@0.0.0-experimental-7283a213-20241206(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206) + specifier: npm:react-server-dom-turbopack@0.0.0-experimental-7eb8234f-20241218 + version: react-server-dom-turbopack@0.0.0-experimental-7eb8234f-20241218(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218) react-server-dom-webpack: - specifier: 19.0.0-rc-7283a213-20241206 - version: 19.0.0-rc-7283a213-20241206(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))) + specifier: 19.1.0-canary-7eb8234f-20241218 + version: 19.1.0-canary-7eb8234f-20241218(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))) react-server-dom-webpack-experimental: - specifier: npm:react-server-dom-webpack@0.0.0-experimental-7283a213-20241206 - version: react-server-dom-webpack@0.0.0-experimental-7283a213-20241206(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))) + specifier: npm:react-server-dom-webpack@0.0.0-experimental-7eb8234f-20241218 + version: react-server-dom-webpack@0.0.0-experimental-7eb8234f-20241218(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))) react-ssr-prepass: specifier: 1.0.8 - version: 1.0.8(react-is@19.0.0-rc-f90a6bcc-20240827)(react@19.0.0-rc-7283a213-20241206) + version: 1.0.8(react-is@19.1.0-canary-7eb8234f-20241218)(react@19.1.0-canary-7eb8234f-20241218) react-virtualized: specifier: 9.22.3 - version: 9.22.3(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206) + version: 9.22.3(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218) relay-compiler: specifier: 13.0.2 version: 13.0.2 @@ -511,11 +511,11 @@ importers: specifier: 0.10.9 version: 0.10.9 scheduler-builtin: - specifier: npm:scheduler@0.25.0-rc-7283a213-20241206 - version: scheduler@0.25.0-rc-7283a213-20241206 + specifier: npm:scheduler@0.26.0-canary-7eb8234f-20241218 + version: scheduler@0.26.0-canary-7eb8234f-20241218 scheduler-experimental-builtin: - specifier: npm:scheduler@0.0.0-experimental-7283a213-20241206 - version: scheduler@0.0.0-experimental-7283a213-20241206 + specifier: npm:scheduler@0.0.0-experimental-7eb8234f-20241218 + version: scheduler@0.0.0-experimental-7eb8234f-20241218 seedrandom: specifier: 3.0.5 version: 3.0.5 @@ -530,16 +530,16 @@ importers: version: 6.0.0 styled-components: specifier: 6.0.0-rc.3 - version: 6.0.0-rc.3(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206) + version: 6.0.0-rc.3(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218) styled-jsx: specifier: 5.1.6 - version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-7283a213-20241206) + version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.1.0-canary-7eb8234f-20241218) styled-jsx-plugin-postcss: specifier: 3.0.2 version: 3.0.2 swr: specifier: ^2.2.4 - version: 2.2.4(react@19.0.0-rc-7283a213-20241206) + version: 2.2.4(react@19.1.0-canary-7eb8234f-20241218) tailwindcss: specifier: 3.2.7 version: 3.2.7(postcss@8.4.31) @@ -614,13 +614,13 @@ importers: dependencies: '@mantine/core': specifier: ^7.10.1 - version: 7.10.1(@mantine/hooks@7.11.2(react@19.0.0-rc-f90a6bcc-20240827))(@types/react@19.0.0)(react-dom@19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827))(react@19.0.0-rc-f90a6bcc-20240827) + version: 7.10.1(@mantine/hooks@7.11.2(react@19.1.0-canary-7eb8234f-20241218))(@types/react@19.0.0)(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218) lodash-es: specifier: ^4.17.21 version: 4.17.21 lucide-react: specifier: ^0.383.0 - version: 0.383.0(react@19.0.0-rc-f90a6bcc-20240827) + version: 0.383.0(react@19.1.0-canary-7eb8234f-20241218) mermaid: specifier: ^10.9.1 version: 10.9.1 @@ -866,17 +866,17 @@ importers: specifier: 8.4.31 version: 8.4.31 react: - specifier: 19.0.0-rc-7283a213-20241206 - version: 19.0.0-rc-7283a213-20241206 + specifier: 19.1.0-canary-7eb8234f-20241218 + version: 19.1.0-canary-7eb8234f-20241218 react-dom: - specifier: 19.0.0-rc-7283a213-20241206 - version: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + specifier: 19.1.0-canary-7eb8234f-20241218 + version: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) sass: specifier: ^1.3.0 version: 1.77.8 styled-jsx: specifier: 5.1.6 - version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-7283a213-20241206) + version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.1.0-canary-7eb8234f-20241218) optionalDependencies: sharp: specifier: ^0.33.5 @@ -950,7 +950,7 @@ importers: version: 3.4.0 '@chromatic-com/storybook': specifier: ^3.2.2 - version: 3.2.2(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3)) + version: 3.2.2(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3)) '@edge-runtime/cookies': specifier: 6.0.0 version: 6.0.0 @@ -1004,19 +1004,19 @@ importers: version: 8.4.7(storybook@8.4.7(prettier@3.3.3)) '@storybook/addon-onboarding': specifier: ^8.4.7 - version: 8.4.7(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3)) + version: 8.4.7(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3)) '@storybook/addon-webpack5-compiler-swc': specifier: ^1.0.5 version: 1.0.5(@swc/helpers@0.5.15)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.23.1)) '@storybook/blocks': specifier: ^8.4.7 - version: 8.4.7(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3)) + version: 8.4.7(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3)) '@storybook/react': specifier: ^8.4.7 - version: 8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2) + version: 8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2) '@storybook/react-webpack5': specifier: ^8.4.7 - version: 8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.23.1)(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2) + version: 8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.23.1)(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2) '@storybook/test': specifier: ^8.4.7 version: 8.4.7(storybook@8.4.7(prettier@3.3.3)) @@ -1487,7 +1487,7 @@ importers: version: 1.0.35 unistore: specifier: 3.4.1 - version: 3.4.1(react@19.0.0-rc-7283a213-20241206) + version: 3.4.1(react@19.1.0-canary-7eb8234f-20241218) util: specifier: 0.12.4 version: 0.12.4 @@ -1596,7 +1596,7 @@ importers: version: 2.2.1(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))) '@mdx-js/react': specifier: '>=0.15.0' - version: 2.2.1(react@19.0.0-rc-f90a6bcc-20240827) + version: 2.2.1(react@19.1.0-canary-7eb8234f-20241218) source-map: specifier: ^0.7.0 version: 0.7.3 @@ -1645,8 +1645,8 @@ importers: packages/third-parties: dependencies: react: - specifier: 19.0.0-rc-7283a213-20241206 - version: 19.0.0-rc-7283a213-20241206 + specifier: 19.1.0-canary-7eb8234f-20241218 + version: 19.1.0-canary-7eb8234f-20241218 third-party-capital: specifier: 1.0.20 version: 1.0.20 @@ -1709,14 +1709,14 @@ importers: specifier: 29.5.0 version: 29.5.0 react: - specifier: 19.0.0-rc-7283a213-20241206 - version: 19.0.0-rc-7283a213-20241206 + specifier: 19.1.0-canary-7eb8234f-20241218 + version: 19.1.0-canary-7eb8234f-20241218 react-test-renderer: specifier: 18.2.0 - version: 18.2.0(react@19.0.0-rc-7283a213-20241206) + version: 18.2.0(react@19.1.0-canary-7eb8234f-20241218) styled-jsx: specifier: ^5.1.2 - version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-7283a213-20241206) + version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.1.0-canary-7eb8234f-20241218) turbopack/packages/devlow-bench: dependencies: @@ -3464,7 +3464,7 @@ packages: resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==} peerDependencies: '@types/react': '*' - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 peerDependenciesMeta: '@types/react': optional: true @@ -3481,7 +3481,7 @@ packages: '@emotion/use-insertion-effect-with-fallbacks@1.0.1': resolution: {integrity: sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 '@emotion/utils@1.2.1': resolution: {integrity: sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==} @@ -3830,14 +3830,14 @@ packages: '@floating-ui/react-dom@2.1.0': resolution: {integrity: sha512-lNzj5EQmEKn5FFKc04+zasr09h/uX8RtJRNj5gUXsSQIXHVWTVh+hVAg1vOMCexkX8EgvemMvIFpQfkosnVNyA==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 '@floating-ui/react@0.26.16': resolution: {integrity: sha512-HEf43zxZNAI/E781QIVpYSF3K2VH4TTYZpqecjdsFkjsaU1EbaWcM++kw0HXFffj7gDUcBFevX8s0rQGQpxkow==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 '@floating-ui/utils@0.2.2': resolution: {integrity: sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==} @@ -4495,13 +4495,13 @@ packages: resolution: {integrity: sha512-l9ypojKN3PjwO1CSLIsqxi7mA25+7w+xc71Q+JuCCREI0tuGwkZsKbIOpuTATIJOjPh8ycLiW7QxX1LYsRTq6w==} peerDependencies: '@mantine/hooks': 7.10.1 - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 '@mantine/hooks@7.11.2': resolution: {integrity: sha512-jhyVe/sbDEG2U8rr2lMecUPgQxcfr5hh9HazqGfkS7ZRIMDO7uJ947yAcTMGGkp5Lxtt5TBFt1Cb6tiB2/1agg==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 '@mapbox/node-pre-gyp@1.0.5': resolution: {integrity: sha512-4srsKPXWlIxp5Vbqz5uLfBN+du2fJChBoYn/f2h991WLdk7jUvcSk/McVLSv/X+xQIPI8eGD5GjrnygdyHnhPA==} @@ -4518,13 +4518,13 @@ packages: '@mdx-js/react@2.2.1': resolution: {integrity: sha512-YdXcMcEnqZhzql98RNrqYo9cEhTTesBiCclEtoiQUbJwx87q9453GTapYU6kJ8ZZ2ek1Vp25SiAXEFy5O/eAPw==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 '@mdx-js/react@3.1.0': resolution: {integrity: sha512-QjHtSaoameoalGnKDT3FoIl4+9RwyTmo9ZJGBdLOks/YOiWHoRDI3PUwEzOE7kEmGcV3AFcp9K6dYu9rEuKLAQ==} peerDependencies: '@types/react': 19.0.0 - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 '@mswjs/cookies@1.1.0': resolution: {integrity: sha512-0ZcCVQxifZmhwNBoQIrystCb+2sWBY2Zw8lpfJBPCHGCA/HWqehITeCRVIv4VMy8MPlaHo2w2pTHFV2pFfqKPw==} @@ -5011,8 +5011,8 @@ packages: '@storybook/blocks@8.4.7': resolution: {integrity: sha512-+QH7+JwXXXIyP3fRCxz/7E2VZepAanXJM7G8nbR3wWsqWgrRp4Wra6MvybxAYCxU7aNfJX5c+RW84SNikFpcIA==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 storybook: ^8.4.7 peerDependenciesMeta: react: @@ -5062,8 +5062,8 @@ packages: resolution: {integrity: sha512-Nz/UzeYQdUZUhacrPyfkiiysSjydyjgg/p0P9HxB4p/WaJUUjMAcaoaLgy3EXx61zZJ3iD36WPuDkZs5QYrA0A==} engines: {node: '>=14.0.0'} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 '@storybook/instrumenter@8.4.7': resolution: {integrity: sha512-k6NSD3jaRCCHAFtqXZ7tw8jAzD/yTEWXGya+REgZqq5RCkmJ+9S4Ytp/6OhQMPtPFX23gAuJJzTQVLcCr+gjRg==} @@ -5079,8 +5079,8 @@ packages: resolution: {integrity: sha512-geTSBKyrBagVihil5MF7LkVFynbfHhCinvnbCZZqXW7M1vgcxvatunUENB+iV8eWg/0EJ+8O7scZL+BAxQ/2qg==} engines: {node: '>=18.0.0'} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 storybook: ^8.4.7 typescript: '*' peerDependenciesMeta: @@ -5101,16 +5101,16 @@ packages: '@storybook/react-dom-shim@8.4.7': resolution: {integrity: sha512-6bkG2jvKTmWrmVzCgwpTxwIugd7Lu+2btsLAqhQSzDyIj2/uhMNp8xIMr/NBDtLgq3nomt9gefNa9xxLwk/OMg==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 storybook: ^8.4.7 '@storybook/react-webpack5@8.4.7': resolution: {integrity: sha512-T9GLqlsP4It4El7cC8rSkBPRWvORAsTDULeWlO36RST2TrYnmBOUytsi22mk7cAAAVhhD6rTrs1YdqWRMpfa1w==} engines: {node: '>=18.0.0'} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 storybook: ^8.4.7 typescript: '>= 4.2.x' peerDependenciesMeta: @@ -5122,8 +5122,8 @@ packages: engines: {node: '>=18.0.0'} peerDependencies: '@storybook/test': 8.4.7 - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 storybook: ^8.4.7 typescript: '>= 4.2.x' peerDependenciesMeta: @@ -5346,8 +5346,8 @@ packages: engines: {node: '>=18'} peerDependencies: '@types/react': 19.0.0 - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 peerDependenciesMeta: '@types/react': optional: true @@ -11088,7 +11088,7 @@ packages: lucide-react@0.383.0: resolution: {integrity: sha512-13xlG0CQCJtzjSQYwwJ3WRqMHtRj3EXmLlorrARt7y+IHnxUCp3XyFNL1DfaGySWxHObDvnu1u1dV+0VMKHUSg==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 lz-string@1.5.0: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} @@ -13505,7 +13505,7 @@ packages: resolution: {integrity: sha512-7Ypx4vz0+g8ECVxr88W9zhcQpbeujJAVqL14ZnXJ3I23mOI9/oBVTQ3dkJhUmB0D6XOtCZEM6N0Gm9PMngkORw==} engines: {node: '>=10.18'} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 react-docgen-typescript@2.2.2: resolution: {integrity: sha512-tvg2ZtOpOi6QDwsb3GZhOjDkkX0h8Z2gipvTg6OVMUyoYoURhEiRNePT8NZItTVCDh39JJHnLdfCOkzoLbFnTg==} @@ -13516,26 +13516,18 @@ packages: resolution: {integrity: sha512-APPU8HB2uZnpl6Vt/+0AFoVYgSRtfiP6FLrZgPPTDmqSb2R4qZRbgd0A3VzIFxDt5e+Fozjx79WjLWnF69DK8g==} engines: {node: '>=16.14.0'} - react-dom@0.0.0-experimental-7283a213-20241206: - resolution: {integrity: sha512-w1P8sybEM3BWnXelZxeKQ2390vlVVO/yXx5LdJUPF6fSP/gJoauTFCT2co1is4L9m7J3Sn3FSn3eZr5AlIWqhg==} + react-dom@0.0.0-experimental-7eb8234f-20241218: + resolution: {integrity: sha512-jDJbHntemoMCQIxVxQlur6Vpz25m6aZwDz6iE8EVr/CTWwo1E7E+fZRtsrV3AFMvaIkx0pgg5yTdJCu0nmHfIg==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 - react-dom@19.0.0-rc-7283a213-20241206: - resolution: {integrity: sha512-SmMSvpa+J1XfHyEX8gwBTeKh/FewFdwCTvFVPMkAIEDnZsFt+yNXSAJNSKqXvgVSFU7UL+awN9sDneffJJwr1Q==} + react-dom@19.1.0-canary-7eb8234f-20241218: + resolution: {integrity: sha512-Jo9EvkMrwooea9yjxpypwK0pt/tuttrsmcbtOsOLggExJ8Wd32ZlaGxSpJWR3qmXk6QTH+Qow3eh6mfteTrURA==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 - react-dom@19.0.0-rc-f90a6bcc-20240827: - resolution: {integrity: sha512-oUa/reDvGtjRcxi8u+GYHaDHanudaO28+G+Wvxm50CItW1xwIFN2Nn7foJxxDS9lFLGdRWZvjxldZEPAUSuXbg==} - peerDependencies: - react: 19.0.0-rc-7283a213-20241206 - - react-is@19.0.0-rc-7283a213-20241206: - resolution: {integrity: sha512-A4ZRE1X34Tz0QtZhWUSTlRBe03zF0Na8nCEio7Q2MmwaXEIqIlRtDUY89La25dwwCpu/1XJWplSbjvDob/7tmQ==} - - react-is@19.0.0-rc-f90a6bcc-20240827: - resolution: {integrity: sha512-1tXoLFzVbqHAQeY3CwpyF5IYbkwgSoNHhrhS8qOrfiZIh2461h/C1BP/JVIxwyL51wHhUgLsAc/M8g0OcEhV1A==} + react-is@19.1.0-canary-7eb8234f-20241218: + resolution: {integrity: sha512-nWwVFW+gGSK23mObgI4kJ5zYZgMPJjupBY6SeYLn5g79fnE4aLF+Rd0DwL5VPcov4hltezOX1bFLTAD/+jE6ew==} react-lifecycles-compat@3.0.4: resolution: {integrity: sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==} @@ -13543,8 +13535,8 @@ packages: react-number-format@5.4.0: resolution: {integrity: sha512-NWdICrqLhI7rAS8yUeLVd6Wr4cN7UjJ9IBTS0f/a9i7UB4x4Ti70kGnksBtZ7o4Z7YRbvCMMR/jQmkoOBa/4fg==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 react-refresh@0.12.0: resolution: {integrity: sha512-suLIhrU2IHKL5JEKR/fAwJv7bbeq4kJ+pJopf77jHwuR+HmJS/HbrPIGsTBUVfw7tXPOmYv7UJ7PCaN49e8x4A==} @@ -13555,7 +13547,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': 19.0.0 - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 peerDependenciesMeta: '@types/react': optional: true @@ -13565,58 +13557,58 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': 19.0.0 - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 peerDependenciesMeta: '@types/react': optional: true - react-server-dom-turbopack@0.0.0-experimental-7283a213-20241206: - resolution: {integrity: sha512-E0R0xI/CP1ubUkD+u7EA+JzDUO5J2hW4iPkllvppDcn8FdsjBoZCPMmsGX/vdJ7qf2lZ9BgqpaaaLbt1ACn58A==} + react-server-dom-turbopack@0.0.0-experimental-7eb8234f-20241218: + resolution: {integrity: sha512-JI/vGgpO/DjS1gRfI0sqzLsx6e0028t92oDPdOCQ2AFuChhxZlaQvGMC2A4YZVpF1M3PcxmfuAuAETjdiyVwtg==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 - react-server-dom-turbopack@19.0.0-rc-7283a213-20241206: - resolution: {integrity: sha512-yqved4QJLsyYx5UCYb+JwrtyXKQX2ffPUei9r07Q/Yvm+W5IU9oJfJwd91hoyGiteebYIw7Ks/E9Qp3KaGDRxg==} + react-server-dom-turbopack@19.1.0-canary-7eb8234f-20241218: + resolution: {integrity: sha512-5NyyUuUbaITa5k64ivWE3ZJuwAaMzxa1DFo31R4XFSC8IDpA6RIErs5v2DAKoY7GKx/FM/SO94OJVGcwIvxUqg==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 - react-server-dom-webpack@0.0.0-experimental-7283a213-20241206: - resolution: {integrity: sha512-tSLSIDHC6usnR0wW6ynr4+hqBPaytSu9hFxqIS2qnpmxHDXEH0IBNTwxwo+gVOo9uC5NlszQYZvg2MwULNaEjQ==} + react-server-dom-webpack@0.0.0-experimental-7eb8234f-20241218: + resolution: {integrity: sha512-MgiCPBJ6SJSCxJPPMr3dwHGxI2dCH/AkZTU/NBA3iNC2tk7Hmj1rZYBX0nNsEcvi3Lu5OfTUqbXNQ693vNkCRg==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 webpack: 5.96.1 - react-server-dom-webpack@19.0.0-rc-7283a213-20241206: - resolution: {integrity: sha512-O0k1TQRI71LHt7uO15jDmzDuTlB+HkQoknJhzSNw/SbMZuNYGWk7dCvOjzdi7fshurZzQf7TIxO/MaKcn0Fo4Q==} + react-server-dom-webpack@19.1.0-canary-7eb8234f-20241218: + resolution: {integrity: sha512-yW3j6bMljzItrGpdPNCFN0FDcu6zIilFxhE7TuqPNgT5FHg3PPtgROFv4zKelsD3ZN6vjgr5a//1dhHclzJOxQ==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 webpack: 5.96.1 react-shallow-renderer@16.15.0: resolution: {integrity: sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 react-ssr-prepass@1.0.8: resolution: {integrity: sha512-O0gfRA1SaK+9ITKxqfnXsej2jF+OHGP/+GxD4unROQaM/0/UczGF9fuF+wTboxaQoKdIf4FvS3h/OigWh704VA==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 - react-is: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-is: 19.1.0-canary-7eb8234f-20241218 react-style-singleton@2.2.1: resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==} engines: {node: '>=10'} peerDependencies: '@types/react': 19.0.0 - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 peerDependenciesMeta: '@types/react': optional: true @@ -13624,30 +13616,26 @@ packages: react-test-renderer@18.2.0: resolution: {integrity: sha512-JWD+aQ0lh2gvh4NM3bBM42Kx+XybOxCpgYK7F8ugAlpaTSnWsX+39Z4XkOykGZAHrjwwTZT3x3KxswVWxHPUqA==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 react-textarea-autosize@8.5.3: resolution: {integrity: sha512-XT1024o2pqCuZSuBt9FwHlaDeNtVrtCXu0Rnz88t1jUGheCLa3PhjE1GH8Ctm2axEtvdCl5SUHYschyQ0L5QHQ==} engines: {node: '>=10'} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 react-virtualized@9.22.3: resolution: {integrity: sha512-MKovKMxWTcwPSxE1kK1HcheQTWfuCxAuBoSTf2gwyMM21NdX/PXUhnoP8Uc5dRKd+nKm8v41R36OellhdCpkrw==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 - react@0.0.0-experimental-7283a213-20241206: - resolution: {integrity: sha512-t6ZYhZUTG4QehY7+tsxJetYkEhptwOpXMJy4Gd/LVeZ/mORSVaPZPltiOhuUg/NJH4+UqHqZAwq9I4GufK7VkQ==} + react@0.0.0-experimental-7eb8234f-20241218: + resolution: {integrity: sha512-cWYVg9cMmVqBOxeFooggdMkuFM8ElHL7SFLk2aZW8JCUDuvpf51CWoTi3JHkN9ayZInMVrG20d52opm7Q2EpTw==} engines: {node: '>=0.10.0'} - react@19.0.0-rc-7283a213-20241206: - resolution: {integrity: sha512-Jl/WSFghvrXr58g29BOBctG+uh3qvB05O149bsYVzv1OAOWe8ADElQn0ujSHjxcWAgU5UzsCqqRauzngjd/hgw==} - engines: {node: '>=0.10.0'} - - react@19.0.0-rc-f90a6bcc-20240827: - resolution: {integrity: sha512-XMSTS5fg3jy87V+NgK1aYIca4eXil7xD8cOiEDnm2FoBvLBN2/hW5sxpEHTllengKxq9APDz+uft+LZRPwScUA==} + react@19.1.0-canary-7eb8234f-20241218: + resolution: {integrity: sha512-iiSzuNVLFklL8NOmtcO2SMB2Yf23BcDgxa1iesgy5LtywEgeoqgtPsEjdySxF3WUOGYwwmUZPeLWmV6V1KA2bg==} engines: {node: '>=0.10.0'} read-cache@1.0.0: @@ -14183,11 +14171,11 @@ packages: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} engines: {node: '>=v12.22.7'} - scheduler@0.0.0-experimental-7283a213-20241206: - resolution: {integrity: sha512-+BceoijzR3mR0l3LXdW6IFi/xiq+2NNadK5QaxXNBW+jfq1g0xX+UZNGjNPN/aEsl4pBcySF3imH7WjDf+Mpmw==} + scheduler@0.0.0-experimental-7eb8234f-20241218: + resolution: {integrity: sha512-8wOZzMUnWMkLL+W0a0I09eHP2mEqYCPH3+A0PelOj/5ioQHMUPZaAyFVdPO5eooNGrGp3mJNA6u8O/kvyPPcPw==} - scheduler@0.25.0-rc-7283a213-20241206: - resolution: {integrity: sha512-rv6fUiCpVctRLUSnlq+WKfX60AqAoVG4lVM+HuSCkaCIAolRcL0QpzeUcnsyxWfI//lzRPtAdlNwD5l6l58z3Q==} + scheduler@0.26.0-canary-7eb8234f-20241218: + resolution: {integrity: sha512-awR3a7CLNJeQhVIl2VzMFwH3cidHEHQhbNoaaHqEApFikHhHQIxsMqB6k6ASI/o49KkbaKCnva5t7Ro27cIvmA==} schema-utils@2.7.1: resolution: {integrity: sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==} @@ -14759,8 +14747,8 @@ packages: engines: {node: '>= 16'} peerDependencies: babel-plugin-styled-components: '>= 2' - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218 peerDependenciesMeta: babel-plugin-styled-components: optional: true @@ -14774,7 +14762,7 @@ packages: peerDependencies: '@babel/core': '*' babel-plugin-macros: '*' - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 peerDependenciesMeta: '@babel/core': optional: true @@ -14858,7 +14846,7 @@ packages: swr@2.2.4: resolution: {integrity: sha512-njiZ/4RiIhoOlAaLYDqwz5qH/KZXVilRLvomrx83HjzCWTfa+InyfAjv05PSFxnmLzZkNO9ZfvgoqzAaEI4sGQ==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 symbol-observable@1.0.1: resolution: {integrity: sha512-Kb3PrPYz4HanVF1LVGuAdW6LoVgIwjUYJGzFe7NDrBLCN4lsV/5J0MFurV+ygS4bRVwrCEt2c7MQ1R2a72oJDw==} @@ -15624,7 +15612,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': 19.0.0 - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 peerDependenciesMeta: '@types/react': optional: true @@ -15632,13 +15620,13 @@ packages: use-composed-ref@1.3.0: resolution: {integrity: sha512-GLMG0Jc/jiKov/3Ulid1wbv3r54K9HlMW29IWcDFPEqFkSO2nS0MuefWgMJpeHQ9YJeXDL3ZUF+P3jdXlZX/cQ==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 use-isomorphic-layout-effect@1.1.2: resolution: {integrity: sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==} peerDependencies: '@types/react': '*' - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 peerDependenciesMeta: '@types/react': optional: true @@ -15647,7 +15635,7 @@ packages: resolution: {integrity: sha512-xA+AVm/Wlg3e2P/JiItTziwS7FK92LWrDB0p+hgXloIMuVCeJJ8v6f0eeHyPZaJrM+usM1FkFfbNCrJGs8A/zw==} peerDependencies: '@types/react': '*' - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 peerDependenciesMeta: '@types/react': optional: true @@ -15657,7 +15645,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': 19.0.0 - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 peerDependenciesMeta: '@types/react': optional: true @@ -15665,7 +15653,7 @@ packages: use-sync-external-store@1.2.0: resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} peerDependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -18218,12 +18206,12 @@ snapshots: '@capsizecss/metrics@3.4.0': {} - '@chromatic-com/storybook@3.2.2(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3))': + '@chromatic-com/storybook@3.2.2(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3))': dependencies: chromatic: 11.20.2 filesize: 10.1.6 jsonfile: 6.1.0 - react-confetti: 6.1.0(react@19.0.0-rc-7283a213-20241206) + react-confetti: 6.1.0(react@19.1.0-canary-7eb8234f-20241218) storybook: 8.4.7(prettier@3.3.3) strip-ansi: 7.1.0 transitivePeerDependencies: @@ -18371,17 +18359,17 @@ snapshots: '@emotion/memoize@0.8.1': {} - '@emotion/react@11.11.1(@types/react@19.0.0)(react@19.0.0-rc-7283a213-20241206)': + '@emotion/react@11.11.1(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218)': dependencies: '@babel/runtime': 7.22.5 '@emotion/babel-plugin': 11.11.0 '@emotion/cache': 11.11.0 '@emotion/serialize': 1.1.2 - '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@19.0.0-rc-7283a213-20241206) + '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@19.1.0-canary-7eb8234f-20241218) '@emotion/utils': 1.2.1 '@emotion/weak-memoize': 0.3.1 hoist-non-react-statics: 3.3.2 - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 optionalDependencies: '@types/react': 19.0.0 transitivePeerDependencies: @@ -18399,9 +18387,9 @@ snapshots: '@emotion/unitless@0.8.1': {} - '@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@19.0.0-rc-7283a213-20241206)': + '@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@19.1.0-canary-7eb8234f-20241218)': dependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 '@emotion/utils@1.2.1': {} @@ -18750,18 +18738,18 @@ snapshots: '@floating-ui/core': 1.6.2 '@floating-ui/utils': 0.2.2 - '@floating-ui/react-dom@2.1.0(react-dom@19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827))(react@19.0.0-rc-f90a6bcc-20240827)': + '@floating-ui/react-dom@2.1.0(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)': dependencies: '@floating-ui/dom': 1.6.5 - react: 19.0.0-rc-f90a6bcc-20240827 - react-dom: 19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) - '@floating-ui/react@0.26.16(react-dom@19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827))(react@19.0.0-rc-f90a6bcc-20240827)': + '@floating-ui/react@0.26.16(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)': dependencies: - '@floating-ui/react-dom': 2.1.0(react-dom@19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827))(react@19.0.0-rc-f90a6bcc-20240827) + '@floating-ui/react-dom': 2.1.0(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218) '@floating-ui/utils': 0.2.2 - react: 19.0.0-rc-f90a6bcc-20240827 - react-dom: 19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) tabbable: 6.2.0 '@floating-ui/utils@0.2.2': {} @@ -19780,23 +19768,23 @@ snapshots: dependencies: call-bind: 1.0.7 - '@mantine/core@7.10.1(@mantine/hooks@7.11.2(react@19.0.0-rc-f90a6bcc-20240827))(@types/react@19.0.0)(react-dom@19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827))(react@19.0.0-rc-f90a6bcc-20240827)': + '@mantine/core@7.10.1(@mantine/hooks@7.11.2(react@19.1.0-canary-7eb8234f-20241218))(@types/react@19.0.0)(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)': dependencies: - '@floating-ui/react': 0.26.16(react-dom@19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827))(react@19.0.0-rc-f90a6bcc-20240827) - '@mantine/hooks': 7.11.2(react@19.0.0-rc-f90a6bcc-20240827) + '@floating-ui/react': 0.26.16(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218) + '@mantine/hooks': 7.11.2(react@19.1.0-canary-7eb8234f-20241218) clsx: 2.1.1 - react: 19.0.0-rc-f90a6bcc-20240827 - react-dom: 19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827) - react-number-format: 5.4.0(react-dom@19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827))(react@19.0.0-rc-f90a6bcc-20240827) - react-remove-scroll: 2.5.10(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827) - react-textarea-autosize: 8.5.3(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) + react-number-format: 5.4.0(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218) + react-remove-scroll: 2.5.10(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218) + react-textarea-autosize: 8.5.3(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218) type-fest: 4.18.3 transitivePeerDependencies: - '@types/react' - '@mantine/hooks@7.11.2(react@19.0.0-rc-f90a6bcc-20240827)': + '@mantine/hooks@7.11.2(react@19.1.0-canary-7eb8234f-20241218)': dependencies: - react: 19.0.0-rc-f90a6bcc-20240827 + react: 19.1.0-canary-7eb8234f-20241218 '@mapbox/node-pre-gyp@1.0.5(encoding@0.1.13)': dependencies: @@ -19843,23 +19831,17 @@ snapshots: transitivePeerDependencies: - supports-color - '@mdx-js/react@2.2.1(react@19.0.0-rc-7283a213-20241206)': + '@mdx-js/react@2.2.1(react@19.1.0-canary-7eb8234f-20241218)': dependencies: '@types/mdx': 2.0.3 '@types/react': 19.0.0 - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 - '@mdx-js/react@2.2.1(react@19.0.0-rc-f90a6bcc-20240827)': + '@mdx-js/react@3.1.0(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218)': dependencies: '@types/mdx': 2.0.3 '@types/react': 19.0.0 - react: 19.0.0-rc-f90a6bcc-20240827 - - '@mdx-js/react@3.1.0(@types/react@19.0.0)(react@19.0.0-rc-7283a213-20241206)': - dependencies: - '@types/mdx': 2.0.3 - '@types/react': 19.0.0 - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 '@mswjs/cookies@1.1.0': {} @@ -20429,12 +20411,12 @@ snapshots: '@storybook/addon-docs@8.4.7(@types/react@19.0.0)(storybook@8.4.7(prettier@3.3.3))': dependencies: - '@mdx-js/react': 3.1.0(@types/react@19.0.0)(react@19.0.0-rc-7283a213-20241206) - '@storybook/blocks': 8.4.7(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3)) + '@mdx-js/react': 3.1.0(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218) + '@storybook/blocks': 8.4.7(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3)) '@storybook/csf-plugin': 8.4.7(storybook@8.4.7(prettier@3.3.3)) - '@storybook/react-dom-shim': 8.4.7(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3)) - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + '@storybook/react-dom-shim': 8.4.7(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3)) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) storybook: 8.4.7(prettier@3.3.3) ts-dedent: 2.2.0 transitivePeerDependencies: @@ -20476,9 +20458,9 @@ snapshots: storybook: 8.4.7(prettier@3.3.3) tiny-invariant: 1.3.3 - '@storybook/addon-onboarding@8.4.7(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3))': + '@storybook/addon-onboarding@8.4.7(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3))': dependencies: - react-confetti: 6.1.0(react@19.0.0-rc-7283a213-20241206) + react-confetti: 6.1.0(react@19.1.0-canary-7eb8234f-20241218) storybook: 8.4.7(prettier@3.3.3) transitivePeerDependencies: - react @@ -20506,15 +20488,15 @@ snapshots: - '@swc/helpers' - webpack - '@storybook/blocks@8.4.7(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3))': + '@storybook/blocks@8.4.7(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3))': dependencies: '@storybook/csf': 0.1.12 - '@storybook/icons': 1.3.0(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206) + '@storybook/icons': 1.3.0(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218) storybook: 8.4.7(prettier@3.3.3) ts-dedent: 2.2.0 optionalDependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) '@storybook/builder-webpack5@8.4.7(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.23.1)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2)': dependencies: @@ -20594,10 +20576,10 @@ snapshots: '@storybook/global@5.0.0': {} - '@storybook/icons@1.3.0(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)': + '@storybook/icons@1.3.0(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)': dependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) '@storybook/instrumenter@8.4.7(storybook@8.4.7(prettier@3.3.3))': dependencies: @@ -20609,18 +20591,18 @@ snapshots: dependencies: storybook: 8.4.7(prettier@3.3.3) - '@storybook/preset-react-webpack@8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.23.1)(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2)': + '@storybook/preset-react-webpack@8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.23.1)(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2)': dependencies: '@storybook/core-webpack': 8.4.7(storybook@8.4.7(prettier@3.3.3)) - '@storybook/react': 8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2) + '@storybook/react': 8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2) '@storybook/react-docgen-typescript-plugin': 1.0.6--canary.9.0c3f3b7.0(typescript@5.7.2)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.23.1)) '@types/node': 20.17.6 '@types/semver': 7.5.6 find-up: 5.0.0 magic-string: 0.30.17 - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 react-docgen: 7.1.0 - react-dom: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) resolve: 1.22.8 semver: 7.6.3 storybook: 8.4.7(prettier@3.3.3) @@ -20654,20 +20636,20 @@ snapshots: transitivePeerDependencies: - supports-color - '@storybook/react-dom-shim@8.4.7(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3))': + '@storybook/react-dom-shim@8.4.7(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3))': dependencies: - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) storybook: 8.4.7(prettier@3.3.3) - '@storybook/react-webpack5@8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.23.1)(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2)': + '@storybook/react-webpack5@8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.23.1)(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2)': dependencies: '@storybook/builder-webpack5': 8.4.7(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.23.1)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2) - '@storybook/preset-react-webpack': 8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.23.1)(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2) - '@storybook/react': 8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2) + '@storybook/preset-react-webpack': 8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.23.1)(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2) + '@storybook/react': 8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2) '@types/node': 20.17.6 - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) storybook: 8.4.7(prettier@3.3.3) optionalDependencies: typescript: 5.7.2 @@ -20680,16 +20662,16 @@ snapshots: - uglify-js - webpack-cli - '@storybook/react@8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2)': + '@storybook/react@8.4.7(@storybook/test@8.4.7(storybook@8.4.7(prettier@3.3.3)))(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3))(typescript@5.7.2)': dependencies: '@storybook/components': 8.4.7(storybook@8.4.7(prettier@3.3.3)) '@storybook/global': 5.0.0 '@storybook/manager-api': 8.4.7(storybook@8.4.7(prettier@3.3.3)) '@storybook/preview-api': 8.4.7(storybook@8.4.7(prettier@3.3.3)) - '@storybook/react-dom-shim': 8.4.7(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(storybook@8.4.7(prettier@3.3.3)) + '@storybook/react-dom-shim': 8.4.7(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(storybook@8.4.7(prettier@3.3.3)) '@storybook/theming': 8.4.7(storybook@8.4.7(prettier@3.3.3)) - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) storybook: 8.4.7(prettier@3.3.3) optionalDependencies: '@storybook/test': 8.4.7(storybook@8.4.7(prettier@3.3.3)) @@ -20925,13 +20907,13 @@ snapshots: lodash: 4.17.21 redent: 3.0.0 - '@testing-library/react@15.0.7(@types/react@19.0.0)(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)': + '@testing-library/react@15.0.7(@types/react@19.0.0)(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)': dependencies: '@babel/runtime': 7.22.5 '@testing-library/dom': 10.1.0 '@types/react-dom': 19.0.0 - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) optionalDependencies: '@types/react': 19.0.0 @@ -26287,7 +26269,7 @@ snapshots: hoist-non-react-statics@3.3.2: dependencies: - react-is: 19.0.0-rc-7283a213-20241206 + react-is: 19.1.0-canary-7eb8234f-20241218 homedir-polyfill@1.0.3: dependencies: @@ -28145,9 +28127,9 @@ snapshots: lru-cache@7.18.3: {} - lucide-react@0.383.0(react@19.0.0-rc-f90a6bcc-20240827): + lucide-react@0.383.0(react@19.1.0-canary-7eb8234f-20241218): dependencies: - react: 19.0.0-rc-f90a6bcc-20240827 + react: 19.1.0-canary-7eb8234f-20241218 lz-string@1.5.0: {} @@ -30947,31 +30929,31 @@ snapshots: '@jest/types': 24.9.0 ansi-regex: 4.1.0 ansi-styles: 3.2.1 - react-is: 19.0.0-rc-7283a213-20241206 + react-is: 19.1.0-canary-7eb8234f-20241218 pretty-format@27.5.1: dependencies: ansi-regex: 5.0.1 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-7283a213-20241206 + react-is: 19.1.0-canary-7eb8234f-20241218 pretty-format@29.5.0: dependencies: '@jest/schemas': 29.4.3 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-7283a213-20241206 + react-is: 19.1.0-canary-7eb8234f-20241218 pretty-format@29.7.0: dependencies: '@jest/schemas': 29.6.3 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-7283a213-20241206 + react-is: 19.1.0-canary-7eb8234f-20241218 pretty-format@30.0.0-alpha.6: dependencies: '@jest/schemas': 30.0.0-alpha.6 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-7283a213-20241206 + react-is: 19.1.0-canary-7eb8234f-20241218 pretty-ms@7.0.0: dependencies: @@ -31030,7 +31012,7 @@ snapshots: dependencies: loose-envify: 1.4.0 object-assign: 4.1.1 - react-is: 19.0.0-rc-7283a213-20241206 + react-is: 19.1.0-canary-7eb8234f-20241218 property-information@5.6.0: dependencies: @@ -31200,9 +31182,9 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 - react-confetti@6.1.0(react@19.0.0-rc-7283a213-20241206): + react-confetti@6.1.0(react@19.1.0-canary-7eb8234f-20241218): dependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 tween-functions: 1.2.0 react-docgen-typescript@2.2.2(typescript@5.7.2): @@ -31224,139 +31206,130 @@ snapshots: transitivePeerDependencies: - supports-color - react-dom@0.0.0-experimental-7283a213-20241206(react@19.0.0-rc-7283a213-20241206): - dependencies: - react: 19.0.0-rc-7283a213-20241206 - scheduler: 0.25.0-rc-7283a213-20241206 - - react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206): + react-dom@0.0.0-experimental-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218): dependencies: - react: 19.0.0-rc-7283a213-20241206 - scheduler: 0.25.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + scheduler: 0.26.0-canary-7eb8234f-20241218 - react-dom@19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827): + react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218): dependencies: - react: 19.0.0-rc-f90a6bcc-20240827 - scheduler: 0.25.0-rc-7283a213-20241206 - - react-is@19.0.0-rc-7283a213-20241206: {} + react: 19.1.0-canary-7eb8234f-20241218 + scheduler: 0.26.0-canary-7eb8234f-20241218 - react-is@19.0.0-rc-f90a6bcc-20240827: {} + react-is@19.1.0-canary-7eb8234f-20241218: {} react-lifecycles-compat@3.0.4: {} - react-number-format@5.4.0(react-dom@19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827))(react@19.0.0-rc-f90a6bcc-20240827): + react-number-format@5.4.0(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218): dependencies: prop-types: 15.8.1 - react: 19.0.0-rc-f90a6bcc-20240827 - react-dom: 19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) react-refresh@0.12.0: {} - react-remove-scroll-bar@2.3.6(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827): + react-remove-scroll-bar@2.3.6(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218): dependencies: - react: 19.0.0-rc-f90a6bcc-20240827 - react-style-singleton: 2.2.1(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827) + react: 19.1.0-canary-7eb8234f-20241218 + react-style-singleton: 2.2.1(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218) tslib: 2.8.1 optionalDependencies: '@types/react': 19.0.0 - react-remove-scroll@2.5.10(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827): + react-remove-scroll@2.5.10(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218): dependencies: - react: 19.0.0-rc-f90a6bcc-20240827 - react-remove-scroll-bar: 2.3.6(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827) - react-style-singleton: 2.2.1(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827) + react: 19.1.0-canary-7eb8234f-20241218 + react-remove-scroll-bar: 2.3.6(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218) + react-style-singleton: 2.2.1(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218) tslib: 2.8.1 - use-callback-ref: 1.3.2(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827) - use-sidecar: 1.1.2(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827) + use-callback-ref: 1.3.2(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218) + use-sidecar: 1.1.2(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218) optionalDependencies: '@types/react': 19.0.0 - react-server-dom-turbopack@0.0.0-experimental-7283a213-20241206(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206): + react-server-dom-turbopack@0.0.0-experimental-7eb8234f-20241218(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) - react-server-dom-turbopack@19.0.0-rc-7283a213-20241206(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206): + react-server-dom-turbopack@19.1.0-canary-7eb8234f-20241218(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) - react-server-dom-webpack@0.0.0-experimental-7283a213-20241206(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))): + react-server-dom-webpack@0.0.0-experimental-7eb8234f-20241218(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) webpack: 5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15)) webpack-sources: 3.2.3(patch_hash=jbynf5dc46ambamq3wuyho6hkq) - react-server-dom-webpack@19.0.0-rc-7283a213-20241206(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))): + react-server-dom-webpack@19.1.0-canary-7eb8234f-20241218(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218)(webpack@5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) webpack: 5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15)) webpack-sources: 3.2.3(patch_hash=jbynf5dc46ambamq3wuyho6hkq) - react-shallow-renderer@16.15.0(react@19.0.0-rc-7283a213-20241206): + react-shallow-renderer@16.15.0(react@19.1.0-canary-7eb8234f-20241218): dependencies: object-assign: 4.1.1 - react: 19.0.0-rc-7283a213-20241206 - react-is: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-is: 19.1.0-canary-7eb8234f-20241218 - react-ssr-prepass@1.0.8(react-is@19.0.0-rc-f90a6bcc-20240827)(react@19.0.0-rc-7283a213-20241206): + react-ssr-prepass@1.0.8(react-is@19.1.0-canary-7eb8234f-20241218)(react@19.1.0-canary-7eb8234f-20241218): dependencies: object-is: 1.0.2 - react: 19.0.0-rc-7283a213-20241206 - react-is: 19.0.0-rc-f90a6bcc-20240827 + react: 19.1.0-canary-7eb8234f-20241218 + react-is: 19.1.0-canary-7eb8234f-20241218 - react-style-singleton@2.2.1(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827): + react-style-singleton@2.2.1(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218): dependencies: get-nonce: 1.0.1 invariant: 2.2.4 - react: 19.0.0-rc-f90a6bcc-20240827 + react: 19.1.0-canary-7eb8234f-20241218 tslib: 2.8.1 optionalDependencies: '@types/react': 19.0.0 - react-test-renderer@18.2.0(react@19.0.0-rc-7283a213-20241206): + react-test-renderer@18.2.0(react@19.1.0-canary-7eb8234f-20241218): dependencies: - react: 19.0.0-rc-7283a213-20241206 - react-is: 19.0.0-rc-7283a213-20241206 - react-shallow-renderer: 16.15.0(react@19.0.0-rc-7283a213-20241206) - scheduler: 0.25.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 + react-is: 19.1.0-canary-7eb8234f-20241218 + react-shallow-renderer: 16.15.0(react@19.1.0-canary-7eb8234f-20241218) + scheduler: 0.26.0-canary-7eb8234f-20241218 - react-textarea-autosize@8.5.3(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827): + react-textarea-autosize@8.5.3(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218): dependencies: '@babel/runtime': 7.22.5 - react: 19.0.0-rc-f90a6bcc-20240827 - use-composed-ref: 1.3.0(react@19.0.0-rc-f90a6bcc-20240827) - use-latest: 1.2.1(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827) + react: 19.1.0-canary-7eb8234f-20241218 + use-composed-ref: 1.3.0(react@19.1.0-canary-7eb8234f-20241218) + use-latest: 1.2.1(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218) transitivePeerDependencies: - '@types/react' - react-virtualized@9.22.3(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206): + react-virtualized@9.22.3(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218): dependencies: '@babel/runtime': 7.22.5 clsx: 1.1.1 dom-helpers: 5.2.1 loose-envify: 1.4.0 prop-types: 15.8.1 - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) react-lifecycles-compat: 3.0.4 - react@0.0.0-experimental-7283a213-20241206: {} - - react@19.0.0-rc-7283a213-20241206: {} + react@0.0.0-experimental-7eb8234f-20241218: {} - react@19.0.0-rc-f90a6bcc-20240827: {} + react@19.1.0-canary-7eb8234f-20241218: {} read-cache@1.0.0: dependencies: @@ -32094,9 +32067,9 @@ snapshots: dependencies: xmlchars: 2.2.0 - scheduler@0.0.0-experimental-7283a213-20241206: {} + scheduler@0.0.0-experimental-7eb8234f-20241218: {} - scheduler@0.25.0-rc-7283a213-20241206: {} + scheduler@0.26.0-canary-7eb8234f-20241218: {} schema-utils@2.7.1: dependencies: @@ -32734,7 +32707,7 @@ snapshots: dependencies: inline-style-parser: 0.1.1 - styled-components@6.0.0-rc.3(react-dom@19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206))(react@19.0.0-rc-7283a213-20241206): + styled-components@6.0.0-rc.3(react-dom@19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218))(react@19.1.0-canary-7eb8234f-20241218): dependencies: '@babel/cli': 7.21.5(@babel/core@7.22.5) '@babel/core': 7.22.5 @@ -32749,8 +32722,8 @@ snapshots: '@emotion/unitless': 0.8.1 css-to-react-native: 3.2.0 postcss: 8.4.31 - react: 19.0.0-rc-7283a213-20241206 - react-dom: 19.0.0-rc-7283a213-20241206(react@19.0.0-rc-7283a213-20241206) + react: 19.1.0-canary-7eb8234f-20241218 + react-dom: 19.1.0-canary-7eb8234f-20241218(react@19.1.0-canary-7eb8234f-20241218) shallowequal: 1.1.0 stylis: 4.2.0 tslib: 2.5.3 @@ -32762,10 +32735,10 @@ snapshots: postcss: 7.0.32 postcss-load-plugins: 2.3.0 - styled-jsx@5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-7283a213-20241206): + styled-jsx@5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.1.0-canary-7eb8234f-20241218): dependencies: client-only: 0.0.1 - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 optionalDependencies: '@babel/core': 7.22.5 babel-plugin-macros: 3.1.0 @@ -32861,11 +32834,11 @@ snapshots: '@swc/counter': 0.1.3 webpack: 5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.23.1) - swr@2.2.4(react@19.0.0-rc-7283a213-20241206): + swr@2.2.4(react@19.1.0-canary-7eb8234f-20241218): dependencies: client-only: 0.0.1 - react: 19.0.0-rc-7283a213-20241206 - use-sync-external-store: 1.2.0(react@19.0.0-rc-7283a213-20241206) + react: 19.1.0-canary-7eb8234f-20241218 + use-sync-external-store: 1.2.0(react@19.1.0-canary-7eb8234f-20241218) symbol-observable@1.0.1: {} @@ -33637,9 +33610,9 @@ snapshots: unist-util-is: 6.0.0 unist-util-visit-parents: 6.0.1 - unistore@3.4.1(react@19.0.0-rc-7283a213-20241206): + unistore@3.4.1(react@19.1.0-canary-7eb8234f-20241218): optionalDependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 universal-github-app-jwt@1.1.1: dependencies: @@ -33733,41 +33706,41 @@ snapshots: punycode: 1.4.1 qs: 6.13.1 - use-callback-ref@1.3.2(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827): + use-callback-ref@1.3.2(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218): dependencies: - react: 19.0.0-rc-f90a6bcc-20240827 + react: 19.1.0-canary-7eb8234f-20241218 tslib: 2.8.1 optionalDependencies: '@types/react': 19.0.0 - use-composed-ref@1.3.0(react@19.0.0-rc-f90a6bcc-20240827): + use-composed-ref@1.3.0(react@19.1.0-canary-7eb8234f-20241218): dependencies: - react: 19.0.0-rc-f90a6bcc-20240827 + react: 19.1.0-canary-7eb8234f-20241218 - use-isomorphic-layout-effect@1.1.2(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827): + use-isomorphic-layout-effect@1.1.2(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218): dependencies: - react: 19.0.0-rc-f90a6bcc-20240827 + react: 19.1.0-canary-7eb8234f-20241218 optionalDependencies: '@types/react': 19.0.0 - use-latest@1.2.1(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827): + use-latest@1.2.1(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218): dependencies: - react: 19.0.0-rc-f90a6bcc-20240827 - use-isomorphic-layout-effect: 1.1.2(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827) + react: 19.1.0-canary-7eb8234f-20241218 + use-isomorphic-layout-effect: 1.1.2(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218) optionalDependencies: '@types/react': 19.0.0 - use-sidecar@1.1.2(@types/react@19.0.0)(react@19.0.0-rc-f90a6bcc-20240827): + use-sidecar@1.1.2(@types/react@19.0.0)(react@19.1.0-canary-7eb8234f-20241218): dependencies: detect-node-es: 1.1.0 - react: 19.0.0-rc-f90a6bcc-20240827 + react: 19.1.0-canary-7eb8234f-20241218 tslib: 2.8.1 optionalDependencies: '@types/react': 19.0.0 - use-sync-external-store@1.2.0(react@19.0.0-rc-7283a213-20241206): + use-sync-external-store@1.2.0(react@19.1.0-canary-7eb8234f-20241218): dependencies: - react: 19.0.0-rc-7283a213-20241206 + react: 19.1.0-canary-7eb8234f-20241218 util-deprecate@1.0.2: {} From ca4d7ebfb35ffcf7cc9b71c2c03cb01a148dc80a Mon Sep 17 00:00:00 2001 From: vercel-release-bot Date: Wed, 18 Dec 2024 20:35:42 +0000 Subject: [PATCH 7/7] ncc-compiled --- .../cjs/react-dom-client.development.js | 15209 ++++++++-------- .../cjs/react-dom-client.production.js | 10626 ++++++----- .../cjs/react-dom-profiling.development.js | 15189 ++++++++------- .../cjs/react-dom-profiling.profiling.js | 11421 ++++++------ ...t-dom-server-legacy.browser.development.js | 38 +- ...ct-dom-server-legacy.browser.production.js | 220 +- ...eact-dom-server-legacy.node.development.js | 38 +- ...react-dom-server-legacy.node.production.js | 231 +- .../react-dom-server.browser.development.js | 42 +- .../react-dom-server.browser.production.js | 183 +- .../cjs/react-dom-server.bun.production.js | 200 +- .../cjs/react-dom-server.edge.development.js | 42 +- .../cjs/react-dom-server.edge.production.js | 194 +- .../cjs/react-dom-server.node.development.js | 42 +- .../cjs/react-dom-server.node.production.js | 194 +- .../react-dom-unstable_testing.development.js | 15209 ++++++++-------- .../react-dom-unstable_testing.production.js | 10626 ++++++----- .../cjs/react-dom.development.js | 2 +- .../cjs/react-dom.production.js | 2 +- .../cjs/react-dom.react-server.development.js | 2 +- .../cjs/react-dom.react-server.production.js | 2 +- .../react-dom-experimental/package.json | 4 +- .../cjs/react-dom-client.development.js | 13533 +++++++------- .../cjs/react-dom-client.production.js | 9749 +++++----- .../cjs/react-dom-profiling.development.js | 13533 +++++++------- .../cjs/react-dom-profiling.profiling.js | 9805 +++++----- ...t-dom-server-legacy.browser.development.js | 34 +- ...ct-dom-server-legacy.browser.production.js | 214 +- ...eact-dom-server-legacy.node.development.js | 34 +- ...react-dom-server-legacy.node.production.js | 225 +- .../react-dom-server.browser.development.js | 38 +- .../react-dom-server.browser.production.js | 177 +- .../cjs/react-dom-server.bun.production.js | 194 +- .../cjs/react-dom-server.edge.development.js | 38 +- .../cjs/react-dom-server.edge.production.js | 188 +- .../cjs/react-dom-server.node.development.js | 38 +- .../cjs/react-dom-server.node.production.js | 188 +- .../react-dom/cjs/react-dom.development.js | 2 +- .../react-dom/cjs/react-dom.production.js | 2 +- .../cjs/react-dom.react-server.development.js | 2 +- .../cjs/react-dom.react-server.production.js | 2 +- .../next/src/compiled/react-dom/package.json | 4 +- .../cjs/react.development.js | 4 +- .../cjs/react.production.js | 4 +- .../cjs/react.react-server.development.js | 12 +- .../cjs/react.react-server.production.js | 4 +- .../next/src/compiled/react-is/package.json | 2 +- ...om-turbopack-client.browser.development.js | 213 +- ...dom-turbopack-client.browser.production.js | 1 + ...r-dom-turbopack-client.edge.development.js | 209 +- ...er-dom-turbopack-client.edge.production.js | 1 + ...r-dom-turbopack-client.node.development.js | 209 +- ...er-dom-turbopack-client.node.production.js | 1 + ...om-turbopack-server.browser.development.js | 650 +- ...dom-turbopack-server.browser.production.js | 602 +- ...r-dom-turbopack-server.edge.development.js | 650 +- ...er-dom-turbopack-server.edge.production.js | 602 +- ...r-dom-turbopack-server.node.development.js | 638 +- ...er-dom-turbopack-server.node.production.js | 592 +- .../package.json | 4 +- .../static.browser.js | 4 +- .../static.edge.js | 4 +- .../static.node.js | 4 +- ...om-turbopack-client.browser.development.js | 8 +- ...dom-turbopack-client.browser.production.js | 1 + ...r-dom-turbopack-client.edge.development.js | 4 +- ...er-dom-turbopack-client.edge.production.js | 1 + ...r-dom-turbopack-client.node.development.js | 4 +- ...er-dom-turbopack-client.node.production.js | 1 + ...om-turbopack-server.browser.development.js | 380 +- ...dom-turbopack-server.browser.production.js | 298 +- ...r-dom-turbopack-server.edge.development.js | 380 +- ...er-dom-turbopack-server.edge.production.js | 298 +- ...r-dom-turbopack-server.node.development.js | 367 +- ...er-dom-turbopack-server.node.production.js | 290 +- .../react-server-dom-turbopack/package.json | 4 +- .../static.browser.js | 4 +- .../react-server-dom-turbopack/static.edge.js | 4 +- .../react-server-dom-turbopack/static.node.js | 4 +- ...-dom-webpack-client.browser.development.js | 213 +- ...r-dom-webpack-client.browser.production.js | 1 + ...ver-dom-webpack-client.edge.development.js | 209 +- ...rver-dom-webpack-client.edge.production.js | 1 + ...ver-dom-webpack-client.node.development.js | 209 +- ...rver-dom-webpack-client.node.production.js | 1 + ...bpack-client.node.unbundled.development.js | 209 +- ...ebpack-client.node.unbundled.production.js | 1 + ...-dom-webpack-server.browser.development.js | 650 +- ...r-dom-webpack-server.browser.production.js | 602 +- ...ver-dom-webpack-server.edge.development.js | 650 +- ...rver-dom-webpack-server.edge.production.js | 602 +- ...ver-dom-webpack-server.node.development.js | 638 +- ...rver-dom-webpack-server.node.production.js | 588 +- ...bpack-server.node.unbundled.development.js | 638 +- ...ebpack-server.node.unbundled.production.js | 588 +- .../package.json | 4 +- .../static.browser.js | 4 +- .../static.edge.js | 4 +- .../static.node.js | 4 +- .../static.node.unbundled.js | 4 +- ...-dom-webpack-client.browser.development.js | 8 +- ...r-dom-webpack-client.browser.production.js | 1 + ...ver-dom-webpack-client.edge.development.js | 4 +- ...rver-dom-webpack-client.edge.production.js | 1 + ...ver-dom-webpack-client.node.development.js | 4 +- ...rver-dom-webpack-client.node.production.js | 1 + ...bpack-client.node.unbundled.development.js | 4 +- ...ebpack-client.node.unbundled.production.js | 1 + ...-dom-webpack-server.browser.development.js | 380 +- ...r-dom-webpack-server.browser.production.js | 298 +- ...ver-dom-webpack-server.edge.development.js | 380 +- ...rver-dom-webpack-server.edge.production.js | 298 +- ...ver-dom-webpack-server.node.development.js | 367 +- ...rver-dom-webpack-server.node.production.js | 286 +- ...bpack-server.node.unbundled.development.js | 367 +- ...ebpack-server.node.unbundled.production.js | 286 +- .../react-server-dom-webpack/package.json | 4 +- .../static.browser.js | 4 +- .../react-server-dom-webpack/static.edge.js | 4 +- .../react-server-dom-webpack/static.node.js | 4 +- .../static.node.unbundled.js | 4 +- .../cjs/react-jsx-dev-runtime.development.js | 2 +- ...sx-dev-runtime.react-server.development.js | 2 +- .../cjs/react-jsx-runtime.development.js | 2 +- ...ct-jsx-runtime.react-server.development.js | 2 +- .../compiled/react/cjs/react.development.js | 4 +- .../compiled/react/cjs/react.production.js | 2 +- .../cjs/react.react-server.development.js | 4 +- .../cjs/react.react-server.production.js | 2 +- .../cjs/scheduler.development.js | 22 +- .../cjs/scheduler.native.development.js | 18 +- .../cjs/scheduler.native.production.js | 14 +- .../cjs/scheduler.production.js | 21 +- .../scheduler/cjs/scheduler.development.js | 12 +- .../cjs/scheduler.native.development.js | 12 +- .../cjs/scheduler.native.production.js | 8 +- .../scheduler/cjs/scheduler.production.js | 12 +- .../next/src/compiled/unistore/unistore.js | 2 +- 138 files changed, 71554 insertions(+), 71287 deletions(-) diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js index 643269fdb0259..67cbb336e724d 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js @@ -510,13 +510,11 @@ return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -919,41 +917,6 @@ } return hook.checkDCE ? !0 : !1; } - function onCommitRoot$1(root, eventPriority) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - var didError = 128 === (root.current.flags & 128); - switch (eventPriority) { - case DiscreteEventPriority: - var schedulerPriority = ImmediatePriority; - break; - case ContinuousEventPriority: - schedulerPriority = UserBlockingPriority; - break; - case DefaultEventPriority: - schedulerPriority = NormalPriority$1; - break; - case IdleEventPriority: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority$1; - } - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), - console.error( - "React instrumentation encountered an error: %s", - err - )); - } - } function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); @@ -1149,54 +1112,6 @@ (root.pingedLanes = 0), (root.warmLanes = 0)); } - function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ) { - var previouslyPendingLanes = root.pendingLanes; - root.pendingLanes = remainingLanes; - root.suspendedLanes = 0; - root.pingedLanes = 0; - root.warmLanes = 0; - root.expiredLanes &= remainingLanes; - root.entangledLanes &= remainingLanes; - root.errorRecoveryDisabledLanes &= remainingLanes; - root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - for ( - remainingLanes = previouslyPendingLanes & ~remainingLanes; - 0 < remainingLanes; - - ) { - var index = 31 - clz32(remainingLanes), - lane = 1 << index; - entanglements[index] = 0; - expirationTimes[index] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index]; - if (null !== hiddenUpdatesForLane) - for ( - hiddenUpdates[index] = null, index = 0; - index < hiddenUpdatesForLane.length; - index++ - ) { - var update = hiddenUpdatesForLane[index]; - null !== update && (update.lane &= -536870913); - } - remainingLanes &= ~lane; - } - 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); - } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; root.suspendedLanes &= ~spawnedLane; @@ -1217,6 +1132,46 @@ rootEntangledLanes &= ~lane; } } + function getBumpedLaneForHydrationByLane(lane) { + switch (lane) { + case 2: + lane = 1; + break; + case 8: + lane = 4; + break; + case 32: + lane = 16; + break; + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + lane = 64; + break; + case 268435456: + lane = 134217728; + break; + default: + lane = 0; + } + return lane; + } function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { @@ -3613,100 +3568,6 @@ "true" === elem.contentEditable) ); } - function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if ( - null !== priorSelectionRange && - hasSelectionCapabilities(containerInfo) - ) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - curFocusedElem = curFocusedElem.getSelection(); - var length = containerInfo.textContent.length, - start = Math.min(priorSelectionRange.start, length); - priorSelectionRange = - void 0 === priorSelectionRange.end - ? start - : Math.min(priorSelectionRange.end, length); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (1 !== curFocusedElem.rangeCount || - curFocusedElem.anchorNode !== length.node || - curFocusedElem.anchorOffset !== length.offset || - curFocusedElem.focusNode !== endMarker.node || - curFocusedElem.focusOffset !== endMarker.offset) && - ((priorSelectionInformation = - priorSelectionInformation.createRange()), - priorSelectionInformation.setStart(length.node, length.offset), - curFocusedElem.removeAllRanges(), - start > priorSelectionRange - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } - } function constructSelectEvent( dispatchQueue, nativeEvent, @@ -3781,6 +3642,26 @@ ? "Idle" : "Other"; } + function logComponentRender(fiber, startTime, endTime) { + var name = getComponentNameFromFiber(fiber); + if (null !== name && supportsUserTiming) { + var selfTime = fiber.actualDuration; + if (null === fiber.alternate || fiber.alternate.child !== fiber.child) + for (fiber = fiber.child; null !== fiber; fiber = fiber.sibling) + selfTime -= fiber.actualDuration; + reusableComponentDevToolDetails.color = + 0.5 > selfTime + ? "primary-light" + : 10 > selfTime + ? "primary" + : 100 > selfTime + ? "primary-dark" + : "error"; + reusableComponentOptions.start = startTime; + reusableComponentOptions.end = endTime; + performance.measure(name, reusableComponentOptions); + } + } function logComponentEffect(fiber, startTime, endTime, selfTime) { fiber = getComponentNameFromFiber(fiber); null !== fiber && @@ -3797,23 +3678,18 @@ (reusableComponentOptions.end = endTime), performance.measure(fiber, reusableComponentOptions)); } - function logRenderPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Render", reusableLaneOptions)); - } - function logSuspendedRenderPhase(startTime, endTime) { + function logSuspendedRenderPhase(startTime, endTime, lanes) { supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Prewarm", reusableLaneOptions)); } - function logSuspendedWithDelayPhase(startTime, endTime) { + function logSuspendedWithDelayPhase(startTime, endTime, lanes) { supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Suspended", reusableLaneOptions)); @@ -3825,27 +3701,6 @@ (reusableLaneOptions.end = endTime), performance.measure("Errored Render", reusableLaneOptions)); } - function logSuspenseThrottlePhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-light"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Throttled", reusableLaneOptions)); - } - function logSuspendedCommitPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-light"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Suspended", reusableLaneOptions)); - } - function logCommitPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-dark"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Commit", reusableLaneOptions)); - } function finishQueueingConcurrentUpdates() { for ( var endIndex = concurrentQueuesIndex, @@ -4161,441 +4016,214 @@ for (var child = fiber.child; child; ) (fiber.actualDuration += child.actualDuration), (child = child.sibling); } - function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; - } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - } - function pushTreeFork(workInProgress, totalChildren) { - warnIfNotHydrating(); - forkStack[forkStackIndex++] = treeForkCount; - forkStack[forkStackIndex++] = treeForkProvider; - treeForkProvider = workInProgress; - treeForkCount = totalChildren; - } - function pushTreeId(workInProgress, totalChildren, index) { - warnIfNotHydrating(); - idStack[idStackIndex++] = treeContextId; - idStack[idStackIndex++] = treeContextOverflow; - idStack[idStackIndex++] = treeContextProvider; - treeContextProvider = workInProgress; - var baseIdWithLeadingBit = treeContextId; - workInProgress = treeContextOverflow; - var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; - baseIdWithLeadingBit &= ~(1 << baseLength); - index += 1; - var length = 32 - clz32(totalChildren) + baseLength; - if (30 < length) { - var numberOfOverflowBits = baseLength - (baseLength % 5); - length = ( - baseIdWithLeadingBit & - ((1 << numberOfOverflowBits) - 1) - ).toString(32); - baseIdWithLeadingBit >>= numberOfOverflowBits; - baseLength -= numberOfOverflowBits; - treeContextId = - (1 << (32 - clz32(totalChildren) + baseLength)) | - (index << baseLength) | - baseIdWithLeadingBit; - treeContextOverflow = length + workInProgress; - } else - (treeContextId = - (1 << length) | (index << baseLength) | baseIdWithLeadingBit), - (treeContextOverflow = workInProgress); - } - function pushMaterializedTreeId(workInProgress) { - warnIfNotHydrating(); - null !== workInProgress.return && - (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); - } - function popTreeContext(workInProgress) { - for (; workInProgress === treeForkProvider; ) - (treeForkProvider = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null), - (treeForkCount = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null); - for (; workInProgress === treeContextProvider; ) - (treeContextProvider = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextOverflow = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextId = idStack[--idStackIndex]), - (idStack[idStackIndex] = null); + function resetContextDependencies() { + lastContextDependency = currentlyRenderingFiber$1 = null; + isDisallowedContextReadInDEV = !1; } - function warnIfNotHydrating() { - isHydrating || + function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue, providerFiber); + context._currentValue = nextValue; + push(rendererCursorDEV, context._currentRenderer, providerFiber); + void 0 !== context._currentRenderer && + null !== context._currentRenderer && + context._currentRenderer !== rendererSigil && console.error( - "Expected to be hydrating. This is a bug in React. Please file an issue." + "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." ); + context._currentRenderer = rendererSigil; } - function buildHydrationDiffNode(fiber, distanceFromLeaf) { - if (null === fiber.return) { - if (null === hydrationDiffRootDEV) - hydrationDiffRootDEV = { - fiber: fiber, - children: [], - serverProps: void 0, - serverTail: [], - distanceFromLeaf: distanceFromLeaf - }; - else { - if (hydrationDiffRootDEV.fiber !== fiber) - throw Error( - "Saw multiple hydration diff roots in a pass. This is a bug in React." - ); - hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf && - (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf); - } - return hydrationDiffRootDEV; + function popProvider(context, providerFiber) { + context._currentValue = valueCursor.current; + var currentRenderer = rendererCursorDEV.current; + pop(rendererCursorDEV, providerFiber); + context._currentRenderer = currentRenderer; + pop(valueCursor, providerFiber); + } + function scheduleContextWorkOnParentPath( + parent, + renderLanes, + propagationRoot + ) { + for (; null !== parent; ) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes + ? ((parent.childLanes |= renderLanes), + null !== alternate && (alternate.childLanes |= renderLanes)) + : null !== alternate && + (alternate.childLanes & renderLanes) !== renderLanes && + (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; } - var siblings = buildHydrationDiffNode( - fiber.return, - distanceFromLeaf + 1 - ).children; - if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber) - return ( - (siblings = siblings[siblings.length - 1]), - siblings.distanceFromLeaf > distanceFromLeaf && - (siblings.distanceFromLeaf = distanceFromLeaf), - siblings + parent !== propagationRoot && + console.error( + "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." ); - distanceFromLeaf = { - fiber: fiber, - children: [], - serverProps: void 0, - serverTail: [], - distanceFromLeaf: distanceFromLeaf - }; - siblings.push(distanceFromLeaf); - return distanceFromLeaf; } - function warnNonHydratedInstance(fiber, rejectedCandidate) { - didSuspendOrErrorDEV || - ((fiber = buildHydrationDiffNode(fiber, 0)), - (fiber.serverProps = null), - null !== rejectedCandidate && - ((rejectedCandidate = - describeHydratableInstanceForDevWarnings(rejectedCandidate)), - fiber.serverTail.push(rejectedCandidate))); - } - function throwOnHydrationMismatch(fiber) { - var diff = "", - diffRoot = hydrationDiffRootDEV; - null !== diffRoot && - ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot))); - queueHydrationError( - createCapturedValueAtFiber( - Error( - "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" + - diff - ), - fiber - ) - ); - throw HydrationMismatchException; - } - function prepareToHydrateHostInstance(fiber) { - var didHydrate = fiber.stateNode; - var type = fiber.type, - props = fiber.memoizedProps; - didHydrate[internalInstanceKey] = fiber; - didHydrate[internalPropsKey] = props; - validatePropertiesInDevelopment(type, props); - switch (type) { - case "dialog": - listenToNonDelegatedEvent("cancel", didHydrate); - listenToNonDelegatedEvent("close", didHydrate); - break; - case "iframe": - case "object": - case "embed": - listenToNonDelegatedEvent("load", didHydrate); - break; - case "video": - case "audio": - for (type = 0; type < mediaEventTypes.length; type++) - listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate); - break; - case "source": - listenToNonDelegatedEvent("error", didHydrate); - break; - case "img": - case "image": - case "link": - listenToNonDelegatedEvent("error", didHydrate); - listenToNonDelegatedEvent("load", didHydrate); - break; - case "details": - listenToNonDelegatedEvent("toggle", didHydrate); - break; - case "input": - checkControlledValueProps("input", props); - listenToNonDelegatedEvent("invalid", didHydrate); - validateInputProps(didHydrate, props); - initInput( - didHydrate, - props.value, - props.defaultValue, - props.checked, - props.defaultChecked, - props.type, - props.name, - !0 + function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree + ) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + for (var i = 0; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; + } + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) + throw Error( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + nextFiber, + renderLanes, + workInProgress ); - track(didHydrate); - break; - case "option": - validateOptionProps(didHydrate, props); - break; - case "select": - checkControlledValueProps("select", props); - listenToNonDelegatedEvent("invalid", didHydrate); - validateSelectProps(didHydrate, props); - break; - case "textarea": - checkControlledValueProps("textarea", props), - listenToNonDelegatedEvent("invalid", didHydrate), - validateTextareaProps(didHydrate, props), - initTextarea( - didHydrate, - props.value, - props.defaultValue, - props.children - ), - track(didHydrate); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; + } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } - type = props.children; - ("string" !== typeof type && - "number" !== typeof type && - "bigint" !== typeof type) || - didHydrate.textContent === "" + type || - !0 === props.suppressHydrationWarning || - checkForUnmatchedText(didHydrate.textContent, type) - ? (null != props.popover && - (listenToNonDelegatedEvent("beforetoggle", didHydrate), - listenToNonDelegatedEvent("toggle", didHydrate)), - null != props.onScroll && - listenToNonDelegatedEvent("scroll", didHydrate), - null != props.onScrollEnd && - listenToNonDelegatedEvent("scrollend", didHydrate), - null != props.onClick && (didHydrate.onclick = noop$1), - (didHydrate = !0)) - : (didHydrate = !1); - didHydrate || throwOnHydrationMismatch(fiber); - } - function popToNextHostParent(fiber) { - for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) - switch (hydrationParentFiber.tag) { - case 3: - case 27: - rootOrSingletonContext = !0; - return; - case 5: - case 13: - rootOrSingletonContext = !1; - return; - default: - hydrationParentFiber = hydrationParentFiber.return; - } } - function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) return !1; - if (!isHydrating) - return popToNextHostParent(fiber), (isHydrating = !0), !1; - var shouldClear = !1, - JSCompiler_temp; - if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { - if ((JSCompiler_temp = 5 === fiber.tag)) - (JSCompiler_temp = fiber.type), - (JSCompiler_temp = - !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || - shouldSetTextContent(fiber.type, fiber.memoizedProps)); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && (shouldClear = !0); - if (shouldClear && nextHydratableInstance) { - for (shouldClear = nextHydratableInstance; shouldClear; ) { - JSCompiler_temp = buildHydrationDiffNode(fiber, 0); - var description = - describeHydratableInstanceForDevWarnings(shouldClear); - JSCompiler_temp.serverTail.push(description); - shouldClear = - "Suspense" === description.type - ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear) - : getNextHydratable(shouldClear.nextSibling); + function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree + ) { + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; + + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current + ? current.push(context) + : (current = [context])); + } + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - throwOnHydrationMismatch(fiber); + parent = parent.return; } - popToNextHostParent(fiber); - if (13 === fiber.tag) { - fiber = fiber.memoizedState; - fiber = null !== fiber ? fiber.dehydrated : null; - if (!fiber) - throw Error( - "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." - ); - nextHydratableInstance = - getNextHydratableInstanceAfterSuspenseInstance(fiber); - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; - } - function resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - didSuspendOrErrorDEV = isHydrating = !1; - } - function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); - } - function emitPendingHydrationWarnings() { - var diffRoot = hydrationDiffRootDEV; - null !== diffRoot && - ((hydrationDiffRootDEV = null), - (diffRoot = describeDiff(diffRoot)), - console.error( - "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s", - "https://react.dev/link/hydration-mismatch", - diffRoot - )); - } - function createThenableState() { - return { didWarnAboutUncachedPromise: !1, thenables: [] }; - } - function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } - function noop$3() {} - function trackUsedThenable(thenableState, thenable, index) { - null !== ReactSharedInternals.actQueue && - (ReactSharedInternals.didUsePromise = !0); - var trackedThenables = thenableState.thenables; - index = trackedThenables[index]; - void 0 === index - ? trackedThenables.push(thenable) - : index !== thenable && - (thenableState.didWarnAboutUncachedPromise || - ((thenableState.didWarnAboutUncachedPromise = !0), - console.error( - "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." - )), - thenable.then(noop$3, noop$3), - (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) - thenable.then(noop$3, noop$3); - else { - thenableState = workInProgressRoot; - if ( - null !== thenableState && - 100 < thenableState.shellSuspendCounter - ) - throw Error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - needsToResetSuspendedThenableDEV = !0; - throw SuspenseException; + function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; } + return !1; } - function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - needsToResetSuspendedThenableDEV = !1; - return thenable; + function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } - function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + function readContext(context) { + isDisallowedContextReadInDEV && + console.error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); + return readContextForConsumer(currentlyRenderingFiber$1, context); } - function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; - } - function retainCache(cache) { - cache.controller.signal.aborted && - console.warn( - "A cache instance was retained after it was already freed. This likely indicates a bug in React." - ); - cache.refCount++; + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } - function releaseCache(cache) { - cache.refCount--; - 0 > cache.refCount && - console.warn( - "A cache instance was released after it was already freed. This likely indicates a bug in React." - ); - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); + function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + throw Error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + lastContextDependency = context; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } function entangleAsyncAction(transition, thenable) { if (null === currentEntangledListeners) { @@ -4654,6378 +4282,6540 @@ ); return thenableWithOverride; } - function pushHiddenContext(fiber, context) { - var prevEntangledRenderLanes = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); - push(currentTreeHiddenStackCursor, context, fiber); - entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; - } - function reuseHiddenContextOnStack(fiber) { - push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); - push( - currentTreeHiddenStackCursor, - currentTreeHiddenStackCursor.current, - fiber - ); - } - function popHiddenContext(fiber) { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor, fiber); - pop(prevEntangledRenderLanesCursor, fiber); - } - function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; + function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; } - function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) - : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); + function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); } - function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; + function createUpdate(lane) { + return { + lane: lane, + tag: UpdateState, + payload: null, + callback: null, + next: null + }; } - function mountHookTypesDev() { - var hookName = currentHookNameInDev; - null === hookTypesDev - ? (hookTypesDev = [hookName]) - : hookTypesDev.push(hookName); - } - function updateHookTypesDev() { - var hookName = currentHookNameInDev; + function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; if ( - null !== hookTypesDev && - (hookTypesUpdateIndexDev++, - hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + currentlyProcessingQueue === updateQueue && + !didWarnUpdateInsideUpdate ) { - var componentName = getComponentNameFromFiber( - currentlyRenderingFiber$1 + var componentName = getComponentNameFromFiber(fiber); + console.error( + "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s", + componentName ); - if ( - !didWarnAboutMismatchedHooksForComponent.has(componentName) && - (didWarnAboutMismatchedHooksForComponent.add(componentName), - null !== hookTypesDev) - ) { - for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { - var oldHookName = hookTypesDev[i], - newHookName = - i === hookTypesUpdateIndexDev ? hookName : oldHookName; - for ( - oldHookName = i + 1 + ". " + oldHookName; - 30 > oldHookName.length; - - ) - oldHookName += " "; - oldHookName += newHookName + "\n"; - table += oldHookName; - } - console.error( - "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - componentName, - table - ); - } + didWarnUpdateInsideUpdate = !0; } - } - function checkDepsAreArrayDev(deps) { - void 0 === deps || - null === deps || - isArrayImpl(deps) || - console.error( - "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", - currentHookNameInDev, - typeof deps + if ((executionContext & RenderContext) !== NoContext) + return ( + (componentName = updateQueue.pending), + null === componentName + ? (update.next = update) + : ((update.next = componentName.next), + (componentName.next = update)), + (updateQueue.pending = update), + (update = getRootForUpdatedFiber(fiber)), + markUpdateLaneFromFiberToRoot(fiber, null, lane), + update ); + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); } - function warnOnUseFormStateInDev() { - var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); - didWarnAboutUseFormState.has(componentName) || - (didWarnAboutUseFormState.add(componentName), - console.error( - "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", - componentName - )); + function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } } - function throwInvalidHookError() { - throw Error( - "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." - ); + function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( + null !== current && + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; + } + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; } - function areHookInputsEqual(nextDeps, prevDeps) { - if (ignorePreviousDependencies) return !1; - if (null === prevDeps) - return ( - console.error( - "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", - currentHookNameInDev - ), - !1 - ); - nextDeps.length !== prevDeps.length && - console.error( - "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", - currentHookNameInDev, - "[" + prevDeps.join(", ") + "]", - "[" + nextDeps.join(", ") + "]" - ); - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; + function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } } - function renderWithHooks( - current, + function processUpdateQueue( workInProgress, - Component, props, - secondArg, - nextRenderLanes + instance$jscomp$0, + renderLanes ) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; - hookTypesDev = null !== current ? current._debugHookTypes : null; - hookTypesUpdateIndexDev = -1; - ignorePreviousDependencies = - null !== current && current.type !== workInProgress.type; - if ( - "[object AsyncFunction]" === - Object.prototype.toString.call(Component) || - "[object AsyncGeneratorFunction]" === - Object.prototype.toString.call(Component) - ) - (nextRenderLanes = getComponentNameFromFiber( - currentlyRenderingFiber$1 - )), - didWarnAboutAsyncClientComponent.has(nextRenderLanes) || - (didWarnAboutAsyncClientComponent.add(nextRenderLanes), - console.error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - )); - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null !== current && null !== current.memoizedState - ? HooksDispatcherOnUpdateInDEV - : null !== hookTypesDev - ? HooksDispatcherOnMountWithHookTypesInDEV - : HooksDispatcherOnMountInDEV; - shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = - (workInProgress.mode & StrictLegacyMode) !== NoMode; - var children = callComponentInDEV(Component, props, secondArg); - shouldDoubleInvokeUserFnsInHooksDEV = !1; - didScheduleRenderPhaseUpdateDuringThisPass && - (children = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - )); - if (nextRenderLanes) { - setIsStrictModeForDevtools(!0); - try { - children = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - ); - } finally { - setIsStrictModeForDevtools(!1); - } + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress.updateQueue; + hasForceUpdate = !1; + currentlyProcessingQueue = queue.shared; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress.alternate; + null !== current && + ((current = current.updateQueue), + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); } - finishRenderingHooks(current, workInProgress); - return children; - } - function finishRenderingHooks(current, workInProgress) { - workInProgress._debugHookTypes = hookTypesDev; - null === workInProgress.dependencies - ? null !== thenableState$1 && - (workInProgress.dependencies = { - lanes: 0, - firstContext: null, - _debugThenableState: thenableState$1 - }) - : (workInProgress.dependencies._debugThenableState = thenableState$1); - ReactSharedInternals.H = ContextOnlyDispatcher; - var didRenderTooFewHooks = - null !== currentHook && null !== currentHook.next; - renderLanes = 0; - hookTypesDev = - currentHookNameInDev = - workInProgressHook = - currentHook = - currentlyRenderingFiber$1 = - null; - hookTypesUpdateIndexDev = -1; - null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && - console.error( - "Internal React error: Expected static flag was missing. Please notify the React team." - ); - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter$1 = 0; - thenableState$1 = null; - if (didRenderTooFewHooks) + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; + do { + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; + if ( + isHiddenUpdate + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + updateLane = workInProgress; + var partialState = pendingQueue; + var nextProps = props, + instance = instance$jscomp$0; + switch (partialState.tag) { + case ReplaceState: + partialState = partialState.payload; + if ("function" === typeof partialState) { + isDisallowedContextReadInDEV = !0; + var nextState = partialState.call( + instance, + newState, + nextProps + ); + if (updateLane.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState.call(instance, newState, nextProps); + } finally { + setIsStrictModeForDevtools(!1); + } + } + isDisallowedContextReadInDEV = !1; + newState = nextState; + break a; + } + newState = partialState; + break a; + case CaptureUpdate: + updateLane.flags = (updateLane.flags & -65537) | 128; + case UpdateState: + nextState = partialState.payload; + if ("function" === typeof nextState) { + isDisallowedContextReadInDEV = !0; + partialState = nextState.call( + instance, + newState, + nextProps + ); + if (updateLane.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + nextState.call(instance, newState, nextProps); + } finally { + setIsStrictModeForDevtools(!1); + } + } + isDisallowedContextReadInDEV = !1; + } else partialState = nextState; + if (null === partialState || void 0 === partialState) break a; + newState = assign({}, newState, partialState); + break a; + case ForceUpdate: + hasForceUpdate = !0; + } + } + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress.flags |= 64), + isHiddenUpdate && (workInProgress.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); + } else + (isHiddenUpdate = { + lane: updateLane, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, + next: null + }), + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress.lanes = lastBaseUpdate; + workInProgress.memoizedState = newState; + } + currentlyProcessingQueue = null; + } + function callCallback(callback, context) { + if ("function" !== typeof callback) throw Error( - "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." + "Invalid argument passed as callback. Expected a function. Instead received: " + + callback ); - null === current || - didReceiveUpdate || - ((current = current.dependencies), - null !== current && - checkIfContextChanged(current) && - (didReceiveUpdate = !0)); - needsToResetSuspendedThenableDEV - ? ((needsToResetSuspendedThenableDEV = !1), (current = !0)) - : (current = !1); - current && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Unknown"), - didWarnAboutUseWrappedInTryCatch.has(workInProgress) || - didWarnAboutAsyncClientComponent.has(workInProgress) || - (didWarnAboutUseWrappedInTryCatch.add(workInProgress), - console.error( - "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary." - ))); + callback.call(context); } - function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); - thenableIndexCounter$1 = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (numberOfReRenders >= RE_RENDER_LIMIT) - throw Error( - "Too many re-renders. React limits the number of renders to prevent an infinite loop." - ); - numberOfReRenders += 1; - ignorePreviousDependencies = !1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); - } - hookTypesUpdateIndexDev = -1; - ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; - children = callComponentInDEV(Component, props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); } - function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== - dispatcher && (currentlyRenderingFiber$1.flags |= 1024); - return maybeThenable; + function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } - function checkDidRenderIdHook() { - var didRenderIdHook = 0 !== localIdCounter; - localIdCounter = 0; - return didRenderIdHook; + function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; } - function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags = - (workInProgress.mode & StrictEffectsMode) !== NoMode - ? workInProgress.flags & -201328645 - : workInProgress.flags & -2053; - current.lanes &= ~lanes; + function retainCache(cache) { + cache.controller.signal.aborted && + console.warn( + "A cache instance was retained after it was already freed. This likely indicates a bug in React." + ); + cache.refCount++; } - function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { - for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; - } - didScheduleRenderPhaseUpdate = !1; - } - renderLanes = 0; - hookTypesDev = - workInProgressHook = - currentHook = - currentlyRenderingFiber$1 = - null; - hookTypesUpdateIndexDev = -1; - currentHookNameInDev = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter$1 = localIdCounter = 0; - thenableState$1 = null; - } - function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; - } - function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) - throw Error( - "Update hook called on initial render. This is likely a bug in React. Please file an issue." - ); - throw Error("Rendered more hooks than during the previous render."); - } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; - } - function useThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = createThenableState()); - thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null !== index && null !== index.memoizedState - ? HooksDispatcherOnUpdateInDEV - : HooksDispatcherOnMountInDEV)); - return thenable; + function releaseCache(cache) { + cache.refCount--; + 0 > cache.refCount && + console.warn( + "A cache instance was released after it was already freed. This likely indicates a bug in React." + ); + 0 === cache.refCount && + scheduleCallback$1(NormalPriority, function () { + cache.controller.abort(); + }); } - function use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } - throw Error("An unsupported type was passed to use(): " + String(usable)); } - function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; - null !== current && - ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); + } } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue || ignorePreviousDependencies) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), - current = 0; - current < size; - current++ - ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - else - updateQueue.length !== size && + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), console.error( - "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.", - updateQueue.length, - size - ); - memoCache.index++; - return updateQueue; - } - function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function mountReducer(reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { - init(initialArg); + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); } finally { setIsStrictModeForDevtools(!1); } } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber$1, - reducer - ); - return [hook.memoizedState, reducer]; - } - function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); - } - function updateReducerImpl(hook, current, reducer) { - var queue = hook.queue; - if (null === queue) - throw Error( - "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" - ); - queue.lastRenderedReducer = reducer; - var baseQueue = hook.baseQueue, - pendingQueue = queue.pending; - if (null !== pendingQueue) { - if (null !== baseQueue) { - var baseFirst = baseQueue.next; - baseQueue.next = pendingQueue.next; - pendingQueue.next = baseFirst; - } - current.baseQueue !== baseQueue && + void 0 === oldProps && console.error( - "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React." + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" ); - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; + return oldProps; } - pendingQueue = hook.baseState; - if (null === baseQueue) hook.memoizedState = pendingQueue; - else { - current = baseQueue.next; - var newBaseQueueFirst = (baseFirst = null), - newBaseQueueLast = null, - update = current, - didReadFromEntangledAsyncAction = !1; - do { - var updateLane = update.lane & -536870913; - if ( - updateLane !== update.lane - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - var revertLane = update.revertLane; - if (0 === revertLane) - null !== newBaseQueueLast && - (newBaseQueueLast = newBaseQueueLast.next = - { - lane: 0, - revertLane: 0, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - else if ((renderLanes & revertLane) === revertLane) { - update = update.next; - revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - continue; - } else - (updateLane = { - lane: 0, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); - } else - (revertLane = { - lane: updateLane, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); - if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction && - ((reducer = currentEntangledActionThenable), null !== reducer)) - ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; - } - null === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) - throw Error( - "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" - ); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do - (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + console.error( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error( - "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." - ); - var nextSnapshot = getServerSnapshot(); - didWarnUncachedGetSnapshot || - nextSnapshot === getServerSnapshot() || - (console.error( - "The result of getServerSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0)); - } else { - nextSnapshot = getSnapshot(); - didWarnUncachedGetSnapshot || - ((getServerSnapshot = getSnapshot()), - objectIs(nextSnapshot, getServerSnapshot) || - (console.error( - "The result of getSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0))); - if (null === workInProgressRoot) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } - hook.memoizedState = nextSnapshot; - getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; - hook.queue = getServerSnapshot; - mountEffect( - subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe), - [subscribe] - ); - fiber.flags |= 2048; - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - getServerSnapshot, - nextSnapshot, - getSnapshot - ), - null - ); - return nextSnapshot; - } - function updateSyncExternalStore( - subscribe, - getSnapshot, - getServerSnapshot - ) { - var fiber = currentlyRenderingFiber$1, - hook = updateWorkInProgressHook(), - isHydrating$jscomp$0 = isHydrating; - if (isHydrating$jscomp$0) { - if (void 0 === getServerSnapshot) - throw Error( - "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." - ); - getServerSnapshot = getServerSnapshot(); - } else if ( - ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot) - ) { - var cachedSnapshot = getSnapshot(); - objectIs(getServerSnapshot, cachedSnapshot) || - (console.error( - "The result of getSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0)); + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); } - if ( - (cachedSnapshot = !objectIs( - (currentHook || hook).memoizedState, - getServerSnapshot - )) - ) - (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); - hook = hook.queue; - var create = subscribeToStore.bind(null, fiber, hook, subscribe); - updateEffectImpl(2048, Passive, create, [subscribe]); - if ( - hook.getSnapshot !== getSnapshot || - cachedSnapshot || - (null !== workInProgressHook && - workInProgressHook.memoizedState.tag & HasEffect) - ) { - fiber.flags |= 2048; - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - hook, - getServerSnapshot, - getSnapshot - ), - null - ); - if (null === workInProgressRoot) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + return newProps; + } + function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + CapturedStacks.set(value, source); + return source; } - return getServerSnapshot; + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } - function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); + function pushTreeFork(workInProgress, totalChildren) { + warnIfNotHydrating(); + forkStack[forkStackIndex++] = treeForkCount; + forkStack[forkStackIndex++] = treeForkProvider; + treeForkProvider = workInProgress; + treeForkCount = totalChildren; } - function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + function pushTreeId(workInProgress, totalChildren, index) { + warnIfNotHydrating(); + idStack[idStackIndex++] = treeContextId; + idStack[idStackIndex++] = treeContextOverflow; + idStack[idStackIndex++] = treeContextProvider; + treeContextProvider = workInProgress; + var baseIdWithLeadingBit = treeContextId; + workInProgress = treeContextOverflow; + var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; + baseIdWithLeadingBit &= ~(1 << baseLength); + index += 1; + var length = 32 - clz32(totalChildren) + baseLength; + if (30 < length) { + var numberOfOverflowBits = baseLength - (baseLength % 5); + length = ( + baseIdWithLeadingBit & + ((1 << numberOfOverflowBits) - 1) + ).toString(32); + baseIdWithLeadingBit >>= numberOfOverflowBits; + baseLength -= numberOfOverflowBits; + treeContextId = + (1 << (32 - clz32(totalChildren) + baseLength)) | + (index << baseLength) | + baseIdWithLeadingBit; + treeContextOverflow = length + workInProgress; + } else + (treeContextId = + (1 << length) | (index << baseLength) | baseIdWithLeadingBit), + (treeContextOverflow = workInProgress); } - function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); - }); + function pushMaterializedTreeId(workInProgress) { + warnIfNotHydrating(); + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); } - function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - inst = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(inst, nextValue); - } catch (error) { - return !0; - } + function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider; ) + (treeForkProvider = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null), + (treeForkCount = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null); + for (; workInProgress === treeContextProvider; ) + (treeContextProvider = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextOverflow = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextId = idStack[--idStackIndex]), + (idStack[idStackIndex] = null); } - function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); + function warnIfNotHydrating() { + isHydrating || + console.error( + "Expected to be hydrating. This is a bug in React. Please file an issue." + ); } - function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - initialStateInitializer(); - } finally { - setIsStrictModeForDevtools(!1); - } + function buildHydrationDiffNode(fiber, distanceFromLeaf) { + if (null === fiber.return) { + if (null === hydrationDiffRootDEV) + hydrationDiffRootDEV = { + fiber: fiber, + children: [], + serverProps: void 0, + serverTail: [], + distanceFromLeaf: distanceFromLeaf + }; + else { + if (hydrationDiffRootDEV.fiber !== fiber) + throw Error( + "Saw multiple hydration diff roots in a pass. This is a bug in React." + ); + hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf && + (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf); } + return hydrationDiffRootDEV; } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState - }; - return hook; - } - function mountState(initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - queue + var siblings = buildHydrationDiffNode( + fiber.return, + distanceFromLeaf + 1 + ).children; + if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber) + return ( + (siblings = siblings[siblings.length - 1]), + siblings.distanceFromLeaf > distanceFromLeaf && + (siblings.distanceFromLeaf = distanceFromLeaf), + siblings ); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - } - function mountOptimistic(passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null + distanceFromLeaf = { + fiber: fiber, + children: [], + serverProps: void 0, + serverTail: [], + distanceFromLeaf: distanceFromLeaf }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; + siblings.push(distanceFromLeaf); + return distanceFromLeaf; } - function updateOptimistic(passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + function warnNonHydratedInstance(fiber, rejectedCandidate) { + didSuspendOrErrorDEV || + ((fiber = buildHydrationDiffNode(fiber, 0)), + (fiber.serverProps = null), + null !== rejectedCandidate && + ((rejectedCandidate = + describeHydratableInstanceForDevWarnings(rejectedCandidate)), + fiber.serverTail.push(rejectedCandidate))); } - function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer + function throwOnHydrationMismatch(fiber) { + var diff = "", + diffRoot = hydrationDiffRootDEV; + null !== diffRoot && + ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot))); + queueHydrationError( + createCapturedValueAtFiber( + Error( + "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" + + diff + ), + fiber + ) ); + throw HydrationMismatchException; } - function rerenderOptimistic(passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; - } - function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload - ) { - if (isRenderPhaseUpdate(fiber)) - throw Error("Cannot update form state while rendering."); - fiber = actionQueue.action; - if (null !== fiber) { - var actionNode = { - payload: payload, - action: fiber, - next: null, - isTransition: !0, - status: "pending", - value: null, - reason: null, - listeners: [], - then: function (listener) { - actionNode.listeners.push(listener); - } - }; - null !== ReactSharedInternals.T - ? setPendingState(!0) - : (actionNode.isTransition = !1); - setState(actionNode); - setPendingState = actionQueue.pending; - null === setPendingState - ? ((actionNode.next = actionQueue.pending = actionNode), - runActionStateAction(actionQueue, actionNode)) - : ((actionNode.next = setPendingState.next), - (actionQueue.pending = setPendingState.next = actionNode)); - } - } - function runActionStateAction(actionQueue, node) { - var action = node.action, - payload = node.payload, - prevState = actionQueue.state; - if (node.isTransition) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - ReactSharedInternals.T._updatedFibers = new Set(); - try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error) { - onActionError(actionQueue, node, error); - } finally { - (ReactSharedInternals.T = prevTransition), - null === prevTransition && - currentTransition._updatedFibers && - ((actionQueue = currentTransition._updatedFibers.size), - currentTransition._updatedFibers.clear(), - 10 < actionQueue && - console.warn( - "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." - )); + function prepareToHydrateHostInstance(fiber) { + var didHydrate = fiber.stateNode; + var type = fiber.type, + props = fiber.memoizedProps; + didHydrate[internalInstanceKey] = fiber; + didHydrate[internalPropsKey] = props; + validatePropertiesInDevelopment(type, props); + switch (type) { + case "dialog": + listenToNonDelegatedEvent("cancel", didHydrate); + listenToNonDelegatedEvent("close", didHydrate); + break; + case "iframe": + case "object": + case "embed": + listenToNonDelegatedEvent("load", didHydrate); + break; + case "video": + case "audio": + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate); + break; + case "source": + listenToNonDelegatedEvent("error", didHydrate); + break; + case "img": + case "image": + case "link": + listenToNonDelegatedEvent("error", didHydrate); + listenToNonDelegatedEvent("load", didHydrate); + break; + case "details": + listenToNonDelegatedEvent("toggle", didHydrate); + break; + case "input": + checkControlledValueProps("input", props); + listenToNonDelegatedEvent("invalid", didHydrate); + validateInputProps(didHydrate, props); + initInput( + didHydrate, + props.value, + props.defaultValue, + props.checked, + props.defaultChecked, + props.type, + props.name, + !0 + ); + track(didHydrate); + break; + case "option": + validateOptionProps(didHydrate, props); + break; + case "select": + checkControlledValueProps("select", props); + listenToNonDelegatedEvent("invalid", didHydrate); + validateSelectProps(didHydrate, props); + break; + case "textarea": + checkControlledValueProps("textarea", props), + listenToNonDelegatedEvent("invalid", didHydrate), + validateTextareaProps(didHydrate, props), + initTextarea( + didHydrate, + props.value, + props.defaultValue, + props.children + ), + track(didHydrate); + } + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + didHydrate.textContent === "" + type || + !0 === props.suppressHydrationWarning || + checkForUnmatchedText(didHydrate.textContent, type) + ? (null != props.popover && + (listenToNonDelegatedEvent("beforetoggle", didHydrate), + listenToNonDelegatedEvent("toggle", didHydrate)), + null != props.onScroll && + listenToNonDelegatedEvent("scroll", didHydrate), + null != props.onScrollEnd && + listenToNonDelegatedEvent("scrollend", didHydrate), + null != props.onClick && (didHydrate.onclick = noop$1), + (didHydrate = !0)) + : (didHydrate = !1); + didHydrate || throwOnHydrationMismatch(fiber); + } + function popToNextHostParent(fiber) { + for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) + switch (hydrationParentFiber.tag) { + case 3: + case 27: + rootOrSingletonContext = !0; + return; + case 5: + case 13: + rootOrSingletonContext = !1; + return; + default: + hydrationParentFiber = hydrationParentFiber.return; } - } else - try { - (currentTransition = action(prevState, payload)), - handleActionReturnValue(actionQueue, node, currentTransition); - } catch (error$3) { - onActionError(actionQueue, node, error$3); + } + function popHydrationState(fiber) { + if (fiber !== hydrationParentFiber) return !1; + if (!isHydrating) + return popToNextHostParent(fiber), (isHydrating = !0), !1; + var shouldClear = !1, + JSCompiler_temp; + if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { + if ((JSCompiler_temp = 5 === fiber.tag)) + (JSCompiler_temp = fiber.type), + (JSCompiler_temp = + !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || + shouldSetTextContent(fiber.type, fiber.memoizedProps)); + JSCompiler_temp = !JSCompiler_temp; + } + JSCompiler_temp && (shouldClear = !0); + if (shouldClear && nextHydratableInstance) { + for (shouldClear = nextHydratableInstance; shouldClear; ) { + JSCompiler_temp = buildHydrationDiffNode(fiber, 0); + var description = + describeHydratableInstanceForDevWarnings(shouldClear); + JSCompiler_temp.serverTail.push(description); + shouldClear = + "Suspense" === description.type + ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear) + : getNextHydratable(shouldClear.nextSibling); } + throwOnHydrationMismatch(fiber); + } + popToNextHostParent(fiber); + if (13 === fiber.tag) { + fiber = fiber.memoizedState; + fiber = null !== fiber ? fiber.dehydrated : null; + if (!fiber) + throw Error( + "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." + ); + nextHydratableInstance = + getNextHydratableInstanceAfterSuspenseInstance(fiber); + } else + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; } - function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ), - node.isTransition || - console.error( - "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`" - )) - : onActionSuccess(actionQueue, node, returnValue); + function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + didSuspendOrErrorDEV = isHydrating = !1; } - function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); + function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); } - function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); - } - actionQueue.action = null; + function emitPendingHydrationWarnings() { + var diffRoot = hydrationDiffRootDEV; + null !== diffRoot && + ((hydrationDiffRootDEV = null), + (diffRoot = describeDiff(diffRoot)), + console.error( + "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s", + "https://react.dev/link/hydration-mismatch", + diffRoot + )); } - function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); + function createThenableState() { + return { didWarnAboutUncachedPromise: !1, thenables: [] }; } - function actionStateReducer(oldState, newState) { - return newState; + function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; } - function mountActionState(action, initialStateProp) { - if (isHydrating) { - var ssrFormState = workInProgressRoot.formState; - if (null !== ssrFormState) { - a: { - var isMatching = currentlyRenderingFiber$1; - if (isHydrating) { - if (nextHydratableInstance) { - b: { - var markerInstance = nextHydratableInstance; - for ( - var inRootOrSingleton = rootOrSingletonContext; - 8 !== markerInstance.nodeType; - - ) { - if (!inRootOrSingleton) { - markerInstance = null; - break b; - } - markerInstance = getNextHydratable( - markerInstance.nextSibling - ); - if (null === markerInstance) { - markerInstance = null; - break b; - } - } - inRootOrSingleton = markerInstance.data; - markerInstance = - inRootOrSingleton === FORM_STATE_IS_MATCHING || - inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING - ? markerInstance - : null; + function noop$3() {} + function trackUsedThenable(thenableState, thenable, index) { + null !== ReactSharedInternals.actQueue && + (ReactSharedInternals.didUsePromise = !0); + var trackedThenables = thenableState.thenables; + index = trackedThenables[index]; + void 0 === index + ? trackedThenables.push(thenable) + : index !== thenable && + (thenableState.didWarnAboutUncachedPromise || + ((thenableState.didWarnAboutUncachedPromise = !0), + console.error( + "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." + )), + thenable.then(noop$3, noop$3), + (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) + thenable.then(noop$3, noop$3); + else { + thenableState = workInProgressRoot; + if ( + null !== thenableState && + 100 < thenableState.shellSuspendCounter + ) + throw Error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; } - if (markerInstance) { - nextHydratableInstance = getNextHydratable( - markerInstance.nextSibling - ); - isMatching = markerInstance.data === FORM_STATE_IS_MATCHING; - break a; + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; } } - throwOnHydrationMismatch(isMatching); - } - isMatching = !1; + ); } - isMatching && (initialStateProp = ssrFormState[0]); - } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + needsToResetSuspendedThenableDEV = !0; + throw SuspenseException; } - ssrFormState = mountWorkInProgressHook(); - ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; - isMatching = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - ssrFormState.queue = isMatching; - ssrFormState = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - isMatching - ); - isMatching.dispatch = ssrFormState; - isMatching = mountStateImpl(!1); - inRootOrSingleton = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !1, - isMatching.queue - ); - isMatching = mountWorkInProgressHook(); - markerInstance = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - isMatching.queue = markerInstance; - ssrFormState = dispatchActionState.bind( - null, - currentlyRenderingFiber$1, - markerInstance, - inRootOrSingleton, - ssrFormState - ); - markerInstance.dispatch = ssrFormState; - isMatching.memoizedState = action; - return [initialStateProp, ssrFormState, !1]; } - function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); + function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + needsToResetSuspendedThenableDEV = !1; + return thenable; } - function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; + function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; - } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; - } - function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); } - function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; + function pushHiddenContext(fiber, context) { + var prevEntangledRenderLanes = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); + push(currentTreeHiddenStackCursor, context, fiber); + entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; } - function pushSimpleEffect(tag, inst, create, deps) { - tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; - inst = currentlyRenderingFiber$1.updateQueue; - null === inst && - ((inst = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = inst)); - create = inst.lastEffect; - null === create - ? (inst.lastEffect = tag.next = tag) - : ((deps = create.next), - (create.next = tag), - (tag.next = deps), - (inst.lastEffect = tag)); - return tag; + function reuseHiddenContextOnStack(fiber) { + push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); + push( + currentTreeHiddenStackCursor, + currentTreeHiddenStackCursor.current, + fiber + ); } - function createEffectInstance() { - return { destroy: void 0, resource: void 0 }; + function popHiddenContext(fiber) { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor, fiber); + pop(prevEntangledRenderLanesCursor, fiber); } - function mountRef(initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); + function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - HasEffect | hookFlags, - createEffectInstance(), - create, - deps - ); + function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) + : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); } - function updateEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var inst = hook.memoizedState.inst; - null !== currentHook && - null !== deps && - areHookInputsEqual(deps, currentHook.memoizedState.deps) - ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - HasEffect | hookFlags, - inst, - create, - deps - ))); + function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } - function mountEffect(create, deps) { - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (currentlyRenderingFiber$1.mode & NoStrictPassiveEffectsMode) === NoMode - ? mountEffectImpl(142608384, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); + function mountHookTypesDev() { + var hookName = currentHookNameInDev; + null === hookTypesDev + ? (hookTypesDev = [hookName]) + : hookTypesDev.push(hookName); } - function useEffectEventImpl(payload) { - currentlyRenderingFiber$1.flags |= 4; - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; - if (null === componentUpdateQueue) - (componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue), - (componentUpdateQueue.events = [payload]); - else { - var events = componentUpdateQueue.events; - null === events - ? (componentUpdateQueue.events = [payload]) - : events.push(payload); - } - } - function mountEvent(callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if ((executionContext & RenderContext) !== NoContext) - throw Error( - "A function wrapped in useEffectEvent can't be called during rendering." - ); - return ref.impl.apply(void 0, arguments); - }; - } - function updateEvent(callback) { - var ref = updateWorkInProgressHook().memoizedState; - useEffectEventImpl({ ref: ref, nextImpl: callback }); - return function () { - if ((executionContext & RenderContext) !== NoContext) - throw Error( - "A function wrapped in useEffectEvent can't be called during rendering." + function updateHookTypesDev() { + var hookName = currentHookNameInDev; + if ( + null !== hookTypesDev && + (hookTypesUpdateIndexDev++, + hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + ) { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); + if ( + !didWarnAboutMismatchedHooksForComponent.has(componentName) && + (didWarnAboutMismatchedHooksForComponent.add(componentName), + null !== hookTypesDev) + ) { + for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { + var oldHookName = hookTypesDev[i], + newHookName = + i === hookTypesUpdateIndexDev ? hookName : oldHookName; + for ( + oldHookName = i + 1 + ". " + oldHookName; + 30 > oldHookName.length; + + ) + oldHookName += " "; + oldHookName += newHookName + "\n"; + table += oldHookName; + } + console.error( + "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + componentName, + table ); - return ref.impl.apply(void 0, arguments); - }; - } - function mountLayoutEffect(create, deps) { - var fiberFlags = 4194308; - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (fiberFlags |= 67108864); - return mountEffectImpl(fiberFlags, Layout, create, deps); - } - function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; + } } - if (null !== ref && void 0 !== ref) - return ( - ref.hasOwnProperty("current") || - console.error( - "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", - "an object with keys {" + Object.keys(ref).join(", ") + "}" - ), - (create = create()), - (ref.current = create), - function () { - ref.current = null; - } - ); } - function mountImperativeHandle(ref, create, deps) { - "function" !== typeof create && + function checkDepsAreArrayDev(deps) { + void 0 === deps || + null === deps || + isArrayImpl(deps) || console.error( - "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", - null !== create ? typeof create : "null" + "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", + currentHookNameInDev, + typeof deps ); - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - var fiberFlags = 4194308; - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (fiberFlags |= 67108864); - mountEffectImpl( - fiberFlags, - Layout, - imperativeHandleEffect.bind(null, create, ref), - deps - ); } - function updateImperativeHandle(ref, create, deps) { - "function" !== typeof create && + function warnOnUseFormStateInDev() { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); + didWarnAboutUseFormState.has(componentName) || + (didWarnAboutUseFormState.add(componentName), console.error( - "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", - null !== create ? typeof create : "null" - ); - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - updateEffectImpl( - 4, - Layout, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - } - function mountCallback(callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; + "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", + componentName + )); } - function updateCallback(callback, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - hook.memoizedState = [callback, deps]; - return callback; + function throwInvalidHookError() { + throw Error( + "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." + ); } - function mountMemo(nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; + function areHookInputsEqual(nextDeps, prevDeps) { + if (ignorePreviousDependencies) return !1; + if (null === prevDeps) + return ( + console.error( + "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", + currentHookNameInDev + ), + !1 + ); + nextDeps.length !== prevDeps.length && + console.error( + "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", + currentHookNameInDev, + "[" + prevDeps.join(", ") + "]", + "[" + nextDeps.join(", ") + "]" + ); + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) + if (!objectIs(nextDeps[i], prevDeps[i])) return !1; + return !0; } - function updateMemo(nextCreate, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - prevState = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { + function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes + ) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + hookTypesDev = null !== current ? current._debugHookTypes : null; + hookTypesUpdateIndexDev = -1; + ignorePreviousDependencies = + null !== current && current.type !== workInProgress.type; + if ( + "[object AsyncFunction]" === + Object.prototype.toString.call(Component) || + "[object AsyncGeneratorFunction]" === + Object.prototype.toString.call(Component) + ) + (nextRenderLanes = getComponentNameFromFiber(currentlyRenderingFiber)), + didWarnAboutAsyncClientComponent.has(nextRenderLanes) || + (didWarnAboutAsyncClientComponent.add(nextRenderLanes), + console.error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + )); + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null !== current && null !== current.memoizedState + ? HooksDispatcherOnUpdateInDEV + : null !== hookTypesDev + ? HooksDispatcherOnMountWithHookTypesInDEV + : HooksDispatcherOnMountInDEV; + shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = + (workInProgress.mode & StrictLegacyMode) !== NoMode; + var children = callComponentInDEV(Component, props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + if (nextRenderLanes) { setIsStrictModeForDevtools(!0); try { - nextCreate(); + children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + ); } finally { setIsStrictModeForDevtools(!1); } } - hook.memoizedState = [prevState, deps]; - return prevState; - } - function mountDeferredValue(value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - } - function updateDeferredValue(value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); + finishRenderingHooks(current, workInProgress); + return children; } - function rerenderDeferredValue(value, initialValue) { - var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue + function finishRenderingHooks(current, workInProgress) { + workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState$1 && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState$1 + }) + : (workInProgress.dependencies._debugThenableState = thenableState$1); + ReactSharedInternals.H = ContextOnlyDispatcher; + var didRenderTooFewHooks = + null !== currentHook && null !== currentHook.next; + renderLanes = 0; + hookTypesDev = + currentHookNameInDev = + workInProgressHook = + currentHook = + currentlyRenderingFiber = + null; + hookTypesUpdateIndexDev = -1; + null !== current && + (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + console.error( + "Internal React error: Expected static flag was missing. Please notify the React team." + ); + didScheduleRenderPhaseUpdate = !1; + thenableIndexCounter$1 = 0; + thenableState$1 = null; + if (didRenderTooFewHooks) + throw Error( + "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." + ); + null === current || + didReceiveUpdate || + ((current = current.dependencies), + null !== current && + checkIfContextChanged(current) && + (didReceiveUpdate = !0)); + needsToResetSuspendedThenableDEV + ? ((needsToResetSuspendedThenableDEV = !1), (current = !0)) + : (current = !1); + current && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Unknown"), + didWarnAboutUseWrappedInTryCatch.has(workInProgress) || + didWarnAboutAsyncClientComponent.has(workInProgress) || + (didWarnAboutUseWrappedInTryCatch.add(workInProgress), + console.error( + "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary." + ))); + } + function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = workInProgress; + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); + thenableIndexCounter$1 = 0; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + if (numberOfReRenders >= RE_RENDER_LIMIT) + throw Error( + "Too many re-renders. React limits the number of renders to prevent an infinite loop." ); + numberOfReRenders += 1; + ignorePreviousDependencies = !1; + workInProgressHook = currentHook = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } + hookTypesUpdateIndexDev = -1; + ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; + children = callComponentInDEV(Component, props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; } - function mountDeferredValueImpl(hook, value, initialValue) { - if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; + function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== + dispatcher && (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; } - function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook - ); - if (0 === (renderLanes & 42)) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; + function checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; } - function startTransition( - fiber, - queue, - pendingState, - finishedState, - callback - ) { - var previousPriority = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = - 0 !== previousPriority && previousPriority < ContinuousEventPriority - ? previousPriority - : ContinuousEventPriority; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - currentTransition._updatedFibers = new Set(); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then + function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags = + (workInProgress.mode & StrictEffectsMode) !== NoMode + ? workInProgress.flags & -201328645 + : workInProgress.flags & -2053; + current.lanes &= ~lanes; + } + function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + ) { - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) - ); - } catch (error) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane(fiber) - ); - } finally { - (ReactDOMSharedInternals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - null === prevTransition && - currentTransition._updatedFibers && - ((fiber = currentTransition._updatedFibers.size), - currentTransition._updatedFibers.clear(), - 10 < fiber && - console.warn( - "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." - )); + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; + } + didScheduleRenderPhaseUpdate = !1; } + renderLanes = 0; + hookTypesDev = + workInProgressHook = + currentHook = + currentlyRenderingFiber = + null; + hookTypesUpdateIndexDev = -1; + currentHookNameInDev = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; } - function startHostTransition(formFiber, pendingState, action, formData) { - if (5 !== formFiber.tag) - throw Error( - "Expected the form instance to be a HostComponent. This is a bug in React." - ); - var queue = ensureFormComponentIsStateful(formFiber).queue; - startTransition( - formFiber, - queue, - pendingState, - NotPendingTransition, - null === action - ? noop$2 - : function () { - requestFormReset$1(formFiber); - return action(formData); - } - ); - } - function ensureFormComponentIsStateful(formFiber) { - var existingStateHook = formFiber.memoizedState; - if (null !== existingStateHook) return existingStateHook; - existingStateHook = { - memoizedState: NotPendingTransition, - baseState: NotPendingTransition, + function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: NotPendingTransition - }, + queue: null, next: null }; - var initialResetState = {}; - existingStateHook.next = { - memoizedState: initialResetState, - baseState: initialResetState, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, - next: null - }; - formFiber.memoizedState = existingStateHook; - formFiber = formFiber.alternate; - null !== formFiber && (formFiber.memoizedState = existingStateHook); - return existingStateHook; - } - function requestFormReset$1(formFiber) { - null === ReactSharedInternals.T && - console.error( - "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." - ); - var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetStateInternal( - formFiber, - resetStateQueue, - {}, - requestUpdateLane(formFiber) - ); + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; } - function mountTransition() { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber$1, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; + function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); + else { + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) + throw Error( + "Update hook called on initial render. This is likely a bug in React. Please file an issue." + ); + throw Error("Rendered more hooks than during the previous render."); + } + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); + } + return workInProgressHook; } - function updateTransition() { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; + function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } - function rerenderTransition() { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; + function useThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = createThenableState()); + thenable = trackUsedThenable(thenableState$1, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null !== index && null !== index.memoizedState + ? HooksDispatcherOnUpdateInDEV + : HooksDispatcherOnMountInDEV)); + return thenable; } - function useHostTransitionStatus() { - return readContext(HostTransitionContext); + function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); + } + throw Error("An unsupported type was passed to use(): " + String(usable)); } - function mountId() { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var treeId = treeContextOverflow; - var idWithLeadingBit = treeContextId; - treeId = - ( - idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) - ).toString(32) + treeId; - identifierPrefix = ":" + identifierPrefix + "R" + treeId; - treeId = localIdCounter++; - 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); - identifierPrefix += ":"; - } else - (treeId = globalClientIdCounter++), - (identifierPrefix = - ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); - return (hook.memoizedState = identifierPrefix); + function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue || ignorePreviousDependencies) + for ( + updateQueue = memoCache.data[memoCache.index] = Array(size), + current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + else + updateQueue.length !== size && + console.error( + "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.", + updateQueue.length, + size + ); + memoCache.index++; + return updateQueue; } - function mountRefresh() { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber$1 - )); + function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; } - function refreshCache(fiber, seedKey, seedValue) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(provider); - fiber = createUpdate(lane); - var root = enqueueUpdate(provider, fiber, lane); - null !== root && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(root, provider, lane), - entangleTransitions(root, provider, lane)); - provider = createCache(); - null !== seedKey && - void 0 !== seedKey && - null !== root && - provider.data.set(seedKey, seedValue); - fiber.payload = { cache: provider }; - return; + function mountReducer(reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } } - provider = provider.return; - } - } - function dispatchReducerAction( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p0 && - console.error( - "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." - ); - JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber); - action = { - lane: JSCompiler_OptimizeArgumentsArray_p0, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - )), - null !== action && - (startUpdateTimerByLane(JSCompiler_OptimizeArgumentsArray_p0), - scheduleUpdateOnFiber( - action, - fiber, - JSCompiler_OptimizeArgumentsArray_p0 - ), - entangleTransitionUpdate( - action, - queue, - JSCompiler_OptimizeArgumentsArray_p0 - ))); + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; } - function dispatchSetState( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p1 && - console.error( - "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." - ); - JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber); - dispatchSetStateInternal( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ) && startUpdateTimerByLane(JSCompiler_OptimizeArgumentsArray_p1); + function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); } - function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); - else { - var alternate = fiber.alternate; - if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) - ) { - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV; - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) - return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && - finishQueueingConcurrentUpdates(), - !1 - ); - } catch (error) { - } finally { - ReactSharedInternals.H = prevDispatcher; - } + function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) + throw Error( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" + ); + queue.lastRenderedReducer = reducer; + var baseQueue = hook.baseQueue, + pendingQueue = queue.pending; + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) - return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 + current.baseQueue !== baseQueue && + console.error( + "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React." ); + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; } - return !1; + pendingQueue = hook.baseState; + if (null === baseQueue) hook.memoizedState = pendingQueue; + else { + current = baseQueue.next; + var newBaseQueueFirst = (baseFirst = null), + newBaseQueueLast = null, + update = current, + didReadFromEntangledAsyncAction = !1; + do { + var updateLane = update.lane & -536870913; + if ( + updateLane !== update.lane + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + var revertLane = update.revertLane; + if (0 === revertLane) + null !== newBaseQueueLast && + (newBaseQueueLast = newBaseQueueLast.next = + { + lane: 0, + revertLane: 0, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + else if ((renderLanes & revertLane) === revertLane) { + update = update.next; + revertLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + continue; + } else + (updateLane = { + lane: 0, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); + if ( + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction && + ((reducer = currentEntangledActionThenable), null !== reducer)) + ) + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; + } + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; } - function dispatchOptimisticSetState( - fiber, - throwIfDuringRender, - queue, - action - ) { - null === ReactSharedInternals.T && - 0 === currentEntangledLane && - console.error( - "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." + function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) + throw Error( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" ); - action = { - lane: 2, - revertLane: requestTransitionLane(), - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) { - if (throwIfDuringRender) - throw Error("Cannot update optimistic state while rendering."); - console.error("Cannot call startTransition while rendering."); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - (startUpdateTimerByLane(2), - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); - } - function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) - ); - } - function enqueueRenderPhaseUpdate(queue, update) { - didScheduleRenderPhaseUpdateDuringThisPass = - didScheduleRenderPhaseUpdate = !0; - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; - } - function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { - var queueLanes = queue.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - queue.lanes = lane; - markRootEntangled(root, lane); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do + (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; } + return [newState, dispatch]; } - function pushDebugInfo(debugInfo) { - var previousDebugInfo = currentDebugInfo; - null != debugInfo && - (currentDebugInfo = - null === previousDebugInfo - ? debugInfo - : previousDebugInfo.concat(debugInfo)); - return previousDebugInfo; - } - function validateFragmentProps(element, fiber, returnFiber) { - for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) { - var key = keys[i]; - if ("children" !== key && "key" !== key) { - null === fiber && - ((fiber = createFiberFromElement(element, returnFiber.mode, 0)), - (fiber._debugInfo = currentDebugInfo), - (fiber.return = returnFiber)); - runWithFiberInDEV( - fiber, - function (erroredKey) { - console.error( - "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", - erroredKey - ); - }, - key + function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." ); - break; - } - } - } - function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = createThenableState()); - return trackUsedThenable(thenableState, thenable, index); - } - function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; + var nextSnapshot = getServerSnapshot(); + didWarnUncachedGetSnapshot || + nextSnapshot === getServerSnapshot() || + (console.error( + "The result of getServerSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } else { + nextSnapshot = getSnapshot(); + didWarnUncachedGetSnapshot || + ((getServerSnapshot = getSnapshot()), + objectIs(nextSnapshot, getServerSnapshot) || + (console.error( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0))); + if (null === workInProgressRoot) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + } + hook.memoizedState = nextSnapshot; + getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; + hook.queue = getServerSnapshot; + mountEffect( + subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe), + [subscribe] + ); + fiber.flags |= 2048; + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + getServerSnapshot, + nextSnapshot, + getSnapshot + ), + null + ); + return nextSnapshot; } - function throwOnInvalidObjectType(returnFiber, newChild) { - if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) - throw Error( - 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.' + function updateSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot + ) { + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(), + isHydrating$jscomp$0 = isHydrating; + if (isHydrating$jscomp$0) { + if (void 0 === getServerSnapshot) + throw Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." + ); + getServerSnapshot = getServerSnapshot(); + } else if ( + ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot) + ) { + var cachedSnapshot = getSnapshot(); + objectIs(getServerSnapshot, cachedSnapshot) || + (console.error( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } + if ( + (cachedSnapshot = !objectIs( + (currentHook || hook).memoizedState, + getServerSnapshot + )) + ) + (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); + hook = hook.queue; + var create = subscribeToStore.bind(null, fiber, hook, subscribe); + updateEffectImpl(2048, Passive, create, [subscribe]); + if ( + hook.getSnapshot !== getSnapshot || + cachedSnapshot || + (null !== workInProgressHook && + workInProgressHook.memoizedState.tag & HasEffect) + ) { + fiber.flags |= 2048; + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + hook, + getServerSnapshot, + getSnapshot + ), + null ); - returnFiber = Object.prototype.toString.call(newChild); - throw Error( - "Objects are not valid as a React child (found: " + - ("[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber) + - "). If you meant to render a collection of children, use an array instead." - ); + if (null === workInProgressRoot) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + return getServerSnapshot; } - function warnOnFunctionType(returnFiber, invalidChild) { - var parentName = getComponentNameFromFiber(returnFiber) || "Component"; - ownerHasFunctionTypeWarning[parentName] || - ((ownerHasFunctionTypeWarning[parentName] = !0), - (invalidChild = - invalidChild.displayName || invalidChild.name || "Component"), - 3 === returnFiber.tag - ? console.error( - "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)", - invalidChild, - invalidChild, - invalidChild - ) - : console.error( - "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}", - invalidChild, - invalidChild, - parentName, - invalidChild, - parentName - )); + function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); } - function warnOnSymbolType(returnFiber, invalidChild) { - var parentName = getComponentNameFromFiber(returnFiber) || "Component"; - ownerHasSymbolTypeWarning[parentName] || - ((ownerHasSymbolTypeWarning[parentName] = !0), - (invalidChild = String(invalidChild)), - 3 === returnFiber.tag - ? console.error( - "Symbols are not valid as a React child.\n root.render(%s)", - invalidChild - ) - : console.error( - "Symbols are not valid as a React child.\n <%s>%s", - parentName, - invalidChild, - parentName - )); + function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); } - function createChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (shouldTrackSideEffects) { - var deletions = returnFiber.deletions; - null === deletions - ? ((returnFiber.deletions = [childToDelete]), - (returnFiber.flags |= 16)) - : deletions.push(childToDelete); - } - } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; - } - function mapRemainingChildren(currentFirstChild) { - for (var existingChildren = new Map(); null !== currentFirstChild; ) - null !== currentFirstChild.key - ? existingChildren.set(currentFirstChild.key, currentFirstChild) - : existingChildren.set(currentFirstChild.index, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return existingChildren; - } - function useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; - } - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) - return (newFiber.flags |= 1048576), lastPlacedIndex; - newIndex = newFiber.alternate; - if (null !== newIndex) - return ( - (newIndex = newIndex.index), - newIndex < lastPlacedIndex - ? ((newFiber.flags |= 33554434), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 33554434; - return lastPlacedIndex; + function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); + } + function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; + } + function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); + } + function mountStateImpl(initialState) { + var hook = mountWorkInProgressHook(); + if ("function" === typeof initialState) { + var initialStateInitializer = initialState; + initialState = initialStateInitializer(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText( - textContent, - returnFiber.mode, - lanes - )), - (current.return = returnFiber), - (current._debugOwner = returnFiber), - (current._debugTask = returnFiber._debugTask), - (current._debugInfo = currentDebugInfo), - current - ); - current = useFiber(current, textContent); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; - } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return ( - (current = updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key - )), - validateFragmentProps(element, current, returnFiber), - current - ); - if ( - null !== current && - (current.elementType === elementType || - isCompatibleFamilyForHotReloading(current, element) || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - callLazyInitInDEV(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - (current._debugOwner = element._owner), - (current._debugInfo = currentDebugInfo), - current - ); - current = createFiberFromElement(element, returnFiber.mode, lanes); - coerceRef(current, element); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; - } - function updatePortal(returnFiber, current, portal, lanes) { - if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - (current._debugInfo = currentDebugInfo), - current - ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + hook.memoizedState = hook.baseState = initialState; + hook.queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + return hook; + } + function mountState(initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + } + function mountOptimistic(passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + } + function updateOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + } + function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer + ); + } + function rerenderOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + } + function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload + ) { + if (isRenderPhaseUpdate(fiber)) + throw Error("Cannot update form state while rendering."); + fiber = actionQueue.action; + if (null !== fiber) { + var actionNode = { + payload: payload, + action: fiber, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); + setPendingState = actionQueue.pending; + null === setPendingState + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = setPendingState.next), + (actionQueue.pending = setPendingState.next = actionNode)); } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - (current._debugOwner = returnFiber), - (current._debugTask = returnFiber._debugTask), - (current._debugInfo = currentDebugInfo), - current - ); - current = useFiber(current, fragment); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + } + function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + ReactSharedInternals.T._updatedFibers = new Set(); + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + (ReactSharedInternals.T = prevTransition), + null === prevTransition && + currentTransition._updatedFibers && + ((actionQueue = currentTransition._updatedFibers.size), + currentTransition._updatedFibers.clear(), + 10 < actionQueue && + console.warn( + "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." + )); + } + } else + try { + (currentTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, currentTransition); + } catch (error$3) { + onActionError(actionQueue, node, error$3); + } + } + function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? (returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ), + node.isTransition || + console.error( + "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`" + )) + : onActionSuccess(actionQueue, node, returnValue); + } + function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); + } + function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); } - function createChild(returnFiber, newChild, lanes) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - (newChild._debugOwner = returnFiber), - (newChild._debugTask = returnFiber._debugTask), - (newChild._debugInfo = currentDebugInfo), - newChild - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (lanes = createFiberFromElement( - newChild, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = pushDebugInfo(newChild._debugInfo)), - (lanes._debugInfo = currentDebugInfo), - (currentDebugInfo = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - (newChild._debugInfo = currentDebugInfo), - newChild - ); - case REACT_LAZY_TYPE: - var _prevDebugInfo = pushDebugInfo(newChild._debugInfo); - newChild = callLazyInitInDEV(newChild); - returnFiber = createChild(returnFiber, newChild, lanes); - currentDebugInfo = _prevDebugInfo; - return returnFiber; - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (lanes = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - (lanes._debugTask = returnFiber._debugTask), - (returnFiber = pushDebugInfo(newChild._debugInfo)), - (lanes._debugInfo = currentDebugInfo), - (currentDebugInfo = returnFiber), - lanes - ); - if ("function" === typeof newChild.then) - return ( - (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = createChild( - returnFiber, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = _prevDebugInfo), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; - } - function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = null !== oldFiber ? oldFiber.key : null; - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return null !== key - ? null - : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return newChild.key === key - ? ((key = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateElement( - returnFiber, - oldFiber, - newChild, - lanes - )), - (currentDebugInfo = key), - returnFiber) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (key = pushDebugInfo(newChild._debugInfo)), - (newChild = callLazyInitInDEV(newChild)), - (returnFiber = updateSlot( - returnFiber, - oldFiber, - newChild, - lanes - )), - (currentDebugInfo = key), - returnFiber - ); - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) { - if (null !== key) return null; - key = pushDebugInfo(newChild._debugInfo); - returnFiber = updateFragment( - returnFiber, - oldFiber, - newChild, - lanes, - null - ); - currentDebugInfo = key; - return returnFiber; + actionQueue.action = null; + } + function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); + } + function actionStateReducer(oldState, newState) { + return newState; + } + function mountActionState(action, initialStateProp) { + if (isHydrating) { + var ssrFormState = workInProgressRoot.formState; + if (null !== ssrFormState) { + a: { + var isMatching = currentlyRenderingFiber; + if (isHydrating) { + if (nextHydratableInstance) { + b: { + var markerInstance = nextHydratableInstance; + for ( + var inRootOrSingleton = rootOrSingletonContext; + 8 !== markerInstance.nodeType; + + ) { + if (!inRootOrSingleton) { + markerInstance = null; + break b; + } + markerInstance = getNextHydratable( + markerInstance.nextSibling + ); + if (null === markerInstance) { + markerInstance = null; + break b; + } + } + inRootOrSingleton = markerInstance.data; + markerInstance = + inRootOrSingleton === FORM_STATE_IS_MATCHING || + inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING + ? markerInstance + : null; + } + if (markerInstance) { + nextHydratableInstance = getNextHydratable( + markerInstance.nextSibling + ); + isMatching = markerInstance.data === FORM_STATE_IS_MATCHING; + break a; + } + } + throwOnHydrationMismatch(isMatching); + } + isMatching = !1; } - if ("function" === typeof newChild.then) - return ( - (key = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = key), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); + isMatching && (initialStateProp = ssrFormState[0]); } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; } - function updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (newIdx = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - (existingChildren = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateElement( - returnFiber, - newIdx, - newChild, - lanes - )), - (currentDebugInfo = existingChildren), - returnFiber - ); - case REACT_PORTAL_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updatePortal(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_LAZY_TYPE: - var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo); - newChild = callLazyInitInDEV(newChild); - returnFiber = updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ); - currentDebugInfo = _prevDebugInfo7; - return returnFiber; - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (newIdx = existingChildren.get(newIdx) || null), - (existingChildren = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateFragment( - returnFiber, - newIdx, - newChild, - lanes, - null - )), - (currentDebugInfo = existingChildren), - returnFiber - ); - if ("function" === typeof newChild.then) - return ( - (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = _prevDebugInfo7), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; - } - function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) { - if ("object" !== typeof child || null === child) return knownKeys; - switch (child.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: - warnForMissingKey(returnFiber, workInProgress, child); - var key = child.key; - if ("string" !== typeof key) break; - if (null === knownKeys) { - knownKeys = new Set(); - knownKeys.add(key); - break; - } - if (!knownKeys.has(key)) { - knownKeys.add(key); - break; - } - runWithFiberInDEV(workInProgress, function () { - console.error( - "Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", - key - ); - }); - break; - case REACT_LAZY_TYPE: - (child = callLazyInitInDEV(child)), - warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); + ssrFormState = mountWorkInProgressHook(); + ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; + isMatching = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + ssrFormState.queue = isMatching; + ssrFormState = dispatchSetState.bind( + null, + currentlyRenderingFiber, + isMatching + ); + isMatching.dispatch = ssrFormState; + isMatching = mountStateImpl(!1); + inRootOrSingleton = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + isMatching.queue + ); + isMatching = mountWorkInProgressHook(); + markerInstance = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null + }; + isMatching.queue = markerInstance; + ssrFormState = dispatchActionState.bind( + null, + currentlyRenderingFiber, + markerInstance, + inRootOrSingleton, + ssrFormState + ); + markerInstance.dispatch = ssrFormState; + isMatching.memoizedState = action; + return [initialStateProp, ssrFormState, !1]; + } + function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); + } + function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; } - return knownKeys; + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; + } + function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; + } + function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; + } + function pushSimpleEffect(tag, inst, create, deps) { + tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; + inst = currentlyRenderingFiber.updateQueue; + null === inst && + ((inst = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = inst)); + create = inst.lastEffect; + null === create + ? (inst.lastEffect = tag.next = tag) + : ((deps = create.next), + (create.next = tag), + (tag.next = deps), + (inst.lastEffect = tag)); + return tag; + } + function createEffectInstance() { + return { destroy: void 0, resource: void 0 }; + } + function mountRef(initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + } + function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + HasEffect | hookFlags, + createEffectInstance(), + create, + deps + ); + } + function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var inst = hook.memoizedState.inst; + null !== currentHook && + null !== deps && + areHookInputsEqual(deps, currentHook.memoizedState.deps) + ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + HasEffect | hookFlags, + inst, + create, + deps + ))); + } + function mountEffect(create, deps) { + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode + ? mountEffectImpl(142608384, Passive, create, deps) + : mountEffectImpl(8390656, Passive, create, deps); + } + function useEffectEventImpl(payload) { + currentlyRenderingFiber.flags |= 4; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + if (null === componentUpdateQueue) + (componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = componentUpdateQueue), + (componentUpdateQueue.events = [payload]); + else { + var events = componentUpdateQueue.events; + null === events + ? (componentUpdateQueue.events = [payload]) + : events.push(payload); } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - for ( - var knownKeys = null, - resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null; - null !== oldFiber && newIdx < newChildren.length; - newIdx++ - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot( - returnFiber, - oldFiber, - newChildren[newIdx], - lanes - ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - knownKeys = warnOnInvalidKey( - returnFiber, - newFiber, - newChildren[newIdx], - knownKeys + } + function mountEvent(callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if ((executionContext & RenderContext) !== NoContext) + throw Error( + "A function wrapped in useEffectEvent can't be called during rendering." ); - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (newIdx === newChildren.length) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + return ref.impl.apply(void 0, arguments); + }; + } + function updateEvent(callback) { + var ref = updateWorkInProgressHook().memoizedState; + useEffectEventImpl({ ref: ref, nextImpl: callback }); + return function () { + if ((executionContext & RenderContext) !== NoContext) + throw Error( + "A function wrapped in useEffectEvent can't be called during rendering." ); - if (null === oldFiber) { - for (; newIdx < newChildren.length; newIdx++) - (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), - null !== oldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - oldFiber, - newChildren[newIdx], - knownKeys - )), - (currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - newIdx < newChildren.length; - newIdx++ - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - newChildren[newIdx], - lanes - )), - null !== nextOldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - nextOldFiber, - newChildren[newIdx], - knownKeys - )), - shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + return ref.impl.apply(void 0, arguments); + }; + } + function mountLayoutEffect(create, deps) { + var fiberFlags = 4194308; + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); + return mountEffectImpl(fiberFlags, Layout, create, deps); + } + function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; } - function reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChildrenIterable, - lanes - ) { - var newChildren = newChildrenIterable[ASYNC_ITERATOR](); - newChildren !== newChildrenIterable || - (0 === returnFiber.tag && - "[object AsyncGeneratorFunction]" === - Object.prototype.toString.call(returnFiber.type) && - "[object AsyncGenerator]" === - Object.prototype.toString.call(newChildren)) || - (didWarnAboutGenerators || + if (null !== ref && void 0 !== ref) + return ( + ref.hasOwnProperty("current") || console.error( - "Using AsyncIterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You can use an AsyncIterable that can iterate multiple times over the same items." + "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", + "an object with keys {" + Object.keys(ref).join(", ") + "}" ), - (didWarnAboutGenerators = !0)); - if (null == newChildren) - throw Error("An iterable object provided no iterator."); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - { - next: function () { - return unwrapThenable(newChildren.next()); - } - }, - lanes + (create = create()), + (ref.current = create), + function () { + ref.current = null; + } + ); + } + function mountImperativeHandle(ref, create, deps) { + "function" !== typeof create && + console.error( + "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", + null !== create ? typeof create : "null" + ); + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + var fiberFlags = 4194308; + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); + mountEffectImpl( + fiberFlags, + Layout, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + } + function updateImperativeHandle(ref, create, deps) { + "function" !== typeof create && + console.error( + "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", + null !== create ? typeof create : "null" ); + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl( + 4, + Layout, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + } + function mountCallback(callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + } + function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; + } + function mountMemo(nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - if (null == newChildren) - throw Error("An iterable object provided no iterator."); - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null, - knownKeys = null, - step = newChildren.next(); - null !== oldFiber && !step.done; - newIdx++, step = newChildren.next() - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - knownKeys = warnOnInvalidKey( - returnFiber, - newFiber, - step.value, - knownKeys - ); - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; + hook.memoizedState = [nextValue, deps]; + return nextValue; + } + function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); } - if (step.done) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + } + hook.memoizedState = [prevState, deps]; + return prevState; + } + function mountDeferredValue(value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + } + function updateDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + } + function rerenderDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(); + return null === currentHook + ? mountDeferredValueImpl(hook, value, initialValue) + : updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue ); - if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildren.next()) - (oldFiber = createChild(returnFiber, step.value, lanes)), - null !== oldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - oldFiber, - step.value, - knownKeys - )), - (currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - step.value, - lanes - )), - null !== nextOldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - nextOldFiber, - step.value, - knownKeys - )), - shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + } + function mountDeferredValueImpl(hook, value, initialValue) { + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; + } + function updateDeferredValueImpl(hook, prevValue, value, initialValue) { + if (objectIs(value, prevValue)) return value; + if (null !== currentTreeHiddenStackCursor.current) + return ( + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook + ); + if (0 === (renderLanes & 42)) + return (didReceiveUpdate = !0), (hook.memoizedState = value); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; + } + function startTransition( + fiber, + queue, + pendingState, + finishedState, + callback + ) { + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = + 0 !== previousPriority && previousPriority < ContinuousEventPriority + ? previousPriority + : ContinuousEventPriority; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); + currentTransition._updatedFibers = new Set(); + try { + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + if ( + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState + ); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane(fiber) + ); + } finally { + (ReactDOMSharedInternals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + null === prevTransition && + currentTransition._updatedFibers && + ((fiber = currentTransition._updatedFibers.size), + currentTransition._updatedFibers.clear(), + 10 < fiber && + console.warn( + "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." + )); } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - (validateFragmentProps(newChild, null, returnFiber), - (newChild = newChild.props.children)); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - var prevDebugInfo = pushDebugInfo(newChild._debugInfo); - a: { - for (var key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) { - key = newChild.type; - if (key === REACT_FRAGMENT_TYPE) { - if (7 === currentFirstChild.tag) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - newChild.props.children - ); - lanes.return = returnFiber; - lanes._debugOwner = newChild._owner; - lanes._debugInfo = currentDebugInfo; - validateFragmentProps(newChild, lanes, returnFiber); - returnFiber = lanes; - break a; - } - } else if ( - currentFirstChild.elementType === key || - isCompatibleFamilyForHotReloading( - currentFirstChild, - newChild - ) || - ("object" === typeof key && - null !== key && - key.$$typeof === REACT_LAZY_TYPE && - callLazyInitInDEV(key) === currentFirstChild.type) - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.props); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - lanes._debugOwner = newChild._owner; - lanes._debugInfo = currentDebugInfo; - returnFiber = lanes; - break a; - } - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - newChild.type === REACT_FRAGMENT_TYPE - ? ((lanes = createFiberFromFragment( - newChild.props.children, - returnFiber.mode, - lanes, - newChild.key - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - (lanes._debugTask = returnFiber._debugTask), - (lanes._debugInfo = currentDebugInfo), - validateFragmentProps(newChild, lanes, returnFiber), - (returnFiber = lanes)) - : ((lanes = createFiberFromElement( - newChild, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (lanes._debugInfo = currentDebugInfo), - (returnFiber = lanes)); - } - returnFiber = placeSingleChild(returnFiber); - currentDebugInfo = prevDebugInfo; - return returnFiber; - case REACT_PORTAL_TYPE: - a: { - prevDebugInfo = newChild; - for ( - newChild = prevDebugInfo.key; - null !== currentFirstChild; - - ) { - if (currentFirstChild.key === newChild) - if ( - 4 === currentFirstChild.tag && - currentFirstChild.stateNode.containerInfo === - prevDebugInfo.containerInfo && - currentFirstChild.stateNode.implementation === - prevDebugInfo.implementation - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - prevDebugInfo.children || [] - ); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } else { - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - lanes = createFiberFromPortal( - prevDebugInfo, - returnFiber.mode, - lanes - ); - lanes.return = returnFiber; - returnFiber = lanes; - } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (newChild = callLazyInitInDEV(newChild)), - (returnFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - } - if (isArrayImpl(newChild)) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if (getIteratorFn(newChild)) { - prevDebugInfo = pushDebugInfo(newChild._debugInfo); - key = getIteratorFn(newChild); - if ("function" !== typeof key) - throw Error( - "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." - ); - var newChildren = key.call(newChild); - if (newChildren === newChild) { - if ( - 0 !== returnFiber.tag || - "[object GeneratorFunction]" !== - Object.prototype.toString.call(returnFiber.type) || - "[object Generator]" !== - Object.prototype.toString.call(newChildren) - ) - didWarnAboutGenerators || - console.error( - "Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items." - ), - (didWarnAboutGenerators = !0); - } else - newChild.entries !== key || - didWarnAboutMaps || - (console.error( - "Using Maps as children is not supported. Use an array of keyed ReactElements instead." - ), - (didWarnAboutMaps = !0)); - returnFiber = reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ); - currentDebugInfo = prevDebugInfo; - return returnFiber; - } - if ("function" === typeof newChild[ASYNC_ITERATOR]) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if ("function" === typeof newChild.then) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (prevDebugInfo = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ), - (lanes = useFiber(currentFirstChild, prevDebugInfo)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText( - prevDebugInfo, - returnFiber.mode, - lanes - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - (lanes._debugTask = returnFiber._debugTask), - (lanes._debugInfo = currentDebugInfo), - (returnFiber = lanes)), - placeSingleChild(returnFiber) - ); - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return deleteRemainingChildren(returnFiber, currentFirstChild); - } - return function (returnFiber, currentFirstChild, newChild, lanes) { - var prevDebugInfo = currentDebugInfo; - currentDebugInfo = null; - try { - thenableIndexCounter = 0; - var firstChildFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - thenableState = null; - return firstChildFiber; - } catch (x) { - if (x === SuspenseException || x === SuspenseActionException) throw x; - var fiber = createFiber(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - var debugInfo = (fiber._debugInfo = currentDebugInfo); - fiber._debugOwner = returnFiber._debugOwner; - fiber._debugTask = returnFiber._debugTask; - if (null != debugInfo) - for (var i = debugInfo.length - 1; 0 <= i; i--) - if ("string" === typeof debugInfo[i].stack) { - fiber._debugOwner = debugInfo[i]; - fiber._debugTask = debugInfo[i].debugTask; - break; - } - return fiber; - } finally { - currentDebugInfo = prevDebugInfo; - } - }; - } - function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push( - suspenseStackCursor, - suspenseStackCursor.current & SubtreeSuspenseContextMask, - handler - ); - push(suspenseHandlerStackCursor, handler, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); - } - function pushOffscreenSuspenseHandler(fiber) { - if (22 === fiber.tag) { - if ( - (push(suspenseStackCursor, suspenseStackCursor.current, fiber), - push(suspenseHandlerStackCursor, fiber, fiber), - null === shellBoundary) - ) { - var current = fiber.alternate; - null !== current && - null !== current.memoizedState && - (shellBoundary = fiber); - } - } else reuseSuspenseHandlerOnStack(fiber); - } - function reuseSuspenseHandlerOnStack(fiber) { - push(suspenseStackCursor, suspenseStackCursor.current, fiber); - push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, - fiber - ); - } - function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor, fiber); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor, fiber); - } - function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - ((state = state.dehydrated), - null === state || - state.data === SUSPENSE_PENDING_START_DATA || - isSuspenseInstanceFallback(state)) - ) - return node; - } else if ( - 19 === node.tag && - void 0 !== node.memoizedProps.revealOrder - ) { - if (0 !== (node.flags & 128)) return node; - } else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; - } - if (node === row) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === row) return null; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; - } - return null; - } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); - } - } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); - } - } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - console.error( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); - } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext - ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - } finally { - setIsStrictModeForDevtools(!1); - } - } - void 0 === oldProps && - console.error( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" - ); - return oldProps; - } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; - } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext - ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - console.error( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( - instance, - instance.state, - null - )); - } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); - } - return newProps; - } - function defaultOnUncaughtError(error) { - reportGlobalError(error); - console.warn( - "%s\n\n%s\n", - componentName - ? "An error occurred in the <" + componentName + "> component." - : "An error occurred in one of your React components.", - "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." - ); - } - function defaultOnCaughtError(error) { - var componentNameMessage = componentName - ? "The above error occurred in the <" + componentName + "> component." - : "The above error occurred in one of your React components.", - recreateMessage = - "React will try to recreate this component tree from scratch using the error boundary you provided, " + - ((errorBoundaryName || "Anonymous") + "."); - if ( - "object" === typeof error && - null !== error && - "string" === typeof error.environmentName - ) { - var JSCompiler_inline_result = error.environmentName; - error = [ - "%o\n\n%s\n\n%s\n", - error, - componentNameMessage, - recreateMessage - ].slice(0); - "string" === typeof error[0] - ? error.splice( - 0, - 1, - badgeFormat + error[0], - badgeStyle, - pad + JSCompiler_inline_result + pad, - resetStyle - ) - : error.splice( - 0, - 0, - badgeFormat, - badgeStyle, - pad + JSCompiler_inline_result + pad, - resetStyle - ); - error.unshift(console); - JSCompiler_inline_result = bind.apply(console.error, error); - JSCompiler_inline_result(); - } else - console.error( - "%o\n\n%s\n\n%s\n", - error, - componentNameMessage, - recreateMessage - ); - } - function defaultOnRecoverableError(error) { - reportGlobalError(error); - } - function logUncaughtError(root, errorInfo) { - try { - componentName = errorInfo.source - ? getComponentNameFromFiber(errorInfo.source) - : null; - errorBoundaryName = null; - var error = errorInfo.value; - if (null !== ReactSharedInternals.actQueue) - ReactSharedInternals.thrownErrors.push(error); - else { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(error, { componentStack: errorInfo.stack }); - } - } catch (e$4) { - setTimeout(function () { - throw e$4; - }); - } - } - function logCaughtError(root, boundary, errorInfo) { - try { - componentName = errorInfo.source - ? getComponentNameFromFiber(errorInfo.source) - : null; - errorBoundaryName = getComponentNameFromFiber(boundary); - var onCaughtError = root.onCaughtError; - onCaughtError(errorInfo.value, { - componentStack: errorInfo.stack, - errorBoundary: 1 === boundary.tag ? boundary.stateNode : null - }); - } catch (e$5) { - setTimeout(function () { - throw e$5; - }); - } - } - function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - lane.payload = { element: null }; - lane.callback = function () { - runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); - }; - return lane; - } - function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - return lane; - } - function initializeClassErrorUpdate(update, root, fiber, errorInfo) { - var getDerivedStateFromError = fiber.type.getDerivedStateFromError; - if ("function" === typeof getDerivedStateFromError) { - var error = errorInfo.value; - update.payload = function () { - return getDerivedStateFromError(error); - }; - update.callback = function () { - markFailedErrorBoundaryForHotReloading(fiber); - runWithFiberInDEV( - errorInfo.source, - logCaughtError, - root, - fiber, - errorInfo - ); - }; - } - var inst = fiber.stateNode; - null !== inst && - "function" === typeof inst.componentDidCatch && - (update.callback = function () { - markFailedErrorBoundaryForHotReloading(fiber); - runWithFiberInDEV( - errorInfo.source, - logCaughtError, - root, - fiber, - errorInfo - ); - "function" !== typeof getDerivedStateFromError && - (null === legacyErrorBoundariesThatAlreadyFailed - ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) - : legacyErrorBoundariesThatAlreadyFailed.add(this)); - callComponentDidCatchInDEV(this, errorInfo); - "function" === typeof getDerivedStateFromError || - (0 === (fiber.lanes & 2) && - console.error( - "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", - getComponentNameFromFiber(fiber) || "Unknown" - )); - }); } - function resetSuspendedComponent(sourceFiber, rootRenderLanes) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 + function startHostTransition(formFiber, pendingState, action, formData) { + if (5 !== formFiber.tag) + throw Error( + "Expected the form instance to be a HostComponent. This is a bug in React." ); + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + NotPendingTransition, + null === action + ? noop$2 + : function () { + requestFormReset$1(formFiber); + return action(formData); + } + ); } - function markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ) { - suspenseBoundary.flags |= 65536; - suspenseBoundary.lanes = rootRenderLanes; - return suspenseBoundary; - } - function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes - ) { - sourceFiber.flags |= 32768; - isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); - if ( - null !== value && - "object" === typeof value && - (value.$$typeof === REACT_POSTPONE_TYPE && - (value = { then: function () {} }), - "function" === typeof value.then) - ) { - resetSuspendedComponent(sourceFiber, rootRenderLanes); - isHydrating && (didSuspendOrErrorDEV = !0); - var suspenseBoundary = suspenseHandlerStackCursor.current; - if (null !== suspenseBoundary) { - switch (suspenseBoundary.tag) { - case 13: - return ( - null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === suspenseBoundary.alternate && - workInProgressRootExitStatus === RootInProgress && - (workInProgressRootExitStatus = RootSuspended), - (suspenseBoundary.flags &= -257), - markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value === noopSuspenseyCommitThenable - ? (suspenseBoundary.flags |= 16384) - : ((sourceFiber = suspenseBoundary.updateQueue), - null === sourceFiber - ? (suspenseBoundary.updateQueue = new Set([value])) - : sourceFiber.add(value), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - case 22: - return ( - (suspenseBoundary.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (suspenseBoundary.flags |= 16384) - : ((sourceFiber = suspenseBoundary.updateQueue), - null === sourceFiber - ? ((sourceFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (suspenseBoundary.updateQueue = sourceFiber)) - : ((returnFiber = sourceFiber.retryQueue), - null === returnFiber - ? (sourceFiber.retryQueue = new Set([value])) - : returnFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - } - throw Error( - "Unexpected Suspense handler tag (" + - suspenseBoundary.tag + - "). This is a bug in React." - ); - } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; - } - if (isHydrating) - return ( - (didSuspendOrErrorDEV = !0), - (suspenseBoundary = suspenseHandlerStackCursor.current), - null !== suspenseBoundary - ? (0 === (suspenseBoundary.flags & 65536) && - (suspenseBoundary.flags |= 256), - markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value !== HydrationMismatchException && - queueHydrationError( - createCapturedValueAtFiber( - Error( - "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.", - { cause: value } - ), - sourceFiber - ) - )) - : (value !== HydrationMismatchException && - queueHydrationError( - createCapturedValueAtFiber( - Error( - "There was an error while hydrating but React was able to recover by instead client rendering the entire root.", - { cause: value } - ), - sourceFiber - ) - ), - (root = root.current.alternate), - (root.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (root.lanes |= rootRenderLanes), - (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), - (rootRenderLanes = createRootErrorUpdate( - root.stateNode, - sourceFiber, - rootRenderLanes - )), - enqueueCapturedUpdate(root, rootRenderLanes), - workInProgressRootExitStatus !== RootSuspendedWithDelay && - (workInProgressRootExitStatus = RootErrored)), - !1 + function ensureFormComponentIsStateful(formFiber) { + var existingStateHook = formFiber.memoizedState; + if (null !== existingStateHook) return existingStateHook; + existingStateHook = { + memoizedState: NotPendingTransition, + baseState: NotPendingTransition, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: NotPendingTransition + }, + next: null + }; + var initialResetState = {}; + existingStateHook.next = { + memoizedState: initialResetState, + baseState: initialResetState, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialResetState + }, + next: null + }; + formFiber.memoizedState = existingStateHook; + formFiber = formFiber.alternate; + null !== formFiber && (formFiber.memoizedState = existingStateHook); + return existingStateHook; + } + function requestFormReset$1(formFiber) { + null === ReactSharedInternals.T && + console.error( + "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." ); - queueConcurrentError( - createCapturedValueAtFiber( - Error( - "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", - { cause: value } - ), - sourceFiber - ) + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) ); - workInProgressRootExitStatus !== RootSuspendedWithDelay && - (workInProgressRootExitStatus = RootErrored); - if (null === returnFiber) return !0; - sourceFiber = createCapturedValueAtFiber(value, sourceFiber); - value = returnFiber; - do { - switch (value.tag) { - case 3: - return ( - (value.flags |= 65536), - (root = rootRenderLanes & -rootRenderLanes), - (value.lanes |= root), - (root = createRootErrorUpdate( - value.stateNode, - sourceFiber, - root - )), - enqueueCapturedUpdate(value, root), - !1 - ); - case 1: - if ( - ((returnFiber = value.type), - (suspenseBoundary = value.stateNode), - 0 === (value.flags & 128) && - ("function" === typeof returnFiber.getDerivedStateFromError || - (null !== suspenseBoundary && - "function" === typeof suspenseBoundary.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - suspenseBoundary - ))))) - ) - return ( - (value.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (value.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - value, - sourceFiber - ), - enqueueCapturedUpdate(value, rootRenderLanes), - !1 - ); - } - value = value.return; - } while (null !== value); - return !1; - } - function reconcileChildren( - current, - workInProgress, - nextChildren, - renderLanes - ) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); } - function updateForwardRef( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - Component = Component.render; - var ref = workInProgress.ref; - if ("ref" in nextProps) { - var propsWithoutRef = {}; - for (var key in nextProps) - "ref" !== key && (propsWithoutRef[key] = nextProps[key]); - } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress); - nextProps = renderWithHooks( - current, - workInProgress, - Component, - propsWithoutRef, - ref, - renderLanes + function mountTransition() { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 ); - key = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && key && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; } - function updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if (null === current) { - var type = Component.type; - if ( - "function" === typeof type && - !shouldConstruct(type) && - void 0 === type.defaultProps && - null === Component.compare - ) - return ( - (Component = resolveFunctionForHotReloading(type)), - (workInProgress.tag = 15), - (workInProgress.type = Component), - validateFunctionComponentInDev(workInProgress, type), - updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) - ); - current = createFiberFromTypeAndProps( - Component.type, - null, - nextProps, - workInProgress, - workInProgress.mode, - renderLanes - ); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); - } - type = current.child; - if (!checkScheduledUpdateOrContext(current, renderLanes)) { - var prevProps = type.memoizedProps; - Component = Component.compare; - Component = null !== Component ? Component : shallowEqual; - if ( - Component(prevProps, nextProps) && - current.ref === workInProgress.ref - ) - return bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); + function updateTransition() { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + } + function rerenderTransition() { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + } + function useHostTransitionStatus() { + return readContext(HostTransitionContext); + } + function mountId() { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var treeId = treeContextOverflow; + var idWithLeadingBit = treeContextId; + treeId = + ( + idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) + ).toString(32) + treeId; + identifierPrefix = ":" + identifierPrefix + "R" + treeId; + treeId = localIdCounter++; + 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); + identifierPrefix += ":"; + } else + (treeId = globalClientIdCounter++), + (identifierPrefix = + ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); + return (hook.memoizedState = identifierPrefix); + } + function mountRefresh() { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + } + function refreshCache(fiber, seedKey, seedValue) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(provider); + fiber = createUpdate(lane); + var root = enqueueUpdate(provider, fiber, lane); + null !== root && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(root, provider, lane), + entangleTransitions(root, provider, lane)); + provider = createCache(); + null !== seedKey && + void 0 !== seedKey && + null !== root && + provider.data.set(seedKey, seedValue); + fiber.payload = { cache: provider }; + return; + } + provider = provider.return; } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); } - function updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if (null !== current) { - var prevProps = current.memoizedProps; - if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref && - workInProgress.type === current.type - ) - if ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) - ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); - else - return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ); + function dispatchReducerAction(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && + console.error( + "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." + ); + args = requestUpdateLane(fiber); + var update = { + lane: args, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, update) + : ((update = enqueueConcurrentHookUpdate(fiber, queue, update, args)), + null !== update && + (startUpdateTimerByLane(args), + scheduleUpdateOnFiber(update, fiber, args), + entangleTransitionUpdate(update, queue, args))); + } + function dispatchSetState(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && + console.error( + "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." + ); + args = requestUpdateLane(fiber); + dispatchSetStateInternal(fiber, queue, action, args) && + startUpdateTimerByLane(args); } - function updateOffscreenComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - nextChildren = nextProps.children, - nextIsDetached = - 0 !== - (workInProgress.stateNode._pendingVisibility & OffscreenDetached), - prevState = null !== current ? current.memoizedState : null; - markRef(current, workInProgress); - if ("hidden" === nextProps.mode || nextIsDetached) { - if (0 !== (workInProgress.flags & 128)) { - nextProps = - null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes; - if (null !== current) { - nextChildren = workInProgress.child = current.child; - for (nextIsDetached = 0; null !== nextChildren; ) - (nextIsDetached = - nextIsDetached | nextChildren.lanes | nextChildren.childLanes), - (nextChildren = nextChildren.sibling); - workInProgress.childLanes = nextIsDetached & ~nextProps; - } else (workInProgress.childLanes = 0), (workInProgress.child = null); - return deferHiddenOffscreenComponent( - current, - workInProgress, - nextProps, - renderLanes - ); + function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + else { + var alternate = fiber.alternate; + if ( + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) + ) { + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) + return ( + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && + finishQueueingConcurrentUpdates(), + !1 + ); + } catch (error) { + } finally { + ReactSharedInternals.H = prevDispatcher; + } } - if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(workInProgress), - pushOffscreenSuspenseHandler(workInProgress); - else + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes, - renderLanes - ) + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 ); - } else - null !== prevState - ? (pushTransition(workInProgress, prevState.cachePool), - pushHiddenContext(workInProgress, prevState), - reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.memoizedState = null)) - : (null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(workInProgress), - reuseSuspenseHandlerOnStack(workInProgress)); - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; + } + return !1; } - function deferHiddenOffscreenComponent( - current, - workInProgress, - nextBaseLanes, - renderLanes + function dispatchOptimisticSetState( + fiber, + throwIfDuringRender, + queue, + action ) { - var JSCompiler_inline_result = peekCacheFromPool(); - JSCompiler_inline_result = - null === JSCompiler_inline_result - ? null - : { - parent: CacheContext._currentValue, - pool: JSCompiler_inline_result - }; - workInProgress.memoizedState = { - baseLanes: nextBaseLanes, - cachePool: JSCompiler_inline_result + null === ReactSharedInternals.T && + 0 === currentEntangledLane && + console.error( + "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." + ); + action = { + lane: 2, + revertLane: requestTransitionLane(), + action: action, + hasEagerState: !1, + eagerState: null, + next: null }; - null !== current && pushTransition(workInProgress, null); - reuseHiddenContextOnStack(workInProgress); - pushOffscreenSuspenseHandler(workInProgress); - null !== current && - propagateParentContextChanges(current, workInProgress, renderLanes, !0); - return null; + if (isRenderPhaseUpdate(fiber)) { + if (throwIfDuringRender) + throw Error("Cannot update optimistic state while rendering."); + console.error("Cannot call startTransition while rendering."); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + (startUpdateTimerByLane(2), + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); } - function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (null === ref) - null !== current && - null !== current.ref && - (workInProgress.flags |= 2097664); - else { - if ("function" !== typeof ref && "object" !== typeof ref) - throw Error( - "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) + ); + } + function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = + didScheduleRenderPhaseUpdate = !0; + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; + } + function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194176)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); + } + } + function pushDebugInfo(debugInfo) { + var previousDebugInfo = currentDebugInfo; + null != debugInfo && + (currentDebugInfo = + null === previousDebugInfo + ? debugInfo + : previousDebugInfo.concat(debugInfo)); + return previousDebugInfo; + } + function validateFragmentProps(element, fiber, returnFiber) { + for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) { + var key = keys[i]; + if ("children" !== key && "key" !== key) { + null === fiber && + ((fiber = createFiberFromElement(element, returnFiber.mode, 0)), + (fiber._debugInfo = currentDebugInfo), + (fiber.return = returnFiber)); + runWithFiberInDEV( + fiber, + function (erroredKey) { + console.error( + "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", + erroredKey + ); + }, + key ); - if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + break; + } } } - function updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if ( - Component.prototype && - "function" === typeof Component.prototype.render - ) { - var componentName = getComponentNameFromType(Component) || "Unknown"; - didWarnAboutBadClass[componentName] || - (console.error( - "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", - componentName, - componentName - ), - (didWarnAboutBadClass[componentName] = !0)); - } - workInProgress.mode & StrictLegacyMode && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - null + function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = createThenableState()); + return trackUsedThenable(thenableState, thenable, index); + } + function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; + } + function throwOnInvalidObjectType(returnFiber, newChild) { + if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) + throw Error( + 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.' ); - null === current && - (validateFunctionComponentInDev(workInProgress, workInProgress.type), - Component.contextTypes && - ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes[componentName] || - ((didWarnAboutContextTypes[componentName] = !0), - console.error( - "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", - componentName - )))); - prepareToReadContext(workInProgress); - Component = renderWithHooks( - current, - workInProgress, - Component, - nextProps, - void 0, - renderLanes + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + "Objects are not valid as a React child (found: " + + ("[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber) + + "). If you meant to render a collection of children, use an array instead." ); - nextProps = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && nextProps && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, Component, renderLanes); - return workInProgress.child; } - function replayFunctionComponent( - current, - workInProgress, - nextProps, - Component, - secondArg, - renderLanes - ) { - prepareToReadContext(workInProgress); - hookTypesUpdateIndexDev = -1; - ignorePreviousDependencies = - null !== current && current.type !== workInProgress.type; - workInProgress.updateQueue = null; - nextProps = renderWithHooksAgain( - workInProgress, - Component, - nextProps, - secondArg - ); - finishRenderingHooks(current, workInProgress); - Component = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && Component && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; + function warnOnFunctionType(returnFiber, invalidChild) { + var parentName = getComponentNameFromFiber(returnFiber) || "Component"; + ownerHasFunctionTypeWarning[parentName] || + ((ownerHasFunctionTypeWarning[parentName] = !0), + (invalidChild = + invalidChild.displayName || invalidChild.name || "Component"), + 3 === returnFiber.tag + ? console.error( + "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)", + invalidChild, + invalidChild, + invalidChild + ) + : console.error( + "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}", + invalidChild, + invalidChild, + parentName, + invalidChild, + parentName + )); } - function updateClassComponent( - current$jscomp$0, - workInProgress, - Component, - nextProps, - renderLanes - ) { - switch (shouldErrorImpl(workInProgress)) { - case !1: - var _instance = workInProgress.stateNode, - state = new workInProgress.type( - workInProgress.memoizedProps, - _instance.context - ).state; - _instance.updater.enqueueSetState(_instance, state, null); - break; - case !0: - workInProgress.flags |= 128; - workInProgress.flags |= 65536; - _instance = Error("Simulated error coming from DevTools"); - var lane = renderLanes & -renderLanes; - workInProgress.lanes |= lane; - state = workInProgressRoot; - if (null === state) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - lane = createClassErrorUpdate(lane); - initializeClassErrorUpdate( - lane, - state, - workInProgress, - createCapturedValueAtFiber(_instance, workInProgress) + function warnOnSymbolType(returnFiber, invalidChild) { + var parentName = getComponentNameFromFiber(returnFiber) || "Component"; + ownerHasSymbolTypeWarning[parentName] || + ((ownerHasSymbolTypeWarning[parentName] = !0), + (invalidChild = String(invalidChild)), + 3 === returnFiber.tag + ? console.error( + "Symbols are not valid as a React child.\n root.render(%s)", + invalidChild + ) + : console.error( + "Symbols are not valid as a React child.\n <%s>%s", + parentName, + invalidChild, + parentName + )); + } + function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), + (returnFiber.flags |= 16)) + : deletions.push(childToDelete); + } + } + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; + } + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null !== currentFirstChild.key + ? existingChildren.set(currentFirstChild.key, currentFirstChild) + : existingChildren.set(currentFirstChild.index, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return existingChildren; + } + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) + return (newFiber.flags |= 1048576), lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) + return ( + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex + ); + newFiber.flags |= 33554434; + return lastPlacedIndex; + } + function placeSingleChild(newFiber) { + shouldTrackSideEffects && + null === newFiber.alternate && + (newFiber.flags |= 33554434); + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) + return ( + (current = createFiberFromText( + textContent, + returnFiber.mode, + lanes + )), + (current.return = returnFiber), + (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), + (current._debugInfo = currentDebugInfo), + current ); - enqueueCapturedUpdate(workInProgress, lane); + current = useFiber(current, textContent); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) { - state = emptyContextObject; - _instance = Component.contextType; - "contextType" in Component && - null !== _instance && - (void 0 === _instance || _instance.$$typeof !== REACT_CONTEXT_TYPE) && - !didWarnAboutInvalidateContextType.has(Component) && - (didWarnAboutInvalidateContextType.add(Component), - (lane = - void 0 === _instance - ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." - : "object" !== typeof _instance - ? " However, it is set to a " + typeof _instance + "." - : _instance.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(_instance).join(", ") + - "}."), - console.error( - "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", - getComponentNameFromType(Component) || "Component", - lane - )); - "object" === typeof _instance && - null !== _instance && - (state = readContext(_instance)); - _instance = new Component(nextProps, state); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - _instance = new Component(nextProps, state); - } finally { - setIsStrictModeForDevtools(!1); + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return ( + (current = updateFragment( + returnFiber, + current, + element.props.children, + lanes, + element.key + )), + validateFragmentProps(element, current, returnFiber), + current + ); + if ( + null !== current && + (current.elementType === elementType || + isCompatibleFamilyForHotReloading(current, element) || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + callLazyInitInDEV(elementType) === current.type)) + ) + return ( + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + (current._debugOwner = element._owner), + (current._debugInfo = currentDebugInfo), + current + ); + current = createFiberFromElement(element, returnFiber.mode, lanes); + coerceRef(current, element); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; + } + function updatePortal(returnFiber, current, portal, lanes) { + if ( + null === current || + 4 !== current.tag || + current.stateNode.containerInfo !== portal.containerInfo || + current.stateNode.implementation !== portal.implementation + ) + return ( + (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), + (current.return = returnFiber), + (current._debugInfo = currentDebugInfo), + current + ); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; + } + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), + (current._debugInfo = currentDebugInfo), + current + ); + current = useFiber(current, fragment); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; + } + function createChild(returnFiber, newChild, lanes) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + (newChild._debugOwner = returnFiber), + (newChild._debugTask = returnFiber._debugTask), + (newChild._debugInfo = currentDebugInfo), + newChild + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (lanes = createFiberFromElement( + newChild, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = pushDebugInfo(newChild._debugInfo)), + (lanes._debugInfo = currentDebugInfo), + (currentDebugInfo = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + (newChild._debugInfo = currentDebugInfo), + newChild + ); + case REACT_LAZY_TYPE: + var _prevDebugInfo = pushDebugInfo(newChild._debugInfo); + newChild = callLazyInitInDEV(newChild); + returnFiber = createChild(returnFiber, newChild, lanes); + currentDebugInfo = _prevDebugInfo; + return returnFiber; + } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (lanes = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), + (returnFiber = pushDebugInfo(newChild._debugInfo)), + (lanes._debugInfo = currentDebugInfo), + (currentDebugInfo = returnFiber), + lanes + ); + if ("function" === typeof newChild.then) + return ( + (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = createChild( + returnFiber, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = _prevDebugInfo), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return null !== key + ? null + : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return newChild.key === key + ? ((key = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateElement( + returnFiber, + oldFiber, + newChild, + lanes + )), + (currentDebugInfo = key), + returnFiber) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (key = pushDebugInfo(newChild._debugInfo)), + (newChild = callLazyInitInDEV(newChild)), + (returnFiber = updateSlot( + returnFiber, + oldFiber, + newChild, + lanes + )), + (currentDebugInfo = key), + returnFiber + ); } - } - state = workInProgress.memoizedState = - null !== _instance.state && void 0 !== _instance.state - ? _instance.state - : null; - _instance.updater = classComponentUpdater; - workInProgress.stateNode = _instance; - _instance._reactInternals = workInProgress; - _instance._reactInternalInstance = fakeInternalInstance; - "function" === typeof Component.getDerivedStateFromProps && - null === state && - ((state = getComponentNameFromType(Component) || "Component"), - didWarnAboutUninitializedState.has(state) || - (didWarnAboutUninitializedState.add(state), - console.error( - "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", - state, - null === _instance.state ? "null" : "undefined", - state - ))); - if ( - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof _instance.getSnapshotBeforeUpdate - ) { - var foundWillUpdateName = (lane = state = null); - "function" === typeof _instance.componentWillMount && - !0 !== _instance.componentWillMount.__suppressDeprecationWarning - ? (state = "componentWillMount") - : "function" === typeof _instance.UNSAFE_componentWillMount && - (state = "UNSAFE_componentWillMount"); - "function" === typeof _instance.componentWillReceiveProps && - !0 !== - _instance.componentWillReceiveProps.__suppressDeprecationWarning - ? (lane = "componentWillReceiveProps") - : "function" === - typeof _instance.UNSAFE_componentWillReceiveProps && - (lane = "UNSAFE_componentWillReceiveProps"); - "function" === typeof _instance.componentWillUpdate && - !0 !== _instance.componentWillUpdate.__suppressDeprecationWarning - ? (foundWillUpdateName = "componentWillUpdate") - : "function" === typeof _instance.UNSAFE_componentWillUpdate && - (foundWillUpdateName = "UNSAFE_componentWillUpdate"); - if (null !== state || null !== lane || null !== foundWillUpdateName) { - _instance = getComponentNameFromType(Component) || "Component"; - var newApiName = - "function" === typeof Component.getDerivedStateFromProps - ? "getDerivedStateFromProps()" - : "getSnapshotBeforeUpdate()"; - didWarnAboutLegacyLifecyclesAndDerivedState.has(_instance) || - (didWarnAboutLegacyLifecyclesAndDerivedState.add(_instance), - console.error( - "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", - _instance, - newApiName, - null !== state ? "\n " + state : "", - null !== lane ? "\n " + lane : "", - null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" - )); + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) { + if (null !== key) return null; + key = pushDebugInfo(newChild._debugInfo); + returnFiber = updateFragment( + returnFiber, + oldFiber, + newChild, + lanes, + null + ); + currentDebugInfo = key; + return returnFiber; } + if ("function" === typeof newChild.then) + return ( + (key = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateSlot( + returnFiber, + oldFiber, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = key), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( + returnFiber, + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } - _instance = workInProgress.stateNode; - state = getComponentNameFromType(Component) || "Component"; - _instance.render || - (Component.prototype && - "function" === typeof Component.prototype.render - ? console.error( - "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", - state - ) - : console.error( - "No `render` method found on the %s instance: you may have forgotten to define `render`.", - state - )); - !_instance.getInitialState || - _instance.getInitialState.isReactClassApproved || - _instance.state || - console.error( - "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", - state - ); - _instance.getDefaultProps && - !_instance.getDefaultProps.isReactClassApproved && - console.error( - "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", - state - ); - _instance.contextType && - console.error( - "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", - state - ); - Component.childContextTypes && - !didWarnAboutChildContextTypes.has(Component) && - (didWarnAboutChildContextTypes.add(Component), - console.error( - "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)", - state - )); - Component.contextTypes && - !didWarnAboutContextTypes$1.has(Component) && - (didWarnAboutContextTypes$1.add(Component), - console.error( - "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", - state - )); - "function" === typeof _instance.componentShouldUpdate && - console.error( - "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", - state - ); - Component.prototype && - Component.prototype.isPureReactComponent && - "undefined" !== typeof _instance.shouldComponentUpdate && - console.error( - "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", - getComponentNameFromType(Component) || "A pure component" - ); - "function" === typeof _instance.componentDidUnmount && - console.error( - "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", - state - ); - "function" === typeof _instance.componentDidReceiveProps && - console.error( - "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", - state - ); - "function" === typeof _instance.componentWillRecieveProps && - console.error( - "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", - state - ); - "function" === typeof _instance.UNSAFE_componentWillRecieveProps && - console.error( - "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", - state + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) ); - lane = _instance.props !== nextProps; - void 0 !== _instance.props && - lane && - console.error( - "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", - state + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (newIdx = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + (existingChildren = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateElement( + returnFiber, + newIdx, + newChild, + lanes + )), + (currentDebugInfo = existingChildren), + returnFiber + ); + case REACT_PORTAL_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updatePortal(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_LAZY_TYPE: + var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo); + newChild = callLazyInitInDEV(newChild); + returnFiber = updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ); + currentDebugInfo = _prevDebugInfo7; + return returnFiber; + } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (newIdx = existingChildren.get(newIdx) || null), + (existingChildren = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFragment( + returnFiber, + newIdx, + newChild, + lanes, + null + )), + (currentDebugInfo = existingChildren), + returnFiber + ); + if ("function" === typeof newChild.then) + return ( + (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFromMap( + existingChildren, + returnFiber, + newIdx, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = _prevDebugInfo7), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) { + if ("object" !== typeof child || null === child) return knownKeys; + switch (child.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + warnForMissingKey(returnFiber, workInProgress, child); + var key = child.key; + if ("string" !== typeof key) break; + if (null === knownKeys) { + knownKeys = new Set(); + knownKeys.add(key); + break; + } + if (!knownKeys.has(key)) { + knownKeys.add(key); + break; + } + runWithFiberInDEV(workInProgress, function () { + console.error( + "Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", + key + ); + }); + break; + case REACT_LAZY_TYPE: + (child = callLazyInitInDEV(child)), + warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); + } + return knownKeys; + } + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var knownKeys = null, + resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( + returnFiber, + oldFiber, + newChildren[newIdx], + lanes ); - _instance.defaultProps && - console.error( - "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", - state, - state + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + knownKeys = warnOnInvalidKey( + returnFiber, + newFiber, + newChildren[newIdx], + knownKeys ); - "function" !== typeof _instance.getSnapshotBeforeUpdate || - "function" === typeof _instance.componentDidUpdate || - didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) || - (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component), - console.error( - "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", - getComponentNameFromType(Component) - )); - "function" === typeof _instance.getDerivedStateFromProps && - console.error( - "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - state + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (newIdx === newChildren.length) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - "function" === typeof _instance.getDerivedStateFromError && - console.error( - "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - state + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + oldFiber, + newChildren[newIdx], + knownKeys + )), + (currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + newIdx < newChildren.length; + newIdx++ + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + newChildren[newIdx], + lanes + )), + null !== nextOldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + nextOldFiber, + newChildren[newIdx], + knownKeys + )), + shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChildrenIterable, + lanes + ) { + var newChildren = newChildrenIterable[ASYNC_ITERATOR](); + newChildren !== newChildrenIterable || + (0 === returnFiber.tag && + "[object AsyncGeneratorFunction]" === + Object.prototype.toString.call(returnFiber.type) && + "[object AsyncGenerator]" === + Object.prototype.toString.call(newChildren)) || + (didWarnAboutGenerators || + console.error( + "Using AsyncIterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You can use an AsyncIterable that can iterate multiple times over the same items." + ), + (didWarnAboutGenerators = !0)); + if (null == newChildren) + throw Error("An iterable object provided no iterator."); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + { + next: function () { + return unwrapThenable(newChildren.next()); + } + }, + lanes + ); + } + function reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + if (null == newChildren) + throw Error("An iterable object provided no iterator."); + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null, + knownKeys = null, + step = newChildren.next(); + null !== oldFiber && !step.done; + newIdx++, step = newChildren.next() + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + knownKeys = warnOnInvalidKey( + returnFiber, + newFiber, + step.value, + knownKeys ); - "function" === typeof Component.getSnapshotBeforeUpdate && - console.error( - "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", - state + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (step.done) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - (lane = _instance.state) && - ("object" !== typeof lane || isArrayImpl(lane)) && - console.error("%s.state: must be set to an object or null", state); - "function" === typeof _instance.getChildContext && - "object" !== typeof Component.childContextTypes && - console.error( - "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", - state + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (oldFiber = createChild(returnFiber, step.value, lanes)), + null !== oldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + oldFiber, + step.value, + knownKeys + )), + (currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + step.value, + lanes + )), + null !== nextOldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + nextOldFiber, + step.value, + knownKeys + )), + shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) { + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + (validateFragmentProps(newChild, null, returnFiber), + (newChild = newChild.props.children)); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + var prevDebugInfo = pushDebugInfo(newChild._debugInfo); + a: { + for (var key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === currentFirstChild.tag) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + newChild.props.children + ); + lanes.return = returnFiber; + lanes._debugOwner = newChild._owner; + lanes._debugInfo = currentDebugInfo; + validateFragmentProps(newChild, lanes, returnFiber); + returnFiber = lanes; + break a; + } + } else if ( + currentFirstChild.elementType === key || + isCompatibleFamilyForHotReloading( + currentFirstChild, + newChild + ) || + ("object" === typeof key && + null !== key && + key.$$typeof === REACT_LAZY_TYPE && + callLazyInitInDEV(key) === currentFirstChild.type) + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.props); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + lanes._debugOwner = newChild._owner; + lanes._debugInfo = currentDebugInfo; + returnFiber = lanes; + break a; + } + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + newChild.type === REACT_FRAGMENT_TYPE + ? ((lanes = createFiberFromFragment( + newChild.props.children, + returnFiber.mode, + lanes, + newChild.key + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), + (lanes._debugInfo = currentDebugInfo), + validateFragmentProps(newChild, lanes, returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromElement( + newChild, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (lanes._debugInfo = currentDebugInfo), + (returnFiber = lanes)); + } + returnFiber = placeSingleChild(returnFiber); + currentDebugInfo = prevDebugInfo; + return returnFiber; + case REACT_PORTAL_TYPE: + a: { + prevDebugInfo = newChild; + for ( + newChild = prevDebugInfo.key; + null !== currentFirstChild; + + ) { + if (currentFirstChild.key === newChild) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + prevDebugInfo.containerInfo && + currentFirstChild.stateNode.implementation === + prevDebugInfo.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + prevDebugInfo.children || [] + ); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + lanes = createFiberFromPortal( + prevDebugInfo, + returnFiber.mode, + lanes + ); + lanes.return = returnFiber; + returnFiber = lanes; + } + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (newChild = callLazyInitInDEV(newChild)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + } + if (isArrayImpl(newChild)) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + if (getIteratorFn(newChild)) { + prevDebugInfo = pushDebugInfo(newChild._debugInfo); + key = getIteratorFn(newChild); + if ("function" !== typeof key) + throw Error( + "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." + ); + var newChildren = key.call(newChild); + if (newChildren === newChild) { + if ( + 0 !== returnFiber.tag || + "[object GeneratorFunction]" !== + Object.prototype.toString.call(returnFiber.type) || + "[object Generator]" !== + Object.prototype.toString.call(newChildren) + ) + didWarnAboutGenerators || + console.error( + "Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items." + ), + (didWarnAboutGenerators = !0); + } else + newChild.entries !== key || + didWarnAboutMaps || + (console.error( + "Using Maps as children is not supported. Use an array of keyed ReactElements instead." + ), + (didWarnAboutMaps = !0)); + returnFiber = reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ); + currentDebugInfo = prevDebugInfo; + return returnFiber; + } + if ("function" === typeof newChild[ASYNC_ITERATOR]) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + if ("function" === typeof newChild.then) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (prevDebugInfo = "" + newChild), + null !== currentFirstChild && 6 === currentFirstChild.tag + ? (deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ), + (lanes = useFiber(currentFirstChild, prevDebugInfo)), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : (deleteRemainingChildren(returnFiber, currentFirstChild), + (lanes = createFiberFromText( + prevDebugInfo, + returnFiber.mode, + lanes + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), + (lanes._debugInfo = currentDebugInfo), + (returnFiber = lanes)), + placeSingleChild(returnFiber) ); - _instance = workInProgress.stateNode; - _instance.props = nextProps; - _instance.state = workInProgress.memoizedState; - _instance.refs = {}; - initializeUpdateQueue(workInProgress); - state = Component.contextType; - _instance.context = - "object" === typeof state && null !== state - ? readContext(state) - : emptyContextObject; - _instance.state === nextProps && - ((state = getComponentNameFromType(Component) || "Component"), - didWarnAboutDirectlyAssigningPropsToState.has(state) || - (didWarnAboutDirectlyAssigningPropsToState.add(state), - console.error( - "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", - state - ))); - workInProgress.mode & StrictLegacyMode && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - _instance + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return deleteRemainingChildren(returnFiber, currentFirstChild); + } + return function (returnFiber, currentFirstChild, newChild, lanes) { + var prevDebugInfo = currentDebugInfo; + currentDebugInfo = null; + try { + thenableIndexCounter = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes ); - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( - workInProgress, - _instance + thenableState = null; + return firstChildFiber; + } catch (x) { + if (x === SuspenseException || x === SuspenseActionException) throw x; + var fiber = createFiber(29, x, null, returnFiber.mode); + fiber.lanes = lanes; + fiber.return = returnFiber; + var debugInfo = (fiber._debugInfo = currentDebugInfo); + fiber._debugOwner = returnFiber._debugOwner; + fiber._debugTask = returnFiber._debugTask; + if (null != debugInfo) + for (var i = debugInfo.length - 1; 0 <= i; i--) + if ("string" === typeof debugInfo[i].stack) { + fiber._debugOwner = debugInfo[i]; + fiber._debugTask = debugInfo[i].debugTask; + break; + } + return fiber; + } finally { + currentDebugInfo = prevDebugInfo; + } + }; + } + function pushPrimaryTreeSuspenseHandler(handler) { + var current = handler.alternate; + push( + suspenseStackCursor, + suspenseStackCursor.current & SubtreeSuspenseContextMask, + handler + ); + push(suspenseHandlerStackCursor, handler, handler); + null === shellBoundary && + (null === current || null !== currentTreeHiddenStackCursor.current + ? (shellBoundary = handler) + : null !== current.memoizedState && (shellBoundary = handler)); + } + function pushOffscreenSuspenseHandler(fiber) { + if (22 === fiber.tag) { + if ( + (push(suspenseStackCursor, suspenseStackCursor.current, fiber), + push(suspenseHandlerStackCursor, fiber, fiber), + null === shellBoundary) + ) { + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); + } + function reuseSuspenseHandlerOnStack(fiber) { + push(suspenseStackCursor, suspenseStackCursor.current, fiber); + push( + suspenseHandlerStackCursor, + suspenseHandlerStackCursor.current, + fiber + ); + } + function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor, fiber); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor, fiber); + } + function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; + if ( + null !== state && + ((state = state.dehydrated), + null === state || + state.data === SUSPENSE_PENDING_START_DATA || + isSuspenseInstanceFallback(state)) + ) + return node; + } else if ( + 19 === node.tag && + void 0 !== node.memoizedProps.revealOrder + ) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + return null; + } + function defaultOnUncaughtError(error) { + reportGlobalError(error); + console.warn( + "%s\n\n%s\n", + componentName + ? "An error occurred in the <" + componentName + "> component." + : "An error occurred in one of your React components.", + "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." + ); + } + function defaultOnCaughtError(error) { + var componentNameMessage = componentName + ? "The above error occurred in the <" + componentName + "> component." + : "The above error occurred in one of your React components.", + recreateMessage = + "React will try to recreate this component tree from scratch using the error boundary you provided, " + + ((errorBoundaryName || "Anonymous") + "."); + if ( + "object" === typeof error && + null !== error && + "string" === typeof error.environmentName + ) { + var JSCompiler_inline_result = error.environmentName; + error = [ + "%o\n\n%s\n\n%s\n", + error, + componentNameMessage, + recreateMessage + ].slice(0); + "string" === typeof error[0] + ? error.splice( + 0, + 1, + badgeFormat + error[0], + badgeStyle, + pad + JSCompiler_inline_result + pad, + resetStyle + ) + : error.splice( + 0, + 0, + badgeFormat, + badgeStyle, + pad + JSCompiler_inline_result + pad, + resetStyle + ); + error.unshift(console); + JSCompiler_inline_result = bind.apply(console.error, error); + JSCompiler_inline_result(); + } else + console.error( + "%o\n\n%s\n\n%s\n", + error, + componentNameMessage, + recreateMessage ); - _instance.state = workInProgress.memoizedState; - state = Component.getDerivedStateFromProps; - "function" === typeof state && - (applyDerivedStateFromProps( - workInProgress, - Component, - state, - nextProps - ), - (_instance.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof _instance.getSnapshotBeforeUpdate || - ("function" !== typeof _instance.UNSAFE_componentWillMount && - "function" !== typeof _instance.componentWillMount) || - ((state = _instance.state), - "function" === typeof _instance.componentWillMount && - _instance.componentWillMount(), - "function" === typeof _instance.UNSAFE_componentWillMount && - _instance.UNSAFE_componentWillMount(), - state !== _instance.state && - (console.error( - "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - getComponentNameFromFiber(workInProgress) || "Component" - ), - classComponentUpdater.enqueueReplaceState( - _instance, - _instance.state, - null - )), - processUpdateQueue(workInProgress, nextProps, _instance, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (_instance.state = workInProgress.memoizedState)); - "function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308); - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864); - _instance = !0; - } else if (null === current$jscomp$0) { - _instance = workInProgress.stateNode; - var unresolvedOldProps = workInProgress.memoizedProps; - lane = resolveClassComponentProps(Component, unresolvedOldProps); - _instance.props = lane; - var oldContext = _instance.context; - foundWillUpdateName = Component.contextType; - state = emptyContextObject; - "object" === typeof foundWillUpdateName && - null !== foundWillUpdateName && - (state = readContext(foundWillUpdateName)); - newApiName = Component.getDerivedStateFromProps; - foundWillUpdateName = - "function" === typeof newApiName || - "function" === typeof _instance.getSnapshotBeforeUpdate; - unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - foundWillUpdateName || - ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof _instance.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== state) && - callComponentWillReceiveProps( - workInProgress, - _instance, - nextProps, - state - )); - hasForceUpdate = !1; - var oldState = workInProgress.memoizedState; - _instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - oldContext = workInProgress.memoizedState; - unresolvedOldProps || oldState !== oldContext || hasForceUpdate - ? ("function" === typeof newApiName && - (applyDerivedStateFromProps( - workInProgress, - Component, - newApiName, - nextProps - ), - (oldContext = workInProgress.memoizedState)), - (lane = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - lane, - nextProps, - oldState, - oldContext, - state - )) - ? (foundWillUpdateName || - ("function" !== typeof _instance.UNSAFE_componentWillMount && - "function" !== typeof _instance.componentWillMount) || - ("function" === typeof _instance.componentWillMount && - _instance.componentWillMount(), - "function" === typeof _instance.UNSAFE_componentWillMount && - _instance.UNSAFE_componentWillMount()), - "function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864)) - : ("function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = oldContext)), - (_instance.props = nextProps), - (_instance.state = oldContext), - (_instance.context = state), - (_instance = lane)) - : ("function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864), - (_instance = !1)); - } else { - _instance = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); - state = workInProgress.memoizedProps; - foundWillUpdateName = resolveClassComponentProps(Component, state); - _instance.props = foundWillUpdateName; - newApiName = workInProgress.pendingProps; - oldState = _instance.context; - oldContext = Component.contextType; - lane = emptyContextObject; - "object" === typeof oldContext && - null !== oldContext && - (lane = readContext(oldContext)); - unresolvedOldProps = Component.getDerivedStateFromProps; - (oldContext = - "function" === typeof unresolvedOldProps || - "function" === typeof _instance.getSnapshotBeforeUpdate) || - ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof _instance.componentWillReceiveProps) || - ((state !== newApiName || oldState !== lane) && - callComponentWillReceiveProps( - workInProgress, - _instance, - nextProps, - lane - )); - hasForceUpdate = !1; - oldState = workInProgress.memoizedState; - _instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - state !== newApiName || - oldState !== newState || - hasForceUpdate || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) - ? ("function" === typeof unresolvedOldProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - unresolvedOldProps, - nextProps - ), - (newState = workInProgress.memoizedState)), - (foundWillUpdateName = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - foundWillUpdateName, - nextProps, - oldState, - newState, - lane - ) || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) - ? (oldContext || - ("function" !== typeof _instance.UNSAFE_componentWillUpdate && - "function" !== typeof _instance.componentWillUpdate) || - ("function" === typeof _instance.componentWillUpdate && - _instance.componentWillUpdate(nextProps, newState, lane), - "function" === typeof _instance.UNSAFE_componentWillUpdate && - _instance.UNSAFE_componentWillUpdate( - nextProps, - newState, - lane - )), - "function" === typeof _instance.componentDidUpdate && - (workInProgress.flags |= 4), - "function" === typeof _instance.getSnapshotBeforeUpdate && - (workInProgress.flags |= 1024)) - : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 1024), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = newState)), - (_instance.props = nextProps), - (_instance.state = newState), - (_instance.context = lane), - (_instance = foundWillUpdateName)) - : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 1024), - (_instance = !1)); + } + function defaultOnRecoverableError(error) { + reportGlobalError(error); + } + function logUncaughtError(root, errorInfo) { + try { + componentName = errorInfo.source + ? getComponentNameFromFiber(errorInfo.source) + : null; + errorBoundaryName = null; + var error = errorInfo.value; + if (null !== ReactSharedInternals.actQueue) + ReactSharedInternals.thrownErrors.push(error); + else { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(error, { componentStack: errorInfo.stack }); + } + } catch (e$4) { + setTimeout(function () { + throw e$4; + }); + } + } + function logCaughtError(root, boundary, errorInfo) { + try { + componentName = errorInfo.source + ? getComponentNameFromFiber(errorInfo.source) + : null; + errorBoundaryName = getComponentNameFromFiber(boundary); + var onCaughtError = root.onCaughtError; + onCaughtError(errorInfo.value, { + componentStack: errorInfo.stack, + errorBoundary: 1 === boundary.tag ? boundary.stateNode : null + }); + } catch (e$5) { + setTimeout(function () { + throw e$5; + }); } - lane = _instance; - markRef(current$jscomp$0, workInProgress); - state = 0 !== (workInProgress.flags & 128); - if (lane || state) { - lane = workInProgress.stateNode; - ReactSharedInternals.getCurrentStack = - null === workInProgress ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = workInProgress; - if (state && "function" !== typeof Component.getDerivedStateFromError) - (Component = null), (profilerStartTime = -1); - else if ( - ((Component = callRenderInDEV(lane)), - workInProgress.mode & StrictLegacyMode) - ) { - setIsStrictModeForDevtools(!0); - try { - callRenderInDEV(lane); - } finally { - setIsStrictModeForDevtools(!1); + } + function createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = CaptureUpdate; + lane.payload = { element: null }; + lane.callback = function () { + runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); + }; + return lane; + } + function createClassErrorUpdate(lane) { + lane = createUpdate(lane); + lane.tag = CaptureUpdate; + return lane; + } + function initializeClassErrorUpdate(update, root, fiber, errorInfo) { + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if ("function" === typeof getDerivedStateFromError) { + var error = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error); + }; + update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo + ); + }; + } + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo + ); + "function" !== typeof getDerivedStateFromError && + (null === legacyErrorBoundariesThatAlreadyFailed + ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) + : legacyErrorBoundariesThatAlreadyFailed.add(this)); + callComponentDidCatchInDEV(this, errorInfo); + "function" === typeof getDerivedStateFromError || + (0 === (fiber.lanes & 2) && + console.error( + "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", + getComponentNameFromFiber(fiber) || "Unknown" + )); + }); + } + function resetSuspendedComponent(sourceFiber, rootRenderLanes) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); + } + function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ) { + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; + } + function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes + ) { + sourceFiber.flags |= 32768; + isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); + if ( + null !== value && + "object" === typeof value && + (value.$$typeof === REACT_POSTPONE_TYPE && + (value = { then: function () {} }), + "function" === typeof value.then) + ) { + resetSuspendedComponent(sourceFiber, rootRenderLanes); + isHydrating && (didSuspendOrErrorDEV = !0); + var suspenseBoundary = suspenseHandlerStackCursor.current; + if (null !== suspenseBoundary) { + switch (suspenseBoundary.tag) { + case 13: + return ( + null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === suspenseBoundary.alternate && + workInProgressRootExitStatus === RootInProgress && + (workInProgressRootExitStatus = RootSuspended), + (suspenseBoundary.flags &= -257), + markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value === noopSuspenseyCommitThenable + ? (suspenseBoundary.flags |= 16384) + : ((sourceFiber = suspenseBoundary.updateQueue), + null === sourceFiber + ? (suspenseBoundary.updateQueue = new Set([value])) + : sourceFiber.add(value), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + case 22: + return ( + (suspenseBoundary.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (suspenseBoundary.flags |= 16384) + : ((sourceFiber = suspenseBoundary.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (suspenseBoundary.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); } + throw Error( + "Unexpected Suspense handler tag (" + + suspenseBoundary.tag + + "). This is a bug in React." + ); } - workInProgress.flags |= 1; - null !== current$jscomp$0 && state - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current$jscomp$0.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - Component, - renderLanes - ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - Component, - renderLanes - ); - workInProgress.memoizedState = lane.state; - current$jscomp$0 = workInProgress.child; - } else - current$jscomp$0 = bailoutOnAlreadyFinishedWork( - current$jscomp$0, - workInProgress, - renderLanes + attachPingListener(root, value, rootRenderLanes); + renderDidSuspendDelayIfPossible(); + return !1; + } + if (isHydrating) + return ( + (didSuspendOrErrorDEV = !0), + (suspenseBoundary = suspenseHandlerStackCursor.current), + null !== suspenseBoundary + ? (0 === (suspenseBoundary.flags & 65536) && + (suspenseBoundary.flags |= 256), + markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value !== HydrationMismatchException && + queueHydrationError( + createCapturedValueAtFiber( + Error( + "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.", + { cause: value } + ), + sourceFiber + ) + )) + : (value !== HydrationMismatchException && + queueHydrationError( + createCapturedValueAtFiber( + Error( + "There was an error while hydrating but React was able to recover by instead client rendering the entire root.", + { cause: value } + ), + sourceFiber + ) + ), + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes + )), + enqueueCapturedUpdate(root, rootRenderLanes), + workInProgressRootExitStatus !== RootSuspendedWithDelay && + (workInProgressRootExitStatus = RootErrored)), + !1 ); - renderLanes = workInProgress.stateNode; - _instance && - renderLanes.props !== nextProps && - (didWarnAboutReassigningProps || - console.error( - "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", - getComponentNameFromFiber(workInProgress) || "a component" + queueConcurrentError( + createCapturedValueAtFiber( + Error( + "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", + { cause: value } ), - (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + sourceFiber + ) + ); + workInProgressRootExitStatus !== RootSuspendedWithDelay && + (workInProgressRootExitStatus = RootErrored); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + value = returnFiber; + do { + switch (value.tag) { + case 3: + return ( + (value.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (value.lanes |= root), + (root = createRootErrorUpdate( + value.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(value, root), + !1 + ); + case 1: + if ( + ((returnFiber = value.type), + (suspenseBoundary = value.stateNode), + 0 === (value.flags & 128) && + ("function" === typeof returnFiber.getDerivedStateFromError || + (null !== suspenseBoundary && + "function" === typeof suspenseBoundary.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has( + suspenseBoundary + ))))) + ) + return ( + (value.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (value.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + value, + sourceFiber + ), + enqueueCapturedUpdate(value, rootRenderLanes), + !1 + ); + } + value = value.return; + } while (null !== value); + return !1; } - function mountHostRootWithoutHydrating( + function reconcileChildren( current, workInProgress, nextChildren, renderLanes ) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; + workInProgress.child = + null === current + ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) + : reconcileChildFibers( + workInProgress, + current.child, + nextChildren, + renderLanes + ); } - function validateFunctionComponentInDev(workInProgress, Component) { - Component && - Component.childContextTypes && - console.error( - "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", - Component.displayName || Component.name || "Component" + function updateForwardRef( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + Component = Component.render; + var ref = workInProgress.ref; + if ("ref" in nextProps) { + var propsWithoutRef = {}; + for (var key in nextProps) + "ref" !== key && (propsWithoutRef[key] = nextProps[key]); + } else propsWithoutRef = nextProps; + prepareToReadContext(workInProgress); + nextProps = renderWithHooks( + current, + workInProgress, + Component, + propsWithoutRef, + ref, + renderLanes + ); + key = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) ); - "function" === typeof Component.getDerivedStateFromProps && - ((workInProgress = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] || - (console.error( - "%s: Function components do not support getDerivedStateFromProps.", - workInProgress - ), - (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] = - !0))); - "object" === typeof Component.contextType && - null !== Component.contextType && - ((Component = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypeOnFunctionComponent[Component] || - (console.error( - "%s: Function components do not support contextType.", - Component - ), - (didWarnAboutContextTypeOnFunctionComponent[Component] = !0))); - } - function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; + isHydrating && key && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; } - function getRemainingWorkInPrimaryTree( + function updateMemoComponent( current, - primaryTreeDidDefer, + workInProgress, + Component, + nextProps, renderLanes ) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; - } - function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2330; - var JSCompiler_object_inline_stack_2329 = workInProgress.pendingProps; - shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2327 = !1; - var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2330 = didSuspend) || - (JSCompiler_object_inline_componentStack_2330 = - null !== current && null === current.memoizedState - ? !1 - : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2330 && - ((JSCompiler_object_inline_message_2327 = !0), - (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2330 = - 0 !== (workInProgress.flags & 32); - workInProgress.flags &= -33; if (null === current) { - if (isHydrating) { - JSCompiler_object_inline_message_2327 - ? pushPrimaryTreeSuspenseHandler(workInProgress) - : reuseSuspenseHandlerOnStack(workInProgress); - if (isHydrating) { - var JSCompiler_object_inline_digest_2328 = nextHydratableInstance; - var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2328)) { - c: { - var instance = JSCompiler_object_inline_digest_2328; - for ( - JSCompiler_temp = rootOrSingletonContext; - 8 !== instance.nodeType; - - ) { - if (!JSCompiler_temp) { - JSCompiler_temp = null; - break c; - } - instance = getNextHydratable(instance.nextSibling); - if (null === instance) { - JSCompiler_temp = null; - break c; - } - } - JSCompiler_temp = instance; - } - null !== JSCompiler_temp - ? (warnIfNotHydrating(), - (workInProgress.memoizedState = { - dehydrated: JSCompiler_temp, - treeContext: - null !== treeContextProvider - ? { id: treeContextId, overflow: treeContextOverflow } - : null, - retryLane: 536870912 - }), - (instance = createFiber(18, null, null, NoMode)), - (instance.stateNode = JSCompiler_temp), - (instance.return = workInProgress), - (workInProgress.child = instance), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (JSCompiler_temp = !0)) - : (JSCompiler_temp = !1); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && - (warnNonHydratedInstance( - workInProgress, - JSCompiler_object_inline_digest_2328 - ), - throwOnHydrationMismatch(workInProgress)); - } - JSCompiler_object_inline_digest_2328 = workInProgress.memoizedState; - if ( - null !== JSCompiler_object_inline_digest_2328 && - ((JSCompiler_object_inline_digest_2328 = - JSCompiler_object_inline_digest_2328.dehydrated), - null !== JSCompiler_object_inline_digest_2328) - ) - return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2328) - ? (workInProgress.lanes = 16) - : (workInProgress.lanes = 536870912), - null - ); - popSuspenseHandler(workInProgress); - } - JSCompiler_object_inline_digest_2328 = - JSCompiler_object_inline_stack_2329.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2329.fallback; - if (JSCompiler_object_inline_message_2327) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2329 = - mountSuspenseFallbackChildren( - workInProgress, - JSCompiler_object_inline_digest_2328, - JSCompiler_temp, - renderLanes - )), - (JSCompiler_object_inline_message_2327 = workInProgress.child), - (JSCompiler_object_inline_message_2327.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2327.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_componentStack_2330, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2329 - ); + var type = Component.type; if ( - "number" === - typeof JSCompiler_object_inline_stack_2329.unstable_expectedLoadTime - ) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2329 = - mountSuspenseFallbackChildren( - workInProgress, - JSCompiler_object_inline_digest_2328, - JSCompiler_temp, - renderLanes - )), - (JSCompiler_object_inline_message_2327 = workInProgress.child), - (JSCompiler_object_inline_message_2327.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2327.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_componentStack_2330, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2329 + "function" === typeof type && + !shouldConstruct(type) && + void 0 === type.defaultProps && + null === Component.compare + ) + return ( + (Component = resolveFunctionForHotReloading(type)), + (workInProgress.tag = 15), + (workInProgress.type = Component), + validateFunctionComponentInDev(workInProgress, type), + updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren( + current = createFiberFromTypeAndProps( + Component.type, + null, + nextProps, workInProgress, - JSCompiler_object_inline_digest_2328 + workInProgress.mode, + renderLanes ); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); } - var prevState = current.memoizedState; - if ( - null !== prevState && - ((JSCompiler_object_inline_digest_2328 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2328) - ) { - if (didSuspend) - workInProgress.flags & 256 - ? (pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags &= -257), - (workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ))) - : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2327 = - JSCompiler_object_inline_stack_2329.fallback), - (JSCompiler_object_inline_digest_2328 = workInProgress.mode), - (JSCompiler_object_inline_stack_2329 = - mountWorkInProgressOffscreenFiber( - { - mode: "visible", - children: JSCompiler_object_inline_stack_2329.children - }, - JSCompiler_object_inline_digest_2328 - )), - (JSCompiler_object_inline_message_2327 = - createFiberFromFragment( - JSCompiler_object_inline_message_2327, - JSCompiler_object_inline_digest_2328, - renderLanes, - null - )), - (JSCompiler_object_inline_message_2327.flags |= 2), - (JSCompiler_object_inline_stack_2329.return = workInProgress), - (JSCompiler_object_inline_message_2327.return = workInProgress), - (JSCompiler_object_inline_stack_2329.sibling = - JSCompiler_object_inline_message_2327), - (workInProgress.child = JSCompiler_object_inline_stack_2329), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (JSCompiler_object_inline_stack_2329 = workInProgress.child), - (JSCompiler_object_inline_stack_2329.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2329.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_componentStack_2330, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2327)); - else if ( - (pushPrimaryTreeSuspenseHandler(workInProgress), - isHydrating && - console.error( - "We should not be hydrating here. This is a bug in React. Please file a bug." - ), - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2328)) - ) { - JSCompiler_object_inline_componentStack_2330 = - JSCompiler_object_inline_digest_2328.nextSibling && - JSCompiler_object_inline_digest_2328.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2330) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2330.dgst; - var message = JSCompiler_object_inline_componentStack_2330.msg; - instance = JSCompiler_object_inline_componentStack_2330.stck; - var componentStack = - JSCompiler_object_inline_componentStack_2330.cstck; - } - JSCompiler_object_inline_message_2327 = message; - JSCompiler_object_inline_digest_2328 = JSCompiler_temp; - JSCompiler_object_inline_stack_2329 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2330 = - componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2328 && - ((JSCompiler_object_inline_componentStack_2330 = - JSCompiler_object_inline_message_2327 - ? Error(JSCompiler_object_inline_message_2327) - : Error( - "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." - )), - (JSCompiler_object_inline_componentStack_2330.stack = - JSCompiler_object_inline_stack_2329 || ""), - (JSCompiler_object_inline_componentStack_2330.digest = - JSCompiler_object_inline_digest_2328), - (JSCompiler_object_inline_stack_2329 = - void 0 === JSCompiler_temp ? null : JSCompiler_temp), - (JSCompiler_object_inline_message_2327 = { - value: JSCompiler_object_inline_componentStack_2330, - source: null, - stack: JSCompiler_object_inline_stack_2329 - }), - "string" === typeof JSCompiler_object_inline_stack_2329 && - CapturedStacks.set( - JSCompiler_object_inline_componentStack_2330, - JSCompiler_object_inline_message_2327 - ), - queueHydrationError(JSCompiler_object_inline_message_2327)); - workInProgress = retrySuspenseComponentWithoutHydrating( + type = current.child; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if ( + Component(prevProps, nextProps) && + current.ref === workInProgress.ref + ) + return bailoutOnAlreadyFinishedWork( current, workInProgress, renderLanes ); - } else if ( - (didReceiveUpdate || - propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (JSCompiler_object_inline_componentStack_2330 = - 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2330) - ) { - JSCompiler_object_inline_componentStack_2330 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2330) { - JSCompiler_object_inline_stack_2329 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2329 & 42)) - JSCompiler_object_inline_stack_2329 = 1; - else - switch (JSCompiler_object_inline_stack_2329) { - case 2: - JSCompiler_object_inline_stack_2329 = 1; - break; - case 8: - JSCompiler_object_inline_stack_2329 = 4; - break; - case 32: - JSCompiler_object_inline_stack_2329 = 16; - break; - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - JSCompiler_object_inline_stack_2329 = 64; - break; - case 268435456: - JSCompiler_object_inline_stack_2329 = 134217728; - break; - default: - JSCompiler_object_inline_stack_2329 = 0; - } - JSCompiler_object_inline_stack_2329 = - 0 !== - (JSCompiler_object_inline_stack_2329 & - (JSCompiler_object_inline_componentStack_2330.suspendedLanes | - renderLanes)) - ? 0 - : JSCompiler_object_inline_stack_2329; - if ( - 0 !== JSCompiler_object_inline_stack_2329 && - JSCompiler_object_inline_stack_2329 !== prevState.retryLane - ) - throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2329), - enqueueConcurrentRenderForLane( - current, - JSCompiler_object_inline_stack_2329 - ), - scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2330, - current, - JSCompiler_object_inline_stack_2329 - ), - SelectiveHydrationException) - ); - } - JSCompiler_object_inline_digest_2328.data === - SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); - workInProgress = retrySuspenseComponentWithoutHydrating( + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + function updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if (null !== current) { + var prevProps = current.memoizedProps; + if ( + shallowEqual(prevProps, nextProps) && + current.ref === workInProgress.ref && + workInProgress.type === current.type + ) + if ( + ((didReceiveUpdate = !1), + (workInProgress.pendingProps = nextProps = prevProps), + checkScheduledUpdateOrContext(current, renderLanes)) + ) + 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + else + return ( + (workInProgress.lanes = current.lanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + } + return updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ); + } + function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + nextIsDetached = + 0 !== + (workInProgress.stateNode._pendingVisibility & OffscreenDetached), + prevState = null !== current ? current.memoizedState : null; + markRef(current, workInProgress); + if ("hidden" === nextProps.mode || nextIsDetached) { + if (0 !== (workInProgress.flags & 128)) { + nextProps = + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes; + if (null !== current) { + nextChildren = workInProgress.child = current.child; + for (nextIsDetached = 0; null !== nextChildren; ) + (nextIsDetached = + nextIsDetached | nextChildren.lanes | nextChildren.childLanes), + (nextChildren = nextChildren.sibling); + workInProgress.childLanes = nextIsDetached & ~nextProps; + } else (workInProgress.childLanes = 0), (workInProgress.child = null); + return deferHiddenOffscreenComponent( current, workInProgress, + nextProps, renderLanes ); - } else - JSCompiler_object_inline_digest_2328.data === - SUSPENSE_PENDING_START_DATA - ? ((workInProgress.flags |= 192), - (workInProgress.child = current.child), - (workInProgress = null)) - : ((current = prevState.treeContext), - (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2328.nextSibling - )), - (hydrationParentFiber = workInProgress), - (isHydrating = !0), - (hydrationErrors = null), - (didSuspendOrErrorDEV = !1), - (hydrationDiffRootDEV = null), - (rootOrSingletonContext = !1), - null !== current && - (warnIfNotHydrating(), - (idStack[idStackIndex++] = treeContextId), - (idStack[idStackIndex++] = treeContextOverflow), - (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = current.id), - (treeContextOverflow = current.overflow), - (treeContextProvider = workInProgress)), - (workInProgress = mountSuspensePrimaryChildren( - workInProgress, - JSCompiler_object_inline_stack_2329.children - )), - (workInProgress.flags |= 4096)); - return workInProgress; - } - if (JSCompiler_object_inline_message_2327) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2327 = - JSCompiler_object_inline_stack_2329.fallback), - (JSCompiler_object_inline_digest_2328 = workInProgress.mode), - (JSCompiler_temp = current.child), - (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2329 = createWorkInProgress( - JSCompiler_temp, - { - mode: "hidden", - children: JSCompiler_object_inline_stack_2329.children - } - )), - (JSCompiler_object_inline_stack_2329.subtreeFlags = - JSCompiler_temp.subtreeFlags & 31457280), - null !== instance - ? (JSCompiler_object_inline_message_2327 = createWorkInProgress( - instance, - JSCompiler_object_inline_message_2327 - )) - : ((JSCompiler_object_inline_message_2327 = createFiberFromFragment( - JSCompiler_object_inline_message_2327, - JSCompiler_object_inline_digest_2328, - renderLanes, - null - )), - (JSCompiler_object_inline_message_2327.flags |= 2)), - (JSCompiler_object_inline_message_2327.return = workInProgress), - (JSCompiler_object_inline_stack_2329.return = workInProgress), - (JSCompiler_object_inline_stack_2329.sibling = - JSCompiler_object_inline_message_2327), - (workInProgress.child = JSCompiler_object_inline_stack_2329), - (JSCompiler_object_inline_stack_2329 = - JSCompiler_object_inline_message_2327), - (JSCompiler_object_inline_message_2327 = workInProgress.child), - (JSCompiler_object_inline_digest_2328 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2328 - ? (JSCompiler_object_inline_digest_2328 = - mountSuspenseOffscreenState(renderLanes)) - : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2328.cachePool), - null !== JSCompiler_temp - ? ((instance = CacheContext._currentValue), - (JSCompiler_temp = - JSCompiler_temp.parent !== instance - ? { parent: instance, pool: instance } - : JSCompiler_temp)) - : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2328 = { - baseLanes: - JSCompiler_object_inline_digest_2328.baseLanes | renderLanes, - cachePool: JSCompiler_temp - })), - (JSCompiler_object_inline_message_2327.memoizedState = - JSCompiler_object_inline_digest_2328), - (JSCompiler_object_inline_message_2327.childLanes = - getRemainingWorkInPrimaryTree( + } + if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); + else + return ( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( current, - JSCompiler_object_inline_componentStack_2330, + workInProgress, + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2329 - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { - mode: "visible", - children: JSCompiler_object_inline_stack_2329.children - }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; - null !== current && - ((JSCompiler_object_inline_componentStack_2330 = - workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2330 - ? ((workInProgress.deletions = [current]), - (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2330.push(current)); - workInProgress.child = renderLanes; - workInProgress.memoizedState = null; - return renderLanes; - } - function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: primaryChildren }, - workInProgress.mode - ); - primaryChildren.return = workInProgress; - return (workInProgress.child = primaryChildren); + ) + ); + } else + null !== prevState + ? (pushTransition(workInProgress, prevState.cachePool), + pushHiddenContext(workInProgress, prevState), + reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.memoizedState = null)) + : (null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(workInProgress), + reuseSuspenseHandlerOnStack(workInProgress)); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; } - function mountSuspenseFallbackChildren( + function deferHiddenOffscreenComponent( + current, workInProgress, - primaryChildren, - fallbackChildren, + nextBaseLanes, renderLanes ) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); - fallbackChildren = createFiberFromFragment( - fallbackChildren, - mode, - renderLanes, - null - ); - primaryChildren.return = workInProgress; - fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; - return fallbackChildren; + var JSCompiler_inline_result = peekCacheFromPool(); + JSCompiler_inline_result = + null === JSCompiler_inline_result + ? null + : { + parent: CacheContext._currentValue, + pool: JSCompiler_inline_result + }; + workInProgress.memoizedState = { + baseLanes: nextBaseLanes, + cachePool: JSCompiler_inline_result + }; + null !== current && pushTransition(workInProgress, null); + reuseHiddenContextOnStack(workInProgress); + pushOffscreenSuspenseHandler(workInProgress); + null !== current && + propagateParentContextChanges(current, workInProgress, renderLanes, !0); + return null; } - function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); + function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + ); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } } - function retrySuspenseComponentWithoutHydrating( + function updateFunctionComponent( current, workInProgress, + Component, + nextProps, renderLanes ) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountSuspensePrimaryChildren( + if ( + Component.prototype && + "function" === typeof Component.prototype.render + ) { + var componentName = getComponentNameFromType(Component) || "Unknown"; + didWarnAboutBadClass[componentName] || + (console.error( + "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", + componentName, + componentName + ), + (didWarnAboutBadClass[componentName] = !0)); + } + workInProgress.mode & StrictLegacyMode && + ReactStrictModeWarnings.recordLegacyContextWarning( + workInProgress, + null + ); + null === current && + (validateFunctionComponentInDev(workInProgress, workInProgress.type), + Component.contextTypes && + ((componentName = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), + console.error( + "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", + componentName + )))); + prepareToReadContext(workInProgress); + Component = renderWithHooks( + current, workInProgress, - workInProgress.pendingProps.children + Component, + nextProps, + void 0, + renderLanes ); - current.flags |= 2; - workInProgress.memoizedState = null; - return current; + nextProps = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && nextProps && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; } - function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { - fiber.lanes |= renderLanes; - var alternate = fiber.alternate; - null !== alternate && (alternate.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - propagationRoot + function replayFunctionComponent( + current, + workInProgress, + nextProps, + Component, + secondArg, + renderLanes + ) { + prepareToReadContext(workInProgress); + hookTypesUpdateIndexDev = -1; + ignorePreviousDependencies = + null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; + nextProps = renderWithHooksAgain( + workInProgress, + Component, + nextProps, + secondArg ); + finishRenderingHooks(current, workInProgress); + Component = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && Component && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; } - function validateSuspenseListNestedChild(childSlot, index) { - var isAnArray = isArrayImpl(childSlot); - childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot); - return isAnArray || childSlot - ? ((isAnArray = isAnArray ? "array" : "iterable"), + function updateClassComponent( + current$jscomp$0, + workInProgress, + Component, + nextProps, + renderLanes + ) { + switch (shouldErrorImpl(workInProgress)) { + case !1: + var _instance = workInProgress.stateNode, + state = new workInProgress.type( + workInProgress.memoizedProps, + _instance.context + ).state; + _instance.updater.enqueueSetState(_instance, state, null); + break; + case !0: + workInProgress.flags |= 128; + workInProgress.flags |= 65536; + _instance = Error("Simulated error coming from DevTools"); + var lane = renderLanes & -renderLanes; + workInProgress.lanes |= lane; + state = workInProgressRoot; + if (null === state) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + lane = createClassErrorUpdate(lane); + initializeClassErrorUpdate( + lane, + state, + workInProgress, + createCapturedValueAtFiber(_instance, workInProgress) + ); + enqueueCapturedUpdate(workInProgress, lane); + } + prepareToReadContext(workInProgress); + if (null === workInProgress.stateNode) { + state = emptyContextObject; + _instance = Component.contextType; + "contextType" in Component && + null !== _instance && + (void 0 === _instance || _instance.$$typeof !== REACT_CONTEXT_TYPE) && + !didWarnAboutInvalidateContextType.has(Component) && + (didWarnAboutInvalidateContextType.add(Component), + (lane = + void 0 === _instance + ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." + : "object" !== typeof _instance + ? " However, it is set to a " + typeof _instance + "." + : _instance.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(_instance).join(", ") + + "}."), console.error( - "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", - isAnArray, - index, - isAnArray - ), - !1) - : !0; - } - function initSuspenseListRenderState( - workInProgress, - isBackwards, - tail, - lastContentRow, - tailMode - ) { - var renderState = workInProgress.memoizedState; - null === renderState - ? (workInProgress.memoizedState = { - isBackwards: isBackwards, - rendering: null, - renderingStartTime: 0, - last: lastContentRow, - tail: tail, - tailMode: tailMode - }) - : ((renderState.isBackwards = isBackwards), - (renderState.rendering = null), - (renderState.renderingStartTime = 0), - (renderState.last = lastContentRow), - (renderState.tail = tail), - (renderState.tailMode = tailMode)); - } - function updateSuspenseListComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - revealOrder = nextProps.revealOrder, - tailMode = nextProps.tail; - nextProps = nextProps.children; - if ( - void 0 !== revealOrder && - "forwards" !== revealOrder && - "backwards" !== revealOrder && - "together" !== revealOrder && - !didWarnAboutRevealOrder[revealOrder] - ) - if ( - ((didWarnAboutRevealOrder[revealOrder] = !0), - "string" === typeof revealOrder) - ) - switch (revealOrder.toLowerCase()) { - case "together": - case "forwards": - case "backwards": - console.error( - '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.', - revealOrder, - revealOrder.toLowerCase() - ); - break; - case "forward": - case "backward": - console.error( - '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.', - revealOrder, - revealOrder.toLowerCase() - ); - break; - default: - console.error( - '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?', - revealOrder - ); + "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", + getComponentNameFromType(Component) || "Component", + lane + )); + "object" === typeof _instance && + null !== _instance && + (state = readContext(_instance)); + _instance = new Component(nextProps, state); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + _instance = new Component(nextProps, state); + } finally { + setIsStrictModeForDevtools(!1); } - else - console.error( - '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?', - revealOrder - ); - void 0 === tailMode || - didWarnAboutTailOptions[tailMode] || - ("collapsed" !== tailMode && "hidden" !== tailMode - ? ((didWarnAboutTailOptions[tailMode] = !0), - console.error( - '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?', - tailMode - )) - : "forwards" !== revealOrder && - "backwards" !== revealOrder && - ((didWarnAboutTailOptions[tailMode] = !0), + } + state = workInProgress.memoizedState = + null !== _instance.state && void 0 !== _instance.state + ? _instance.state + : null; + _instance.updater = classComponentUpdater; + workInProgress.stateNode = _instance; + _instance._reactInternals = workInProgress; + _instance._reactInternalInstance = fakeInternalInstance; + "function" === typeof Component.getDerivedStateFromProps && + null === state && + ((state = getComponentNameFromType(Component) || "Component"), + didWarnAboutUninitializedState.has(state) || + (didWarnAboutUninitializedState.add(state), console.error( - ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', - tailMode + "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", + state, + null === _instance.state ? "null" : "undefined", + state ))); - a: if ( - ("forwards" === revealOrder || "backwards" === revealOrder) && - void 0 !== nextProps && - null !== nextProps && - !1 !== nextProps - ) - if (isArrayImpl(nextProps)) - for (var i = 0; i < nextProps.length; i++) { - if (!validateSuspenseListNestedChild(nextProps[i], i)) break a; - } - else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) { - if ((i = i.call(nextProps))) - for (var step = i.next(), _i = 0; !step.done; step = i.next()) { - if (!validateSuspenseListNestedChild(step.value, _i)) break a; - _i++; - } - } else - console.error( - 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', - revealOrder - ); - reconcileChildren(current, workInProgress, nextProps, renderLanes); - nextProps = suspenseStackCursor.current; - if (0 !== (nextProps & ForceSuspenseFallback)) - (nextProps = - (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback), - (workInProgress.flags |= 128); - else { - if (null !== current && 0 !== (current.flags & 128)) - a: for (current = workInProgress.child; null !== current; ) { - if (13 === current.tag) - null !== current.memoizedState && - scheduleSuspenseWorkOnFiber( - current, - renderLanes, - workInProgress - ); - else if (19 === current.tag) - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (null !== current.child) { - current.child.return = current; - current = current.child; - continue; - } - if (current === workInProgress) break a; - for (; null === current.sibling; ) { - if (null === current.return || current.return === workInProgress) - break a; - current = current.return; - } - current.sibling.return = current.return; - current = current.sibling; - } - nextProps &= SubtreeSuspenseContextMask; - } - push(suspenseStackCursor, nextProps, workInProgress); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; + if ( + "function" === typeof Component.getDerivedStateFromProps || + "function" === typeof _instance.getSnapshotBeforeUpdate + ) { + var foundWillUpdateName = (lane = state = null); + "function" === typeof _instance.componentWillMount && + !0 !== _instance.componentWillMount.__suppressDeprecationWarning + ? (state = "componentWillMount") + : "function" === typeof _instance.UNSAFE_componentWillMount && + (state = "UNSAFE_componentWillMount"); + "function" === typeof _instance.componentWillReceiveProps && + !0 !== + _instance.componentWillReceiveProps.__suppressDeprecationWarning + ? (lane = "componentWillReceiveProps") + : "function" === + typeof _instance.UNSAFE_componentWillReceiveProps && + (lane = "UNSAFE_componentWillReceiveProps"); + "function" === typeof _instance.componentWillUpdate && + !0 !== _instance.componentWillUpdate.__suppressDeprecationWarning + ? (foundWillUpdateName = "componentWillUpdate") + : "function" === typeof _instance.UNSAFE_componentWillUpdate && + (foundWillUpdateName = "UNSAFE_componentWillUpdate"); + if (null !== state || null !== lane || null !== foundWillUpdateName) { + _instance = getComponentNameFromType(Component) || "Component"; + var newApiName = + "function" === typeof Component.getDerivedStateFromProps + ? "getDerivedStateFromProps()" + : "getSnapshotBeforeUpdate()"; + didWarnAboutLegacyLifecyclesAndDerivedState.has(_instance) || + (didWarnAboutLegacyLifecyclesAndDerivedState.add(_instance), + console.error( + "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", + _instance, + newApiName, + null !== state ? "\n " + state : "", + null !== lane ? "\n " + lane : "", + null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" + )); } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode + } + _instance = workInProgress.stateNode; + state = getComponentNameFromType(Component) || "Component"; + _instance.render || + (Component.prototype && + "function" === typeof Component.prototype.render + ? console.error( + "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", + state + ) + : console.error( + "No `render` method found on the %s instance: you may have forgotten to define `render`.", + state + )); + !_instance.getInitialState || + _instance.getInitialState.isReactClassApproved || + _instance.state || + console.error( + "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", + state ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } - return workInProgress.child; - } - function bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ) { - null !== current && (workInProgress.dependencies = current.dependencies); - profilerStartTime = -1; - workInProgressRootSkippedLanes |= workInProgress.lanes; - if (0 === (renderLanes & workInProgress.childLanes)) - if (null !== current) { - if ( - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - 0 === (renderLanes & workInProgress.childLanes)) - ) - return null; - } else return null; - if (null !== current && workInProgress.child !== current.child) - throw Error("Resuming work not yet implemented."); - if (null !== workInProgress.child) { - current = workInProgress.child; - renderLanes = createWorkInProgress(current, current.pendingProps); - workInProgress.child = renderLanes; - for (renderLanes.return = workInProgress; null !== current.sibling; ) - (current = current.sibling), - (renderLanes = renderLanes.sibling = - createWorkInProgress(current, current.pendingProps)), - (renderLanes.return = workInProgress); - renderLanes.sibling = null; - } - return workInProgress.child; - } - function checkScheduledUpdateOrContext(current, renderLanes) { - if (0 !== (current.lanes & renderLanes)) return !0; - current = current.dependencies; - return null !== current && checkIfContextChanged(current) ? !0 : !1; - } - function attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) { - switch (workInProgress.tag) { - case 3: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo + _instance.getDefaultProps && + !_instance.getDefaultProps.isReactClassApproved && + console.error( + "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", + state ); - pushProvider( - workInProgress, - CacheContext, - current.memoizedState.cache + _instance.contextType && + console.error( + "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", + state ); - resetHydrationState(); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 4: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo + Component.childContextTypes && + !didWarnAboutChildContextTypes.has(Component) && + (didWarnAboutChildContextTypes.add(Component), + console.error( + "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)", + state + )); + Component.contextTypes && + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), + console.error( + "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", + state + )); + "function" === typeof _instance.componentShouldUpdate && + console.error( + "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", + state ); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value + Component.prototype && + Component.prototype.isPureReactComponent && + "undefined" !== typeof _instance.shouldComponentUpdate && + console.error( + "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", + getComponentNameFromType(Component) || "A pure component" ); - break; - case 12: - 0 !== (renderLanes & workInProgress.childLanes) && - (workInProgress.flags |= 4); - workInProgress.flags |= 2048; - var stateNode = workInProgress.stateNode; - stateNode.effectDuration = -0; - stateNode.passiveEffectDuration = -0; - break; - case 13: - stateNode = workInProgress.memoizedState; - if (null !== stateNode) { - if (null !== stateNode.dehydrated) - return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - if (0 !== (renderLanes & workInProgress.child.childLanes)) - return updateSuspenseComponent( - current, - workInProgress, - renderLanes - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - current = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - return null !== current ? current.sibling : null; - } - pushPrimaryTreeSuspenseHandler(workInProgress); - break; - case 19: - var didSuspendBefore = 0 !== (current.flags & 128); - stateNode = 0 !== (renderLanes & workInProgress.childLanes); - stateNode || - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); - if (didSuspendBefore) { - if (stateNode) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - workInProgress.flags |= 128; - } - didSuspendBefore = workInProgress.memoizedState; - null !== didSuspendBefore && - ((didSuspendBefore.rendering = null), - (didSuspendBefore.tail = null), - (didSuspendBefore.lastEffect = null)); - push( - suspenseStackCursor, - suspenseStackCursor.current, - workInProgress + "function" === typeof _instance.componentDidUnmount && + console.error( + "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", + state + ); + "function" === typeof _instance.componentDidReceiveProps && + console.error( + "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", + state + ); + "function" === typeof _instance.componentWillRecieveProps && + console.error( + "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", + state + ); + "function" === typeof _instance.UNSAFE_componentWillRecieveProps && + console.error( + "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", + state + ); + lane = _instance.props !== nextProps; + void 0 !== _instance.props && + lane && + console.error( + "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", + state + ); + _instance.defaultProps && + console.error( + "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", + state, + state + ); + "function" !== typeof _instance.getSnapshotBeforeUpdate || + "function" === typeof _instance.componentDidUpdate || + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) || + (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component), + console.error( + "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", + getComponentNameFromType(Component) + )); + "function" === typeof _instance.getDerivedStateFromProps && + console.error( + "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + state + ); + "function" === typeof _instance.getDerivedStateFromError && + console.error( + "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + state + ); + "function" === typeof Component.getSnapshotBeforeUpdate && + console.error( + "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", + state ); - if (stateNode) break; - else return null; - case 22: - case 23: - return ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) + (lane = _instance.state) && + ("object" !== typeof lane || isArrayImpl(lane)) && + console.error("%s.state: must be set to an object or null", state); + "function" === typeof _instance.getChildContext && + "object" !== typeof Component.childContextTypes && + console.error( + "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", + state ); - case 24: - pushProvider( + _instance = workInProgress.stateNode; + _instance.props = nextProps; + _instance.state = workInProgress.memoizedState; + _instance.refs = {}; + initializeUpdateQueue(workInProgress); + state = Component.contextType; + _instance.context = + "object" === typeof state && null !== state + ? readContext(state) + : emptyContextObject; + _instance.state === nextProps && + ((state = getComponentNameFromType(Component) || "Component"), + didWarnAboutDirectlyAssigningPropsToState.has(state) || + (didWarnAboutDirectlyAssigningPropsToState.add(state), + console.error( + "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", + state + ))); + workInProgress.mode & StrictLegacyMode && + ReactStrictModeWarnings.recordLegacyContextWarning( workInProgress, - CacheContext, - current.memoizedState.cache + _instance ); - } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); - } - function beginWork(current, workInProgress, renderLanes) { - if (workInProgress._debugNeedsRemount && null !== current) { - renderLanes = createFiberFromTypeAndProps( - workInProgress.type, - workInProgress.key, - workInProgress.pendingProps, - workInProgress._debugOwner || null, - workInProgress.mode, - workInProgress.lanes + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( + workInProgress, + _instance ); - renderLanes._debugStack = workInProgress._debugStack; - renderLanes._debugTask = workInProgress._debugTask; - var returnFiber = workInProgress.return; - if (null === returnFiber) throw Error("Cannot swap the root fiber."); - current.alternate = null; - workInProgress.alternate = null; - renderLanes.index = workInProgress.index; - renderLanes.sibling = workInProgress.sibling; - renderLanes.return = workInProgress.return; - renderLanes.ref = workInProgress.ref; - renderLanes._debugInfo = workInProgress._debugInfo; - if (workInProgress === returnFiber.child) - returnFiber.child = renderLanes; - else { - var prevSibling = returnFiber.child; - if (null === prevSibling) - throw Error("Expected parent to have a child."); - for (; prevSibling.sibling !== workInProgress; ) - if (((prevSibling = prevSibling.sibling), null === prevSibling)) - throw Error("Expected to find the previous sibling."); - prevSibling.sibling = renderLanes; - } - workInProgress = returnFiber.deletions; - null === workInProgress - ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) - : workInProgress.push(current); - renderLanes.flags |= 2; - return renderLanes; - } - if (null !== current) - if ( - current.memoizedProps !== workInProgress.pendingProps || - workInProgress.type !== current.type - ) - didReceiveUpdate = !0; - else { - if ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) - ) - return ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, + _instance.state = workInProgress.memoizedState; + state = Component.getDerivedStateFromProps; + "function" === typeof state && + (applyDerivedStateFromProps( + workInProgress, + Component, + state, + nextProps + ), + (_instance.state = workInProgress.memoizedState)); + "function" === typeof Component.getDerivedStateFromProps || + "function" === typeof _instance.getSnapshotBeforeUpdate || + ("function" !== typeof _instance.UNSAFE_componentWillMount && + "function" !== typeof _instance.componentWillMount) || + ((state = _instance.state), + "function" === typeof _instance.componentWillMount && + _instance.componentWillMount(), + "function" === typeof _instance.UNSAFE_componentWillMount && + _instance.UNSAFE_componentWillMount(), + state !== _instance.state && + (console.error( + "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + getComponentNameFromFiber(workInProgress) || "Component" + ), + classComponentUpdater.enqueueReplaceState( + _instance, + _instance.state, + null + )), + processUpdateQueue(workInProgress, nextProps, _instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (_instance.state = workInProgress.memoizedState)); + "function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308); + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864); + _instance = !0; + } else if (null === current$jscomp$0) { + _instance = workInProgress.stateNode; + var unresolvedOldProps = workInProgress.memoizedProps; + lane = resolveClassComponentProps(Component, unresolvedOldProps); + _instance.props = lane; + var oldContext = _instance.context; + foundWillUpdateName = Component.contextType; + state = emptyContextObject; + "object" === typeof foundWillUpdateName && + null !== foundWillUpdateName && + (state = readContext(foundWillUpdateName)); + newApiName = Component.getDerivedStateFromProps; + foundWillUpdateName = + "function" === typeof newApiName || + "function" === typeof _instance.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + foundWillUpdateName || + ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof _instance.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== state) && + callComponentWillReceiveProps( + workInProgress, + _instance, + nextProps, + state + )); + hasForceUpdate = !1; + var oldState = workInProgress.memoizedState; + _instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + oldContext = workInProgress.memoizedState; + unresolvedOldProps || oldState !== oldContext || hasForceUpdate + ? ("function" === typeof newApiName && + (applyDerivedStateFromProps( + workInProgress, + Component, + newApiName, + nextProps + ), + (oldContext = workInProgress.memoizedState)), + (lane = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + lane, + nextProps, + oldState, + oldContext, + state + )) + ? (foundWillUpdateName || + ("function" !== typeof _instance.UNSAFE_componentWillMount && + "function" !== typeof _instance.componentWillMount) || + ("function" === typeof _instance.componentWillMount && + _instance.componentWillMount(), + "function" === typeof _instance.UNSAFE_componentWillMount && + _instance.UNSAFE_componentWillMount()), + "function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864)) + : ("function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (_instance.props = nextProps), + (_instance.state = oldContext), + (_instance.context = state), + (_instance = lane)) + : ("function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864), + (_instance = !1)); + } else { + _instance = workInProgress.stateNode; + cloneUpdateQueue(current$jscomp$0, workInProgress); + state = workInProgress.memoizedProps; + foundWillUpdateName = resolveClassComponentProps(Component, state); + _instance.props = foundWillUpdateName; + newApiName = workInProgress.pendingProps; + oldState = _instance.context; + oldContext = Component.contextType; + lane = emptyContextObject; + "object" === typeof oldContext && + null !== oldContext && + (lane = readContext(oldContext)); + unresolvedOldProps = Component.getDerivedStateFromProps; + (oldContext = + "function" === typeof unresolvedOldProps || + "function" === typeof _instance.getSnapshotBeforeUpdate) || + ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof _instance.componentWillReceiveProps) || + ((state !== newApiName || oldState !== lane) && + callComponentWillReceiveProps( + workInProgress, + _instance, + nextProps, + lane + )); + hasForceUpdate = !1; + oldState = workInProgress.memoizedState; + _instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + state !== newApiName || + oldState !== newState || + hasForceUpdate || + (null !== current$jscomp$0 && + null !== current$jscomp$0.dependencies && + checkIfContextChanged(current$jscomp$0.dependencies)) + ? ("function" === typeof unresolvedOldProps && + (applyDerivedStateFromProps( workInProgress, - renderLanes - ) - ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; - } - else { - didReceiveUpdate = !1; - if ((returnFiber = isHydrating)) - warnIfNotHydrating(), - (returnFiber = 0 !== (workInProgress.flags & 1048576)); - returnFiber && - ((returnFiber = workInProgress.index), - warnIfNotHydrating(), - pushTreeId(workInProgress, treeForkCount, returnFiber)); + Component, + unresolvedOldProps, + nextProps + ), + (newState = workInProgress.memoizedState)), + (foundWillUpdateName = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + foundWillUpdateName, + nextProps, + oldState, + newState, + lane + ) || + (null !== current$jscomp$0 && + null !== current$jscomp$0.dependencies && + checkIfContextChanged(current$jscomp$0.dependencies))) + ? (oldContext || + ("function" !== typeof _instance.UNSAFE_componentWillUpdate && + "function" !== typeof _instance.componentWillUpdate) || + ("function" === typeof _instance.componentWillUpdate && + _instance.componentWillUpdate(nextProps, newState, lane), + "function" === typeof _instance.UNSAFE_componentWillUpdate && + _instance.UNSAFE_componentWillUpdate( + nextProps, + newState, + lane + )), + "function" === typeof _instance.componentDidUpdate && + (workInProgress.flags |= 4), + "function" === typeof _instance.getSnapshotBeforeUpdate && + (workInProgress.flags |= 1024)) + : ("function" !== typeof _instance.componentDidUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof _instance.getSnapshotBeforeUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 1024), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = newState)), + (_instance.props = nextProps), + (_instance.state = newState), + (_instance.context = lane), + (_instance = foundWillUpdateName)) + : ("function" !== typeof _instance.componentDidUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof _instance.getSnapshotBeforeUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 1024), + (_instance = !1)); } - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 16: - a: if ( - ((returnFiber = workInProgress.pendingProps), - (current = callLazyInitInDEV(workInProgress.elementType)), - (workInProgress.type = current), - "function" === typeof current) - ) - shouldConstruct(current) - ? ((returnFiber = resolveClassComponentProps( - current, - returnFiber - )), - (workInProgress.tag = 1), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateClassComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))) - : ((workInProgress.tag = 0), - validateFunctionComponentInDev(workInProgress, current), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))); - else { - if (void 0 !== current && null !== current) - if ( - ((prevSibling = current.$$typeof), - prevSibling === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress.type = current = - resolveForwardRefForHotReloading(current); - workInProgress = updateForwardRef( - null, - workInProgress, - current, - returnFiber, - renderLanes - ); - break a; - } else if (prevSibling === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ); - break a; - } - workInProgress = ""; - null !== current && - "object" === typeof current && - current.$$typeof === REACT_LAZY_TYPE && - (workInProgress = - " Did you wrap a component in React.lazy() more than once?"); - current = getComponentNameFromType(current) || current; - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - current + - ". Lazy element type must resolve to a class or function." + - workInProgress - ); + lane = _instance; + markRef(current$jscomp$0, workInProgress); + state = 0 !== (workInProgress.flags & 128); + if (lane || state) { + lane = workInProgress.stateNode; + ReactSharedInternals.getCurrentStack = + null === workInProgress ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = workInProgress; + if (state && "function" !== typeof Component.getDerivedStateFromError) + (Component = null), (profilerStartTime = -1); + else if ( + ((Component = callRenderInDEV(lane)), + workInProgress.mode & StrictLegacyMode) + ) { + setIsStrictModeForDevtools(!0); + try { + callRenderInDEV(lane); + } finally { + setIsStrictModeForDevtools(!1); } - return workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 1: - return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( - returnFiber, - workInProgress.pendingProps - )), - updateClassComponent( - current, + } + workInProgress.flags |= 1; + null !== current$jscomp$0 && state + ? ((workInProgress.child = reconcileChildFibers( workInProgress, - returnFiber, - prevSibling, + current$jscomp$0.child, + null, renderLanes - ) - ); - case 3: - a: { - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ); - if (null === current) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - var nextProps = workInProgress.pendingProps; - prevSibling = workInProgress.memoizedState; - returnFiber = prevSibling.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - var nextState = workInProgress.memoizedState; - nextProps = nextState.cache; - pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ); - suspendIfUpdateReadFromEntangledAsyncAction(); - nextProps = nextState.element; - if (prevSibling.isDehydrated) - if ( - ((prevSibling = { - element: nextProps, - isDehydrated: !1, - cache: nextState.cache - }), - (workInProgress.updateQueue.baseState = prevSibling), - (workInProgress.memoizedState = prevSibling), - workInProgress.flags & 256) - ) { - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else if (nextProps !== returnFiber) { - returnFiber = createCapturedValueAtFiber( - Error( - "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." - ), - workInProgress - ); - queueHydrationError(returnFiber); - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + Component, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + Component, + renderLanes + ); + workInProgress.memoizedState = lane.state; + current$jscomp$0 = workInProgress.child; + } else + current$jscomp$0 = bailoutOnAlreadyFinishedWork( + current$jscomp$0, + workInProgress, + renderLanes + ); + renderLanes = workInProgress.stateNode; + _instance && + renderLanes.props !== nextProps && + (didWarnAboutReassigningProps || + console.error( + "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", + getComponentNameFromFiber(workInProgress) || "a component" + ), + (didWarnAboutReassigningProps = !0)); + return current$jscomp$0; + } + function mountHostRootWithoutHydrating( + current, + workInProgress, + nextChildren, + renderLanes + ) { + resetHydrationState(); + workInProgress.flags |= 256; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function validateFunctionComponentInDev(workInProgress, Component) { + Component && + Component.childContextTypes && + console.error( + "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", + Component.displayName || Component.name || "Component" + ); + "function" === typeof Component.getDerivedStateFromProps && + ((workInProgress = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] || + (console.error( + "%s: Function components do not support getDerivedStateFromProps.", + workInProgress + ), + (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] = + !0))); + "object" === typeof Component.contextType && + null !== Component.contextType && + ((Component = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypeOnFunctionComponent[Component] || + (console.error( + "%s: Function components do not support contextType.", + Component + ), + (didWarnAboutContextTypeOnFunctionComponent[Component] = !0))); + } + function mountSuspenseOffscreenState(renderLanes) { + return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; + } + function getRemainingWorkInPrimaryTree( + current, + primaryTreeDidDefer, + renderLanes + ) { + current = null !== current ? current.childLanes & ~renderLanes : 0; + primaryTreeDidDefer && (current |= workInProgressDeferredLane); + return current; + } + function updateSuspenseComponent(current, workInProgress, renderLanes) { + var JSCompiler_object_inline_componentStack_2425; + var JSCompiler_object_inline_stack_2424 = workInProgress.pendingProps; + shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); + var JSCompiler_object_inline_message_2422 = !1; + var didSuspend = 0 !== (workInProgress.flags & 128); + (JSCompiler_object_inline_componentStack_2425 = didSuspend) || + (JSCompiler_object_inline_componentStack_2425 = + null !== current && null === current.memoizedState + ? !1 + : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); + JSCompiler_object_inline_componentStack_2425 && + ((JSCompiler_object_inline_message_2422 = !0), + (workInProgress.flags &= -129)); + JSCompiler_object_inline_componentStack_2425 = + 0 !== (workInProgress.flags & 32); + workInProgress.flags &= -33; + if (null === current) { + if (isHydrating) { + JSCompiler_object_inline_message_2422 + ? pushPrimaryTreeSuspenseHandler(workInProgress) + : reuseSuspenseHandlerOnStack(workInProgress); + if (isHydrating) { + var JSCompiler_object_inline_digest_2423 = nextHydratableInstance; + var JSCompiler_temp; + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2423)) { + c: { + var instance = JSCompiler_object_inline_digest_2423; for ( - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ), - hydrationParentFiber = workInProgress, - isHydrating = !0, - hydrationErrors = null, - didSuspendOrErrorDEV = !1, - hydrationDiffRootDEV = null, - rootOrSingletonContext = !0, - current = mountChildFibers( - workInProgress, - null, - nextProps, - renderLanes - ), - workInProgress.child = current; - current; + JSCompiler_temp = rootOrSingletonContext; + 8 !== instance.nodeType; - ) - (current.flags = (current.flags & -3) | 4096), - (current = current.sibling); - else { - resetHydrationState(); - if (nextProps === returnFiber) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; + ) { + if (!JSCompiler_temp) { + JSCompiler_temp = null; + break c; + } + instance = getNextHydratable(instance.nextSibling); + if (null === instance) { + JSCompiler_temp = null; + break c; + } + } + JSCompiler_temp = instance; } - reconcileChildren( - current, - workInProgress, - nextProps, - renderLanes - ); + null !== JSCompiler_temp + ? (warnIfNotHydrating(), + (workInProgress.memoizedState = { + dehydrated: JSCompiler_temp, + treeContext: + null !== treeContextProvider + ? { id: treeContextId, overflow: treeContextOverflow } + : null, + retryLane: 536870912 + }), + (instance = createFiber(18, null, null, NoMode)), + (instance.stateNode = JSCompiler_temp), + (instance.return = workInProgress), + (workInProgress.child = instance), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (JSCompiler_temp = !0)) + : (JSCompiler_temp = !1); + JSCompiler_temp = !JSCompiler_temp; } - workInProgress = workInProgress.child; + JSCompiler_temp && + (warnNonHydratedInstance( + workInProgress, + JSCompiler_object_inline_digest_2423 + ), + throwOnHydrationMismatch(workInProgress)); } - return workInProgress; - case 26: - return ( - markRef(current, workInProgress), - null === current - ? (current = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - )) - ? (workInProgress.memoizedState = current) - : isHydrating || - ((current = workInProgress.type), - (renderLanes = workInProgress.pendingProps), - (returnFiber = requiredContext( - rootInstanceStackCursor.current - )), - (returnFiber = - getOwnerDocumentFromRootContainer( - returnFiber - ).createElement(current)), - (returnFiber[internalInstanceKey] = workInProgress), - (returnFiber[internalPropsKey] = renderLanes), - setInitialProperties(returnFiber, current, renderLanes), - markNodeAsHoistable(returnFiber), - (workInProgress.stateNode = returnFiber)) - : (workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - )), - null - ); - case 27: - return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((prevSibling = requiredContext(rootInstanceStackCursor.current)), - (returnFiber = getHostContext()), - (prevSibling = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - prevSibling, - returnFiber, - !1 - )), - didSuspendOrErrorDEV || - ((returnFiber = diffHydratedProperties( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - returnFiber - )), - null !== returnFiber && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - returnFiber)), - (hydrationParentFiber = workInProgress), - (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable( - prevSibling.firstChild - ))), - (returnFiber = workInProgress.pendingProps.children), - null !== current || isHydrating - ? reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ) - : (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - returnFiber, - renderLanes - )), - markRef(current, workInProgress), - workInProgress.child - ); - case 5: + JSCompiler_object_inline_digest_2423 = workInProgress.memoizedState; + if ( + null !== JSCompiler_object_inline_digest_2423 && + ((JSCompiler_object_inline_digest_2423 = + JSCompiler_object_inline_digest_2423.dehydrated), + null !== JSCompiler_object_inline_digest_2423) + ) + return ( + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2423) + ? (workInProgress.lanes = 32) + : (workInProgress.lanes = 536870912), + null + ); + popSuspenseHandler(workInProgress); + } + JSCompiler_object_inline_digest_2423 = + JSCompiler_object_inline_stack_2424.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2424.fallback; + if (JSCompiler_object_inline_message_2422) return ( - null === current && - isHydrating && - ((nextProps = getHostContext()), - (returnFiber = validateDOMNesting( - workInProgress.type, - nextProps.ancestorInfo + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_stack_2424 = + mountSuspenseFallbackChildren( + workInProgress, + JSCompiler_object_inline_digest_2423, + JSCompiler_temp, + renderLanes )), - (prevSibling = nextHydratableInstance), - (nextState = !prevSibling) || - ((nextState = canHydrateInstance( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== nextState - ? ((workInProgress.stateNode = nextState), - didSuspendOrErrorDEV || - ((nextProps = diffHydratedProperties( - nextState, - workInProgress.type, - workInProgress.pendingProps, - nextProps - )), - null !== nextProps && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - nextProps)), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = getNextHydratable( - nextState.firstChild - )), - (rootOrSingletonContext = !1), - (nextProps = !0)) - : (nextProps = !1), - (nextState = !nextProps)), - nextState && - (returnFiber && - warnNonHydratedInstance(workInProgress, prevSibling), - throwOnHydrationMismatch(workInProgress))), - pushHostContext(workInProgress), - (prevSibling = workInProgress.type), - (nextProps = workInProgress.pendingProps), - (nextState = null !== current ? current.memoizedProps : null), - (returnFiber = nextProps.children), - shouldSetTextContent(prevSibling, nextProps) - ? (returnFiber = null) - : null !== nextState && - shouldSetTextContent(prevSibling, nextState) && - (workInProgress.flags |= 32), - null !== workInProgress.memoizedState && - ((prevSibling = renderWithHooks( + (JSCompiler_object_inline_message_2422 = workInProgress.child), + (JSCompiler_object_inline_message_2422.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_message_2422.childLanes = + getRemainingWorkInPrimaryTree( current, - workInProgress, - TransitionAwareHostComponent, - null, - null, + JSCompiler_object_inline_componentStack_2425, renderLanes )), - (HostTransitionContext._currentValue = prevSibling)), - markRef(current, workInProgress), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child - ); - case 6: - return ( - null === current && - isHydrating && - ((current = workInProgress.pendingProps), - (renderLanes = getHostContext().ancestorInfo.current), - (current = - null != renderLanes - ? validateTextNesting(current, renderLanes.tag) - : !0), - (renderLanes = nextHydratableInstance), - (returnFiber = !renderLanes) || - ((returnFiber = canHydrateTextInstance( - renderLanes, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== returnFiber - ? ((workInProgress.stateNode = returnFiber), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (returnFiber = !0)) - : (returnFiber = !1), - (returnFiber = !returnFiber)), - returnFiber && - (current && - warnNonHydratedInstance(workInProgress, renderLanes), - throwOnHydrationMismatch(workInProgress))), - null - ); - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ), - (returnFiber = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - returnFiber, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child - ); - case 11: - return updateForwardRef( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 7: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child - ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 12: - return ( - (workInProgress.flags |= 4), - (workInProgress.flags |= 2048), - (returnFiber = workInProgress.stateNode), - (returnFiber.effectDuration = -0), - (returnFiber.passiveEffectDuration = -0), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + (workInProgress.memoizedState = SUSPENDED_MARKER), + JSCompiler_object_inline_stack_2424 ); - case 10: + if ( + "number" === + typeof JSCompiler_object_inline_stack_2424.unstable_expectedLoadTime + ) return ( - (returnFiber = workInProgress.type), - (prevSibling = workInProgress.pendingProps), - (nextProps = prevSibling.value), - "value" in prevSibling || - hasWarnedAboutUsingNoValuePropOnContextProvider || - ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), - console.error( - "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_stack_2424 = + mountSuspenseFallbackChildren( + workInProgress, + JSCompiler_object_inline_digest_2423, + JSCompiler_temp, + renderLanes )), - pushProvider(workInProgress, returnFiber, nextProps), - reconcileChildren( - current, - workInProgress, - prevSibling.children, - renderLanes - ), - workInProgress.child + (JSCompiler_object_inline_message_2422 = workInProgress.child), + (JSCompiler_object_inline_message_2422.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_message_2422.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_componentStack_2425, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress.lanes = 4194304), + JSCompiler_object_inline_stack_2424 ); - case 9: - return ( - (prevSibling = workInProgress.type._context), - (returnFiber = workInProgress.pendingProps.children), - "function" !== typeof returnFiber && - console.error( - "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." - ), - prepareToReadContext(workInProgress), - (prevSibling = readContext(prevSibling)), - (returnFiber = callComponentInDEV( - returnFiber, - prevSibling, - void 0 - )), - (workInProgress.flags |= 1), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren( + workInProgress, + JSCompiler_object_inline_digest_2423 + ); + } + var prevState = current.memoizedState; + if ( + null !== prevState && + ((JSCompiler_object_inline_digest_2423 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2423) + ) { + if (didSuspend) + workInProgress.flags & 256 + ? (pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags &= -257), + (workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ))) + : null !== workInProgress.memoizedState + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_message_2422 = + JSCompiler_object_inline_stack_2424.fallback), + (JSCompiler_object_inline_digest_2423 = workInProgress.mode), + (JSCompiler_object_inline_stack_2424 = + mountWorkInProgressOffscreenFiber( + { + mode: "visible", + children: JSCompiler_object_inline_stack_2424.children + }, + JSCompiler_object_inline_digest_2423 + )), + (JSCompiler_object_inline_message_2422 = + createFiberFromFragment( + JSCompiler_object_inline_message_2422, + JSCompiler_object_inline_digest_2423, + renderLanes, + null + )), + (JSCompiler_object_inline_message_2422.flags |= 2), + (JSCompiler_object_inline_stack_2424.return = workInProgress), + (JSCompiler_object_inline_message_2422.return = workInProgress), + (JSCompiler_object_inline_stack_2424.sibling = + JSCompiler_object_inline_message_2422), + (workInProgress.child = JSCompiler_object_inline_stack_2424), + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (JSCompiler_object_inline_stack_2424 = workInProgress.child), + (JSCompiler_object_inline_stack_2424.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_stack_2424.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_componentStack_2425, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = JSCompiler_object_inline_message_2422)); + else if ( + (pushPrimaryTreeSuspenseHandler(workInProgress), + isHydrating && + console.error( + "We should not be hydrating here. This is a bug in React. Please file a bug." ), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 15: - return updateSimpleMemoComponent( + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2423)) + ) { + JSCompiler_object_inline_componentStack_2425 = + JSCompiler_object_inline_digest_2423.nextSibling && + JSCompiler_object_inline_digest_2423.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2425) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2425.dgst; + var message = JSCompiler_object_inline_componentStack_2425.msg; + instance = JSCompiler_object_inline_componentStack_2425.stck; + var componentStack = + JSCompiler_object_inline_componentStack_2425.cstck; + } + JSCompiler_object_inline_message_2422 = message; + JSCompiler_object_inline_digest_2423 = JSCompiler_temp; + JSCompiler_object_inline_stack_2424 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2425 = + componentStack; + "POSTPONE" !== JSCompiler_object_inline_digest_2423 && + ((JSCompiler_object_inline_componentStack_2425 = + JSCompiler_object_inline_message_2422 + ? Error(JSCompiler_object_inline_message_2422) + : Error( + "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." + )), + (JSCompiler_object_inline_componentStack_2425.stack = + JSCompiler_object_inline_stack_2424 || ""), + (JSCompiler_object_inline_componentStack_2425.digest = + JSCompiler_object_inline_digest_2423), + (JSCompiler_object_inline_stack_2424 = + void 0 === JSCompiler_temp ? null : JSCompiler_temp), + (JSCompiler_object_inline_message_2422 = { + value: JSCompiler_object_inline_componentStack_2425, + source: null, + stack: JSCompiler_object_inline_stack_2424 + }), + "string" === typeof JSCompiler_object_inline_stack_2424 && + CapturedStacks.set( + JSCompiler_object_inline_componentStack_2425, + JSCompiler_object_inline_message_2422 + ), + queueHydrationError(JSCompiler_object_inline_message_2422)); + workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - workInProgress.type, - workInProgress.pendingProps, renderLanes ); - case 19: - return updateSuspenseListComponent( + } else if ( + (didReceiveUpdate || + propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (JSCompiler_object_inline_componentStack_2425 = + 0 !== (renderLanes & current.childLanes)), + didReceiveUpdate || JSCompiler_object_inline_componentStack_2425) + ) { + JSCompiler_object_inline_componentStack_2425 = workInProgressRoot; + if ( + null !== JSCompiler_object_inline_componentStack_2425 && + ((JSCompiler_object_inline_stack_2424 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2424 = + 0 !== (JSCompiler_object_inline_stack_2424 & 42) + ? 1 + : getBumpedLaneForHydrationByLane( + JSCompiler_object_inline_stack_2424 + )), + (JSCompiler_object_inline_stack_2424 = + 0 !== + (JSCompiler_object_inline_stack_2424 & + (JSCompiler_object_inline_componentStack_2425.suspendedLanes | + renderLanes)) + ? 0 + : JSCompiler_object_inline_stack_2424), + 0 !== JSCompiler_object_inline_stack_2424 && + JSCompiler_object_inline_stack_2424 !== prevState.retryLane) + ) + throw ( + ((prevState.retryLane = JSCompiler_object_inline_stack_2424), + enqueueConcurrentRenderForLane( + current, + JSCompiler_object_inline_stack_2424 + ), + scheduleUpdateOnFiber( + JSCompiler_object_inline_componentStack_2425, + current, + JSCompiler_object_inline_stack_2424 + ), + SelectiveHydrationException) + ); + JSCompiler_object_inline_digest_2423.data === + SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); + workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, renderLanes ); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (returnFiber = readContext(CacheContext)), - null === current - ? ((prevSibling = peekCacheFromPool()), - null === prevSibling && - ((prevSibling = workInProgressRoot), - (nextProps = createCache()), - (prevSibling.pooledCache = nextProps), - retainCache(nextProps), - null !== nextProps && - (prevSibling.pooledCacheLanes |= renderLanes), - (prevSibling = nextProps)), - (workInProgress.memoizedState = { - parent: returnFiber, - cache: prevSibling - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, prevSibling)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (prevSibling = current.memoizedState), - (nextProps = workInProgress.memoizedState), - prevSibling.parent !== returnFiber - ? ((prevSibling = { - parent: returnFiber, - cache: returnFiber - }), - (workInProgress.memoizedState = prevSibling), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - prevSibling), - pushProvider(workInProgress, CacheContext, returnFiber)) - : ((returnFiber = nextProps.cache), - pushProvider(workInProgress, CacheContext, returnFiber), - returnFiber !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( + } else + JSCompiler_object_inline_digest_2423.data === + SUSPENSE_PENDING_START_DATA + ? ((workInProgress.flags |= 192), + (workInProgress.child = current.child), + (workInProgress = null)) + : ((current = prevState.treeContext), + (nextHydratableInstance = getNextHydratable( + JSCompiler_object_inline_digest_2423.nextSibling + )), + (hydrationParentFiber = workInProgress), + (isHydrating = !0), + (hydrationErrors = null), + (didSuspendOrErrorDEV = !1), + (hydrationDiffRootDEV = null), + (rootOrSingletonContext = !1), + null !== current && + (warnIfNotHydrating(), + (idStack[idStackIndex++] = treeContextId), + (idStack[idStackIndex++] = treeContextOverflow), + (idStack[idStackIndex++] = treeContextProvider), + (treeContextId = current.id), + (treeContextOverflow = current.overflow), + (treeContextProvider = workInProgress)), + (workInProgress = mountSuspensePrimaryChildren( + workInProgress, + JSCompiler_object_inline_stack_2424.children + )), + (workInProgress.flags |= 4096)); + return workInProgress; + } + if (JSCompiler_object_inline_message_2422) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_message_2422 = + JSCompiler_object_inline_stack_2424.fallback), + (JSCompiler_object_inline_digest_2423 = workInProgress.mode), + (JSCompiler_temp = current.child), + (instance = JSCompiler_temp.sibling), + (JSCompiler_object_inline_stack_2424 = createWorkInProgress( + JSCompiler_temp, + { + mode: "hidden", + children: JSCompiler_object_inline_stack_2424.children + } + )), + (JSCompiler_object_inline_stack_2424.subtreeFlags = + JSCompiler_temp.subtreeFlags & 31457280), + null !== instance + ? (JSCompiler_object_inline_message_2422 = createWorkInProgress( + instance, + JSCompiler_object_inline_message_2422 + )) + : ((JSCompiler_object_inline_message_2422 = createFiberFromFragment( + JSCompiler_object_inline_message_2422, + JSCompiler_object_inline_digest_2423, + renderLanes, + null + )), + (JSCompiler_object_inline_message_2422.flags |= 2)), + (JSCompiler_object_inline_message_2422.return = workInProgress), + (JSCompiler_object_inline_stack_2424.return = workInProgress), + (JSCompiler_object_inline_stack_2424.sibling = + JSCompiler_object_inline_message_2422), + (workInProgress.child = JSCompiler_object_inline_stack_2424), + (JSCompiler_object_inline_stack_2424 = + JSCompiler_object_inline_message_2422), + (JSCompiler_object_inline_message_2422 = workInProgress.child), + (JSCompiler_object_inline_digest_2423 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2423 + ? (JSCompiler_object_inline_digest_2423 = + mountSuspenseOffscreenState(renderLanes)) + : ((JSCompiler_temp = + JSCompiler_object_inline_digest_2423.cachePool), + null !== JSCompiler_temp + ? ((instance = CacheContext._currentValue), + (JSCompiler_temp = + JSCompiler_temp.parent !== instance + ? { parent: instance, pool: instance } + : JSCompiler_temp)) + : (JSCompiler_temp = getSuspendedCache()), + (JSCompiler_object_inline_digest_2423 = { + baseLanes: + JSCompiler_object_inline_digest_2423.baseLanes | renderLanes, + cachePool: JSCompiler_temp + })), + (JSCompiler_object_inline_message_2422.memoizedState = + JSCompiler_object_inline_digest_2423), + (JSCompiler_object_inline_message_2422.childLanes = + getRemainingWorkInPrimaryTree( current, - workInProgress, - workInProgress.pendingProps.children, + JSCompiler_object_inline_componentStack_2425, renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); - } - function resetContextDependencies() { - lastContextDependency = currentlyRenderingFiber = null; - isDisallowedContextReadInDEV = !1; - } - function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue, providerFiber); - context._currentValue = nextValue; - push(rendererCursorDEV, context._currentRenderer, providerFiber); - void 0 !== context._currentRenderer && - null !== context._currentRenderer && - context._currentRenderer !== rendererSigil && - console.error( - "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + JSCompiler_object_inline_stack_2424 ); - context._currentRenderer = rendererSigil; + pushPrimaryTreeSuspenseHandler(workInProgress); + renderLanes = current.child; + current = renderLanes.sibling; + renderLanes = createWorkInProgress(renderLanes, { + mode: "visible", + children: JSCompiler_object_inline_stack_2424.children + }); + renderLanes.return = workInProgress; + renderLanes.sibling = null; + null !== current && + ((JSCompiler_object_inline_componentStack_2425 = + workInProgress.deletions), + null === JSCompiler_object_inline_componentStack_2425 + ? ((workInProgress.deletions = [current]), + (workInProgress.flags |= 16)) + : JSCompiler_object_inline_componentStack_2425.push(current)); + workInProgress.child = renderLanes; + workInProgress.memoizedState = null; + return renderLanes; } - function popProvider(context, providerFiber) { - context._currentValue = valueCursor.current; - var currentRenderer = rendererCursorDEV.current; - pop(rendererCursorDEV, providerFiber); - context._currentRenderer = currentRenderer; - pop(valueCursor, providerFiber); + function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: primaryChildren }, + workInProgress.mode + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); + } + function mountSuspenseFallbackChildren( + workInProgress, + primaryChildren, + fallbackChildren, + renderLanes + ) { + var mode = workInProgress.mode; + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "hidden", children: primaryChildren }, + mode + ); + fallbackChildren = createFiberFromFragment( + fallbackChildren, + mode, + renderLanes, + null + ); + primaryChildren.return = workInProgress; + fallbackChildren.return = workInProgress; + primaryChildren.sibling = fallbackChildren; + workInProgress.child = primaryChildren; + return fallbackChildren; } - function scheduleContextWorkOnParentPath( - parent, - renderLanes, - propagationRoot + function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { + return createFiberFromOffscreen(offscreenProps, mode, 0, null); + } + function retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes ) { - for (; null !== parent; ) { - var alternate = parent.alternate; - (parent.childLanes & renderLanes) !== renderLanes - ? ((parent.childLanes |= renderLanes), - null !== alternate && (alternate.childLanes |= renderLanes)) - : null !== alternate && - (alternate.childLanes & renderLanes) !== renderLanes && - (alternate.childLanes |= renderLanes); - if (parent === propagationRoot) break; - parent = parent.return; - } - parent !== propagationRoot && - console.error( - "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." - ); + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren( + workInProgress, + workInProgress.pendingProps.children + ); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; } - function propagateContextChanges( + function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + fiber.return, + renderLanes, + propagationRoot + ); + } + function validateSuspenseListNestedChild(childSlot, index) { + var isAnArray = isArrayImpl(childSlot); + childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot); + return isAnArray || childSlot + ? ((isAnArray = isAnArray ? "array" : "iterable"), + console.error( + "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", + isAnArray, + index, + isAnArray + ), + !1) + : !0; + } + function initSuspenseListRenderState( workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree + isBackwards, + tail, + lastContentRow, + tailMode ) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, + var renderState = workInProgress.memoizedState; + null === renderState + ? (workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + }) + : ((renderState.isBackwards = isBackwards), + (renderState.rendering = null), + (renderState.renderingStartTime = 0), + (renderState.last = lastContentRow), + (renderState.tail = tail), + (renderState.tailMode = tailMode)); + } + function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + nextProps = nextProps.children; + if ( + void 0 !== revealOrder && + "forwards" !== revealOrder && + "backwards" !== revealOrder && + "together" !== revealOrder && + !didWarnAboutRevealOrder[revealOrder] + ) + if ( + ((didWarnAboutRevealOrder[revealOrder] = !0), + "string" === typeof revealOrder) + ) + switch (revealOrder.toLowerCase()) { + case "together": + case "forwards": + case "backwards": + console.error( + '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.', + revealOrder, + revealOrder.toLowerCase() + ); + break; + case "forward": + case "backward": + console.error( + '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.', + revealOrder, + revealOrder.toLowerCase() + ); + break; + default: + console.error( + '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?', + revealOrder + ); + } + else + console.error( + '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?', + revealOrder + ); + void 0 === tailMode || + didWarnAboutTailOptions[tailMode] || + ("collapsed" !== tailMode && "hidden" !== tailMode + ? ((didWarnAboutTailOptions[tailMode] = !0), + console.error( + '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?', + tailMode + )) + : "forwards" !== revealOrder && + "backwards" !== revealOrder && + ((didWarnAboutTailOptions[tailMode] = !0), + console.error( + ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', + tailMode + ))); + a: if ( + ("forwards" === revealOrder || "backwards" === revealOrder) && + void 0 !== nextProps && + null !== nextProps && + !1 !== nextProps + ) + if (isArrayImpl(nextProps)) + for (var i = 0; i < nextProps.length; i++) { + if (!validateSuspenseListNestedChild(nextProps[i], i)) break a; + } + else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) { + if ((i = i.call(nextProps))) + for (var step = i.next(), _i = 0; !step.done; step = i.next()) { + if (!validateSuspenseListNestedChild(step.value, _i)) break a; + _i++; + } + } else + console.error( + 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', + revealOrder + ); + reconcileChildren(current, workInProgress, nextProps, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & ForceSuspenseFallback)) + (nextProps = + (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback), + (workInProgress.flags |= 128); + else { + if (null !== current && 0 !== (current.flags & 128)) + a: for (current = workInProgress.child; null !== current; ) { + if (13 === current.tag) + null !== current.memoizedState && + scheduleSuspenseWorkOnFiber( + current, renderLanes, workInProgress ); - forcePropagateEntireTree || (nextFiber = null); + else if (19 === current.tag) + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling; ) { + if (null === current.return || current.return === workInProgress) break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress - ); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; + current = current.return; } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= SubtreeSuspenseContextMask; + } + push(suspenseStackCursor, nextProps, workInProgress); + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); + renderLanes = revealOrder; + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), + (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; break; } - nextFiber = nextFiber.return; + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; } - fiber = nextFiber; + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; } + return workInProgress.child; } - function propagateParentContextChanges( + function bailoutOnAlreadyFinishedWork( current, workInProgress, - renderLanes, - forcePropagateEntireTree + renderLanes ) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; - - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current - ? current.push(context) - : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); - } - parent = parent.return; - } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; - } - function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue + null !== current && (workInProgress.dependencies = current.dependencies); + profilerStartTime = -1; + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) + if (null !== current) { + if ( + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + 0 === (renderLanes & workInProgress.childLanes)) ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; - } - function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); - } - function readContext(context) { - isDisallowedContextReadInDEV && - console.error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - return readContextForConsumer(currentlyRenderingFiber, context); - } - function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); - } - function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - lastContextDependency = context; - consumer.dependencies = { - lanes: 0, - firstContext: context, - _debugThenableState: null - }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; - } - function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; - } - function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); - } - function createUpdate(lane) { - return { - lane: lane, - tag: UpdateState, - payload: null, - callback: null, - next: null - }; - } - function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if ( - currentlyProcessingQueue === updateQueue && - !didWarnUpdateInsideUpdate - ) { - var componentName = getComponentNameFromFiber(fiber); - console.error( - "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s", - componentName - ); - didWarnUpdateInsideUpdate = !0; - } - if ((executionContext & RenderContext) !== NoContext) - return ( - (componentName = updateQueue.pending), - null === componentName - ? (update.next = update) - : ((update.next = componentName.next), - (componentName.next = update)), - (updateQueue.pending = update), - (update = getRootForUpdatedFiber(fiber)), - markUpdateLaneFromFiberToRoot(fiber, null, lane), - update - ); - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); - } - function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); - } - } - function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( - null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks - }; - workInProgress.updateQueue = queue; - return; + return null; + } else return null; + if (null !== current && workInProgress.child !== current.child) + throw Error("Resuming work not yet implemented."); + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + for (renderLanes.return = workInProgress; null !== current.sibling; ) + (current = current.sibling), + (renderLanes = renderLanes.sibling = + createWorkInProgress(current, current.pendingProps)), + (renderLanes.return = workInProgress); + renderLanes.sibling = null; } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + return workInProgress.child; } - function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; - } + function checkScheduledUpdateOrContext(current, renderLanes) { + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } - function processUpdateQueue( + function attemptEarlyBailoutIfNoScheduledUpdate( + current, workInProgress, - props, - instance$jscomp$0, renderLanes ) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress.updateQueue; - hasForceUpdate = !1; - currentlyProcessingQueue = queue.shared; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); + switch (workInProgress.tag) { + case 3: + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + pushProvider( + workInProgress, + CacheContext, + current.memoizedState.cache + ); + resetHydrationState(); + break; + case 27: + case 5: + pushHostContext(workInProgress); + break; + case 4: + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + break; + case 10: + pushProvider( + workInProgress, + workInProgress.type, + workInProgress.memoizedProps.value + ); + break; + case 12: + 0 !== (renderLanes & workInProgress.childLanes) && + (workInProgress.flags |= 4); + workInProgress.flags |= 2048; + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = -0; + stateNode.passiveEffectDuration = -0; + break; + case 13: + stateNode = workInProgress.memoizedState; + if (null !== stateNode) { + if (null !== stateNode.dehydrated) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags |= 128), + null + ); + if (0 !== (renderLanes & workInProgress.child.childLanes)) + return updateSuspenseComponent( + current, + workInProgress, + renderLanes + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + return null !== current ? current.sibling : null; + } + pushPrimaryTreeSuspenseHandler(workInProgress); + break; + case 19: + var didSuspendBefore = 0 !== (current.flags & 128); + stateNode = 0 !== (renderLanes & workInProgress.childLanes); + stateNode || + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); + if (didSuspendBefore) { + if (stateNode) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + workInProgress.flags |= 128; + } + didSuspendBefore = workInProgress.memoizedState; + null !== didSuspendBefore && + ((didSuspendBefore.rendering = null), + (didSuspendBefore.tail = null), + (didSuspendBefore.lastEffect = null)); + push( + suspenseStackCursor, + suspenseStackCursor.current, + workInProgress + ); + if (stateNode) break; + else return null; + case 22: + case 23: + return ( + (workInProgress.lanes = 0), + updateOffscreenComponent(current, workInProgress, renderLanes) + ); + case 24: + pushProvider( + workInProgress, + CacheContext, + current.memoizedState.cache + ); } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + function beginWork(current, workInProgress, renderLanes) { + if (workInProgress._debugNeedsRemount && null !== current) { + renderLanes = createFiberFromTypeAndProps( + workInProgress.type, + workInProgress.key, + workInProgress.pendingProps, + workInProgress._debugOwner || null, + workInProgress.mode, + workInProgress.lanes + ); + renderLanes._debugStack = workInProgress._debugStack; + renderLanes._debugTask = workInProgress._debugTask; + var returnFiber = workInProgress.return; + if (null === returnFiber) throw Error("Cannot swap the root fiber."); + current.alternate = null; + workInProgress.alternate = null; + renderLanes.index = workInProgress.index; + renderLanes.sibling = workInProgress.sibling; + renderLanes.return = workInProgress.return; + renderLanes.ref = workInProgress.ref; + renderLanes._debugInfo = workInProgress._debugInfo; + if (workInProgress === returnFiber.child) + returnFiber.child = renderLanes; + else { + var prevSibling = returnFiber.child; + if (null === prevSibling) + throw Error("Expected parent to have a child."); + for (; prevSibling.sibling !== workInProgress; ) + if (((prevSibling = prevSibling.sibling), null === prevSibling)) + throw Error("Expected to find the previous sibling."); + prevSibling.sibling = renderLanes; + } + workInProgress = returnFiber.deletions; + null === workInProgress + ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) + : workInProgress.push(current); + renderLanes.flags |= 2; + return renderLanes; + } + if (null !== current) + if ( + current.memoizedProps !== workInProgress.pendingProps || + workInProgress.type !== current.type + ) + didReceiveUpdate = !0; + else { if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) + ) + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + } + else { + didReceiveUpdate = !1; + if ((returnFiber = isHydrating)) + warnIfNotHydrating(), + (returnFiber = 0 !== (workInProgress.flags & 1048576)); + returnFiber && + ((returnFiber = workInProgress.index), + warnIfNotHydrating(), + pushTreeId(workInProgress, treeForkCount, returnFiber)); + } + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 16: + a: if ( + ((returnFiber = workInProgress.pendingProps), + (current = callLazyInitInDEV(workInProgress.elementType)), + (workInProgress.type = current), + "function" === typeof current) + ) + shouldConstruct(current) + ? ((returnFiber = resolveClassComponentProps( + current, + returnFiber + )), + (workInProgress.tag = 1), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateClassComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ))) + : ((workInProgress.tag = 0), + validateFunctionComponentInDev(workInProgress, current), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateFunctionComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ))); + else { + if (void 0 !== current && null !== current) + if ( + ((prevSibling = current.$$typeof), + prevSibling === REACT_FORWARD_REF_TYPE) + ) { + workInProgress.tag = 11; + workInProgress.type = current = + resolveForwardRefForHotReloading(current); + workInProgress = updateForwardRef( + null, + workInProgress, + current, + returnFiber, + renderLanes + ); + break a; + } else if (prevSibling === REACT_MEMO_TYPE) { + workInProgress.tag = 14; + workInProgress = updateMemoComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ); + break a; + } + workInProgress = ""; null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - updateLane = workInProgress; - var partialState = pendingQueue; - var nextProps = props, - instance = instance$jscomp$0; - switch (partialState.tag) { - case ReplaceState: - partialState = partialState.payload; - if ("function" === typeof partialState) { - isDisallowedContextReadInDEV = !0; - var nextState = partialState.call( - instance, - newState, - nextProps - ); - if (updateLane.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState.call(instance, newState, nextProps); - } finally { - setIsStrictModeForDevtools(!1); - } - } - isDisallowedContextReadInDEV = !1; - newState = nextState; - break a; - } - newState = partialState; - break a; - case CaptureUpdate: - updateLane.flags = (updateLane.flags & -65537) | 128; - case UpdateState: - nextState = partialState.payload; - if ("function" === typeof nextState) { - isDisallowedContextReadInDEV = !0; - partialState = nextState.call( - instance, - newState, - nextProps - ); - if (updateLane.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - nextState.call(instance, newState, nextProps); - } finally { - setIsStrictModeForDevtools(!1); - } - } - isDisallowedContextReadInDEV = !1; - } else partialState = nextState; - if (null === partialState || void 0 === partialState) break a; - newState = assign({}, newState, partialState); - break a; - case ForceUpdate: - hasForceUpdate = !0; + "object" === typeof current && + current.$$typeof === REACT_LAZY_TYPE && + (workInProgress = + " Did you wrap a component in React.lazy() more than once?"); + current = getComponentNameFromType(current) || current; + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + current + + ". Lazy element type must resolve to a class or function." + + workInProgress + ); + } + return workInProgress; + case 0: + return updateFunctionComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 1: + return ( + (returnFiber = workInProgress.type), + (prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps + )), + updateClassComponent( + current, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) + ); + case 3: + a: { + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + if (null === current) + throw Error( + "Should have a current fiber. This is a bug in React." + ); + var nextProps = workInProgress.pendingProps; + prevSibling = workInProgress.memoizedState; + returnFiber = prevSibling.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + var nextState = workInProgress.memoizedState; + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); + suspendIfUpdateReadFromEntangledAsyncAction(); + nextProps = nextState.element; + if (prevSibling.isDehydrated) + if ( + ((prevSibling = { + element: nextProps, + isDehydrated: !1, + cache: nextState.cache + }), + (workInProgress.updateQueue.baseState = prevSibling), + (workInProgress.memoizedState = prevSibling), + workInProgress.flags & 256) + ) { + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else if (nextProps !== returnFiber) { + returnFiber = createCapturedValueAtFiber( + Error( + "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." + ), + workInProgress + ); + queueHydrationError(returnFiber); + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else + for ( + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ), + hydrationParentFiber = workInProgress, + isHydrating = !0, + hydrationErrors = null, + didSuspendOrErrorDEV = !1, + hydrationDiffRootDEV = null, + rootOrSingletonContext = !0, + current = mountChildFibers( + workInProgress, + null, + nextProps, + renderLanes + ), + workInProgress.child = current; + current; + + ) + (current.flags = (current.flags & -3) | 4096), + (current = current.sibling); + else { + resetHydrationState(); + if (nextProps === returnFiber) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + break a; } + reconcileChildren( + current, + workInProgress, + nextProps, + renderLanes + ); } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress.flags |= 64), - isHiddenUpdate && (workInProgress.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null - }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) - break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress.lanes = lastBaseUpdate; - workInProgress.memoizedState = newState; + workInProgress = workInProgress.child; + } + return workInProgress; + case 26: + return ( + markRef(current, workInProgress), + null === current + ? (current = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + )) + ? (workInProgress.memoizedState = current) + : isHydrating || + ((current = workInProgress.type), + (renderLanes = workInProgress.pendingProps), + (returnFiber = requiredContext( + rootInstanceStackCursor.current + )), + (returnFiber = + getOwnerDocumentFromRootContainer( + returnFiber + ).createElement(current)), + (returnFiber[internalInstanceKey] = workInProgress), + (returnFiber[internalPropsKey] = renderLanes), + setInitialProperties(returnFiber, current, renderLanes), + markNodeAsHoistable(returnFiber), + (workInProgress.stateNode = returnFiber)) + : (workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + )), + null + ); + case 27: + return ( + pushHostContext(workInProgress), + null === current && + isHydrating && + ((prevSibling = requiredContext(rootInstanceStackCursor.current)), + (returnFiber = getHostContext()), + (prevSibling = workInProgress.stateNode = + resolveSingletonInstance( + workInProgress.type, + workInProgress.pendingProps, + prevSibling, + returnFiber, + !1 + )), + didSuspendOrErrorDEV || + ((returnFiber = diffHydratedProperties( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + returnFiber + )), + null !== returnFiber && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + returnFiber)), + (hydrationParentFiber = workInProgress), + (rootOrSingletonContext = !0), + (nextHydratableInstance = getNextHydratable( + prevSibling.firstChild + ))), + (returnFiber = workInProgress.pendingProps.children), + null !== current || isHydrating + ? reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )), + markRef(current, workInProgress), + workInProgress.child + ); + case 5: + return ( + null === current && + isHydrating && + ((nextProps = getHostContext()), + (returnFiber = validateDOMNesting( + workInProgress.type, + nextProps.ancestorInfo + )), + (prevSibling = nextHydratableInstance), + (nextState = !prevSibling) || + ((nextState = canHydrateInstance( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== nextState + ? ((workInProgress.stateNode = nextState), + didSuspendOrErrorDEV || + ((nextProps = diffHydratedProperties( + nextState, + workInProgress.type, + workInProgress.pendingProps, + nextProps + )), + null !== nextProps && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + nextProps)), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = getNextHydratable( + nextState.firstChild + )), + (rootOrSingletonContext = !1), + (nextProps = !0)) + : (nextProps = !1), + (nextState = !nextProps)), + nextState && + (returnFiber && + warnNonHydratedInstance(workInProgress, prevSibling), + throwOnHydrationMismatch(workInProgress))), + pushHostContext(workInProgress), + (prevSibling = workInProgress.type), + (nextProps = workInProgress.pendingProps), + (nextState = null !== current ? current.memoizedProps : null), + (returnFiber = nextProps.children), + shouldSetTextContent(prevSibling, nextProps) + ? (returnFiber = null) + : null !== nextState && + shouldSetTextContent(prevSibling, nextState) && + (workInProgress.flags |= 32), + null !== workInProgress.memoizedState && + ((prevSibling = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue = prevSibling)), + markRef(current, workInProgress), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 6: + return ( + null === current && + isHydrating && + ((current = workInProgress.pendingProps), + (renderLanes = getHostContext().ancestorInfo.current), + (current = + null != renderLanes + ? validateTextNesting(current, renderLanes.tag) + : !0), + (renderLanes = nextHydratableInstance), + (returnFiber = !renderLanes) || + ((returnFiber = canHydrateTextInstance( + renderLanes, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== returnFiber + ? ((workInProgress.stateNode = returnFiber), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (returnFiber = !0)) + : (returnFiber = !1), + (returnFiber = !returnFiber)), + returnFiber && + (current && + warnNonHydratedInstance(workInProgress, renderLanes), + throwOnHydrationMismatch(workInProgress))), + null + ); + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (returnFiber = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child + ); + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), + (returnFiber = workInProgress.stateNode), + (returnFiber.effectDuration = -0), + (returnFiber.passiveEffectDuration = -0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return ( + (returnFiber = workInProgress.type), + (prevSibling = workInProgress.pendingProps), + (nextProps = prevSibling.value), + "value" in prevSibling || + hasWarnedAboutUsingNoValuePropOnContextProvider || + ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), + console.error( + "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" + )), + pushProvider(workInProgress, returnFiber, nextProps), + reconcileChildren( + current, + workInProgress, + prevSibling.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (prevSibling = workInProgress.type._context), + (returnFiber = workInProgress.pendingProps.children), + "function" !== typeof returnFiber && + console.error( + "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." + ), + prepareToReadContext(workInProgress), + (prevSibling = readContext(prevSibling)), + (returnFiber = callComponentInDEV( + returnFiber, + prevSibling, + void 0 + )), + (workInProgress.flags |= 1), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 19: + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (returnFiber = readContext(CacheContext)), + null === current + ? ((prevSibling = peekCacheFromPool()), + null === prevSibling && + ((prevSibling = workInProgressRoot), + (nextProps = createCache()), + (prevSibling.pooledCache = nextProps), + retainCache(nextProps), + null !== nextProps && + (prevSibling.pooledCacheLanes |= renderLanes), + (prevSibling = nextProps)), + (workInProgress.memoizedState = { + parent: returnFiber, + cache: prevSibling + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, prevSibling)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (prevSibling = current.memoizedState), + (nextProps = workInProgress.memoizedState), + prevSibling.parent !== returnFiber + ? ((prevSibling = { + parent: returnFiber, + cache: returnFiber + }), + (workInProgress.memoizedState = prevSibling), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + prevSibling), + pushProvider(workInProgress, CacheContext, returnFiber)) + : ((returnFiber = nextProps.cache), + pushProvider(workInProgress, CacheContext, returnFiber), + returnFiber !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; } - currentlyProcessingQueue = null; - } - function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error( - "Invalid argument passed as callback. Expected a function. Instead received: " + - callback - ); - callback.call(context); - } - function commitHiddenCallbacks(updateQueue, context) { - var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < hiddenCallbacks.length; - updateQueue++ - ) - callCallback(hiddenCallbacks[updateQueue], context); - } - function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } function shouldProfile(current) { return (current.mode & ProfileMode) !== NoMode; @@ -11520,182 +11310,28 @@ insertOrAppendPlacementNode(finishedWork, parentFiber, parent); break; case 5: - parent = parentFiber.stateNode; - parentFiber.flags & 32 && - (resetTextContent(parent), (parentFiber.flags &= -33)); - parentFiber = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, parentFiber, parent); - break; - case 3: - case 4: - parent = parentFiber.stateNode.containerInfo; - parentFiber = getHostSibling(finishedWork); - insertOrAppendPlacementNodeIntoContainer( - finishedWork, - parentFiber, - parent - ); - break; - default: - throw Error( - "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." - ); - } - } - } - function commitBeforeMutationEffects(root, firstChild) { - root = root.containerInfo; - eventsEnabled = _enabled; - root = getActiveElementDeep(root); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, - focusNode = selection.focusNode; - selection = selection.focusOffset; - try { - JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$2) { - JSCompiler_temp = null; - break a; - } - var length = 0, - start = -1, - end = -1, - indexWithinAnchor = 0, - indexWithinFocus = 0, - node = root, - parentNode = null; - b: for (;;) { - for (var next; ; ) { - node !== JSCompiler_temp || - (0 !== anchorOffset && 3 !== node.nodeType) || - (start = length + anchorOffset); - node !== focusNode || - (0 !== selection && 3 !== node.nodeType) || - (end = length + selection); - 3 === node.nodeType && (length += node.nodeValue.length); - if (null === (next = node.firstChild)) break; - parentNode = node; - node = next; - } - for (;;) { - if (node === root) break b; - parentNode === JSCompiler_temp && - ++indexWithinAnchor === anchorOffset && - (start = length); - parentNode === focusNode && - ++indexWithinFocus === selection && - (end = length); - if (null !== (next = node.nextSibling)) break; - node = parentNode; - parentNode = node.parentNode; - } - node = next; - } - JSCompiler_temp = - -1 === start || -1 === end ? null : { start: start, end: end }; - } else JSCompiler_temp = null; - } - JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 }; - } else JSCompiler_temp = null; - selectionInformation = { - focusedElem: root, - selectionRange: JSCompiler_temp - }; - _enabled = !1; - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((firstChild = nextEffect), - (root = firstChild.child), - 0 !== (firstChild.subtreeFlags & 1028) && null !== root) - ) - (root.return = firstChild), (nextEffect = root); - else - for (; null !== nextEffect; ) { - root = firstChild = nextEffect; - JSCompiler_temp = root.alternate; - anchorOffset = root.flags; - switch (root.tag) { - case 0: - if ( - 0 !== (anchorOffset & 4) && - ((root = root.updateQueue), - (root = null !== root ? root.events : null), - null !== root) - ) - for ( - JSCompiler_temp = 0; - JSCompiler_temp < root.length; - JSCompiler_temp++ - ) - (anchorOffset = root[JSCompiler_temp]), - (anchorOffset.ref.impl = anchorOffset.nextImpl); - break; - case 11: - case 15: - break; - case 1: - 0 !== (anchorOffset & 1024) && - null !== JSCompiler_temp && - commitClassSnapshot(root, JSCompiler_temp); - break; - case 3: - if (0 !== (anchorOffset & 1024)) - if ( - ((root = root.stateNode.containerInfo), - (JSCompiler_temp = root.nodeType), - 9 === JSCompiler_temp) - ) - clearContainerSparingly(root); - else if (1 === JSCompiler_temp) - switch (root.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(root); - break; - default: - root.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (anchorOffset & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return firstChild; + parent = parentFiber.stateNode; + parentFiber.flags & 32 && + (resetTextContent(parent), (parentFiber.flags &= -33)); + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 3: + case 4: + parent = parentFiber.stateNode.containerInfo; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + parentFiber, + parent + ); + break; + default: + throw Error( + "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." + ); + } + } } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var prevEffectStart = pushComponentEffectStart(), @@ -12182,13 +11818,6 @@ } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - resetComponentEffectTimers(); - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -12728,13 +12357,6 @@ parentFiber = parentFiber.sibling; } } - function commitLayoutEffects(finishedWork, root, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - resetComponentEffectTimers(); - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -12742,6 +12364,7 @@ (parentFiber = parentFiber.sibling); } function disappearLayoutEffects(finishedWork) { + var prevEffectStart = pushComponentEffectStart(); switch (finishedWork.tag) { case 0: case 11: @@ -12779,6 +12402,17 @@ default: recursivelyTraverseDisappearLayoutEffects(finishedWork); } + (finishedWork.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); } function recursivelyTraverseDisappearLayoutEffects(parentFiber) { for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -12791,7 +12425,8 @@ finishedWork, includeWorkInProgressEffects ) { - var flags = finishedWork.flags; + var prevEffectStart = pushComponentEffectStart(), + flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: @@ -12906,6 +12541,17 @@ includeWorkInProgressEffects ); } + (finishedWork.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); } function recursivelyTraverseReappearLayoutEffects( finishedRoot, @@ -12978,39 +12624,11 @@ endTime ) { var prevEffectStart = pushComponentEffectStart(); - if ( - (finishedWork.mode & ProfileMode) !== NoMode && + (finishedWork.mode & ProfileMode) !== NoMode && 0 < finishedWork.actualStartTime && - 0 !== (finishedWork.flags & 1) - ) { - var startTime = finishedWork.actualStartTime, - name = getComponentNameFromFiber(finishedWork); - if (null !== name && supportsUserTiming) { - var selfTime = finishedWork.actualDuration; - if ( - null === finishedWork.alternate || - finishedWork.alternate.child !== finishedWork.child - ) - for ( - var child = finishedWork.child; - null !== child; - child = child.sibling - ) - selfTime -= child.actualDuration; - reusableComponentDevToolDetails.color = - 0.5 > selfTime - ? "primary-light" - : 10 > selfTime - ? "primary" - : 100 > selfTime - ? "primary-dark" - : "error"; - reusableComponentOptions.start = startTime; - reusableComponentOptions.end = endTime; - performance.measure(name, reusableComponentOptions); - } - } - name = finishedWork.flags; + 0 !== (finishedWork.flags & 1) && + logComponentRender(finishedWork, finishedWork.actualStartTime, endTime); + var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: @@ -13022,11 +12640,11 @@ committedTransitions, endTime ); - name & 2048 && + flags & 2048 && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; case 3: - startTime = pushNestedEffectDurations(); + var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13034,7 +12652,7 @@ committedTransitions, endTime ); - name & 2048 && + flags & 2048 && ((committedLanes = null), null !== finishedWork.alternate && (committedLanes = finishedWork.alternate.memoizedState.cache), @@ -13043,11 +12661,11 @@ (retainCache(committedTransitions), null != committedLanes && releaseCache(committedLanes))); finishedRoot.passiveEffectDuration += - popNestedEffectDurations(startTime); + popNestedEffectDurations(prevEffectDuration); break; case 12: - if (name & 2048) { - startTime = pushNestedEffectDurations(); + if (flags & 2048) { + prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13057,7 +12675,7 @@ ); finishedRoot = finishedWork.stateNode; finishedRoot.passiveEffectDuration += - bubbleNestedEffectDurations(startTime); + bubbleNestedEffectDurations(prevEffectDuration); try { runWithFiberInDEV( finishedWork, @@ -13082,9 +12700,9 @@ case 23: break; case 22: - startTime = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState - ? startTime._visibility & OffscreenPassiveEffectsConnected + ? prevEffectDuration._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13094,9 +12712,12 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + finishedWork, + committedLanes, + committedTransitions, + endTime ) - : startTime._visibility & OffscreenPassiveEffectsConnected + : prevEffectDuration._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13104,15 +12725,17 @@ committedTransitions, endTime ) - : ((startTime._visibility |= OffscreenPassiveEffectsConnected), + : ((prevEffectDuration._visibility |= + OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) + 0 !== (finishedWork.subtreeFlags & 10256), + endTime )); - name & 2048 && + flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork @@ -13126,7 +12749,7 @@ committedTransitions, endTime ); - name & 2048 && + flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); break; default: @@ -13155,28 +12778,38 @@ parentFiber, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ) { includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); - for (parentFiber = parentFiber.child; null !== parentFiber; ) + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var nextSibling = parentFiber.sibling; reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, committedTransitions, - includeWorkInProgressEffects - ), - (parentFiber = parentFiber.sibling); + includeWorkInProgressEffects, + null !== nextSibling ? nextSibling.actualStartTime : endTime + ); + parentFiber = nextSibling; + } } function reconnectPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ) { + var prevEffectStart = pushComponentEffectStart(); + (finishedWork.mode & ProfileMode) !== NoMode && + 0 < finishedWork.actualStartTime && + 0 !== (finishedWork.flags & 1) && + logComponentRender(finishedWork, finishedWork.actualStartTime, endTime); var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: @@ -13187,7 +12820,8 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); commitHookPassiveMountEffects(finishedWork, Passive); break; @@ -13202,11 +12836,15 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + finishedWork, + committedLanes, + committedTransitions, + endTime ) : ((_instance2._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( @@ -13214,7 +12852,8 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime )); includeWorkInProgressEffects && flags & 2048 && @@ -13229,7 +12868,8 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); includeWorkInProgressEffects && flags & 2048 && @@ -13241,49 +12881,77 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); } + (finishedWork.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); } function recursivelyTraverseAtomicPassiveEffects( finishedRoot$jscomp$0, - parentFiber + parentFiber, + committedLanes$jscomp$0, + committedTransitions$jscomp$0, + endTime$jscomp$0 ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) { + for (var child = parentFiber.child; null !== child; ) { + parentFiber = child.sibling; var finishedRoot = finishedRoot$jscomp$0, - finishedWork = parentFiber, - flags = finishedWork.flags; - switch (finishedWork.tag) { + committedLanes = committedLanes$jscomp$0, + committedTransitions = committedTransitions$jscomp$0, + endTime = + null !== parentFiber + ? parentFiber.actualStartTime + : endTime$jscomp$0; + (child.mode & ProfileMode) !== NoMode && + 0 < child.actualStartTime && + 0 !== (child.flags & 1) && + logComponentRender(child, child.actualStartTime, endTime); + var flags = child.flags; + switch (child.tag) { case 22: recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + child, + committedLanes, + committedTransitions, + endTime ); flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); + commitOffscreenPassiveMountEffects(child.alternate, child); break; case 24: recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + child, + committedLanes, + committedTransitions, + endTime ); flags & 2048 && - commitCachePassiveMountEffect( - finishedWork.alternate, - finishedWork - ); + commitCachePassiveMountEffect(child.alternate, child); break; default: recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + child, + committedLanes, + committedTransitions, + endTime ); } - parentFiber = parentFiber.sibling; + child = parentFiber; } } function recursivelyAccumulateSuspenseyCommit(parentFiber) { @@ -13457,11 +13125,13 @@ } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { for (; null !== nextEffect; ) { var fiber = nextEffect, - current = fiber; + current = fiber, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0, + prevEffectStart = pushComponentEffectStart(); switch (current.tag) { case 0: case 11: @@ -13476,30 +13146,42 @@ case 22: null !== current.memoizedState && null !== current.memoizedState.cachePool && - ((current = current.memoizedState.cachePool.pool), - null != current && retainCache(current)); + ((nearestMountedAncestor = current.memoizedState.cachePool.pool), + null != nearestMountedAncestor && + retainCache(nearestMountedAncestor)); break; case 24: releaseCache(current.memoizedState.cache); } + (current.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + current, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); current = fiber.child; if (null !== current) (current.return = fiber), (nextEffect = current); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { current = nextEffect; - var sibling = current.sibling, - returnFiber = current.return; + prevEffectStart = current.sibling; + nearestMountedAncestor = current.return; detachFiberAfterEffects(current); if (current === fiber) { nextEffect = null; break a; } - if (null !== sibling) { - sibling.return = returnFiber; - nextEffect = sibling; + if (null !== prevEffectStart) { + prevEffectStart.return = nearestMountedAncestor; + nextEffect = prevEffectStart; break a; } - nextEffect = returnFiber; + nextEffect = nearestMountedAncestor; } } } @@ -14882,7 +14564,7 @@ if ((lanes & 4194176) !== lanes) break; case RootSuspendedAtTheShell: setCurrentTrackFromLanes(lanes); - logSuspendedRenderPhase(renderStartTime, startTime); + logSuspendedRenderPhase(renderStartTime, startTime, lanes); finalizeRender(lanes, startTime); yieldEndTime = lanes; 0 !== (yieldEndTime & 3) || 0 !== (yieldEndTime & 60) @@ -15148,14 +14830,26 @@ workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootSuspendedWithDelay ) - logSuspendedRenderPhase(previousRenderStartTime, renderStartTime); + logSuspendedRenderPhase( + previousRenderStartTime, + renderStartTime, + lanes + ); else { var endTime = renderStartTime; supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = endTime), - performance.measure("Interrupted Render", reusableLaneOptions)); + performance.measure( + (lanes & 536870912) === lanes + ? "Prewarm" + : (lanes & 201326677) === lanes + ? "Interrupted Hydration" + : "Interrupted Render", + reusableLaneOptions + )); } finalizeRender(workInProgressRootRenderLanes, renderStartTime); } @@ -15176,7 +14870,8 @@ ? endTime : 0 <= previousRenderStartTime ? previousRenderStartTime - : renderStartTime + : renderStartTime, + lanes )); var eventType = blockingEventType, eventIsRepeat = blockingEventIsRepeat, @@ -15198,7 +14893,10 @@ reusableLaneOptions )), 0 < previousRenderStartTime && - ((reusableLaneDevToolDetails.color = "primary-light"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes + ? "tertiary-light" + : "primary-light"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = renderStartTime$jscomp$0), performance.measure("Blocked", reusableLaneOptions))); @@ -15227,7 +14925,8 @@ ? eventType : 0 <= endTime ? endTime - : renderStartTime + : renderStartTime, + lanes )); eventIsRepeat = transitionEventType; renderStartTime$jscomp$0 = transitionEventIsRepeat; @@ -15312,7 +15011,7 @@ return previousRenderStartTime; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; ReactSharedInternals.getCurrentStack = null; isRendering = !1; @@ -15812,7 +15511,7 @@ workInProgress = null; } function commitRoot( - root, + root$jscomp$0, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -15824,176 +15523,501 @@ completedRenderStartTime, completedRenderEndTime ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = ReactDOMSharedInternals.p; + didIncludeRenderPhaseUpdate = ReactSharedInternals.T; + var previousUpdateLanePriority = ReactDOMSharedInternals.p; try { - (ReactDOMSharedInternals.p = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (ReactDOMSharedInternals.p = previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - ReactStrictModeWarnings.flushLegacyContextWarning(); - ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - var finishedWork = root.finishedWork; - didIncludeRenderPhaseUpdate = root.finishedLanes; - setCurrentTrackFromLanes(didIncludeRenderPhaseUpdate); - exitStatus === RootErrored - ? logErroredRenderPhase( - completedRenderStartTime, - completedRenderEndTime - ) - : logRenderPhase(completedRenderStartTime, completedRenderEndTime); - if (null === finishedWork) return null; - 0 === didIncludeRenderPhaseUpdate && - console.error( - "root.finishedLanes should not be empty during a commit. This is a bug in React." - ); - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; - exitStatus = finishedWork.lanes | finishedWork.childLanes; - exitStatus |= concurrentlyUpdatedLanes; - markRootFinished( - root, - didIncludeRenderPhaseUpdate, - exitStatus, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - (0 === finishedWork.actualDuration && - 0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = exitStatus), - (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), - (pendingPassiveTransitions = transitions), - scheduleCallback$1(NormalPriority$1, function () { - schedulerEvent = window.event; - flushPassiveEffects(!0); - return null; - })); - commitStartTime = now(); - suspendedCommitReason === SUSPENDED_COMMIT - ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) - : suspendedCommitReason === THROTTLED_COMMIT && - logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), - (ReactDOMSharedInternals.p = DiscreteEventPriority), - (updatedLanes = executionContext), - (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffects( - root, - finishedWork, - didIncludeRenderPhaseUpdate - ), - restoreSelection(selectionInformation, root.containerInfo), - (_enabled = !!eventsEnabled), - (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - commitLayoutEffects(finishedWork, root, didIncludeRenderPhaseUpdate), - requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - commitEndTime = now(); - logCommitPhase( - suspendedCommitReason === IMMEDIATE_COMMIT - ? completedRenderEndTime - : commitStartTime, - commitEndTime - ); - (suspendedCommitReason = rootDoesHavePassiveEffects) - ? ((rootDoesHavePassiveEffects = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) - : (releaseRootPooledCache(root, exitStatus), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - exitStatus = root.pendingLanes; - 0 === exitStatus && (legacyErrorBoundariesThatAlreadyFailed = null); - suspendedCommitReason || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - onCommitRoot(); - ensureRootIsScheduled(root); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, - completedRenderEndTime = 0; - completedRenderEndTime < recoverableErrors.length; - completedRenderEndTime++ - ) - (finishedWork = recoverableErrors[completedRenderEndTime]), - (exitStatus = makeErrorInfo(finishedWork.stack)), - runWithFiberInDEV( - finishedWork.source, - renderPriorityLevel, - finishedWork.value, - exitStatus + ReactDOMSharedInternals.p = DiscreteEventPriority; + ReactSharedInternals.T = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + ReactStrictModeWarnings.flushLegacyContextWarning(); + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) + throw Error("Should not already be working."); + var finishedWork = root$jscomp$0.finishedWork, + lanes = root$jscomp$0.finishedLanes; + setCurrentTrackFromLanes(lanes); + exitStatus === RootErrored + ? logErroredRenderPhase( + completedRenderStartTime, + completedRenderEndTime + ) + : supportsUserTiming && + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (reusableLaneOptions.start = completedRenderStartTime), + (reusableLaneOptions.end = completedRenderEndTime), + performance.measure( + (lanes & 536870912) === lanes + ? "Prepared" + : (lanes & 201326677) === lanes + ? "Hydrated" + : "Render", + reusableLaneOptions + )); + if (null !== finishedWork) { + 0 === lanes && + console.error( + "root.finishedLanes should not be empty during a commit. This is a bug in React." ); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - exitStatus = root.pendingLanes; - 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (exitStatus & 42) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - suspendedCommitReason || - finalizeRender(didIncludeRenderPhaseUpdate, commitEndTime); - flushSyncWorkAcrossRoots_impl(0, !1); - return null; + root$jscomp$0.finishedWork = null; + root$jscomp$0.finishedLanes = 0; + if (finishedWork === root$jscomp$0.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + exitStatus = remainingLanes |= concurrentlyUpdatedLanes; + var previouslyPendingLanes = root$jscomp$0.pendingLanes; + root$jscomp$0.pendingLanes = exitStatus; + root$jscomp$0.suspendedLanes = 0; + root$jscomp$0.pingedLanes = 0; + root$jscomp$0.warmLanes = 0; + root$jscomp$0.expiredLanes &= exitStatus; + root$jscomp$0.entangledLanes &= exitStatus; + root$jscomp$0.errorRecoveryDisabledLanes &= exitStatus; + root$jscomp$0.shellSuspendCounter = 0; + var entanglements = root$jscomp$0.entanglements, + expirationTimes = root$jscomp$0.expirationTimes, + hiddenUpdates = root$jscomp$0.hiddenUpdates; + for ( + exitStatus = previouslyPendingLanes & ~exitStatus; + 0 < exitStatus; + + ) { + var index = 31 - clz32(exitStatus); + completedRenderStartTime = 1 << index; + entanglements[index] = 0; + expirationTimes[index] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index]; + if (null !== hiddenUpdatesForLane) { + hiddenUpdates[index] = null; + for (var i = 0; i < hiddenUpdatesForLane.length; i++) { + var update = hiddenUpdatesForLane[i]; + null !== update && (update.lane &= -536870913); + } + } + exitStatus &= ~completedRenderStartTime; + } + 0 !== spawnedLane && + markSpawnedDeferredLane(root$jscomp$0, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root$jscomp$0.tag && + (root$jscomp$0.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~lanes)); + root$jscomp$0 === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + spawnedLane = !1; + 0 !== finishedWork.actualDuration || + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), + (pendingPassiveTransitions = transitions)) + : ((root$jscomp$0.callbackNode = null), + (root$jscomp$0.callbackPriority = 0), + (root$jscomp$0.cancelPendingCommit = null)); + commitStartTime = now(); + suspendedCommitReason === SUSPENDED_COMMIT + ? ((transitions = commitStartTime), + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-light"), + (reusableLaneOptions.start = completedRenderEndTime), + (reusableLaneOptions.end = transitions), + performance.measure("Suspended", reusableLaneOptions))) + : suspendedCommitReason === THROTTLED_COMMIT && + ((transitions = commitStartTime), + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-light"), + (reusableLaneOptions.start = completedRenderEndTime), + (reusableLaneOptions.end = transitions), + performance.measure("Throttled", reusableLaneOptions))); + var rootHasEffect = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || rootHasEffect) { + var prevTransition = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = DiscreteEventPriority; + rootHasEffect = executionContext; + executionContext |= CommitContext; + var containerInfo = root$jscomp$0.containerInfo; + eventsEnabled = _enabled; + var focusedElem = getActiveElementDeep(containerInfo); + if (hasSelectionCapabilities(focusedElem)) { + if ("selectionStart" in focusedElem) + var selection = { + start: focusedElem.selectionStart, + end: focusedElem.selectionEnd + }; + else + b: { + var ownerDocument = focusedElem.ownerDocument, + win = + (ownerDocument && ownerDocument.defaultView) || window, + selection$jscomp$0 = win.getSelection && win.getSelection(); + if ( + selection$jscomp$0 && + 0 !== selection$jscomp$0.rangeCount + ) { + var anchorNode = selection$jscomp$0.anchorNode, + anchorOffset = selection$jscomp$0.anchorOffset, + focusNode = selection$jscomp$0.focusNode, + focusOffset = selection$jscomp$0.focusOffset; + try { + anchorNode.nodeType, focusNode.nodeType; + } catch (e$2) { + selection = null; + break b; + } + containerInfo = 0; + win = ownerDocument = -1; + transitions = selection$jscomp$0 = 0; + updatedLanes = focusedElem; + suspendedRetryLanes = null; + c: for (;;) { + for (var next; ; ) { + updatedLanes !== anchorNode || + (0 !== anchorOffset && 3 !== updatedLanes.nodeType) || + (ownerDocument = containerInfo + anchorOffset); + updatedLanes !== focusNode || + (0 !== focusOffset && 3 !== updatedLanes.nodeType) || + (win = containerInfo + focusOffset); + 3 === updatedLanes.nodeType && + (containerInfo += updatedLanes.nodeValue.length); + if (null === (next = updatedLanes.firstChild)) break; + suspendedRetryLanes = updatedLanes; + updatedLanes = next; + } + for (;;) { + if (updatedLanes === focusedElem) break c; + suspendedRetryLanes === anchorNode && + ++selection$jscomp$0 === anchorOffset && + (ownerDocument = containerInfo); + suspendedRetryLanes === focusNode && + ++transitions === focusOffset && + (win = containerInfo); + if (null !== (next = updatedLanes.nextSibling)) break; + updatedLanes = suspendedRetryLanes; + suspendedRetryLanes = updatedLanes.parentNode; + } + updatedLanes = next; + } + selection = + -1 === ownerDocument || -1 === win + ? null + : { start: ownerDocument, end: win }; + } else selection = null; + } + var JSCompiler_temp = selection || { start: 0, end: 0 }; + } else JSCompiler_temp = null; + selectionInformation = { + focusedElem: focusedElem, + selectionRange: JSCompiler_temp + }; + _enabled = !1; + for (nextEffect = finishedWork; null !== nextEffect; ) { + focusedElem = nextEffect; + var child = focusedElem.child; + if (0 !== (focusedElem.subtreeFlags & 1028) && null !== child) + (child.return = focusedElem), (nextEffect = child); + else + b: for (; null !== nextEffect; ) { + JSCompiler_temp = focusedElem = nextEffect; + var current = JSCompiler_temp.alternate, + flags = JSCompiler_temp.flags; + switch (JSCompiler_temp.tag) { + case 0: + if (0 !== (flags & 4)) { + var updateQueue = JSCompiler_temp.updateQueue, + eventPayloads = + null !== updateQueue ? updateQueue.events : null; + if (null !== eventPayloads) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < eventPayloads.length; + JSCompiler_temp++ + ) { + var _eventPayloads$ii = + eventPayloads[JSCompiler_temp]; + _eventPayloads$ii.ref.impl = + _eventPayloads$ii.nextImpl; + } + } + break; + case 11: + case 15: + break; + case 1: + 0 !== (flags & 1024) && + null !== current && + commitClassSnapshot(JSCompiler_temp, current); + break; + case 3: + if (0 !== (flags & 1024)) + c: { + var container = + JSCompiler_temp.stateNode.containerInfo, + nodeType = container.nodeType; + if (9 === nodeType) + clearContainerSparingly(container); + else if (1 === nodeType) + switch (container.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(container); + break c; + default: + container.textContent = ""; + } + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (flags & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); + } + var sibling = focusedElem.sibling; + if (null !== sibling) { + sibling.return = focusedElem.return; + nextEffect = sibling; + break b; + } + nextEffect = focusedElem.return; + } + } + inProgressLanes = lanes; + inProgressRoot = root$jscomp$0; + resetComponentEffectTimers(); + commitMutationEffectsOnFiber(finishedWork, root$jscomp$0); + inProgressRoot = inProgressLanes = null; + child = selectionInformation; + var curFocusedElem = getActiveElementDeep( + root$jscomp$0.containerInfo + ), + priorFocusedElem = child.focusedElem, + priorSelectionRange = child.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start = priorSelectionRange.start, + end = priorSelectionRange.end; + void 0 === end && (end = start); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start), + (priorFocusedElem.selectionEnd = Math.min( + end, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win$jscomp$0 = (doc && doc.defaultView) || window; + if (win$jscomp$0.getSelection) { + var selection$jscomp$1 = win$jscomp$0.getSelection(), + length = priorFocusedElem.textContent.length, + start$jscomp$0 = Math.min( + priorSelectionRange.start, + length + ), + end$jscomp$0 = + void 0 === priorSelectionRange.end + ? start$jscomp$0 + : Math.min(priorSelectionRange.end, length); + !selection$jscomp$1.extend && + start$jscomp$0 > end$jscomp$0 && + ((curFocusedElem = end$jscomp$0), + (end$jscomp$0 = start$jscomp$0), + (start$jscomp$0 = curFocusedElem)); + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$0 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$0 + ); + if ( + startMarker && + endMarker && + (1 !== selection$jscomp$1.rangeCount || + selection$jscomp$1.anchorNode !== startMarker.node || + selection$jscomp$1.anchorOffset !== + startMarker.offset || + selection$jscomp$1.focusNode !== endMarker.node || + selection$jscomp$1.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection$jscomp$1.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection$jscomp$1.addRange(range), + selection$jscomp$1.extend( + endMarker.node, + endMarker.offset + )) + : (range.setEnd(endMarker.node, endMarker.offset), + selection$jscomp$1.addRange(range)); + } + } + } + } + doc = []; + for ( + selection$jscomp$1 = priorFocusedElem; + (selection$jscomp$1 = selection$jscomp$1.parentNode); + + ) + 1 === selection$jscomp$1.nodeType && + doc.push({ + element: selection$jscomp$1, + left: selection$jscomp$1.scrollLeft, + top: selection$jscomp$1.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + priorFocusedElem = 0; + priorFocusedElem < doc.length; + priorFocusedElem++ + ) { + var info = doc[priorFocusedElem]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + root$jscomp$0.current = finishedWork; + inProgressLanes = lanes; + inProgressRoot = root$jscomp$0; + resetComponentEffectTimers(); + commitLayoutEffectOnFiber( + root$jscomp$0, + finishedWork.alternate, + finishedWork + ); + inProgressRoot = inProgressLanes = null; + requestPaint(); + executionContext = rootHasEffect; + ReactDOMSharedInternals.p = previousPriority; + ReactSharedInternals.T = prevTransition; + } else root$jscomp$0.current = finishedWork; + commitEndTime = now(); + suspendedCommitReason = + suspendedCommitReason === IMMEDIATE_COMMIT + ? completedRenderEndTime + : commitStartTime; + completedRenderEndTime = commitEndTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-dark"), + (reusableLaneOptions.start = suspendedCommitReason), + (reusableLaneOptions.end = completedRenderEndTime), + performance.measure("Commit", reusableLaneOptions)); + (suspendedCommitReason = spawnedLane) + ? ((rootWithPendingPassiveEffects = root$jscomp$0), + (pendingPassiveEffectsLanes = lanes)) + : (releaseRootPooledCache(root$jscomp$0, remainingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + remainingLanes = root$jscomp$0.pendingLanes; + 0 === remainingLanes && + (legacyErrorBoundariesThatAlreadyFailed = null); + suspendedCommitReason || + commitDoubleInvokeEffectsInDEV(root$jscomp$0); + var root = finishedWork.stateNode; + if ( + injectedHook && + "function" === typeof injectedHook.onCommitFiberRoot + ) + try { + var didError = 128 === (root.current.flags & 128); + switch (previousUpdateLanePriority) { + case DiscreteEventPriority: + var schedulerPriority = ImmediatePriority; + break; + case ContinuousEventPriority: + schedulerPriority = UserBlockingPriority; + break; + case DefaultEventPriority: + schedulerPriority = NormalPriority$1; + break; + case IdleEventPriority: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority$1; + } + injectedHook.onCommitFiberRoot( + rendererID, + root, + schedulerPriority, + didError + ); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + console.error( + "React instrumentation encountered an error: %s", + err + )); + } + isDevToolsPresent && root$jscomp$0.memoizedUpdaters.clear(); + onCommitRoot(); + if (null !== recoverableErrors) { + var onRecoverableError = root$jscomp$0.onRecoverableError; + for ( + finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) { + var recoverableError = recoverableErrors[finishedWork], + errorInfo = makeErrorInfo(recoverableError.stack); + runWithFiberInDEV( + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo + ); + } + } + 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); + ensureRootIsScheduled(root$jscomp$0); + remainingLanes = root$jscomp$0.pendingLanes; + 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + ? ((nestedUpdateScheduled = !0), + root$jscomp$0 === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), + (rootWithNestedUpdates = root$jscomp$0))) + : (nestedUpdateCount = 0); + suspendedCommitReason || finalizeRender(lanes, commitEndTime); + flushSyncWorkAcrossRoots_impl(0, !1); + } + } finally { + (ReactSharedInternals.T = didIncludeRenderPhaseUpdate), + (ReactDOMSharedInternals.p = previousUpdateLanePriority); + } } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -16036,6 +16060,9 @@ var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; + priority.callbackNode = null; + priority.callbackPriority = 0; + priority.cancelPendingCommit = null; if ( (executionContext & (RenderContext | CommitContext)) !== NoContext @@ -16093,6 +16120,7 @@ : (nestedPassiveUpdateCount = 0); didScheduleUpdateDuringPassiveEffects = isFlushingPassiveEffects = !1; + ensureRootIsScheduled(priority); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot @@ -16314,7 +16342,7 @@ shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber), reappearLayoutEffects(root, fiber.alternate, fiber, !1), shouldDoubleInvokePassiveEffects && - reconnectPassiveEffects(root, fiber, 0, null, !1); + reconnectPassiveEffects(root, fiber, 0, null, !1, 0); } finally { setIsStrictModeForDevtools(!1); } @@ -16359,12 +16387,6 @@ addFiberToLanesMap(root, schedulingFiber, lanes); }); } - function scheduleCallback$1(priorityLevel, callback) { - var actQueue = ReactSharedInternals.actQueue; - return null !== actQueue - ? (actQueue.push(callback), fakeActCallbackNode$1) - : scheduleCallback$3(priorityLevel, callback); - } function warnIfUpdatesNotWrappedWithActDEV(fiber) { isConcurrentActEnvironment() && null === ReactSharedInternals.actQueue && @@ -16480,12 +16502,13 @@ } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } + suspendedLanes = pendingPassiveEffectsLanes; currentTime = workInProgressRoot; - suspendedLanes = workInProgressRootRenderLanes; - suspendedLanes = getNextLanes( - root, - root === currentTime ? suspendedLanes : 0 - ); + pingedLanes = workInProgressRootRenderLanes; + suspendedLanes = + root === rootWithPendingPassiveEffects + ? suspendedLanes + : getNextLanes(root, root === currentTime ? pingedLanes : 0); pingedLanes = root.callbackNode; if ( 0 === suspendedLanes || @@ -16535,7 +16558,7 @@ null !== ReactSharedInternals.actQueue ? (ReactSharedInternals.actQueue.push(pingedLanes), (suspendedLanes = fakeActCallbackNode)) - : (suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes)); + : (suspendedLanes = scheduleCallback$2(suspendedLanes, pingedLanes)); root.callbackPriority = currentTime; root.callbackNode = suspendedLanes; return currentTime; @@ -16583,7 +16606,7 @@ }); scheduleMicrotask(function () { (executionContext & (RenderContext | CommitContext)) !== NoContext - ? scheduleCallback$3(ImmediatePriority, cb) + ? scheduleCallback$2(ImmediatePriority, cb) : cb(); }); } @@ -18746,7 +18769,7 @@ console.error( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." ); - else if (canDiffStyleForHydrationWarning) { + else { var clientValue; var delimiter = (clientValue = ""), styleName; @@ -19165,42 +19188,36 @@ } case "src": case "href": - if ( - !( - "" !== propKey || - ("a" === tag && "href" === value) || - ("object" === tag && "data" === value) - ) - ) { - "src" === value - ? console.error( - 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ) - : console.error( - 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ); - hydrateSanitizedAttribute( - domElement, - value, - value, - null, - extraAttributes, - serverDifferences - ); - continue; - } - hydrateSanitizedAttribute( - domElement, - value, - value, - propKey, - extraAttributes, - serverDifferences - ); + "" !== propKey || + ("a" === tag && "href" === value) || + ("object" === tag && "data" === value) + ? hydrateSanitizedAttribute( + domElement, + value, + value, + propKey, + extraAttributes, + serverDifferences + ) + : ("src" === value + ? console.error( + 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ) + : console.error( + 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ), + hydrateSanitizedAttribute( + domElement, + value, + value, + null, + extraAttributes, + serverDifferences + )); continue; case "action": case "formAction": @@ -21318,8 +21335,12 @@ queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(nearestMounted), - root = enqueueConcurrentRenderForLane(nearestMounted, lane); + var lane = requestUpdateLane(nearestMounted); + lane = getBumpedLaneForHydrationByLane(lane); + var root = enqueueConcurrentRenderForLane( + nearestMounted, + lane + ); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); markRetryLaneIfNotHydrated(nearestMounted, lane); @@ -21535,7 +21556,6 @@ REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"); Symbol.for("react.scope"); - Symbol.for("react.debug_trace_mode"); var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); Symbol.for("react.legacy_hidden"); Symbol.for("react.tracing_marker"); @@ -21581,7 +21601,7 @@ rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null), hasOwnProperty = Object.prototype.hasOwnProperty, - scheduleCallback$3 = Scheduler.unstable_scheduleCallback, + scheduleCallback$2 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -21619,11 +21639,6 @@ allNativeEvents = new Set(), registrationNameDependencies = {}, possibleRegistrationNames = {}, - canUseDOM = !( - "undefined" === typeof window || - "undefined" === typeof window.document || - "undefined" === typeof window.document.createElement - ), hasReadOnlyValue = { button: !0, checkbox: !0, @@ -21670,8 +21685,6 @@ containerTagInScope: null }, didWarn = {}, - MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML", - SVG_NAMESPACE = "http://www.w3.org/2000/svg", shorthandToLonghand = { animation: "animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationPlayState animationTimingFunction".split( @@ -21822,6 +21835,8 @@ " " ) ), + MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML", + SVG_NAMESPACE = "http://www.w3.org/2000/svg", aliases = new Map([ ["acceptCharset", "accept-charset"], ["htmlFor", "for"], @@ -22470,6 +22485,11 @@ restoreTarget = null, restoreQueue = null, isInsideEventHandler = !1, + canUseDOM = !( + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ), passiveBrowserEventsSupported = !1; if (canUseDOM) try { @@ -22817,7 +22837,7 @@ detail: { devtools: reusableLaneDevToolDetails } }, blockingLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -22827,7 +22847,7 @@ } }, transitionLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -22837,7 +22857,7 @@ } }, suspenseLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -22847,7 +22867,7 @@ } }, idleLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -22898,6 +22918,59 @@ yieldStartTime = -1.1, currentUpdateIsNested = !1, nestedUpdateScheduled = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber$1 = null, + lastContextDependency = null, + isDisallowedContextReadInDEV = !1, + currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0, + currentEntangledActionThenable = null, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, + NoFlags = 0, + HasEffect = 1, + Insertion = 2, + Layout = 4, + Passive = 8, + AbortControllerLocal = + "undefined" !== typeof AbortController + ? AbortController + : function () { + var listeners = [], + signal = (this.signal = { + aborted: !1, + addEventListener: function (type, listener) { + listeners.push(listener); + } + }); + this.abort = function () { + signal.aborted = !0; + listeners.forEach(function (listener) { + return listener(); + }); + }; + }, + scheduleCallback$1 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0, + _currentRenderer: null, + _currentRenderer2: null + }, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -23092,7 +23165,79 @@ pendingUNSAFE_ComponentWillUpdateWarnings = []; pendingLegacyContextWarning = new Map(); }; - var CapturedStacks = new WeakMap(), + var fakeInternalInstance = {}; + var didWarnAboutStateAssignmentForComponent = new Set(); + var didWarnAboutUninitializedState = new Set(); + var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); + var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); + var didWarnAboutDirectlyAssigningPropsToState = new Set(); + var didWarnAboutUndefinedDerivedState = new Set(); + var didWarnAboutContextTypes$1 = new Set(); + var didWarnAboutChildContextTypes = new Set(); + var didWarnAboutInvalidateContextType = new Set(); + var didWarnOnInvalidCallback = new Set(); + Object.freeze(fakeInternalInstance); + var classComponentUpdater = { + isMounted: function (component) { + var owner = current; + if (null !== owner && isRendering && 1 === owner.tag) { + var instance = owner.stateNode; + instance._warnedAboutRefsInRender || + console.error( + "%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", + getComponentNameFromFiber(owner) || "A component" + ); + instance._warnedAboutRefsInRender = !0; + } + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = ReplaceState; + update.payload = payload; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = ForceUpdate; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + } + }, + CapturedStacks = new WeakMap(), forkStack = [], forkStackIndex = 0, treeForkProvider = null, @@ -23107,68 +23252,29 @@ isHydrating = !1, didSuspendOrErrorDEV = !1, hydrationDiffRootDEV = null, - hydrationErrors = null, - rootOrSingletonContext = !1, - HydrationMismatchException = Error( - "Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." - ), - SuspenseyCommitException = Error( - "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseActionException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." - ), - noopSuspenseyCommitThenable = { - then: function () { - console.error( - 'Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.' - ); - } - }, - suspendedThenable = null, - needsToResetSuspendedThenableDEV = !1, - NoFlags = 0, - HasEffect = 1, - Insertion = 2, - Layout = 4, - Passive = 8, - AbortControllerLocal = - "undefined" !== typeof AbortController - ? AbortController - : function () { - var listeners = [], - signal = (this.signal = { - aborted: !1, - addEventListener: function (type, listener) { - listeners.push(listener); - } - }); - this.abort = function () { - signal.aborted = !0; - listeners.forEach(function (listener) { - return listener(); - }); - }; - }, - scheduleCallback$2 = Scheduler.unstable_scheduleCallback, - NormalPriority = Scheduler.unstable_NormalPriority, - CacheContext = { - $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, - Provider: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0, - _currentRenderer: null, - _currentRenderer2: null + hydrationErrors = null, + rootOrSingletonContext = !1, + HydrationMismatchException = Error( + "Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." + ), + SuspenseyCommitException = Error( + "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseActionException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." + ), + noopSuspenseyCommitThenable = { + then: function () { + console.error( + 'Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.' + ); + } }, - currentEntangledListeners = null, - currentEntangledPendingCount = 0, - currentEntangledLane = 0, - currentEntangledActionThenable = null, + suspendedThenable = null, + needsToResetSuspendedThenableDEV = !1, currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0), prevOnStartTransitionFinish = ReactSharedInternals.S; @@ -23202,7 +23308,7 @@ var didWarnAboutAsyncClientComponent = new Set(); var didWarnAboutUseFormState = new Set(); var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -23216,36 +23322,33 @@ currentHookNameInDev = null, hookTypesDev = null, hookTypesUpdateIndexDev = -1, - ignorePreviousDependencies = !1; - var createFunctionComponentUpdateQueue = function () { - return { lastEffect: null, events: null, stores: null, memoCache: null }; - }; - var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError - }; - ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; - ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; + ignorePreviousDependencies = !1, + ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError + }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; - ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; - ContextOnlyDispatcher.useFormState = throwInvalidHookError; - ContextOnlyDispatcher.useActionState = throwInvalidHookError; - ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -23364,39 +23467,35 @@ mountHookTypesDev(); return mountId(); }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; mountHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - }; - HooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useOptimistic = function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -23502,46 +23601,35 @@ updateHookTypesDev(); return mountId(); }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return mountActionState(action, initialState); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountWithHookTypesInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountWithHookTypesInDEV.useEffectEvent = function ( - callback - ) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return mountEvent(callback); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountWithHookTypesInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return mountOptimistic(passthrough); - }; HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -23647,39 +23735,35 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnUpdateInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnUpdateInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; - HooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -23785,39 +23869,35 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnRerenderInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnRerenderInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; - HooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnRerenderInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -23942,15 +24022,34 @@ mountHookTypesDev(); return mountId(); }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); mountHookTypesDev(); - return mountRefresh(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountOptimistic(passthrough); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -23958,34 +24057,6 @@ return mountEvent(callback); } }; - InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnMountInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -24110,15 +24181,34 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -24126,31 +24216,6 @@ return updateEvent(callback); } }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -24275,15 +24340,34 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -24291,33 +24375,6 @@ return updateEvent(callback); } }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnRerenderInDEV.useFormState = function ( - action - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -24503,78 +24560,6 @@ SubtreeSuspenseContextMask = 1, ForceSuspenseFallback = 2, suspenseStackCursor = createCursor(0), - fakeInternalInstance = {}; - var didWarnAboutStateAssignmentForComponent = new Set(); - var didWarnAboutUninitializedState = new Set(); - var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); - var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); - var didWarnAboutDirectlyAssigningPropsToState = new Set(); - var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypes$1 = new Set(); - var didWarnAboutChildContextTypes = new Set(); - var didWarnAboutInvalidateContextType = new Set(); - var didWarnOnInvalidCallback = new Set(); - Object.freeze(fakeInternalInstance); - var classComponentUpdater = { - isMounted: function (component) { - var owner = current; - if (null !== owner && isRendering && 1 === owner.tag) { - var instance = owner.stateNode; - instance._warnedAboutRefsInRender || - console.error( - "%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", - getComponentNameFromFiber(owner) || "A component" - ); - instance._warnedAboutRefsInRender = !0; - } - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = ReplaceState; - update.payload = payload; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = ForceUpdate; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - } - }, reportGlobalError = "function" === typeof reportError ? reportError @@ -24623,20 +24608,6 @@ retryLane: 0 }, hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -24646,7 +24617,6 @@ nextEffect = null, inProgressLanes = null, inProgressRoot = null, - shouldFireAfterActiveInstanceBlur = !1, hostParent = null, hostParentIsContainer = !1, currentHoistableRoot = null, @@ -24727,7 +24697,6 @@ RENDER_TIMEOUT_MS = 500, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -24748,8 +24717,7 @@ didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); - var fakeActCallbackNode$1 = {}, - firstScheduledRoot = null, + var firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = !1, didScheduleMicrotask_act = !1, @@ -24827,7 +24795,6 @@ didWarnFormActionMethod = !1, didWarnPopoverTargetObject = !1; var didWarnForNewBooleanPropsWithEmptyValue = {}; - var canDiffStyleForHydrationWarning = !0; var NORMALIZE_NEWLINES_REGEX = /\r\n?/g, NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g, xlinkNamespace = "http://www.w3.org/1999/xlink", @@ -25222,52 +25189,43 @@ ), lastScheduledReplayQueue = null; ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = - function (children, JSCompiler_OptimizeArgumentsArray_p2) { + function (children) { var root = this._internalRoot; if (null === root) throw Error("Cannot update an unmounted root."); - "function" === typeof JSCompiler_OptimizeArgumentsArray_p2 + var args = arguments; + "function" === typeof args[1] ? console.error( "does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()." ) - : isValidContainer(JSCompiler_OptimizeArgumentsArray_p2) + : isValidContainer(args[1]) ? console.error( "You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root." ) - : "undefined" !== typeof JSCompiler_OptimizeArgumentsArray_p2 && + : "undefined" !== typeof args[1] && console.error( "You passed a second argument to root.render(...) but it only accepts one argument." ); - JSCompiler_OptimizeArgumentsArray_p2 = root.current; - var lane = requestUpdateLane(JSCompiler_OptimizeArgumentsArray_p2); - updateContainerImpl( - JSCompiler_OptimizeArgumentsArray_p2, - lane, - children, - root, - null, - null - ); + args = children; + var current = root.current, + lane = requestUpdateLane(current); + updateContainerImpl(current, lane, args, root, null, null); }; ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = - function (JSCompiler_OptimizeArgumentsArray_p3) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p3 && + function () { + var args = arguments; + "function" === typeof args[0] && console.error( "does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()." ); - JSCompiler_OptimizeArgumentsArray_p3 = this._internalRoot; - if (null !== JSCompiler_OptimizeArgumentsArray_p3) { + args = this._internalRoot; + if (null !== args) { this._internalRoot = null; - var container = JSCompiler_OptimizeArgumentsArray_p3.containerInfo; + var container = args.containerInfo; (executionContext & (RenderContext | CommitContext)) !== NoContext && console.error( "Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition." ); - updateContainerSync( - null, - JSCompiler_OptimizeArgumentsArray_p3, - null, - null - ); + updateContainerSync(null, args, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; } @@ -25291,11 +25249,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7283a213-20241206" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-7eb8234f-20241218" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-7283a213-20241206\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-experimental-7eb8234f-20241218\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -25332,11 +25290,10 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-experimental-7283a213-20241206", + version: "19.1.0-experimental-7eb8234f-20241218", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7283a213-20241206" + reconcilerVersion: "19.1.0-experimental-7eb8234f-20241218" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25468,17 +25425,19 @@ initialChildren.context = getContextForSubtree(null); options = initialChildren.current; isStrictMode = requestUpdateLane(options); + isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode); identifierPrefix = createUpdate(isStrictMode); identifierPrefix.callback = null; enqueueUpdate(options, identifierPrefix, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated$1(initialChildren, isStrictMode); + options = isStrictMode; + initialChildren.current.lanes = options; + markRootUpdated$1(initialChildren, options); ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.0.0-experimental-7283a213-20241206"; + exports.version = "19.1.0-experimental-7eb8234f-20241218"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js index df49790f340c5..80be6c818dae3 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js @@ -51,7 +51,6 @@ var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"); Symbol.for("react.scope"); -Symbol.for("react.debug_trace_mode"); var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); Symbol.for("react.legacy_hidden"); Symbol.for("react.tracing_marker"); @@ -286,13 +285,11 @@ function describeFiber(fiber) { return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -500,7 +497,7 @@ function popHostContext(fiber) { (HostTransitionContext._currentValue = sharedNotPendingObject)); } var hasOwnProperty = Object.prototype.hasOwnProperty, - scheduleCallback$3 = Scheduler.unstable_scheduleCallback, + scheduleCallback$2 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -515,17 +512,6 @@ var hasOwnProperty = Object.prototype.hasOwnProperty, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null; -function onCommitRoot(root) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - injectedHook.onCommitFiberRoot( - rendererID, - root, - void 0, - 128 === (root.current.flags & 128) - ); - } catch (err) {} -} function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); if (injectedHook && "function" === typeof injectedHook.setStrictMode) @@ -706,54 +692,6 @@ function markRootUpdated$1(root, updateLane) { 268435456 !== updateLane && ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); } -function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes -) { - var previouslyPendingLanes = root.pendingLanes; - root.pendingLanes = remainingLanes; - root.suspendedLanes = 0; - root.pingedLanes = 0; - root.warmLanes = 0; - root.expiredLanes &= remainingLanes; - root.entangledLanes &= remainingLanes; - root.errorRecoveryDisabledLanes &= remainingLanes; - root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - for ( - remainingLanes = previouslyPendingLanes & ~remainingLanes; - 0 < remainingLanes; - - ) { - var index$7 = 31 - clz32(remainingLanes), - lane = 1 << index$7; - entanglements[index$7] = 0; - expirationTimes[index$7] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$7]; - if (null !== hiddenUpdatesForLane) - for ( - hiddenUpdates[index$7] = null, index$7 = 0; - index$7 < hiddenUpdatesForLane.length; - index$7++ - ) { - var update = hiddenUpdatesForLane[index$7]; - null !== update && (update.lane &= -536870913); - } - remainingLanes &= ~lane; - } - 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); -} function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; root.suspendedLanes &= ~spawnedLane; @@ -774,6 +712,46 @@ function markRootEntangled(root, entangledLanes) { rootEntangledLanes &= ~lane; } } +function getBumpedLaneForHydrationByLane(lane) { + switch (lane) { + case 2: + lane = 1; + break; + case 8: + lane = 4; + break; + case 32: + lane = 16; + break; + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + lane = 64; + break; + case 268435456: + lane = 134217728; + break; + default: + lane = 0; + } + return lane; +} function lanesToEventPriority(lanes) { lanes &= -lanes; return 2 < lanes @@ -890,12 +868,7 @@ function registerDirectEvent(registrationName, dependencies) { ) allNativeEvents.add(dependencies[registrationName]); } -var canUseDOM = !( - "undefined" === typeof window || - "undefined" === typeof window.document || - "undefined" === typeof window.document.createElement - ), - VALID_ATTRIBUTE_NAME_REGEX = RegExp( +var VALID_ATTRIBUTE_NAME_REGEX = RegExp( "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$" ), illegalAttributeNameCache = {}, @@ -1504,7 +1477,12 @@ function getListener(inst, registrationName) { ); return stateNode; } -var passiveBrowserEventsSupported = !1; +var canUseDOM = !( + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ), + passiveBrowserEventsSupported = !1; if (canUseDOM) try { var options = {}; @@ -1991,19 +1969,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$285; + var JSCompiler_inline_result$jscomp$282; if (canUseDOM) { - var isSupported$jscomp$inline_420 = "oninput" in document; - if (!isSupported$jscomp$inline_420) { - var element$jscomp$inline_421 = document.createElement("div"); - element$jscomp$inline_421.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_420 = - "function" === typeof element$jscomp$inline_421.oninput; + var isSupported$jscomp$inline_411 = "oninput" in document; + if (!isSupported$jscomp$inline_411) { + var element$jscomp$inline_412 = document.createElement("div"); + element$jscomp$inline_412.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_411 = + "function" === typeof element$jscomp$inline_412.oninput; } - JSCompiler_inline_result$jscomp$285 = isSupported$jscomp$inline_420; - } else JSCompiler_inline_result$jscomp$285 = !1; + JSCompiler_inline_result$jscomp$282 = isSupported$jscomp$inline_411; + } else JSCompiler_inline_result$jscomp$282 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$285 && + JSCompiler_inline_result$jscomp$282 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2155,97 +2133,6 @@ function hasSelectionCapabilities(elem) { "true" === elem.contentEditable) ); } -function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if (null !== priorSelectionRange && hasSelectionCapabilities(containerInfo)) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - curFocusedElem = curFocusedElem.getSelection(); - var length = containerInfo.textContent.length, - start = Math.min(priorSelectionRange.start, length); - priorSelectionRange = - void 0 === priorSelectionRange.end - ? start - : Math.min(priorSelectionRange.end, length); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (1 !== curFocusedElem.rangeCount || - curFocusedElem.anchorNode !== length.node || - curFocusedElem.anchorOffset !== length.offset || - curFocusedElem.focusNode !== endMarker.node || - curFocusedElem.focusOffset !== endMarker.offset) && - ((priorSelectionInformation = - priorSelectionInformation.createRange()), - priorSelectionInformation.setStart(length.node, length.offset), - curFocusedElem.removeAllRanges(), - start > priorSelectionRange - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } -} var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && 11 >= document.documentMode, activeElement = null, @@ -2424,357 +2311,172 @@ function getRootForUpdatedFiber(sourceFiber) { return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; } var emptyContextObject = {}, - CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; - } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; -} -var forkStack = [], - forkStackIndex = 0, - treeForkProvider = null, - treeForkCount = 0, - idStack = [], - idStackIndex = 0, - treeContextProvider = null, - treeContextId = 1, - treeContextOverflow = ""; -function pushTreeFork(workInProgress, totalChildren) { - forkStack[forkStackIndex++] = treeForkCount; - forkStack[forkStackIndex++] = treeForkProvider; - treeForkProvider = workInProgress; - treeForkCount = totalChildren; -} -function pushTreeId(workInProgress, totalChildren, index) { - idStack[idStackIndex++] = treeContextId; - idStack[idStackIndex++] = treeContextOverflow; - idStack[idStackIndex++] = treeContextProvider; - treeContextProvider = workInProgress; - var baseIdWithLeadingBit = treeContextId; - workInProgress = treeContextOverflow; - var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; - baseIdWithLeadingBit &= ~(1 << baseLength); - index += 1; - var length = 32 - clz32(totalChildren) + baseLength; - if (30 < length) { - var numberOfOverflowBits = baseLength - (baseLength % 5); - length = ( - baseIdWithLeadingBit & - ((1 << numberOfOverflowBits) - 1) - ).toString(32); - baseIdWithLeadingBit >>= numberOfOverflowBits; - baseLength -= numberOfOverflowBits; - treeContextId = - (1 << (32 - clz32(totalChildren) + baseLength)) | - (index << baseLength) | - baseIdWithLeadingBit; - treeContextOverflow = length + workInProgress; - } else - (treeContextId = - (1 << length) | (index << baseLength) | baseIdWithLeadingBit), - (treeContextOverflow = workInProgress); + valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = null; +function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue); + context._currentValue = nextValue; } -function pushMaterializedTreeId(workInProgress) { - null !== workInProgress.return && - (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); +function popProvider(context) { + context._currentValue = valueCursor.current; + pop(valueCursor); } -function popTreeContext(workInProgress) { - for (; workInProgress === treeForkProvider; ) - (treeForkProvider = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null), - (treeForkCount = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null); - for (; workInProgress === treeContextProvider; ) - (treeContextProvider = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextOverflow = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextId = idStack[--idStackIndex]), - (idStack[idStackIndex] = null); +function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { + for (; null !== parent; ) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes + ? ((parent.childLanes |= renderLanes), + null !== alternate && (alternate.childLanes |= renderLanes)) + : null !== alternate && + (alternate.childLanes & renderLanes) !== renderLanes && + (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; + } } -var hydrationParentFiber = null, - nextHydratableInstance = null, - isHydrating = !1, - hydrationErrors = null, - rootOrSingletonContext = !1, - HydrationMismatchException = Error(formatProdErrorMessage(519)); -function throwOnHydrationMismatch(fiber) { - var error = Error(formatProdErrorMessage(418, "")); - queueHydrationError(createCapturedValueAtFiber(error, fiber)); - throw HydrationMismatchException; +function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + for (var i = 0; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; + } + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) throw Error(formatProdErrorMessage(341)); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; + } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; + } } -function prepareToHydrateHostInstance(fiber) { - var instance = fiber.stateNode, - type = fiber.type, - props = fiber.memoizedProps; - instance[internalInstanceKey] = fiber; - instance[internalPropsKey] = props; - switch (type) { - case "dialog": - listenToNonDelegatedEvent("cancel", instance); - listenToNonDelegatedEvent("close", instance); - break; - case "iframe": - case "object": - case "embed": - listenToNonDelegatedEvent("load", instance); - break; - case "video": - case "audio": - for (type = 0; type < mediaEventTypes.length; type++) - listenToNonDelegatedEvent(mediaEventTypes[type], instance); - break; - case "source": - listenToNonDelegatedEvent("error", instance); - break; - case "img": - case "image": - case "link": - listenToNonDelegatedEvent("error", instance); - listenToNonDelegatedEvent("load", instance); - break; - case "details": - listenToNonDelegatedEvent("toggle", instance); - break; - case "input": - listenToNonDelegatedEvent("invalid", instance); - initInput( - instance, - props.value, - props.defaultValue, - props.checked, - props.defaultChecked, - props.type, - props.name, - !0 - ); - track(instance); - break; - case "select": - listenToNonDelegatedEvent("invalid", instance); - break; - case "textarea": - listenToNonDelegatedEvent("invalid", instance), - initTextarea(instance, props.value, props.defaultValue, props.children), - track(instance); - } - type = props.children; - ("string" !== typeof type && - "number" !== typeof type && - "bigint" !== typeof type) || - instance.textContent === "" + type || - !0 === props.suppressHydrationWarning || - checkForUnmatchedText(instance.textContent, type) - ? (null != props.popover && - (listenToNonDelegatedEvent("beforetoggle", instance), - listenToNonDelegatedEvent("toggle", instance)), - null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), - null != props.onScrollEnd && - listenToNonDelegatedEvent("scrollend", instance), - null != props.onClick && (instance.onclick = noop$1), - (instance = !0)) - : (instance = !1); - instance || throwOnHydrationMismatch(fiber); -} -function popToNextHostParent(fiber) { - for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) - switch (hydrationParentFiber.tag) { - case 3: - case 27: - rootOrSingletonContext = !0; - return; - case 5: - case 13: - rootOrSingletonContext = !1; - return; - default: - hydrationParentFiber = hydrationParentFiber.return; - } -} -function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) return !1; - if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; - var shouldClear = !1, - JSCompiler_temp; - if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { - if ((JSCompiler_temp = 5 === fiber.tag)) - (JSCompiler_temp = fiber.type), - (JSCompiler_temp = - !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || - shouldSetTextContent(fiber.type, fiber.memoizedProps)); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && (shouldClear = !0); - shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); - popToNextHostParent(fiber); - if (13 === fiber.tag) { - fiber = fiber.memoizedState; - fiber = null !== fiber ? fiber.dehydrated : null; - if (!fiber) throw Error(formatProdErrorMessage(317)); - a: { - fiber = fiber.nextSibling; - for (shouldClear = 0; fiber; ) { - if (8 === fiber.nodeType) - if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { - if (0 === shouldClear) { - nextHydratableInstance = getNextHydratable(fiber.nextSibling); - break a; - } - shouldClear--; - } else - ("$" !== JSCompiler_temp && - "$!" !== JSCompiler_temp && - "$?" !== JSCompiler_temp) || - shouldClear++; - fiber = fiber.nextSibling; +function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree +) { + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; + + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current ? current.push(context) : (current = [context])); } - nextHydratableInstance = null; + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; + parent = parent.return; + } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } -function resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - isHydrating = !1; +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; + } + return !1; } -function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -var SuspenseException = Error(formatProdErrorMessage(460)), - SuspenseyCommitException = Error(formatProdErrorMessage(474)), - SuspenseActionException = Error(formatProdErrorMessage(542)), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function noop$3() {} -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop$3, noop$3), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error(formatProdErrorMessage(482)); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; - } +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; -} -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error(formatProdErrorMessage(483)); -} -var AbortControllerLocal = - "undefined" !== typeof AbortController - ? AbortController - : function () { - var listeners = [], - signal = (this.signal = { - aborted: !1, - addEventListener: function (type, listener) { - listeners.push(listener); - } - }); - this.abort = function () { - signal.aborted = !0; - listeners.forEach(function (listener) { - return listener(); - }); - }; - }, - scheduleCallback$2 = Scheduler.unstable_scheduleCallback, - NormalPriority = Scheduler.unstable_NormalPriority, - CacheContext = { - $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, - Provider: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; -function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; -} -function releaseCache(cache) { - cache.refCount--; - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); +function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) throw Error(formatProdErrorMessage(308)); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } var currentEntangledListeners = null, currentEntangledPendingCount = 0, @@ -2836,1327 +2538,1140 @@ function chainThenableValue(thenable, result) { ); return thenableWithOverride; } -var currentTreeHiddenStackCursor = createCursor(null), - prevEntangledRenderLanesCursor = createCursor(0); -function pushHiddenContext(fiber, context) { - fiber = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, fiber); - push(currentTreeHiddenStackCursor, context); - entangledRenderLanes = fiber | context.baseLanes; -} -function reuseHiddenContextOnStack() { - push(prevEntangledRenderLanesCursor, entangledRenderLanes); - push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); +var hasForceUpdate = !1; +function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; } -function popHiddenContext() { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor); - pop(prevEntangledRenderLanesCursor); +function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); } -var prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; +function createUpdate(lane) { + return { lane: lane, tag: 0, payload: null, callback: null, next: null }; } -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); +function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if (0 !== (executionContext & 2)) { + var pending = updateQueue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + updateQueue.pending = update; + update = getRootForUpdatedFiber(fiber); + markUpdateLaneFromFiberToRoot(fiber, null, lane); + return update; + } + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); } -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; +function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } } -var renderLanes = 0, - currentlyRenderingFiber$1 = null, - currentHook = null, - workInProgressHook = null, - didScheduleRenderPhaseUpdate = !1, - didScheduleRenderPhaseUpdateDuringThisPass = !1, - shouldDoubleInvokeUserFnsInHooksDEV = !1, - localIdCounter = 0, - thenableIndexCounter$1 = 0, - thenableState$1 = null, - globalClientIdCounter = 0; -function throwInvalidHookError() { - throw Error(formatProdErrorMessage(321)); +function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( + null !== current && + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; + } + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; } -function areHookInputsEqual(nextDeps, prevDeps) { - if (null === prevDeps) return !1; - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; +var didReadFromEntangledAsyncAction = !1; +function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } } -function renderWithHooks( - current, - workInProgress, - Component, +function processUpdateQueue( + workInProgress$jscomp$0, props, - secondArg, - nextRenderLanes + instance$jscomp$0, + renderLanes ) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null === current || null === current.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate; - shouldDoubleInvokeUserFnsInHooksDEV = !1; - nextRenderLanes = Component(props, secondArg); - shouldDoubleInvokeUserFnsInHooksDEV = !1; - didScheduleRenderPhaseUpdateDuringThisPass && - (nextRenderLanes = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - )); - finishRenderingHooks(current); - return nextRenderLanes; -} -function finishRenderingHooks(current) { - ReactSharedInternals.H = ContextOnlyDispatcher; - var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter$1 = 0; - thenableState$1 = null; - if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); - null === current || - didReceiveUpdate || - ((current = current.dependencies), - null !== current && - checkIfContextChanged(current) && - (didReceiveUpdate = !0)); -} -function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); - thenableIndexCounter$1 = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); - numberOfReRenders += 1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); - } - ReactSharedInternals.H = HooksDispatcherOnRerender; - children = Component(props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; -} -function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && - (currentlyRenderingFiber$1.flags |= 1024); - return maybeThenable; -} -function checkDidRenderIdHook() { - var didRenderIdHook = 0 !== localIdCounter; - localIdCounter = 0; - return didRenderIdHook; -} -function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags &= -2053; - current.lanes &= ~lanes; -} -function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { - for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; - } - didScheduleRenderPhaseUpdate = !1; - } - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter$1 = localIdCounter = 0; - thenableState$1 = null; -} -function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; -} -function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) - throw Error(formatProdErrorMessage(467)); - throw Error(formatProdErrorMessage(310)); - } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; -} -var createFunctionComponentUpdateQueue; -createFunctionComponentUpdateQueue = function () { - return { lastEffect: null, events: null, stores: null, memoCache: null }; -}; -function useThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = []); - thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null === index || null === index.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate)); - return thenable; -} -function use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); - } - throw Error(formatProdErrorMessage(438, String(usable))); -} -function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress$jscomp$0.updateQueue; + hasForceUpdate = !1; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress$jscomp$0.alternate; null !== current && ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); - } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; - current < size; - current++ - ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - memoCache.index++; - return updateQueue; -} -function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; -} -function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); -} -function updateReducerImpl(hook, current, reducer) { - var queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var baseQueue = hook.baseQueue, - pendingQueue = queue.pending; - if (null !== pendingQueue) { - if (null !== baseQueue) { - var baseFirst = baseQueue.next; - baseQueue.next = pendingQueue.next; - pendingQueue.next = baseFirst; - } - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); } - pendingQueue = hook.baseState; - if (null === baseQueue) hook.memoizedState = pendingQueue; - else { - current = baseQueue.next; - var newBaseQueueFirst = (baseFirst = null), - newBaseQueueLast = null, - update = current, - didReadFromEntangledAsyncAction$26 = !1; + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; do { - var updateLane = update.lane & -536870913; + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; if ( - updateLane !== update.lane + isHiddenUpdate ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes & updateLane) === updateLane ) { - var revertLane = update.revertLane; - if (0 === revertLane) - null !== newBaseQueueLast && - (newBaseQueueLast = newBaseQueueLast.next = - { - lane: 0, - revertLane: 0, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$26 = !0); - else if ((renderLanes & revertLane) === revertLane) { - update = update.next; - revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$26 = !0); - continue; - } else - (updateLane = { - lane: 0, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + var workInProgress = workInProgress$jscomp$0, + update = pendingQueue; + updateLane = props; + var instance = instance$jscomp$0; + switch (update.tag) { + case 1: + workInProgress = update.payload; + if ("function" === typeof workInProgress) { + newState = workInProgress.call(instance, newState, updateLane); + break a; + } + newState = workInProgress; + break a; + case 3: + workInProgress.flags = (workInProgress.flags & -65537) | 128; + case 0: + workInProgress = update.payload; + updateLane = + "function" === typeof workInProgress + ? workInProgress.call(instance, newState, updateLane) + : workInProgress; + if (null === updateLane || void 0 === updateLane) break a; + newState = assign({}, newState, updateLane); + break a; + case 2: + hasForceUpdate = !0; + } + } + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress$jscomp$0.flags |= 64), + isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); } else - (revertLane = { + (isHiddenUpdate = { lane: updateLane, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, next: null }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); - if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$26 && - ((reducer = currentEntangledActionThenable), null !== reducer)) - ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress$jscomp$0.lanes = lastBaseUpdate; + workInProgress$jscomp$0.memoizedState = newState; } - null === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; } -function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; +function callCallback(callback, context) { + if ("function" !== typeof callback) + throw Error(formatProdErrorMessage(191, callback)); + callback.call(context); } -function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = updateWorkInProgressHook(), - isHydrating$jscomp$0 = isHydrating; - if (isHydrating$jscomp$0) { - if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else getServerSnapshot = getSnapshot(); - var snapshotChanged = !objectIs( - (currentHook || hook).memoizedState, - getServerSnapshot - ); - snapshotChanged && - ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); - hook = hook.queue; - updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ - subscribe - ]); - if ( - hook.getSnapshot !== getSnapshot || - snapshotChanged || - (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) - ) { - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - hook, - getServerSnapshot, - getSnapshot - ), - null - ); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - return getServerSnapshot; +function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } -function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); +var AbortControllerLocal = + "undefined" !== typeof AbortController + ? AbortController + : function () { + var listeners = [], + signal = (this.signal = { + aborted: !1, + addEventListener: function (type, listener) { + listeners.push(listener); + } + }); + this.abort = function () { + signal.aborted = !0; + listeners.forEach(function (listener) { + return listener(); + }); + }; + }, + scheduleCallback$1 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }; +function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; } -function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); +function releaseCache(cache) { + cache.refCount--; + 0 === cache.refCount && + scheduleCallback$1(NormalPriority, function () { + cache.controller.abort(); + }); } -function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); - }); +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps +) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); } -function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - inst = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(inst, nextValue); - } catch (error) { - return !0; +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } -function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } -function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - initialStateInitializer(); - } finally { - setIsStrictModeForDevtools(!1); - } - } +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState - }; - return hook; -} -function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer - ); + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$28 in Component) + void 0 === newProps[propName$28] && + (newProps[propName$28] = Component[propName$28]); + } + return newProps; } -function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload -) { - if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); - fiber = actionQueue.action; - if (null !== fiber) { - var actionNode = { - payload: payload, - action: fiber, - next: null, - isTransition: !0, - status: "pending", - value: null, - reason: null, - listeners: [], - then: function (listener) { - actionNode.listeners.push(listener); - } +var CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) }; - null !== ReactSharedInternals.T - ? setPendingState(!0) - : (actionNode.isTransition = !1); - setState(actionNode); - setPendingState = actionQueue.pending; - null === setPendingState - ? ((actionNode.next = actionQueue.pending = actionNode), - runActionStateAction(actionQueue, actionNode)) - : ((actionNode.next = setPendingState.next), - (actionQueue.pending = setPendingState.next = actionNode)); + CapturedStacks.set(value, source); + return source; } + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } -function runActionStateAction(actionQueue, node) { - var action = node.action, - payload = node.payload, - prevState = actionQueue.state; - if (node.isTransition) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error) { - onActionError(actionQueue, node, error); - } finally { - ReactSharedInternals.T = prevTransition; - } - } else - try { - (prevTransition = action(prevState, payload)), - handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$32) { - onActionError(actionQueue, node, error$32); - } +var forkStack = [], + forkStackIndex = 0, + treeForkProvider = null, + treeForkCount = 0, + idStack = [], + idStackIndex = 0, + treeContextProvider = null, + treeContextId = 1, + treeContextOverflow = ""; +function pushTreeFork(workInProgress, totalChildren) { + forkStack[forkStackIndex++] = treeForkCount; + forkStack[forkStackIndex++] = treeForkProvider; + treeForkProvider = workInProgress; + treeForkCount = totalChildren; } -function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ) - : onActionSuccess(actionQueue, node, returnValue); +function pushTreeId(workInProgress, totalChildren, index) { + idStack[idStackIndex++] = treeContextId; + idStack[idStackIndex++] = treeContextOverflow; + idStack[idStackIndex++] = treeContextProvider; + treeContextProvider = workInProgress; + var baseIdWithLeadingBit = treeContextId; + workInProgress = treeContextOverflow; + var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; + baseIdWithLeadingBit &= ~(1 << baseLength); + index += 1; + var length = 32 - clz32(totalChildren) + baseLength; + if (30 < length) { + var numberOfOverflowBits = baseLength - (baseLength % 5); + length = ( + baseIdWithLeadingBit & + ((1 << numberOfOverflowBits) - 1) + ).toString(32); + baseIdWithLeadingBit >>= numberOfOverflowBits; + baseLength -= numberOfOverflowBits; + treeContextId = + (1 << (32 - clz32(totalChildren) + baseLength)) | + (index << baseLength) | + baseIdWithLeadingBit; + treeContextOverflow = length + workInProgress; + } else + (treeContextId = + (1 << length) | (index << baseLength) | baseIdWithLeadingBit), + (treeContextOverflow = workInProgress); } -function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); +function pushMaterializedTreeId(workInProgress) { + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); } -function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); - } - actionQueue.action = null; +function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider; ) + (treeForkProvider = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null), + (treeForkCount = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null); + for (; workInProgress === treeContextProvider; ) + (treeContextProvider = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextOverflow = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextId = idStack[--idStackIndex]), + (idStack[idStackIndex] = null); } -function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); +var hydrationParentFiber = null, + nextHydratableInstance = null, + isHydrating = !1, + hydrationErrors = null, + rootOrSingletonContext = !1, + HydrationMismatchException = Error(formatProdErrorMessage(519)); +function throwOnHydrationMismatch(fiber) { + var error = Error(formatProdErrorMessage(418, "")); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } -function actionStateReducer(oldState, newState) { - return newState; +function prepareToHydrateHostInstance(fiber) { + var instance = fiber.stateNode, + type = fiber.type, + props = fiber.memoizedProps; + instance[internalInstanceKey] = fiber; + instance[internalPropsKey] = props; + switch (type) { + case "dialog": + listenToNonDelegatedEvent("cancel", instance); + listenToNonDelegatedEvent("close", instance); + break; + case "iframe": + case "object": + case "embed": + listenToNonDelegatedEvent("load", instance); + break; + case "video": + case "audio": + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], instance); + break; + case "source": + listenToNonDelegatedEvent("error", instance); + break; + case "img": + case "image": + case "link": + listenToNonDelegatedEvent("error", instance); + listenToNonDelegatedEvent("load", instance); + break; + case "details": + listenToNonDelegatedEvent("toggle", instance); + break; + case "input": + listenToNonDelegatedEvent("invalid", instance); + initInput( + instance, + props.value, + props.defaultValue, + props.checked, + props.defaultChecked, + props.type, + props.name, + !0 + ); + track(instance); + break; + case "select": + listenToNonDelegatedEvent("invalid", instance); + break; + case "textarea": + listenToNonDelegatedEvent("invalid", instance), + initTextarea(instance, props.value, props.defaultValue, props.children), + track(instance); + } + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + instance.textContent === "" + type || + !0 === props.suppressHydrationWarning || + checkForUnmatchedText(instance.textContent, type) + ? (null != props.popover && + (listenToNonDelegatedEvent("beforetoggle", instance), + listenToNonDelegatedEvent("toggle", instance)), + null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), + null != props.onScrollEnd && + listenToNonDelegatedEvent("scrollend", instance), + null != props.onClick && (instance.onclick = noop$1), + (instance = !0)) + : (instance = !1); + instance || throwOnHydrationMismatch(fiber); } -function mountActionState(action, initialStateProp) { - if (isHydrating) { - var ssrFormState = workInProgressRoot.formState; - if (null !== ssrFormState) { - a: { - var JSCompiler_inline_result = currentlyRenderingFiber$1; - if (isHydrating) { - if (nextHydratableInstance) { - b: { - var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; - for ( - var inRootOrSingleton = rootOrSingletonContext; - 8 !== JSCompiler_inline_result$jscomp$0.nodeType; - - ) { - if (!inRootOrSingleton) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - JSCompiler_inline_result$jscomp$0 = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - if (null === JSCompiler_inline_result$jscomp$0) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - } - inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; - JSCompiler_inline_result$jscomp$0 = - "F!" === inRootOrSingleton || "F" === inRootOrSingleton - ? JSCompiler_inline_result$jscomp$0 - : null; - } - if (JSCompiler_inline_result$jscomp$0) { - nextHydratableInstance = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - JSCompiler_inline_result = - "F!" === JSCompiler_inline_result$jscomp$0.data; +function popToNextHostParent(fiber) { + for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) + switch (hydrationParentFiber.tag) { + case 3: + case 27: + rootOrSingletonContext = !0; + return; + case 5: + case 13: + rootOrSingletonContext = !1; + return; + default: + hydrationParentFiber = hydrationParentFiber.return; + } +} +function popHydrationState(fiber) { + if (fiber !== hydrationParentFiber) return !1; + if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; + var shouldClear = !1, + JSCompiler_temp; + if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { + if ((JSCompiler_temp = 5 === fiber.tag)) + (JSCompiler_temp = fiber.type), + (JSCompiler_temp = + !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || + shouldSetTextContent(fiber.type, fiber.memoizedProps)); + JSCompiler_temp = !JSCompiler_temp; + } + JSCompiler_temp && (shouldClear = !0); + shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); + popToNextHostParent(fiber); + if (13 === fiber.tag) { + fiber = fiber.memoizedState; + fiber = null !== fiber ? fiber.dehydrated : null; + if (!fiber) throw Error(formatProdErrorMessage(317)); + a: { + fiber = fiber.nextSibling; + for (shouldClear = 0; fiber; ) { + if (8 === fiber.nodeType) + if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { + if (0 === shouldClear) { + nextHydratableInstance = getNextHydratable(fiber.nextSibling); break a; } - } - throwOnHydrationMismatch(JSCompiler_inline_result); - } - JSCompiler_inline_result = !1; + shouldClear--; + } else + ("$" !== JSCompiler_temp && + "$!" !== JSCompiler_temp && + "$?" !== JSCompiler_temp) || + shouldClear++; + fiber = fiber.nextSibling; } - JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); + nextHydratableInstance = null; } - } - ssrFormState = mountWorkInProgressHook(); - ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; - JSCompiler_inline_result = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - ssrFormState.queue = JSCompiler_inline_result; - ssrFormState = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result - ); - JSCompiler_inline_result.dispatch = ssrFormState; - JSCompiler_inline_result = mountStateImpl(!1); - inRootOrSingleton = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !1, - JSCompiler_inline_result.queue - ); - JSCompiler_inline_result = mountWorkInProgressHook(); - JSCompiler_inline_result$jscomp$0 = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; - ssrFormState = dispatchActionState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result$jscomp$0, - inRootOrSingleton, - ssrFormState - ); - JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; - JSCompiler_inline_result.memoizedState = action; - return [initialStateProp, ssrFormState, !1]; + } else + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; } -function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); +function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + isHydrating = !1; } -function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; - if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then - ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; - } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), - pushSimpleEffect( - 9, - createEffectInstance(), - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; -} -function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; -} -function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; +function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); } -function pushSimpleEffect(tag, inst, create, deps) { - tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; - inst = currentlyRenderingFiber$1.updateQueue; - null === inst && - ((inst = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = inst)); - create = inst.lastEffect; - null === create - ? (inst.lastEffect = tag.next = tag) - : ((deps = create.next), - (create.next = tag), - (tag.next = deps), - (inst.lastEffect = tag)); - return tag; +var SuspenseException = Error(formatProdErrorMessage(460)), + SuspenseyCommitException = Error(formatProdErrorMessage(474)), + SuspenseActionException = Error(formatProdErrorMessage(542)), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; } -function createEffectInstance() { - return { destroy: void 0, resource: void 0 }; +function noop$3() {} +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop$3, noop$3), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error(formatProdErrorMessage(482)); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; + } } -function updateRef() { - return updateWorkInProgressHook().memoizedState; +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; } -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - createEffectInstance(), - create, - deps - ); +function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error(formatProdErrorMessage(483)); } -function updateEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var inst = hook.memoizedState.inst; - null !== currentHook && - null !== deps && - areHookInputsEqual(deps, currentHook.memoizedState.deps) - ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - inst, - create, - deps - ))); +var currentTreeHiddenStackCursor = createCursor(null), + prevEntangledRenderLanesCursor = createCursor(0); +function pushHiddenContext(fiber, context) { + fiber = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, fiber); + push(currentTreeHiddenStackCursor, context); + entangledRenderLanes = fiber | context.baseLanes; } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function reuseHiddenContextOnStack() { + push(prevEntangledRenderLanesCursor, entangledRenderLanes); + push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); +function popHiddenContext() { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor); + pop(prevEntangledRenderLanesCursor); } -function useEffectEventImpl(payload) { - currentlyRenderingFiber$1.flags |= 4; - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; - if (null === componentUpdateQueue) - (componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue), - (componentUpdateQueue.events = [payload]); - else { - var events = componentUpdateQueue.events; - null === events - ? (componentUpdateQueue.events = [payload]) - : events.push(payload); - } +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } -function updateEvent(callback) { - var ref = updateWorkInProgressHook().memoizedState; - useEffectEventImpl({ ref: ref, nextImpl: callback }); - return function () { - if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); } -function updateInsertionEffect(create, deps) { - return updateEffectImpl(4, 2, create, deps); +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } -function updateLayoutEffect(create, deps) { - return updateEffectImpl(4, 4, create, deps); +var renderLanes = 0, + currentlyRenderingFiber = null, + currentHook = null, + workInProgressHook = null, + didScheduleRenderPhaseUpdate = !1, + didScheduleRenderPhaseUpdateDuringThisPass = !1, + shouldDoubleInvokeUserFnsInHooksDEV = !1, + localIdCounter = 0, + thenableIndexCounter$1 = 0, + thenableState$1 = null, + globalClientIdCounter = 0; +function throwInvalidHookError() { + throw Error(formatProdErrorMessage(321)); } -function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; - } - if (null !== ref && void 0 !== ref) - return ( - (create = create()), - (ref.current = create), - function () { - ref.current = null; - } - ); +function areHookInputsEqual(nextDeps, prevDeps) { + if (null === prevDeps) return !1; + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) + if (!objectIs(nextDeps[i], prevDeps[i])) return !1; + return !0; } -function updateImperativeHandle(ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); +function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes +) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null === current || null === current.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate; + shouldDoubleInvokeUserFnsInHooksDEV = !1; + nextRenderLanes = Component(props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (nextRenderLanes = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + finishRenderingHooks(current); + return nextRenderLanes; } -function mountDebugValue() {} -function updateCallback(callback, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - hook.memoizedState = [callback, deps]; - return callback; +function finishRenderingHooks(current) { + ReactSharedInternals.H = ContextOnlyDispatcher; + var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdate = !1; + thenableIndexCounter$1 = 0; + thenableState$1 = null; + if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); + null === current || + didReceiveUpdate || + ((current = current.dependencies), + null !== current && + checkIfContextChanged(current) && + (didReceiveUpdate = !0)); } -function updateMemo(nextCreate, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - prevState = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); +function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = workInProgress; + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); + thenableIndexCounter$1 = 0; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); + numberOfReRenders += 1; + workInProgressHook = currentHook = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); } - } - hook.memoizedState = [prevState, deps]; - return prevState; + ReactSharedInternals.H = HooksDispatcherOnRerender; + children = Component(props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; } -function mountDeferredValueImpl(hook, value, initialValue) { - if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; +function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && + (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; } -function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook - ); - if (0 === (renderLanes & 42)) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; +function checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; } -function startTransition(fiber, queue, pendingState, finishedState, callback) { - var previousPriority = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = - 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then +function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags &= -2053; + current.lanes &= ~lanes; +} +function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + ) { - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) - ); - } catch (error) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane() - ); - } finally { - (ReactDOMSharedInternals.p = previousPriority), - (ReactSharedInternals.T = prevTransition); + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; + } + didScheduleRenderPhaseUpdate = !1; } + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; } -function noop$2() {} -function startHostTransition(formFiber, pendingState, action, formData) { - if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); - var queue = ensureFormComponentIsStateful(formFiber).queue; - startTransition( - formFiber, - queue, - pendingState, - sharedNotPendingObject, - null === action - ? noop$2 - : function () { - requestFormReset$1(formFiber); - return action(formData); - } - ); -} -function ensureFormComponentIsStateful(formFiber) { - var existingStateHook = formFiber.memoizedState; - if (null !== existingStateHook) return existingStateHook; - existingStateHook = { - memoizedState: sharedNotPendingObject, - baseState: sharedNotPendingObject, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: sharedNotPendingObject - }, - next: null - }; - var initialResetState = {}; - existingStateHook.next = { - memoizedState: initialResetState, - baseState: initialResetState, +function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, + queue: null, next: null }; - formFiber.memoizedState = existingStateHook; - formFiber = formFiber.alternate; - null !== formFiber && (formFiber.memoizedState = existingStateHook); - return existingStateHook; -} -function requestFormReset$1(formFiber) { - var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane()); -} -function useHostTransitionStatus() { - return readContext(HostTransitionContext); -} -function updateId() { - return updateWorkInProgressHook().memoizedState; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; } -function updateRefresh() { - return updateWorkInProgressHook().memoizedState; -} -function refreshCache(fiber, seedKey, seedValue) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(); - fiber = createUpdate(lane); - var root$35 = enqueueUpdate(provider, fiber, lane); - null !== root$35 && - (scheduleUpdateOnFiber(root$35, provider, lane), - entangleTransitions(root$35, provider, lane)); - provider = createCache(); - null !== seedKey && - void 0 !== seedKey && - null !== root$35 && - provider.data.set(seedKey, seedValue); - fiber.payload = { cache: provider }; - return; +function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); + else { + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) + throw Error(formatProdErrorMessage(467)); + throw Error(formatProdErrorMessage(310)); } - provider = provider.return; + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } + return workInProgressHook; } -function dispatchReducerAction(fiber, queue, action) { - var lane = requestUpdateLane(); - action = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), - null !== action && - (scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane))); +function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } -function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(); - dispatchSetStateInternal(fiber, queue, action, lane); +function useThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = []); + thenable = trackUsedThenable(thenableState$1, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null === index || null === index.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate)); + return thenable; } -function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); - else { - var alternate = fiber.alternate; - if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) - ) - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) - return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && finishQueueingConcurrentUpdates(), - !1 - ); - } catch (error) { - } finally { - } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) - return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 - ); +function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); } - return !1; -} -function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { - action = { - lane: 2, - revertLane: requestTransitionLane(), - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) { - if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); + throw Error(formatProdErrorMessage(438, String(usable))); } -function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) - ); +function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue) + for ( + updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + memoCache.index++; + return updateQueue; } -function enqueueRenderPhaseUpdate(queue, update) { - didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = - !0; - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; +function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; } -function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { - var queueLanes = queue.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - queue.lanes = lane; - markRootEntangled(root, lane); - } +function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); } -var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError -}; -ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; -ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; -ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; -ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; -ContextOnlyDispatcher.useFormState = throwInvalidHookError; -ContextOnlyDispatcher.useActionState = throwInvalidHookError; -ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; -var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } +function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var baseQueue = hook.baseQueue, + pendingQueue = queue.pending; + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - init(initialArg); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber$1, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber$1, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; + } + pendingQueue = hook.baseState; + if (null === baseQueue) hook.memoizedState = pendingQueue; + else { + current = baseQueue.next; + var newBaseQueueFirst = (baseFirst = null), + newBaseQueueLast = null, + update = current, + didReadFromEntangledAsyncAction$33 = !1; + do { + var updateLane = update.lane & -536870913; + if ( + updateLane !== update.lane + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + var revertLane = update.revertLane; + if (0 === revertLane) + null !== newBaseQueueLast && + (newBaseQueueLast = newBaseQueueLast.next = + { + lane: 0, + revertLane: 0, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$33 = !0); + else if ((renderLanes & revertLane) === revertLane) { + update = update.next; + revertLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$33 = !0); + continue; + } else + (updateLane = { + lane: 0, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); + if ( + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction$33 && + ((reducer = currentEntangledActionThenable), null !== reducer)) + ) + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; + } + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; +} +function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; + } + return [newState, dispatch]; +} +function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(), + isHydrating$jscomp$0 = isHydrating; + if (isHydrating$jscomp$0) { + if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else getServerSnapshot = getSnapshot(); + var snapshotChanged = !objectIs( + (currentHook || hook).memoizedState, + getServerSnapshot + ); + snapshotChanged && + ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); + hook = hook.queue; + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); + if ( + hook.getSnapshot !== getSnapshot || + snapshotChanged || + (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) + ) { fiber.flags |= 2048; pushSimpleEffect( 9, @@ -4164,1094 +3679,1878 @@ var HooksDispatcherOnMount = { updateStoreInstance.bind( null, fiber, - inst, + hook, getServerSnapshot, getSnapshot ), null ); - return getServerSnapshot; - }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var JSCompiler_inline_result = treeContextOverflow; - var idWithLeadingBit = treeContextId; - JSCompiler_inline_result = - ( - idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) - ).toString(32) + JSCompiler_inline_result; - identifierPrefix = - ":" + identifierPrefix + "R" + JSCompiler_inline_result; - JSCompiler_inline_result = localIdCounter++; - 0 < JSCompiler_inline_result && - (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); - identifierPrefix += ":"; - } else - (JSCompiler_inline_result = globalClientIdCounter++), - (identifierPrefix = - ":" + - identifierPrefix + - "r" + - JSCompiler_inline_result.toString(32) + - ":"); - return (hook.memoizedState = identifierPrefix); - }, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber$1 - )); + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } -}; -HooksDispatcherOnMount.useMemoCache = useMemoCache; -HooksDispatcherOnMount.useEffectEvent = function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; -}; -HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnMount.useFormState = mountActionState; -HooksDispatcherOnMount.useActionState = mountActionState; -HooksDispatcherOnMount.useOptimistic = function (passthrough) { + return getServerSnapshot; +} +function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); +} +function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); +} +function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); +} +function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; + } +} +function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); +} +function mountStateImpl(initialState) { var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { + if ("function" === typeof initialState) { + var initialStateInitializer = initialState; + initialState = initialStateInitializer(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } + hook.memoizedState = hook.baseState = initialState; + hook.queue = { pending: null, lanes: 0, dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue + return hook; +} +function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer ); - queue.dispatch = hook; - return [passthrough, hook]; -}; -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId -}; -HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh; -HooksDispatcherOnUpdate.useMemoCache = useMemoCache; -HooksDispatcherOnUpdate.useEffectEvent = updateEvent; -HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnUpdate.useFormState = updateActionState; -HooksDispatcherOnUpdate.useActionState = updateActionState; -HooksDispatcherOnUpdate.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); -}; -var HooksDispatcherOnRerender = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: rerenderReducer, - useRef: updateRef, - useState: function () { - return rerenderReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId -}; -HooksDispatcherOnRerender.useCacheRefresh = updateRefresh; -HooksDispatcherOnRerender.useMemoCache = useMemoCache; -HooksDispatcherOnRerender.useEffectEvent = updateEvent; -HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnRerender.useFormState = rerenderActionState; -HooksDispatcherOnRerender.useActionState = rerenderActionState; -HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; -}; -var thenableState = null, - thenableIndexCounter = 0; -function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, thenable, index); } -function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; +function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload +) { + if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + fiber = actionQueue.action; + if (null !== fiber) { + var actionNode = { + payload: payload, + action: fiber, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); + setPendingState = actionQueue.pending; + null === setPendingState + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = setPendingState.next), + (actionQueue.pending = setPendingState.next = actionNode)); + } } -function throwOnInvalidObjectType(returnFiber, newChild) { - if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) - throw Error(formatProdErrorMessage(525)); - returnFiber = Object.prototype.toString.call(newChild); - throw Error( - formatProdErrorMessage( - 31, - "[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber - ) - ); +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; + } + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$39) { + onActionError(actionQueue, node, error$39); + } } -function resolveLazy(lazyType) { - var init = lazyType._init; - return init(lazyType._payload); +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); } -function createChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (shouldTrackSideEffects) { - var deletions = returnFiber.deletions; - null === deletions - ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) - : deletions.push(childToDelete); - } - } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; - } - function mapRemainingChildren(currentFirstChild) { - for (var existingChildren = new Map(); null !== currentFirstChild; ) - null !== currentFirstChild.key - ? existingChildren.set(currentFirstChild.key, currentFirstChild) - : existingChildren.set(currentFirstChild.index, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return existingChildren; +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); } - function useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; + actionQueue.action = null; +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); +} +function actionStateReducer(oldState, newState) { + return newState; +} +function mountActionState(action, initialStateProp) { + if (isHydrating) { + var ssrFormState = workInProgressRoot.formState; + if (null !== ssrFormState) { + a: { + var JSCompiler_inline_result = currentlyRenderingFiber; + if (isHydrating) { + if (nextHydratableInstance) { + b: { + var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; + for ( + var inRootOrSingleton = rootOrSingletonContext; + 8 !== JSCompiler_inline_result$jscomp$0.nodeType; + + ) { + if (!inRootOrSingleton) { + JSCompiler_inline_result$jscomp$0 = null; + break b; + } + JSCompiler_inline_result$jscomp$0 = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + if (null === JSCompiler_inline_result$jscomp$0) { + JSCompiler_inline_result$jscomp$0 = null; + break b; + } + } + inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; + JSCompiler_inline_result$jscomp$0 = + "F!" === inRootOrSingleton || "F" === inRootOrSingleton + ? JSCompiler_inline_result$jscomp$0 + : null; + } + if (JSCompiler_inline_result$jscomp$0) { + nextHydratableInstance = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + JSCompiler_inline_result = + "F!" === JSCompiler_inline_result$jscomp$0.data; + break a; + } + } + throwOnHydrationMismatch(JSCompiler_inline_result); + } + JSCompiler_inline_result = !1; + } + JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); + } } - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) - return (newFiber.flags |= 1048576), lastPlacedIndex; - newIndex = newFiber.alternate; - if (null !== newIndex) - return ( - (newIndex = newIndex.index), - newIndex < lastPlacedIndex - ? ((newFiber.flags |= 33554434), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 33554434; - return lastPlacedIndex; - } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; + ssrFormState = mountWorkInProgressHook(); + ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; + JSCompiler_inline_result = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + ssrFormState.queue = JSCompiler_inline_result; + ssrFormState = dispatchSetState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result + ); + JSCompiler_inline_result.dispatch = ssrFormState; + JSCompiler_inline_result = mountStateImpl(!1); + inRootOrSingleton = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + JSCompiler_inline_result.queue + ); + JSCompiler_inline_result = mountWorkInProgressHook(); + JSCompiler_inline_result$jscomp$0 = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null + }; + JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; + ssrFormState = dispatchActionState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result$jscomp$0, + inRootOrSingleton, + ssrFormState + ); + JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; + JSCompiler_inline_result.memoizedState = action; + return [initialStateProp, ssrFormState, !1]; +} +function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); +} +function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; + } + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + 9, + createEffectInstance(), + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; +} +function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; +} +function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; +} +function pushSimpleEffect(tag, inst, create, deps) { + tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; + inst = currentlyRenderingFiber.updateQueue; + null === inst && + ((inst = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = inst)); + create = inst.lastEffect; + null === create + ? (inst.lastEffect = tag.next = tag) + : ((deps = create.next), + (create.next = tag), + (tag.next = deps), + (inst.lastEffect = tag)); + return tag; +} +function createEffectInstance() { + return { destroy: void 0, resource: void 0 }; +} +function updateRef() { + return updateWorkInProgressHook().memoizedState; +} +function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + createEffectInstance(), + create, + deps + ); +} +function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var inst = hook.memoizedState.inst; + null !== currentHook && + null !== deps && + areHookInputsEqual(deps, currentHook.memoizedState.deps) + ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + inst, + create, + deps + ))); +} +function mountEffect(create, deps) { + mountEffectImpl(8390656, 8, create, deps); +} +function updateEffect(create, deps) { + updateEffectImpl(2048, 8, create, deps); +} +function useEffectEventImpl(payload) { + currentlyRenderingFiber.flags |= 4; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + if (null === componentUpdateQueue) + (componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = componentUpdateQueue), + (componentUpdateQueue.events = [payload]); + else { + var events = componentUpdateQueue.events; + null === events + ? (componentUpdateQueue.events = [payload]) + : events.push(payload); } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText(textContent, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, textContent); - current.return = returnFiber; - return current; +} +function updateEvent(callback) { + var ref = updateWorkInProgressHook().memoizedState; + useEffectEventImpl({ ref: ref, nextImpl: callback }); + return function () { + if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; +} +function updateInsertionEffect(create, deps) { + return updateEffectImpl(4, 2, create, deps); +} +function updateLayoutEffect(create, deps) { + return updateEffectImpl(4, 4, create, deps); +} +function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key - ); - if ( - null !== current && - (current.elementType === elementType || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - resolveLazy(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - current - ); - current = createFiberFromTypeAndProps( - element.type, - element.key, - element.props, - null, - returnFiber.mode, - lanes + if (null !== ref && void 0 !== ref) + return ( + (create = create()), + (ref.current = create), + function () { + ref.current = null; + } ); - coerceRef(current, element); - current.return = returnFiber; - return current; - } - function updatePortal(returnFiber, current, portal, lanes) { - if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - return current; - } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - current +} +function updateImperativeHandle(ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); +} +function mountDebugValue() {} +function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; +} +function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } + hook.memoizedState = [prevState, deps]; + return prevState; +} +function mountDeferredValueImpl(hook, value, initialValue) { + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; +} +function updateDeferredValueImpl(hook, prevValue, value, initialValue) { + if (objectIs(value, prevValue)) return value; + if (null !== currentTreeHiddenStackCursor.current) + return ( + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook + ); + if (0 === (renderLanes & 42)) + return (didReceiveUpdate = !0), (hook.memoizedState = value); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; +} +function startTransition(fiber, queue, pendingState, finishedState, callback) { + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = + 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); + try { + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + if ( + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState ); - current = useFiber(current, fragment); - current.return = returnFiber; - return current; + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane() + ); + } finally { + (ReactDOMSharedInternals.p = previousPriority), + (ReactSharedInternals.T = prevTransition); } - function createChild(returnFiber, newChild, lanes) { +} +function noop$2() {} +function startHostTransition(formFiber, pendingState, action, formData) { + if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + sharedNotPendingObject, + null === action + ? noop$2 + : function () { + requestFormReset$1(formFiber); + return action(formData); + } + ); +} +function ensureFormComponentIsStateful(formFiber) { + var existingStateHook = formFiber.memoizedState; + if (null !== existingStateHook) return existingStateHook; + existingStateHook = { + memoizedState: sharedNotPendingObject, + baseState: sharedNotPendingObject, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: sharedNotPendingObject + }, + next: null + }; + var initialResetState = {}; + existingStateHook.next = { + memoizedState: initialResetState, + baseState: initialResetState, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialResetState + }, + next: null + }; + formFiber.memoizedState = existingStateHook; + formFiber = formFiber.alternate; + null !== formFiber && (formFiber.memoizedState = existingStateHook); + return existingStateHook; +} +function requestFormReset$1(formFiber) { + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane()); +} +function useHostTransitionStatus() { + return readContext(HostTransitionContext); +} +function updateId() { + return updateWorkInProgressHook().memoizedState; +} +function updateRefresh() { + return updateWorkInProgressHook().memoizedState; +} +function refreshCache(fiber, seedKey, seedValue) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(); + fiber = createUpdate(lane); + var root$42 = enqueueUpdate(provider, fiber, lane); + null !== root$42 && + (scheduleUpdateOnFiber(root$42, provider, lane), + entangleTransitions(root$42, provider, lane)); + provider = createCache(); + null !== seedKey && + void 0 !== seedKey && + null !== root$42 && + provider.data.set(seedKey, seedValue); + fiber.payload = { cache: provider }; + return; + } + provider = provider.return; + } +} +function dispatchReducerAction(fiber, queue, action) { + var lane = requestUpdateLane(); + action = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, action) + : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), + null !== action && + (scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane))); +} +function dispatchSetState(fiber, queue, action) { + var lane = requestUpdateLane(); + dispatchSetStateInternal(fiber, queue, action, lane); +} +function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + else { + var alternate = fiber.alternate; if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: + try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) return ( - (lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && finishQueueingConcurrentUpdates(), + !1 ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return createChild(returnFiber, newChild, lanes); + } catch (error) { + } finally { } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (newChild = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (newChild.return = returnFiber), - newChild - ); - if ("function" === typeof newChild.then) - return createChild(returnFiber, unwrapThenable(newChild), lanes); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) + return ( + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 + ); } - function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = null !== oldFiber ? oldFiber.key : null; - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return null !== key - ? null - : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return newChild.key === key - ? updateElement(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - updateSlot(returnFiber, oldFiber, newChild, lanes) - ); - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return null !== key - ? null - : updateFragment(returnFiber, oldFiber, newChild, lanes, null); - if ("function" === typeof newChild.then) - return updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; + return !1; +} +function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { + action = { + lane: 2, + revertLane: requestTransitionLane(), + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); +} +function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) + ); +} +function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = + !0; + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; +} +function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194176)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); } - function updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) +} +var ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError +}; +ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; +var HooksDispatcherOnMount = { + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updateElement(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_PORTAL_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updatePortal(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ); + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateFragment(returnFiber, existingChildren, newChild, lanes, null) - ); - if ("function" === typeof newChild.then) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; - } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null; - null !== oldFiber && newIdx < newChildren.length; - newIdx++ - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot( - returnFiber, - oldFiber, - newChildren[newIdx], - lanes + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) + throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (newIdx === newChildren.length) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null ); - if (null === oldFiber) { - for (; newIdx < newChildren.length; newIdx++) - (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), - null !== oldFiber && - ((currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + return getServerSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var JSCompiler_inline_result = treeContextOverflow; + var idWithLeadingBit = treeContextId; + JSCompiler_inline_result = + ( + idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) + ).toString(32) + JSCompiler_inline_result; + identifierPrefix = + ":" + identifierPrefix + "R" + JSCompiler_inline_result; + JSCompiler_inline_result = localIdCounter++; + 0 < JSCompiler_inline_result && + (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); + identifierPrefix += ":"; + } else + (JSCompiler_inline_result = globalClientIdCounter++), + (identifierPrefix = + ":" + + identifierPrefix + + "r" + + JSCompiler_inline_result.toString(32) + + ":"); + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; } - for ( - oldFiber = mapRemainingChildren(oldFiber); - newIdx < newChildren.length; - newIdx++ + }, + HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh + }; +HooksDispatcherOnUpdate.useEffectEvent = updateEvent; +var HooksDispatcherOnRerender = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: rerenderReducer, + useRef: updateRef, + useState: function () { + return rerenderReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return null === currentHook + ? mountDeferredValueImpl(hook, value, initialValue) + : updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: rerenderActionState, + useActionState: rerenderActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh +}; +HooksDispatcherOnRerender.useEffectEvent = updateEvent; +var thenableState = null, + thenableIndexCounter = 0; +function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, thenable, index); +} +function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; +} +function throwOnInvalidObjectType(returnFiber, newChild) { + if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) + throw Error(formatProdErrorMessage(525)); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + formatProdErrorMessage( + 31, + "[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - newChildren[newIdx], - lanes - )), - null !== nextOldFiber && - (shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + ); +} +function resolveLazy(lazyType) { + var init = lazyType._init; + return init(lazyType._payload); +} +function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) + : deletions.push(childToDelete); + } } - function reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChildrenIterable, - lanes - ) { - var newChildren = newChildrenIterable[ASYNC_ITERATOR](); - if (null == newChildren) throw Error(formatProdErrorMessage(151)); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - { - next: function () { - return unwrapThenable(newChildren.next()); - } - }, - lanes - ); + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - if (null == newChildren) throw Error(formatProdErrorMessage(151)); - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null, - step = newChildren.next(); - null !== oldFiber && !step.done; - newIdx++, step = newChildren.next() - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (step.done) + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null !== currentFirstChild.key + ? existingChildren.set(currentFirstChild.key, currentFirstChild) + : existingChildren.set(currentFirstChild.index, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return existingChildren; + } + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) + return (newFiber.flags |= 1048576), lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex ); - if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildren.next()) - (step = createChild(returnFiber, step.value, lanes)), - null !== step && - ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() - ) - (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), - null !== step && - (shouldTrackSideEffects && - null !== step.alternate && - oldFiber.delete(null === step.key ? newIdx : step.key), - (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); + newFiber.flags |= 33554434; + return lastPlacedIndex; + } + function placeSingleChild(newFiber) { shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + null === newFiber.alternate && + (newFiber.flags |= 33554434); + return newFiber; } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - (newChild = newChild.props.children); + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) + return ( + (current = createFiberFromText(textContent, returnFiber.mode, lanes)), + (current.return = returnFiber), + current + ); + current = useFiber(current, textContent); + current.return = returnFiber; + return current; + } + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return updateFragment( + returnFiber, + current, + element.props.children, + lanes, + element.key + ); + if ( + null !== current && + (current.elementType === elementType || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + resolveLazy(elementType) === current.type)) + ) + return ( + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + current + ); + current = createFiberFromTypeAndProps( + element.type, + element.key, + element.props, + null, + returnFiber.mode, + lanes + ); + coerceRef(current, element); + current.return = returnFiber; + return current; + } + function updatePortal(returnFiber, current, portal, lanes) { + if ( + null === current || + 4 !== current.tag || + current.stateNode.containerInfo !== portal.containerInfo || + current.stateNode.implementation !== portal.implementation + ) + return ( + (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), + (current.return = returnFiber), + current + ); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + return current; + } + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + current + ); + current = useFiber(current, fragment); + current.return = returnFiber; + return current; + } + function createChild(returnFiber, newChild, lanes) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); if ("object" === typeof newChild && null !== newChild) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: - a: { - for (var key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) { - key = newChild.type; - if (key === REACT_FRAGMENT_TYPE) { - if (7 === currentFirstChild.tag) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - newChild.props.children - ); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - } else if ( - currentFirstChild.elementType === key || - ("object" === typeof key && - null !== key && - key.$$typeof === REACT_LAZY_TYPE && - resolveLazy(key) === currentFirstChild.type) - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.props); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - newChild.type === REACT_FRAGMENT_TYPE - ? ((lanes = createFiberFromFragment( - newChild.props.children, - returnFiber.mode, - lanes, - newChild.key - )), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : ((lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = lanes)); - } - return placeSingleChild(returnFiber); - case REACT_PORTAL_TYPE: - a: { - for (key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) - if ( - 4 === currentFirstChild.tag && - currentFirstChild.stateNode.containerInfo === - newChild.containerInfo && - currentFirstChild.stateNode.implementation === - newChild.implementation - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.children || []); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } else { - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); - lanes.return = returnFiber; - returnFiber = lanes; - } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - reconcileChildFibersImpl( - returnFiber, - currentFirstChild, + (lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( newChild, + returnFiber.mode, lanes - ) + )), + (newChild.return = returnFiber), + newChild ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return createChild(returnFiber, newChild, lanes); } - if (isArrayImpl(newChild)) - return reconcileChildrenArray( + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (newChild = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (newChild.return = returnFiber), + newChild + ); + if ("function" === typeof newChild.then) + return createChild(returnFiber, unwrapThenable(newChild), lanes); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( returnFiber, - currentFirstChild, - newChild, + readContextDuringReconciliation(returnFiber, newChild), lanes ); - if (getIteratorFn(newChild)) { - key = getIteratorFn(newChild); - if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); - newChild = key.call(newChild); - return reconcileChildrenIterator( + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; + } + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return null !== key + ? null + : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return newChild.key === key + ? updateElement(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + updateSlot(returnFiber, oldFiber, newChild, lanes) + ); + } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return null !== key + ? null + : updateFragment(returnFiber, oldFiber, newChild, lanes, null); + if ("function" === typeof newChild.then) + return updateSlot( returnFiber, - currentFirstChild, - newChild, + oldFiber, + unwrapThenable(newChild), lanes ); - } - if ("function" === typeof newChild[ASYNC_ITERATOR]) - return reconcileChildrenAsyncIteratable( + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( returnFiber, - currentFirstChild, - newChild, + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), lanes ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; + } + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updateElement(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_PORTAL_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updatePortal(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ); + } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateFragment(returnFiber, existingChildren, newChild, lanes, null) + ); if ("function" === typeof newChild.then) - return reconcileChildFibersImpl( + return updateFromMap( + existingChildren, returnFiber, - currentFirstChild, + newIdx, unwrapThenable(newChild), lanes ); if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( + return updateFromMap( + existingChildren, returnFiber, - currentFirstChild, + newIdx, readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); } - return ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ? ((newChild = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), - (lanes = useFiber(currentFirstChild, newChild)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), - (lanes.return = returnFiber), - (returnFiber = lanes)), - placeSingleChild(returnFiber)) - : deleteRemainingChildren(returnFiber, currentFirstChild); + return null; } - return function (returnFiber, currentFirstChild, newChild, lanes) { - try { - thenableIndexCounter = 0; - var firstChildFiber = reconcileChildFibersImpl( + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( returnFiber, - currentFirstChild, - newChild, + oldFiber, + newChildren[newIdx], lanes ); - thenableState = null; - return firstChildFiber; - } catch (x) { - if (x === SuspenseException || x === SuspenseActionException) throw x; - var fiber = createFiberImplClass(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - return fiber; - } finally { + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; } - }; -} -var reconcileChildFibers = createChildReconciler(!0), - mountChildFibers = createChildReconciler(!1), - suspenseHandlerStackCursor = createCursor(null), - shellBoundary = null; -function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push(suspenseStackCursor, suspenseStackCursor.current & 1); - push(suspenseHandlerStackCursor, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); -} -function pushOffscreenSuspenseHandler(fiber) { - if (22 === fiber.tag) { - if ( - (push(suspenseStackCursor, suspenseStackCursor.current), - push(suspenseHandlerStackCursor, fiber), - null === shellBoundary) - ) { - var current = fiber.alternate; - null !== current && - null !== current.memoizedState && - (shellBoundary = fiber); + if (newIdx === newChildren.length) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild + ); + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; } - } else reuseSuspenseHandlerOnStack(fiber); -} -function reuseSuspenseHandlerOnStack() { - push(suspenseStackCursor, suspenseStackCursor.current); - push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); -} -function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor); -} -var suspenseStackCursor = createCursor(0); -function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - ((state = state.dehydrated), - null === state || - "$?" === state.data || - isSuspenseInstanceFallback(state)) - ) - return node; - } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { - if (0 !== (node.flags & 128)) return node; - } else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; + for ( + oldFiber = mapRemainingChildren(oldFiber); + newIdx < newChildren.length; + newIdx++ + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + newChildren[newIdx], + lanes + )), + null !== nextOldFiber && + (shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChildrenIterable, + lanes + ) { + var newChildren = newChildrenIterable[ASYNC_ITERATOR](); + if (null == newChildren) throw Error(formatProdErrorMessage(151)); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + { + next: function () { + return unwrapThenable(newChildren.next()); + } + }, + lanes + ); + } + function reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + if (null == newChildren) throw Error(formatProdErrorMessage(151)); + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null, + step = newChildren.next(); + null !== oldFiber && !step.done; + newIdx++, step = newChildren.next() + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; } - if (node === row) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === row) return null; - node = node.return; + if (step.done) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild + ); + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (step = createChild(returnFiber, step.value, lanes)), + null !== step && + ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; } - node.sibling.return = node.return; - node = node.sibling; + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() + ) + (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), + null !== step && + (shouldTrackSideEffects && + null !== step.alternate && + oldFiber.delete(null === step.key ? newIdx : step.key), + (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; } - return null; -} -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); -} -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) { + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + (newChild = newChild.props.children); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + a: { + for (var key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === currentFirstChild.tag) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + newChild.props.children + ); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + } else if ( + currentFirstChild.elementType === key || + ("object" === typeof key && + null !== key && + key.$$typeof === REACT_LAZY_TYPE && + resolveLazy(key) === currentFirstChild.type) + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.props); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + newChild.type === REACT_FRAGMENT_TYPE + ? ((lanes = createFiberFromFragment( + newChild.props.children, + returnFiber.mode, + lanes, + newChild.key + )), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = lanes)); + } + return placeSingleChild(returnFiber); + case REACT_PORTAL_TYPE: + a: { + for (key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + newChild.containerInfo && + currentFirstChild.stateNode.implementation === + newChild.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.children || []); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); + lanes.return = returnFiber; + returnFiber = lanes; + } + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) + ); + } + if (isArrayImpl(newChild)) + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if (getIteratorFn(newChild)) { + key = getIteratorFn(newChild); + if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); + newChild = key.call(newChild); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + } + if ("function" === typeof newChild[ASYNC_ITERATOR]) + return reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if ("function" === typeof newChild.then) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ? ((newChild = "" + newChild), + null !== currentFirstChild && 6 === currentFirstChild.tag + ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), + (lanes = useFiber(currentFirstChild, newChild)), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : (deleteRemainingChildren(returnFiber, currentFirstChild), + (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), + (lanes.return = returnFiber), + (returnFiber = lanes)), + placeSingleChild(returnFiber)) + : deleteRemainingChildren(returnFiber, currentFirstChild); } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext -) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; -} -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext -) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); + return function (returnFiber, currentFirstChild, newChild, lanes) { + try { + thenableIndexCounter = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + thenableState = null; + return firstChildFiber; + } catch (x) { + if (x === SuspenseException || x === SuspenseActionException) throw x; + var fiber = createFiberImplClass(29, x, null, returnFiber.mode); + fiber.lanes = lanes; + fiber.return = returnFiber; + return fiber; + } finally { + } + }; } -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$68 in Component) - void 0 === newProps[propName$68] && - (newProps[propName$68] = Component[propName$68]); +var reconcileChildFibers = createChildReconciler(!0), + mountChildFibers = createChildReconciler(!1), + suspenseHandlerStackCursor = createCursor(null), + shellBoundary = null; +function pushPrimaryTreeSuspenseHandler(handler) { + var current = handler.alternate; + push(suspenseStackCursor, suspenseStackCursor.current & 1); + push(suspenseHandlerStackCursor, handler); + null === shellBoundary && + (null === current || null !== currentTreeHiddenStackCursor.current + ? (shellBoundary = handler) + : null !== current.memoizedState && (shellBoundary = handler)); +} +function pushOffscreenSuspenseHandler(fiber) { + if (22 === fiber.tag) { + if ( + (push(suspenseStackCursor, suspenseStackCursor.current), + push(suspenseHandlerStackCursor, fiber), + null === shellBoundary) + ) { + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); +} +function reuseSuspenseHandlerOnStack() { + push(suspenseStackCursor, suspenseStackCursor.current); + push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); +} +function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor); +} +var suspenseStackCursor = createCursor(0); +function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; + if ( + null !== state && + ((state = state.dehydrated), + null === state || + "$?" === state.data || + isSuspenseInstanceFallback(state)) + ) + return node; + } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; } - return newProps; + return null; } var reportGlobalError = "function" === typeof reportError @@ -5295,9 +5594,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$69) { + } catch (e$75) { setTimeout(function () { - throw e$69; + throw e$75; }); } } @@ -5308,9 +5607,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$70) { + } catch (e$76) { setTimeout(function () { - throw e$70; + throw e$76; }); } } @@ -5326,2315 +5625,1870 @@ function createRootErrorUpdate(root, errorInfo, lane) { function createClassErrorUpdate(lane) { lane = createUpdate(lane); lane.tag = 3; - return lane; -} -function initializeClassErrorUpdate(update, root, fiber, errorInfo) { - var getDerivedStateFromError = fiber.type.getDerivedStateFromError; - if ("function" === typeof getDerivedStateFromError) { - var error = errorInfo.value; - update.payload = function () { - return getDerivedStateFromError(error); - }; - update.callback = function () { - logCaughtError(root, fiber, errorInfo); - }; - } - var inst = fiber.stateNode; - null !== inst && - "function" === typeof inst.componentDidCatch && - (update.callback = function () { - logCaughtError(root, fiber, errorInfo); - "function" !== typeof getDerivedStateFromError && - (null === legacyErrorBoundariesThatAlreadyFailed - ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) - : legacyErrorBoundariesThatAlreadyFailed.add(this)); - var stack = errorInfo.stack; - this.componentDidCatch(errorInfo.value, { - componentStack: null !== stack ? stack : "" - }); - }); -} -function resetSuspendedComponent(sourceFiber, rootRenderLanes) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 - ); -} -function markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes -) { - suspenseBoundary.flags |= 65536; - suspenseBoundary.lanes = rootRenderLanes; - return suspenseBoundary; -} -function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes -) { - sourceFiber.flags |= 32768; - if ( - null !== value && - "object" === typeof value && - (value.$$typeof === REACT_POSTPONE_TYPE && - (value = { then: function () {} }), - "function" === typeof value.then) - ) { - resetSuspendedComponent(sourceFiber, rootRenderLanes); - var suspenseBoundary = suspenseHandlerStackCursor.current; - if (null !== suspenseBoundary) { - switch (suspenseBoundary.tag) { - case 13: - return ( - null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === suspenseBoundary.alternate && - 0 === workInProgressRootExitStatus && - (workInProgressRootExitStatus = 3), - (suspenseBoundary.flags &= -257), - markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value === noopSuspenseyCommitThenable - ? (suspenseBoundary.flags |= 16384) - : ((sourceFiber = suspenseBoundary.updateQueue), - null === sourceFiber - ? (suspenseBoundary.updateQueue = new Set([value])) - : sourceFiber.add(value), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - case 22: - return ( - (suspenseBoundary.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (suspenseBoundary.flags |= 16384) - : ((sourceFiber = suspenseBoundary.updateQueue), - null === sourceFiber - ? ((sourceFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (suspenseBoundary.updateQueue = sourceFiber)) - : ((returnFiber = sourceFiber.retryQueue), - null === returnFiber - ? (sourceFiber.retryQueue = new Set([value])) - : returnFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - } - throw Error(formatProdErrorMessage(435, suspenseBoundary.tag)); - } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; - } - if (isHydrating) - return ( - (suspenseBoundary = suspenseHandlerStackCursor.current), - null !== suspenseBoundary - ? (0 === (suspenseBoundary.flags & 65536) && - (suspenseBoundary.flags |= 256), - markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value !== HydrationMismatchException && - ((root = Error(formatProdErrorMessage(422), { cause: value })), - queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) - : (value !== HydrationMismatchException && - ((returnFiber = Error(formatProdErrorMessage(423), { - cause: value - })), - queueHydrationError( - createCapturedValueAtFiber(returnFiber, sourceFiber) - )), - (root = root.current.alternate), - (root.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (root.lanes |= rootRenderLanes), - (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), - (rootRenderLanes = createRootErrorUpdate( - root.stateNode, - sourceFiber, - rootRenderLanes - )), - enqueueCapturedUpdate(root, rootRenderLanes), - 4 !== workInProgressRootExitStatus && - (workInProgressRootExitStatus = 2)), - !1 - ); - suspenseBoundary = Error(formatProdErrorMessage(520), { cause: value }); - queueConcurrentError( - createCapturedValueAtFiber(suspenseBoundary, sourceFiber) - ); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); - if (null === returnFiber) return !0; - sourceFiber = createCapturedValueAtFiber(value, sourceFiber); - do { - switch (returnFiber.tag) { - case 3: - return ( - (returnFiber.flags |= 65536), - (root = rootRenderLanes & -rootRenderLanes), - (returnFiber.lanes |= root), - (root = createRootErrorUpdate( - returnFiber.stateNode, - sourceFiber, - root - )), - enqueueCapturedUpdate(returnFiber, root), - !1 - ); - case 1: - if ( - ((value = returnFiber.type), - (suspenseBoundary = returnFiber.stateNode), - 0 === (returnFiber.flags & 128) && - ("function" === typeof value.getDerivedStateFromError || - (null !== suspenseBoundary && - "function" === typeof suspenseBoundary.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - suspenseBoundary - ))))) - ) - return ( - (returnFiber.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - returnFiber, - sourceFiber - ), - enqueueCapturedUpdate(returnFiber, rootRenderLanes), - !1 - ); - } - returnFiber = returnFiber.return; - } while (null !== returnFiber); - return !1; -} -var SelectiveHydrationException = Error(formatProdErrorMessage(461)), - didReceiveUpdate = !1; -function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); -} -function updateForwardRef( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - Component = Component.render; - var ref = workInProgress.ref; - if ("ref" in nextProps) { - var propsWithoutRef = {}; - for (var key in nextProps) - "ref" !== key && (propsWithoutRef[key] = nextProps[key]); - } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress); - nextProps = renderWithHooks( - current, - workInProgress, - Component, - propsWithoutRef, - ref, - renderLanes - ); - key = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && key && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; -} -function updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null === current) { - var type = Component.type; - if ( - "function" === typeof type && - !shouldConstruct(type) && - void 0 === type.defaultProps && - null === Component.compare - ) - return ( - (workInProgress.tag = 15), - (workInProgress.type = type), - updateSimpleMemoComponent( - current, - workInProgress, - type, - nextProps, - renderLanes - ) - ); - current = createFiberFromTypeAndProps( - Component.type, - null, - nextProps, - workInProgress, - workInProgress.mode, - renderLanes - ); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); - } - type = current.child; - if (!checkScheduledUpdateOrContext(current, renderLanes)) { - var prevProps = type.memoizedProps; - Component = Component.compare; - Component = null !== Component ? Component : shallowEqual; - if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); - } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); -} -function updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null !== current) { - var prevProps = current.memoizedProps; - if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref - ) - if ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) - ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); - else - return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ); -} -function updateOffscreenComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - nextChildren = nextProps.children, - nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2), - prevState = null !== current ? current.memoizedState : null; - markRef(current, workInProgress); - if ("hidden" === nextProps.mode || nextIsDetached) { - if (0 !== (workInProgress.flags & 128)) { - nextProps = - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; - if (null !== current) { - nextChildren = workInProgress.child = current.child; - for (nextIsDetached = 0; null !== nextChildren; ) - (nextIsDetached = - nextIsDetached | nextChildren.lanes | nextChildren.childLanes), - (nextChildren = nextChildren.sibling); - workInProgress.childLanes = nextIsDetached & ~nextProps; - } else (workInProgress.childLanes = 0), (workInProgress.child = null); - return deferHiddenOffscreenComponent( - current, - workInProgress, - nextProps, - renderLanes - ); - } - if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); - else - return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, - renderLanes - ) - ); - } else - null !== prevState - ? (pushTransition(workInProgress, prevState.cachePool), - pushHiddenContext(workInProgress, prevState), - reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.memoizedState = null)) - : (null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(), - reuseSuspenseHandlerOnStack(workInProgress)); - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; -} -function deferHiddenOffscreenComponent( - current, - workInProgress, - nextBaseLanes, - renderLanes -) { - var JSCompiler_inline_result = peekCacheFromPool(); - JSCompiler_inline_result = - null === JSCompiler_inline_result - ? null - : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result }; - workInProgress.memoizedState = { - baseLanes: nextBaseLanes, - cachePool: JSCompiler_inline_result - }; - null !== current && pushTransition(workInProgress, null); - reuseHiddenContextOnStack(); - pushOffscreenSuspenseHandler(workInProgress); - null !== current && - propagateParentContextChanges(current, workInProgress, renderLanes, !0); - return null; -} -function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (null === ref) - null !== current && - null !== current.ref && - (workInProgress.flags |= 2097664); - else { - if ("function" !== typeof ref && "object" !== typeof ref) - throw Error(formatProdErrorMessage(284)); - if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; - } -} -function updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - prepareToReadContext(workInProgress); - Component = renderWithHooks( - current, - workInProgress, - Component, - nextProps, - void 0, - renderLanes - ); - nextProps = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && nextProps && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, Component, renderLanes); - return workInProgress.child; -} -function replayFunctionComponent( - current, - workInProgress, - nextProps, - Component, - secondArg, - renderLanes -) { - prepareToReadContext(workInProgress); - workInProgress.updateQueue = null; - nextProps = renderWithHooksAgain( - workInProgress, - Component, - nextProps, - secondArg - ); - finishRenderingHooks(current); - Component = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && Component && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; -} -function updateClassComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) { - var context = emptyContextObject, - contextType = Component.contextType; - "object" === typeof contextType && - null !== contextType && - (context = readContext(contextType)); - context = new Component(nextProps, context); - workInProgress.memoizedState = - null !== context.state && void 0 !== context.state ? context.state : null; - context.updater = classComponentUpdater; - workInProgress.stateNode = context; - context._reactInternals = workInProgress; - context = workInProgress.stateNode; - context.props = nextProps; - context.state = workInProgress.memoizedState; - context.refs = {}; - initializeUpdateQueue(workInProgress); - contextType = Component.contextType; - context.context = - "object" === typeof contextType && null !== contextType - ? readContext(contextType) - : emptyContextObject; - context.state = workInProgress.memoizedState; - contextType = Component.getDerivedStateFromProps; - "function" === typeof contextType && - (applyDerivedStateFromProps( - workInProgress, - Component, - contextType, - nextProps - ), - (context.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof context.getSnapshotBeforeUpdate || - ("function" !== typeof context.UNSAFE_componentWillMount && - "function" !== typeof context.componentWillMount) || - ((contextType = context.state), - "function" === typeof context.componentWillMount && - context.componentWillMount(), - "function" === typeof context.UNSAFE_componentWillMount && - context.UNSAFE_componentWillMount(), - contextType !== context.state && - classComponentUpdater.enqueueReplaceState(context, context.state, null), - processUpdateQueue(workInProgress, nextProps, context, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (context.state = workInProgress.memoizedState)); - "function" === typeof context.componentDidMount && - (workInProgress.flags |= 4194308); - nextProps = !0; - } else if (null === current) { - context = workInProgress.stateNode; - var unresolvedOldProps = workInProgress.memoizedProps, - oldProps = resolveClassComponentProps(Component, unresolvedOldProps); - context.props = oldProps; - var oldContext = context.context, - contextType$jscomp$0 = Component.contextType; - contextType = emptyContextObject; - "object" === typeof contextType$jscomp$0 && - null !== contextType$jscomp$0 && - (contextType = readContext(contextType$jscomp$0)); - var getDerivedStateFromProps = Component.getDerivedStateFromProps; - contextType$jscomp$0 = - "function" === typeof getDerivedStateFromProps || - "function" === typeof context.getSnapshotBeforeUpdate; - unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - contextType$jscomp$0 || - ("function" !== typeof context.UNSAFE_componentWillReceiveProps && - "function" !== typeof context.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== contextType) && - callComponentWillReceiveProps( - workInProgress, - context, - nextProps, - contextType - )); - hasForceUpdate = !1; - var oldState = workInProgress.memoizedState; - context.state = oldState; - processUpdateQueue(workInProgress, nextProps, context, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - oldContext = workInProgress.memoizedState; - unresolvedOldProps || oldState !== oldContext || hasForceUpdate - ? ("function" === typeof getDerivedStateFromProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - getDerivedStateFromProps, - nextProps - ), - (oldContext = workInProgress.memoizedState)), - (oldProps = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - oldProps, - nextProps, - oldState, - oldContext, - contextType - )) - ? (contextType$jscomp$0 || - ("function" !== typeof context.UNSAFE_componentWillMount && - "function" !== typeof context.componentWillMount) || - ("function" === typeof context.componentWillMount && - context.componentWillMount(), - "function" === typeof context.UNSAFE_componentWillMount && - context.UNSAFE_componentWillMount()), - "function" === typeof context.componentDidMount && - (workInProgress.flags |= 4194308)) - : ("function" === typeof context.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = oldContext)), - (context.props = nextProps), - (context.state = oldContext), - (context.context = contextType), - (nextProps = oldProps)) - : ("function" === typeof context.componentDidMount && - (workInProgress.flags |= 4194308), - (nextProps = !1)); - } else { - context = workInProgress.stateNode; - cloneUpdateQueue(current, workInProgress); - contextType = workInProgress.memoizedProps; - contextType$jscomp$0 = resolveClassComponentProps(Component, contextType); - context.props = contextType$jscomp$0; - getDerivedStateFromProps = workInProgress.pendingProps; - oldState = context.context; - oldContext = Component.contextType; - oldProps = emptyContextObject; - "object" === typeof oldContext && - null !== oldContext && - (oldProps = readContext(oldContext)); - unresolvedOldProps = Component.getDerivedStateFromProps; - (oldContext = - "function" === typeof unresolvedOldProps || - "function" === typeof context.getSnapshotBeforeUpdate) || - ("function" !== typeof context.UNSAFE_componentWillReceiveProps && - "function" !== typeof context.componentWillReceiveProps) || - ((contextType !== getDerivedStateFromProps || oldState !== oldProps) && - callComponentWillReceiveProps( - workInProgress, - context, - nextProps, - oldProps - )); - hasForceUpdate = !1; - oldState = workInProgress.memoizedState; - context.state = oldState; - processUpdateQueue(workInProgress, nextProps, context, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - contextType !== getDerivedStateFromProps || - oldState !== newState || - hasForceUpdate || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies)) - ? ("function" === typeof unresolvedOldProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - unresolvedOldProps, - nextProps - ), - (newState = workInProgress.memoizedState)), - (contextType$jscomp$0 = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - contextType$jscomp$0, - nextProps, - oldState, - newState, - oldProps - ) || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies))) - ? (oldContext || - ("function" !== typeof context.UNSAFE_componentWillUpdate && - "function" !== typeof context.componentWillUpdate) || - ("function" === typeof context.componentWillUpdate && - context.componentWillUpdate(nextProps, newState, oldProps), - "function" === typeof context.UNSAFE_componentWillUpdate && - context.UNSAFE_componentWillUpdate( - nextProps, - newState, - oldProps - )), - "function" === typeof context.componentDidUpdate && - (workInProgress.flags |= 4), - "function" === typeof context.getSnapshotBeforeUpdate && - (workInProgress.flags |= 1024)) - : ("function" !== typeof context.componentDidUpdate || - (contextType === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof context.getSnapshotBeforeUpdate || - (contextType === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 1024), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = newState)), - (context.props = nextProps), - (context.state = newState), - (context.context = oldProps), - (nextProps = contextType$jscomp$0)) - : ("function" !== typeof context.componentDidUpdate || - (contextType === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof context.getSnapshotBeforeUpdate || - (contextType === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 1024), - (nextProps = !1)); - } - context = nextProps; - markRef(current, workInProgress); - nextProps = 0 !== (workInProgress.flags & 128); - context || nextProps - ? ((context = workInProgress.stateNode), - (Component = - nextProps && "function" !== typeof Component.getDerivedStateFromError - ? null - : context.render()), - (workInProgress.flags |= 1), - null !== current && nextProps - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - Component, - renderLanes - ))) - : reconcileChildren(current, workInProgress, Component, renderLanes), - (workInProgress.memoizedState = context.state), - (current = workInProgress.child)) - : (current = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - )); - return current; + return lane; } -function mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes -) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; +function initializeClassErrorUpdate(update, root, fiber, errorInfo) { + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if ("function" === typeof getDerivedStateFromError) { + var error = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error); + }; + update.callback = function () { + logCaughtError(root, fiber, errorInfo); + }; + } + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + logCaughtError(root, fiber, errorInfo); + "function" !== typeof getDerivedStateFromError && + (null === legacyErrorBoundariesThatAlreadyFailed + ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) + : legacyErrorBoundariesThatAlreadyFailed.add(this)); + var stack = errorInfo.stack; + this.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + }); } -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; -function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; +function resetSuspendedComponent(sourceFiber, rootRenderLanes) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); } -function getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes +function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes ) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; } -function updateSuspenseComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - showFallback = !1, - didSuspend = 0 !== (workInProgress.flags & 128), - JSCompiler_temp; - (JSCompiler_temp = didSuspend) || - (JSCompiler_temp = - null !== current && null === current.memoizedState - ? !1 - : 0 !== (suspenseStackCursor.current & 2)); - JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); - JSCompiler_temp = 0 !== (workInProgress.flags & 32); - workInProgress.flags &= -33; - if (null === current) { - if (isHydrating) { - showFallback - ? pushPrimaryTreeSuspenseHandler(workInProgress) - : reuseSuspenseHandlerOnStack(workInProgress); - if (isHydrating) { - var nextInstance = nextHydratableInstance, - JSCompiler_temp$jscomp$0; - if ((JSCompiler_temp$jscomp$0 = nextInstance)) { - c: { - JSCompiler_temp$jscomp$0 = nextInstance; - for ( - nextInstance = rootOrSingletonContext; - 8 !== JSCompiler_temp$jscomp$0.nodeType; - - ) { - if (!nextInstance) { - nextInstance = null; - break c; - } - JSCompiler_temp$jscomp$0 = getNextHydratable( - JSCompiler_temp$jscomp$0.nextSibling - ); - if (null === JSCompiler_temp$jscomp$0) { - nextInstance = null; - break c; - } - } - nextInstance = JSCompiler_temp$jscomp$0; - } - null !== nextInstance - ? ((workInProgress.memoizedState = { - dehydrated: nextInstance, - treeContext: - null !== treeContextProvider - ? { id: treeContextId, overflow: treeContextOverflow } - : null, - retryLane: 536870912 - }), - (JSCompiler_temp$jscomp$0 = createFiberImplClass( - 18, - null, - null, - 0 - )), - (JSCompiler_temp$jscomp$0.stateNode = nextInstance), - (JSCompiler_temp$jscomp$0.return = workInProgress), - (workInProgress.child = JSCompiler_temp$jscomp$0), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (JSCompiler_temp$jscomp$0 = !0)) - : (JSCompiler_temp$jscomp$0 = !1); - } - JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); - } - nextInstance = workInProgress.memoizedState; - if ( - null !== nextInstance && - ((nextInstance = nextInstance.dehydrated), null !== nextInstance) - ) - return ( - isSuspenseInstanceFallback(nextInstance) - ? (workInProgress.lanes = 16) - : (workInProgress.lanes = 536870912), - null - ); - popSuspenseHandler(workInProgress); - } - nextInstance = nextProps.children; - JSCompiler_temp$jscomp$0 = nextProps.fallback; - if (showFallback) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (nextProps = mountSuspenseFallbackChildren( - workInProgress, - nextInstance, - JSCompiler_temp$jscomp$0, - renderLanes - )), - (showFallback = workInProgress.child), - (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - nextProps - ); - if ("number" === typeof nextProps.unstable_expectedLoadTime) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (nextProps = mountSuspenseFallbackChildren( - workInProgress, - nextInstance, - JSCompiler_temp$jscomp$0, - renderLanes - )), - (showFallback = workInProgress.child), - (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress.lanes = 4194304), - nextProps - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren(workInProgress, nextInstance); - } - JSCompiler_temp$jscomp$0 = current.memoizedState; +function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes +) { + sourceFiber.flags |= 32768; if ( - null !== JSCompiler_temp$jscomp$0 && - ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated), - null !== nextInstance) + null !== value && + "object" === typeof value && + (value.$$typeof === REACT_POSTPONE_TYPE && + (value = { then: function () {} }), + "function" === typeof value.then) ) { - if (didSuspend) - workInProgress.flags & 256 - ? (pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags &= -257), - (workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ))) - : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (showFallback = nextProps.fallback), - (nextInstance = workInProgress.mode), - (nextProps = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: nextProps.children }, - nextInstance - )), - (showFallback = createFiberFromFragment( - showFallback, - nextInstance, - renderLanes, - null - )), - (showFallback.flags |= 2), - (nextProps.return = workInProgress), - (showFallback.return = workInProgress), - (nextProps.sibling = showFallback), - (workInProgress.child = nextProps), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes + resetSuspendedComponent(sourceFiber, rootRenderLanes); + var suspenseBoundary = suspenseHandlerStackCursor.current; + if (null !== suspenseBoundary) { + switch (suspenseBoundary.tag) { + case 13: + return ( + null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === suspenseBoundary.alternate && + 0 === workInProgressRootExitStatus && + (workInProgressRootExitStatus = 3), + (suspenseBoundary.flags &= -257), + markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes ), - (nextProps = workInProgress.child), - (nextProps.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = showFallback)); - else if ( - (pushPrimaryTreeSuspenseHandler(workInProgress), - isSuspenseInstanceFallback(nextInstance)) - ) { - JSCompiler_temp = - nextInstance.nextSibling && nextInstance.nextSibling.dataset; - if (JSCompiler_temp) var digest = JSCompiler_temp.dgst; - JSCompiler_temp = digest; - "POSTPONE" !== JSCompiler_temp && - ((nextProps = Error(formatProdErrorMessage(419))), - (nextProps.stack = ""), - (nextProps.digest = JSCompiler_temp), - queueHydrationError({ value: nextProps, source: null, stack: null })); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else if ( - (didReceiveUpdate || - propagateParentContextChanges(current, workInProgress, renderLanes, !1), - (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_temp) - ) { - JSCompiler_temp = workInProgressRoot; - if (null !== JSCompiler_temp) { - nextProps = renderLanes & -renderLanes; - if (0 !== (nextProps & 42)) nextProps = 1; - else - switch (nextProps) { - case 2: - nextProps = 1; - break; - case 8: - nextProps = 4; - break; - case 32: - nextProps = 16; - break; - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - nextProps = 64; - break; - case 268435456: - nextProps = 134217728; - break; - default: - nextProps = 0; - } - nextProps = - 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) - ? 0 - : nextProps; - if (0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) - throw ( - ((JSCompiler_temp$jscomp$0.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), - SelectiveHydrationException) + value === noopSuspenseyCommitThenable + ? (suspenseBoundary.flags |= 16384) + : ((sourceFiber = suspenseBoundary.updateQueue), + null === sourceFiber + ? (suspenseBoundary.updateQueue = new Set([value])) + : sourceFiber.add(value), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + case 22: + return ( + (suspenseBoundary.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (suspenseBoundary.flags |= 16384) + : ((sourceFiber = suspenseBoundary.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (suspenseBoundary.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 ); } - "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else - "$?" === nextInstance.data - ? ((workInProgress.flags |= 192), - (workInProgress.child = current.child), - (workInProgress = null)) - : ((current = JSCompiler_temp$jscomp$0.treeContext), - (nextHydratableInstance = getNextHydratable( - nextInstance.nextSibling - )), - (hydrationParentFiber = workInProgress), - (isHydrating = !0), - (hydrationErrors = null), - (rootOrSingletonContext = !1), - null !== current && - ((idStack[idStackIndex++] = treeContextId), - (idStack[idStackIndex++] = treeContextOverflow), - (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = current.id), - (treeContextOverflow = current.overflow), - (treeContextProvider = workInProgress)), - (workInProgress = mountSuspensePrimaryChildren( - workInProgress, - nextProps.children - )), - (workInProgress.flags |= 4096)); - return workInProgress; + throw Error(formatProdErrorMessage(435, suspenseBoundary.tag)); + } + attachPingListener(root, value, rootRenderLanes); + renderDidSuspendDelayIfPossible(); + return !1; } - if (showFallback) + if (isHydrating) return ( - reuseSuspenseHandlerOnStack(workInProgress), - (showFallback = nextProps.fallback), - (nextInstance = workInProgress.mode), - (JSCompiler_temp$jscomp$0 = current.child), - (digest = JSCompiler_temp$jscomp$0.sibling), - (nextProps = createWorkInProgress(JSCompiler_temp$jscomp$0, { - mode: "hidden", - children: nextProps.children - })), - (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280), - null !== digest - ? (showFallback = createWorkInProgress(digest, showFallback)) - : ((showFallback = createFiberFromFragment( - showFallback, - nextInstance, - renderLanes, - null + (suspenseBoundary = suspenseHandlerStackCursor.current), + null !== suspenseBoundary + ? (0 === (suspenseBoundary.flags & 65536) && + (suspenseBoundary.flags |= 256), + markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value !== HydrationMismatchException && + ((root = Error(formatProdErrorMessage(422), { cause: value })), + queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) + : (value !== HydrationMismatchException && + ((returnFiber = Error(formatProdErrorMessage(423), { + cause: value + })), + queueHydrationError( + createCapturedValueAtFiber(returnFiber, sourceFiber) + )), + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes )), - (showFallback.flags |= 2)), - (showFallback.return = workInProgress), - (nextProps.return = workInProgress), - (nextProps.sibling = showFallback), - (workInProgress.child = nextProps), - (nextProps = showFallback), - (showFallback = workInProgress.child), - (nextInstance = current.child.memoizedState), - null === nextInstance - ? (nextInstance = mountSuspenseOffscreenState(renderLanes)) - : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool), - null !== JSCompiler_temp$jscomp$0 - ? ((digest = CacheContext._currentValue), - (JSCompiler_temp$jscomp$0 = - JSCompiler_temp$jscomp$0.parent !== digest - ? { parent: digest, pool: digest } - : JSCompiler_temp$jscomp$0)) - : (JSCompiler_temp$jscomp$0 = getSuspendedCache()), - (nextInstance = { - baseLanes: nextInstance.baseLanes | renderLanes, - cachePool: JSCompiler_temp$jscomp$0 - })), - (showFallback.memoizedState = nextInstance), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - nextProps + enqueueCapturedUpdate(root, rootRenderLanes), + 4 !== workInProgressRootExitStatus && + (workInProgressRootExitStatus = 2)), + !1 ); - pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { - mode: "visible", - children: nextProps.children - }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; - null !== current && - ((JSCompiler_temp = workInProgress.deletions), - null === JSCompiler_temp - ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_temp.push(current)); - workInProgress.child = renderLanes; - workInProgress.memoizedState = null; - return renderLanes; + suspenseBoundary = Error(formatProdErrorMessage(520), { cause: value }); + queueConcurrentError( + createCapturedValueAtFiber(suspenseBoundary, sourceFiber) + ); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + do { + switch (returnFiber.tag) { + case 3: + return ( + (returnFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(returnFiber, root), + !1 + ); + case 1: + if ( + ((value = returnFiber.type), + (suspenseBoundary = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== suspenseBoundary && + "function" === typeof suspenseBoundary.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has( + suspenseBoundary + ))))) + ) + return ( + (returnFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + returnFiber, + sourceFiber + ), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), + !1 + ); + } + returnFiber = returnFiber.return; + } while (null !== returnFiber); + return !1; } -function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: primaryChildren }, - workInProgress.mode - ); - primaryChildren.return = workInProgress; - return (workInProgress.child = primaryChildren); +var SelectiveHydrationException = Error(formatProdErrorMessage(461)), + didReceiveUpdate = !1; +function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { + workInProgress.child = + null === current + ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) + : reconcileChildFibers( + workInProgress, + current.child, + nextChildren, + renderLanes + ); } -function mountSuspenseFallbackChildren( +function updateForwardRef( + current, workInProgress, - primaryChildren, - fallbackChildren, + Component, + nextProps, renderLanes ) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); - fallbackChildren = createFiberFromFragment( - fallbackChildren, - mode, - renderLanes, - null + Component = Component.render; + var ref = workInProgress.ref; + if ("ref" in nextProps) { + var propsWithoutRef = {}; + for (var key in nextProps) + "ref" !== key && (propsWithoutRef[key] = nextProps[key]); + } else propsWithoutRef = nextProps; + prepareToReadContext(workInProgress); + nextProps = renderWithHooks( + current, + workInProgress, + Component, + propsWithoutRef, + ref, + renderLanes ); - primaryChildren.return = workInProgress; - fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; - return fallbackChildren; -} -function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); + key = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && key && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; } -function retrySuspenseComponentWithoutHydrating( +function updateMemoComponent( current, workInProgress, + Component, + nextProps, renderLanes ) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountSuspensePrimaryChildren( - workInProgress, - workInProgress.pendingProps.children - ); - current.flags |= 2; - workInProgress.memoizedState = null; - return current; -} -function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { - fiber.lanes |= renderLanes; - var alternate = fiber.alternate; - null !== alternate && (alternate.lanes |= renderLanes); - scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); + if (null === current) { + var type = Component.type; + if ( + "function" === typeof type && + !shouldConstruct(type) && + void 0 === type.defaultProps && + null === Component.compare + ) + return ( + (workInProgress.tag = 15), + (workInProgress.type = type), + updateSimpleMemoComponent( + current, + workInProgress, + type, + nextProps, + renderLanes + ) + ); + current = createFiberFromTypeAndProps( + Component.type, + null, + nextProps, + workInProgress, + workInProgress.mode, + renderLanes + ); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + type = current.child; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); } -function initSuspenseListRenderState( +function updateSimpleMemoComponent( + current, workInProgress, - isBackwards, - tail, - lastContentRow, - tailMode + Component, + nextProps, + renderLanes ) { - var renderState = workInProgress.memoizedState; - null === renderState - ? (workInProgress.memoizedState = { - isBackwards: isBackwards, - rendering: null, - renderingStartTime: 0, - last: lastContentRow, - tail: tail, - tailMode: tailMode - }) - : ((renderState.isBackwards = isBackwards), - (renderState.rendering = null), - (renderState.renderingStartTime = 0), - (renderState.last = lastContentRow), - (renderState.tail = tail), - (renderState.tailMode = tailMode)); + if (null !== current) { + var prevProps = current.memoizedProps; + if ( + shallowEqual(prevProps, nextProps) && + current.ref === workInProgress.ref + ) + if ( + ((didReceiveUpdate = !1), + (workInProgress.pendingProps = nextProps = prevProps), + checkScheduledUpdateOrContext(current, renderLanes)) + ) + 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + else + return ( + (workInProgress.lanes = current.lanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + } + return updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ); } -function updateSuspenseListComponent(current, workInProgress, renderLanes) { +function updateOffscreenComponent(current, workInProgress, renderLanes) { var nextProps = workInProgress.pendingProps, - revealOrder = nextProps.revealOrder, - tailMode = nextProps.tail; - reconcileChildren(current, workInProgress, nextProps.children, renderLanes); - nextProps = suspenseStackCursor.current; - if (0 !== (nextProps & 2)) - (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128); - else { - if (null !== current && 0 !== (current.flags & 128)) - a: for (current = workInProgress.child; null !== current; ) { - if (13 === current.tag) - null !== current.memoizedState && - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (19 === current.tag) - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (null !== current.child) { - current.child.return = current; - current = current.child; - continue; - } - if (current === workInProgress) break a; - for (; null === current.sibling; ) { - if (null === current.return || current.return === workInProgress) - break a; - current = current.return; - } - current.sibling.return = current.return; - current = current.sibling; - } - nextProps &= 1; - } - push(suspenseStackCursor, nextProps); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); - initSuspenseListRenderState( + nextChildren = nextProps.children, + nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2), + prevState = null !== current ? current.memoizedState : null; + markRef(current, workInProgress); + if ("hidden" === nextProps.mode || nextIsDetached) { + if (0 !== (workInProgress.flags & 128)) { + nextProps = + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; + if (null !== current) { + nextChildren = workInProgress.child = current.child; + for (nextIsDetached = 0; null !== nextChildren; ) + (nextIsDetached = + nextIsDetached | nextChildren.lanes | nextChildren.childLanes), + (nextChildren = nextChildren.sibling); + workInProgress.childLanes = nextIsDetached & ~nextProps; + } else (workInProgress.childLanes = 0), (workInProgress.child = null); + return deferHiddenOffscreenComponent( + current, workInProgress, - !1, - revealOrder, - renderLanes, - tailMode + nextProps, + renderLanes ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode + } + if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else + return ( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( + current, + workInProgress, + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, + renderLanes + ) ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } + } else + null !== prevState + ? (pushTransition(workInProgress, prevState.cachePool), + pushHiddenContext(workInProgress, prevState), + reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.memoizedState = null)) + : (null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(), + reuseSuspenseHandlerOnStack(workInProgress)); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } -function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { - null !== current && (workInProgress.dependencies = current.dependencies); - workInProgressRootSkippedLanes |= workInProgress.lanes; - if (0 === (renderLanes & workInProgress.childLanes)) - if (null !== current) { - if ( - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - 0 === (renderLanes & workInProgress.childLanes)) - ) - return null; - } else return null; - if (null !== current && workInProgress.child !== current.child) - throw Error(formatProdErrorMessage(153)); - if (null !== workInProgress.child) { - current = workInProgress.child; - renderLanes = createWorkInProgress(current, current.pendingProps); - workInProgress.child = renderLanes; - for (renderLanes.return = workInProgress; null !== current.sibling; ) - (current = current.sibling), - (renderLanes = renderLanes.sibling = - createWorkInProgress(current, current.pendingProps)), - (renderLanes.return = workInProgress); - renderLanes.sibling = null; +function deferHiddenOffscreenComponent( + current, + workInProgress, + nextBaseLanes, + renderLanes +) { + var JSCompiler_inline_result = peekCacheFromPool(); + JSCompiler_inline_result = + null === JSCompiler_inline_result + ? null + : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result }; + workInProgress.memoizedState = { + baseLanes: nextBaseLanes, + cachePool: JSCompiler_inline_result + }; + null !== current && pushTransition(workInProgress, null); + reuseHiddenContextOnStack(); + pushOffscreenSuspenseHandler(workInProgress); + null !== current && + propagateParentContextChanges(current, workInProgress, renderLanes, !0); + return null; +} +function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error(formatProdErrorMessage(284)); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; } +} +function updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + prepareToReadContext(workInProgress); + Component = renderWithHooks( + current, + workInProgress, + Component, + nextProps, + void 0, + renderLanes + ); + nextProps = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && nextProps && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); return workInProgress.child; } -function checkScheduledUpdateOrContext(current, renderLanes) { - if (0 !== (current.lanes & renderLanes)) return !0; - current = current.dependencies; - return null !== current && checkIfContextChanged(current) ? !0 : !1; +function replayFunctionComponent( + current, + workInProgress, + nextProps, + Component, + secondArg, + renderLanes +) { + prepareToReadContext(workInProgress); + workInProgress.updateQueue = null; + nextProps = renderWithHooksAgain( + workInProgress, + Component, + nextProps, + secondArg + ); + finishRenderingHooks(current); + Component = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && Component && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; } -function attemptEarlyBailoutIfNoScheduledUpdate( +function updateClassComponent( current, workInProgress, + Component, + nextProps, renderLanes ) { - switch (workInProgress.tag) { - case 3: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); - resetHydrationState(); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 4: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - break; - case 10: - pushProvider( + prepareToReadContext(workInProgress); + if (null === workInProgress.stateNode) { + var context = emptyContextObject, + contextType = Component.contextType; + "object" === typeof contextType && + null !== contextType && + (context = readContext(contextType)); + context = new Component(nextProps, context); + workInProgress.memoizedState = + null !== context.state && void 0 !== context.state ? context.state : null; + context.updater = classComponentUpdater; + workInProgress.stateNode = context; + context._reactInternals = workInProgress; + context = workInProgress.stateNode; + context.props = nextProps; + context.state = workInProgress.memoizedState; + context.refs = {}; + initializeUpdateQueue(workInProgress); + contextType = Component.contextType; + context.context = + "object" === typeof contextType && null !== contextType + ? readContext(contextType) + : emptyContextObject; + context.state = workInProgress.memoizedState; + contextType = Component.getDerivedStateFromProps; + "function" === typeof contextType && + (applyDerivedStateFromProps( workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value - ); - break; - case 13: - var state = workInProgress.memoizedState; - if (null !== state) { - if (null !== state.dehydrated) - return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - if (0 !== (renderLanes & workInProgress.child.childLanes)) - return updateSuspenseComponent(current, workInProgress, renderLanes); - pushPrimaryTreeSuspenseHandler(workInProgress); - current = bailoutOnAlreadyFinishedWork( - current, + Component, + contextType, + nextProps + ), + (context.state = workInProgress.memoizedState)); + "function" === typeof Component.getDerivedStateFromProps || + "function" === typeof context.getSnapshotBeforeUpdate || + ("function" !== typeof context.UNSAFE_componentWillMount && + "function" !== typeof context.componentWillMount) || + ((contextType = context.state), + "function" === typeof context.componentWillMount && + context.componentWillMount(), + "function" === typeof context.UNSAFE_componentWillMount && + context.UNSAFE_componentWillMount(), + contextType !== context.state && + classComponentUpdater.enqueueReplaceState(context, context.state, null), + processUpdateQueue(workInProgress, nextProps, context, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (context.state = workInProgress.memoizedState)); + "function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308); + nextProps = !0; + } else if (null === current) { + context = workInProgress.stateNode; + var unresolvedOldProps = workInProgress.memoizedProps, + oldProps = resolveClassComponentProps(Component, unresolvedOldProps); + context.props = oldProps; + var oldContext = context.context, + contextType$jscomp$0 = Component.contextType; + contextType = emptyContextObject; + "object" === typeof contextType$jscomp$0 && + null !== contextType$jscomp$0 && + (contextType = readContext(contextType$jscomp$0)); + var getDerivedStateFromProps = Component.getDerivedStateFromProps; + contextType$jscomp$0 = + "function" === typeof getDerivedStateFromProps || + "function" === typeof context.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + contextType$jscomp$0 || + ("function" !== typeof context.UNSAFE_componentWillReceiveProps && + "function" !== typeof context.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && + callComponentWillReceiveProps( workInProgress, - renderLanes - ); - return null !== current ? current.sibling : null; - } - pushPrimaryTreeSuspenseHandler(workInProgress); - break; - case 19: - var didSuspendBefore = 0 !== (current.flags & 128); - state = 0 !== (renderLanes & workInProgress.childLanes); - state || - (propagateParentContextChanges( - current, + context, + nextProps, + contextType + )); + hasForceUpdate = !1; + var oldState = workInProgress.memoizedState; + context.state = oldState; + processUpdateQueue(workInProgress, nextProps, context, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + oldContext = workInProgress.memoizedState; + unresolvedOldProps || oldState !== oldContext || hasForceUpdate + ? ("function" === typeof getDerivedStateFromProps && + (applyDerivedStateFromProps( + workInProgress, + Component, + getDerivedStateFromProps, + nextProps + ), + (oldContext = workInProgress.memoizedState)), + (oldProps = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + oldProps, + nextProps, + oldState, + oldContext, + contextType + )) + ? (contextType$jscomp$0 || + ("function" !== typeof context.UNSAFE_componentWillMount && + "function" !== typeof context.componentWillMount) || + ("function" === typeof context.componentWillMount && + context.componentWillMount(), + "function" === typeof context.UNSAFE_componentWillMount && + context.UNSAFE_componentWillMount()), + "function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308)) + : ("function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (context.props = nextProps), + (context.state = oldContext), + (context.context = contextType), + (nextProps = oldProps)) + : ("function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308), + (nextProps = !1)); + } else { + context = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + contextType = workInProgress.memoizedProps; + contextType$jscomp$0 = resolveClassComponentProps(Component, contextType); + context.props = contextType$jscomp$0; + getDerivedStateFromProps = workInProgress.pendingProps; + oldState = context.context; + oldContext = Component.contextType; + oldProps = emptyContextObject; + "object" === typeof oldContext && + null !== oldContext && + (oldProps = readContext(oldContext)); + unresolvedOldProps = Component.getDerivedStateFromProps; + (oldContext = + "function" === typeof unresolvedOldProps || + "function" === typeof context.getSnapshotBeforeUpdate) || + ("function" !== typeof context.UNSAFE_componentWillReceiveProps && + "function" !== typeof context.componentWillReceiveProps) || + ((contextType !== getDerivedStateFromProps || oldState !== oldProps) && + callComponentWillReceiveProps( workInProgress, - renderLanes, - !1 - ), - (state = 0 !== (renderLanes & workInProgress.childLanes))); - if (didSuspendBefore) { - if (state) - return updateSuspenseListComponent( - current, + context, + nextProps, + oldProps + )); + hasForceUpdate = !1; + oldState = workInProgress.memoizedState; + context.state = oldState; + processUpdateQueue(workInProgress, nextProps, context, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + contextType !== getDerivedStateFromProps || + oldState !== newState || + hasForceUpdate || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) + ? ("function" === typeof unresolvedOldProps && + (applyDerivedStateFromProps( workInProgress, - renderLanes - ); - workInProgress.flags |= 128; - } - didSuspendBefore = workInProgress.memoizedState; - null !== didSuspendBefore && - ((didSuspendBefore.rendering = null), - (didSuspendBefore.tail = null), - (didSuspendBefore.lastEffect = null)); - push(suspenseStackCursor, suspenseStackCursor.current); - if (state) break; - else return null; - case 22: - case 23: - return ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) - ); - case 24: - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); + Component, + unresolvedOldProps, + nextProps + ), + (newState = workInProgress.memoizedState)), + (contextType$jscomp$0 = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + contextType$jscomp$0, + nextProps, + oldState, + newState, + oldProps + ) || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) + ? (oldContext || + ("function" !== typeof context.UNSAFE_componentWillUpdate && + "function" !== typeof context.componentWillUpdate) || + ("function" === typeof context.componentWillUpdate && + context.componentWillUpdate(nextProps, newState, oldProps), + "function" === typeof context.UNSAFE_componentWillUpdate && + context.UNSAFE_componentWillUpdate( + nextProps, + newState, + oldProps + )), + "function" === typeof context.componentDidUpdate && + (workInProgress.flags |= 4), + "function" === typeof context.getSnapshotBeforeUpdate && + (workInProgress.flags |= 1024)) + : ("function" !== typeof context.componentDidUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof context.getSnapshotBeforeUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 1024), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = newState)), + (context.props = nextProps), + (context.state = newState), + (context.context = oldProps), + (nextProps = contextType$jscomp$0)) + : ("function" !== typeof context.componentDidUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof context.getSnapshotBeforeUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 1024), + (nextProps = !1)); } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); -} -function beginWork(current, workInProgress, renderLanes) { - if (null !== current) - if (current.memoizedProps !== workInProgress.pendingProps) - didReceiveUpdate = !0; - else { - if ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) - ) - return ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, + context = nextProps; + markRef(current, workInProgress); + nextProps = 0 !== (workInProgress.flags & 128); + context || nextProps + ? ((context = workInProgress.stateNode), + (Component = + nextProps && "function" !== typeof Component.getDerivedStateFromError + ? null + : context.render()), + (workInProgress.flags |= 1), + null !== current && nextProps + ? ((workInProgress.child = reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( workInProgress, + null, + Component, renderLanes - ) - ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; - } - else - (didReceiveUpdate = !1), - isHydrating && - 0 !== (workInProgress.flags & 1048576) && - pushTreeId(workInProgress, treeForkCount, workInProgress.index); - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 16: - a: { - current = workInProgress.pendingProps; - var lazyComponent = workInProgress.elementType, - init = lazyComponent._init; - lazyComponent = init(lazyComponent._payload); - workInProgress.type = lazyComponent; - if ("function" === typeof lazyComponent) - shouldConstruct(lazyComponent) - ? ((current = resolveClassComponentProps(lazyComponent, current)), - (workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - lazyComponent, - current, - renderLanes - ))) - : ((workInProgress.tag = 0), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - lazyComponent, - current, - renderLanes - ))); - else { - if (void 0 !== lazyComponent && null !== lazyComponent) - if ( - ((init = lazyComponent.$$typeof), init === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - lazyComponent, - current, - renderLanes - ); - break a; - } else if (init === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - lazyComponent, - current, - renderLanes - ); - break a; - } - workInProgress = - getComponentNameFromType(lazyComponent) || lazyComponent; - throw Error(formatProdErrorMessage(306, workInProgress, "")); - } - } - return workInProgress; - case 0: - return updateFunctionComponent( + ))) + : reconcileChildren(current, workInProgress, Component, renderLanes), + (workInProgress.memoizedState = context.state), + (current = workInProgress.child)) + : (current = bailoutOnAlreadyFinishedWork( current, workInProgress, - workInProgress.type, - workInProgress.pendingProps, renderLanes - ); - case 1: - return ( - (lazyComponent = workInProgress.type), - (init = resolveClassComponentProps( - lazyComponent, - workInProgress.pendingProps - )), - updateClassComponent( - current, - workInProgress, - lazyComponent, - init, - renderLanes - ) - ); - case 3: - a: { - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ); - if (null === current) throw Error(formatProdErrorMessage(387)); - var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - lazyComponent = init.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - var nextState = workInProgress.memoizedState; - nextProps = nextState.cache; - pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ); - suspendIfUpdateReadFromEntangledAsyncAction(); - nextProps = nextState.element; - if (init.isDehydrated) - if ( - ((init = { - element: nextProps, - isDehydrated: !1, - cache: nextState.cache - }), - (workInProgress.updateQueue.baseState = init), - (workInProgress.memoizedState = init), - workInProgress.flags & 256) - ) { - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else if (nextProps !== lazyComponent) { - lazyComponent = createCapturedValueAtFiber( - Error(formatProdErrorMessage(424)), - workInProgress - ); - queueHydrationError(lazyComponent); - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else + )); + return current; +} +function mountHostRootWithoutHydrating( + current, + workInProgress, + nextChildren, + renderLanes +) { + resetHydrationState(); + workInProgress.flags |= 256; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; +} +var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; +function mountSuspenseOffscreenState(renderLanes) { + return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; +} +function getRemainingWorkInPrimaryTree( + current, + primaryTreeDidDefer, + renderLanes +) { + current = null !== current ? current.childLanes & ~renderLanes : 0; + primaryTreeDidDefer && (current |= workInProgressDeferredLane); + return current; +} +function updateSuspenseComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + showFallback = !1, + didSuspend = 0 !== (workInProgress.flags & 128), + JSCompiler_temp; + (JSCompiler_temp = didSuspend) || + (JSCompiler_temp = + null !== current && null === current.memoizedState + ? !1 + : 0 !== (suspenseStackCursor.current & 2)); + JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); + JSCompiler_temp = 0 !== (workInProgress.flags & 32); + workInProgress.flags &= -33; + if (null === current) { + if (isHydrating) { + showFallback + ? pushPrimaryTreeSuspenseHandler(workInProgress) + : reuseSuspenseHandlerOnStack(workInProgress); + if (isHydrating) { + var nextInstance = nextHydratableInstance, + JSCompiler_temp$jscomp$0; + if ((JSCompiler_temp$jscomp$0 = nextInstance)) { + c: { + JSCompiler_temp$jscomp$0 = nextInstance; for ( - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ), - hydrationParentFiber = workInProgress, - isHydrating = !0, - hydrationErrors = null, - rootOrSingletonContext = !0, - renderLanes = mountChildFibers( - workInProgress, - null, - nextProps, - renderLanes - ), - workInProgress.child = renderLanes; - renderLanes; + nextInstance = rootOrSingletonContext; + 8 !== JSCompiler_temp$jscomp$0.nodeType; - ) - (renderLanes.flags = (renderLanes.flags & -3) | 4096), - (renderLanes = renderLanes.sibling); - else { - resetHydrationState(); - if (nextProps === lazyComponent) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; + ) { + if (!nextInstance) { + nextInstance = null; + break c; + } + JSCompiler_temp$jscomp$0 = getNextHydratable( + JSCompiler_temp$jscomp$0.nextSibling + ); + if (null === JSCompiler_temp$jscomp$0) { + nextInstance = null; + break c; + } + } + nextInstance = JSCompiler_temp$jscomp$0; } - reconcileChildren(current, workInProgress, nextProps, renderLanes); + null !== nextInstance + ? ((workInProgress.memoizedState = { + dehydrated: nextInstance, + treeContext: + null !== treeContextProvider + ? { id: treeContextId, overflow: treeContextOverflow } + : null, + retryLane: 536870912 + }), + (JSCompiler_temp$jscomp$0 = createFiberImplClass( + 18, + null, + null, + 0 + )), + (JSCompiler_temp$jscomp$0.stateNode = nextInstance), + (JSCompiler_temp$jscomp$0.return = workInProgress), + (workInProgress.child = JSCompiler_temp$jscomp$0), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (JSCompiler_temp$jscomp$0 = !0)) + : (JSCompiler_temp$jscomp$0 = !1); } - workInProgress = workInProgress.child; + JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); } - return workInProgress; - case 26: - return ( - markRef(current, workInProgress), - null === current - ? (renderLanes = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - )) - ? (workInProgress.memoizedState = renderLanes) - : isHydrating || - ((renderLanes = workInProgress.type), - (current = workInProgress.pendingProps), - (lazyComponent = getOwnerDocumentFromRootContainer( - rootInstanceStackCursor.current - ).createElement(renderLanes)), - (lazyComponent[internalInstanceKey] = workInProgress), - (lazyComponent[internalPropsKey] = current), - setInitialProperties(lazyComponent, renderLanes, current), - markNodeAsHoistable(lazyComponent), - (workInProgress.stateNode = lazyComponent)) - : (workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - )), - null - ); - case 27: + nextInstance = workInProgress.memoizedState; + if ( + null !== nextInstance && + ((nextInstance = nextInstance.dehydrated), null !== nextInstance) + ) + return ( + isSuspenseInstanceFallback(nextInstance) + ? (workInProgress.lanes = 32) + : (workInProgress.lanes = 536870912), + null + ); + popSuspenseHandler(workInProgress); + } + nextInstance = nextProps.children; + JSCompiler_temp$jscomp$0 = nextProps.fallback; + if (showFallback) return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((lazyComponent = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - rootInstanceStackCursor.current - )), - (hydrationParentFiber = workInProgress), - (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable( - lazyComponent.firstChild - ))), - (lazyComponent = workInProgress.pendingProps.children), - null !== current || isHydrating - ? reconcileChildren( - current, - workInProgress, - lazyComponent, - renderLanes - ) - : (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - lazyComponent, - renderLanes - )), - markRef(current, workInProgress), - workInProgress.child - ); - case 5: - if (null === current && isHydrating) { - if ((init = lazyComponent = nextHydratableInstance)) - (lazyComponent = canHydrateInstance( - lazyComponent, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== lazyComponent - ? ((workInProgress.stateNode = lazyComponent), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = getNextHydratable( - lazyComponent.firstChild - )), - (rootOrSingletonContext = !1), - (init = !0)) - : (init = !1); - init || throwOnHydrationMismatch(workInProgress); - } - pushHostContext(workInProgress); - init = workInProgress.type; - nextProps = workInProgress.pendingProps; - nextState = null !== current ? current.memoizedProps : null; - lazyComponent = nextProps.children; - shouldSetTextContent(init, nextProps) - ? (lazyComponent = null) - : null !== nextState && - shouldSetTextContent(init, nextState) && - (workInProgress.flags |= 32); - null !== workInProgress.memoizedState && - ((init = renderWithHooks( - current, + reuseSuspenseHandlerOnStack(workInProgress), + (nextProps = mountSuspenseFallbackChildren( workInProgress, - TransitionAwareHostComponent, - null, - null, + nextInstance, + JSCompiler_temp$jscomp$0, renderLanes )), - (HostTransitionContext._currentValue = init)); - markRef(current, workInProgress); - reconcileChildren(current, workInProgress, lazyComponent, renderLanes); - return workInProgress.child; - case 6: - if (null === current && isHydrating) { - if ((current = renderLanes = nextHydratableInstance)) - (renderLanes = canHydrateTextInstance( - renderLanes, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== renderLanes - ? ((workInProgress.stateNode = renderLanes), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (current = !0)) - : (current = !1); - current || throwOnHydrationMismatch(workInProgress); - } - return null; - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: + (showFallback = workInProgress.child), + (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + nextProps + ); + if ("number" === typeof nextProps.unstable_expectedLoadTime) return ( - pushHostContainer( + reuseSuspenseHandlerOnStack(workInProgress), + (nextProps = mountSuspenseFallbackChildren( workInProgress, - workInProgress.stateNode.containerInfo - ), - (lazyComponent = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( + nextInstance, + JSCompiler_temp$jscomp$0, + renderLanes + )), + (showFallback = workInProgress.child), + (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress.lanes = 4194304), + nextProps + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren(workInProgress, nextInstance); + } + JSCompiler_temp$jscomp$0 = current.memoizedState; + if ( + null !== JSCompiler_temp$jscomp$0 && + ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated), + null !== nextInstance) + ) { + if (didSuspend) + workInProgress.flags & 256 + ? (pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags &= -257), + (workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ))) + : null !== workInProgress.memoizedState + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = nextProps.fallback), + (nextInstance = workInProgress.mode), + (nextProps = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: nextProps.children }, + nextInstance + )), + (showFallback = createFiberFromFragment( + showFallback, + nextInstance, + renderLanes, + null + )), + (showFallback.flags |= 2), + (nextProps.return = workInProgress), + (showFallback.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + reconcileChildFibers( workInProgress, + current.child, null, - lazyComponent, renderLanes - )) - : reconcileChildren( + ), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( current, - workInProgress, - lazyComponent, + JSCompiler_temp, renderLanes - ), - workInProgress.child - ); - case 11: - return updateForwardRef( + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = showFallback)); + else if ( + (pushPrimaryTreeSuspenseHandler(workInProgress), + isSuspenseInstanceFallback(nextInstance)) + ) { + JSCompiler_temp = + nextInstance.nextSibling && nextInstance.nextSibling.dataset; + if (JSCompiler_temp) var digest = JSCompiler_temp.dgst; + JSCompiler_temp = digest; + "POSTPONE" !== JSCompiler_temp && + ((nextProps = Error(formatProdErrorMessage(419))), + (nextProps.stack = ""), + (nextProps.digest = JSCompiler_temp), + queueHydrationError({ value: nextProps, source: null, stack: null })); + workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - workInProgress.type, - workInProgress.pendingProps, renderLanes ); - case 7: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child - ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 12: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 10: - return ( - (lazyComponent = workInProgress.pendingProps), - pushProvider(workInProgress, workInProgress.type, lazyComponent.value), - reconcileChildren( - current, - workInProgress, - lazyComponent.children, - renderLanes - ), - workInProgress.child - ); - case 9: - return ( - (init = workInProgress.type._context), - (lazyComponent = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress), - (init = readContext(init)), - (lazyComponent = lazyComponent(init)), - (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, lazyComponent, renderLanes), - workInProgress.child - ); - case 14: - return updateMemoComponent( + } else if ( + (didReceiveUpdate || + propagateParentContextChanges(current, workInProgress, renderLanes, !1), + (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), + didReceiveUpdate || JSCompiler_temp) + ) { + JSCompiler_temp = workInProgressRoot; + if ( + null !== JSCompiler_temp && + ((nextProps = renderLanes & -renderLanes), + (nextProps = + 0 !== (nextProps & 42) + ? 1 + : getBumpedLaneForHydrationByLane(nextProps)), + (nextProps = + 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) + ? 0 + : nextProps), + 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) + ) + throw ( + ((JSCompiler_temp$jscomp$0.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), + SelectiveHydrationException) + ); + "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); + workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - workInProgress.type, - workInProgress.pendingProps, renderLanes ); - case 15: - return updateSimpleMemoComponent( + } else + "$?" === nextInstance.data + ? ((workInProgress.flags |= 192), + (workInProgress.child = current.child), + (workInProgress = null)) + : ((current = JSCompiler_temp$jscomp$0.treeContext), + (nextHydratableInstance = getNextHydratable( + nextInstance.nextSibling + )), + (hydrationParentFiber = workInProgress), + (isHydrating = !0), + (hydrationErrors = null), + (rootOrSingletonContext = !1), + null !== current && + ((idStack[idStackIndex++] = treeContextId), + (idStack[idStackIndex++] = treeContextOverflow), + (idStack[idStackIndex++] = treeContextProvider), + (treeContextId = current.id), + (treeContextOverflow = current.overflow), + (treeContextProvider = workInProgress)), + (workInProgress = mountSuspensePrimaryChildren( + workInProgress, + nextProps.children + )), + (workInProgress.flags |= 4096)); + return workInProgress; + } + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = nextProps.fallback), + (nextInstance = workInProgress.mode), + (JSCompiler_temp$jscomp$0 = current.child), + (digest = JSCompiler_temp$jscomp$0.sibling), + (nextProps = createWorkInProgress(JSCompiler_temp$jscomp$0, { + mode: "hidden", + children: nextProps.children + })), + (nextProps.subtreeFlags = + JSCompiler_temp$jscomp$0.subtreeFlags & 31457280), + null !== digest + ? (showFallback = createWorkInProgress(digest, showFallback)) + : ((showFallback = createFiberFromFragment( + showFallback, + nextInstance, + renderLanes, + null + )), + (showFallback.flags |= 2)), + (showFallback.return = workInProgress), + (nextProps.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + (nextProps = showFallback), + (showFallback = workInProgress.child), + (nextInstance = current.child.memoizedState), + null === nextInstance + ? (nextInstance = mountSuspenseOffscreenState(renderLanes)) + : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool), + null !== JSCompiler_temp$jscomp$0 + ? ((digest = CacheContext._currentValue), + (JSCompiler_temp$jscomp$0 = + JSCompiler_temp$jscomp$0.parent !== digest + ? { parent: digest, pool: digest } + : JSCompiler_temp$jscomp$0)) + : (JSCompiler_temp$jscomp$0 = getSuspendedCache()), + (nextInstance = { + baseLanes: nextInstance.baseLanes | renderLanes, + cachePool: JSCompiler_temp$jscomp$0 + })), + (showFallback.memoizedState = nextInstance), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, + JSCompiler_temp, renderLanes - ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (lazyComponent = readContext(CacheContext)), - null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), - (nextProps = createCache()), - (init.pooledCache = nextProps), - nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), - (workInProgress.memoizedState = { - parent: lazyComponent, - cache: init - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), - (nextProps = workInProgress.memoizedState), - init.parent !== lazyComponent - ? ((init = { parent: lazyComponent, cache: lazyComponent }), - (workInProgress.memoizedState = init), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, lazyComponent)) - : ((lazyComponent = nextProps.cache), - pushProvider(workInProgress, CacheContext, lazyComponent), - lazyComponent !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error(formatProdErrorMessage(156, workInProgress.tag)); -} -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = null; -function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue); - context._currentValue = nextValue; -} -function popProvider(context) { - context._currentValue = valueCursor.current; - pop(valueCursor); -} -function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { - for (; null !== parent; ) { - var alternate = parent.alternate; - (parent.childLanes & renderLanes) !== renderLanes - ? ((parent.childLanes |= renderLanes), - null !== alternate && (alternate.childLanes |= renderLanes)) - : null !== alternate && - (alternate.childLanes & renderLanes) !== renderLanes && - (alternate.childLanes |= renderLanes); - if (parent === propagationRoot) break; - parent = parent.return; - } + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + nextProps + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + renderLanes = current.child; + current = renderLanes.sibling; + renderLanes = createWorkInProgress(renderLanes, { + mode: "visible", + children: nextProps.children + }); + renderLanes.return = workInProgress; + renderLanes.sibling = null; + null !== current && + ((JSCompiler_temp = workInProgress.deletions), + null === JSCompiler_temp + ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) + : JSCompiler_temp.push(current)); + workInProgress.child = renderLanes; + workInProgress.memoizedState = null; + return renderLanes; } -function propagateContextChanges( +function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: primaryChildren }, + workInProgress.mode + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); +} +function mountSuspenseFallbackChildren( workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree + primaryChildren, + fallbackChildren, + renderLanes ) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } + var mode = workInProgress.mode; + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "hidden", children: primaryChildren }, + mode + ); + fallbackChildren = createFiberFromFragment( + fallbackChildren, + mode, + renderLanes, + null + ); + primaryChildren.return = workInProgress; + fallbackChildren.return = workInProgress; + primaryChildren.sibling = fallbackChildren; + workInProgress.child = primaryChildren; + return fallbackChildren; } -function propagateParentContextChanges( +function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { + return createFiberFromOffscreen(offscreenProps, mode, 0, null); +} +function retrySuspenseComponentWithoutHydrating( current, workInProgress, - renderLanes, - forcePropagateEntireTree + renderLanes ) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; - - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current ? current.push(context) : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); - } - parent = parent.return; - } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; -} -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); -} -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); -} -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; -} -var hasForceUpdate = !1; -function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren( + workInProgress, + workInProgress.pendingProps.children + ); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; } -function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); +function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); } -function createUpdate(lane) { - return { lane: lane, tag: 0, payload: null, callback: null, next: null }; +function initSuspenseListRenderState( + workInProgress, + isBackwards, + tail, + lastContentRow, + tailMode +) { + var renderState = workInProgress.memoizedState; + null === renderState + ? (workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + }) + : ((renderState.isBackwards = isBackwards), + (renderState.rendering = null), + (renderState.renderingStartTime = 0), + (renderState.last = lastContentRow), + (renderState.tail = tail), + (renderState.tailMode = tailMode)); } -function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if (0 !== (executionContext & 2)) { - var pending = updateQueue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - updateQueue.pending = update; - update = getRootForUpdatedFiber(fiber); - markUpdateLaneFromFiberToRoot(fiber, null, lane); - return update; +function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + reconcileChildren(current, workInProgress, nextProps.children, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & 2)) + (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128); + else { + if (null !== current && 0 !== (current.flags & 128)) + a: for (current = workInProgress.child; null !== current; ) { + if (13 === current.tag) + null !== current.memoizedState && + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (19 === current.tag) + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling; ) { + if (null === current.return || current.return === workInProgress) + break a; + current = current.return; + } + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= 1; } - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); -} -function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); + push(suspenseStackCursor, nextProps); + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); + renderLanes = revealOrder; + null === renderLanes + ? ((revealOrder = workInProgress.child), (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; } + return workInProgress.child; } -function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( - null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks - }; - workInProgress.updateQueue = queue; - return; +function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { + null !== current && (workInProgress.dependencies = current.dependencies); + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) + if (null !== current) { + if ( + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + 0 === (renderLanes & workInProgress.childLanes)) + ) + return null; + } else return null; + if (null !== current && workInProgress.child !== current.child) + throw Error(formatProdErrorMessage(153)); + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + for (renderLanes.return = workInProgress; null !== current.sibling; ) + (current = current.sibling), + (renderLanes = renderLanes.sibling = + createWorkInProgress(current, current.pendingProps)), + (renderLanes.return = workInProgress); + renderLanes.sibling = null; } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + return workInProgress.child; } -var didReadFromEntangledAsyncAction = !1; -function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; - } +function checkScheduledUpdateOrContext(current, renderLanes) { + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } -function processUpdateQueue( - workInProgress$jscomp$0, - props, - instance$jscomp$0, +function attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, renderLanes ) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress$jscomp$0.updateQueue; - hasForceUpdate = !1; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress$jscomp$0.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); + switch (workInProgress.tag) { + case 3: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); + resetHydrationState(); + break; + case 27: + case 5: + pushHostContext(workInProgress); + break; + case 4: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + break; + case 10: + pushProvider( + workInProgress, + workInProgress.type, + workInProgress.memoizedProps.value + ); + break; + case 13: + var state = workInProgress.memoizedState; + if (null !== state) { + if (null !== state.dehydrated) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags |= 128), + null + ); + if (0 !== (renderLanes & workInProgress.child.childLanes)) + return updateSuspenseComponent(current, workInProgress, renderLanes); + pushPrimaryTreeSuspenseHandler(workInProgress); + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + return null !== current ? current.sibling : null; + } + pushPrimaryTreeSuspenseHandler(workInProgress); + break; + case 19: + var didSuspendBefore = 0 !== (current.flags & 128); + state = 0 !== (renderLanes & workInProgress.childLanes); + state || + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (state = 0 !== (renderLanes & workInProgress.childLanes))); + if (didSuspendBefore) { + if (state) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + workInProgress.flags |= 128; + } + didSuspendBefore = workInProgress.memoizedState; + null !== didSuspendBefore && + ((didSuspendBefore.rendering = null), + (didSuspendBefore.tail = null), + (didSuspendBefore.lastEffect = null)); + push(suspenseStackCursor, suspenseStackCursor.current); + if (state) break; + else return null; + case 22: + case 23: + return ( + (workInProgress.lanes = 0), + updateOffscreenComponent(current, workInProgress, renderLanes) + ); + case 24: + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); +} +function beginWork(current, workInProgress, renderLanes) { + if (null !== current) + if (current.memoizedProps !== workInProgress.pendingProps) + didReceiveUpdate = !0; + else { if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - var workInProgress = workInProgress$jscomp$0, - update = pendingQueue; - updateLane = props; - var instance = instance$jscomp$0; - switch (update.tag) { - case 1: - workInProgress = update.payload; - if ("function" === typeof workInProgress) { - newState = workInProgress.call(instance, newState, updateLane); - break a; - } - newState = workInProgress; + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) + ) + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + } + else + (didReceiveUpdate = !1), + isHydrating && + 0 !== (workInProgress.flags & 1048576) && + pushTreeId(workInProgress, treeForkCount, workInProgress.index); + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 16: + a: { + current = workInProgress.pendingProps; + var lazyComponent = workInProgress.elementType, + init = lazyComponent._init; + lazyComponent = init(lazyComponent._payload); + workInProgress.type = lazyComponent; + if ("function" === typeof lazyComponent) + shouldConstruct(lazyComponent) + ? ((current = resolveClassComponentProps(lazyComponent, current)), + (workInProgress.tag = 1), + (workInProgress = updateClassComponent( + null, + workInProgress, + lazyComponent, + current, + renderLanes + ))) + : ((workInProgress.tag = 0), + (workInProgress = updateFunctionComponent( + null, + workInProgress, + lazyComponent, + current, + renderLanes + ))); + else { + if (void 0 !== lazyComponent && null !== lazyComponent) + if ( + ((init = lazyComponent.$$typeof), init === REACT_FORWARD_REF_TYPE) + ) { + workInProgress.tag = 11; + workInProgress = updateForwardRef( + null, + workInProgress, + lazyComponent, + current, + renderLanes + ); break a; - case 3: - workInProgress.flags = (workInProgress.flags & -65537) | 128; - case 0: - workInProgress = update.payload; - updateLane = - "function" === typeof workInProgress - ? workInProgress.call(instance, newState, updateLane) - : workInProgress; - if (null === updateLane || void 0 === updateLane) break a; - newState = assign({}, newState, updateLane); + } else if (init === REACT_MEMO_TYPE) { + workInProgress.tag = 14; + workInProgress = updateMemoComponent( + null, + workInProgress, + lazyComponent, + current, + renderLanes + ); break a; - case 2: - hasForceUpdate = !0; + } + workInProgress = + getComponentNameFromType(lazyComponent) || lazyComponent; + throw Error(formatProdErrorMessage(306, workInProgress, "")); + } + } + return workInProgress; + case 0: + return updateFunctionComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 1: + return ( + (lazyComponent = workInProgress.type), + (init = resolveClassComponentProps( + lazyComponent, + workInProgress.pendingProps + )), + updateClassComponent( + current, + workInProgress, + lazyComponent, + init, + renderLanes + ) + ); + case 3: + a: { + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + if (null === current) throw Error(formatProdErrorMessage(387)); + var nextProps = workInProgress.pendingProps; + init = workInProgress.memoizedState; + lazyComponent = init.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + var nextState = workInProgress.memoizedState; + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); + suspendIfUpdateReadFromEntangledAsyncAction(); + nextProps = nextState.element; + if (init.isDehydrated) + if ( + ((init = { + element: nextProps, + isDehydrated: !1, + cache: nextState.cache + }), + (workInProgress.updateQueue.baseState = init), + (workInProgress.memoizedState = init), + workInProgress.flags & 256) + ) { + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else if (nextProps !== lazyComponent) { + lazyComponent = createCapturedValueAtFiber( + Error(formatProdErrorMessage(424)), + workInProgress + ); + queueHydrationError(lazyComponent); + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else + for ( + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ), + hydrationParentFiber = workInProgress, + isHydrating = !0, + hydrationErrors = null, + rootOrSingletonContext = !0, + renderLanes = mountChildFibers( + workInProgress, + null, + nextProps, + renderLanes + ), + workInProgress.child = renderLanes; + renderLanes; + + ) + (renderLanes.flags = (renderLanes.flags & -3) | 4096), + (renderLanes = renderLanes.sibling); + else { + resetHydrationState(); + if (nextProps === lazyComponent) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + break a; } + reconcileChildren(current, workInProgress, nextProps, renderLanes); } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress$jscomp$0.flags |= 64), - isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null - }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) - break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress$jscomp$0.lanes = lastBaseUpdate; - workInProgress$jscomp$0.memoizedState = newState; + workInProgress = workInProgress.child; + } + return workInProgress; + case 26: + return ( + markRef(current, workInProgress), + null === current + ? (renderLanes = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + )) + ? (workInProgress.memoizedState = renderLanes) + : isHydrating || + ((renderLanes = workInProgress.type), + (current = workInProgress.pendingProps), + (lazyComponent = getOwnerDocumentFromRootContainer( + rootInstanceStackCursor.current + ).createElement(renderLanes)), + (lazyComponent[internalInstanceKey] = workInProgress), + (lazyComponent[internalPropsKey] = current), + setInitialProperties(lazyComponent, renderLanes, current), + markNodeAsHoistable(lazyComponent), + (workInProgress.stateNode = lazyComponent)) + : (workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + )), + null + ); + case 27: + return ( + pushHostContext(workInProgress), + null === current && + isHydrating && + ((lazyComponent = workInProgress.stateNode = + resolveSingletonInstance( + workInProgress.type, + workInProgress.pendingProps, + rootInstanceStackCursor.current + )), + (hydrationParentFiber = workInProgress), + (rootOrSingletonContext = !0), + (nextHydratableInstance = getNextHydratable( + lazyComponent.firstChild + ))), + (lazyComponent = workInProgress.pendingProps.children), + null !== current || isHydrating + ? reconcileChildren( + current, + workInProgress, + lazyComponent, + renderLanes + ) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + lazyComponent, + renderLanes + )), + markRef(current, workInProgress), + workInProgress.child + ); + case 5: + if (null === current && isHydrating) { + if ((init = lazyComponent = nextHydratableInstance)) + (lazyComponent = canHydrateInstance( + lazyComponent, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== lazyComponent + ? ((workInProgress.stateNode = lazyComponent), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = getNextHydratable( + lazyComponent.firstChild + )), + (rootOrSingletonContext = !1), + (init = !0)) + : (init = !1); + init || throwOnHydrationMismatch(workInProgress); + } + pushHostContext(workInProgress); + init = workInProgress.type; + nextProps = workInProgress.pendingProps; + nextState = null !== current ? current.memoizedProps : null; + lazyComponent = nextProps.children; + shouldSetTextContent(init, nextProps) + ? (lazyComponent = null) + : null !== nextState && + shouldSetTextContent(init, nextState) && + (workInProgress.flags |= 32); + null !== workInProgress.memoizedState && + ((init = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue = init)); + markRef(current, workInProgress); + reconcileChildren(current, workInProgress, lazyComponent, renderLanes); + return workInProgress.child; + case 6: + if (null === current && isHydrating) { + if ((current = renderLanes = nextHydratableInstance)) + (renderLanes = canHydrateTextInstance( + renderLanes, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== renderLanes + ? ((workInProgress.stateNode = renderLanes), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (current = !0)) + : (current = !1); + current || throwOnHydrationMismatch(workInProgress); + } + return null; + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (lazyComponent = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + lazyComponent, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + lazyComponent, + renderLanes + ), + workInProgress.child + ); + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child + ); + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return ( + (lazyComponent = workInProgress.pendingProps), + pushProvider(workInProgress, workInProgress.type, lazyComponent.value), + reconcileChildren( + current, + workInProgress, + lazyComponent.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (init = workInProgress.type._context), + (lazyComponent = workInProgress.pendingProps.children), + prepareToReadContext(workInProgress), + (init = readContext(init)), + (lazyComponent = lazyComponent(init)), + (workInProgress.flags |= 1), + reconcileChildren(current, workInProgress, lazyComponent, renderLanes), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (lazyComponent = readContext(CacheContext)), + null === current + ? ((init = peekCacheFromPool()), + null === init && + ((init = workInProgressRoot), + (nextProps = createCache()), + (init.pooledCache = nextProps), + nextProps.refCount++, + null !== nextProps && (init.pooledCacheLanes |= renderLanes), + (init = nextProps)), + (workInProgress.memoizedState = { + parent: lazyComponent, + cache: init + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, init)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (init = current.memoizedState), + (nextProps = workInProgress.memoizedState), + init.parent !== lazyComponent + ? ((init = { parent: lazyComponent, cache: lazyComponent }), + (workInProgress.memoizedState = init), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + init), + pushProvider(workInProgress, CacheContext, lazyComponent)) + : ((lazyComponent = nextProps.cache), + pushProvider(workInProgress, CacheContext, lazyComponent), + lazyComponent !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; } -} -function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error(formatProdErrorMessage(191, callback)); - callback.call(context); -} -function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); + throw Error(formatProdErrorMessage(156, workInProgress.tag)); } function commitHookEffectListMount(flags, finishedWork) { try { @@ -7869,178 +7723,7 @@ var offscreenSubtreeIsHidden = !1, offscreenSubtreeWasHidden = !1, needsFormReset = !1, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null, - shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - root = root.containerInfo; - eventsEnabled = _enabled; - root = getActiveElementDeep(root); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, - focusNode = selection.focusNode; - selection = selection.focusOffset; - try { - JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$20) { - JSCompiler_temp = null; - break a; - } - var length = 0, - start = -1, - end = -1, - indexWithinAnchor = 0, - indexWithinFocus = 0, - node = root, - parentNode = null; - b: for (;;) { - for (var next; ; ) { - node !== JSCompiler_temp || - (0 !== anchorOffset && 3 !== node.nodeType) || - (start = length + anchorOffset); - node !== focusNode || - (0 !== selection && 3 !== node.nodeType) || - (end = length + selection); - 3 === node.nodeType && (length += node.nodeValue.length); - if (null === (next = node.firstChild)) break; - parentNode = node; - node = next; - } - for (;;) { - if (node === root) break b; - parentNode === JSCompiler_temp && - ++indexWithinAnchor === anchorOffset && - (start = length); - parentNode === focusNode && - ++indexWithinFocus === selection && - (end = length); - if (null !== (next = node.nextSibling)) break; - node = parentNode; - parentNode = node.parentNode; - } - node = next; - } - JSCompiler_temp = - -1 === start || -1 === end ? null : { start: start, end: end }; - } else JSCompiler_temp = null; - } - JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 }; - } else JSCompiler_temp = null; - selectionInformation = { focusedElem: root, selectionRange: JSCompiler_temp }; - _enabled = !1; - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((firstChild = nextEffect), - (root = firstChild.child), - 0 !== (firstChild.subtreeFlags & 1028) && null !== root) - ) - (root.return = firstChild), (nextEffect = root); - else - for (; null !== nextEffect; ) { - firstChild = nextEffect; - focusNode = firstChild.alternate; - root = firstChild.flags; - switch (firstChild.tag) { - case 0: - if ( - 0 !== (root & 4) && - ((root = firstChild.updateQueue), - (root = null !== root ? root.events : null), - null !== root) - ) - for ( - JSCompiler_temp = 0; - JSCompiler_temp < root.length; - JSCompiler_temp++ - ) - (anchorOffset = root[JSCompiler_temp]), - (anchorOffset.ref.impl = anchorOffset.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (root & 1024) && null !== focusNode) { - root = void 0; - JSCompiler_temp = firstChild; - anchorOffset = focusNode.memoizedProps; - focusNode = focusNode.memoizedState; - selection = JSCompiler_temp.stateNode; - try { - var resolvedPrevProps = resolveClassComponentProps( - JSCompiler_temp.type, - anchorOffset, - JSCompiler_temp.elementType === JSCompiler_temp.type - ); - root = selection.getSnapshotBeforeUpdate( - resolvedPrevProps, - focusNode - ); - selection.__reactInternalSnapshotBeforeUpdate = root; - } catch (error) { - captureCommitPhaseError( - JSCompiler_temp, - JSCompiler_temp.return, - error - ); - } - } - break; - case 3: - if (0 !== (root & 1024)) - if ( - ((root = firstChild.stateNode.containerInfo), - (JSCompiler_temp = root.nodeType), - 9 === JSCompiler_temp) - ) - clearContainerSparingly(root); - else if (1 === JSCompiler_temp) - switch (root.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(root); - break; - default: - root.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163)); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return resolvedPrevProps; -} + nextEffect = null; function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { @@ -10412,7 +10095,6 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -10760,7 +10442,7 @@ function resetWorkInProgressStack() { var interruptedWork = workInProgress.return; else (interruptedWork = workInProgress), - (lastContextDependency = currentlyRenderingFiber = null), + (lastContextDependency = currentlyRenderingFiber$1 = null), resetHooksOnUnwind(interruptedWork), (thenableState = null), (thenableIndexCounter = 0), @@ -10817,7 +10499,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; thrownValue === SuspenseException || thrownValue === SuspenseActionException ? ((thrownValue = getSuspendedThenable()), @@ -10924,7 +10606,7 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -11039,7 +10721,7 @@ function renderRootConcurrent(root, lanes) { handleThrow(root, thrownValue$168); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -11100,7 +10782,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -11207,136 +10889,413 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { workInProgress = null; } function commitRoot( - root, + root$jscomp$0, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = ReactDOMSharedInternals.p; + didIncludeRenderPhaseUpdate = ReactSharedInternals.T; + var previousUpdateLanePriority = ReactDOMSharedInternals.p; try { - (ReactDOMSharedInternals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); + ReactDOMSharedInternals.p = 2; + ReactSharedInternals.T = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); + var finishedWork = root$jscomp$0.finishedWork, + lanes = root$jscomp$0.finishedLanes; + if (null !== finishedWork) { + root$jscomp$0.finishedWork = null; + root$jscomp$0.finishedLanes = 0; + if (finishedWork === root$jscomp$0.current) + throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes, + remainingLanes$jscomp$0 = (remainingLanes |= concurrentlyUpdatedLanes), + previouslyPendingLanes = root$jscomp$0.pendingLanes; + root$jscomp$0.pendingLanes = remainingLanes$jscomp$0; + root$jscomp$0.suspendedLanes = 0; + root$jscomp$0.pingedLanes = 0; + root$jscomp$0.warmLanes = 0; + root$jscomp$0.expiredLanes &= remainingLanes$jscomp$0; + root$jscomp$0.entangledLanes &= remainingLanes$jscomp$0; + root$jscomp$0.errorRecoveryDisabledLanes &= remainingLanes$jscomp$0; + root$jscomp$0.shellSuspendCounter = 0; + var entanglements = root$jscomp$0.entanglements, + expirationTimes = root$jscomp$0.expirationTimes, + hiddenUpdates = root$jscomp$0.hiddenUpdates; + for ( + remainingLanes$jscomp$0 = + previouslyPendingLanes & ~remainingLanes$jscomp$0; + 0 < remainingLanes$jscomp$0; + + ) { + var index$7 = 31 - clz32(remainingLanes$jscomp$0), + lane = 1 << index$7; + entanglements[index$7] = 0; + expirationTimes[index$7] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$7]; + if (null !== hiddenUpdatesForLane) { + hiddenUpdates[index$7] = null; + for (var i = 0; i < hiddenUpdatesForLane.length; i++) { + var update = hiddenUpdatesForLane[i]; + null !== update && (update.lane &= -536870913); + } + } + remainingLanes$jscomp$0 &= ~lane; + } + 0 !== spawnedLane && + markSpawnedDeferredLane(root$jscomp$0, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root$jscomp$0.tag && + (root$jscomp$0.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~lanes)); + root$jscomp$0 === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions)) + : ((root$jscomp$0.callbackNode = null), + (root$jscomp$0.callbackPriority = 0), + (root$jscomp$0.cancelPendingCommit = null)); + var rootHasEffect = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || rootHasEffect) { + var prevTransition = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = 2; + transitions = executionContext; + executionContext |= 4; + var containerInfo = root$jscomp$0.containerInfo; + eventsEnabled = _enabled; + var focusedElem = getActiveElementDeep(containerInfo); + if (hasSelectionCapabilities(focusedElem)) { + if ("selectionStart" in focusedElem) + var selection = { + start: focusedElem.selectionStart, + end: focusedElem.selectionEnd + }; + else + b: { + var ownerDocument = focusedElem.ownerDocument, + win = (ownerDocument && ownerDocument.defaultView) || window, + selection$jscomp$0 = win.getSelection && win.getSelection(); + if (selection$jscomp$0 && 0 !== selection$jscomp$0.rangeCount) { + var anchorNode = selection$jscomp$0.anchorNode, + anchorOffset = selection$jscomp$0.anchorOffset, + focusNode = selection$jscomp$0.focusNode, + focusOffset = selection$jscomp$0.focusOffset; + try { + anchorNode.nodeType, focusNode.nodeType; + } catch (e$20) { + selection = null; + break b; + } + containerInfo = 0; + win = ownerDocument = -1; + rootHasEffect = selection$jscomp$0 = 0; + updatedLanes = focusedElem; + suspendedRetryLanes = null; + c: for (;;) { + for (var next; ; ) { + updatedLanes !== anchorNode || + (0 !== anchorOffset && 3 !== updatedLanes.nodeType) || + (ownerDocument = containerInfo + anchorOffset); + updatedLanes !== focusNode || + (0 !== focusOffset && 3 !== updatedLanes.nodeType) || + (win = containerInfo + focusOffset); + 3 === updatedLanes.nodeType && + (containerInfo += updatedLanes.nodeValue.length); + if (null === (next = updatedLanes.firstChild)) break; + suspendedRetryLanes = updatedLanes; + updatedLanes = next; + } + for (;;) { + if (updatedLanes === focusedElem) break c; + suspendedRetryLanes === anchorNode && + ++selection$jscomp$0 === anchorOffset && + (ownerDocument = containerInfo); + suspendedRetryLanes === focusNode && + ++rootHasEffect === focusOffset && + (win = containerInfo); + if (null !== (next = updatedLanes.nextSibling)) break; + updatedLanes = suspendedRetryLanes; + suspendedRetryLanes = updatedLanes.parentNode; + } + updatedLanes = next; + } + selection = + -1 === ownerDocument || -1 === win + ? null + : { start: ownerDocument, end: win }; + } else selection = null; + } + var JSCompiler_temp = selection || { start: 0, end: 0 }; + } else JSCompiler_temp = null; + selectionInformation = { + focusedElem: focusedElem, + selectionRange: JSCompiler_temp + }; + _enabled = !1; + for (nextEffect = finishedWork; null !== nextEffect; ) { + focusedElem = nextEffect; + var child = focusedElem.child; + if (0 !== (focusedElem.subtreeFlags & 1028) && null !== child) + (child.return = focusedElem), (nextEffect = child); + else + b: for (; null !== nextEffect; ) { + focusedElem = nextEffect; + JSCompiler_temp = void 0; + selection = focusedElem; + var current = selection.alternate, + flags = selection.flags; + switch (selection.tag) { + case 0: + if (0 !== (flags & 4)) { + var updateQueue = selection.updateQueue, + eventPayloads = + null !== updateQueue ? updateQueue.events : null; + if (null !== eventPayloads) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < eventPayloads.length; + JSCompiler_temp++ + ) { + var _eventPayloads$ii = eventPayloads[JSCompiler_temp]; + _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; + } + } + break; + case 11: + case 15: + break; + case 1: + if (0 !== (flags & 1024) && null !== current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState, + instance = selection.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + selection.type, + prevProps, + selection.elementType === selection.type + ); + JSCompiler_temp = instance.getSnapshotBeforeUpdate( + resolvedPrevProps, + prevState + ); + instance.__reactInternalSnapshotBeforeUpdate = + JSCompiler_temp; + } catch (error) { + captureCommitPhaseError( + selection, + selection.return, + error + ); + } + } + break; + case 3: + if (0 !== (flags & 1024)) + c: { + var container = selection.stateNode.containerInfo, + nodeType = container.nodeType; + if (9 === nodeType) clearContainerSparingly(container); + else if (1 === nodeType) + switch (container.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(container); + break c; + default: + container.textContent = ""; + } + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (flags & 1024)) + throw Error(formatProdErrorMessage(163)); + } + var sibling = focusedElem.sibling; + if (null !== sibling) { + sibling.return = focusedElem.return; + nextEffect = sibling; + break b; + } + nextEffect = focusedElem.return; + } + } + commitMutationEffectsOnFiber(finishedWork, root$jscomp$0); + child = selectionInformation; + var curFocusedElem = getActiveElementDeep(root$jscomp$0.containerInfo), + priorFocusedElem = child.focusedElem, + priorSelectionRange = child.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start = priorSelectionRange.start, + end = priorSelectionRange.end; + void 0 === end && (end = start); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start), + (priorFocusedElem.selectionEnd = Math.min( + end, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win$jscomp$0 = (doc && doc.defaultView) || window; + if (win$jscomp$0.getSelection) { + var selection$jscomp$1 = win$jscomp$0.getSelection(), + length = priorFocusedElem.textContent.length, + start$jscomp$0 = Math.min(priorSelectionRange.start, length), + end$jscomp$0 = + void 0 === priorSelectionRange.end + ? start$jscomp$0 + : Math.min(priorSelectionRange.end, length); + !selection$jscomp$1.extend && + start$jscomp$0 > end$jscomp$0 && + ((curFocusedElem = end$jscomp$0), + (end$jscomp$0 = start$jscomp$0), + (start$jscomp$0 = curFocusedElem)); + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$0 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$0 + ); + if ( + startMarker && + endMarker && + (1 !== selection$jscomp$1.rangeCount || + selection$jscomp$1.anchorNode !== startMarker.node || + selection$jscomp$1.anchorOffset !== startMarker.offset || + selection$jscomp$1.focusNode !== endMarker.node || + selection$jscomp$1.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection$jscomp$1.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection$jscomp$1.addRange(range), + selection$jscomp$1.extend( + endMarker.node, + endMarker.offset + )) + : (range.setEnd(endMarker.node, endMarker.offset), + selection$jscomp$1.addRange(range)); + } + } + } + } + doc = []; + for ( + selection$jscomp$1 = priorFocusedElem; + (selection$jscomp$1 = selection$jscomp$1.parentNode); + + ) + 1 === selection$jscomp$1.nodeType && + doc.push({ + element: selection$jscomp$1, + left: selection$jscomp$1.scrollLeft, + top: selection$jscomp$1.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + priorFocusedElem = 0; + priorFocusedElem < doc.length; + priorFocusedElem++ + ) { + var info = doc[priorFocusedElem]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + root$jscomp$0.current = finishedWork; + commitLayoutEffectOnFiber( + root$jscomp$0, + finishedWork.alternate, + finishedWork + ); + requestPaint(); + executionContext = transitions; + ReactDOMSharedInternals.p = previousPriority; + ReactSharedInternals.T = prevTransition; + } else root$jscomp$0.current = finishedWork; + spawnedLane + ? ((rootWithPendingPassiveEffects = root$jscomp$0), + (pendingPassiveEffectsLanes = lanes)) + : releaseRootPooledCache(root$jscomp$0, remainingLanes); + remainingLanes = root$jscomp$0.pendingLanes; + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + var root = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + injectedHook.onCommitFiberRoot( + rendererID, + root, + void 0, + 128 === (root.current.flags & 128) + ); + } catch (err) {} + if (null !== recoverableErrors) { + var onRecoverableError = root$jscomp$0.onRecoverableError; + for ( + finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) { + var recoverableError = recoverableErrors[finishedWork]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } + 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); + ensureRootIsScheduled(root$jscomp$0); + remainingLanes = root$jscomp$0.pendingLanes; + 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + ? root$jscomp$0 === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root$jscomp$0)) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + } } finally { - (ReactSharedInternals.T = prevTransition), + (ReactSharedInternals.T = didIncludeRenderPhaseUpdate), (ReactDOMSharedInternals.p = previousUpdateLanePriority); } } -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes -) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork; - didIncludeRenderPhaseUpdate = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - didIncludeRenderPhaseUpdate, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - (0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), - (ReactDOMSharedInternals.p = 2), - (updatedLanes = executionContext), - (executionContext |= 4), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffectsOnFiber(finishedWork, root), - restoreSelection(selectionInformation, root.containerInfo), - (_enabled = !!eventsEnabled), - (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), - requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - rootDoesHavePassiveEffects - ? ((rootDoesHavePassiveEffects = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - ensureRootIsScheduled(root); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack - }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - remainingLanes = root.pendingLanes; - 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) - ? root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - return null; -} function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && ((remainingLanes = root.pooledCache), @@ -11363,6 +11322,9 @@ function flushPassiveEffects() { lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; + root.callbackNode = null; + root.callbackPriority = 0; + root.cancelPendingCommit = null; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); var prevExecutionContext = executionContext; @@ -11371,6 +11333,7 @@ function flushPassiveEffects() { commitPassiveMountOnFiber(root, root.current, lanes, renderPriority); executionContext = prevExecutionContext; flushSyncWorkAcrossRoots_impl(0, !1); + ensureRootIsScheduled(root); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot @@ -11502,9 +11465,6 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } -function scheduleCallback$1(priorityLevel, callback) { - return scheduleCallback$3(priorityLevel, callback); -} var firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = !1, @@ -11609,12 +11569,13 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } + suspendedLanes = pendingPassiveEffectsLanes; currentTime = workInProgressRoot; - suspendedLanes = workInProgressRootRenderLanes; - suspendedLanes = getNextLanes( - root, - root === currentTime ? suspendedLanes : 0 - ); + pingedLanes = workInProgressRootRenderLanes; + suspendedLanes = + root === rootWithPendingPassiveEffects + ? suspendedLanes + : getNextLanes(root, root === currentTime ? pingedLanes : 0); pingedLanes = root.callbackNode; if ( 0 === suspendedLanes || @@ -11631,36 +11592,39 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { (root.callbackPriority = 0) ); if ( - 0 === (suspendedLanes & 3) || - checkIfRootIsPrerendering(root, suspendedLanes) - ) { - currentTime = suspendedLanes & -suspendedLanes; - if (currentTime === root.callbackPriority) return currentTime; - null !== pingedLanes && cancelCallback$1(pingedLanes); - switch (lanesToEventPriority(suspendedLanes)) { - case 2: - case 8: - suspendedLanes = UserBlockingPriority; - break; - case 32: - suspendedLanes = NormalPriority$1; - break; - case 268435456: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; - } - pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); - suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; + 0 !== (suspendedLanes & 3) && + !checkIfRootIsPrerendering(root, suspendedLanes) + ) + return ( + null !== pingedLanes && + null !== pingedLanes && + cancelCallback$1(pingedLanes), + (root.callbackPriority = 2), + (root.callbackNode = null), + 2 + ); + currentTime = suspendedLanes & -suspendedLanes; + if (currentTime === root.callbackPriority) return currentTime; + null !== pingedLanes && cancelCallback$1(pingedLanes); + switch (lanesToEventPriority(suspendedLanes)) { + case 2: + case 8: + suspendedLanes = UserBlockingPriority; + break; + case 32: + suspendedLanes = NormalPriority$1; + break; + case 268435456: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; } - null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes); - root.callbackPriority = 2; - root.callbackNode = null; - return 2; + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + suspendedLanes = scheduleCallback$2(suspendedLanes, pingedLanes); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; } function performWorkOnRootViaSchedulerTask(root, didTimeout) { var originalCallbackNode = root.callbackNode; @@ -11685,7 +11649,7 @@ function performSyncWorkOnRoot(root, lanes) { function scheduleImmediateTask(cb) { scheduleMicrotask(function () { 0 !== (executionContext & 6) - ? scheduleCallback$3(ImmediatePriority, cb) + ? scheduleCallback$2(ImmediatePriority, cb) : cb(); }); } @@ -11789,20 +11753,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1429 = 0; - i$jscomp$inline_1429 < simpleEventPluginEvents.length; - i$jscomp$inline_1429++ + var i$jscomp$inline_1445 = 0; + i$jscomp$inline_1445 < simpleEventPluginEvents.length; + i$jscomp$inline_1445++ ) { - var eventName$jscomp$inline_1430 = - simpleEventPluginEvents[i$jscomp$inline_1429], - domEventName$jscomp$inline_1431 = - eventName$jscomp$inline_1430.toLowerCase(), - capitalizedEvent$jscomp$inline_1432 = - eventName$jscomp$inline_1430[0].toUpperCase() + - eventName$jscomp$inline_1430.slice(1); + var eventName$jscomp$inline_1446 = + simpleEventPluginEvents[i$jscomp$inline_1445], + domEventName$jscomp$inline_1447 = + eventName$jscomp$inline_1446.toLowerCase(), + capitalizedEvent$jscomp$inline_1448 = + eventName$jscomp$inline_1446[0].toUpperCase() + + eventName$jscomp$inline_1446.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1431, - "on" + capitalizedEvent$jscomp$inline_1432 + domEventName$jscomp$inline_1447, + "on" + capitalizedEvent$jscomp$inline_1448 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15059,8 +15023,9 @@ function attemptExplicitHydrationTarget(queuedTarget) { queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(), - root = enqueueConcurrentRenderForLane(nearestMounted, lane); + var lane = requestUpdateLane(); + lane = getBumpedLaneForHydrationByLane(lane); + var root = enqueueConcurrentRenderForLane(nearestMounted, lane); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); markRetryLaneIfNotHydrated(nearestMounted, lane); @@ -15262,16 +15227,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1676 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1709 = React.version; if ( - "19.0.0-experimental-7283a213-20241206" !== - isomorphicReactPackageVersion$jscomp$inline_1676 + "19.1.0-experimental-7eb8234f-20241218" !== + isomorphicReactPackageVersion$jscomp$inline_1709 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1676, - "19.0.0-experimental-7283a213-20241206" + isomorphicReactPackageVersion$jscomp$inline_1709, + "19.1.0-experimental-7eb8234f-20241218" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15291,25 +15256,24 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2146 = { +var internals$jscomp$inline_2204 = { bundleType: 0, - version: "19.0.0-experimental-7283a213-20241206", + version: "19.1.0-experimental-7eb8234f-20241218", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7283a213-20241206" + reconcilerVersion: "19.1.0-experimental-7eb8234f-20241218" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2147 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2205 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2147.isDisabled && - hook$jscomp$inline_2147.supportsFiber + !hook$jscomp$inline_2205.isDisabled && + hook$jscomp$inline_2205.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2147.inject( - internals$jscomp$inline_2146 + (rendererID = hook$jscomp$inline_2205.inject( + internals$jscomp$inline_2204 )), - (injectedHook = hook$jscomp$inline_2147); + (injectedHook = hook$jscomp$inline_2205); } catch (err) {} } exports.createRoot = function (container, options) { @@ -15391,14 +15355,16 @@ exports.hydrateRoot = function (container, initialChildren, options) { initialChildren.context = getContextForSubtree(null); options = initialChildren.current; isStrictMode = requestUpdateLane(); + isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode); identifierPrefix = createUpdate(isStrictMode); identifierPrefix.callback = null; enqueueUpdate(options, identifierPrefix, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated$1(initialChildren, isStrictMode); + options = isStrictMode; + initialChildren.current.lanes = options; + markRootUpdated$1(initialChildren, options); ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.0.0-experimental-7283a213-20241206"; +exports.version = "19.1.0-experimental-7eb8234f-20241218"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js index 894a13db08621..6a8ea0fe59c32 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js @@ -510,13 +510,11 @@ return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -927,41 +925,6 @@ } return hook.checkDCE ? !0 : !1; } - function onCommitRoot$1(root, eventPriority) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - var didError = 128 === (root.current.flags & 128); - switch (eventPriority) { - case DiscreteEventPriority: - var schedulerPriority = ImmediatePriority; - break; - case ContinuousEventPriority: - schedulerPriority = UserBlockingPriority; - break; - case DefaultEventPriority: - schedulerPriority = NormalPriority$1; - break; - case IdleEventPriority: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority$1; - } - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), - console.error( - "React instrumentation encountered an error: %s", - err - )); - } - } function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); @@ -1157,54 +1120,6 @@ (root.pingedLanes = 0), (root.warmLanes = 0)); } - function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ) { - var previouslyPendingLanes = root.pendingLanes; - root.pendingLanes = remainingLanes; - root.suspendedLanes = 0; - root.pingedLanes = 0; - root.warmLanes = 0; - root.expiredLanes &= remainingLanes; - root.entangledLanes &= remainingLanes; - root.errorRecoveryDisabledLanes &= remainingLanes; - root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - for ( - remainingLanes = previouslyPendingLanes & ~remainingLanes; - 0 < remainingLanes; - - ) { - var index = 31 - clz32(remainingLanes), - lane = 1 << index; - entanglements[index] = 0; - expirationTimes[index] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index]; - if (null !== hiddenUpdatesForLane) - for ( - hiddenUpdates[index] = null, index = 0; - index < hiddenUpdatesForLane.length; - index++ - ) { - var update = hiddenUpdatesForLane[index]; - null !== update && (update.lane &= -536870913); - } - remainingLanes &= ~lane; - } - 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); - } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; root.suspendedLanes &= ~spawnedLane; @@ -1225,6 +1140,46 @@ rootEntangledLanes &= ~lane; } } + function getBumpedLaneForHydrationByLane(lane) { + switch (lane) { + case 2: + lane = 1; + break; + case 8: + lane = 4; + break; + case 32: + lane = 16; + break; + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + lane = 64; + break; + case 268435456: + lane = 134217728; + break; + default: + lane = 0; + } + return lane; + } function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { @@ -3621,100 +3576,6 @@ "true" === elem.contentEditable) ); } - function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if ( - null !== priorSelectionRange && - hasSelectionCapabilities(containerInfo) - ) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - curFocusedElem = curFocusedElem.getSelection(); - var length = containerInfo.textContent.length, - start = Math.min(priorSelectionRange.start, length); - priorSelectionRange = - void 0 === priorSelectionRange.end - ? start - : Math.min(priorSelectionRange.end, length); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (1 !== curFocusedElem.rangeCount || - curFocusedElem.anchorNode !== length.node || - curFocusedElem.anchorOffset !== length.offset || - curFocusedElem.focusNode !== endMarker.node || - curFocusedElem.focusOffset !== endMarker.offset) && - ((priorSelectionInformation = - priorSelectionInformation.createRange()), - priorSelectionInformation.setStart(length.node, length.offset), - curFocusedElem.removeAllRanges(), - start > priorSelectionRange - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } - } function constructSelectEvent( dispatchQueue, nativeEvent, @@ -3789,6 +3650,26 @@ ? "Idle" : "Other"; } + function logComponentRender(fiber, startTime, endTime) { + var name = getComponentNameFromFiber(fiber); + if (null !== name && supportsUserTiming) { + var selfTime = fiber.actualDuration; + if (null === fiber.alternate || fiber.alternate.child !== fiber.child) + for (fiber = fiber.child; null !== fiber; fiber = fiber.sibling) + selfTime -= fiber.actualDuration; + reusableComponentDevToolDetails.color = + 0.5 > selfTime + ? "primary-light" + : 10 > selfTime + ? "primary" + : 100 > selfTime + ? "primary-dark" + : "error"; + reusableComponentOptions.start = startTime; + reusableComponentOptions.end = endTime; + performance.measure(name, reusableComponentOptions); + } + } function logComponentEffect(fiber, startTime, endTime, selfTime) { fiber = getComponentNameFromFiber(fiber); null !== fiber && @@ -3805,23 +3686,18 @@ (reusableComponentOptions.end = endTime), performance.measure(fiber, reusableComponentOptions)); } - function logRenderPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Render", reusableLaneOptions)); - } - function logSuspendedRenderPhase(startTime, endTime) { + function logSuspendedRenderPhase(startTime, endTime, lanes) { supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Prewarm", reusableLaneOptions)); } - function logSuspendedWithDelayPhase(startTime, endTime) { + function logSuspendedWithDelayPhase(startTime, endTime, lanes) { supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Suspended", reusableLaneOptions)); @@ -3833,27 +3709,6 @@ (reusableLaneOptions.end = endTime), performance.measure("Errored Render", reusableLaneOptions)); } - function logSuspenseThrottlePhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-light"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Throttled", reusableLaneOptions)); - } - function logSuspendedCommitPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-light"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Suspended", reusableLaneOptions)); - } - function logCommitPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-dark"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Commit", reusableLaneOptions)); - } function finishQueueingConcurrentUpdates() { for ( var endIndex = concurrentQueuesIndex, @@ -4169,441 +4024,214 @@ for (var child = fiber.child; child; ) (fiber.actualDuration += child.actualDuration), (child = child.sibling); } - function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; - } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - } - function pushTreeFork(workInProgress, totalChildren) { - warnIfNotHydrating(); - forkStack[forkStackIndex++] = treeForkCount; - forkStack[forkStackIndex++] = treeForkProvider; - treeForkProvider = workInProgress; - treeForkCount = totalChildren; - } - function pushTreeId(workInProgress, totalChildren, index) { - warnIfNotHydrating(); - idStack[idStackIndex++] = treeContextId; - idStack[idStackIndex++] = treeContextOverflow; - idStack[idStackIndex++] = treeContextProvider; - treeContextProvider = workInProgress; - var baseIdWithLeadingBit = treeContextId; - workInProgress = treeContextOverflow; - var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; - baseIdWithLeadingBit &= ~(1 << baseLength); - index += 1; - var length = 32 - clz32(totalChildren) + baseLength; - if (30 < length) { - var numberOfOverflowBits = baseLength - (baseLength % 5); - length = ( - baseIdWithLeadingBit & - ((1 << numberOfOverflowBits) - 1) - ).toString(32); - baseIdWithLeadingBit >>= numberOfOverflowBits; - baseLength -= numberOfOverflowBits; - treeContextId = - (1 << (32 - clz32(totalChildren) + baseLength)) | - (index << baseLength) | - baseIdWithLeadingBit; - treeContextOverflow = length + workInProgress; - } else - (treeContextId = - (1 << length) | (index << baseLength) | baseIdWithLeadingBit), - (treeContextOverflow = workInProgress); - } - function pushMaterializedTreeId(workInProgress) { - warnIfNotHydrating(); - null !== workInProgress.return && - (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); - } - function popTreeContext(workInProgress) { - for (; workInProgress === treeForkProvider; ) - (treeForkProvider = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null), - (treeForkCount = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null); - for (; workInProgress === treeContextProvider; ) - (treeContextProvider = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextOverflow = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextId = idStack[--idStackIndex]), - (idStack[idStackIndex] = null); + function resetContextDependencies() { + lastContextDependency = currentlyRenderingFiber$1 = null; + isDisallowedContextReadInDEV = !1; } - function warnIfNotHydrating() { - isHydrating || + function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue, providerFiber); + context._currentValue = nextValue; + push(rendererCursorDEV, context._currentRenderer, providerFiber); + void 0 !== context._currentRenderer && + null !== context._currentRenderer && + context._currentRenderer !== rendererSigil && console.error( - "Expected to be hydrating. This is a bug in React. Please file an issue." + "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." ); + context._currentRenderer = rendererSigil; } - function buildHydrationDiffNode(fiber, distanceFromLeaf) { - if (null === fiber.return) { - if (null === hydrationDiffRootDEV) - hydrationDiffRootDEV = { - fiber: fiber, - children: [], - serverProps: void 0, - serverTail: [], - distanceFromLeaf: distanceFromLeaf - }; - else { - if (hydrationDiffRootDEV.fiber !== fiber) - throw Error( - "Saw multiple hydration diff roots in a pass. This is a bug in React." - ); - hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf && - (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf); - } - return hydrationDiffRootDEV; + function popProvider(context, providerFiber) { + context._currentValue = valueCursor.current; + var currentRenderer = rendererCursorDEV.current; + pop(rendererCursorDEV, providerFiber); + context._currentRenderer = currentRenderer; + pop(valueCursor, providerFiber); + } + function scheduleContextWorkOnParentPath( + parent, + renderLanes, + propagationRoot + ) { + for (; null !== parent; ) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes + ? ((parent.childLanes |= renderLanes), + null !== alternate && (alternate.childLanes |= renderLanes)) + : null !== alternate && + (alternate.childLanes & renderLanes) !== renderLanes && + (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; } - var siblings = buildHydrationDiffNode( - fiber.return, - distanceFromLeaf + 1 - ).children; - if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber) - return ( - (siblings = siblings[siblings.length - 1]), - siblings.distanceFromLeaf > distanceFromLeaf && - (siblings.distanceFromLeaf = distanceFromLeaf), - siblings + parent !== propagationRoot && + console.error( + "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." ); - distanceFromLeaf = { - fiber: fiber, - children: [], - serverProps: void 0, - serverTail: [], - distanceFromLeaf: distanceFromLeaf - }; - siblings.push(distanceFromLeaf); - return distanceFromLeaf; } - function warnNonHydratedInstance(fiber, rejectedCandidate) { - didSuspendOrErrorDEV || - ((fiber = buildHydrationDiffNode(fiber, 0)), - (fiber.serverProps = null), - null !== rejectedCandidate && - ((rejectedCandidate = - describeHydratableInstanceForDevWarnings(rejectedCandidate)), - fiber.serverTail.push(rejectedCandidate))); - } - function throwOnHydrationMismatch(fiber) { - var diff = "", - diffRoot = hydrationDiffRootDEV; - null !== diffRoot && - ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot))); - queueHydrationError( - createCapturedValueAtFiber( - Error( - "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" + - diff - ), - fiber - ) - ); - throw HydrationMismatchException; - } - function prepareToHydrateHostInstance(fiber) { - var didHydrate = fiber.stateNode; - var type = fiber.type, - props = fiber.memoizedProps; - didHydrate[internalInstanceKey] = fiber; - didHydrate[internalPropsKey] = props; - validatePropertiesInDevelopment(type, props); - switch (type) { - case "dialog": - listenToNonDelegatedEvent("cancel", didHydrate); - listenToNonDelegatedEvent("close", didHydrate); - break; - case "iframe": - case "object": - case "embed": - listenToNonDelegatedEvent("load", didHydrate); - break; - case "video": - case "audio": - for (type = 0; type < mediaEventTypes.length; type++) - listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate); - break; - case "source": - listenToNonDelegatedEvent("error", didHydrate); - break; - case "img": - case "image": - case "link": - listenToNonDelegatedEvent("error", didHydrate); - listenToNonDelegatedEvent("load", didHydrate); - break; - case "details": - listenToNonDelegatedEvent("toggle", didHydrate); - break; - case "input": - checkControlledValueProps("input", props); - listenToNonDelegatedEvent("invalid", didHydrate); - validateInputProps(didHydrate, props); - initInput( - didHydrate, - props.value, - props.defaultValue, - props.checked, - props.defaultChecked, - props.type, - props.name, - !0 + function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree + ) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + for (var i = 0; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; + } + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) + throw Error( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + nextFiber, + renderLanes, + workInProgress ); - track(didHydrate); - break; - case "option": - validateOptionProps(didHydrate, props); - break; - case "select": - checkControlledValueProps("select", props); - listenToNonDelegatedEvent("invalid", didHydrate); - validateSelectProps(didHydrate, props); - break; - case "textarea": - checkControlledValueProps("textarea", props), - listenToNonDelegatedEvent("invalid", didHydrate), - validateTextareaProps(didHydrate, props), - initTextarea( - didHydrate, - props.value, - props.defaultValue, - props.children - ), - track(didHydrate); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; + } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } - type = props.children; - ("string" !== typeof type && - "number" !== typeof type && - "bigint" !== typeof type) || - didHydrate.textContent === "" + type || - !0 === props.suppressHydrationWarning || - checkForUnmatchedText(didHydrate.textContent, type) - ? (null != props.popover && - (listenToNonDelegatedEvent("beforetoggle", didHydrate), - listenToNonDelegatedEvent("toggle", didHydrate)), - null != props.onScroll && - listenToNonDelegatedEvent("scroll", didHydrate), - null != props.onScrollEnd && - listenToNonDelegatedEvent("scrollend", didHydrate), - null != props.onClick && (didHydrate.onclick = noop$2), - (didHydrate = !0)) - : (didHydrate = !1); - didHydrate || throwOnHydrationMismatch(fiber); - } - function popToNextHostParent(fiber) { - for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) - switch (hydrationParentFiber.tag) { - case 3: - case 27: - rootOrSingletonContext = !0; - return; - case 5: - case 13: - rootOrSingletonContext = !1; - return; - default: - hydrationParentFiber = hydrationParentFiber.return; - } } - function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) return !1; - if (!isHydrating) - return popToNextHostParent(fiber), (isHydrating = !0), !1; - var shouldClear = !1, - JSCompiler_temp; - if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { - if ((JSCompiler_temp = 5 === fiber.tag)) - (JSCompiler_temp = fiber.type), - (JSCompiler_temp = - !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || - shouldSetTextContent(fiber.type, fiber.memoizedProps)); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && (shouldClear = !0); - if (shouldClear && nextHydratableInstance) { - for (shouldClear = nextHydratableInstance; shouldClear; ) { - JSCompiler_temp = buildHydrationDiffNode(fiber, 0); - var description = - describeHydratableInstanceForDevWarnings(shouldClear); - JSCompiler_temp.serverTail.push(description); - shouldClear = - "Suspense" === description.type - ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear) - : getNextHydratable(shouldClear.nextSibling); + function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree + ) { + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; + + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current + ? current.push(context) + : (current = [context])); + } + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - throwOnHydrationMismatch(fiber); + parent = parent.return; } - popToNextHostParent(fiber); - if (13 === fiber.tag) { - fiber = fiber.memoizedState; - fiber = null !== fiber ? fiber.dehydrated : null; - if (!fiber) - throw Error( - "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." - ); - nextHydratableInstance = - getNextHydratableInstanceAfterSuspenseInstance(fiber); - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; - } - function resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - didSuspendOrErrorDEV = isHydrating = !1; - } - function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); - } - function emitPendingHydrationWarnings() { - var diffRoot = hydrationDiffRootDEV; - null !== diffRoot && - ((hydrationDiffRootDEV = null), - (diffRoot = describeDiff(diffRoot)), - console.error( - "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s", - "https://react.dev/link/hydration-mismatch", - diffRoot - )); - } - function createThenableState() { - return { didWarnAboutUncachedPromise: !1, thenables: [] }; - } - function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } - function noop$4() {} - function trackUsedThenable(thenableState, thenable, index) { - null !== ReactSharedInternals.actQueue && - (ReactSharedInternals.didUsePromise = !0); - var trackedThenables = thenableState.thenables; - index = trackedThenables[index]; - void 0 === index - ? trackedThenables.push(thenable) - : index !== thenable && - (thenableState.didWarnAboutUncachedPromise || - ((thenableState.didWarnAboutUncachedPromise = !0), - console.error( - "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." - )), - thenable.then(noop$4, noop$4), - (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) - thenable.then(noop$4, noop$4); - else { - thenableState = workInProgressRoot; - if ( - null !== thenableState && - 100 < thenableState.shellSuspendCounter - ) - throw Error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - needsToResetSuspendedThenableDEV = !0; - throw SuspenseException; + function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; } + return !1; } - function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - needsToResetSuspendedThenableDEV = !1; - return thenable; + function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } - function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + function readContext(context) { + isDisallowedContextReadInDEV && + console.error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); + return readContextForConsumer(currentlyRenderingFiber$1, context); } - function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; - } - function retainCache(cache) { - cache.controller.signal.aborted && - console.warn( - "A cache instance was retained after it was already freed. This likely indicates a bug in React." - ); - cache.refCount++; + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } - function releaseCache(cache) { - cache.refCount--; - 0 > cache.refCount && - console.warn( - "A cache instance was released after it was already freed. This likely indicates a bug in React." - ); - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); + function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + throw Error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + lastContextDependency = context; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } function entangleAsyncAction(transition, thenable) { if (null === currentEntangledListeners) { @@ -4662,6378 +4290,6540 @@ ); return thenableWithOverride; } - function pushHiddenContext(fiber, context) { - var prevEntangledRenderLanes = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); - push(currentTreeHiddenStackCursor, context, fiber); - entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; - } - function reuseHiddenContextOnStack(fiber) { - push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); - push( - currentTreeHiddenStackCursor, - currentTreeHiddenStackCursor.current, - fiber - ); - } - function popHiddenContext(fiber) { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor, fiber); - pop(prevEntangledRenderLanesCursor, fiber); - } - function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; + function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; } - function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) - : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); + function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); } - function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; + function createUpdate(lane) { + return { + lane: lane, + tag: UpdateState, + payload: null, + callback: null, + next: null + }; } - function mountHookTypesDev() { - var hookName = currentHookNameInDev; - null === hookTypesDev - ? (hookTypesDev = [hookName]) - : hookTypesDev.push(hookName); - } - function updateHookTypesDev() { - var hookName = currentHookNameInDev; + function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; if ( - null !== hookTypesDev && - (hookTypesUpdateIndexDev++, - hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + currentlyProcessingQueue === updateQueue && + !didWarnUpdateInsideUpdate ) { - var componentName = getComponentNameFromFiber( - currentlyRenderingFiber$1 + var componentName = getComponentNameFromFiber(fiber); + console.error( + "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s", + componentName ); - if ( - !didWarnAboutMismatchedHooksForComponent.has(componentName) && - (didWarnAboutMismatchedHooksForComponent.add(componentName), - null !== hookTypesDev) - ) { - for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { - var oldHookName = hookTypesDev[i], - newHookName = - i === hookTypesUpdateIndexDev ? hookName : oldHookName; - for ( - oldHookName = i + 1 + ". " + oldHookName; - 30 > oldHookName.length; - - ) - oldHookName += " "; - oldHookName += newHookName + "\n"; - table += oldHookName; - } - console.error( - "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - componentName, - table - ); - } + didWarnUpdateInsideUpdate = !0; } - } - function checkDepsAreArrayDev(deps) { - void 0 === deps || - null === deps || - isArrayImpl(deps) || - console.error( - "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", - currentHookNameInDev, - typeof deps + if ((executionContext & RenderContext) !== NoContext) + return ( + (componentName = updateQueue.pending), + null === componentName + ? (update.next = update) + : ((update.next = componentName.next), + (componentName.next = update)), + (updateQueue.pending = update), + (update = getRootForUpdatedFiber(fiber)), + markUpdateLaneFromFiberToRoot(fiber, null, lane), + update ); + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); } - function warnOnUseFormStateInDev() { - var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); - didWarnAboutUseFormState.has(componentName) || - (didWarnAboutUseFormState.add(componentName), - console.error( - "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", - componentName - )); + function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } } - function throwInvalidHookError() { - throw Error( - "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." - ); + function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( + null !== current && + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; + } + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; } - function areHookInputsEqual(nextDeps, prevDeps) { - if (ignorePreviousDependencies) return !1; - if (null === prevDeps) - return ( - console.error( - "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", - currentHookNameInDev - ), - !1 - ); - nextDeps.length !== prevDeps.length && - console.error( - "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", - currentHookNameInDev, - "[" + prevDeps.join(", ") + "]", - "[" + nextDeps.join(", ") + "]" - ); - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; + function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } } - function renderWithHooks( - current, + function processUpdateQueue( workInProgress, - Component, props, - secondArg, - nextRenderLanes + instance$jscomp$0, + renderLanes ) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; - hookTypesDev = null !== current ? current._debugHookTypes : null; - hookTypesUpdateIndexDev = -1; - ignorePreviousDependencies = - null !== current && current.type !== workInProgress.type; - if ( - "[object AsyncFunction]" === - Object.prototype.toString.call(Component) || - "[object AsyncGeneratorFunction]" === - Object.prototype.toString.call(Component) - ) - (nextRenderLanes = getComponentNameFromFiber( - currentlyRenderingFiber$1 - )), - didWarnAboutAsyncClientComponent.has(nextRenderLanes) || - (didWarnAboutAsyncClientComponent.add(nextRenderLanes), - console.error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - )); - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null !== current && null !== current.memoizedState - ? HooksDispatcherOnUpdateInDEV - : null !== hookTypesDev - ? HooksDispatcherOnMountWithHookTypesInDEV - : HooksDispatcherOnMountInDEV; - shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = - (workInProgress.mode & StrictLegacyMode) !== NoMode; - var children = callComponentInDEV(Component, props, secondArg); - shouldDoubleInvokeUserFnsInHooksDEV = !1; - didScheduleRenderPhaseUpdateDuringThisPass && - (children = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - )); - if (nextRenderLanes) { - setIsStrictModeForDevtools(!0); - try { - children = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - ); - } finally { - setIsStrictModeForDevtools(!1); - } + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress.updateQueue; + hasForceUpdate = !1; + currentlyProcessingQueue = queue.shared; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress.alternate; + null !== current && + ((current = current.updateQueue), + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); } - finishRenderingHooks(current, workInProgress); - return children; - } - function finishRenderingHooks(current, workInProgress) { - workInProgress._debugHookTypes = hookTypesDev; - null === workInProgress.dependencies - ? null !== thenableState$1 && - (workInProgress.dependencies = { - lanes: 0, - firstContext: null, - _debugThenableState: thenableState$1 - }) - : (workInProgress.dependencies._debugThenableState = thenableState$1); - ReactSharedInternals.H = ContextOnlyDispatcher; - var didRenderTooFewHooks = - null !== currentHook && null !== currentHook.next; - renderLanes = 0; - hookTypesDev = - currentHookNameInDev = - workInProgressHook = - currentHook = - currentlyRenderingFiber$1 = - null; - hookTypesUpdateIndexDev = -1; - null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && - console.error( - "Internal React error: Expected static flag was missing. Please notify the React team." - ); - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter$1 = 0; - thenableState$1 = null; - if (didRenderTooFewHooks) + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; + do { + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; + if ( + isHiddenUpdate + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + updateLane = workInProgress; + var partialState = pendingQueue; + var nextProps = props, + instance = instance$jscomp$0; + switch (partialState.tag) { + case ReplaceState: + partialState = partialState.payload; + if ("function" === typeof partialState) { + isDisallowedContextReadInDEV = !0; + var nextState = partialState.call( + instance, + newState, + nextProps + ); + if (updateLane.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState.call(instance, newState, nextProps); + } finally { + setIsStrictModeForDevtools(!1); + } + } + isDisallowedContextReadInDEV = !1; + newState = nextState; + break a; + } + newState = partialState; + break a; + case CaptureUpdate: + updateLane.flags = (updateLane.flags & -65537) | 128; + case UpdateState: + nextState = partialState.payload; + if ("function" === typeof nextState) { + isDisallowedContextReadInDEV = !0; + partialState = nextState.call( + instance, + newState, + nextProps + ); + if (updateLane.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + nextState.call(instance, newState, nextProps); + } finally { + setIsStrictModeForDevtools(!1); + } + } + isDisallowedContextReadInDEV = !1; + } else partialState = nextState; + if (null === partialState || void 0 === partialState) break a; + newState = assign({}, newState, partialState); + break a; + case ForceUpdate: + hasForceUpdate = !0; + } + } + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress.flags |= 64), + isHiddenUpdate && (workInProgress.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); + } else + (isHiddenUpdate = { + lane: updateLane, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, + next: null + }), + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress.lanes = lastBaseUpdate; + workInProgress.memoizedState = newState; + } + currentlyProcessingQueue = null; + } + function callCallback(callback, context) { + if ("function" !== typeof callback) throw Error( - "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." + "Invalid argument passed as callback. Expected a function. Instead received: " + + callback ); - null === current || - didReceiveUpdate || - ((current = current.dependencies), - null !== current && - checkIfContextChanged(current) && - (didReceiveUpdate = !0)); - needsToResetSuspendedThenableDEV - ? ((needsToResetSuspendedThenableDEV = !1), (current = !0)) - : (current = !1); - current && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Unknown"), - didWarnAboutUseWrappedInTryCatch.has(workInProgress) || - didWarnAboutAsyncClientComponent.has(workInProgress) || - (didWarnAboutUseWrappedInTryCatch.add(workInProgress), - console.error( - "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary." - ))); + callback.call(context); } - function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); - thenableIndexCounter$1 = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (numberOfReRenders >= RE_RENDER_LIMIT) - throw Error( - "Too many re-renders. React limits the number of renders to prevent an infinite loop." - ); - numberOfReRenders += 1; - ignorePreviousDependencies = !1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); - } - hookTypesUpdateIndexDev = -1; - ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; - children = callComponentInDEV(Component, props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); } - function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== - dispatcher && (currentlyRenderingFiber$1.flags |= 1024); - return maybeThenable; + function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } - function checkDidRenderIdHook() { - var didRenderIdHook = 0 !== localIdCounter; - localIdCounter = 0; - return didRenderIdHook; + function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; } - function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags = - (workInProgress.mode & StrictEffectsMode) !== NoMode - ? workInProgress.flags & -201328645 - : workInProgress.flags & -2053; - current.lanes &= ~lanes; + function retainCache(cache) { + cache.controller.signal.aborted && + console.warn( + "A cache instance was retained after it was already freed. This likely indicates a bug in React." + ); + cache.refCount++; } - function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { - for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; - } - didScheduleRenderPhaseUpdate = !1; - } - renderLanes = 0; - hookTypesDev = - workInProgressHook = - currentHook = - currentlyRenderingFiber$1 = - null; - hookTypesUpdateIndexDev = -1; - currentHookNameInDev = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter$1 = localIdCounter = 0; - thenableState$1 = null; - } - function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; - } - function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) - throw Error( - "Update hook called on initial render. This is likely a bug in React. Please file an issue." - ); - throw Error("Rendered more hooks than during the previous render."); - } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; - } - function useThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = createThenableState()); - thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null !== index && null !== index.memoizedState - ? HooksDispatcherOnUpdateInDEV - : HooksDispatcherOnMountInDEV)); - return thenable; + function releaseCache(cache) { + cache.refCount--; + 0 > cache.refCount && + console.warn( + "A cache instance was released after it was already freed. This likely indicates a bug in React." + ); + 0 === cache.refCount && + scheduleCallback$1(NormalPriority, function () { + cache.controller.abort(); + }); } - function use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } - throw Error("An unsupported type was passed to use(): " + String(usable)); } - function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; - null !== current && - ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); + } } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue || ignorePreviousDependencies) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), - current = 0; - current < size; - current++ - ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - else - updateQueue.length !== size && + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), console.error( - "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.", - updateQueue.length, - size - ); - memoCache.index++; - return updateQueue; - } - function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function mountReducer(reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { - init(initialArg); + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); } finally { setIsStrictModeForDevtools(!1); } } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber$1, - reducer - ); - return [hook.memoizedState, reducer]; - } - function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); - } - function updateReducerImpl(hook, current, reducer) { - var queue = hook.queue; - if (null === queue) - throw Error( - "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" - ); - queue.lastRenderedReducer = reducer; - var baseQueue = hook.baseQueue, - pendingQueue = queue.pending; - if (null !== pendingQueue) { - if (null !== baseQueue) { - var baseFirst = baseQueue.next; - baseQueue.next = pendingQueue.next; - pendingQueue.next = baseFirst; - } - current.baseQueue !== baseQueue && + void 0 === oldProps && console.error( - "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React." + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" ); - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; + return oldProps; } - pendingQueue = hook.baseState; - if (null === baseQueue) hook.memoizedState = pendingQueue; - else { - current = baseQueue.next; - var newBaseQueueFirst = (baseFirst = null), - newBaseQueueLast = null, - update = current, - didReadFromEntangledAsyncAction = !1; - do { - var updateLane = update.lane & -536870913; - if ( - updateLane !== update.lane - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - var revertLane = update.revertLane; - if (0 === revertLane) - null !== newBaseQueueLast && - (newBaseQueueLast = newBaseQueueLast.next = - { - lane: 0, - revertLane: 0, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - else if ((renderLanes & revertLane) === revertLane) { - update = update.next; - revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - continue; - } else - (updateLane = { - lane: 0, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); - } else - (revertLane = { - lane: updateLane, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); - if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction && - ((reducer = currentEntangledActionThenable), null !== reducer)) - ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; - } - null === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) - throw Error( - "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" - ); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do - (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + console.error( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error( - "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." - ); - var nextSnapshot = getServerSnapshot(); - didWarnUncachedGetSnapshot || - nextSnapshot === getServerSnapshot() || - (console.error( - "The result of getServerSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0)); - } else { - nextSnapshot = getSnapshot(); - didWarnUncachedGetSnapshot || - ((getServerSnapshot = getSnapshot()), - objectIs(nextSnapshot, getServerSnapshot) || - (console.error( - "The result of getSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0))); - if (null === workInProgressRoot) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } - hook.memoizedState = nextSnapshot; - getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; - hook.queue = getServerSnapshot; - mountEffect( - subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe), - [subscribe] - ); - fiber.flags |= 2048; - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - getServerSnapshot, - nextSnapshot, - getSnapshot - ), - null - ); - return nextSnapshot; - } - function updateSyncExternalStore( - subscribe, - getSnapshot, - getServerSnapshot - ) { - var fiber = currentlyRenderingFiber$1, - hook = updateWorkInProgressHook(), - isHydrating$jscomp$0 = isHydrating; - if (isHydrating$jscomp$0) { - if (void 0 === getServerSnapshot) - throw Error( - "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." - ); - getServerSnapshot = getServerSnapshot(); - } else if ( - ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot) - ) { - var cachedSnapshot = getSnapshot(); - objectIs(getServerSnapshot, cachedSnapshot) || - (console.error( - "The result of getSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0)); + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); } - if ( - (cachedSnapshot = !objectIs( - (currentHook || hook).memoizedState, - getServerSnapshot - )) - ) - (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); - hook = hook.queue; - var create = subscribeToStore.bind(null, fiber, hook, subscribe); - updateEffectImpl(2048, Passive, create, [subscribe]); - if ( - hook.getSnapshot !== getSnapshot || - cachedSnapshot || - (null !== workInProgressHook && - workInProgressHook.memoizedState.tag & HasEffect) - ) { - fiber.flags |= 2048; - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - hook, - getServerSnapshot, - getSnapshot - ), - null - ); - if (null === workInProgressRoot) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + return newProps; + } + function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + CapturedStacks.set(value, source); + return source; } - return getServerSnapshot; + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } - function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); + function pushTreeFork(workInProgress, totalChildren) { + warnIfNotHydrating(); + forkStack[forkStackIndex++] = treeForkCount; + forkStack[forkStackIndex++] = treeForkProvider; + treeForkProvider = workInProgress; + treeForkCount = totalChildren; } - function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + function pushTreeId(workInProgress, totalChildren, index) { + warnIfNotHydrating(); + idStack[idStackIndex++] = treeContextId; + idStack[idStackIndex++] = treeContextOverflow; + idStack[idStackIndex++] = treeContextProvider; + treeContextProvider = workInProgress; + var baseIdWithLeadingBit = treeContextId; + workInProgress = treeContextOverflow; + var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; + baseIdWithLeadingBit &= ~(1 << baseLength); + index += 1; + var length = 32 - clz32(totalChildren) + baseLength; + if (30 < length) { + var numberOfOverflowBits = baseLength - (baseLength % 5); + length = ( + baseIdWithLeadingBit & + ((1 << numberOfOverflowBits) - 1) + ).toString(32); + baseIdWithLeadingBit >>= numberOfOverflowBits; + baseLength -= numberOfOverflowBits; + treeContextId = + (1 << (32 - clz32(totalChildren) + baseLength)) | + (index << baseLength) | + baseIdWithLeadingBit; + treeContextOverflow = length + workInProgress; + } else + (treeContextId = + (1 << length) | (index << baseLength) | baseIdWithLeadingBit), + (treeContextOverflow = workInProgress); } - function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); - }); + function pushMaterializedTreeId(workInProgress) { + warnIfNotHydrating(); + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); } - function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - inst = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(inst, nextValue); - } catch (error) { - return !0; - } + function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider; ) + (treeForkProvider = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null), + (treeForkCount = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null); + for (; workInProgress === treeContextProvider; ) + (treeContextProvider = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextOverflow = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextId = idStack[--idStackIndex]), + (idStack[idStackIndex] = null); } - function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); + function warnIfNotHydrating() { + isHydrating || + console.error( + "Expected to be hydrating. This is a bug in React. Please file an issue." + ); } - function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - initialStateInitializer(); - } finally { - setIsStrictModeForDevtools(!1); - } + function buildHydrationDiffNode(fiber, distanceFromLeaf) { + if (null === fiber.return) { + if (null === hydrationDiffRootDEV) + hydrationDiffRootDEV = { + fiber: fiber, + children: [], + serverProps: void 0, + serverTail: [], + distanceFromLeaf: distanceFromLeaf + }; + else { + if (hydrationDiffRootDEV.fiber !== fiber) + throw Error( + "Saw multiple hydration diff roots in a pass. This is a bug in React." + ); + hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf && + (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf); } + return hydrationDiffRootDEV; } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState - }; - return hook; - } - function mountState(initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - queue + var siblings = buildHydrationDiffNode( + fiber.return, + distanceFromLeaf + 1 + ).children; + if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber) + return ( + (siblings = siblings[siblings.length - 1]), + siblings.distanceFromLeaf > distanceFromLeaf && + (siblings.distanceFromLeaf = distanceFromLeaf), + siblings ); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - } - function mountOptimistic(passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null + distanceFromLeaf = { + fiber: fiber, + children: [], + serverProps: void 0, + serverTail: [], + distanceFromLeaf: distanceFromLeaf }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; + siblings.push(distanceFromLeaf); + return distanceFromLeaf; } - function updateOptimistic(passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + function warnNonHydratedInstance(fiber, rejectedCandidate) { + didSuspendOrErrorDEV || + ((fiber = buildHydrationDiffNode(fiber, 0)), + (fiber.serverProps = null), + null !== rejectedCandidate && + ((rejectedCandidate = + describeHydratableInstanceForDevWarnings(rejectedCandidate)), + fiber.serverTail.push(rejectedCandidate))); } - function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer + function throwOnHydrationMismatch(fiber) { + var diff = "", + diffRoot = hydrationDiffRootDEV; + null !== diffRoot && + ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot))); + queueHydrationError( + createCapturedValueAtFiber( + Error( + "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" + + diff + ), + fiber + ) ); + throw HydrationMismatchException; } - function rerenderOptimistic(passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; - } - function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload - ) { - if (isRenderPhaseUpdate(fiber)) - throw Error("Cannot update form state while rendering."); - fiber = actionQueue.action; - if (null !== fiber) { - var actionNode = { - payload: payload, - action: fiber, - next: null, - isTransition: !0, - status: "pending", - value: null, - reason: null, - listeners: [], - then: function (listener) { - actionNode.listeners.push(listener); - } - }; - null !== ReactSharedInternals.T - ? setPendingState(!0) - : (actionNode.isTransition = !1); - setState(actionNode); - setPendingState = actionQueue.pending; - null === setPendingState - ? ((actionNode.next = actionQueue.pending = actionNode), - runActionStateAction(actionQueue, actionNode)) - : ((actionNode.next = setPendingState.next), - (actionQueue.pending = setPendingState.next = actionNode)); - } - } - function runActionStateAction(actionQueue, node) { - var action = node.action, - payload = node.payload, - prevState = actionQueue.state; - if (node.isTransition) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - ReactSharedInternals.T._updatedFibers = new Set(); - try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error) { - onActionError(actionQueue, node, error); - } finally { - (ReactSharedInternals.T = prevTransition), - null === prevTransition && - currentTransition._updatedFibers && - ((actionQueue = currentTransition._updatedFibers.size), - currentTransition._updatedFibers.clear(), - 10 < actionQueue && - console.warn( - "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." - )); + function prepareToHydrateHostInstance(fiber) { + var didHydrate = fiber.stateNode; + var type = fiber.type, + props = fiber.memoizedProps; + didHydrate[internalInstanceKey] = fiber; + didHydrate[internalPropsKey] = props; + validatePropertiesInDevelopment(type, props); + switch (type) { + case "dialog": + listenToNonDelegatedEvent("cancel", didHydrate); + listenToNonDelegatedEvent("close", didHydrate); + break; + case "iframe": + case "object": + case "embed": + listenToNonDelegatedEvent("load", didHydrate); + break; + case "video": + case "audio": + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate); + break; + case "source": + listenToNonDelegatedEvent("error", didHydrate); + break; + case "img": + case "image": + case "link": + listenToNonDelegatedEvent("error", didHydrate); + listenToNonDelegatedEvent("load", didHydrate); + break; + case "details": + listenToNonDelegatedEvent("toggle", didHydrate); + break; + case "input": + checkControlledValueProps("input", props); + listenToNonDelegatedEvent("invalid", didHydrate); + validateInputProps(didHydrate, props); + initInput( + didHydrate, + props.value, + props.defaultValue, + props.checked, + props.defaultChecked, + props.type, + props.name, + !0 + ); + track(didHydrate); + break; + case "option": + validateOptionProps(didHydrate, props); + break; + case "select": + checkControlledValueProps("select", props); + listenToNonDelegatedEvent("invalid", didHydrate); + validateSelectProps(didHydrate, props); + break; + case "textarea": + checkControlledValueProps("textarea", props), + listenToNonDelegatedEvent("invalid", didHydrate), + validateTextareaProps(didHydrate, props), + initTextarea( + didHydrate, + props.value, + props.defaultValue, + props.children + ), + track(didHydrate); + } + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + didHydrate.textContent === "" + type || + !0 === props.suppressHydrationWarning || + checkForUnmatchedText(didHydrate.textContent, type) + ? (null != props.popover && + (listenToNonDelegatedEvent("beforetoggle", didHydrate), + listenToNonDelegatedEvent("toggle", didHydrate)), + null != props.onScroll && + listenToNonDelegatedEvent("scroll", didHydrate), + null != props.onScrollEnd && + listenToNonDelegatedEvent("scrollend", didHydrate), + null != props.onClick && (didHydrate.onclick = noop$2), + (didHydrate = !0)) + : (didHydrate = !1); + didHydrate || throwOnHydrationMismatch(fiber); + } + function popToNextHostParent(fiber) { + for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) + switch (hydrationParentFiber.tag) { + case 3: + case 27: + rootOrSingletonContext = !0; + return; + case 5: + case 13: + rootOrSingletonContext = !1; + return; + default: + hydrationParentFiber = hydrationParentFiber.return; } - } else - try { - (currentTransition = action(prevState, payload)), - handleActionReturnValue(actionQueue, node, currentTransition); - } catch (error$3) { - onActionError(actionQueue, node, error$3); + } + function popHydrationState(fiber) { + if (fiber !== hydrationParentFiber) return !1; + if (!isHydrating) + return popToNextHostParent(fiber), (isHydrating = !0), !1; + var shouldClear = !1, + JSCompiler_temp; + if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { + if ((JSCompiler_temp = 5 === fiber.tag)) + (JSCompiler_temp = fiber.type), + (JSCompiler_temp = + !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || + shouldSetTextContent(fiber.type, fiber.memoizedProps)); + JSCompiler_temp = !JSCompiler_temp; + } + JSCompiler_temp && (shouldClear = !0); + if (shouldClear && nextHydratableInstance) { + for (shouldClear = nextHydratableInstance; shouldClear; ) { + JSCompiler_temp = buildHydrationDiffNode(fiber, 0); + var description = + describeHydratableInstanceForDevWarnings(shouldClear); + JSCompiler_temp.serverTail.push(description); + shouldClear = + "Suspense" === description.type + ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear) + : getNextHydratable(shouldClear.nextSibling); } + throwOnHydrationMismatch(fiber); + } + popToNextHostParent(fiber); + if (13 === fiber.tag) { + fiber = fiber.memoizedState; + fiber = null !== fiber ? fiber.dehydrated : null; + if (!fiber) + throw Error( + "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." + ); + nextHydratableInstance = + getNextHydratableInstanceAfterSuspenseInstance(fiber); + } else + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; } - function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ), - node.isTransition || - console.error( - "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`" - )) - : onActionSuccess(actionQueue, node, returnValue); + function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + didSuspendOrErrorDEV = isHydrating = !1; } - function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); + function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); } - function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); - } - actionQueue.action = null; + function emitPendingHydrationWarnings() { + var diffRoot = hydrationDiffRootDEV; + null !== diffRoot && + ((hydrationDiffRootDEV = null), + (diffRoot = describeDiff(diffRoot)), + console.error( + "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s", + "https://react.dev/link/hydration-mismatch", + diffRoot + )); } - function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); + function createThenableState() { + return { didWarnAboutUncachedPromise: !1, thenables: [] }; } - function actionStateReducer(oldState, newState) { - return newState; + function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; } - function mountActionState(action, initialStateProp) { - if (isHydrating) { - var ssrFormState = workInProgressRoot.formState; - if (null !== ssrFormState) { - a: { - var isMatching = currentlyRenderingFiber$1; - if (isHydrating) { - if (nextHydratableInstance) { - b: { - var markerInstance = nextHydratableInstance; - for ( - var inRootOrSingleton = rootOrSingletonContext; - 8 !== markerInstance.nodeType; - - ) { - if (!inRootOrSingleton) { - markerInstance = null; - break b; - } - markerInstance = getNextHydratable( - markerInstance.nextSibling - ); - if (null === markerInstance) { - markerInstance = null; - break b; - } - } - inRootOrSingleton = markerInstance.data; - markerInstance = - inRootOrSingleton === FORM_STATE_IS_MATCHING || - inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING - ? markerInstance - : null; + function noop$4() {} + function trackUsedThenable(thenableState, thenable, index) { + null !== ReactSharedInternals.actQueue && + (ReactSharedInternals.didUsePromise = !0); + var trackedThenables = thenableState.thenables; + index = trackedThenables[index]; + void 0 === index + ? trackedThenables.push(thenable) + : index !== thenable && + (thenableState.didWarnAboutUncachedPromise || + ((thenableState.didWarnAboutUncachedPromise = !0), + console.error( + "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." + )), + thenable.then(noop$4, noop$4), + (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) + thenable.then(noop$4, noop$4); + else { + thenableState = workInProgressRoot; + if ( + null !== thenableState && + 100 < thenableState.shellSuspendCounter + ) + throw Error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; } - if (markerInstance) { - nextHydratableInstance = getNextHydratable( - markerInstance.nextSibling - ); - isMatching = markerInstance.data === FORM_STATE_IS_MATCHING; - break a; + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; } } - throwOnHydrationMismatch(isMatching); - } - isMatching = !1; + ); } - isMatching && (initialStateProp = ssrFormState[0]); - } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + needsToResetSuspendedThenableDEV = !0; + throw SuspenseException; } - ssrFormState = mountWorkInProgressHook(); - ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; - isMatching = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - ssrFormState.queue = isMatching; - ssrFormState = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - isMatching - ); - isMatching.dispatch = ssrFormState; - isMatching = mountStateImpl(!1); - inRootOrSingleton = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !1, - isMatching.queue - ); - isMatching = mountWorkInProgressHook(); - markerInstance = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - isMatching.queue = markerInstance; - ssrFormState = dispatchActionState.bind( - null, - currentlyRenderingFiber$1, - markerInstance, - inRootOrSingleton, - ssrFormState - ); - markerInstance.dispatch = ssrFormState; - isMatching.memoizedState = action; - return [initialStateProp, ssrFormState, !1]; } - function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); + function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + needsToResetSuspendedThenableDEV = !1; + return thenable; } - function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; + function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; - } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; - } - function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); } - function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; + function pushHiddenContext(fiber, context) { + var prevEntangledRenderLanes = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); + push(currentTreeHiddenStackCursor, context, fiber); + entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; } - function pushSimpleEffect(tag, inst, create, deps) { - tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; - inst = currentlyRenderingFiber$1.updateQueue; - null === inst && - ((inst = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = inst)); - create = inst.lastEffect; - null === create - ? (inst.lastEffect = tag.next = tag) - : ((deps = create.next), - (create.next = tag), - (tag.next = deps), - (inst.lastEffect = tag)); - return tag; + function reuseHiddenContextOnStack(fiber) { + push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); + push( + currentTreeHiddenStackCursor, + currentTreeHiddenStackCursor.current, + fiber + ); } - function createEffectInstance() { - return { destroy: void 0, resource: void 0 }; + function popHiddenContext(fiber) { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor, fiber); + pop(prevEntangledRenderLanesCursor, fiber); } - function mountRef(initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); + function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - HasEffect | hookFlags, - createEffectInstance(), - create, - deps - ); + function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) + : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); } - function updateEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var inst = hook.memoizedState.inst; - null !== currentHook && - null !== deps && - areHookInputsEqual(deps, currentHook.memoizedState.deps) - ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - HasEffect | hookFlags, - inst, - create, - deps - ))); + function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } - function mountEffect(create, deps) { - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (currentlyRenderingFiber$1.mode & NoStrictPassiveEffectsMode) === NoMode - ? mountEffectImpl(142608384, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); + function mountHookTypesDev() { + var hookName = currentHookNameInDev; + null === hookTypesDev + ? (hookTypesDev = [hookName]) + : hookTypesDev.push(hookName); } - function useEffectEventImpl(payload) { - currentlyRenderingFiber$1.flags |= 4; - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; - if (null === componentUpdateQueue) - (componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue), - (componentUpdateQueue.events = [payload]); - else { - var events = componentUpdateQueue.events; - null === events - ? (componentUpdateQueue.events = [payload]) - : events.push(payload); - } - } - function mountEvent(callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if ((executionContext & RenderContext) !== NoContext) - throw Error( - "A function wrapped in useEffectEvent can't be called during rendering." - ); - return ref.impl.apply(void 0, arguments); - }; - } - function updateEvent(callback) { - var ref = updateWorkInProgressHook().memoizedState; - useEffectEventImpl({ ref: ref, nextImpl: callback }); - return function () { - if ((executionContext & RenderContext) !== NoContext) - throw Error( - "A function wrapped in useEffectEvent can't be called during rendering." + function updateHookTypesDev() { + var hookName = currentHookNameInDev; + if ( + null !== hookTypesDev && + (hookTypesUpdateIndexDev++, + hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + ) { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); + if ( + !didWarnAboutMismatchedHooksForComponent.has(componentName) && + (didWarnAboutMismatchedHooksForComponent.add(componentName), + null !== hookTypesDev) + ) { + for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { + var oldHookName = hookTypesDev[i], + newHookName = + i === hookTypesUpdateIndexDev ? hookName : oldHookName; + for ( + oldHookName = i + 1 + ". " + oldHookName; + 30 > oldHookName.length; + + ) + oldHookName += " "; + oldHookName += newHookName + "\n"; + table += oldHookName; + } + console.error( + "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + componentName, + table ); - return ref.impl.apply(void 0, arguments); - }; - } - function mountLayoutEffect(create, deps) { - var fiberFlags = 4194308; - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (fiberFlags |= 67108864); - return mountEffectImpl(fiberFlags, Layout, create, deps); - } - function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; + } } - if (null !== ref && void 0 !== ref) - return ( - ref.hasOwnProperty("current") || - console.error( - "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", - "an object with keys {" + Object.keys(ref).join(", ") + "}" - ), - (create = create()), - (ref.current = create), - function () { - ref.current = null; - } - ); } - function mountImperativeHandle(ref, create, deps) { - "function" !== typeof create && + function checkDepsAreArrayDev(deps) { + void 0 === deps || + null === deps || + isArrayImpl(deps) || console.error( - "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", - null !== create ? typeof create : "null" + "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", + currentHookNameInDev, + typeof deps ); - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - var fiberFlags = 4194308; - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (fiberFlags |= 67108864); - mountEffectImpl( - fiberFlags, - Layout, - imperativeHandleEffect.bind(null, create, ref), - deps - ); } - function updateImperativeHandle(ref, create, deps) { - "function" !== typeof create && + function warnOnUseFormStateInDev() { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); + didWarnAboutUseFormState.has(componentName) || + (didWarnAboutUseFormState.add(componentName), console.error( - "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", - null !== create ? typeof create : "null" - ); - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - updateEffectImpl( - 4, - Layout, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - } - function mountCallback(callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; + "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", + componentName + )); } - function updateCallback(callback, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - hook.memoizedState = [callback, deps]; - return callback; + function throwInvalidHookError() { + throw Error( + "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." + ); } - function mountMemo(nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; + function areHookInputsEqual(nextDeps, prevDeps) { + if (ignorePreviousDependencies) return !1; + if (null === prevDeps) + return ( + console.error( + "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", + currentHookNameInDev + ), + !1 + ); + nextDeps.length !== prevDeps.length && + console.error( + "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", + currentHookNameInDev, + "[" + prevDeps.join(", ") + "]", + "[" + nextDeps.join(", ") + "]" + ); + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) + if (!objectIs(nextDeps[i], prevDeps[i])) return !1; + return !0; } - function updateMemo(nextCreate, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - prevState = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { + function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes + ) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + hookTypesDev = null !== current ? current._debugHookTypes : null; + hookTypesUpdateIndexDev = -1; + ignorePreviousDependencies = + null !== current && current.type !== workInProgress.type; + if ( + "[object AsyncFunction]" === + Object.prototype.toString.call(Component) || + "[object AsyncGeneratorFunction]" === + Object.prototype.toString.call(Component) + ) + (nextRenderLanes = getComponentNameFromFiber(currentlyRenderingFiber)), + didWarnAboutAsyncClientComponent.has(nextRenderLanes) || + (didWarnAboutAsyncClientComponent.add(nextRenderLanes), + console.error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + )); + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null !== current && null !== current.memoizedState + ? HooksDispatcherOnUpdateInDEV + : null !== hookTypesDev + ? HooksDispatcherOnMountWithHookTypesInDEV + : HooksDispatcherOnMountInDEV; + shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = + (workInProgress.mode & StrictLegacyMode) !== NoMode; + var children = callComponentInDEV(Component, props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + if (nextRenderLanes) { setIsStrictModeForDevtools(!0); try { - nextCreate(); + children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + ); } finally { setIsStrictModeForDevtools(!1); } } - hook.memoizedState = [prevState, deps]; - return prevState; - } - function mountDeferredValue(value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - } - function updateDeferredValue(value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); + finishRenderingHooks(current, workInProgress); + return children; } - function rerenderDeferredValue(value, initialValue) { - var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue + function finishRenderingHooks(current, workInProgress) { + workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState$1 && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState$1 + }) + : (workInProgress.dependencies._debugThenableState = thenableState$1); + ReactSharedInternals.H = ContextOnlyDispatcher; + var didRenderTooFewHooks = + null !== currentHook && null !== currentHook.next; + renderLanes = 0; + hookTypesDev = + currentHookNameInDev = + workInProgressHook = + currentHook = + currentlyRenderingFiber = + null; + hookTypesUpdateIndexDev = -1; + null !== current && + (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + console.error( + "Internal React error: Expected static flag was missing. Please notify the React team." + ); + didScheduleRenderPhaseUpdate = !1; + thenableIndexCounter$1 = 0; + thenableState$1 = null; + if (didRenderTooFewHooks) + throw Error( + "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." + ); + null === current || + didReceiveUpdate || + ((current = current.dependencies), + null !== current && + checkIfContextChanged(current) && + (didReceiveUpdate = !0)); + needsToResetSuspendedThenableDEV + ? ((needsToResetSuspendedThenableDEV = !1), (current = !0)) + : (current = !1); + current && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Unknown"), + didWarnAboutUseWrappedInTryCatch.has(workInProgress) || + didWarnAboutAsyncClientComponent.has(workInProgress) || + (didWarnAboutUseWrappedInTryCatch.add(workInProgress), + console.error( + "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary." + ))); + } + function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = workInProgress; + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); + thenableIndexCounter$1 = 0; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + if (numberOfReRenders >= RE_RENDER_LIMIT) + throw Error( + "Too many re-renders. React limits the number of renders to prevent an infinite loop." ); + numberOfReRenders += 1; + ignorePreviousDependencies = !1; + workInProgressHook = currentHook = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } + hookTypesUpdateIndexDev = -1; + ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; + children = callComponentInDEV(Component, props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; } - function mountDeferredValueImpl(hook, value, initialValue) { - if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; + function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== + dispatcher && (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; } - function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook - ); - if (0 === (renderLanes & 42)) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; + function checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; } - function startTransition( - fiber, - queue, - pendingState, - finishedState, - callback - ) { - var previousPriority = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = - 0 !== previousPriority && previousPriority < ContinuousEventPriority - ? previousPriority - : ContinuousEventPriority; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - currentTransition._updatedFibers = new Set(); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then + function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags = + (workInProgress.mode & StrictEffectsMode) !== NoMode + ? workInProgress.flags & -201328645 + : workInProgress.flags & -2053; + current.lanes &= ~lanes; + } + function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + ) { - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) - ); - } catch (error) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane(fiber) - ); - } finally { - (ReactDOMSharedInternals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - null === prevTransition && - currentTransition._updatedFibers && - ((fiber = currentTransition._updatedFibers.size), - currentTransition._updatedFibers.clear(), - 10 < fiber && - console.warn( - "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." - )); + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; + } + didScheduleRenderPhaseUpdate = !1; } + renderLanes = 0; + hookTypesDev = + workInProgressHook = + currentHook = + currentlyRenderingFiber = + null; + hookTypesUpdateIndexDev = -1; + currentHookNameInDev = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; } - function startHostTransition(formFiber, pendingState, action, formData) { - if (5 !== formFiber.tag) - throw Error( - "Expected the form instance to be a HostComponent. This is a bug in React." - ); - var queue = ensureFormComponentIsStateful(formFiber).queue; - startTransition( - formFiber, - queue, - pendingState, - NotPendingTransition, - null === action - ? noop$3 - : function () { - requestFormReset$2(formFiber); - return action(formData); - } - ); - } - function ensureFormComponentIsStateful(formFiber) { - var existingStateHook = formFiber.memoizedState; - if (null !== existingStateHook) return existingStateHook; - existingStateHook = { - memoizedState: NotPendingTransition, - baseState: NotPendingTransition, + function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: NotPendingTransition - }, + queue: null, next: null }; - var initialResetState = {}; - existingStateHook.next = { - memoizedState: initialResetState, - baseState: initialResetState, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, - next: null - }; - formFiber.memoizedState = existingStateHook; - formFiber = formFiber.alternate; - null !== formFiber && (formFiber.memoizedState = existingStateHook); - return existingStateHook; - } - function requestFormReset$2(formFiber) { - null === ReactSharedInternals.T && - console.error( - "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." - ); - var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetStateInternal( - formFiber, - resetStateQueue, - {}, - requestUpdateLane(formFiber) - ); + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; } - function mountTransition() { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber$1, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; + function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); + else { + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) + throw Error( + "Update hook called on initial render. This is likely a bug in React. Please file an issue." + ); + throw Error("Rendered more hooks than during the previous render."); + } + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); + } + return workInProgressHook; } - function updateTransition() { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; + function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } - function rerenderTransition() { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; + function useThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = createThenableState()); + thenable = trackUsedThenable(thenableState$1, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null !== index && null !== index.memoizedState + ? HooksDispatcherOnUpdateInDEV + : HooksDispatcherOnMountInDEV)); + return thenable; } - function useHostTransitionStatus() { - return readContext(HostTransitionContext); + function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); + } + throw Error("An unsupported type was passed to use(): " + String(usable)); } - function mountId() { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var treeId = treeContextOverflow; - var idWithLeadingBit = treeContextId; - treeId = - ( - idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) - ).toString(32) + treeId; - identifierPrefix = ":" + identifierPrefix + "R" + treeId; - treeId = localIdCounter++; - 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); - identifierPrefix += ":"; - } else - (treeId = globalClientIdCounter++), - (identifierPrefix = - ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); - return (hook.memoizedState = identifierPrefix); + function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue || ignorePreviousDependencies) + for ( + updateQueue = memoCache.data[memoCache.index] = Array(size), + current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + else + updateQueue.length !== size && + console.error( + "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.", + updateQueue.length, + size + ); + memoCache.index++; + return updateQueue; } - function mountRefresh() { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber$1 - )); + function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; } - function refreshCache(fiber, seedKey, seedValue) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(provider); - fiber = createUpdate(lane); - var root = enqueueUpdate(provider, fiber, lane); - null !== root && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(root, provider, lane), - entangleTransitions(root, provider, lane)); - provider = createCache(); - null !== seedKey && - void 0 !== seedKey && - null !== root && - provider.data.set(seedKey, seedValue); - fiber.payload = { cache: provider }; - return; + function mountReducer(reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } } - provider = provider.return; - } - } - function dispatchReducerAction( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p0 && - console.error( - "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." - ); - JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber); - action = { - lane: JSCompiler_OptimizeArgumentsArray_p0, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - )), - null !== action && - (startUpdateTimerByLane(JSCompiler_OptimizeArgumentsArray_p0), - scheduleUpdateOnFiber( - action, - fiber, - JSCompiler_OptimizeArgumentsArray_p0 - ), - entangleTransitionUpdate( - action, - queue, - JSCompiler_OptimizeArgumentsArray_p0 - ))); + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; } - function dispatchSetState( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p1 && - console.error( - "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." - ); - JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber); - dispatchSetStateInternal( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ) && startUpdateTimerByLane(JSCompiler_OptimizeArgumentsArray_p1); + function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); } - function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); - else { - var alternate = fiber.alternate; - if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) - ) { - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV; - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) - return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && - finishQueueingConcurrentUpdates(), - !1 - ); - } catch (error) { - } finally { - ReactSharedInternals.H = prevDispatcher; - } + function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) + throw Error( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" + ); + queue.lastRenderedReducer = reducer; + var baseQueue = hook.baseQueue, + pendingQueue = queue.pending; + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) - return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 + current.baseQueue !== baseQueue && + console.error( + "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React." ); + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; } - return !1; + pendingQueue = hook.baseState; + if (null === baseQueue) hook.memoizedState = pendingQueue; + else { + current = baseQueue.next; + var newBaseQueueFirst = (baseFirst = null), + newBaseQueueLast = null, + update = current, + didReadFromEntangledAsyncAction = !1; + do { + var updateLane = update.lane & -536870913; + if ( + updateLane !== update.lane + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + var revertLane = update.revertLane; + if (0 === revertLane) + null !== newBaseQueueLast && + (newBaseQueueLast = newBaseQueueLast.next = + { + lane: 0, + revertLane: 0, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + else if ((renderLanes & revertLane) === revertLane) { + update = update.next; + revertLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + continue; + } else + (updateLane = { + lane: 0, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); + if ( + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction && + ((reducer = currentEntangledActionThenable), null !== reducer)) + ) + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; + } + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; } - function dispatchOptimisticSetState( - fiber, - throwIfDuringRender, - queue, - action - ) { - null === ReactSharedInternals.T && - 0 === currentEntangledLane && - console.error( - "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." + function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) + throw Error( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" ); - action = { - lane: 2, - revertLane: requestTransitionLane(), - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) { - if (throwIfDuringRender) - throw Error("Cannot update optimistic state while rendering."); - console.error("Cannot call startTransition while rendering."); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - (startUpdateTimerByLane(2), - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); - } - function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) - ); - } - function enqueueRenderPhaseUpdate(queue, update) { - didScheduleRenderPhaseUpdateDuringThisPass = - didScheduleRenderPhaseUpdate = !0; - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; - } - function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { - var queueLanes = queue.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - queue.lanes = lane; - markRootEntangled(root, lane); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do + (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; } + return [newState, dispatch]; } - function pushDebugInfo(debugInfo) { - var previousDebugInfo = currentDebugInfo; - null != debugInfo && - (currentDebugInfo = - null === previousDebugInfo - ? debugInfo - : previousDebugInfo.concat(debugInfo)); - return previousDebugInfo; - } - function validateFragmentProps(element, fiber, returnFiber) { - for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) { - var key = keys[i]; - if ("children" !== key && "key" !== key) { - null === fiber && - ((fiber = createFiberFromElement(element, returnFiber.mode, 0)), - (fiber._debugInfo = currentDebugInfo), - (fiber.return = returnFiber)); - runWithFiberInDEV( - fiber, - function (erroredKey) { - console.error( - "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", - erroredKey - ); - }, - key + function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." ); - break; - } - } - } - function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = createThenableState()); - return trackUsedThenable(thenableState, thenable, index); - } - function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; + var nextSnapshot = getServerSnapshot(); + didWarnUncachedGetSnapshot || + nextSnapshot === getServerSnapshot() || + (console.error( + "The result of getServerSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } else { + nextSnapshot = getSnapshot(); + didWarnUncachedGetSnapshot || + ((getServerSnapshot = getSnapshot()), + objectIs(nextSnapshot, getServerSnapshot) || + (console.error( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0))); + if (null === workInProgressRoot) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + } + hook.memoizedState = nextSnapshot; + getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; + hook.queue = getServerSnapshot; + mountEffect( + subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe), + [subscribe] + ); + fiber.flags |= 2048; + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + getServerSnapshot, + nextSnapshot, + getSnapshot + ), + null + ); + return nextSnapshot; } - function throwOnInvalidObjectType(returnFiber, newChild) { - if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) - throw Error( - 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.' + function updateSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot + ) { + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(), + isHydrating$jscomp$0 = isHydrating; + if (isHydrating$jscomp$0) { + if (void 0 === getServerSnapshot) + throw Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." + ); + getServerSnapshot = getServerSnapshot(); + } else if ( + ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot) + ) { + var cachedSnapshot = getSnapshot(); + objectIs(getServerSnapshot, cachedSnapshot) || + (console.error( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } + if ( + (cachedSnapshot = !objectIs( + (currentHook || hook).memoizedState, + getServerSnapshot + )) + ) + (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); + hook = hook.queue; + var create = subscribeToStore.bind(null, fiber, hook, subscribe); + updateEffectImpl(2048, Passive, create, [subscribe]); + if ( + hook.getSnapshot !== getSnapshot || + cachedSnapshot || + (null !== workInProgressHook && + workInProgressHook.memoizedState.tag & HasEffect) + ) { + fiber.flags |= 2048; + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + hook, + getServerSnapshot, + getSnapshot + ), + null ); - returnFiber = Object.prototype.toString.call(newChild); - throw Error( - "Objects are not valid as a React child (found: " + - ("[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber) + - "). If you meant to render a collection of children, use an array instead." - ); + if (null === workInProgressRoot) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + return getServerSnapshot; } - function warnOnFunctionType(returnFiber, invalidChild) { - var parentName = getComponentNameFromFiber(returnFiber) || "Component"; - ownerHasFunctionTypeWarning[parentName] || - ((ownerHasFunctionTypeWarning[parentName] = !0), - (invalidChild = - invalidChild.displayName || invalidChild.name || "Component"), - 3 === returnFiber.tag - ? console.error( - "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)", - invalidChild, - invalidChild, - invalidChild - ) - : console.error( - "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}", - invalidChild, - invalidChild, - parentName, - invalidChild, - parentName - )); + function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); } - function warnOnSymbolType(returnFiber, invalidChild) { - var parentName = getComponentNameFromFiber(returnFiber) || "Component"; - ownerHasSymbolTypeWarning[parentName] || - ((ownerHasSymbolTypeWarning[parentName] = !0), - (invalidChild = String(invalidChild)), - 3 === returnFiber.tag - ? console.error( - "Symbols are not valid as a React child.\n root.render(%s)", - invalidChild - ) - : console.error( - "Symbols are not valid as a React child.\n <%s>%s", - parentName, - invalidChild, - parentName - )); + function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); } - function createChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (shouldTrackSideEffects) { - var deletions = returnFiber.deletions; - null === deletions - ? ((returnFiber.deletions = [childToDelete]), - (returnFiber.flags |= 16)) - : deletions.push(childToDelete); - } - } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; - } - function mapRemainingChildren(currentFirstChild) { - for (var existingChildren = new Map(); null !== currentFirstChild; ) - null !== currentFirstChild.key - ? existingChildren.set(currentFirstChild.key, currentFirstChild) - : existingChildren.set(currentFirstChild.index, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return existingChildren; - } - function useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; - } - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) - return (newFiber.flags |= 1048576), lastPlacedIndex; - newIndex = newFiber.alternate; - if (null !== newIndex) - return ( - (newIndex = newIndex.index), - newIndex < lastPlacedIndex - ? ((newFiber.flags |= 33554434), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 33554434; - return lastPlacedIndex; + function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); + } + function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; + } + function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); + } + function mountStateImpl(initialState) { + var hook = mountWorkInProgressHook(); + if ("function" === typeof initialState) { + var initialStateInitializer = initialState; + initialState = initialStateInitializer(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText( - textContent, - returnFiber.mode, - lanes - )), - (current.return = returnFiber), - (current._debugOwner = returnFiber), - (current._debugTask = returnFiber._debugTask), - (current._debugInfo = currentDebugInfo), - current - ); - current = useFiber(current, textContent); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; - } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return ( - (current = updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key - )), - validateFragmentProps(element, current, returnFiber), - current - ); - if ( - null !== current && - (current.elementType === elementType || - isCompatibleFamilyForHotReloading(current, element) || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - callLazyInitInDEV(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - (current._debugOwner = element._owner), - (current._debugInfo = currentDebugInfo), - current - ); - current = createFiberFromElement(element, returnFiber.mode, lanes); - coerceRef(current, element); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; - } - function updatePortal(returnFiber, current, portal, lanes) { - if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - (current._debugInfo = currentDebugInfo), - current - ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + hook.memoizedState = hook.baseState = initialState; + hook.queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + return hook; + } + function mountState(initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + } + function mountOptimistic(passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + } + function updateOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + } + function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer + ); + } + function rerenderOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + } + function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload + ) { + if (isRenderPhaseUpdate(fiber)) + throw Error("Cannot update form state while rendering."); + fiber = actionQueue.action; + if (null !== fiber) { + var actionNode = { + payload: payload, + action: fiber, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); + setPendingState = actionQueue.pending; + null === setPendingState + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = setPendingState.next), + (actionQueue.pending = setPendingState.next = actionNode)); } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - (current._debugOwner = returnFiber), - (current._debugTask = returnFiber._debugTask), - (current._debugInfo = currentDebugInfo), - current - ); - current = useFiber(current, fragment); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + } + function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + ReactSharedInternals.T._updatedFibers = new Set(); + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + (ReactSharedInternals.T = prevTransition), + null === prevTransition && + currentTransition._updatedFibers && + ((actionQueue = currentTransition._updatedFibers.size), + currentTransition._updatedFibers.clear(), + 10 < actionQueue && + console.warn( + "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." + )); + } + } else + try { + (currentTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, currentTransition); + } catch (error$3) { + onActionError(actionQueue, node, error$3); + } + } + function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? (returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ), + node.isTransition || + console.error( + "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`" + )) + : onActionSuccess(actionQueue, node, returnValue); + } + function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); + } + function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); } - function createChild(returnFiber, newChild, lanes) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - (newChild._debugOwner = returnFiber), - (newChild._debugTask = returnFiber._debugTask), - (newChild._debugInfo = currentDebugInfo), - newChild - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (lanes = createFiberFromElement( - newChild, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = pushDebugInfo(newChild._debugInfo)), - (lanes._debugInfo = currentDebugInfo), - (currentDebugInfo = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - (newChild._debugInfo = currentDebugInfo), - newChild - ); - case REACT_LAZY_TYPE: - var _prevDebugInfo = pushDebugInfo(newChild._debugInfo); - newChild = callLazyInitInDEV(newChild); - returnFiber = createChild(returnFiber, newChild, lanes); - currentDebugInfo = _prevDebugInfo; - return returnFiber; - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (lanes = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - (lanes._debugTask = returnFiber._debugTask), - (returnFiber = pushDebugInfo(newChild._debugInfo)), - (lanes._debugInfo = currentDebugInfo), - (currentDebugInfo = returnFiber), - lanes - ); - if ("function" === typeof newChild.then) - return ( - (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = createChild( - returnFiber, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = _prevDebugInfo), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; - } - function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = null !== oldFiber ? oldFiber.key : null; - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return null !== key - ? null - : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return newChild.key === key - ? ((key = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateElement( - returnFiber, - oldFiber, - newChild, - lanes - )), - (currentDebugInfo = key), - returnFiber) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (key = pushDebugInfo(newChild._debugInfo)), - (newChild = callLazyInitInDEV(newChild)), - (returnFiber = updateSlot( - returnFiber, - oldFiber, - newChild, - lanes - )), - (currentDebugInfo = key), - returnFiber - ); - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) { - if (null !== key) return null; - key = pushDebugInfo(newChild._debugInfo); - returnFiber = updateFragment( - returnFiber, - oldFiber, - newChild, - lanes, - null - ); - currentDebugInfo = key; - return returnFiber; + actionQueue.action = null; + } + function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); + } + function actionStateReducer(oldState, newState) { + return newState; + } + function mountActionState(action, initialStateProp) { + if (isHydrating) { + var ssrFormState = workInProgressRoot.formState; + if (null !== ssrFormState) { + a: { + var isMatching = currentlyRenderingFiber; + if (isHydrating) { + if (nextHydratableInstance) { + b: { + var markerInstance = nextHydratableInstance; + for ( + var inRootOrSingleton = rootOrSingletonContext; + 8 !== markerInstance.nodeType; + + ) { + if (!inRootOrSingleton) { + markerInstance = null; + break b; + } + markerInstance = getNextHydratable( + markerInstance.nextSibling + ); + if (null === markerInstance) { + markerInstance = null; + break b; + } + } + inRootOrSingleton = markerInstance.data; + markerInstance = + inRootOrSingleton === FORM_STATE_IS_MATCHING || + inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING + ? markerInstance + : null; + } + if (markerInstance) { + nextHydratableInstance = getNextHydratable( + markerInstance.nextSibling + ); + isMatching = markerInstance.data === FORM_STATE_IS_MATCHING; + break a; + } + } + throwOnHydrationMismatch(isMatching); + } + isMatching = !1; } - if ("function" === typeof newChild.then) - return ( - (key = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = key), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); + isMatching && (initialStateProp = ssrFormState[0]); } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; } - function updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (newIdx = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - (existingChildren = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateElement( - returnFiber, - newIdx, - newChild, - lanes - )), - (currentDebugInfo = existingChildren), - returnFiber - ); - case REACT_PORTAL_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updatePortal(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_LAZY_TYPE: - var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo); - newChild = callLazyInitInDEV(newChild); - returnFiber = updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ); - currentDebugInfo = _prevDebugInfo7; - return returnFiber; - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (newIdx = existingChildren.get(newIdx) || null), - (existingChildren = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateFragment( - returnFiber, - newIdx, - newChild, - lanes, - null - )), - (currentDebugInfo = existingChildren), - returnFiber - ); - if ("function" === typeof newChild.then) - return ( - (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = _prevDebugInfo7), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; - } - function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) { - if ("object" !== typeof child || null === child) return knownKeys; - switch (child.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: - warnForMissingKey(returnFiber, workInProgress, child); - var key = child.key; - if ("string" !== typeof key) break; - if (null === knownKeys) { - knownKeys = new Set(); - knownKeys.add(key); - break; - } - if (!knownKeys.has(key)) { - knownKeys.add(key); - break; - } - runWithFiberInDEV(workInProgress, function () { - console.error( - "Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", - key - ); - }); - break; - case REACT_LAZY_TYPE: - (child = callLazyInitInDEV(child)), - warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); + ssrFormState = mountWorkInProgressHook(); + ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; + isMatching = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + ssrFormState.queue = isMatching; + ssrFormState = dispatchSetState.bind( + null, + currentlyRenderingFiber, + isMatching + ); + isMatching.dispatch = ssrFormState; + isMatching = mountStateImpl(!1); + inRootOrSingleton = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + isMatching.queue + ); + isMatching = mountWorkInProgressHook(); + markerInstance = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null + }; + isMatching.queue = markerInstance; + ssrFormState = dispatchActionState.bind( + null, + currentlyRenderingFiber, + markerInstance, + inRootOrSingleton, + ssrFormState + ); + markerInstance.dispatch = ssrFormState; + isMatching.memoizedState = action; + return [initialStateProp, ssrFormState, !1]; + } + function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); + } + function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; } - return knownKeys; + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; + } + function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; + } + function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; + } + function pushSimpleEffect(tag, inst, create, deps) { + tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; + inst = currentlyRenderingFiber.updateQueue; + null === inst && + ((inst = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = inst)); + create = inst.lastEffect; + null === create + ? (inst.lastEffect = tag.next = tag) + : ((deps = create.next), + (create.next = tag), + (tag.next = deps), + (inst.lastEffect = tag)); + return tag; + } + function createEffectInstance() { + return { destroy: void 0, resource: void 0 }; + } + function mountRef(initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + } + function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + HasEffect | hookFlags, + createEffectInstance(), + create, + deps + ); + } + function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var inst = hook.memoizedState.inst; + null !== currentHook && + null !== deps && + areHookInputsEqual(deps, currentHook.memoizedState.deps) + ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + HasEffect | hookFlags, + inst, + create, + deps + ))); + } + function mountEffect(create, deps) { + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode + ? mountEffectImpl(142608384, Passive, create, deps) + : mountEffectImpl(8390656, Passive, create, deps); + } + function useEffectEventImpl(payload) { + currentlyRenderingFiber.flags |= 4; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + if (null === componentUpdateQueue) + (componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = componentUpdateQueue), + (componentUpdateQueue.events = [payload]); + else { + var events = componentUpdateQueue.events; + null === events + ? (componentUpdateQueue.events = [payload]) + : events.push(payload); } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - for ( - var knownKeys = null, - resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null; - null !== oldFiber && newIdx < newChildren.length; - newIdx++ - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot( - returnFiber, - oldFiber, - newChildren[newIdx], - lanes - ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - knownKeys = warnOnInvalidKey( - returnFiber, - newFiber, - newChildren[newIdx], - knownKeys + } + function mountEvent(callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if ((executionContext & RenderContext) !== NoContext) + throw Error( + "A function wrapped in useEffectEvent can't be called during rendering." ); - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (newIdx === newChildren.length) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + return ref.impl.apply(void 0, arguments); + }; + } + function updateEvent(callback) { + var ref = updateWorkInProgressHook().memoizedState; + useEffectEventImpl({ ref: ref, nextImpl: callback }); + return function () { + if ((executionContext & RenderContext) !== NoContext) + throw Error( + "A function wrapped in useEffectEvent can't be called during rendering." ); - if (null === oldFiber) { - for (; newIdx < newChildren.length; newIdx++) - (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), - null !== oldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - oldFiber, - newChildren[newIdx], - knownKeys - )), - (currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - newIdx < newChildren.length; - newIdx++ - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - newChildren[newIdx], - lanes - )), - null !== nextOldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - nextOldFiber, - newChildren[newIdx], - knownKeys - )), - shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + return ref.impl.apply(void 0, arguments); + }; + } + function mountLayoutEffect(create, deps) { + var fiberFlags = 4194308; + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); + return mountEffectImpl(fiberFlags, Layout, create, deps); + } + function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; } - function reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChildrenIterable, - lanes - ) { - var newChildren = newChildrenIterable[ASYNC_ITERATOR](); - newChildren !== newChildrenIterable || - (0 === returnFiber.tag && - "[object AsyncGeneratorFunction]" === - Object.prototype.toString.call(returnFiber.type) && - "[object AsyncGenerator]" === - Object.prototype.toString.call(newChildren)) || - (didWarnAboutGenerators || + if (null !== ref && void 0 !== ref) + return ( + ref.hasOwnProperty("current") || console.error( - "Using AsyncIterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You can use an AsyncIterable that can iterate multiple times over the same items." + "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", + "an object with keys {" + Object.keys(ref).join(", ") + "}" ), - (didWarnAboutGenerators = !0)); - if (null == newChildren) - throw Error("An iterable object provided no iterator."); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - { - next: function () { - return unwrapThenable(newChildren.next()); - } - }, - lanes + (create = create()), + (ref.current = create), + function () { + ref.current = null; + } + ); + } + function mountImperativeHandle(ref, create, deps) { + "function" !== typeof create && + console.error( + "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", + null !== create ? typeof create : "null" + ); + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + var fiberFlags = 4194308; + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); + mountEffectImpl( + fiberFlags, + Layout, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + } + function updateImperativeHandle(ref, create, deps) { + "function" !== typeof create && + console.error( + "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", + null !== create ? typeof create : "null" ); + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl( + 4, + Layout, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + } + function mountCallback(callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + } + function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; + } + function mountMemo(nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - if (null == newChildren) - throw Error("An iterable object provided no iterator."); - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null, - knownKeys = null, - step = newChildren.next(); - null !== oldFiber && !step.done; - newIdx++, step = newChildren.next() - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - knownKeys = warnOnInvalidKey( - returnFiber, - newFiber, - step.value, - knownKeys - ); - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; + hook.memoizedState = [nextValue, deps]; + return nextValue; + } + function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); } - if (step.done) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + } + hook.memoizedState = [prevState, deps]; + return prevState; + } + function mountDeferredValue(value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + } + function updateDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + } + function rerenderDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(); + return null === currentHook + ? mountDeferredValueImpl(hook, value, initialValue) + : updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue ); - if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildren.next()) - (oldFiber = createChild(returnFiber, step.value, lanes)), - null !== oldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - oldFiber, - step.value, - knownKeys - )), - (currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - step.value, - lanes - )), - null !== nextOldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - nextOldFiber, - step.value, - knownKeys - )), - shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + } + function mountDeferredValueImpl(hook, value, initialValue) { + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; + } + function updateDeferredValueImpl(hook, prevValue, value, initialValue) { + if (objectIs(value, prevValue)) return value; + if (null !== currentTreeHiddenStackCursor.current) + return ( + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook + ); + if (0 === (renderLanes & 42)) + return (didReceiveUpdate = !0), (hook.memoizedState = value); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; + } + function startTransition( + fiber, + queue, + pendingState, + finishedState, + callback + ) { + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = + 0 !== previousPriority && previousPriority < ContinuousEventPriority + ? previousPriority + : ContinuousEventPriority; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); + currentTransition._updatedFibers = new Set(); + try { + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + if ( + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState + ); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane(fiber) + ); + } finally { + (ReactDOMSharedInternals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + null === prevTransition && + currentTransition._updatedFibers && + ((fiber = currentTransition._updatedFibers.size), + currentTransition._updatedFibers.clear(), + 10 < fiber && + console.warn( + "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." + )); } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - (validateFragmentProps(newChild, null, returnFiber), - (newChild = newChild.props.children)); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - var prevDebugInfo = pushDebugInfo(newChild._debugInfo); - a: { - for (var key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) { - key = newChild.type; - if (key === REACT_FRAGMENT_TYPE) { - if (7 === currentFirstChild.tag) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - newChild.props.children - ); - lanes.return = returnFiber; - lanes._debugOwner = newChild._owner; - lanes._debugInfo = currentDebugInfo; - validateFragmentProps(newChild, lanes, returnFiber); - returnFiber = lanes; - break a; - } - } else if ( - currentFirstChild.elementType === key || - isCompatibleFamilyForHotReloading( - currentFirstChild, - newChild - ) || - ("object" === typeof key && - null !== key && - key.$$typeof === REACT_LAZY_TYPE && - callLazyInitInDEV(key) === currentFirstChild.type) - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.props); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - lanes._debugOwner = newChild._owner; - lanes._debugInfo = currentDebugInfo; - returnFiber = lanes; - break a; - } - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - newChild.type === REACT_FRAGMENT_TYPE - ? ((lanes = createFiberFromFragment( - newChild.props.children, - returnFiber.mode, - lanes, - newChild.key - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - (lanes._debugTask = returnFiber._debugTask), - (lanes._debugInfo = currentDebugInfo), - validateFragmentProps(newChild, lanes, returnFiber), - (returnFiber = lanes)) - : ((lanes = createFiberFromElement( - newChild, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (lanes._debugInfo = currentDebugInfo), - (returnFiber = lanes)); - } - returnFiber = placeSingleChild(returnFiber); - currentDebugInfo = prevDebugInfo; - return returnFiber; - case REACT_PORTAL_TYPE: - a: { - prevDebugInfo = newChild; - for ( - newChild = prevDebugInfo.key; - null !== currentFirstChild; - - ) { - if (currentFirstChild.key === newChild) - if ( - 4 === currentFirstChild.tag && - currentFirstChild.stateNode.containerInfo === - prevDebugInfo.containerInfo && - currentFirstChild.stateNode.implementation === - prevDebugInfo.implementation - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - prevDebugInfo.children || [] - ); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } else { - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - lanes = createFiberFromPortal( - prevDebugInfo, - returnFiber.mode, - lanes - ); - lanes.return = returnFiber; - returnFiber = lanes; - } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (newChild = callLazyInitInDEV(newChild)), - (returnFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - } - if (isArrayImpl(newChild)) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if (getIteratorFn(newChild)) { - prevDebugInfo = pushDebugInfo(newChild._debugInfo); - key = getIteratorFn(newChild); - if ("function" !== typeof key) - throw Error( - "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." - ); - var newChildren = key.call(newChild); - if (newChildren === newChild) { - if ( - 0 !== returnFiber.tag || - "[object GeneratorFunction]" !== - Object.prototype.toString.call(returnFiber.type) || - "[object Generator]" !== - Object.prototype.toString.call(newChildren) - ) - didWarnAboutGenerators || - console.error( - "Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items." - ), - (didWarnAboutGenerators = !0); - } else - newChild.entries !== key || - didWarnAboutMaps || - (console.error( - "Using Maps as children is not supported. Use an array of keyed ReactElements instead." - ), - (didWarnAboutMaps = !0)); - returnFiber = reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ); - currentDebugInfo = prevDebugInfo; - return returnFiber; - } - if ("function" === typeof newChild[ASYNC_ITERATOR]) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if ("function" === typeof newChild.then) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (prevDebugInfo = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ), - (lanes = useFiber(currentFirstChild, prevDebugInfo)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText( - prevDebugInfo, - returnFiber.mode, - lanes - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - (lanes._debugTask = returnFiber._debugTask), - (lanes._debugInfo = currentDebugInfo), - (returnFiber = lanes)), - placeSingleChild(returnFiber) - ); - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return deleteRemainingChildren(returnFiber, currentFirstChild); - } - return function (returnFiber, currentFirstChild, newChild, lanes) { - var prevDebugInfo = currentDebugInfo; - currentDebugInfo = null; - try { - thenableIndexCounter = 0; - var firstChildFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - thenableState = null; - return firstChildFiber; - } catch (x) { - if (x === SuspenseException || x === SuspenseActionException) throw x; - var fiber = createFiber(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - var debugInfo = (fiber._debugInfo = currentDebugInfo); - fiber._debugOwner = returnFiber._debugOwner; - fiber._debugTask = returnFiber._debugTask; - if (null != debugInfo) - for (var i = debugInfo.length - 1; 0 <= i; i--) - if ("string" === typeof debugInfo[i].stack) { - fiber._debugOwner = debugInfo[i]; - fiber._debugTask = debugInfo[i].debugTask; - break; - } - return fiber; - } finally { - currentDebugInfo = prevDebugInfo; - } - }; - } - function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push( - suspenseStackCursor, - suspenseStackCursor.current & SubtreeSuspenseContextMask, - handler - ); - push(suspenseHandlerStackCursor, handler, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); - } - function pushOffscreenSuspenseHandler(fiber) { - if (22 === fiber.tag) { - if ( - (push(suspenseStackCursor, suspenseStackCursor.current, fiber), - push(suspenseHandlerStackCursor, fiber, fiber), - null === shellBoundary) - ) { - var current = fiber.alternate; - null !== current && - null !== current.memoizedState && - (shellBoundary = fiber); - } - } else reuseSuspenseHandlerOnStack(fiber); - } - function reuseSuspenseHandlerOnStack(fiber) { - push(suspenseStackCursor, suspenseStackCursor.current, fiber); - push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, - fiber - ); - } - function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor, fiber); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor, fiber); - } - function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - ((state = state.dehydrated), - null === state || - state.data === SUSPENSE_PENDING_START_DATA || - isSuspenseInstanceFallback(state)) - ) - return node; - } else if ( - 19 === node.tag && - void 0 !== node.memoizedProps.revealOrder - ) { - if (0 !== (node.flags & 128)) return node; - } else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; - } - if (node === row) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === row) return null; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; - } - return null; - } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); - } - } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); - } - } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - console.error( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); - } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext - ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - } finally { - setIsStrictModeForDevtools(!1); - } - } - void 0 === oldProps && - console.error( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" - ); - return oldProps; - } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; - } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext - ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - console.error( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( - instance, - instance.state, - null - )); - } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); - } - return newProps; - } - function defaultOnUncaughtError(error) { - reportGlobalError(error); - console.warn( - "%s\n\n%s\n", - componentName - ? "An error occurred in the <" + componentName + "> component." - : "An error occurred in one of your React components.", - "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." - ); - } - function defaultOnCaughtError(error) { - var componentNameMessage = componentName - ? "The above error occurred in the <" + componentName + "> component." - : "The above error occurred in one of your React components.", - recreateMessage = - "React will try to recreate this component tree from scratch using the error boundary you provided, " + - ((errorBoundaryName || "Anonymous") + "."); - if ( - "object" === typeof error && - null !== error && - "string" === typeof error.environmentName - ) { - var JSCompiler_inline_result = error.environmentName; - error = [ - "%o\n\n%s\n\n%s\n", - error, - componentNameMessage, - recreateMessage - ].slice(0); - "string" === typeof error[0] - ? error.splice( - 0, - 1, - badgeFormat + error[0], - badgeStyle, - pad + JSCompiler_inline_result + pad, - resetStyle - ) - : error.splice( - 0, - 0, - badgeFormat, - badgeStyle, - pad + JSCompiler_inline_result + pad, - resetStyle - ); - error.unshift(console); - JSCompiler_inline_result = bind.apply(console.error, error); - JSCompiler_inline_result(); - } else - console.error( - "%o\n\n%s\n\n%s\n", - error, - componentNameMessage, - recreateMessage - ); } - function defaultOnRecoverableError(error) { - reportGlobalError(error); - } - function logUncaughtError(root, errorInfo) { - try { - componentName = errorInfo.source - ? getComponentNameFromFiber(errorInfo.source) - : null; - errorBoundaryName = null; - var error = errorInfo.value; - if (null !== ReactSharedInternals.actQueue) - ReactSharedInternals.thrownErrors.push(error); - else { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(error, { componentStack: errorInfo.stack }); - } - } catch (e$4) { - setTimeout(function () { - throw e$4; - }); - } - } - function logCaughtError(root, boundary, errorInfo) { - try { - componentName = errorInfo.source - ? getComponentNameFromFiber(errorInfo.source) - : null; - errorBoundaryName = getComponentNameFromFiber(boundary); - var onCaughtError = root.onCaughtError; - onCaughtError(errorInfo.value, { - componentStack: errorInfo.stack, - errorBoundary: 1 === boundary.tag ? boundary.stateNode : null - }); - } catch (e$5) { - setTimeout(function () { - throw e$5; - }); - } - } - function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - lane.payload = { element: null }; - lane.callback = function () { - runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); - }; - return lane; - } - function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - return lane; - } - function initializeClassErrorUpdate(update, root, fiber, errorInfo) { - var getDerivedStateFromError = fiber.type.getDerivedStateFromError; - if ("function" === typeof getDerivedStateFromError) { - var error = errorInfo.value; - update.payload = function () { - return getDerivedStateFromError(error); - }; - update.callback = function () { - markFailedErrorBoundaryForHotReloading(fiber); - runWithFiberInDEV( - errorInfo.source, - logCaughtError, - root, - fiber, - errorInfo - ); - }; - } - var inst = fiber.stateNode; - null !== inst && - "function" === typeof inst.componentDidCatch && - (update.callback = function () { - markFailedErrorBoundaryForHotReloading(fiber); - runWithFiberInDEV( - errorInfo.source, - logCaughtError, - root, - fiber, - errorInfo - ); - "function" !== typeof getDerivedStateFromError && - (null === legacyErrorBoundariesThatAlreadyFailed - ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) - : legacyErrorBoundariesThatAlreadyFailed.add(this)); - callComponentDidCatchInDEV(this, errorInfo); - "function" === typeof getDerivedStateFromError || - (0 === (fiber.lanes & 2) && - console.error( - "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", - getComponentNameFromFiber(fiber) || "Unknown" - )); - }); - } - function resetSuspendedComponent(sourceFiber, rootRenderLanes) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 - ); - } - function markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ) { - suspenseBoundary.flags |= 65536; - suspenseBoundary.lanes = rootRenderLanes; - return suspenseBoundary; - } - function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes - ) { - sourceFiber.flags |= 32768; - isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); - if ( - null !== value && - "object" === typeof value && - (value.$$typeof === REACT_POSTPONE_TYPE && - (value = { then: function () {} }), - "function" === typeof value.then) - ) { - resetSuspendedComponent(sourceFiber, rootRenderLanes); - isHydrating && (didSuspendOrErrorDEV = !0); - var suspenseBoundary = suspenseHandlerStackCursor.current; - if (null !== suspenseBoundary) { - switch (suspenseBoundary.tag) { - case 13: - return ( - null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === suspenseBoundary.alternate && - workInProgressRootExitStatus === RootInProgress && - (workInProgressRootExitStatus = RootSuspended), - (suspenseBoundary.flags &= -257), - markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value === noopSuspenseyCommitThenable - ? (suspenseBoundary.flags |= 16384) - : ((sourceFiber = suspenseBoundary.updateQueue), - null === sourceFiber - ? (suspenseBoundary.updateQueue = new Set([value])) - : sourceFiber.add(value), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - case 22: - return ( - (suspenseBoundary.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (suspenseBoundary.flags |= 16384) - : ((sourceFiber = suspenseBoundary.updateQueue), - null === sourceFiber - ? ((sourceFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (suspenseBoundary.updateQueue = sourceFiber)) - : ((returnFiber = sourceFiber.retryQueue), - null === returnFiber - ? (sourceFiber.retryQueue = new Set([value])) - : returnFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - } - throw Error( - "Unexpected Suspense handler tag (" + - suspenseBoundary.tag + - "). This is a bug in React." - ); - } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; - } - if (isHydrating) - return ( - (didSuspendOrErrorDEV = !0), - (suspenseBoundary = suspenseHandlerStackCursor.current), - null !== suspenseBoundary - ? (0 === (suspenseBoundary.flags & 65536) && - (suspenseBoundary.flags |= 256), - markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value !== HydrationMismatchException && - queueHydrationError( - createCapturedValueAtFiber( - Error( - "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.", - { cause: value } - ), - sourceFiber - ) - )) - : (value !== HydrationMismatchException && - queueHydrationError( - createCapturedValueAtFiber( - Error( - "There was an error while hydrating but React was able to recover by instead client rendering the entire root.", - { cause: value } - ), - sourceFiber - ) - ), - (root = root.current.alternate), - (root.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (root.lanes |= rootRenderLanes), - (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), - (rootRenderLanes = createRootErrorUpdate( - root.stateNode, - sourceFiber, - rootRenderLanes - )), - enqueueCapturedUpdate(root, rootRenderLanes), - workInProgressRootExitStatus !== RootSuspendedWithDelay && - (workInProgressRootExitStatus = RootErrored)), - !1 + function startHostTransition(formFiber, pendingState, action, formData) { + if (5 !== formFiber.tag) + throw Error( + "Expected the form instance to be a HostComponent. This is a bug in React." ); - queueConcurrentError( - createCapturedValueAtFiber( - Error( - "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", - { cause: value } - ), - sourceFiber - ) + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + NotPendingTransition, + null === action + ? noop$3 + : function () { + requestFormReset$2(formFiber); + return action(formData); + } ); - workInProgressRootExitStatus !== RootSuspendedWithDelay && - (workInProgressRootExitStatus = RootErrored); - if (null === returnFiber) return !0; - sourceFiber = createCapturedValueAtFiber(value, sourceFiber); - value = returnFiber; - do { - switch (value.tag) { - case 3: - return ( - (value.flags |= 65536), - (root = rootRenderLanes & -rootRenderLanes), - (value.lanes |= root), - (root = createRootErrorUpdate( - value.stateNode, - sourceFiber, - root - )), - enqueueCapturedUpdate(value, root), - !1 - ); - case 1: - if ( - ((returnFiber = value.type), - (suspenseBoundary = value.stateNode), - 0 === (value.flags & 128) && - ("function" === typeof returnFiber.getDerivedStateFromError || - (null !== suspenseBoundary && - "function" === typeof suspenseBoundary.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - suspenseBoundary - ))))) - ) - return ( - (value.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (value.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - value, - sourceFiber - ), - enqueueCapturedUpdate(value, rootRenderLanes), - !1 - ); - } - value = value.return; - } while (null !== value); - return !1; } - function reconcileChildren( - current, - workInProgress, - nextChildren, - renderLanes - ) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); + function ensureFormComponentIsStateful(formFiber) { + var existingStateHook = formFiber.memoizedState; + if (null !== existingStateHook) return existingStateHook; + existingStateHook = { + memoizedState: NotPendingTransition, + baseState: NotPendingTransition, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: NotPendingTransition + }, + next: null + }; + var initialResetState = {}; + existingStateHook.next = { + memoizedState: initialResetState, + baseState: initialResetState, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialResetState + }, + next: null + }; + formFiber.memoizedState = existingStateHook; + formFiber = formFiber.alternate; + null !== formFiber && (formFiber.memoizedState = existingStateHook); + return existingStateHook; } - function updateForwardRef( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - Component = Component.render; - var ref = workInProgress.ref; - if ("ref" in nextProps) { - var propsWithoutRef = {}; - for (var key in nextProps) - "ref" !== key && (propsWithoutRef[key] = nextProps[key]); - } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress); - nextProps = renderWithHooks( - current, - workInProgress, - Component, - propsWithoutRef, - ref, - renderLanes - ); - key = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + function requestFormReset$2(formFiber) { + null === ReactSharedInternals.T && + console.error( + "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." ); - isHydrating && key && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) + ); } - function updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if (null === current) { - var type = Component.type; - if ( - "function" === typeof type && - !shouldConstruct(type) && - void 0 === type.defaultProps && - null === Component.compare - ) - return ( - (Component = resolveFunctionForHotReloading(type)), - (workInProgress.tag = 15), - (workInProgress.type = Component), - validateFunctionComponentInDev(workInProgress, type), - updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) - ); - current = createFiberFromTypeAndProps( - Component.type, - null, - nextProps, - workInProgress, - workInProgress.mode, - renderLanes - ); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); - } - type = current.child; - if (!checkScheduledUpdateOrContext(current, renderLanes)) { - var prevProps = type.memoizedProps; - Component = Component.compare; - Component = null !== Component ? Component : shallowEqual; - if ( - Component(prevProps, nextProps) && - current.ref === workInProgress.ref - ) - return bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); + function mountTransition() { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + } + function updateTransition() { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + } + function rerenderTransition() { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + } + function useHostTransitionStatus() { + return readContext(HostTransitionContext); + } + function mountId() { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var treeId = treeContextOverflow; + var idWithLeadingBit = treeContextId; + treeId = + ( + idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) + ).toString(32) + treeId; + identifierPrefix = ":" + identifierPrefix + "R" + treeId; + treeId = localIdCounter++; + 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); + identifierPrefix += ":"; + } else + (treeId = globalClientIdCounter++), + (identifierPrefix = + ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); + return (hook.memoizedState = identifierPrefix); } - function updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if (null !== current) { - var prevProps = current.memoizedProps; - if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref && - workInProgress.type === current.type - ) - if ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) - ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); - else - return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); + function mountRefresh() { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + } + function refreshCache(fiber, seedKey, seedValue) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(provider); + fiber = createUpdate(lane); + var root = enqueueUpdate(provider, fiber, lane); + null !== root && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(root, provider, lane), + entangleTransitions(root, provider, lane)); + provider = createCache(); + null !== seedKey && + void 0 !== seedKey && + null !== root && + provider.data.set(seedKey, seedValue); + fiber.payload = { cache: provider }; + return; + } + provider = provider.return; } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ); } - function updateOffscreenComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - nextChildren = nextProps.children, - nextIsDetached = - 0 !== - (workInProgress.stateNode._pendingVisibility & OffscreenDetached), - prevState = null !== current ? current.memoizedState : null; - markRef(current, workInProgress); - if ("hidden" === nextProps.mode || nextIsDetached) { - if (0 !== (workInProgress.flags & 128)) { - nextProps = - null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes; - if (null !== current) { - nextChildren = workInProgress.child = current.child; - for (nextIsDetached = 0; null !== nextChildren; ) - (nextIsDetached = - nextIsDetached | nextChildren.lanes | nextChildren.childLanes), - (nextChildren = nextChildren.sibling); - workInProgress.childLanes = nextIsDetached & ~nextProps; - } else (workInProgress.childLanes = 0), (workInProgress.child = null); - return deferHiddenOffscreenComponent( - current, - workInProgress, - nextProps, - renderLanes - ); + function dispatchReducerAction(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && + console.error( + "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." + ); + args = requestUpdateLane(fiber); + var update = { + lane: args, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, update) + : ((update = enqueueConcurrentHookUpdate(fiber, queue, update, args)), + null !== update && + (startUpdateTimerByLane(args), + scheduleUpdateOnFiber(update, fiber, args), + entangleTransitionUpdate(update, queue, args))); + } + function dispatchSetState(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && + console.error( + "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." + ); + args = requestUpdateLane(fiber); + dispatchSetStateInternal(fiber, queue, action, args) && + startUpdateTimerByLane(args); + } + function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + else { + var alternate = fiber.alternate; + if ( + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) + ) { + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) + return ( + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && + finishQueueingConcurrentUpdates(), + !1 + ); + } catch (error) { + } finally { + ReactSharedInternals.H = prevDispatcher; + } } - if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(workInProgress), - pushOffscreenSuspenseHandler(workInProgress); - else + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes, - renderLanes - ) + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 ); - } else - null !== prevState - ? (pushTransition(workInProgress, prevState.cachePool), - pushHiddenContext(workInProgress, prevState), - reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.memoizedState = null)) - : (null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(workInProgress), - reuseSuspenseHandlerOnStack(workInProgress)); - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; + } + return !1; } - function deferHiddenOffscreenComponent( - current, - workInProgress, - nextBaseLanes, - renderLanes + function dispatchOptimisticSetState( + fiber, + throwIfDuringRender, + queue, + action ) { - var JSCompiler_inline_result = peekCacheFromPool(); - JSCompiler_inline_result = - null === JSCompiler_inline_result - ? null - : { - parent: CacheContext._currentValue, - pool: JSCompiler_inline_result - }; - workInProgress.memoizedState = { - baseLanes: nextBaseLanes, - cachePool: JSCompiler_inline_result + null === ReactSharedInternals.T && + 0 === currentEntangledLane && + console.error( + "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." + ); + action = { + lane: 2, + revertLane: requestTransitionLane(), + action: action, + hasEagerState: !1, + eagerState: null, + next: null }; - null !== current && pushTransition(workInProgress, null); - reuseHiddenContextOnStack(workInProgress); - pushOffscreenSuspenseHandler(workInProgress); - null !== current && - propagateParentContextChanges(current, workInProgress, renderLanes, !0); - return null; + if (isRenderPhaseUpdate(fiber)) { + if (throwIfDuringRender) + throw Error("Cannot update optimistic state while rendering."); + console.error("Cannot call startTransition while rendering."); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + (startUpdateTimerByLane(2), + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); + } + function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) + ); + } + function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = + didScheduleRenderPhaseUpdate = !0; + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; + } + function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194176)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); + } } - function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (null === ref) - null !== current && - null !== current.ref && - (workInProgress.flags |= 2097664); - else { - if ("function" !== typeof ref && "object" !== typeof ref) - throw Error( - "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + function pushDebugInfo(debugInfo) { + var previousDebugInfo = currentDebugInfo; + null != debugInfo && + (currentDebugInfo = + null === previousDebugInfo + ? debugInfo + : previousDebugInfo.concat(debugInfo)); + return previousDebugInfo; + } + function validateFragmentProps(element, fiber, returnFiber) { + for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) { + var key = keys[i]; + if ("children" !== key && "key" !== key) { + null === fiber && + ((fiber = createFiberFromElement(element, returnFiber.mode, 0)), + (fiber._debugInfo = currentDebugInfo), + (fiber.return = returnFiber)); + runWithFiberInDEV( + fiber, + function (erroredKey) { + console.error( + "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", + erroredKey + ); + }, + key ); - if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + break; + } } } - function updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if ( - Component.prototype && - "function" === typeof Component.prototype.render - ) { - var componentName = getComponentNameFromType(Component) || "Unknown"; - didWarnAboutBadClass[componentName] || - (console.error( - "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", - componentName, - componentName - ), - (didWarnAboutBadClass[componentName] = !0)); - } - workInProgress.mode & StrictLegacyMode && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - null + function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = createThenableState()); + return trackUsedThenable(thenableState, thenable, index); + } + function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; + } + function throwOnInvalidObjectType(returnFiber, newChild) { + if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) + throw Error( + 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.' ); - null === current && - (validateFunctionComponentInDev(workInProgress, workInProgress.type), - Component.contextTypes && - ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes[componentName] || - ((didWarnAboutContextTypes[componentName] = !0), - console.error( - "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", - componentName - )))); - prepareToReadContext(workInProgress); - Component = renderWithHooks( - current, - workInProgress, - Component, - nextProps, - void 0, - renderLanes + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + "Objects are not valid as a React child (found: " + + ("[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber) + + "). If you meant to render a collection of children, use an array instead." ); - nextProps = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && nextProps && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, Component, renderLanes); - return workInProgress.child; } - function replayFunctionComponent( - current, - workInProgress, - nextProps, - Component, - secondArg, - renderLanes - ) { - prepareToReadContext(workInProgress); - hookTypesUpdateIndexDev = -1; - ignorePreviousDependencies = - null !== current && current.type !== workInProgress.type; - workInProgress.updateQueue = null; - nextProps = renderWithHooksAgain( - workInProgress, - Component, - nextProps, - secondArg - ); - finishRenderingHooks(current, workInProgress); - Component = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && Component && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; + function warnOnFunctionType(returnFiber, invalidChild) { + var parentName = getComponentNameFromFiber(returnFiber) || "Component"; + ownerHasFunctionTypeWarning[parentName] || + ((ownerHasFunctionTypeWarning[parentName] = !0), + (invalidChild = + invalidChild.displayName || invalidChild.name || "Component"), + 3 === returnFiber.tag + ? console.error( + "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)", + invalidChild, + invalidChild, + invalidChild + ) + : console.error( + "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}", + invalidChild, + invalidChild, + parentName, + invalidChild, + parentName + )); } - function updateClassComponent( - current$jscomp$0, - workInProgress, - Component, - nextProps, - renderLanes - ) { - switch (shouldErrorImpl(workInProgress)) { - case !1: - var _instance = workInProgress.stateNode, - state = new workInProgress.type( - workInProgress.memoizedProps, - _instance.context - ).state; - _instance.updater.enqueueSetState(_instance, state, null); - break; - case !0: - workInProgress.flags |= 128; - workInProgress.flags |= 65536; - _instance = Error("Simulated error coming from DevTools"); - var lane = renderLanes & -renderLanes; - workInProgress.lanes |= lane; - state = workInProgressRoot; - if (null === state) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - lane = createClassErrorUpdate(lane); - initializeClassErrorUpdate( - lane, - state, - workInProgress, - createCapturedValueAtFiber(_instance, workInProgress) + function warnOnSymbolType(returnFiber, invalidChild) { + var parentName = getComponentNameFromFiber(returnFiber) || "Component"; + ownerHasSymbolTypeWarning[parentName] || + ((ownerHasSymbolTypeWarning[parentName] = !0), + (invalidChild = String(invalidChild)), + 3 === returnFiber.tag + ? console.error( + "Symbols are not valid as a React child.\n root.render(%s)", + invalidChild + ) + : console.error( + "Symbols are not valid as a React child.\n <%s>%s", + parentName, + invalidChild, + parentName + )); + } + function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), + (returnFiber.flags |= 16)) + : deletions.push(childToDelete); + } + } + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; + } + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null !== currentFirstChild.key + ? existingChildren.set(currentFirstChild.key, currentFirstChild) + : existingChildren.set(currentFirstChild.index, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return existingChildren; + } + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) + return (newFiber.flags |= 1048576), lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) + return ( + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex ); - enqueueCapturedUpdate(workInProgress, lane); + newFiber.flags |= 33554434; + return lastPlacedIndex; } - prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) { - state = emptyContextObject; - _instance = Component.contextType; - "contextType" in Component && - null !== _instance && - (void 0 === _instance || _instance.$$typeof !== REACT_CONTEXT_TYPE) && - !didWarnAboutInvalidateContextType.has(Component) && - (didWarnAboutInvalidateContextType.add(Component), - (lane = - void 0 === _instance - ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." - : "object" !== typeof _instance - ? " However, it is set to a " + typeof _instance + "." - : _instance.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(_instance).join(", ") + - "}."), - console.error( - "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", - getComponentNameFromType(Component) || "Component", - lane - )); - "object" === typeof _instance && - null !== _instance && - (state = readContext(_instance)); - _instance = new Component(nextProps, state); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - _instance = new Component(nextProps, state); - } finally { - setIsStrictModeForDevtools(!1); + function placeSingleChild(newFiber) { + shouldTrackSideEffects && + null === newFiber.alternate && + (newFiber.flags |= 33554434); + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) + return ( + (current = createFiberFromText( + textContent, + returnFiber.mode, + lanes + )), + (current.return = returnFiber), + (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), + (current._debugInfo = currentDebugInfo), + current + ); + current = useFiber(current, textContent); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; + } + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return ( + (current = updateFragment( + returnFiber, + current, + element.props.children, + lanes, + element.key + )), + validateFragmentProps(element, current, returnFiber), + current + ); + if ( + null !== current && + (current.elementType === elementType || + isCompatibleFamilyForHotReloading(current, element) || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + callLazyInitInDEV(elementType) === current.type)) + ) + return ( + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + (current._debugOwner = element._owner), + (current._debugInfo = currentDebugInfo), + current + ); + current = createFiberFromElement(element, returnFiber.mode, lanes); + coerceRef(current, element); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; + } + function updatePortal(returnFiber, current, portal, lanes) { + if ( + null === current || + 4 !== current.tag || + current.stateNode.containerInfo !== portal.containerInfo || + current.stateNode.implementation !== portal.implementation + ) + return ( + (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), + (current.return = returnFiber), + (current._debugInfo = currentDebugInfo), + current + ); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; + } + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), + (current._debugInfo = currentDebugInfo), + current + ); + current = useFiber(current, fragment); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; + } + function createChild(returnFiber, newChild, lanes) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + (newChild._debugOwner = returnFiber), + (newChild._debugTask = returnFiber._debugTask), + (newChild._debugInfo = currentDebugInfo), + newChild + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (lanes = createFiberFromElement( + newChild, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = pushDebugInfo(newChild._debugInfo)), + (lanes._debugInfo = currentDebugInfo), + (currentDebugInfo = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + (newChild._debugInfo = currentDebugInfo), + newChild + ); + case REACT_LAZY_TYPE: + var _prevDebugInfo = pushDebugInfo(newChild._debugInfo); + newChild = callLazyInitInDEV(newChild); + returnFiber = createChild(returnFiber, newChild, lanes); + currentDebugInfo = _prevDebugInfo; + return returnFiber; } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (lanes = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), + (returnFiber = pushDebugInfo(newChild._debugInfo)), + (lanes._debugInfo = currentDebugInfo), + (currentDebugInfo = returnFiber), + lanes + ); + if ("function" === typeof newChild.then) + return ( + (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = createChild( + returnFiber, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = _prevDebugInfo), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } - state = workInProgress.memoizedState = - null !== _instance.state && void 0 !== _instance.state - ? _instance.state - : null; - _instance.updater = classComponentUpdater; - workInProgress.stateNode = _instance; - _instance._reactInternals = workInProgress; - _instance._reactInternalInstance = fakeInternalInstance; - "function" === typeof Component.getDerivedStateFromProps && - null === state && - ((state = getComponentNameFromType(Component) || "Component"), - didWarnAboutUninitializedState.has(state) || - (didWarnAboutUninitializedState.add(state), - console.error( - "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", - state, - null === _instance.state ? "null" : "undefined", - state - ))); + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; if ( - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof _instance.getSnapshotBeforeUpdate - ) { - var foundWillUpdateName = (lane = state = null); - "function" === typeof _instance.componentWillMount && - !0 !== _instance.componentWillMount.__suppressDeprecationWarning - ? (state = "componentWillMount") - : "function" === typeof _instance.UNSAFE_componentWillMount && - (state = "UNSAFE_componentWillMount"); - "function" === typeof _instance.componentWillReceiveProps && - !0 !== - _instance.componentWillReceiveProps.__suppressDeprecationWarning - ? (lane = "componentWillReceiveProps") - : "function" === - typeof _instance.UNSAFE_componentWillReceiveProps && - (lane = "UNSAFE_componentWillReceiveProps"); - "function" === typeof _instance.componentWillUpdate && - !0 !== _instance.componentWillUpdate.__suppressDeprecationWarning - ? (foundWillUpdateName = "componentWillUpdate") - : "function" === typeof _instance.UNSAFE_componentWillUpdate && - (foundWillUpdateName = "UNSAFE_componentWillUpdate"); - if (null !== state || null !== lane || null !== foundWillUpdateName) { - _instance = getComponentNameFromType(Component) || "Component"; - var newApiName = - "function" === typeof Component.getDerivedStateFromProps - ? "getDerivedStateFromProps()" - : "getSnapshotBeforeUpdate()"; - didWarnAboutLegacyLifecyclesAndDerivedState.has(_instance) || - (didWarnAboutLegacyLifecyclesAndDerivedState.add(_instance), - console.error( - "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", - _instance, - newApiName, - null !== state ? "\n " + state : "", - null !== lane ? "\n " + lane : "", - null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" - )); + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return null !== key + ? null + : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return newChild.key === key + ? ((key = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateElement( + returnFiber, + oldFiber, + newChild, + lanes + )), + (currentDebugInfo = key), + returnFiber) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (key = pushDebugInfo(newChild._debugInfo)), + (newChild = callLazyInitInDEV(newChild)), + (returnFiber = updateSlot( + returnFiber, + oldFiber, + newChild, + lanes + )), + (currentDebugInfo = key), + returnFiber + ); + } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) { + if (null !== key) return null; + key = pushDebugInfo(newChild._debugInfo); + returnFiber = updateFragment( + returnFiber, + oldFiber, + newChild, + lanes, + null + ); + currentDebugInfo = key; + return returnFiber; } + if ("function" === typeof newChild.then) + return ( + (key = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateSlot( + returnFiber, + oldFiber, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = key), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( + returnFiber, + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } - _instance = workInProgress.stateNode; - state = getComponentNameFromType(Component) || "Component"; - _instance.render || - (Component.prototype && - "function" === typeof Component.prototype.render - ? console.error( - "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", - state - ) - : console.error( - "No `render` method found on the %s instance: you may have forgotten to define `render`.", - state - )); - !_instance.getInitialState || - _instance.getInitialState.isReactClassApproved || - _instance.state || - console.error( - "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", - state - ); - _instance.getDefaultProps && - !_instance.getDefaultProps.isReactClassApproved && - console.error( - "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", - state - ); - _instance.contextType && - console.error( - "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", - state - ); - Component.childContextTypes && - !didWarnAboutChildContextTypes.has(Component) && - (didWarnAboutChildContextTypes.add(Component), - console.error( - "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)", - state - )); - Component.contextTypes && - !didWarnAboutContextTypes$1.has(Component) && - (didWarnAboutContextTypes$1.add(Component), - console.error( - "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", - state - )); - "function" === typeof _instance.componentShouldUpdate && - console.error( - "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", - state - ); - Component.prototype && - Component.prototype.isPureReactComponent && - "undefined" !== typeof _instance.shouldComponentUpdate && - console.error( - "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", - getComponentNameFromType(Component) || "A pure component" - ); - "function" === typeof _instance.componentDidUnmount && - console.error( - "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", - state - ); - "function" === typeof _instance.componentDidReceiveProps && - console.error( - "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", - state - ); - "function" === typeof _instance.componentWillRecieveProps && - console.error( - "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", - state - ); - "function" === typeof _instance.UNSAFE_componentWillRecieveProps && - console.error( - "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", - state + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) ); - lane = _instance.props !== nextProps; - void 0 !== _instance.props && - lane && - console.error( - "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", - state + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (newIdx = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + (existingChildren = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateElement( + returnFiber, + newIdx, + newChild, + lanes + )), + (currentDebugInfo = existingChildren), + returnFiber + ); + case REACT_PORTAL_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updatePortal(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_LAZY_TYPE: + var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo); + newChild = callLazyInitInDEV(newChild); + returnFiber = updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ); + currentDebugInfo = _prevDebugInfo7; + return returnFiber; + } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (newIdx = existingChildren.get(newIdx) || null), + (existingChildren = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFragment( + returnFiber, + newIdx, + newChild, + lanes, + null + )), + (currentDebugInfo = existingChildren), + returnFiber + ); + if ("function" === typeof newChild.then) + return ( + (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFromMap( + existingChildren, + returnFiber, + newIdx, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = _prevDebugInfo7), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) { + if ("object" !== typeof child || null === child) return knownKeys; + switch (child.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + warnForMissingKey(returnFiber, workInProgress, child); + var key = child.key; + if ("string" !== typeof key) break; + if (null === knownKeys) { + knownKeys = new Set(); + knownKeys.add(key); + break; + } + if (!knownKeys.has(key)) { + knownKeys.add(key); + break; + } + runWithFiberInDEV(workInProgress, function () { + console.error( + "Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", + key + ); + }); + break; + case REACT_LAZY_TYPE: + (child = callLazyInitInDEV(child)), + warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); + } + return knownKeys; + } + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var knownKeys = null, + resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( + returnFiber, + oldFiber, + newChildren[newIdx], + lanes ); - _instance.defaultProps && - console.error( - "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", - state, - state + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + knownKeys = warnOnInvalidKey( + returnFiber, + newFiber, + newChildren[newIdx], + knownKeys ); - "function" !== typeof _instance.getSnapshotBeforeUpdate || - "function" === typeof _instance.componentDidUpdate || - didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) || - (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component), - console.error( - "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", - getComponentNameFromType(Component) - )); - "function" === typeof _instance.getDerivedStateFromProps && - console.error( - "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - state + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (newIdx === newChildren.length) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - "function" === typeof _instance.getDerivedStateFromError && - console.error( - "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - state + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + oldFiber, + newChildren[newIdx], + knownKeys + )), + (currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + newIdx < newChildren.length; + newIdx++ + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + newChildren[newIdx], + lanes + )), + null !== nextOldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + nextOldFiber, + newChildren[newIdx], + knownKeys + )), + shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChildrenIterable, + lanes + ) { + var newChildren = newChildrenIterable[ASYNC_ITERATOR](); + newChildren !== newChildrenIterable || + (0 === returnFiber.tag && + "[object AsyncGeneratorFunction]" === + Object.prototype.toString.call(returnFiber.type) && + "[object AsyncGenerator]" === + Object.prototype.toString.call(newChildren)) || + (didWarnAboutGenerators || + console.error( + "Using AsyncIterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You can use an AsyncIterable that can iterate multiple times over the same items." + ), + (didWarnAboutGenerators = !0)); + if (null == newChildren) + throw Error("An iterable object provided no iterator."); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + { + next: function () { + return unwrapThenable(newChildren.next()); + } + }, + lanes + ); + } + function reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + if (null == newChildren) + throw Error("An iterable object provided no iterator."); + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null, + knownKeys = null, + step = newChildren.next(); + null !== oldFiber && !step.done; + newIdx++, step = newChildren.next() + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + knownKeys = warnOnInvalidKey( + returnFiber, + newFiber, + step.value, + knownKeys ); - "function" === typeof Component.getSnapshotBeforeUpdate && - console.error( - "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", - state + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (step.done) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - (lane = _instance.state) && - ("object" !== typeof lane || isArrayImpl(lane)) && - console.error("%s.state: must be set to an object or null", state); - "function" === typeof _instance.getChildContext && - "object" !== typeof Component.childContextTypes && - console.error( - "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", - state + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (oldFiber = createChild(returnFiber, step.value, lanes)), + null !== oldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + oldFiber, + step.value, + knownKeys + )), + (currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + step.value, + lanes + )), + null !== nextOldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + nextOldFiber, + step.value, + knownKeys + )), + shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) { + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + (validateFragmentProps(newChild, null, returnFiber), + (newChild = newChild.props.children)); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + var prevDebugInfo = pushDebugInfo(newChild._debugInfo); + a: { + for (var key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === currentFirstChild.tag) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + newChild.props.children + ); + lanes.return = returnFiber; + lanes._debugOwner = newChild._owner; + lanes._debugInfo = currentDebugInfo; + validateFragmentProps(newChild, lanes, returnFiber); + returnFiber = lanes; + break a; + } + } else if ( + currentFirstChild.elementType === key || + isCompatibleFamilyForHotReloading( + currentFirstChild, + newChild + ) || + ("object" === typeof key && + null !== key && + key.$$typeof === REACT_LAZY_TYPE && + callLazyInitInDEV(key) === currentFirstChild.type) + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.props); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + lanes._debugOwner = newChild._owner; + lanes._debugInfo = currentDebugInfo; + returnFiber = lanes; + break a; + } + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + newChild.type === REACT_FRAGMENT_TYPE + ? ((lanes = createFiberFromFragment( + newChild.props.children, + returnFiber.mode, + lanes, + newChild.key + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), + (lanes._debugInfo = currentDebugInfo), + validateFragmentProps(newChild, lanes, returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromElement( + newChild, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (lanes._debugInfo = currentDebugInfo), + (returnFiber = lanes)); + } + returnFiber = placeSingleChild(returnFiber); + currentDebugInfo = prevDebugInfo; + return returnFiber; + case REACT_PORTAL_TYPE: + a: { + prevDebugInfo = newChild; + for ( + newChild = prevDebugInfo.key; + null !== currentFirstChild; + + ) { + if (currentFirstChild.key === newChild) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + prevDebugInfo.containerInfo && + currentFirstChild.stateNode.implementation === + prevDebugInfo.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + prevDebugInfo.children || [] + ); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + lanes = createFiberFromPortal( + prevDebugInfo, + returnFiber.mode, + lanes + ); + lanes.return = returnFiber; + returnFiber = lanes; + } + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (newChild = callLazyInitInDEV(newChild)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + } + if (isArrayImpl(newChild)) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + if (getIteratorFn(newChild)) { + prevDebugInfo = pushDebugInfo(newChild._debugInfo); + key = getIteratorFn(newChild); + if ("function" !== typeof key) + throw Error( + "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." + ); + var newChildren = key.call(newChild); + if (newChildren === newChild) { + if ( + 0 !== returnFiber.tag || + "[object GeneratorFunction]" !== + Object.prototype.toString.call(returnFiber.type) || + "[object Generator]" !== + Object.prototype.toString.call(newChildren) + ) + didWarnAboutGenerators || + console.error( + "Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items." + ), + (didWarnAboutGenerators = !0); + } else + newChild.entries !== key || + didWarnAboutMaps || + (console.error( + "Using Maps as children is not supported. Use an array of keyed ReactElements instead." + ), + (didWarnAboutMaps = !0)); + returnFiber = reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ); + currentDebugInfo = prevDebugInfo; + return returnFiber; + } + if ("function" === typeof newChild[ASYNC_ITERATOR]) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + if ("function" === typeof newChild.then) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (prevDebugInfo = "" + newChild), + null !== currentFirstChild && 6 === currentFirstChild.tag + ? (deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ), + (lanes = useFiber(currentFirstChild, prevDebugInfo)), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : (deleteRemainingChildren(returnFiber, currentFirstChild), + (lanes = createFiberFromText( + prevDebugInfo, + returnFiber.mode, + lanes + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), + (lanes._debugInfo = currentDebugInfo), + (returnFiber = lanes)), + placeSingleChild(returnFiber) ); - _instance = workInProgress.stateNode; - _instance.props = nextProps; - _instance.state = workInProgress.memoizedState; - _instance.refs = {}; - initializeUpdateQueue(workInProgress); - state = Component.contextType; - _instance.context = - "object" === typeof state && null !== state - ? readContext(state) - : emptyContextObject; - _instance.state === nextProps && - ((state = getComponentNameFromType(Component) || "Component"), - didWarnAboutDirectlyAssigningPropsToState.has(state) || - (didWarnAboutDirectlyAssigningPropsToState.add(state), - console.error( - "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", - state - ))); - workInProgress.mode & StrictLegacyMode && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - _instance + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return deleteRemainingChildren(returnFiber, currentFirstChild); + } + return function (returnFiber, currentFirstChild, newChild, lanes) { + var prevDebugInfo = currentDebugInfo; + currentDebugInfo = null; + try { + thenableIndexCounter = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes ); - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( - workInProgress, - _instance + thenableState = null; + return firstChildFiber; + } catch (x) { + if (x === SuspenseException || x === SuspenseActionException) throw x; + var fiber = createFiber(29, x, null, returnFiber.mode); + fiber.lanes = lanes; + fiber.return = returnFiber; + var debugInfo = (fiber._debugInfo = currentDebugInfo); + fiber._debugOwner = returnFiber._debugOwner; + fiber._debugTask = returnFiber._debugTask; + if (null != debugInfo) + for (var i = debugInfo.length - 1; 0 <= i; i--) + if ("string" === typeof debugInfo[i].stack) { + fiber._debugOwner = debugInfo[i]; + fiber._debugTask = debugInfo[i].debugTask; + break; + } + return fiber; + } finally { + currentDebugInfo = prevDebugInfo; + } + }; + } + function pushPrimaryTreeSuspenseHandler(handler) { + var current = handler.alternate; + push( + suspenseStackCursor, + suspenseStackCursor.current & SubtreeSuspenseContextMask, + handler + ); + push(suspenseHandlerStackCursor, handler, handler); + null === shellBoundary && + (null === current || null !== currentTreeHiddenStackCursor.current + ? (shellBoundary = handler) + : null !== current.memoizedState && (shellBoundary = handler)); + } + function pushOffscreenSuspenseHandler(fiber) { + if (22 === fiber.tag) { + if ( + (push(suspenseStackCursor, suspenseStackCursor.current, fiber), + push(suspenseHandlerStackCursor, fiber, fiber), + null === shellBoundary) + ) { + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); + } + function reuseSuspenseHandlerOnStack(fiber) { + push(suspenseStackCursor, suspenseStackCursor.current, fiber); + push( + suspenseHandlerStackCursor, + suspenseHandlerStackCursor.current, + fiber + ); + } + function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor, fiber); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor, fiber); + } + function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; + if ( + null !== state && + ((state = state.dehydrated), + null === state || + state.data === SUSPENSE_PENDING_START_DATA || + isSuspenseInstanceFallback(state)) + ) + return node; + } else if ( + 19 === node.tag && + void 0 !== node.memoizedProps.revealOrder + ) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + return null; + } + function defaultOnUncaughtError(error) { + reportGlobalError(error); + console.warn( + "%s\n\n%s\n", + componentName + ? "An error occurred in the <" + componentName + "> component." + : "An error occurred in one of your React components.", + "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." + ); + } + function defaultOnCaughtError(error) { + var componentNameMessage = componentName + ? "The above error occurred in the <" + componentName + "> component." + : "The above error occurred in one of your React components.", + recreateMessage = + "React will try to recreate this component tree from scratch using the error boundary you provided, " + + ((errorBoundaryName || "Anonymous") + "."); + if ( + "object" === typeof error && + null !== error && + "string" === typeof error.environmentName + ) { + var JSCompiler_inline_result = error.environmentName; + error = [ + "%o\n\n%s\n\n%s\n", + error, + componentNameMessage, + recreateMessage + ].slice(0); + "string" === typeof error[0] + ? error.splice( + 0, + 1, + badgeFormat + error[0], + badgeStyle, + pad + JSCompiler_inline_result + pad, + resetStyle + ) + : error.splice( + 0, + 0, + badgeFormat, + badgeStyle, + pad + JSCompiler_inline_result + pad, + resetStyle + ); + error.unshift(console); + JSCompiler_inline_result = bind.apply(console.error, error); + JSCompiler_inline_result(); + } else + console.error( + "%o\n\n%s\n\n%s\n", + error, + componentNameMessage, + recreateMessage ); - _instance.state = workInProgress.memoizedState; - state = Component.getDerivedStateFromProps; - "function" === typeof state && - (applyDerivedStateFromProps( - workInProgress, - Component, - state, - nextProps - ), - (_instance.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof _instance.getSnapshotBeforeUpdate || - ("function" !== typeof _instance.UNSAFE_componentWillMount && - "function" !== typeof _instance.componentWillMount) || - ((state = _instance.state), - "function" === typeof _instance.componentWillMount && - _instance.componentWillMount(), - "function" === typeof _instance.UNSAFE_componentWillMount && - _instance.UNSAFE_componentWillMount(), - state !== _instance.state && - (console.error( - "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - getComponentNameFromFiber(workInProgress) || "Component" - ), - classComponentUpdater.enqueueReplaceState( - _instance, - _instance.state, - null - )), - processUpdateQueue(workInProgress, nextProps, _instance, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (_instance.state = workInProgress.memoizedState)); - "function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308); - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864); - _instance = !0; - } else if (null === current$jscomp$0) { - _instance = workInProgress.stateNode; - var unresolvedOldProps = workInProgress.memoizedProps; - lane = resolveClassComponentProps(Component, unresolvedOldProps); - _instance.props = lane; - var oldContext = _instance.context; - foundWillUpdateName = Component.contextType; - state = emptyContextObject; - "object" === typeof foundWillUpdateName && - null !== foundWillUpdateName && - (state = readContext(foundWillUpdateName)); - newApiName = Component.getDerivedStateFromProps; - foundWillUpdateName = - "function" === typeof newApiName || - "function" === typeof _instance.getSnapshotBeforeUpdate; - unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - foundWillUpdateName || - ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof _instance.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== state) && - callComponentWillReceiveProps( - workInProgress, - _instance, - nextProps, - state - )); - hasForceUpdate = !1; - var oldState = workInProgress.memoizedState; - _instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - oldContext = workInProgress.memoizedState; - unresolvedOldProps || oldState !== oldContext || hasForceUpdate - ? ("function" === typeof newApiName && - (applyDerivedStateFromProps( - workInProgress, - Component, - newApiName, - nextProps - ), - (oldContext = workInProgress.memoizedState)), - (lane = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - lane, - nextProps, - oldState, - oldContext, - state - )) - ? (foundWillUpdateName || - ("function" !== typeof _instance.UNSAFE_componentWillMount && - "function" !== typeof _instance.componentWillMount) || - ("function" === typeof _instance.componentWillMount && - _instance.componentWillMount(), - "function" === typeof _instance.UNSAFE_componentWillMount && - _instance.UNSAFE_componentWillMount()), - "function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864)) - : ("function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = oldContext)), - (_instance.props = nextProps), - (_instance.state = oldContext), - (_instance.context = state), - (_instance = lane)) - : ("function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864), - (_instance = !1)); - } else { - _instance = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); - state = workInProgress.memoizedProps; - foundWillUpdateName = resolveClassComponentProps(Component, state); - _instance.props = foundWillUpdateName; - newApiName = workInProgress.pendingProps; - oldState = _instance.context; - oldContext = Component.contextType; - lane = emptyContextObject; - "object" === typeof oldContext && - null !== oldContext && - (lane = readContext(oldContext)); - unresolvedOldProps = Component.getDerivedStateFromProps; - (oldContext = - "function" === typeof unresolvedOldProps || - "function" === typeof _instance.getSnapshotBeforeUpdate) || - ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof _instance.componentWillReceiveProps) || - ((state !== newApiName || oldState !== lane) && - callComponentWillReceiveProps( - workInProgress, - _instance, - nextProps, - lane - )); - hasForceUpdate = !1; - oldState = workInProgress.memoizedState; - _instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - state !== newApiName || - oldState !== newState || - hasForceUpdate || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) - ? ("function" === typeof unresolvedOldProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - unresolvedOldProps, - nextProps - ), - (newState = workInProgress.memoizedState)), - (foundWillUpdateName = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - foundWillUpdateName, - nextProps, - oldState, - newState, - lane - ) || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) - ? (oldContext || - ("function" !== typeof _instance.UNSAFE_componentWillUpdate && - "function" !== typeof _instance.componentWillUpdate) || - ("function" === typeof _instance.componentWillUpdate && - _instance.componentWillUpdate(nextProps, newState, lane), - "function" === typeof _instance.UNSAFE_componentWillUpdate && - _instance.UNSAFE_componentWillUpdate( - nextProps, - newState, - lane - )), - "function" === typeof _instance.componentDidUpdate && - (workInProgress.flags |= 4), - "function" === typeof _instance.getSnapshotBeforeUpdate && - (workInProgress.flags |= 1024)) - : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 1024), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = newState)), - (_instance.props = nextProps), - (_instance.state = newState), - (_instance.context = lane), - (_instance = foundWillUpdateName)) - : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 1024), - (_instance = !1)); + } + function defaultOnRecoverableError(error) { + reportGlobalError(error); + } + function logUncaughtError(root, errorInfo) { + try { + componentName = errorInfo.source + ? getComponentNameFromFiber(errorInfo.source) + : null; + errorBoundaryName = null; + var error = errorInfo.value; + if (null !== ReactSharedInternals.actQueue) + ReactSharedInternals.thrownErrors.push(error); + else { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(error, { componentStack: errorInfo.stack }); + } + } catch (e$4) { + setTimeout(function () { + throw e$4; + }); } - lane = _instance; - markRef(current$jscomp$0, workInProgress); - state = 0 !== (workInProgress.flags & 128); - if (lane || state) { - lane = workInProgress.stateNode; - ReactSharedInternals.getCurrentStack = - null === workInProgress ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = workInProgress; - if (state && "function" !== typeof Component.getDerivedStateFromError) - (Component = null), (profilerStartTime = -1); - else if ( - ((Component = callRenderInDEV(lane)), - workInProgress.mode & StrictLegacyMode) - ) { - setIsStrictModeForDevtools(!0); - try { - callRenderInDEV(lane); - } finally { - setIsStrictModeForDevtools(!1); + } + function logCaughtError(root, boundary, errorInfo) { + try { + componentName = errorInfo.source + ? getComponentNameFromFiber(errorInfo.source) + : null; + errorBoundaryName = getComponentNameFromFiber(boundary); + var onCaughtError = root.onCaughtError; + onCaughtError(errorInfo.value, { + componentStack: errorInfo.stack, + errorBoundary: 1 === boundary.tag ? boundary.stateNode : null + }); + } catch (e$5) { + setTimeout(function () { + throw e$5; + }); + } + } + function createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = CaptureUpdate; + lane.payload = { element: null }; + lane.callback = function () { + runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); + }; + return lane; + } + function createClassErrorUpdate(lane) { + lane = createUpdate(lane); + lane.tag = CaptureUpdate; + return lane; + } + function initializeClassErrorUpdate(update, root, fiber, errorInfo) { + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if ("function" === typeof getDerivedStateFromError) { + var error = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error); + }; + update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo + ); + }; + } + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo + ); + "function" !== typeof getDerivedStateFromError && + (null === legacyErrorBoundariesThatAlreadyFailed + ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) + : legacyErrorBoundariesThatAlreadyFailed.add(this)); + callComponentDidCatchInDEV(this, errorInfo); + "function" === typeof getDerivedStateFromError || + (0 === (fiber.lanes & 2) && + console.error( + "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", + getComponentNameFromFiber(fiber) || "Unknown" + )); + }); + } + function resetSuspendedComponent(sourceFiber, rootRenderLanes) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); + } + function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ) { + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; + } + function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes + ) { + sourceFiber.flags |= 32768; + isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); + if ( + null !== value && + "object" === typeof value && + (value.$$typeof === REACT_POSTPONE_TYPE && + (value = { then: function () {} }), + "function" === typeof value.then) + ) { + resetSuspendedComponent(sourceFiber, rootRenderLanes); + isHydrating && (didSuspendOrErrorDEV = !0); + var suspenseBoundary = suspenseHandlerStackCursor.current; + if (null !== suspenseBoundary) { + switch (suspenseBoundary.tag) { + case 13: + return ( + null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === suspenseBoundary.alternate && + workInProgressRootExitStatus === RootInProgress && + (workInProgressRootExitStatus = RootSuspended), + (suspenseBoundary.flags &= -257), + markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value === noopSuspenseyCommitThenable + ? (suspenseBoundary.flags |= 16384) + : ((sourceFiber = suspenseBoundary.updateQueue), + null === sourceFiber + ? (suspenseBoundary.updateQueue = new Set([value])) + : sourceFiber.add(value), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + case 22: + return ( + (suspenseBoundary.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (suspenseBoundary.flags |= 16384) + : ((sourceFiber = suspenseBoundary.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (suspenseBoundary.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); } + throw Error( + "Unexpected Suspense handler tag (" + + suspenseBoundary.tag + + "). This is a bug in React." + ); } - workInProgress.flags |= 1; - null !== current$jscomp$0 && state - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current$jscomp$0.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - Component, - renderLanes - ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - Component, - renderLanes - ); - workInProgress.memoizedState = lane.state; - current$jscomp$0 = workInProgress.child; - } else - current$jscomp$0 = bailoutOnAlreadyFinishedWork( - current$jscomp$0, - workInProgress, - renderLanes + attachPingListener(root, value, rootRenderLanes); + renderDidSuspendDelayIfPossible(); + return !1; + } + if (isHydrating) + return ( + (didSuspendOrErrorDEV = !0), + (suspenseBoundary = suspenseHandlerStackCursor.current), + null !== suspenseBoundary + ? (0 === (suspenseBoundary.flags & 65536) && + (suspenseBoundary.flags |= 256), + markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value !== HydrationMismatchException && + queueHydrationError( + createCapturedValueAtFiber( + Error( + "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.", + { cause: value } + ), + sourceFiber + ) + )) + : (value !== HydrationMismatchException && + queueHydrationError( + createCapturedValueAtFiber( + Error( + "There was an error while hydrating but React was able to recover by instead client rendering the entire root.", + { cause: value } + ), + sourceFiber + ) + ), + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes + )), + enqueueCapturedUpdate(root, rootRenderLanes), + workInProgressRootExitStatus !== RootSuspendedWithDelay && + (workInProgressRootExitStatus = RootErrored)), + !1 ); - renderLanes = workInProgress.stateNode; - _instance && - renderLanes.props !== nextProps && - (didWarnAboutReassigningProps || - console.error( - "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", - getComponentNameFromFiber(workInProgress) || "a component" + queueConcurrentError( + createCapturedValueAtFiber( + Error( + "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", + { cause: value } ), - (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; + sourceFiber + ) + ); + workInProgressRootExitStatus !== RootSuspendedWithDelay && + (workInProgressRootExitStatus = RootErrored); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + value = returnFiber; + do { + switch (value.tag) { + case 3: + return ( + (value.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (value.lanes |= root), + (root = createRootErrorUpdate( + value.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(value, root), + !1 + ); + case 1: + if ( + ((returnFiber = value.type), + (suspenseBoundary = value.stateNode), + 0 === (value.flags & 128) && + ("function" === typeof returnFiber.getDerivedStateFromError || + (null !== suspenseBoundary && + "function" === typeof suspenseBoundary.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has( + suspenseBoundary + ))))) + ) + return ( + (value.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (value.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + value, + sourceFiber + ), + enqueueCapturedUpdate(value, rootRenderLanes), + !1 + ); + } + value = value.return; + } while (null !== value); + return !1; } - function mountHostRootWithoutHydrating( + function reconcileChildren( current, workInProgress, nextChildren, renderLanes ) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; + workInProgress.child = + null === current + ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) + : reconcileChildFibers( + workInProgress, + current.child, + nextChildren, + renderLanes + ); } - function validateFunctionComponentInDev(workInProgress, Component) { - Component && - Component.childContextTypes && - console.error( - "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", - Component.displayName || Component.name || "Component" + function updateForwardRef( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + Component = Component.render; + var ref = workInProgress.ref; + if ("ref" in nextProps) { + var propsWithoutRef = {}; + for (var key in nextProps) + "ref" !== key && (propsWithoutRef[key] = nextProps[key]); + } else propsWithoutRef = nextProps; + prepareToReadContext(workInProgress); + nextProps = renderWithHooks( + current, + workInProgress, + Component, + propsWithoutRef, + ref, + renderLanes + ); + key = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) ); - "function" === typeof Component.getDerivedStateFromProps && - ((workInProgress = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] || - (console.error( - "%s: Function components do not support getDerivedStateFromProps.", - workInProgress - ), - (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] = - !0))); - "object" === typeof Component.contextType && - null !== Component.contextType && - ((Component = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypeOnFunctionComponent[Component] || - (console.error( - "%s: Function components do not support contextType.", - Component - ), - (didWarnAboutContextTypeOnFunctionComponent[Component] = !0))); - } - function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; + isHydrating && key && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; } - function getRemainingWorkInPrimaryTree( + function updateMemoComponent( current, - primaryTreeDidDefer, + workInProgress, + Component, + nextProps, renderLanes ) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; - } - function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2335; - var JSCompiler_object_inline_stack_2334 = workInProgress.pendingProps; - shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2332 = !1; - var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2335 = didSuspend) || - (JSCompiler_object_inline_componentStack_2335 = - null !== current && null === current.memoizedState - ? !1 - : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2335 && - ((JSCompiler_object_inline_message_2332 = !0), - (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2335 = - 0 !== (workInProgress.flags & 32); - workInProgress.flags &= -33; if (null === current) { - if (isHydrating) { - JSCompiler_object_inline_message_2332 - ? pushPrimaryTreeSuspenseHandler(workInProgress) - : reuseSuspenseHandlerOnStack(workInProgress); - if (isHydrating) { - var JSCompiler_object_inline_digest_2333 = nextHydratableInstance; - var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2333)) { - c: { - var instance = JSCompiler_object_inline_digest_2333; - for ( - JSCompiler_temp = rootOrSingletonContext; - 8 !== instance.nodeType; - - ) { - if (!JSCompiler_temp) { - JSCompiler_temp = null; - break c; - } - instance = getNextHydratable(instance.nextSibling); - if (null === instance) { - JSCompiler_temp = null; - break c; - } - } - JSCompiler_temp = instance; - } - null !== JSCompiler_temp - ? (warnIfNotHydrating(), - (workInProgress.memoizedState = { - dehydrated: JSCompiler_temp, - treeContext: - null !== treeContextProvider - ? { id: treeContextId, overflow: treeContextOverflow } - : null, - retryLane: 536870912 - }), - (instance = createFiber(18, null, null, NoMode)), - (instance.stateNode = JSCompiler_temp), - (instance.return = workInProgress), - (workInProgress.child = instance), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (JSCompiler_temp = !0)) - : (JSCompiler_temp = !1); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && - (warnNonHydratedInstance( - workInProgress, - JSCompiler_object_inline_digest_2333 - ), - throwOnHydrationMismatch(workInProgress)); - } - JSCompiler_object_inline_digest_2333 = workInProgress.memoizedState; - if ( - null !== JSCompiler_object_inline_digest_2333 && - ((JSCompiler_object_inline_digest_2333 = - JSCompiler_object_inline_digest_2333.dehydrated), - null !== JSCompiler_object_inline_digest_2333) - ) - return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2333) - ? (workInProgress.lanes = 16) - : (workInProgress.lanes = 536870912), - null - ); - popSuspenseHandler(workInProgress); - } - JSCompiler_object_inline_digest_2333 = - JSCompiler_object_inline_stack_2334.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2334.fallback; - if (JSCompiler_object_inline_message_2332) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2334 = - mountSuspenseFallbackChildren( - workInProgress, - JSCompiler_object_inline_digest_2333, - JSCompiler_temp, - renderLanes - )), - (JSCompiler_object_inline_message_2332 = workInProgress.child), - (JSCompiler_object_inline_message_2332.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2332.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_componentStack_2335, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2334 - ); + var type = Component.type; if ( - "number" === - typeof JSCompiler_object_inline_stack_2334.unstable_expectedLoadTime + "function" === typeof type && + !shouldConstruct(type) && + void 0 === type.defaultProps && + null === Component.compare ) return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2334 = - mountSuspenseFallbackChildren( - workInProgress, - JSCompiler_object_inline_digest_2333, - JSCompiler_temp, - renderLanes - )), - (JSCompiler_object_inline_message_2332 = workInProgress.child), - (JSCompiler_object_inline_message_2332.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2332.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_componentStack_2335, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2334 + (Component = resolveFunctionForHotReloading(type)), + (workInProgress.tag = 15), + (workInProgress.type = Component), + validateFunctionComponentInDev(workInProgress, type), + updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren( + current = createFiberFromTypeAndProps( + Component.type, + null, + nextProps, workInProgress, - JSCompiler_object_inline_digest_2333 + workInProgress.mode, + renderLanes ); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); } - var prevState = current.memoizedState; - if ( - null !== prevState && - ((JSCompiler_object_inline_digest_2333 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2333) - ) { - if (didSuspend) - workInProgress.flags & 256 - ? (pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags &= -257), - (workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ))) - : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2332 = - JSCompiler_object_inline_stack_2334.fallback), - (JSCompiler_object_inline_digest_2333 = workInProgress.mode), - (JSCompiler_object_inline_stack_2334 = - mountWorkInProgressOffscreenFiber( - { - mode: "visible", - children: JSCompiler_object_inline_stack_2334.children - }, - JSCompiler_object_inline_digest_2333 - )), - (JSCompiler_object_inline_message_2332 = - createFiberFromFragment( - JSCompiler_object_inline_message_2332, - JSCompiler_object_inline_digest_2333, - renderLanes, - null - )), - (JSCompiler_object_inline_message_2332.flags |= 2), - (JSCompiler_object_inline_stack_2334.return = workInProgress), - (JSCompiler_object_inline_message_2332.return = workInProgress), - (JSCompiler_object_inline_stack_2334.sibling = - JSCompiler_object_inline_message_2332), - (workInProgress.child = JSCompiler_object_inline_stack_2334), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (JSCompiler_object_inline_stack_2334 = workInProgress.child), - (JSCompiler_object_inline_stack_2334.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2334.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_componentStack_2335, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2332)); - else if ( - (pushPrimaryTreeSuspenseHandler(workInProgress), - isHydrating && - console.error( - "We should not be hydrating here. This is a bug in React. Please file a bug." - ), - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2333)) - ) { - JSCompiler_object_inline_componentStack_2335 = - JSCompiler_object_inline_digest_2333.nextSibling && - JSCompiler_object_inline_digest_2333.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2335) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2335.dgst; - var message = JSCompiler_object_inline_componentStack_2335.msg; - instance = JSCompiler_object_inline_componentStack_2335.stck; - var componentStack = - JSCompiler_object_inline_componentStack_2335.cstck; - } - JSCompiler_object_inline_message_2332 = message; - JSCompiler_object_inline_digest_2333 = JSCompiler_temp; - JSCompiler_object_inline_stack_2334 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2335 = - componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2333 && - ((JSCompiler_object_inline_componentStack_2335 = - JSCompiler_object_inline_message_2332 - ? Error(JSCompiler_object_inline_message_2332) - : Error( - "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." - )), - (JSCompiler_object_inline_componentStack_2335.stack = - JSCompiler_object_inline_stack_2334 || ""), - (JSCompiler_object_inline_componentStack_2335.digest = - JSCompiler_object_inline_digest_2333), - (JSCompiler_object_inline_stack_2334 = - void 0 === JSCompiler_temp ? null : JSCompiler_temp), - (JSCompiler_object_inline_message_2332 = { - value: JSCompiler_object_inline_componentStack_2335, - source: null, - stack: JSCompiler_object_inline_stack_2334 - }), - "string" === typeof JSCompiler_object_inline_stack_2334 && - CapturedStacks.set( - JSCompiler_object_inline_componentStack_2335, - JSCompiler_object_inline_message_2332 - ), - queueHydrationError(JSCompiler_object_inline_message_2332)); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else if ( - (didReceiveUpdate || - propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (JSCompiler_object_inline_componentStack_2335 = - 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2335) - ) { - JSCompiler_object_inline_componentStack_2335 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2335) { - JSCompiler_object_inline_stack_2334 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2334 & 42)) - JSCompiler_object_inline_stack_2334 = 1; - else - switch (JSCompiler_object_inline_stack_2334) { - case 2: - JSCompiler_object_inline_stack_2334 = 1; - break; - case 8: - JSCompiler_object_inline_stack_2334 = 4; - break; - case 32: - JSCompiler_object_inline_stack_2334 = 16; - break; - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - JSCompiler_object_inline_stack_2334 = 64; - break; - case 268435456: - JSCompiler_object_inline_stack_2334 = 134217728; - break; - default: - JSCompiler_object_inline_stack_2334 = 0; - } - JSCompiler_object_inline_stack_2334 = - 0 !== - (JSCompiler_object_inline_stack_2334 & - (JSCompiler_object_inline_componentStack_2335.suspendedLanes | - renderLanes)) - ? 0 - : JSCompiler_object_inline_stack_2334; - if ( - 0 !== JSCompiler_object_inline_stack_2334 && - JSCompiler_object_inline_stack_2334 !== prevState.retryLane - ) - throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2334), - enqueueConcurrentRenderForLane( - current, - JSCompiler_object_inline_stack_2334 - ), - scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2335, - current, - JSCompiler_object_inline_stack_2334 - ), - SelectiveHydrationException) - ); - } - JSCompiler_object_inline_digest_2333.data === - SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); - workInProgress = retrySuspenseComponentWithoutHydrating( + type = current.child; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if ( + Component(prevProps, nextProps) && + current.ref === workInProgress.ref + ) + return bailoutOnAlreadyFinishedWork( current, workInProgress, renderLanes ); - } else - JSCompiler_object_inline_digest_2333.data === - SUSPENSE_PENDING_START_DATA - ? ((workInProgress.flags |= 192), - (workInProgress.child = current.child), - (workInProgress = null)) - : ((current = prevState.treeContext), - (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2333.nextSibling - )), - (hydrationParentFiber = workInProgress), - (isHydrating = !0), - (hydrationErrors = null), - (didSuspendOrErrorDEV = !1), - (hydrationDiffRootDEV = null), - (rootOrSingletonContext = !1), - null !== current && - (warnIfNotHydrating(), - (idStack[idStackIndex++] = treeContextId), - (idStack[idStackIndex++] = treeContextOverflow), - (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = current.id), - (treeContextOverflow = current.overflow), - (treeContextProvider = workInProgress)), - (workInProgress = mountSuspensePrimaryChildren( - workInProgress, - JSCompiler_object_inline_stack_2334.children - )), - (workInProgress.flags |= 4096)); - return workInProgress; } - if (JSCompiler_object_inline_message_2332) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2332 = - JSCompiler_object_inline_stack_2334.fallback), - (JSCompiler_object_inline_digest_2333 = workInProgress.mode), - (JSCompiler_temp = current.child), - (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2334 = createWorkInProgress( - JSCompiler_temp, - { - mode: "hidden", - children: JSCompiler_object_inline_stack_2334.children - } - )), - (JSCompiler_object_inline_stack_2334.subtreeFlags = - JSCompiler_temp.subtreeFlags & 31457280), - null !== instance - ? (JSCompiler_object_inline_message_2332 = createWorkInProgress( - instance, - JSCompiler_object_inline_message_2332 - )) - : ((JSCompiler_object_inline_message_2332 = createFiberFromFragment( - JSCompiler_object_inline_message_2332, - JSCompiler_object_inline_digest_2333, - renderLanes, - null - )), - (JSCompiler_object_inline_message_2332.flags |= 2)), - (JSCompiler_object_inline_message_2332.return = workInProgress), - (JSCompiler_object_inline_stack_2334.return = workInProgress), - (JSCompiler_object_inline_stack_2334.sibling = - JSCompiler_object_inline_message_2332), - (workInProgress.child = JSCompiler_object_inline_stack_2334), - (JSCompiler_object_inline_stack_2334 = - JSCompiler_object_inline_message_2332), - (JSCompiler_object_inline_message_2332 = workInProgress.child), - (JSCompiler_object_inline_digest_2333 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2333 - ? (JSCompiler_object_inline_digest_2333 = - mountSuspenseOffscreenState(renderLanes)) - : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2333.cachePool), - null !== JSCompiler_temp - ? ((instance = CacheContext._currentValue), - (JSCompiler_temp = - JSCompiler_temp.parent !== instance - ? { parent: instance, pool: instance } - : JSCompiler_temp)) - : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2333 = { - baseLanes: - JSCompiler_object_inline_digest_2333.baseLanes | renderLanes, - cachePool: JSCompiler_temp - })), - (JSCompiler_object_inline_message_2332.memoizedState = - JSCompiler_object_inline_digest_2333), - (JSCompiler_object_inline_message_2332.childLanes = - getRemainingWorkInPrimaryTree( + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + function updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if (null !== current) { + var prevProps = current.memoizedProps; + if ( + shallowEqual(prevProps, nextProps) && + current.ref === workInProgress.ref && + workInProgress.type === current.type + ) + if ( + ((didReceiveUpdate = !1), + (workInProgress.pendingProps = nextProps = prevProps), + checkScheduledUpdateOrContext(current, renderLanes)) + ) + 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + else + return ( + (workInProgress.lanes = current.lanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + } + return updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ); + } + function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + nextIsDetached = + 0 !== + (workInProgress.stateNode._pendingVisibility & OffscreenDetached), + prevState = null !== current ? current.memoizedState : null; + markRef(current, workInProgress); + if ("hidden" === nextProps.mode || nextIsDetached) { + if (0 !== (workInProgress.flags & 128)) { + nextProps = + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes; + if (null !== current) { + nextChildren = workInProgress.child = current.child; + for (nextIsDetached = 0; null !== nextChildren; ) + (nextIsDetached = + nextIsDetached | nextChildren.lanes | nextChildren.childLanes), + (nextChildren = nextChildren.sibling); + workInProgress.childLanes = nextIsDetached & ~nextProps; + } else (workInProgress.childLanes = 0), (workInProgress.child = null); + return deferHiddenOffscreenComponent( + current, + workInProgress, + nextProps, + renderLanes + ); + } + if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); + else + return ( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( current, - JSCompiler_object_inline_componentStack_2335, + workInProgress, + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2334 - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { - mode: "visible", - children: JSCompiler_object_inline_stack_2334.children - }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; - null !== current && - ((JSCompiler_object_inline_componentStack_2335 = - workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2335 - ? ((workInProgress.deletions = [current]), - (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2335.push(current)); - workInProgress.child = renderLanes; - workInProgress.memoizedState = null; - return renderLanes; - } - function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: primaryChildren }, - workInProgress.mode - ); - primaryChildren.return = workInProgress; - return (workInProgress.child = primaryChildren); + ) + ); + } else + null !== prevState + ? (pushTransition(workInProgress, prevState.cachePool), + pushHiddenContext(workInProgress, prevState), + reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.memoizedState = null)) + : (null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(workInProgress), + reuseSuspenseHandlerOnStack(workInProgress)); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; } - function mountSuspenseFallbackChildren( + function deferHiddenOffscreenComponent( + current, workInProgress, - primaryChildren, - fallbackChildren, + nextBaseLanes, renderLanes ) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); - fallbackChildren = createFiberFromFragment( - fallbackChildren, - mode, - renderLanes, - null - ); - primaryChildren.return = workInProgress; - fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; - return fallbackChildren; + var JSCompiler_inline_result = peekCacheFromPool(); + JSCompiler_inline_result = + null === JSCompiler_inline_result + ? null + : { + parent: CacheContext._currentValue, + pool: JSCompiler_inline_result + }; + workInProgress.memoizedState = { + baseLanes: nextBaseLanes, + cachePool: JSCompiler_inline_result + }; + null !== current && pushTransition(workInProgress, null); + reuseHiddenContextOnStack(workInProgress); + pushOffscreenSuspenseHandler(workInProgress); + null !== current && + propagateParentContextChanges(current, workInProgress, renderLanes, !0); + return null; } - function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); + function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + ); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } } - function retrySuspenseComponentWithoutHydrating( + function updateFunctionComponent( current, workInProgress, + Component, + nextProps, renderLanes ) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountSuspensePrimaryChildren( + if ( + Component.prototype && + "function" === typeof Component.prototype.render + ) { + var componentName = getComponentNameFromType(Component) || "Unknown"; + didWarnAboutBadClass[componentName] || + (console.error( + "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", + componentName, + componentName + ), + (didWarnAboutBadClass[componentName] = !0)); + } + workInProgress.mode & StrictLegacyMode && + ReactStrictModeWarnings.recordLegacyContextWarning( + workInProgress, + null + ); + null === current && + (validateFunctionComponentInDev(workInProgress, workInProgress.type), + Component.contextTypes && + ((componentName = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), + console.error( + "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", + componentName + )))); + prepareToReadContext(workInProgress); + Component = renderWithHooks( + current, workInProgress, - workInProgress.pendingProps.children - ); - current.flags |= 2; - workInProgress.memoizedState = null; - return current; - } - function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { - fiber.lanes |= renderLanes; - var alternate = fiber.alternate; - null !== alternate && (alternate.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - propagationRoot + Component, + nextProps, + void 0, + renderLanes ); + nextProps = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && nextProps && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; } - function validateSuspenseListNestedChild(childSlot, index) { - var isAnArray = isArrayImpl(childSlot); - childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot); - return isAnArray || childSlot - ? ((isAnArray = isAnArray ? "array" : "iterable"), - console.error( - "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", - isAnArray, - index, - isAnArray - ), - !1) - : !0; - } - function initSuspenseListRenderState( + function replayFunctionComponent( + current, workInProgress, - isBackwards, - tail, - lastContentRow, - tailMode + nextProps, + Component, + secondArg, + renderLanes ) { - var renderState = workInProgress.memoizedState; - null === renderState - ? (workInProgress.memoizedState = { - isBackwards: isBackwards, - rendering: null, - renderingStartTime: 0, - last: lastContentRow, - tail: tail, - tailMode: tailMode - }) - : ((renderState.isBackwards = isBackwards), - (renderState.rendering = null), - (renderState.renderingStartTime = 0), - (renderState.last = lastContentRow), - (renderState.tail = tail), - (renderState.tailMode = tailMode)); + prepareToReadContext(workInProgress); + hookTypesUpdateIndexDev = -1; + ignorePreviousDependencies = + null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; + nextProps = renderWithHooksAgain( + workInProgress, + Component, + nextProps, + secondArg + ); + finishRenderingHooks(current, workInProgress); + Component = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && Component && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; } - function updateSuspenseListComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - revealOrder = nextProps.revealOrder, - tailMode = nextProps.tail; - nextProps = nextProps.children; - if ( - void 0 !== revealOrder && - "forwards" !== revealOrder && - "backwards" !== revealOrder && - "together" !== revealOrder && - !didWarnAboutRevealOrder[revealOrder] - ) + function updateClassComponent( + current$jscomp$0, + workInProgress, + Component, + nextProps, + renderLanes + ) { + switch (shouldErrorImpl(workInProgress)) { + case !1: + var _instance = workInProgress.stateNode, + state = new workInProgress.type( + workInProgress.memoizedProps, + _instance.context + ).state; + _instance.updater.enqueueSetState(_instance, state, null); + break; + case !0: + workInProgress.flags |= 128; + workInProgress.flags |= 65536; + _instance = Error("Simulated error coming from DevTools"); + var lane = renderLanes & -renderLanes; + workInProgress.lanes |= lane; + state = workInProgressRoot; + if (null === state) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + lane = createClassErrorUpdate(lane); + initializeClassErrorUpdate( + lane, + state, + workInProgress, + createCapturedValueAtFiber(_instance, workInProgress) + ); + enqueueCapturedUpdate(workInProgress, lane); + } + prepareToReadContext(workInProgress); + if (null === workInProgress.stateNode) { + state = emptyContextObject; + _instance = Component.contextType; + "contextType" in Component && + null !== _instance && + (void 0 === _instance || _instance.$$typeof !== REACT_CONTEXT_TYPE) && + !didWarnAboutInvalidateContextType.has(Component) && + (didWarnAboutInvalidateContextType.add(Component), + (lane = + void 0 === _instance + ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." + : "object" !== typeof _instance + ? " However, it is set to a " + typeof _instance + "." + : _instance.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(_instance).join(", ") + + "}."), + console.error( + "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", + getComponentNameFromType(Component) || "Component", + lane + )); + "object" === typeof _instance && + null !== _instance && + (state = readContext(_instance)); + _instance = new Component(nextProps, state); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + _instance = new Component(nextProps, state); + } finally { + setIsStrictModeForDevtools(!1); + } + } + state = workInProgress.memoizedState = + null !== _instance.state && void 0 !== _instance.state + ? _instance.state + : null; + _instance.updater = classComponentUpdater; + workInProgress.stateNode = _instance; + _instance._reactInternals = workInProgress; + _instance._reactInternalInstance = fakeInternalInstance; + "function" === typeof Component.getDerivedStateFromProps && + null === state && + ((state = getComponentNameFromType(Component) || "Component"), + didWarnAboutUninitializedState.has(state) || + (didWarnAboutUninitializedState.add(state), + console.error( + "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", + state, + null === _instance.state ? "null" : "undefined", + state + ))); if ( - ((didWarnAboutRevealOrder[revealOrder] = !0), - "string" === typeof revealOrder) - ) - switch (revealOrder.toLowerCase()) { - case "together": - case "forwards": - case "backwards": - console.error( - '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.', - revealOrder, - revealOrder.toLowerCase() - ); - break; - case "forward": - case "backward": - console.error( - '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.', - revealOrder, - revealOrder.toLowerCase() - ); - break; - default: + "function" === typeof Component.getDerivedStateFromProps || + "function" === typeof _instance.getSnapshotBeforeUpdate + ) { + var foundWillUpdateName = (lane = state = null); + "function" === typeof _instance.componentWillMount && + !0 !== _instance.componentWillMount.__suppressDeprecationWarning + ? (state = "componentWillMount") + : "function" === typeof _instance.UNSAFE_componentWillMount && + (state = "UNSAFE_componentWillMount"); + "function" === typeof _instance.componentWillReceiveProps && + !0 !== + _instance.componentWillReceiveProps.__suppressDeprecationWarning + ? (lane = "componentWillReceiveProps") + : "function" === + typeof _instance.UNSAFE_componentWillReceiveProps && + (lane = "UNSAFE_componentWillReceiveProps"); + "function" === typeof _instance.componentWillUpdate && + !0 !== _instance.componentWillUpdate.__suppressDeprecationWarning + ? (foundWillUpdateName = "componentWillUpdate") + : "function" === typeof _instance.UNSAFE_componentWillUpdate && + (foundWillUpdateName = "UNSAFE_componentWillUpdate"); + if (null !== state || null !== lane || null !== foundWillUpdateName) { + _instance = getComponentNameFromType(Component) || "Component"; + var newApiName = + "function" === typeof Component.getDerivedStateFromProps + ? "getDerivedStateFromProps()" + : "getSnapshotBeforeUpdate()"; + didWarnAboutLegacyLifecyclesAndDerivedState.has(_instance) || + (didWarnAboutLegacyLifecyclesAndDerivedState.add(_instance), console.error( - '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?', - revealOrder - ); + "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", + _instance, + newApiName, + null !== state ? "\n " + state : "", + null !== lane ? "\n " + lane : "", + null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" + )); } - else + } + _instance = workInProgress.stateNode; + state = getComponentNameFromType(Component) || "Component"; + _instance.render || + (Component.prototype && + "function" === typeof Component.prototype.render + ? console.error( + "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", + state + ) + : console.error( + "No `render` method found on the %s instance: you may have forgotten to define `render`.", + state + )); + !_instance.getInitialState || + _instance.getInitialState.isReactClassApproved || + _instance.state || console.error( - '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?', - revealOrder + "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", + state ); - void 0 === tailMode || - didWarnAboutTailOptions[tailMode] || - ("collapsed" !== tailMode && "hidden" !== tailMode - ? ((didWarnAboutTailOptions[tailMode] = !0), - console.error( - '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?', - tailMode - )) - : "forwards" !== revealOrder && - "backwards" !== revealOrder && - ((didWarnAboutTailOptions[tailMode] = !0), - console.error( - ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', - tailMode - ))); - a: if ( - ("forwards" === revealOrder || "backwards" === revealOrder) && - void 0 !== nextProps && - null !== nextProps && - !1 !== nextProps - ) - if (isArrayImpl(nextProps)) - for (var i = 0; i < nextProps.length; i++) { - if (!validateSuspenseListNestedChild(nextProps[i], i)) break a; - } - else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) { - if ((i = i.call(nextProps))) - for (var step = i.next(), _i = 0; !step.done; step = i.next()) { - if (!validateSuspenseListNestedChild(step.value, _i)) break a; - _i++; - } - } else + _instance.getDefaultProps && + !_instance.getDefaultProps.isReactClassApproved && console.error( - 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', - revealOrder + "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", + state + ); + _instance.contextType && + console.error( + "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", + state + ); + Component.childContextTypes && + !didWarnAboutChildContextTypes.has(Component) && + (didWarnAboutChildContextTypes.add(Component), + console.error( + "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)", + state + )); + Component.contextTypes && + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), + console.error( + "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", + state + )); + "function" === typeof _instance.componentShouldUpdate && + console.error( + "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", + state + ); + Component.prototype && + Component.prototype.isPureReactComponent && + "undefined" !== typeof _instance.shouldComponentUpdate && + console.error( + "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", + getComponentNameFromType(Component) || "A pure component" ); - reconcileChildren(current, workInProgress, nextProps, renderLanes); - nextProps = suspenseStackCursor.current; - if (0 !== (nextProps & ForceSuspenseFallback)) - (nextProps = - (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback), - (workInProgress.flags |= 128); - else { - if (null !== current && 0 !== (current.flags & 128)) - a: for (current = workInProgress.child; null !== current; ) { - if (13 === current.tag) - null !== current.memoizedState && - scheduleSuspenseWorkOnFiber( - current, - renderLanes, - workInProgress - ); - else if (19 === current.tag) - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (null !== current.child) { - current.child.return = current; - current = current.child; - continue; - } - if (current === workInProgress) break a; - for (; null === current.sibling; ) { - if (null === current.return || current.return === workInProgress) - break a; - current = current.return; - } - current.sibling.return = current.return; - current = current.sibling; - } - nextProps &= SubtreeSuspenseContextMask; - } - push(suspenseStackCursor, nextProps, workInProgress); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode + "function" === typeof _instance.componentDidUnmount && + console.error( + "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", + state ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode + "function" === typeof _instance.componentDidReceiveProps && + console.error( + "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", + state ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } - return workInProgress.child; - } - function bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ) { - null !== current && (workInProgress.dependencies = current.dependencies); - profilerStartTime = -1; - workInProgressRootSkippedLanes |= workInProgress.lanes; - if (0 === (renderLanes & workInProgress.childLanes)) - if (null !== current) { - if ( - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - 0 === (renderLanes & workInProgress.childLanes)) - ) - return null; - } else return null; - if (null !== current && workInProgress.child !== current.child) - throw Error("Resuming work not yet implemented."); - if (null !== workInProgress.child) { - current = workInProgress.child; - renderLanes = createWorkInProgress(current, current.pendingProps); - workInProgress.child = renderLanes; - for (renderLanes.return = workInProgress; null !== current.sibling; ) - (current = current.sibling), - (renderLanes = renderLanes.sibling = - createWorkInProgress(current, current.pendingProps)), - (renderLanes.return = workInProgress); - renderLanes.sibling = null; - } - return workInProgress.child; - } - function checkScheduledUpdateOrContext(current, renderLanes) { - if (0 !== (current.lanes & renderLanes)) return !0; - current = current.dependencies; - return null !== current && checkIfContextChanged(current) ? !0 : !1; - } - function attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) { - switch (workInProgress.tag) { - case 3: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo + "function" === typeof _instance.componentWillRecieveProps && + console.error( + "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", + state ); - pushProvider( - workInProgress, - CacheContext, - current.memoizedState.cache + "function" === typeof _instance.UNSAFE_componentWillRecieveProps && + console.error( + "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", + state ); - resetHydrationState(); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 4: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo + lane = _instance.props !== nextProps; + void 0 !== _instance.props && + lane && + console.error( + "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", + state ); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value + _instance.defaultProps && + console.error( + "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", + state, + state ); - break; - case 12: - 0 !== (renderLanes & workInProgress.childLanes) && - (workInProgress.flags |= 4); - workInProgress.flags |= 2048; - var stateNode = workInProgress.stateNode; - stateNode.effectDuration = -0; - stateNode.passiveEffectDuration = -0; - break; - case 13: - stateNode = workInProgress.memoizedState; - if (null !== stateNode) { - if (null !== stateNode.dehydrated) - return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - if (0 !== (renderLanes & workInProgress.child.childLanes)) - return updateSuspenseComponent( - current, - workInProgress, - renderLanes - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - current = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - return null !== current ? current.sibling : null; - } - pushPrimaryTreeSuspenseHandler(workInProgress); - break; - case 19: - var didSuspendBefore = 0 !== (current.flags & 128); - stateNode = 0 !== (renderLanes & workInProgress.childLanes); - stateNode || - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); - if (didSuspendBefore) { - if (stateNode) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - workInProgress.flags |= 128; - } - didSuspendBefore = workInProgress.memoizedState; - null !== didSuspendBefore && - ((didSuspendBefore.rendering = null), - (didSuspendBefore.tail = null), - (didSuspendBefore.lastEffect = null)); - push( - suspenseStackCursor, - suspenseStackCursor.current, - workInProgress + "function" !== typeof _instance.getSnapshotBeforeUpdate || + "function" === typeof _instance.componentDidUpdate || + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) || + (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component), + console.error( + "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", + getComponentNameFromType(Component) + )); + "function" === typeof _instance.getDerivedStateFromProps && + console.error( + "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + state ); - if (stateNode) break; - else return null; - case 22: - case 23: - return ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) + "function" === typeof _instance.getDerivedStateFromError && + console.error( + "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + state ); - case 24: - pushProvider( + "function" === typeof Component.getSnapshotBeforeUpdate && + console.error( + "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", + state + ); + (lane = _instance.state) && + ("object" !== typeof lane || isArrayImpl(lane)) && + console.error("%s.state: must be set to an object or null", state); + "function" === typeof _instance.getChildContext && + "object" !== typeof Component.childContextTypes && + console.error( + "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", + state + ); + _instance = workInProgress.stateNode; + _instance.props = nextProps; + _instance.state = workInProgress.memoizedState; + _instance.refs = {}; + initializeUpdateQueue(workInProgress); + state = Component.contextType; + _instance.context = + "object" === typeof state && null !== state + ? readContext(state) + : emptyContextObject; + _instance.state === nextProps && + ((state = getComponentNameFromType(Component) || "Component"), + didWarnAboutDirectlyAssigningPropsToState.has(state) || + (didWarnAboutDirectlyAssigningPropsToState.add(state), + console.error( + "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", + state + ))); + workInProgress.mode & StrictLegacyMode && + ReactStrictModeWarnings.recordLegacyContextWarning( workInProgress, - CacheContext, - current.memoizedState.cache + _instance ); - } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); - } - function beginWork(current, workInProgress, renderLanes) { - if (workInProgress._debugNeedsRemount && null !== current) { - renderLanes = createFiberFromTypeAndProps( - workInProgress.type, - workInProgress.key, - workInProgress.pendingProps, - workInProgress._debugOwner || null, - workInProgress.mode, - workInProgress.lanes + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( + workInProgress, + _instance ); - renderLanes._debugStack = workInProgress._debugStack; - renderLanes._debugTask = workInProgress._debugTask; - var returnFiber = workInProgress.return; - if (null === returnFiber) throw Error("Cannot swap the root fiber."); - current.alternate = null; - workInProgress.alternate = null; - renderLanes.index = workInProgress.index; - renderLanes.sibling = workInProgress.sibling; - renderLanes.return = workInProgress.return; - renderLanes.ref = workInProgress.ref; - renderLanes._debugInfo = workInProgress._debugInfo; - if (workInProgress === returnFiber.child) - returnFiber.child = renderLanes; - else { - var prevSibling = returnFiber.child; - if (null === prevSibling) - throw Error("Expected parent to have a child."); - for (; prevSibling.sibling !== workInProgress; ) - if (((prevSibling = prevSibling.sibling), null === prevSibling)) - throw Error("Expected to find the previous sibling."); - prevSibling.sibling = renderLanes; - } - workInProgress = returnFiber.deletions; - null === workInProgress - ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) - : workInProgress.push(current); - renderLanes.flags |= 2; - return renderLanes; - } - if (null !== current) - if ( - current.memoizedProps !== workInProgress.pendingProps || - workInProgress.type !== current.type - ) - didReceiveUpdate = !0; - else { - if ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) - ) - return ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) - ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; - } - else { - didReceiveUpdate = !1; - if ((returnFiber = isHydrating)) - warnIfNotHydrating(), - (returnFiber = 0 !== (workInProgress.flags & 1048576)); - returnFiber && - ((returnFiber = workInProgress.index), - warnIfNotHydrating(), - pushTreeId(workInProgress, treeForkCount, returnFiber)); - } - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 16: - a: if ( - ((returnFiber = workInProgress.pendingProps), - (current = callLazyInitInDEV(workInProgress.elementType)), - (workInProgress.type = current), - "function" === typeof current) - ) - shouldConstruct(current) - ? ((returnFiber = resolveClassComponentProps( - current, - returnFiber - )), - (workInProgress.tag = 1), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateClassComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))) - : ((workInProgress.tag = 0), - validateFunctionComponentInDev(workInProgress, current), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))); - else { - if (void 0 !== current && null !== current) - if ( - ((prevSibling = current.$$typeof), - prevSibling === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress.type = current = - resolveForwardRefForHotReloading(current); - workInProgress = updateForwardRef( - null, - workInProgress, - current, - returnFiber, - renderLanes - ); - break a; - } else if (prevSibling === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ); - break a; - } - workInProgress = ""; - null !== current && - "object" === typeof current && - current.$$typeof === REACT_LAZY_TYPE && - (workInProgress = - " Did you wrap a component in React.lazy() more than once?"); - current = getComponentNameFromType(current) || current; - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - current + - ". Lazy element type must resolve to a class or function." + - workInProgress - ); - } - return workInProgress; - case 0: - return updateFunctionComponent( - current, + _instance.state = workInProgress.memoizedState; + state = Component.getDerivedStateFromProps; + "function" === typeof state && + (applyDerivedStateFromProps( workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 1: - return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( - returnFiber, - workInProgress.pendingProps + Component, + state, + nextProps + ), + (_instance.state = workInProgress.memoizedState)); + "function" === typeof Component.getDerivedStateFromProps || + "function" === typeof _instance.getSnapshotBeforeUpdate || + ("function" !== typeof _instance.UNSAFE_componentWillMount && + "function" !== typeof _instance.componentWillMount) || + ((state = _instance.state), + "function" === typeof _instance.componentWillMount && + _instance.componentWillMount(), + "function" === typeof _instance.UNSAFE_componentWillMount && + _instance.UNSAFE_componentWillMount(), + state !== _instance.state && + (console.error( + "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + getComponentNameFromFiber(workInProgress) || "Component" + ), + classComponentUpdater.enqueueReplaceState( + _instance, + _instance.state, + null )), - updateClassComponent( - current, + processUpdateQueue(workInProgress, nextProps, _instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (_instance.state = workInProgress.memoizedState)); + "function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308); + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864); + _instance = !0; + } else if (null === current$jscomp$0) { + _instance = workInProgress.stateNode; + var unresolvedOldProps = workInProgress.memoizedProps; + lane = resolveClassComponentProps(Component, unresolvedOldProps); + _instance.props = lane; + var oldContext = _instance.context; + foundWillUpdateName = Component.contextType; + state = emptyContextObject; + "object" === typeof foundWillUpdateName && + null !== foundWillUpdateName && + (state = readContext(foundWillUpdateName)); + newApiName = Component.getDerivedStateFromProps; + foundWillUpdateName = + "function" === typeof newApiName || + "function" === typeof _instance.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + foundWillUpdateName || + ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof _instance.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== state) && + callComponentWillReceiveProps( workInProgress, - returnFiber, - prevSibling, - renderLanes - ) - ); - case 3: - a: { - pushHostContainer( + _instance, + nextProps, + state + )); + hasForceUpdate = !1; + var oldState = workInProgress.memoizedState; + _instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + oldContext = workInProgress.memoizedState; + unresolvedOldProps || oldState !== oldContext || hasForceUpdate + ? ("function" === typeof newApiName && + (applyDerivedStateFromProps( + workInProgress, + Component, + newApiName, + nextProps + ), + (oldContext = workInProgress.memoizedState)), + (lane = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + lane, + nextProps, + oldState, + oldContext, + state + )) + ? (foundWillUpdateName || + ("function" !== typeof _instance.UNSAFE_componentWillMount && + "function" !== typeof _instance.componentWillMount) || + ("function" === typeof _instance.componentWillMount && + _instance.componentWillMount(), + "function" === typeof _instance.UNSAFE_componentWillMount && + _instance.UNSAFE_componentWillMount()), + "function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864)) + : ("function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (_instance.props = nextProps), + (_instance.state = oldContext), + (_instance.context = state), + (_instance = lane)) + : ("function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864), + (_instance = !1)); + } else { + _instance = workInProgress.stateNode; + cloneUpdateQueue(current$jscomp$0, workInProgress); + state = workInProgress.memoizedProps; + foundWillUpdateName = resolveClassComponentProps(Component, state); + _instance.props = foundWillUpdateName; + newApiName = workInProgress.pendingProps; + oldState = _instance.context; + oldContext = Component.contextType; + lane = emptyContextObject; + "object" === typeof oldContext && + null !== oldContext && + (lane = readContext(oldContext)); + unresolvedOldProps = Component.getDerivedStateFromProps; + (oldContext = + "function" === typeof unresolvedOldProps || + "function" === typeof _instance.getSnapshotBeforeUpdate) || + ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof _instance.componentWillReceiveProps) || + ((state !== newApiName || oldState !== lane) && + callComponentWillReceiveProps( workInProgress, - workInProgress.stateNode.containerInfo - ); - if (null === current) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - var nextProps = workInProgress.pendingProps; - prevSibling = workInProgress.memoizedState; - returnFiber = prevSibling.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - var nextState = workInProgress.memoizedState; - nextProps = nextState.cache; - pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== prevSibling.cache && - propagateContextChanges( + _instance, + nextProps, + lane + )); + hasForceUpdate = !1; + oldState = workInProgress.memoizedState; + _instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + state !== newApiName || + oldState !== newState || + hasForceUpdate || + (null !== current$jscomp$0 && + null !== current$jscomp$0.dependencies && + checkIfContextChanged(current$jscomp$0.dependencies)) + ? ("function" === typeof unresolvedOldProps && + (applyDerivedStateFromProps( workInProgress, - [CacheContext], - renderLanes, - !0 - ); - suspendIfUpdateReadFromEntangledAsyncAction(); - nextProps = nextState.element; - if (prevSibling.isDehydrated) - if ( - ((prevSibling = { - element: nextProps, - isDehydrated: !1, - cache: nextState.cache - }), - (workInProgress.updateQueue.baseState = prevSibling), - (workInProgress.memoizedState = prevSibling), - workInProgress.flags & 256) - ) { - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else if (nextProps !== returnFiber) { - returnFiber = createCapturedValueAtFiber( - Error( - "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." - ), - workInProgress - ); - queueHydrationError(returnFiber); - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else + Component, + unresolvedOldProps, + nextProps + ), + (newState = workInProgress.memoizedState)), + (foundWillUpdateName = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + foundWillUpdateName, + nextProps, + oldState, + newState, + lane + ) || + (null !== current$jscomp$0 && + null !== current$jscomp$0.dependencies && + checkIfContextChanged(current$jscomp$0.dependencies))) + ? (oldContext || + ("function" !== typeof _instance.UNSAFE_componentWillUpdate && + "function" !== typeof _instance.componentWillUpdate) || + ("function" === typeof _instance.componentWillUpdate && + _instance.componentWillUpdate(nextProps, newState, lane), + "function" === typeof _instance.UNSAFE_componentWillUpdate && + _instance.UNSAFE_componentWillUpdate( + nextProps, + newState, + lane + )), + "function" === typeof _instance.componentDidUpdate && + (workInProgress.flags |= 4), + "function" === typeof _instance.getSnapshotBeforeUpdate && + (workInProgress.flags |= 1024)) + : ("function" !== typeof _instance.componentDidUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof _instance.getSnapshotBeforeUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 1024), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = newState)), + (_instance.props = nextProps), + (_instance.state = newState), + (_instance.context = lane), + (_instance = foundWillUpdateName)) + : ("function" !== typeof _instance.componentDidUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof _instance.getSnapshotBeforeUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 1024), + (_instance = !1)); + } + lane = _instance; + markRef(current$jscomp$0, workInProgress); + state = 0 !== (workInProgress.flags & 128); + if (lane || state) { + lane = workInProgress.stateNode; + ReactSharedInternals.getCurrentStack = + null === workInProgress ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = workInProgress; + if (state && "function" !== typeof Component.getDerivedStateFromError) + (Component = null), (profilerStartTime = -1); + else if ( + ((Component = callRenderInDEV(lane)), + workInProgress.mode & StrictLegacyMode) + ) { + setIsStrictModeForDevtools(!0); + try { + callRenderInDEV(lane); + } finally { + setIsStrictModeForDevtools(!1); + } + } + workInProgress.flags |= 1; + null !== current$jscomp$0 && state + ? ((workInProgress.child = reconcileChildFibers( + workInProgress, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + Component, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + Component, + renderLanes + ); + workInProgress.memoizedState = lane.state; + current$jscomp$0 = workInProgress.child; + } else + current$jscomp$0 = bailoutOnAlreadyFinishedWork( + current$jscomp$0, + workInProgress, + renderLanes + ); + renderLanes = workInProgress.stateNode; + _instance && + renderLanes.props !== nextProps && + (didWarnAboutReassigningProps || + console.error( + "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", + getComponentNameFromFiber(workInProgress) || "a component" + ), + (didWarnAboutReassigningProps = !0)); + return current$jscomp$0; + } + function mountHostRootWithoutHydrating( + current, + workInProgress, + nextChildren, + renderLanes + ) { + resetHydrationState(); + workInProgress.flags |= 256; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function validateFunctionComponentInDev(workInProgress, Component) { + Component && + Component.childContextTypes && + console.error( + "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", + Component.displayName || Component.name || "Component" + ); + "function" === typeof Component.getDerivedStateFromProps && + ((workInProgress = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] || + (console.error( + "%s: Function components do not support getDerivedStateFromProps.", + workInProgress + ), + (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] = + !0))); + "object" === typeof Component.contextType && + null !== Component.contextType && + ((Component = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypeOnFunctionComponent[Component] || + (console.error( + "%s: Function components do not support contextType.", + Component + ), + (didWarnAboutContextTypeOnFunctionComponent[Component] = !0))); + } + function mountSuspenseOffscreenState(renderLanes) { + return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; + } + function getRemainingWorkInPrimaryTree( + current, + primaryTreeDidDefer, + renderLanes + ) { + current = null !== current ? current.childLanes & ~renderLanes : 0; + primaryTreeDidDefer && (current |= workInProgressDeferredLane); + return current; + } + function updateSuspenseComponent(current, workInProgress, renderLanes) { + var JSCompiler_object_inline_componentStack_2430; + var JSCompiler_object_inline_stack_2429 = workInProgress.pendingProps; + shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); + var JSCompiler_object_inline_message_2427 = !1; + var didSuspend = 0 !== (workInProgress.flags & 128); + (JSCompiler_object_inline_componentStack_2430 = didSuspend) || + (JSCompiler_object_inline_componentStack_2430 = + null !== current && null === current.memoizedState + ? !1 + : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); + JSCompiler_object_inline_componentStack_2430 && + ((JSCompiler_object_inline_message_2427 = !0), + (workInProgress.flags &= -129)); + JSCompiler_object_inline_componentStack_2430 = + 0 !== (workInProgress.flags & 32); + workInProgress.flags &= -33; + if (null === current) { + if (isHydrating) { + JSCompiler_object_inline_message_2427 + ? pushPrimaryTreeSuspenseHandler(workInProgress) + : reuseSuspenseHandlerOnStack(workInProgress); + if (isHydrating) { + var JSCompiler_object_inline_digest_2428 = nextHydratableInstance; + var JSCompiler_temp; + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2428)) { + c: { + var instance = JSCompiler_object_inline_digest_2428; for ( - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ), - hydrationParentFiber = workInProgress, - isHydrating = !0, - hydrationErrors = null, - didSuspendOrErrorDEV = !1, - hydrationDiffRootDEV = null, - rootOrSingletonContext = !0, - current = mountChildFibers( - workInProgress, - null, - nextProps, - renderLanes - ), - workInProgress.child = current; - current; + JSCompiler_temp = rootOrSingletonContext; + 8 !== instance.nodeType; - ) - (current.flags = (current.flags & -3) | 4096), - (current = current.sibling); - else { - resetHydrationState(); - if (nextProps === returnFiber) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; + ) { + if (!JSCompiler_temp) { + JSCompiler_temp = null; + break c; + } + instance = getNextHydratable(instance.nextSibling); + if (null === instance) { + JSCompiler_temp = null; + break c; + } + } + JSCompiler_temp = instance; } - reconcileChildren( - current, - workInProgress, - nextProps, - renderLanes - ); - } - workInProgress = workInProgress.child; - } - return workInProgress; - case 26: - return ( - markRef(current, workInProgress), - null === current - ? (current = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - )) - ? (workInProgress.memoizedState = current) - : isHydrating || - ((current = workInProgress.type), - (renderLanes = workInProgress.pendingProps), - (returnFiber = requiredContext( - rootInstanceStackCursor.current - )), - (returnFiber = - getOwnerDocumentFromRootContainer( - returnFiber - ).createElement(current)), - (returnFiber[internalInstanceKey] = workInProgress), - (returnFiber[internalPropsKey] = renderLanes), - setInitialProperties(returnFiber, current, renderLanes), - markNodeAsHoistable(returnFiber), - (workInProgress.stateNode = returnFiber)) - : (workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - )), - null - ); - case 27: - return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((prevSibling = requiredContext(rootInstanceStackCursor.current)), - (returnFiber = getHostContext()), - (prevSibling = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - prevSibling, - returnFiber, - !1 - )), - didSuspendOrErrorDEV || - ((returnFiber = diffHydratedProperties( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - returnFiber - )), - null !== returnFiber && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - returnFiber)), - (hydrationParentFiber = workInProgress), - (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable( - prevSibling.firstChild - ))), - (returnFiber = workInProgress.pendingProps.children), - null !== current || isHydrating - ? reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ) - : (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - returnFiber, - renderLanes - )), - markRef(current, workInProgress), - workInProgress.child - ); - case 5: + null !== JSCompiler_temp + ? (warnIfNotHydrating(), + (workInProgress.memoizedState = { + dehydrated: JSCompiler_temp, + treeContext: + null !== treeContextProvider + ? { id: treeContextId, overflow: treeContextOverflow } + : null, + retryLane: 536870912 + }), + (instance = createFiber(18, null, null, NoMode)), + (instance.stateNode = JSCompiler_temp), + (instance.return = workInProgress), + (workInProgress.child = instance), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (JSCompiler_temp = !0)) + : (JSCompiler_temp = !1); + JSCompiler_temp = !JSCompiler_temp; + } + JSCompiler_temp && + (warnNonHydratedInstance( + workInProgress, + JSCompiler_object_inline_digest_2428 + ), + throwOnHydrationMismatch(workInProgress)); + } + JSCompiler_object_inline_digest_2428 = workInProgress.memoizedState; + if ( + null !== JSCompiler_object_inline_digest_2428 && + ((JSCompiler_object_inline_digest_2428 = + JSCompiler_object_inline_digest_2428.dehydrated), + null !== JSCompiler_object_inline_digest_2428) + ) + return ( + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2428) + ? (workInProgress.lanes = 32) + : (workInProgress.lanes = 536870912), + null + ); + popSuspenseHandler(workInProgress); + } + JSCompiler_object_inline_digest_2428 = + JSCompiler_object_inline_stack_2429.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2429.fallback; + if (JSCompiler_object_inline_message_2427) return ( - null === current && - isHydrating && - ((nextProps = getHostContext()), - (returnFiber = validateDOMNesting( - workInProgress.type, - nextProps.ancestorInfo + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_stack_2429 = + mountSuspenseFallbackChildren( + workInProgress, + JSCompiler_object_inline_digest_2428, + JSCompiler_temp, + renderLanes )), - (prevSibling = nextHydratableInstance), - (nextState = !prevSibling) || - ((nextState = canHydrateInstance( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== nextState - ? ((workInProgress.stateNode = nextState), - didSuspendOrErrorDEV || - ((nextProps = diffHydratedProperties( - nextState, - workInProgress.type, - workInProgress.pendingProps, - nextProps - )), - null !== nextProps && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - nextProps)), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = getNextHydratable( - nextState.firstChild - )), - (rootOrSingletonContext = !1), - (nextProps = !0)) - : (nextProps = !1), - (nextState = !nextProps)), - nextState && - (returnFiber && - warnNonHydratedInstance(workInProgress, prevSibling), - throwOnHydrationMismatch(workInProgress))), - pushHostContext(workInProgress), - (prevSibling = workInProgress.type), - (nextProps = workInProgress.pendingProps), - (nextState = null !== current ? current.memoizedProps : null), - (returnFiber = nextProps.children), - shouldSetTextContent(prevSibling, nextProps) - ? (returnFiber = null) - : null !== nextState && - shouldSetTextContent(prevSibling, nextState) && - (workInProgress.flags |= 32), - null !== workInProgress.memoizedState && - ((prevSibling = renderWithHooks( + (JSCompiler_object_inline_message_2427 = workInProgress.child), + (JSCompiler_object_inline_message_2427.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_message_2427.childLanes = + getRemainingWorkInPrimaryTree( current, - workInProgress, - TransitionAwareHostComponent, - null, - null, + JSCompiler_object_inline_componentStack_2430, renderLanes )), - (HostTransitionContext._currentValue = prevSibling)), - markRef(current, workInProgress), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child + (workInProgress.memoizedState = SUSPENDED_MARKER), + JSCompiler_object_inline_stack_2429 ); - case 6: + if ( + "number" === + typeof JSCompiler_object_inline_stack_2429.unstable_expectedLoadTime + ) return ( - null === current && - isHydrating && - ((current = workInProgress.pendingProps), - (renderLanes = getHostContext().ancestorInfo.current), - (current = - null != renderLanes - ? validateTextNesting(current, renderLanes.tag) - : !0), - (renderLanes = nextHydratableInstance), - (returnFiber = !renderLanes) || - ((returnFiber = canHydrateTextInstance( - renderLanes, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== returnFiber - ? ((workInProgress.stateNode = returnFiber), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (returnFiber = !0)) - : (returnFiber = !1), - (returnFiber = !returnFiber)), - returnFiber && - (current && - warnNonHydratedInstance(workInProgress, renderLanes), - throwOnHydrationMismatch(workInProgress))), - null + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_stack_2429 = + mountSuspenseFallbackChildren( + workInProgress, + JSCompiler_object_inline_digest_2428, + JSCompiler_temp, + renderLanes + )), + (JSCompiler_object_inline_message_2427 = workInProgress.child), + (JSCompiler_object_inline_message_2427.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_message_2427.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_componentStack_2430, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress.lanes = 4194304), + JSCompiler_object_inline_stack_2429 ); - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ), - (returnFiber = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren( + workInProgress, + JSCompiler_object_inline_digest_2428 + ); + } + var prevState = current.memoizedState; + if ( + null !== prevState && + ((JSCompiler_object_inline_digest_2428 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2428) + ) { + if (didSuspend) + workInProgress.flags & 256 + ? (pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags &= -257), + (workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ))) + : null !== workInProgress.memoizedState + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_message_2427 = + JSCompiler_object_inline_stack_2429.fallback), + (JSCompiler_object_inline_digest_2428 = workInProgress.mode), + (JSCompiler_object_inline_stack_2429 = + mountWorkInProgressOffscreenFiber( + { + mode: "visible", + children: JSCompiler_object_inline_stack_2429.children + }, + JSCompiler_object_inline_digest_2428 + )), + (JSCompiler_object_inline_message_2427 = + createFiberFromFragment( + JSCompiler_object_inline_message_2427, + JSCompiler_object_inline_digest_2428, + renderLanes, + null + )), + (JSCompiler_object_inline_message_2427.flags |= 2), + (JSCompiler_object_inline_stack_2429.return = workInProgress), + (JSCompiler_object_inline_message_2427.return = workInProgress), + (JSCompiler_object_inline_stack_2429.sibling = + JSCompiler_object_inline_message_2427), + (workInProgress.child = JSCompiler_object_inline_stack_2429), + reconcileChildFibers( workInProgress, + current.child, null, - returnFiber, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - returnFiber, renderLanes ), - workInProgress.child - ); - case 11: - return updateForwardRef( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 7: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child - ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 12: - return ( - (workInProgress.flags |= 4), - (workInProgress.flags |= 2048), - (returnFiber = workInProgress.stateNode), - (returnFiber.effectDuration = -0), - (returnFiber.passiveEffectDuration = -0), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 10: - return ( - (returnFiber = workInProgress.type), - (prevSibling = workInProgress.pendingProps), - (nextProps = prevSibling.value), - "value" in prevSibling || - hasWarnedAboutUsingNoValuePropOnContextProvider || - ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), - console.error( - "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" - )), - pushProvider(workInProgress, returnFiber, nextProps), - reconcileChildren( - current, - workInProgress, - prevSibling.children, - renderLanes + (JSCompiler_object_inline_stack_2429 = workInProgress.child), + (JSCompiler_object_inline_stack_2429.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_stack_2429.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_componentStack_2430, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = JSCompiler_object_inline_message_2427)); + else if ( + (pushPrimaryTreeSuspenseHandler(workInProgress), + isHydrating && + console.error( + "We should not be hydrating here. This is a bug in React. Please file a bug." ), - workInProgress.child - ); - case 9: - return ( - (prevSibling = workInProgress.type._context), - (returnFiber = workInProgress.pendingProps.children), - "function" !== typeof returnFiber && - console.error( - "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2428)) + ) { + JSCompiler_object_inline_componentStack_2430 = + JSCompiler_object_inline_digest_2428.nextSibling && + JSCompiler_object_inline_digest_2428.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2430) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2430.dgst; + var message = JSCompiler_object_inline_componentStack_2430.msg; + instance = JSCompiler_object_inline_componentStack_2430.stck; + var componentStack = + JSCompiler_object_inline_componentStack_2430.cstck; + } + JSCompiler_object_inline_message_2427 = message; + JSCompiler_object_inline_digest_2428 = JSCompiler_temp; + JSCompiler_object_inline_stack_2429 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2430 = + componentStack; + "POSTPONE" !== JSCompiler_object_inline_digest_2428 && + ((JSCompiler_object_inline_componentStack_2430 = + JSCompiler_object_inline_message_2427 + ? Error(JSCompiler_object_inline_message_2427) + : Error( + "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." + )), + (JSCompiler_object_inline_componentStack_2430.stack = + JSCompiler_object_inline_stack_2429 || ""), + (JSCompiler_object_inline_componentStack_2430.digest = + JSCompiler_object_inline_digest_2428), + (JSCompiler_object_inline_stack_2429 = + void 0 === JSCompiler_temp ? null : JSCompiler_temp), + (JSCompiler_object_inline_message_2427 = { + value: JSCompiler_object_inline_componentStack_2430, + source: null, + stack: JSCompiler_object_inline_stack_2429 + }), + "string" === typeof JSCompiler_object_inline_stack_2429 && + CapturedStacks.set( + JSCompiler_object_inline_componentStack_2430, + JSCompiler_object_inline_message_2427 ), - prepareToReadContext(workInProgress), - (prevSibling = readContext(prevSibling)), - (returnFiber = callComponentInDEV( - returnFiber, - prevSibling, - void 0 - )), - (workInProgress.flags |= 1), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 15: - return updateSimpleMemoComponent( + queueHydrationError(JSCompiler_object_inline_message_2427)); + workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, - workInProgress.type, - workInProgress.pendingProps, renderLanes ); - case 19: - return updateSuspenseListComponent( + } else if ( + (didReceiveUpdate || + propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (JSCompiler_object_inline_componentStack_2430 = + 0 !== (renderLanes & current.childLanes)), + didReceiveUpdate || JSCompiler_object_inline_componentStack_2430) + ) { + JSCompiler_object_inline_componentStack_2430 = workInProgressRoot; + if ( + null !== JSCompiler_object_inline_componentStack_2430 && + ((JSCompiler_object_inline_stack_2429 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2429 = + 0 !== (JSCompiler_object_inline_stack_2429 & 42) + ? 1 + : getBumpedLaneForHydrationByLane( + JSCompiler_object_inline_stack_2429 + )), + (JSCompiler_object_inline_stack_2429 = + 0 !== + (JSCompiler_object_inline_stack_2429 & + (JSCompiler_object_inline_componentStack_2430.suspendedLanes | + renderLanes)) + ? 0 + : JSCompiler_object_inline_stack_2429), + 0 !== JSCompiler_object_inline_stack_2429 && + JSCompiler_object_inline_stack_2429 !== prevState.retryLane) + ) + throw ( + ((prevState.retryLane = JSCompiler_object_inline_stack_2429), + enqueueConcurrentRenderForLane( + current, + JSCompiler_object_inline_stack_2429 + ), + scheduleUpdateOnFiber( + JSCompiler_object_inline_componentStack_2430, + current, + JSCompiler_object_inline_stack_2429 + ), + SelectiveHydrationException) + ); + JSCompiler_object_inline_digest_2428.data === + SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); + workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, renderLanes ); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (returnFiber = readContext(CacheContext)), - null === current - ? ((prevSibling = peekCacheFromPool()), - null === prevSibling && - ((prevSibling = workInProgressRoot), - (nextProps = createCache()), - (prevSibling.pooledCache = nextProps), - retainCache(nextProps), - null !== nextProps && - (prevSibling.pooledCacheLanes |= renderLanes), - (prevSibling = nextProps)), - (workInProgress.memoizedState = { - parent: returnFiber, - cache: prevSibling - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, prevSibling)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (prevSibling = current.memoizedState), - (nextProps = workInProgress.memoizedState), - prevSibling.parent !== returnFiber - ? ((prevSibling = { - parent: returnFiber, - cache: returnFiber - }), - (workInProgress.memoizedState = prevSibling), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - prevSibling), - pushProvider(workInProgress, CacheContext, returnFiber)) - : ((returnFiber = nextProps.cache), - pushProvider(workInProgress, CacheContext, returnFiber), - returnFiber !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( + } else + JSCompiler_object_inline_digest_2428.data === + SUSPENSE_PENDING_START_DATA + ? ((workInProgress.flags |= 192), + (workInProgress.child = current.child), + (workInProgress = null)) + : ((current = prevState.treeContext), + (nextHydratableInstance = getNextHydratable( + JSCompiler_object_inline_digest_2428.nextSibling + )), + (hydrationParentFiber = workInProgress), + (isHydrating = !0), + (hydrationErrors = null), + (didSuspendOrErrorDEV = !1), + (hydrationDiffRootDEV = null), + (rootOrSingletonContext = !1), + null !== current && + (warnIfNotHydrating(), + (idStack[idStackIndex++] = treeContextId), + (idStack[idStackIndex++] = treeContextOverflow), + (idStack[idStackIndex++] = treeContextProvider), + (treeContextId = current.id), + (treeContextOverflow = current.overflow), + (treeContextProvider = workInProgress)), + (workInProgress = mountSuspensePrimaryChildren( + workInProgress, + JSCompiler_object_inline_stack_2429.children + )), + (workInProgress.flags |= 4096)); + return workInProgress; + } + if (JSCompiler_object_inline_message_2427) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_message_2427 = + JSCompiler_object_inline_stack_2429.fallback), + (JSCompiler_object_inline_digest_2428 = workInProgress.mode), + (JSCompiler_temp = current.child), + (instance = JSCompiler_temp.sibling), + (JSCompiler_object_inline_stack_2429 = createWorkInProgress( + JSCompiler_temp, + { + mode: "hidden", + children: JSCompiler_object_inline_stack_2429.children + } + )), + (JSCompiler_object_inline_stack_2429.subtreeFlags = + JSCompiler_temp.subtreeFlags & 31457280), + null !== instance + ? (JSCompiler_object_inline_message_2427 = createWorkInProgress( + instance, + JSCompiler_object_inline_message_2427 + )) + : ((JSCompiler_object_inline_message_2427 = createFiberFromFragment( + JSCompiler_object_inline_message_2427, + JSCompiler_object_inline_digest_2428, + renderLanes, + null + )), + (JSCompiler_object_inline_message_2427.flags |= 2)), + (JSCompiler_object_inline_message_2427.return = workInProgress), + (JSCompiler_object_inline_stack_2429.return = workInProgress), + (JSCompiler_object_inline_stack_2429.sibling = + JSCompiler_object_inline_message_2427), + (workInProgress.child = JSCompiler_object_inline_stack_2429), + (JSCompiler_object_inline_stack_2429 = + JSCompiler_object_inline_message_2427), + (JSCompiler_object_inline_message_2427 = workInProgress.child), + (JSCompiler_object_inline_digest_2428 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2428 + ? (JSCompiler_object_inline_digest_2428 = + mountSuspenseOffscreenState(renderLanes)) + : ((JSCompiler_temp = + JSCompiler_object_inline_digest_2428.cachePool), + null !== JSCompiler_temp + ? ((instance = CacheContext._currentValue), + (JSCompiler_temp = + JSCompiler_temp.parent !== instance + ? { parent: instance, pool: instance } + : JSCompiler_temp)) + : (JSCompiler_temp = getSuspendedCache()), + (JSCompiler_object_inline_digest_2428 = { + baseLanes: + JSCompiler_object_inline_digest_2428.baseLanes | renderLanes, + cachePool: JSCompiler_temp + })), + (JSCompiler_object_inline_message_2427.memoizedState = + JSCompiler_object_inline_digest_2428), + (JSCompiler_object_inline_message_2427.childLanes = + getRemainingWorkInPrimaryTree( current, - workInProgress, - workInProgress.pendingProps.children, + JSCompiler_object_inline_componentStack_2430, renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + JSCompiler_object_inline_stack_2429 + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + renderLanes = current.child; + current = renderLanes.sibling; + renderLanes = createWorkInProgress(renderLanes, { + mode: "visible", + children: JSCompiler_object_inline_stack_2429.children + }); + renderLanes.return = workInProgress; + renderLanes.sibling = null; + null !== current && + ((JSCompiler_object_inline_componentStack_2430 = + workInProgress.deletions), + null === JSCompiler_object_inline_componentStack_2430 + ? ((workInProgress.deletions = [current]), + (workInProgress.flags |= 16)) + : JSCompiler_object_inline_componentStack_2430.push(current)); + workInProgress.child = renderLanes; + workInProgress.memoizedState = null; + return renderLanes; } - function resetContextDependencies() { - lastContextDependency = currentlyRenderingFiber = null; - isDisallowedContextReadInDEV = !1; + function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: primaryChildren }, + workInProgress.mode + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); } - function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue, providerFiber); - context._currentValue = nextValue; - push(rendererCursorDEV, context._currentRenderer, providerFiber); - void 0 !== context._currentRenderer && - null !== context._currentRenderer && - context._currentRenderer !== rendererSigil && - console.error( - "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." - ); - context._currentRenderer = rendererSigil; + function mountSuspenseFallbackChildren( + workInProgress, + primaryChildren, + fallbackChildren, + renderLanes + ) { + var mode = workInProgress.mode; + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "hidden", children: primaryChildren }, + mode + ); + fallbackChildren = createFiberFromFragment( + fallbackChildren, + mode, + renderLanes, + null + ); + primaryChildren.return = workInProgress; + fallbackChildren.return = workInProgress; + primaryChildren.sibling = fallbackChildren; + workInProgress.child = primaryChildren; + return fallbackChildren; } - function popProvider(context, providerFiber) { - context._currentValue = valueCursor.current; - var currentRenderer = rendererCursorDEV.current; - pop(rendererCursorDEV, providerFiber); - context._currentRenderer = currentRenderer; - pop(valueCursor, providerFiber); + function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { + return createFiberFromOffscreen(offscreenProps, mode, 0, null); } - function scheduleContextWorkOnParentPath( - parent, - renderLanes, - propagationRoot + function retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes ) { - for (; null !== parent; ) { - var alternate = parent.alternate; - (parent.childLanes & renderLanes) !== renderLanes - ? ((parent.childLanes |= renderLanes), - null !== alternate && (alternate.childLanes |= renderLanes)) - : null !== alternate && - (alternate.childLanes & renderLanes) !== renderLanes && - (alternate.childLanes |= renderLanes); - if (parent === propagationRoot) break; - parent = parent.return; - } - parent !== propagationRoot && - console.error( - "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." - ); + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren( + workInProgress, + workInProgress.pendingProps.children + ); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; } - function propagateContextChanges( + function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + fiber.return, + renderLanes, + propagationRoot + ); + } + function validateSuspenseListNestedChild(childSlot, index) { + var isAnArray = isArrayImpl(childSlot); + childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot); + return isAnArray || childSlot + ? ((isAnArray = isAnArray ? "array" : "iterable"), + console.error( + "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", + isAnArray, + index, + isAnArray + ), + !1) + : !0; + } + function initSuspenseListRenderState( workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree + isBackwards, + tail, + lastContentRow, + tailMode ) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, + var renderState = workInProgress.memoizedState; + null === renderState + ? (workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + }) + : ((renderState.isBackwards = isBackwards), + (renderState.rendering = null), + (renderState.renderingStartTime = 0), + (renderState.last = lastContentRow), + (renderState.tail = tail), + (renderState.tailMode = tailMode)); + } + function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + nextProps = nextProps.children; + if ( + void 0 !== revealOrder && + "forwards" !== revealOrder && + "backwards" !== revealOrder && + "together" !== revealOrder && + !didWarnAboutRevealOrder[revealOrder] + ) + if ( + ((didWarnAboutRevealOrder[revealOrder] = !0), + "string" === typeof revealOrder) + ) + switch (revealOrder.toLowerCase()) { + case "together": + case "forwards": + case "backwards": + console.error( + '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.', + revealOrder, + revealOrder.toLowerCase() + ); + break; + case "forward": + case "backward": + console.error( + '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.', + revealOrder, + revealOrder.toLowerCase() + ); + break; + default: + console.error( + '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?', + revealOrder + ); + } + else + console.error( + '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?', + revealOrder + ); + void 0 === tailMode || + didWarnAboutTailOptions[tailMode] || + ("collapsed" !== tailMode && "hidden" !== tailMode + ? ((didWarnAboutTailOptions[tailMode] = !0), + console.error( + '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?', + tailMode + )) + : "forwards" !== revealOrder && + "backwards" !== revealOrder && + ((didWarnAboutTailOptions[tailMode] = !0), + console.error( + ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', + tailMode + ))); + a: if ( + ("forwards" === revealOrder || "backwards" === revealOrder) && + void 0 !== nextProps && + null !== nextProps && + !1 !== nextProps + ) + if (isArrayImpl(nextProps)) + for (var i = 0; i < nextProps.length; i++) { + if (!validateSuspenseListNestedChild(nextProps[i], i)) break a; + } + else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) { + if ((i = i.call(nextProps))) + for (var step = i.next(), _i = 0; !step.done; step = i.next()) { + if (!validateSuspenseListNestedChild(step.value, _i)) break a; + _i++; + } + } else + console.error( + 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', + revealOrder + ); + reconcileChildren(current, workInProgress, nextProps, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & ForceSuspenseFallback)) + (nextProps = + (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback), + (workInProgress.flags |= 128); + else { + if (null !== current && 0 !== (current.flags & 128)) + a: for (current = workInProgress.child; null !== current; ) { + if (13 === current.tag) + null !== current.memoizedState && + scheduleSuspenseWorkOnFiber( + current, renderLanes, workInProgress ); - forcePropagateEntireTree || (nextFiber = null); + else if (19 === current.tag) + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling; ) { + if (null === current.return || current.return === workInProgress) break a; - } - list = dependency.next; + current = current.return; + } + current.sibling.return = current.return; + current = current.sibling; } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, + nextProps &= SubtreeSuspenseContextMask; + } + push(suspenseStackCursor, nextProps, workInProgress); + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); + renderLanes = revealOrder; + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), + (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, renderLanes, - workInProgress + tailMode ); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; break; } - nextFiber = nextFiber.return; + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; } - fiber = nextFiber; + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; } + return workInProgress.child; } - function propagateParentContextChanges( + function bailoutOnAlreadyFinishedWork( current, workInProgress, - renderLanes, - forcePropagateEntireTree + renderLanes ) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; - - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current - ? current.push(context) - : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); - } - parent = parent.return; - } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; - } - function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue + null !== current && (workInProgress.dependencies = current.dependencies); + profilerStartTime = -1; + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) + if (null !== current) { + if ( + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + 0 === (renderLanes & workInProgress.childLanes)) ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; - } - function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); - } - function readContext(context) { - isDisallowedContextReadInDEV && - console.error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - return readContextForConsumer(currentlyRenderingFiber, context); - } - function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); - } - function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - lastContextDependency = context; - consumer.dependencies = { - lanes: 0, - firstContext: context, - _debugThenableState: null - }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; - } - function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; - } - function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); - } - function createUpdate(lane) { - return { - lane: lane, - tag: UpdateState, - payload: null, - callback: null, - next: null - }; - } - function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if ( - currentlyProcessingQueue === updateQueue && - !didWarnUpdateInsideUpdate - ) { - var componentName = getComponentNameFromFiber(fiber); - console.error( - "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s", - componentName - ); - didWarnUpdateInsideUpdate = !0; - } - if ((executionContext & RenderContext) !== NoContext) - return ( - (componentName = updateQueue.pending), - null === componentName - ? (update.next = update) - : ((update.next = componentName.next), - (componentName.next = update)), - (updateQueue.pending = update), - (update = getRootForUpdatedFiber(fiber)), - markUpdateLaneFromFiberToRoot(fiber, null, lane), - update - ); - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); - } - function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); - } - } - function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( - null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks - }; - workInProgress.updateQueue = queue; - return; + return null; + } else return null; + if (null !== current && workInProgress.child !== current.child) + throw Error("Resuming work not yet implemented."); + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + for (renderLanes.return = workInProgress; null !== current.sibling; ) + (current = current.sibling), + (renderLanes = renderLanes.sibling = + createWorkInProgress(current, current.pendingProps)), + (renderLanes.return = workInProgress); + renderLanes.sibling = null; } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + return workInProgress.child; } - function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; - } + function checkScheduledUpdateOrContext(current, renderLanes) { + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } - function processUpdateQueue( + function attemptEarlyBailoutIfNoScheduledUpdate( + current, workInProgress, - props, - instance$jscomp$0, renderLanes ) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress.updateQueue; - hasForceUpdate = !1; - currentlyProcessingQueue = queue.shared; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); + switch (workInProgress.tag) { + case 3: + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + pushProvider( + workInProgress, + CacheContext, + current.memoizedState.cache + ); + resetHydrationState(); + break; + case 27: + case 5: + pushHostContext(workInProgress); + break; + case 4: + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + break; + case 10: + pushProvider( + workInProgress, + workInProgress.type, + workInProgress.memoizedProps.value + ); + break; + case 12: + 0 !== (renderLanes & workInProgress.childLanes) && + (workInProgress.flags |= 4); + workInProgress.flags |= 2048; + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = -0; + stateNode.passiveEffectDuration = -0; + break; + case 13: + stateNode = workInProgress.memoizedState; + if (null !== stateNode) { + if (null !== stateNode.dehydrated) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags |= 128), + null + ); + if (0 !== (renderLanes & workInProgress.child.childLanes)) + return updateSuspenseComponent( + current, + workInProgress, + renderLanes + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + return null !== current ? current.sibling : null; + } + pushPrimaryTreeSuspenseHandler(workInProgress); + break; + case 19: + var didSuspendBefore = 0 !== (current.flags & 128); + stateNode = 0 !== (renderLanes & workInProgress.childLanes); + stateNode || + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); + if (didSuspendBefore) { + if (stateNode) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + workInProgress.flags |= 128; + } + didSuspendBefore = workInProgress.memoizedState; + null !== didSuspendBefore && + ((didSuspendBefore.rendering = null), + (didSuspendBefore.tail = null), + (didSuspendBefore.lastEffect = null)); + push( + suspenseStackCursor, + suspenseStackCursor.current, + workInProgress + ); + if (stateNode) break; + else return null; + case 22: + case 23: + return ( + (workInProgress.lanes = 0), + updateOffscreenComponent(current, workInProgress, renderLanes) + ); + case 24: + pushProvider( + workInProgress, + CacheContext, + current.memoizedState.cache + ); } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + function beginWork(current, workInProgress, renderLanes) { + if (workInProgress._debugNeedsRemount && null !== current) { + renderLanes = createFiberFromTypeAndProps( + workInProgress.type, + workInProgress.key, + workInProgress.pendingProps, + workInProgress._debugOwner || null, + workInProgress.mode, + workInProgress.lanes + ); + renderLanes._debugStack = workInProgress._debugStack; + renderLanes._debugTask = workInProgress._debugTask; + var returnFiber = workInProgress.return; + if (null === returnFiber) throw Error("Cannot swap the root fiber."); + current.alternate = null; + workInProgress.alternate = null; + renderLanes.index = workInProgress.index; + renderLanes.sibling = workInProgress.sibling; + renderLanes.return = workInProgress.return; + renderLanes.ref = workInProgress.ref; + renderLanes._debugInfo = workInProgress._debugInfo; + if (workInProgress === returnFiber.child) + returnFiber.child = renderLanes; + else { + var prevSibling = returnFiber.child; + if (null === prevSibling) + throw Error("Expected parent to have a child."); + for (; prevSibling.sibling !== workInProgress; ) + if (((prevSibling = prevSibling.sibling), null === prevSibling)) + throw Error("Expected to find the previous sibling."); + prevSibling.sibling = renderLanes; + } + workInProgress = returnFiber.deletions; + null === workInProgress + ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) + : workInProgress.push(current); + renderLanes.flags |= 2; + return renderLanes; + } + if (null !== current) + if ( + current.memoizedProps !== workInProgress.pendingProps || + workInProgress.type !== current.type + ) + didReceiveUpdate = !0; + else { if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) + ) + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + } + else { + didReceiveUpdate = !1; + if ((returnFiber = isHydrating)) + warnIfNotHydrating(), + (returnFiber = 0 !== (workInProgress.flags & 1048576)); + returnFiber && + ((returnFiber = workInProgress.index), + warnIfNotHydrating(), + pushTreeId(workInProgress, treeForkCount, returnFiber)); + } + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 16: + a: if ( + ((returnFiber = workInProgress.pendingProps), + (current = callLazyInitInDEV(workInProgress.elementType)), + (workInProgress.type = current), + "function" === typeof current) + ) + shouldConstruct(current) + ? ((returnFiber = resolveClassComponentProps( + current, + returnFiber + )), + (workInProgress.tag = 1), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateClassComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ))) + : ((workInProgress.tag = 0), + validateFunctionComponentInDev(workInProgress, current), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateFunctionComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ))); + else { + if (void 0 !== current && null !== current) + if ( + ((prevSibling = current.$$typeof), + prevSibling === REACT_FORWARD_REF_TYPE) + ) { + workInProgress.tag = 11; + workInProgress.type = current = + resolveForwardRefForHotReloading(current); + workInProgress = updateForwardRef( + null, + workInProgress, + current, + returnFiber, + renderLanes + ); + break a; + } else if (prevSibling === REACT_MEMO_TYPE) { + workInProgress.tag = 14; + workInProgress = updateMemoComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ); + break a; + } + workInProgress = ""; null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - updateLane = workInProgress; - var partialState = pendingQueue; - var nextProps = props, - instance = instance$jscomp$0; - switch (partialState.tag) { - case ReplaceState: - partialState = partialState.payload; - if ("function" === typeof partialState) { - isDisallowedContextReadInDEV = !0; - var nextState = partialState.call( - instance, - newState, - nextProps - ); - if (updateLane.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState.call(instance, newState, nextProps); - } finally { - setIsStrictModeForDevtools(!1); - } - } - isDisallowedContextReadInDEV = !1; - newState = nextState; - break a; - } - newState = partialState; - break a; - case CaptureUpdate: - updateLane.flags = (updateLane.flags & -65537) | 128; - case UpdateState: - nextState = partialState.payload; - if ("function" === typeof nextState) { - isDisallowedContextReadInDEV = !0; - partialState = nextState.call( - instance, - newState, - nextProps - ); - if (updateLane.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - nextState.call(instance, newState, nextProps); - } finally { - setIsStrictModeForDevtools(!1); - } - } - isDisallowedContextReadInDEV = !1; - } else partialState = nextState; - if (null === partialState || void 0 === partialState) break a; - newState = assign({}, newState, partialState); - break a; - case ForceUpdate: - hasForceUpdate = !0; + "object" === typeof current && + current.$$typeof === REACT_LAZY_TYPE && + (workInProgress = + " Did you wrap a component in React.lazy() more than once?"); + current = getComponentNameFromType(current) || current; + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + current + + ". Lazy element type must resolve to a class or function." + + workInProgress + ); + } + return workInProgress; + case 0: + return updateFunctionComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 1: + return ( + (returnFiber = workInProgress.type), + (prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps + )), + updateClassComponent( + current, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) + ); + case 3: + a: { + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + if (null === current) + throw Error( + "Should have a current fiber. This is a bug in React." + ); + var nextProps = workInProgress.pendingProps; + prevSibling = workInProgress.memoizedState; + returnFiber = prevSibling.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + var nextState = workInProgress.memoizedState; + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); + suspendIfUpdateReadFromEntangledAsyncAction(); + nextProps = nextState.element; + if (prevSibling.isDehydrated) + if ( + ((prevSibling = { + element: nextProps, + isDehydrated: !1, + cache: nextState.cache + }), + (workInProgress.updateQueue.baseState = prevSibling), + (workInProgress.memoizedState = prevSibling), + workInProgress.flags & 256) + ) { + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else if (nextProps !== returnFiber) { + returnFiber = createCapturedValueAtFiber( + Error( + "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." + ), + workInProgress + ); + queueHydrationError(returnFiber); + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else + for ( + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ), + hydrationParentFiber = workInProgress, + isHydrating = !0, + hydrationErrors = null, + didSuspendOrErrorDEV = !1, + hydrationDiffRootDEV = null, + rootOrSingletonContext = !0, + current = mountChildFibers( + workInProgress, + null, + nextProps, + renderLanes + ), + workInProgress.child = current; + current; + + ) + (current.flags = (current.flags & -3) | 4096), + (current = current.sibling); + else { + resetHydrationState(); + if (nextProps === returnFiber) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + break a; } + reconcileChildren( + current, + workInProgress, + nextProps, + renderLanes + ); } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress.flags |= 64), - isHiddenUpdate && (workInProgress.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null - }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) - break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress.lanes = lastBaseUpdate; - workInProgress.memoizedState = newState; + workInProgress = workInProgress.child; + } + return workInProgress; + case 26: + return ( + markRef(current, workInProgress), + null === current + ? (current = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + )) + ? (workInProgress.memoizedState = current) + : isHydrating || + ((current = workInProgress.type), + (renderLanes = workInProgress.pendingProps), + (returnFiber = requiredContext( + rootInstanceStackCursor.current + )), + (returnFiber = + getOwnerDocumentFromRootContainer( + returnFiber + ).createElement(current)), + (returnFiber[internalInstanceKey] = workInProgress), + (returnFiber[internalPropsKey] = renderLanes), + setInitialProperties(returnFiber, current, renderLanes), + markNodeAsHoistable(returnFiber), + (workInProgress.stateNode = returnFiber)) + : (workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + )), + null + ); + case 27: + return ( + pushHostContext(workInProgress), + null === current && + isHydrating && + ((prevSibling = requiredContext(rootInstanceStackCursor.current)), + (returnFiber = getHostContext()), + (prevSibling = workInProgress.stateNode = + resolveSingletonInstance( + workInProgress.type, + workInProgress.pendingProps, + prevSibling, + returnFiber, + !1 + )), + didSuspendOrErrorDEV || + ((returnFiber = diffHydratedProperties( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + returnFiber + )), + null !== returnFiber && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + returnFiber)), + (hydrationParentFiber = workInProgress), + (rootOrSingletonContext = !0), + (nextHydratableInstance = getNextHydratable( + prevSibling.firstChild + ))), + (returnFiber = workInProgress.pendingProps.children), + null !== current || isHydrating + ? reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )), + markRef(current, workInProgress), + workInProgress.child + ); + case 5: + return ( + null === current && + isHydrating && + ((nextProps = getHostContext()), + (returnFiber = validateDOMNesting( + workInProgress.type, + nextProps.ancestorInfo + )), + (prevSibling = nextHydratableInstance), + (nextState = !prevSibling) || + ((nextState = canHydrateInstance( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== nextState + ? ((workInProgress.stateNode = nextState), + didSuspendOrErrorDEV || + ((nextProps = diffHydratedProperties( + nextState, + workInProgress.type, + workInProgress.pendingProps, + nextProps + )), + null !== nextProps && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + nextProps)), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = getNextHydratable( + nextState.firstChild + )), + (rootOrSingletonContext = !1), + (nextProps = !0)) + : (nextProps = !1), + (nextState = !nextProps)), + nextState && + (returnFiber && + warnNonHydratedInstance(workInProgress, prevSibling), + throwOnHydrationMismatch(workInProgress))), + pushHostContext(workInProgress), + (prevSibling = workInProgress.type), + (nextProps = workInProgress.pendingProps), + (nextState = null !== current ? current.memoizedProps : null), + (returnFiber = nextProps.children), + shouldSetTextContent(prevSibling, nextProps) + ? (returnFiber = null) + : null !== nextState && + shouldSetTextContent(prevSibling, nextState) && + (workInProgress.flags |= 32), + null !== workInProgress.memoizedState && + ((prevSibling = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue = prevSibling)), + markRef(current, workInProgress), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 6: + return ( + null === current && + isHydrating && + ((current = workInProgress.pendingProps), + (renderLanes = getHostContext().ancestorInfo.current), + (current = + null != renderLanes + ? validateTextNesting(current, renderLanes.tag) + : !0), + (renderLanes = nextHydratableInstance), + (returnFiber = !renderLanes) || + ((returnFiber = canHydrateTextInstance( + renderLanes, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== returnFiber + ? ((workInProgress.stateNode = returnFiber), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (returnFiber = !0)) + : (returnFiber = !1), + (returnFiber = !returnFiber)), + returnFiber && + (current && + warnNonHydratedInstance(workInProgress, renderLanes), + throwOnHydrationMismatch(workInProgress))), + null + ); + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (returnFiber = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child + ); + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), + (returnFiber = workInProgress.stateNode), + (returnFiber.effectDuration = -0), + (returnFiber.passiveEffectDuration = -0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return ( + (returnFiber = workInProgress.type), + (prevSibling = workInProgress.pendingProps), + (nextProps = prevSibling.value), + "value" in prevSibling || + hasWarnedAboutUsingNoValuePropOnContextProvider || + ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), + console.error( + "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" + )), + pushProvider(workInProgress, returnFiber, nextProps), + reconcileChildren( + current, + workInProgress, + prevSibling.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (prevSibling = workInProgress.type._context), + (returnFiber = workInProgress.pendingProps.children), + "function" !== typeof returnFiber && + console.error( + "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." + ), + prepareToReadContext(workInProgress), + (prevSibling = readContext(prevSibling)), + (returnFiber = callComponentInDEV( + returnFiber, + prevSibling, + void 0 + )), + (workInProgress.flags |= 1), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 19: + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (returnFiber = readContext(CacheContext)), + null === current + ? ((prevSibling = peekCacheFromPool()), + null === prevSibling && + ((prevSibling = workInProgressRoot), + (nextProps = createCache()), + (prevSibling.pooledCache = nextProps), + retainCache(nextProps), + null !== nextProps && + (prevSibling.pooledCacheLanes |= renderLanes), + (prevSibling = nextProps)), + (workInProgress.memoizedState = { + parent: returnFiber, + cache: prevSibling + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, prevSibling)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (prevSibling = current.memoizedState), + (nextProps = workInProgress.memoizedState), + prevSibling.parent !== returnFiber + ? ((prevSibling = { + parent: returnFiber, + cache: returnFiber + }), + (workInProgress.memoizedState = prevSibling), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + prevSibling), + pushProvider(workInProgress, CacheContext, returnFiber)) + : ((returnFiber = nextProps.cache), + pushProvider(workInProgress, CacheContext, returnFiber), + returnFiber !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; } - currentlyProcessingQueue = null; - } - function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error( - "Invalid argument passed as callback. Expected a function. Instead received: " + - callback - ); - callback.call(context); - } - function commitHiddenCallbacks(updateQueue, context) { - var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < hiddenCallbacks.length; - updateQueue++ - ) - callCallback(hiddenCallbacks[updateQueue], context); - } - function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } function shouldProfile(current) { return (current.mode & ProfileMode) !== NoMode; @@ -11529,181 +11319,27 @@ break; case 5: parent = parentFiber.stateNode; - parentFiber.flags & 32 && - (resetTextContent(parent), (parentFiber.flags &= -33)); - parentFiber = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, parentFiber, parent); - break; - case 3: - case 4: - parent = parentFiber.stateNode.containerInfo; - parentFiber = getHostSibling(finishedWork); - insertOrAppendPlacementNodeIntoContainer( - finishedWork, - parentFiber, - parent - ); - break; - default: - throw Error( - "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." - ); - } - } - } - function commitBeforeMutationEffects(root, firstChild) { - root = root.containerInfo; - eventsEnabled = _enabled; - root = getActiveElementDeep(root); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, - focusNode = selection.focusNode; - selection = selection.focusOffset; - try { - JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$2) { - JSCompiler_temp = null; - break a; - } - var length = 0, - start = -1, - end = -1, - indexWithinAnchor = 0, - indexWithinFocus = 0, - node = root, - parentNode = null; - b: for (;;) { - for (var next; ; ) { - node !== JSCompiler_temp || - (0 !== anchorOffset && 3 !== node.nodeType) || - (start = length + anchorOffset); - node !== focusNode || - (0 !== selection && 3 !== node.nodeType) || - (end = length + selection); - 3 === node.nodeType && (length += node.nodeValue.length); - if (null === (next = node.firstChild)) break; - parentNode = node; - node = next; - } - for (;;) { - if (node === root) break b; - parentNode === JSCompiler_temp && - ++indexWithinAnchor === anchorOffset && - (start = length); - parentNode === focusNode && - ++indexWithinFocus === selection && - (end = length); - if (null !== (next = node.nextSibling)) break; - node = parentNode; - parentNode = node.parentNode; - } - node = next; - } - JSCompiler_temp = - -1 === start || -1 === end ? null : { start: start, end: end }; - } else JSCompiler_temp = null; - } - JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 }; - } else JSCompiler_temp = null; - selectionInformation = { - focusedElem: root, - selectionRange: JSCompiler_temp - }; - _enabled = !1; - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((firstChild = nextEffect), - (root = firstChild.child), - 0 !== (firstChild.subtreeFlags & 1028) && null !== root) - ) - (root.return = firstChild), (nextEffect = root); - else - for (; null !== nextEffect; ) { - root = firstChild = nextEffect; - JSCompiler_temp = root.alternate; - anchorOffset = root.flags; - switch (root.tag) { - case 0: - if ( - 0 !== (anchorOffset & 4) && - ((root = root.updateQueue), - (root = null !== root ? root.events : null), - null !== root) - ) - for ( - JSCompiler_temp = 0; - JSCompiler_temp < root.length; - JSCompiler_temp++ - ) - (anchorOffset = root[JSCompiler_temp]), - (anchorOffset.ref.impl = anchorOffset.nextImpl); - break; - case 11: - case 15: - break; - case 1: - 0 !== (anchorOffset & 1024) && - null !== JSCompiler_temp && - commitClassSnapshot(root, JSCompiler_temp); - break; - case 3: - if (0 !== (anchorOffset & 1024)) - if ( - ((root = root.stateNode.containerInfo), - (JSCompiler_temp = root.nodeType), - 9 === JSCompiler_temp) - ) - clearContainerSparingly(root); - else if (1 === JSCompiler_temp) - switch (root.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(root); - break; - default: - root.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (anchorOffset & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return firstChild; + parentFiber.flags & 32 && + (resetTextContent(parent), (parentFiber.flags &= -33)); + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 3: + case 4: + parent = parentFiber.stateNode.containerInfo; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + parentFiber, + parent + ); + break; + default: + throw Error( + "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." + ); + } + } } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var prevEffectStart = pushComponentEffectStart(), @@ -12190,13 +11826,6 @@ } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - resetComponentEffectTimers(); - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -12736,13 +12365,6 @@ parentFiber = parentFiber.sibling; } } - function commitLayoutEffects(finishedWork, root, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - resetComponentEffectTimers(); - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -12750,6 +12372,7 @@ (parentFiber = parentFiber.sibling); } function disappearLayoutEffects(finishedWork) { + var prevEffectStart = pushComponentEffectStart(); switch (finishedWork.tag) { case 0: case 11: @@ -12787,6 +12410,17 @@ default: recursivelyTraverseDisappearLayoutEffects(finishedWork); } + (finishedWork.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); } function recursivelyTraverseDisappearLayoutEffects(parentFiber) { for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -12799,7 +12433,8 @@ finishedWork, includeWorkInProgressEffects ) { - var flags = finishedWork.flags; + var prevEffectStart = pushComponentEffectStart(), + flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: @@ -12914,6 +12549,17 @@ includeWorkInProgressEffects ); } + (finishedWork.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); } function recursivelyTraverseReappearLayoutEffects( finishedRoot, @@ -12986,39 +12632,11 @@ endTime ) { var prevEffectStart = pushComponentEffectStart(); - if ( - (finishedWork.mode & ProfileMode) !== NoMode && + (finishedWork.mode & ProfileMode) !== NoMode && 0 < finishedWork.actualStartTime && - 0 !== (finishedWork.flags & 1) - ) { - var startTime = finishedWork.actualStartTime, - name = getComponentNameFromFiber(finishedWork); - if (null !== name && supportsUserTiming) { - var selfTime = finishedWork.actualDuration; - if ( - null === finishedWork.alternate || - finishedWork.alternate.child !== finishedWork.child - ) - for ( - var child = finishedWork.child; - null !== child; - child = child.sibling - ) - selfTime -= child.actualDuration; - reusableComponentDevToolDetails.color = - 0.5 > selfTime - ? "primary-light" - : 10 > selfTime - ? "primary" - : 100 > selfTime - ? "primary-dark" - : "error"; - reusableComponentOptions.start = startTime; - reusableComponentOptions.end = endTime; - performance.measure(name, reusableComponentOptions); - } - } - name = finishedWork.flags; + 0 !== (finishedWork.flags & 1) && + logComponentRender(finishedWork, finishedWork.actualStartTime, endTime); + var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: @@ -13030,11 +12648,11 @@ committedTransitions, endTime ); - name & 2048 && + flags & 2048 && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; case 3: - startTime = pushNestedEffectDurations(); + var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13042,7 +12660,7 @@ committedTransitions, endTime ); - name & 2048 && + flags & 2048 && ((committedLanes = null), null !== finishedWork.alternate && (committedLanes = finishedWork.alternate.memoizedState.cache), @@ -13051,11 +12669,11 @@ (retainCache(committedTransitions), null != committedLanes && releaseCache(committedLanes))); finishedRoot.passiveEffectDuration += - popNestedEffectDurations(startTime); + popNestedEffectDurations(prevEffectDuration); break; case 12: - if (name & 2048) { - startTime = pushNestedEffectDurations(); + if (flags & 2048) { + prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13065,7 +12683,7 @@ ); finishedRoot = finishedWork.stateNode; finishedRoot.passiveEffectDuration += - bubbleNestedEffectDurations(startTime); + bubbleNestedEffectDurations(prevEffectDuration); try { runWithFiberInDEV( finishedWork, @@ -13090,9 +12708,9 @@ case 23: break; case 22: - startTime = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState - ? startTime._visibility & OffscreenPassiveEffectsConnected + ? prevEffectDuration._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13102,9 +12720,12 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + finishedWork, + committedLanes, + committedTransitions, + endTime ) - : startTime._visibility & OffscreenPassiveEffectsConnected + : prevEffectDuration._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13112,15 +12733,17 @@ committedTransitions, endTime ) - : ((startTime._visibility |= OffscreenPassiveEffectsConnected), + : ((prevEffectDuration._visibility |= + OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) + 0 !== (finishedWork.subtreeFlags & 10256), + endTime )); - name & 2048 && + flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork @@ -13134,7 +12757,7 @@ committedTransitions, endTime ); - name & 2048 && + flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); break; default: @@ -13163,28 +12786,38 @@ parentFiber, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ) { includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); - for (parentFiber = parentFiber.child; null !== parentFiber; ) + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var nextSibling = parentFiber.sibling; reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, committedTransitions, - includeWorkInProgressEffects - ), - (parentFiber = parentFiber.sibling); + includeWorkInProgressEffects, + null !== nextSibling ? nextSibling.actualStartTime : endTime + ); + parentFiber = nextSibling; + } } function reconnectPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ) { + var prevEffectStart = pushComponentEffectStart(); + (finishedWork.mode & ProfileMode) !== NoMode && + 0 < finishedWork.actualStartTime && + 0 !== (finishedWork.flags & 1) && + logComponentRender(finishedWork, finishedWork.actualStartTime, endTime); var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: @@ -13195,7 +12828,8 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); commitHookPassiveMountEffects(finishedWork, Passive); break; @@ -13210,11 +12844,15 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + finishedWork, + committedLanes, + committedTransitions, + endTime ) : ((_instance2._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( @@ -13222,7 +12860,8 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime )); includeWorkInProgressEffects && flags & 2048 && @@ -13237,7 +12876,8 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); includeWorkInProgressEffects && flags & 2048 && @@ -13249,49 +12889,77 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); } + (finishedWork.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); } function recursivelyTraverseAtomicPassiveEffects( finishedRoot$jscomp$0, - parentFiber + parentFiber, + committedLanes$jscomp$0, + committedTransitions$jscomp$0, + endTime$jscomp$0 ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) { + for (var child = parentFiber.child; null !== child; ) { + parentFiber = child.sibling; var finishedRoot = finishedRoot$jscomp$0, - finishedWork = parentFiber, - flags = finishedWork.flags; - switch (finishedWork.tag) { + committedLanes = committedLanes$jscomp$0, + committedTransitions = committedTransitions$jscomp$0, + endTime = + null !== parentFiber + ? parentFiber.actualStartTime + : endTime$jscomp$0; + (child.mode & ProfileMode) !== NoMode && + 0 < child.actualStartTime && + 0 !== (child.flags & 1) && + logComponentRender(child, child.actualStartTime, endTime); + var flags = child.flags; + switch (child.tag) { case 22: recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + child, + committedLanes, + committedTransitions, + endTime ); flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); + commitOffscreenPassiveMountEffects(child.alternate, child); break; case 24: recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + child, + committedLanes, + committedTransitions, + endTime ); flags & 2048 && - commitCachePassiveMountEffect( - finishedWork.alternate, - finishedWork - ); + commitCachePassiveMountEffect(child.alternate, child); break; default: recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + child, + committedLanes, + committedTransitions, + endTime ); } - parentFiber = parentFiber.sibling; + child = parentFiber; } } function recursivelyAccumulateSuspenseyCommit(parentFiber) { @@ -13465,11 +13133,13 @@ } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { for (; null !== nextEffect; ) { var fiber = nextEffect, - current = fiber; + current = fiber, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0, + prevEffectStart = pushComponentEffectStart(); switch (current.tag) { case 0: case 11: @@ -13484,30 +13154,42 @@ case 22: null !== current.memoizedState && null !== current.memoizedState.cachePool && - ((current = current.memoizedState.cachePool.pool), - null != current && retainCache(current)); + ((nearestMountedAncestor = current.memoizedState.cachePool.pool), + null != nearestMountedAncestor && + retainCache(nearestMountedAncestor)); break; case 24: releaseCache(current.memoizedState.cache); } + (current.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + current, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); current = fiber.child; if (null !== current) (current.return = fiber), (nextEffect = current); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { current = nextEffect; - var sibling = current.sibling, - returnFiber = current.return; + prevEffectStart = current.sibling; + nearestMountedAncestor = current.return; detachFiberAfterEffects(current); if (current === fiber) { nextEffect = null; break a; } - if (null !== sibling) { - sibling.return = returnFiber; - nextEffect = sibling; + if (null !== prevEffectStart) { + prevEffectStart.return = nearestMountedAncestor; + nextEffect = prevEffectStart; break a; } - nextEffect = returnFiber; + nextEffect = nearestMountedAncestor; } } } @@ -14890,7 +14572,7 @@ if ((lanes & 4194176) !== lanes) break; case RootSuspendedAtTheShell: setCurrentTrackFromLanes(lanes); - logSuspendedRenderPhase(renderStartTime, startTime); + logSuspendedRenderPhase(renderStartTime, startTime, lanes); finalizeRender(lanes, startTime); yieldEndTime = lanes; 0 !== (yieldEndTime & 3) || 0 !== (yieldEndTime & 60) @@ -15160,14 +14842,26 @@ workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootSuspendedWithDelay ) - logSuspendedRenderPhase(previousRenderStartTime, renderStartTime); + logSuspendedRenderPhase( + previousRenderStartTime, + renderStartTime, + lanes + ); else { var endTime = renderStartTime; supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = endTime), - performance.measure("Interrupted Render", reusableLaneOptions)); + performance.measure( + (lanes & 536870912) === lanes + ? "Prewarm" + : (lanes & 201326677) === lanes + ? "Interrupted Hydration" + : "Interrupted Render", + reusableLaneOptions + )); } finalizeRender(workInProgressRootRenderLanes, renderStartTime); } @@ -15188,7 +14882,8 @@ ? endTime : 0 <= previousRenderStartTime ? previousRenderStartTime - : renderStartTime + : renderStartTime, + lanes )); var eventType = blockingEventType, eventIsRepeat = blockingEventIsRepeat, @@ -15210,7 +14905,10 @@ reusableLaneOptions )), 0 < previousRenderStartTime && - ((reusableLaneDevToolDetails.color = "primary-light"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes + ? "tertiary-light" + : "primary-light"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = renderStartTime$jscomp$0), performance.measure("Blocked", reusableLaneOptions))); @@ -15239,7 +14937,8 @@ ? eventType : 0 <= endTime ? endTime - : renderStartTime + : renderStartTime, + lanes )); eventIsRepeat = transitionEventType; renderStartTime$jscomp$0 = transitionEventIsRepeat; @@ -15324,7 +15023,7 @@ return previousRenderStartTime; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; ReactSharedInternals.getCurrentStack = null; isRendering = !1; @@ -15824,7 +15523,7 @@ workInProgress = null; } function commitRoot( - root, + root$jscomp$0, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -15836,176 +15535,501 @@ completedRenderStartTime, completedRenderEndTime ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = ReactDOMSharedInternals.p; + didIncludeRenderPhaseUpdate = ReactSharedInternals.T; + var previousUpdateLanePriority = ReactDOMSharedInternals.p; try { - (ReactDOMSharedInternals.p = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (ReactDOMSharedInternals.p = previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - ReactStrictModeWarnings.flushLegacyContextWarning(); - ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - var finishedWork = root.finishedWork; - didIncludeRenderPhaseUpdate = root.finishedLanes; - setCurrentTrackFromLanes(didIncludeRenderPhaseUpdate); - exitStatus === RootErrored - ? logErroredRenderPhase( - completedRenderStartTime, - completedRenderEndTime - ) - : logRenderPhase(completedRenderStartTime, completedRenderEndTime); - if (null === finishedWork) return null; - 0 === didIncludeRenderPhaseUpdate && - console.error( - "root.finishedLanes should not be empty during a commit. This is a bug in React." - ); - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; - exitStatus = finishedWork.lanes | finishedWork.childLanes; - exitStatus |= concurrentlyUpdatedLanes; - markRootFinished( - root, - didIncludeRenderPhaseUpdate, - exitStatus, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - (0 === finishedWork.actualDuration && - 0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = exitStatus), - (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), - (pendingPassiveTransitions = transitions), - scheduleCallback$1(NormalPriority$1, function () { - schedulerEvent = window.event; - flushPassiveEffects(!0); - return null; - })); - commitStartTime = now(); - suspendedCommitReason === SUSPENDED_COMMIT - ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) - : suspendedCommitReason === THROTTLED_COMMIT && - logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), - (ReactDOMSharedInternals.p = DiscreteEventPriority), - (updatedLanes = executionContext), - (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffects( - root, - finishedWork, - didIncludeRenderPhaseUpdate - ), - restoreSelection(selectionInformation, root.containerInfo), - (_enabled = !!eventsEnabled), - (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - commitLayoutEffects(finishedWork, root, didIncludeRenderPhaseUpdate), - requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - commitEndTime = now(); - logCommitPhase( - suspendedCommitReason === IMMEDIATE_COMMIT - ? completedRenderEndTime - : commitStartTime, - commitEndTime - ); - (suspendedCommitReason = rootDoesHavePassiveEffects) - ? ((rootDoesHavePassiveEffects = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) - : (releaseRootPooledCache(root, exitStatus), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - exitStatus = root.pendingLanes; - 0 === exitStatus && (legacyErrorBoundariesThatAlreadyFailed = null); - suspendedCommitReason || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - onCommitRoot(); - ensureRootIsScheduled(root); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, - completedRenderEndTime = 0; - completedRenderEndTime < recoverableErrors.length; - completedRenderEndTime++ - ) - (finishedWork = recoverableErrors[completedRenderEndTime]), - (exitStatus = makeErrorInfo(finishedWork.stack)), - runWithFiberInDEV( - finishedWork.source, - renderPriorityLevel, - finishedWork.value, - exitStatus + ReactDOMSharedInternals.p = DiscreteEventPriority; + ReactSharedInternals.T = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + ReactStrictModeWarnings.flushLegacyContextWarning(); + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) + throw Error("Should not already be working."); + var finishedWork = root$jscomp$0.finishedWork, + lanes = root$jscomp$0.finishedLanes; + setCurrentTrackFromLanes(lanes); + exitStatus === RootErrored + ? logErroredRenderPhase( + completedRenderStartTime, + completedRenderEndTime + ) + : supportsUserTiming && + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (reusableLaneOptions.start = completedRenderStartTime), + (reusableLaneOptions.end = completedRenderEndTime), + performance.measure( + (lanes & 536870912) === lanes + ? "Prepared" + : (lanes & 201326677) === lanes + ? "Hydrated" + : "Render", + reusableLaneOptions + )); + if (null !== finishedWork) { + 0 === lanes && + console.error( + "root.finishedLanes should not be empty during a commit. This is a bug in React." ); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - exitStatus = root.pendingLanes; - 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (exitStatus & 42) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - suspendedCommitReason || - finalizeRender(didIncludeRenderPhaseUpdate, commitEndTime); - flushSyncWorkAcrossRoots_impl(0, !1); - return null; + root$jscomp$0.finishedWork = null; + root$jscomp$0.finishedLanes = 0; + if (finishedWork === root$jscomp$0.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + exitStatus = remainingLanes |= concurrentlyUpdatedLanes; + var previouslyPendingLanes = root$jscomp$0.pendingLanes; + root$jscomp$0.pendingLanes = exitStatus; + root$jscomp$0.suspendedLanes = 0; + root$jscomp$0.pingedLanes = 0; + root$jscomp$0.warmLanes = 0; + root$jscomp$0.expiredLanes &= exitStatus; + root$jscomp$0.entangledLanes &= exitStatus; + root$jscomp$0.errorRecoveryDisabledLanes &= exitStatus; + root$jscomp$0.shellSuspendCounter = 0; + var entanglements = root$jscomp$0.entanglements, + expirationTimes = root$jscomp$0.expirationTimes, + hiddenUpdates = root$jscomp$0.hiddenUpdates; + for ( + exitStatus = previouslyPendingLanes & ~exitStatus; + 0 < exitStatus; + + ) { + var index = 31 - clz32(exitStatus); + completedRenderStartTime = 1 << index; + entanglements[index] = 0; + expirationTimes[index] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index]; + if (null !== hiddenUpdatesForLane) { + hiddenUpdates[index] = null; + for (var i = 0; i < hiddenUpdatesForLane.length; i++) { + var update = hiddenUpdatesForLane[i]; + null !== update && (update.lane &= -536870913); + } + } + exitStatus &= ~completedRenderStartTime; + } + 0 !== spawnedLane && + markSpawnedDeferredLane(root$jscomp$0, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root$jscomp$0.tag && + (root$jscomp$0.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~lanes)); + root$jscomp$0 === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + spawnedLane = !1; + 0 !== finishedWork.actualDuration || + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), + (pendingPassiveTransitions = transitions)) + : ((root$jscomp$0.callbackNode = null), + (root$jscomp$0.callbackPriority = 0), + (root$jscomp$0.cancelPendingCommit = null)); + commitStartTime = now(); + suspendedCommitReason === SUSPENDED_COMMIT + ? ((transitions = commitStartTime), + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-light"), + (reusableLaneOptions.start = completedRenderEndTime), + (reusableLaneOptions.end = transitions), + performance.measure("Suspended", reusableLaneOptions))) + : suspendedCommitReason === THROTTLED_COMMIT && + ((transitions = commitStartTime), + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-light"), + (reusableLaneOptions.start = completedRenderEndTime), + (reusableLaneOptions.end = transitions), + performance.measure("Throttled", reusableLaneOptions))); + var rootHasEffect = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || rootHasEffect) { + var prevTransition = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = DiscreteEventPriority; + rootHasEffect = executionContext; + executionContext |= CommitContext; + var containerInfo = root$jscomp$0.containerInfo; + eventsEnabled = _enabled; + var focusedElem = getActiveElementDeep(containerInfo); + if (hasSelectionCapabilities(focusedElem)) { + if ("selectionStart" in focusedElem) + var selection = { + start: focusedElem.selectionStart, + end: focusedElem.selectionEnd + }; + else + b: { + var ownerDocument = focusedElem.ownerDocument, + win = + (ownerDocument && ownerDocument.defaultView) || window, + selection$jscomp$0 = win.getSelection && win.getSelection(); + if ( + selection$jscomp$0 && + 0 !== selection$jscomp$0.rangeCount + ) { + var anchorNode = selection$jscomp$0.anchorNode, + anchorOffset = selection$jscomp$0.anchorOffset, + focusNode = selection$jscomp$0.focusNode, + focusOffset = selection$jscomp$0.focusOffset; + try { + anchorNode.nodeType, focusNode.nodeType; + } catch (e$2) { + selection = null; + break b; + } + containerInfo = 0; + win = ownerDocument = -1; + transitions = selection$jscomp$0 = 0; + updatedLanes = focusedElem; + suspendedRetryLanes = null; + c: for (;;) { + for (var next; ; ) { + updatedLanes !== anchorNode || + (0 !== anchorOffset && 3 !== updatedLanes.nodeType) || + (ownerDocument = containerInfo + anchorOffset); + updatedLanes !== focusNode || + (0 !== focusOffset && 3 !== updatedLanes.nodeType) || + (win = containerInfo + focusOffset); + 3 === updatedLanes.nodeType && + (containerInfo += updatedLanes.nodeValue.length); + if (null === (next = updatedLanes.firstChild)) break; + suspendedRetryLanes = updatedLanes; + updatedLanes = next; + } + for (;;) { + if (updatedLanes === focusedElem) break c; + suspendedRetryLanes === anchorNode && + ++selection$jscomp$0 === anchorOffset && + (ownerDocument = containerInfo); + suspendedRetryLanes === focusNode && + ++transitions === focusOffset && + (win = containerInfo); + if (null !== (next = updatedLanes.nextSibling)) break; + updatedLanes = suspendedRetryLanes; + suspendedRetryLanes = updatedLanes.parentNode; + } + updatedLanes = next; + } + selection = + -1 === ownerDocument || -1 === win + ? null + : { start: ownerDocument, end: win }; + } else selection = null; + } + var JSCompiler_temp = selection || { start: 0, end: 0 }; + } else JSCompiler_temp = null; + selectionInformation = { + focusedElem: focusedElem, + selectionRange: JSCompiler_temp + }; + _enabled = !1; + for (nextEffect = finishedWork; null !== nextEffect; ) { + focusedElem = nextEffect; + var child = focusedElem.child; + if (0 !== (focusedElem.subtreeFlags & 1028) && null !== child) + (child.return = focusedElem), (nextEffect = child); + else + b: for (; null !== nextEffect; ) { + JSCompiler_temp = focusedElem = nextEffect; + var current = JSCompiler_temp.alternate, + flags = JSCompiler_temp.flags; + switch (JSCompiler_temp.tag) { + case 0: + if (0 !== (flags & 4)) { + var updateQueue = JSCompiler_temp.updateQueue, + eventPayloads = + null !== updateQueue ? updateQueue.events : null; + if (null !== eventPayloads) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < eventPayloads.length; + JSCompiler_temp++ + ) { + var _eventPayloads$ii = + eventPayloads[JSCompiler_temp]; + _eventPayloads$ii.ref.impl = + _eventPayloads$ii.nextImpl; + } + } + break; + case 11: + case 15: + break; + case 1: + 0 !== (flags & 1024) && + null !== current && + commitClassSnapshot(JSCompiler_temp, current); + break; + case 3: + if (0 !== (flags & 1024)) + c: { + var container = + JSCompiler_temp.stateNode.containerInfo, + nodeType = container.nodeType; + if (9 === nodeType) + clearContainerSparingly(container); + else if (1 === nodeType) + switch (container.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(container); + break c; + default: + container.textContent = ""; + } + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (flags & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); + } + var sibling = focusedElem.sibling; + if (null !== sibling) { + sibling.return = focusedElem.return; + nextEffect = sibling; + break b; + } + nextEffect = focusedElem.return; + } + } + inProgressLanes = lanes; + inProgressRoot = root$jscomp$0; + resetComponentEffectTimers(); + commitMutationEffectsOnFiber(finishedWork, root$jscomp$0); + inProgressRoot = inProgressLanes = null; + child = selectionInformation; + var curFocusedElem = getActiveElementDeep( + root$jscomp$0.containerInfo + ), + priorFocusedElem = child.focusedElem, + priorSelectionRange = child.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start = priorSelectionRange.start, + end = priorSelectionRange.end; + void 0 === end && (end = start); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start), + (priorFocusedElem.selectionEnd = Math.min( + end, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win$jscomp$0 = (doc && doc.defaultView) || window; + if (win$jscomp$0.getSelection) { + var selection$jscomp$1 = win$jscomp$0.getSelection(), + length = priorFocusedElem.textContent.length, + start$jscomp$0 = Math.min( + priorSelectionRange.start, + length + ), + end$jscomp$0 = + void 0 === priorSelectionRange.end + ? start$jscomp$0 + : Math.min(priorSelectionRange.end, length); + !selection$jscomp$1.extend && + start$jscomp$0 > end$jscomp$0 && + ((curFocusedElem = end$jscomp$0), + (end$jscomp$0 = start$jscomp$0), + (start$jscomp$0 = curFocusedElem)); + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$0 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$0 + ); + if ( + startMarker && + endMarker && + (1 !== selection$jscomp$1.rangeCount || + selection$jscomp$1.anchorNode !== startMarker.node || + selection$jscomp$1.anchorOffset !== + startMarker.offset || + selection$jscomp$1.focusNode !== endMarker.node || + selection$jscomp$1.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection$jscomp$1.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection$jscomp$1.addRange(range), + selection$jscomp$1.extend( + endMarker.node, + endMarker.offset + )) + : (range.setEnd(endMarker.node, endMarker.offset), + selection$jscomp$1.addRange(range)); + } + } + } + } + doc = []; + for ( + selection$jscomp$1 = priorFocusedElem; + (selection$jscomp$1 = selection$jscomp$1.parentNode); + + ) + 1 === selection$jscomp$1.nodeType && + doc.push({ + element: selection$jscomp$1, + left: selection$jscomp$1.scrollLeft, + top: selection$jscomp$1.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + priorFocusedElem = 0; + priorFocusedElem < doc.length; + priorFocusedElem++ + ) { + var info = doc[priorFocusedElem]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + root$jscomp$0.current = finishedWork; + inProgressLanes = lanes; + inProgressRoot = root$jscomp$0; + resetComponentEffectTimers(); + commitLayoutEffectOnFiber( + root$jscomp$0, + finishedWork.alternate, + finishedWork + ); + inProgressRoot = inProgressLanes = null; + requestPaint(); + executionContext = rootHasEffect; + ReactDOMSharedInternals.p = previousPriority; + ReactSharedInternals.T = prevTransition; + } else root$jscomp$0.current = finishedWork; + commitEndTime = now(); + suspendedCommitReason = + suspendedCommitReason === IMMEDIATE_COMMIT + ? completedRenderEndTime + : commitStartTime; + completedRenderEndTime = commitEndTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-dark"), + (reusableLaneOptions.start = suspendedCommitReason), + (reusableLaneOptions.end = completedRenderEndTime), + performance.measure("Commit", reusableLaneOptions)); + (suspendedCommitReason = spawnedLane) + ? ((rootWithPendingPassiveEffects = root$jscomp$0), + (pendingPassiveEffectsLanes = lanes)) + : (releaseRootPooledCache(root$jscomp$0, remainingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + remainingLanes = root$jscomp$0.pendingLanes; + 0 === remainingLanes && + (legacyErrorBoundariesThatAlreadyFailed = null); + suspendedCommitReason || + commitDoubleInvokeEffectsInDEV(root$jscomp$0); + var root = finishedWork.stateNode; + if ( + injectedHook && + "function" === typeof injectedHook.onCommitFiberRoot + ) + try { + var didError = 128 === (root.current.flags & 128); + switch (previousUpdateLanePriority) { + case DiscreteEventPriority: + var schedulerPriority = ImmediatePriority; + break; + case ContinuousEventPriority: + schedulerPriority = UserBlockingPriority; + break; + case DefaultEventPriority: + schedulerPriority = NormalPriority$1; + break; + case IdleEventPriority: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority$1; + } + injectedHook.onCommitFiberRoot( + rendererID, + root, + schedulerPriority, + didError + ); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + console.error( + "React instrumentation encountered an error: %s", + err + )); + } + isDevToolsPresent && root$jscomp$0.memoizedUpdaters.clear(); + onCommitRoot(); + if (null !== recoverableErrors) { + var onRecoverableError = root$jscomp$0.onRecoverableError; + for ( + finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) { + var recoverableError = recoverableErrors[finishedWork], + errorInfo = makeErrorInfo(recoverableError.stack); + runWithFiberInDEV( + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo + ); + } + } + 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); + ensureRootIsScheduled(root$jscomp$0); + remainingLanes = root$jscomp$0.pendingLanes; + 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + ? ((nestedUpdateScheduled = !0), + root$jscomp$0 === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), + (rootWithNestedUpdates = root$jscomp$0))) + : (nestedUpdateCount = 0); + suspendedCommitReason || finalizeRender(lanes, commitEndTime); + flushSyncWorkAcrossRoots_impl(0, !1); + } + } finally { + (ReactSharedInternals.T = didIncludeRenderPhaseUpdate), + (ReactDOMSharedInternals.p = previousUpdateLanePriority); + } } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -16048,6 +16072,9 @@ var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; + priority.callbackNode = null; + priority.callbackPriority = 0; + priority.cancelPendingCommit = null; if ( (executionContext & (RenderContext | CommitContext)) !== NoContext @@ -16105,6 +16132,7 @@ : (nestedPassiveUpdateCount = 0); didScheduleUpdateDuringPassiveEffects = isFlushingPassiveEffects = !1; + ensureRootIsScheduled(priority); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot @@ -16326,7 +16354,7 @@ shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber), reappearLayoutEffects(root, fiber.alternate, fiber, !1), shouldDoubleInvokePassiveEffects && - reconnectPassiveEffects(root, fiber, 0, null, !1); + reconnectPassiveEffects(root, fiber, 0, null, !1, 0); } finally { setIsStrictModeForDevtools(!1); } @@ -16371,12 +16399,6 @@ addFiberToLanesMap(root, schedulingFiber, lanes); }); } - function scheduleCallback$1(priorityLevel, callback) { - var actQueue = ReactSharedInternals.actQueue; - return null !== actQueue - ? (actQueue.push(callback), fakeActCallbackNode$1) - : scheduleCallback$3(priorityLevel, callback); - } function warnIfUpdatesNotWrappedWithActDEV(fiber) { isConcurrentActEnvironment() && null === ReactSharedInternals.actQueue && @@ -16492,12 +16514,13 @@ } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } + suspendedLanes = pendingPassiveEffectsLanes; currentTime = workInProgressRoot; - suspendedLanes = workInProgressRootRenderLanes; - suspendedLanes = getNextLanes( - root, - root === currentTime ? suspendedLanes : 0 - ); + pingedLanes = workInProgressRootRenderLanes; + suspendedLanes = + root === rootWithPendingPassiveEffects + ? suspendedLanes + : getNextLanes(root, root === currentTime ? pingedLanes : 0); pingedLanes = root.callbackNode; if ( 0 === suspendedLanes || @@ -16547,7 +16570,7 @@ null !== ReactSharedInternals.actQueue ? (ReactSharedInternals.actQueue.push(pingedLanes), (suspendedLanes = fakeActCallbackNode)) - : (suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes)); + : (suspendedLanes = scheduleCallback$2(suspendedLanes, pingedLanes)); root.callbackPriority = currentTime; root.callbackNode = suspendedLanes; return currentTime; @@ -16595,7 +16618,7 @@ }); scheduleMicrotask(function () { (executionContext & (RenderContext | CommitContext)) !== NoContext - ? scheduleCallback$3(ImmediatePriority, cb) + ? scheduleCallback$2(ImmediatePriority, cb) : cb(); }); } @@ -18758,7 +18781,7 @@ console.error( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." ); - else if (canDiffStyleForHydrationWarning) { + else { var clientValue; var delimiter = (clientValue = ""), styleName; @@ -19177,42 +19200,36 @@ } case "src": case "href": - if ( - !( - "" !== propKey || - ("a" === tag && "href" === value) || - ("object" === tag && "data" === value) - ) - ) { - "src" === value - ? console.error( - 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ) - : console.error( - 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ); - hydrateSanitizedAttribute( - domElement, - value, - value, - null, - extraAttributes, - serverDifferences - ); - continue; - } - hydrateSanitizedAttribute( - domElement, - value, - value, - propKey, - extraAttributes, - serverDifferences - ); + "" !== propKey || + ("a" === tag && "href" === value) || + ("object" === tag && "data" === value) + ? hydrateSanitizedAttribute( + domElement, + value, + value, + propKey, + extraAttributes, + serverDifferences + ) + : ("src" === value + ? console.error( + 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ) + : console.error( + 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ), + hydrateSanitizedAttribute( + domElement, + value, + value, + null, + extraAttributes, + serverDifferences + )); continue; case "action": case "formAction": @@ -21347,8 +21364,12 @@ queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(nearestMounted), - root = enqueueConcurrentRenderForLane(nearestMounted, lane); + var lane = requestUpdateLane(nearestMounted); + lane = getBumpedLaneForHydrationByLane(lane); + var root = enqueueConcurrentRenderForLane( + nearestMounted, + lane + ); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); markRetryLaneIfNotHydrated(nearestMounted, lane); @@ -21592,7 +21613,6 @@ REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"); Symbol.for("react.scope"); - Symbol.for("react.debug_trace_mode"); var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); Symbol.for("react.legacy_hidden"); Symbol.for("react.tracing_marker"); @@ -21638,7 +21658,7 @@ rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null), hasOwnProperty = Object.prototype.hasOwnProperty, - scheduleCallback$3 = Scheduler.unstable_scheduleCallback, + scheduleCallback$2 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -21676,11 +21696,6 @@ allNativeEvents = new Set(), registrationNameDependencies = {}, possibleRegistrationNames = {}, - canUseDOM = !( - "undefined" === typeof window || - "undefined" === typeof window.document || - "undefined" === typeof window.document.createElement - ), hasReadOnlyValue = { button: !0, checkbox: !0, @@ -21727,8 +21742,6 @@ containerTagInScope: null }, didWarn = {}, - MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML", - SVG_NAMESPACE = "http://www.w3.org/2000/svg", shorthandToLonghand = { animation: "animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationPlayState animationTimingFunction".split( @@ -21879,6 +21892,8 @@ " " ) ), + MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML", + SVG_NAMESPACE = "http://www.w3.org/2000/svg", aliases = new Map([ ["acceptCharset", "accept-charset"], ["htmlFor", "for"], @@ -22527,6 +22542,11 @@ restoreTarget = null, restoreQueue = null, isInsideEventHandler = !1, + canUseDOM = !( + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ), passiveBrowserEventsSupported = !1; if (canUseDOM) try { @@ -22874,7 +22894,7 @@ detail: { devtools: reusableLaneDevToolDetails } }, blockingLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -22884,7 +22904,7 @@ } }, transitionLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -22894,7 +22914,7 @@ } }, suspenseLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -22904,7 +22924,7 @@ } }, idleLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -22955,6 +22975,59 @@ yieldStartTime = -1.1, currentUpdateIsNested = !1, nestedUpdateScheduled = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber$1 = null, + lastContextDependency = null, + isDisallowedContextReadInDEV = !1, + currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0, + currentEntangledActionThenable = null, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, + NoFlags = 0, + HasEffect = 1, + Insertion = 2, + Layout = 4, + Passive = 8, + AbortControllerLocal = + "undefined" !== typeof AbortController + ? AbortController + : function () { + var listeners = [], + signal = (this.signal = { + aborted: !1, + addEventListener: function (type, listener) { + listeners.push(listener); + } + }); + this.abort = function () { + signal.aborted = !0; + listeners.forEach(function (listener) { + return listener(); + }); + }; + }, + scheduleCallback$1 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0, + _currentRenderer: null, + _currentRenderer2: null + }, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -23149,7 +23222,79 @@ pendingUNSAFE_ComponentWillUpdateWarnings = []; pendingLegacyContextWarning = new Map(); }; - var CapturedStacks = new WeakMap(), + var fakeInternalInstance = {}; + var didWarnAboutStateAssignmentForComponent = new Set(); + var didWarnAboutUninitializedState = new Set(); + var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); + var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); + var didWarnAboutDirectlyAssigningPropsToState = new Set(); + var didWarnAboutUndefinedDerivedState = new Set(); + var didWarnAboutContextTypes$1 = new Set(); + var didWarnAboutChildContextTypes = new Set(); + var didWarnAboutInvalidateContextType = new Set(); + var didWarnOnInvalidCallback = new Set(); + Object.freeze(fakeInternalInstance); + var classComponentUpdater = { + isMounted: function (component) { + var owner = current; + if (null !== owner && isRendering && 1 === owner.tag) { + var instance = owner.stateNode; + instance._warnedAboutRefsInRender || + console.error( + "%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", + getComponentNameFromFiber(owner) || "A component" + ); + instance._warnedAboutRefsInRender = !0; + } + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = ReplaceState; + update.payload = payload; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = ForceUpdate; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + } + }, + CapturedStacks = new WeakMap(), forkStack = [], forkStackIndex = 0, treeForkProvider = null, @@ -23164,68 +23309,29 @@ isHydrating = !1, didSuspendOrErrorDEV = !1, hydrationDiffRootDEV = null, - hydrationErrors = null, - rootOrSingletonContext = !1, - HydrationMismatchException = Error( - "Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." - ), - SuspenseyCommitException = Error( - "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseActionException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." - ), - noopSuspenseyCommitThenable = { - then: function () { - console.error( - 'Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.' - ); - } - }, - suspendedThenable = null, - needsToResetSuspendedThenableDEV = !1, - NoFlags = 0, - HasEffect = 1, - Insertion = 2, - Layout = 4, - Passive = 8, - AbortControllerLocal = - "undefined" !== typeof AbortController - ? AbortController - : function () { - var listeners = [], - signal = (this.signal = { - aborted: !1, - addEventListener: function (type, listener) { - listeners.push(listener); - } - }); - this.abort = function () { - signal.aborted = !0; - listeners.forEach(function (listener) { - return listener(); - }); - }; - }, - scheduleCallback$2 = Scheduler.unstable_scheduleCallback, - NormalPriority = Scheduler.unstable_NormalPriority, - CacheContext = { - $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, - Provider: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0, - _currentRenderer: null, - _currentRenderer2: null + hydrationErrors = null, + rootOrSingletonContext = !1, + HydrationMismatchException = Error( + "Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." + ), + SuspenseyCommitException = Error( + "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseActionException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." + ), + noopSuspenseyCommitThenable = { + then: function () { + console.error( + 'Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.' + ); + } }, - currentEntangledListeners = null, - currentEntangledPendingCount = 0, - currentEntangledLane = 0, - currentEntangledActionThenable = null, + suspendedThenable = null, + needsToResetSuspendedThenableDEV = !1, currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0), prevOnStartTransitionFinish = ReactSharedInternals.S; @@ -23259,7 +23365,7 @@ var didWarnAboutAsyncClientComponent = new Set(); var didWarnAboutUseFormState = new Set(); var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -23273,36 +23379,33 @@ currentHookNameInDev = null, hookTypesDev = null, hookTypesUpdateIndexDev = -1, - ignorePreviousDependencies = !1; - var createFunctionComponentUpdateQueue = function () { - return { lastEffect: null, events: null, stores: null, memoCache: null }; - }; - var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError - }; - ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; - ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; + ignorePreviousDependencies = !1, + ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError + }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; - ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; - ContextOnlyDispatcher.useFormState = throwInvalidHookError; - ContextOnlyDispatcher.useActionState = throwInvalidHookError; - ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -23421,39 +23524,35 @@ mountHookTypesDev(); return mountId(); }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; mountHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - }; - HooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useOptimistic = function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -23559,46 +23658,35 @@ updateHookTypesDev(); return mountId(); }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return mountActionState(action, initialState); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountWithHookTypesInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountWithHookTypesInDEV.useEffectEvent = function ( - callback - ) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return mountEvent(callback); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountWithHookTypesInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return mountOptimistic(passthrough); - }; HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -23704,39 +23792,35 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnUpdateInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnUpdateInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; - HooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -23842,39 +23926,35 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnRerenderInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnRerenderInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; - HooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnRerenderInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -23999,15 +24079,34 @@ mountHookTypesDev(); return mountId(); }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); mountHookTypesDev(); - return mountRefresh(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountOptimistic(passthrough); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -24015,34 +24114,6 @@ return mountEvent(callback); } }; - InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnMountInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -24167,15 +24238,34 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -24183,31 +24273,6 @@ return updateEvent(callback); } }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -24332,15 +24397,34 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -24348,33 +24432,6 @@ return updateEvent(callback); } }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnRerenderInDEV.useFormState = function ( - action - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -24560,78 +24617,6 @@ SubtreeSuspenseContextMask = 1, ForceSuspenseFallback = 2, suspenseStackCursor = createCursor(0), - fakeInternalInstance = {}; - var didWarnAboutStateAssignmentForComponent = new Set(); - var didWarnAboutUninitializedState = new Set(); - var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); - var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); - var didWarnAboutDirectlyAssigningPropsToState = new Set(); - var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypes$1 = new Set(); - var didWarnAboutChildContextTypes = new Set(); - var didWarnAboutInvalidateContextType = new Set(); - var didWarnOnInvalidCallback = new Set(); - Object.freeze(fakeInternalInstance); - var classComponentUpdater = { - isMounted: function (component) { - var owner = current; - if (null !== owner && isRendering && 1 === owner.tag) { - var instance = owner.stateNode; - instance._warnedAboutRefsInRender || - console.error( - "%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", - getComponentNameFromFiber(owner) || "A component" - ); - instance._warnedAboutRefsInRender = !0; - } - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = ReplaceState; - update.payload = payload; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = ForceUpdate; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - } - }, reportGlobalError = "function" === typeof reportError ? reportError @@ -24680,20 +24665,6 @@ retryLane: 0 }, hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -24703,7 +24674,6 @@ nextEffect = null, inProgressLanes = null, inProgressRoot = null, - shouldFireAfterActiveInstanceBlur = !1, hostParent = null, hostParentIsContainer = !1, currentHoistableRoot = null, @@ -24784,7 +24754,6 @@ RENDER_TIMEOUT_MS = 500, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -24805,8 +24774,7 @@ didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); - var fakeActCallbackNode$1 = {}, - firstScheduledRoot = null, + var firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = !1, didScheduleMicrotask_act = !1, @@ -24884,7 +24852,6 @@ didWarnFormActionMethod = !1, didWarnPopoverTargetObject = !1; var didWarnForNewBooleanPropsWithEmptyValue = {}; - var canDiffStyleForHydrationWarning = !0; var NORMALIZE_NEWLINES_REGEX = /\r\n?/g, NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g, xlinkNamespace = "http://www.w3.org/1999/xlink", @@ -25279,52 +25246,43 @@ ), lastScheduledReplayQueue = null; ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = - function (children, JSCompiler_OptimizeArgumentsArray_p2) { + function (children) { var root = this._internalRoot; if (null === root) throw Error("Cannot update an unmounted root."); - "function" === typeof JSCompiler_OptimizeArgumentsArray_p2 + var args = arguments; + "function" === typeof args[1] ? console.error( "does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()." ) - : isValidContainer(JSCompiler_OptimizeArgumentsArray_p2) + : isValidContainer(args[1]) ? console.error( "You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root." ) - : "undefined" !== typeof JSCompiler_OptimizeArgumentsArray_p2 && + : "undefined" !== typeof args[1] && console.error( "You passed a second argument to root.render(...) but it only accepts one argument." ); - JSCompiler_OptimizeArgumentsArray_p2 = root.current; - var lane = requestUpdateLane(JSCompiler_OptimizeArgumentsArray_p2); - updateContainerImpl( - JSCompiler_OptimizeArgumentsArray_p2, - lane, - children, - root, - null, - null - ); + args = children; + var current = root.current, + lane = requestUpdateLane(current); + updateContainerImpl(current, lane, args, root, null, null); }; ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = - function (JSCompiler_OptimizeArgumentsArray_p3) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p3 && + function () { + var args = arguments; + "function" === typeof args[0] && console.error( "does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()." ); - JSCompiler_OptimizeArgumentsArray_p3 = this._internalRoot; - if (null !== JSCompiler_OptimizeArgumentsArray_p3) { + args = this._internalRoot; + if (null !== args) { this._internalRoot = null; - var container = JSCompiler_OptimizeArgumentsArray_p3.containerInfo; + var container = args.containerInfo; (executionContext & (RenderContext | CommitContext)) !== NoContext && console.error( "Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition." ); - updateContainerSync( - null, - JSCompiler_OptimizeArgumentsArray_p3, - null, - null - ); + updateContainerSync(null, args, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; } @@ -25348,11 +25306,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7283a213-20241206" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-7eb8234f-20241218" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-7283a213-20241206\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-experimental-7eb8234f-20241218\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -25389,11 +25347,10 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-experimental-7283a213-20241206", + version: "19.1.0-experimental-7eb8234f-20241218", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7283a213-20241206" + reconcilerVersion: "19.1.0-experimental-7eb8234f-20241218" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25582,11 +25539,13 @@ initialChildren.context = getContextForSubtree(null); options = initialChildren.current; isStrictMode = requestUpdateLane(options); + isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode); identifierPrefix = createUpdate(isStrictMode); identifierPrefix.callback = null; enqueueUpdate(options, identifierPrefix, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated$1(initialChildren, isStrictMode); + options = isStrictMode; + initialChildren.current.lanes = options; + markRootUpdated$1(initialChildren, options); ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); @@ -25865,7 +25824,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-experimental-7283a213-20241206"; + exports.version = "19.1.0-experimental-7eb8234f-20241218"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js index 08905f33ea0f8..4e2a290d727ab 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js @@ -55,7 +55,6 @@ var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"); Symbol.for("react.scope"); -Symbol.for("react.debug_trace_mode"); var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); Symbol.for("react.legacy_hidden"); Symbol.for("react.tracing_marker"); @@ -346,13 +345,11 @@ function describeFiber(fiber) { return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -560,7 +557,7 @@ function popHostContext(fiber) { (HostTransitionContext._currentValue = sharedNotPendingObject)); } var hasOwnProperty = Object.prototype.hasOwnProperty, - scheduleCallback$3 = Scheduler.unstable_scheduleCallback, + scheduleCallback$2 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -576,34 +573,6 @@ var hasOwnProperty = Object.prototype.hasOwnProperty, rendererID = null, injectedHook = null, isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__; -function onCommitRoot(root, eventPriority) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - var didError = 128 === (root.current.flags & 128); - switch (eventPriority) { - case 2: - var schedulerPriority = ImmediatePriority; - break; - case 8: - schedulerPriority = UserBlockingPriority; - break; - case 32: - schedulerPriority = NormalPriority$1; - break; - case 268435456: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority$1; - } - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } catch (err) {} -} function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); if (injectedHook && "function" === typeof injectedHook.setStrictMode) @@ -784,54 +753,6 @@ function markRootUpdated$1(root, updateLane) { 268435456 !== updateLane && ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); } -function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes -) { - var previouslyPendingLanes = root.pendingLanes; - root.pendingLanes = remainingLanes; - root.suspendedLanes = 0; - root.pingedLanes = 0; - root.warmLanes = 0; - root.expiredLanes &= remainingLanes; - root.entangledLanes &= remainingLanes; - root.errorRecoveryDisabledLanes &= remainingLanes; - root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - for ( - remainingLanes = previouslyPendingLanes & ~remainingLanes; - 0 < remainingLanes; - - ) { - var index$7 = 31 - clz32(remainingLanes), - lane = 1 << index$7; - entanglements[index$7] = 0; - expirationTimes[index$7] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$7]; - if (null !== hiddenUpdatesForLane) - for ( - hiddenUpdates[index$7] = null, index$7 = 0; - index$7 < hiddenUpdatesForLane.length; - index$7++ - ) { - var update = hiddenUpdatesForLane[index$7]; - null !== update && (update.lane &= -536870913); - } - remainingLanes &= ~lane; - } - 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); -} function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; root.suspendedLanes &= ~spawnedLane; @@ -852,6 +773,46 @@ function markRootEntangled(root, entangledLanes) { rootEntangledLanes &= ~lane; } } +function getBumpedLaneForHydrationByLane(lane) { + switch (lane) { + case 2: + lane = 1; + break; + case 8: + lane = 4; + break; + case 32: + lane = 16; + break; + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + lane = 64; + break; + case 268435456: + lane = 134217728; + break; + default: + lane = 0; + } + return lane; +} function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { @@ -998,12 +959,7 @@ function registerDirectEvent(registrationName, dependencies) { ) allNativeEvents.add(dependencies[registrationName]); } -var canUseDOM = !( - "undefined" === typeof window || - "undefined" === typeof window.document || - "undefined" === typeof window.document.createElement - ), - VALID_ATTRIBUTE_NAME_REGEX = RegExp( +var VALID_ATTRIBUTE_NAME_REGEX = RegExp( "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$" ), illegalAttributeNameCache = {}, @@ -1612,7 +1568,12 @@ function getListener(inst, registrationName) { ); return stateNode; } -var passiveBrowserEventsSupported = !1; +var canUseDOM = !( + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ), + passiveBrowserEventsSupported = !1; if (canUseDOM) try { var options = {}; @@ -2099,19 +2060,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$305; + var JSCompiler_inline_result$jscomp$302; if (canUseDOM) { - var isSupported$jscomp$inline_441 = "oninput" in document; - if (!isSupported$jscomp$inline_441) { - var element$jscomp$inline_442 = document.createElement("div"); - element$jscomp$inline_442.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_441 = - "function" === typeof element$jscomp$inline_442.oninput; + var isSupported$jscomp$inline_432 = "oninput" in document; + if (!isSupported$jscomp$inline_432) { + var element$jscomp$inline_433 = document.createElement("div"); + element$jscomp$inline_433.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_432 = + "function" === typeof element$jscomp$inline_433.oninput; } - JSCompiler_inline_result$jscomp$305 = isSupported$jscomp$inline_441; - } else JSCompiler_inline_result$jscomp$305 = !1; + JSCompiler_inline_result$jscomp$302 = isSupported$jscomp$inline_432; + } else JSCompiler_inline_result$jscomp$302 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$305 && + JSCompiler_inline_result$jscomp$302 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2263,97 +2224,6 @@ function hasSelectionCapabilities(elem) { "true" === elem.contentEditable) ); } -function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if (null !== priorSelectionRange && hasSelectionCapabilities(containerInfo)) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - curFocusedElem = curFocusedElem.getSelection(); - var length = containerInfo.textContent.length, - start = Math.min(priorSelectionRange.start, length); - priorSelectionRange = - void 0 === priorSelectionRange.end - ? start - : Math.min(priorSelectionRange.end, length); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (1 !== curFocusedElem.rangeCount || - curFocusedElem.anchorNode !== length.node || - curFocusedElem.anchorOffset !== length.offset || - curFocusedElem.focusNode !== endMarker.node || - curFocusedElem.focusOffset !== endMarker.offset) && - ((priorSelectionInformation = - priorSelectionInformation.createRange()), - priorSelectionInformation.setStart(length.node, length.offset), - curFocusedElem.removeAllRanges(), - start > priorSelectionRange - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } -} var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && 11 >= document.documentMode, activeElement = null, @@ -2484,7 +2354,7 @@ function setCurrentTrackFromLanes(lanes) { : "Other"; } var blockingLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -2494,7 +2364,7 @@ var blockingLaneMarker = { } }, transitionLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -2504,7 +2374,7 @@ var blockingLaneMarker = { } }, suspenseLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -2514,7 +2384,7 @@ var blockingLaneMarker = { } }, idleLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -2523,6 +2393,26 @@ var blockingLaneMarker = { } } }; +function logComponentRender(fiber, startTime, endTime) { + var name = getComponentNameFromFiber(fiber); + if (null !== name && supportsUserTiming) { + var selfTime = fiber.actualDuration; + if (null === fiber.alternate || fiber.alternate.child !== fiber.child) + for (fiber = fiber.child; null !== fiber; fiber = fiber.sibling) + selfTime -= fiber.actualDuration; + reusableComponentDevToolDetails.color = + 0.5 > selfTime + ? "primary-light" + : 10 > selfTime + ? "primary" + : 100 > selfTime + ? "primary-dark" + : "error"; + reusableComponentOptions.start = startTime; + reusableComponentOptions.end = endTime; + performance.measure(name, reusableComponentOptions); + } +} function logComponentEffect(fiber, startTime, endTime, selfTime) { fiber = getComponentNameFromFiber(fiber); null !== fiber && @@ -2539,23 +2429,18 @@ function logComponentEffect(fiber, startTime, endTime, selfTime) { (reusableComponentOptions.end = endTime), performance.measure(fiber, reusableComponentOptions)); } -function logRenderPhase(startTime, endTime) { +function logSuspendedRenderPhase(startTime, endTime, lanes) { supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Render", reusableLaneOptions)); -} -function logSuspendedRenderPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Prewarm", reusableLaneOptions)); } -function logSuspendedWithDelayPhase(startTime, endTime) { +function logSuspendedWithDelayPhase(startTime, endTime, lanes) { supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Suspended", reusableLaneOptions)); @@ -2567,27 +2452,6 @@ function logErroredRenderPhase(startTime, endTime) { (reusableLaneOptions.end = endTime), performance.measure("Errored Render", reusableLaneOptions)); } -function logSuspenseThrottlePhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-light"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Throttled", reusableLaneOptions)); -} -function logSuspendedCommitPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-light"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Suspended", reusableLaneOptions)); -} -function logCommitPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-dark"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Commit", reusableLaneOptions)); -} var concurrentQueues = [], concurrentQueuesIndex = 0, concurrentlyUpdatedLanes = 0; @@ -2788,378 +2652,193 @@ function transferActualDuration(fiber) { for (var child = fiber.child; child; ) (fiber.actualDuration += child.actualDuration), (child = child.sibling); } -var CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; - } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; +var valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = null; +function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue); + context._currentValue = nextValue; } -var forkStack = [], - forkStackIndex = 0, - treeForkProvider = null, - treeForkCount = 0, - idStack = [], - idStackIndex = 0, - treeContextProvider = null, - treeContextId = 1, - treeContextOverflow = ""; -function pushTreeFork(workInProgress, totalChildren) { - forkStack[forkStackIndex++] = treeForkCount; - forkStack[forkStackIndex++] = treeForkProvider; - treeForkProvider = workInProgress; - treeForkCount = totalChildren; +function popProvider(context) { + context._currentValue = valueCursor.current; + pop(valueCursor); } -function pushTreeId(workInProgress, totalChildren, index) { - idStack[idStackIndex++] = treeContextId; - idStack[idStackIndex++] = treeContextOverflow; - idStack[idStackIndex++] = treeContextProvider; - treeContextProvider = workInProgress; - var baseIdWithLeadingBit = treeContextId; - workInProgress = treeContextOverflow; - var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; - baseIdWithLeadingBit &= ~(1 << baseLength); - index += 1; - var length = 32 - clz32(totalChildren) + baseLength; - if (30 < length) { - var numberOfOverflowBits = baseLength - (baseLength % 5); - length = ( - baseIdWithLeadingBit & - ((1 << numberOfOverflowBits) - 1) - ).toString(32); - baseIdWithLeadingBit >>= numberOfOverflowBits; - baseLength -= numberOfOverflowBits; - treeContextId = - (1 << (32 - clz32(totalChildren) + baseLength)) | - (index << baseLength) | - baseIdWithLeadingBit; - treeContextOverflow = length + workInProgress; - } else - (treeContextId = - (1 << length) | (index << baseLength) | baseIdWithLeadingBit), - (treeContextOverflow = workInProgress); +function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { + for (; null !== parent; ) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes + ? ((parent.childLanes |= renderLanes), + null !== alternate && (alternate.childLanes |= renderLanes)) + : null !== alternate && + (alternate.childLanes & renderLanes) !== renderLanes && + (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; + } } -function pushMaterializedTreeId(workInProgress) { - null !== workInProgress.return && - (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); +function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + for (var i = 0; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; + } + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) throw Error(formatProdErrorMessage(341)); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; + } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; + } } -function popTreeContext(workInProgress) { - for (; workInProgress === treeForkProvider; ) - (treeForkProvider = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null), - (treeForkCount = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null); - for (; workInProgress === treeContextProvider; ) - (treeContextProvider = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextOverflow = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextId = idStack[--idStackIndex]), - (idStack[idStackIndex] = null); -} -var hydrationParentFiber = null, - nextHydratableInstance = null, - isHydrating = !1, - hydrationErrors = null, - rootOrSingletonContext = !1, - HydrationMismatchException = Error(formatProdErrorMessage(519)); -function throwOnHydrationMismatch(fiber) { - var error = Error(formatProdErrorMessage(418, "")); - queueHydrationError(createCapturedValueAtFiber(error, fiber)); - throw HydrationMismatchException; +function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree +) { + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; + + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current ? current.push(context) : (current = [context])); + } + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); + } + parent = parent.return; + } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } -function prepareToHydrateHostInstance(fiber) { - var instance = fiber.stateNode, - type = fiber.type, - props = fiber.memoizedProps; - instance[internalInstanceKey] = fiber; - instance[internalPropsKey] = props; - switch (type) { - case "dialog": - listenToNonDelegatedEvent("cancel", instance); - listenToNonDelegatedEvent("close", instance); - break; - case "iframe": - case "object": - case "embed": - listenToNonDelegatedEvent("load", instance); - break; - case "video": - case "audio": - for (type = 0; type < mediaEventTypes.length; type++) - listenToNonDelegatedEvent(mediaEventTypes[type], instance); - break; - case "source": - listenToNonDelegatedEvent("error", instance); - break; - case "img": - case "image": - case "link": - listenToNonDelegatedEvent("error", instance); - listenToNonDelegatedEvent("load", instance); - break; - case "details": - listenToNonDelegatedEvent("toggle", instance); - break; - case "input": - listenToNonDelegatedEvent("invalid", instance); - initInput( - instance, - props.value, - props.defaultValue, - props.checked, - props.defaultChecked, - props.type, - props.name, - !0 - ); - track(instance); - break; - case "select": - listenToNonDelegatedEvent("invalid", instance); - break; - case "textarea": - listenToNonDelegatedEvent("invalid", instance), - initTextarea(instance, props.value, props.defaultValue, props.children), - track(instance); +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; } - type = props.children; - ("string" !== typeof type && - "number" !== typeof type && - "bigint" !== typeof type) || - instance.textContent === "" + type || - !0 === props.suppressHydrationWarning || - checkForUnmatchedText(instance.textContent, type) - ? (null != props.popover && - (listenToNonDelegatedEvent("beforetoggle", instance), - listenToNonDelegatedEvent("toggle", instance)), - null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), - null != props.onScrollEnd && - listenToNonDelegatedEvent("scrollend", instance), - null != props.onClick && (instance.onclick = noop$2), - (instance = !0)) - : (instance = !1); - instance || throwOnHydrationMismatch(fiber); + return !1; } -function popToNextHostParent(fiber) { - for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) - switch (hydrationParentFiber.tag) { - case 3: - case 27: - rootOrSingletonContext = !0; - return; - case 5: - case 13: - rootOrSingletonContext = !1; - return; - default: - hydrationParentFiber = hydrationParentFiber.return; - } +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) return !1; - if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; - var shouldClear = !1, - JSCompiler_temp; - if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { - if ((JSCompiler_temp = 5 === fiber.tag)) - (JSCompiler_temp = fiber.type), - (JSCompiler_temp = - !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || - shouldSetTextContent(fiber.type, fiber.memoizedProps)); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && (shouldClear = !0); - shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); - popToNextHostParent(fiber); - if (13 === fiber.tag) { - fiber = fiber.memoizedState; - fiber = null !== fiber ? fiber.dehydrated : null; - if (!fiber) throw Error(formatProdErrorMessage(317)); - a: { - fiber = fiber.nextSibling; - for (shouldClear = 0; fiber; ) { - if (8 === fiber.nodeType) - if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { - if (0 === shouldClear) { - nextHydratableInstance = getNextHydratable(fiber.nextSibling); - break a; - } - shouldClear--; - } else - ("$" !== JSCompiler_temp && - "$!" !== JSCompiler_temp && - "$?" !== JSCompiler_temp) || - shouldClear++; - fiber = fiber.nextSibling; - } - nextHydratableInstance = null; - } - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - isHydrating = !1; +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); +function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) throw Error(formatProdErrorMessage(308)); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } -var SuspenseException = Error(formatProdErrorMessage(460)), - SuspenseyCommitException = Error(formatProdErrorMessage(474)), - SuspenseActionException = Error(formatProdErrorMessage(542)), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; -} -function noop$4() {} -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop$4, noop$4), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop$4, noop$4); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error(formatProdErrorMessage(482)); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; - } -} -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; -} -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error(formatProdErrorMessage(483)); -} -var AbortControllerLocal = - "undefined" !== typeof AbortController - ? AbortController - : function () { - var listeners = [], - signal = (this.signal = { - aborted: !1, - addEventListener: function (type, listener) { - listeners.push(listener); - } - }); - this.abort = function () { - signal.aborted = !0; - listeners.forEach(function (listener) { - return listener(); - }); - }; - }, - scheduleCallback$2 = Scheduler.unstable_scheduleCallback, - NormalPriority = Scheduler.unstable_NormalPriority, - CacheContext = { - $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, - Provider: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; -function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; -} -function releaseCache(cache) { - cache.refCount--; - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); -} -var currentEntangledListeners = null, - currentEntangledPendingCount = 0, - currentEntangledLane = 0, - currentEntangledActionThenable = null; -function entangleAsyncAction(transition, thenable) { - if (null === currentEntangledListeners) { - var entangledListeners = (currentEntangledListeners = []); - currentEntangledPendingCount = 0; - currentEntangledLane = requestTransitionLane(); - currentEntangledActionThenable = { - status: "pending", - value: void 0, - then: function (resolve) { - entangledListeners.push(resolve); - } - }; - } - currentEntangledPendingCount++; - thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); - return thenable; +var currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0, + currentEntangledActionThenable = null; +function entangleAsyncAction(transition, thenable) { + if (null === currentEntangledListeners) { + var entangledListeners = (currentEntangledListeners = []); + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); + currentEntangledActionThenable = { + status: "pending", + value: void 0, + then: function (resolve) { + entangledListeners.push(resolve); + } + }; + } + currentEntangledPendingCount++; + thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); + return thenable; } function pingEngtangledActionScope() { if ( @@ -3201,1346 +2880,1158 @@ function chainThenableValue(thenable, result) { ); return thenableWithOverride; } -var currentTreeHiddenStackCursor = createCursor(null), - prevEntangledRenderLanesCursor = createCursor(0); -function pushHiddenContext(fiber, context) { - fiber = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, fiber); - push(currentTreeHiddenStackCursor, context); - entangledRenderLanes = fiber | context.baseLanes; +var hasForceUpdate = !1; +function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; } -function reuseHiddenContextOnStack() { - push(prevEntangledRenderLanesCursor, entangledRenderLanes); - push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); +function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); } -function popHiddenContext() { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor); - pop(prevEntangledRenderLanesCursor); +function createUpdate(lane) { + return { lane: lane, tag: 0, payload: null, callback: null, next: null }; } -var prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { +function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if (0 !== (executionContext & 2)) { + var pending = updateQueue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + updateQueue.pending = update; + update = getRootForUpdatedFiber(fiber); + markUpdateLaneFromFiberToRoot(fiber, null, lane); + return update; + } + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); +} +function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } +} +function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; if ( - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then + null !== current && + ((current = current.updateQueue), queue === current) ) { - if (0 > transitionStartTime && 0 > transitionUpdateTime) { - transitionStartTime = now(); - var newEventTime = resolveEventTimeStamp(), - newEventType = resolveEventType(); - if ( - newEventTime !== transitionEventTime || - newEventType !== transitionEventType - ) - transitionEventIsRepeat = !1; - transitionEventTime = newEventTime; - transitionEventType = newEventType; - } - entangleAsyncAction(transition, returnValue); + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; } - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; } -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); -} -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; -} -var renderLanes = 0, - currentlyRenderingFiber$1 = null, - currentHook = null, - workInProgressHook = null, - didScheduleRenderPhaseUpdate = !1, - didScheduleRenderPhaseUpdateDuringThisPass = !1, - shouldDoubleInvokeUserFnsInHooksDEV = !1, - localIdCounter = 0, - thenableIndexCounter$1 = 0, - thenableState$1 = null, - globalClientIdCounter = 0; -function throwInvalidHookError() { - throw Error(formatProdErrorMessage(321)); -} -function areHookInputsEqual(nextDeps, prevDeps) { - if (null === prevDeps) return !1; - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; +var didReadFromEntangledAsyncAction = !1; +function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } } -function renderWithHooks( - current, - workInProgress, - Component, +function processUpdateQueue( + workInProgress$jscomp$0, props, - secondArg, - nextRenderLanes + instance$jscomp$0, + renderLanes ) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null === current || null === current.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate; - shouldDoubleInvokeUserFnsInHooksDEV = !1; - nextRenderLanes = Component(props, secondArg); - shouldDoubleInvokeUserFnsInHooksDEV = !1; - didScheduleRenderPhaseUpdateDuringThisPass && - (nextRenderLanes = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - )); - finishRenderingHooks(current); - return nextRenderLanes; -} -function finishRenderingHooks(current) { - ReactSharedInternals.H = ContextOnlyDispatcher; - var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter$1 = 0; - thenableState$1 = null; - if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); - null === current || - didReceiveUpdate || - ((current = current.dependencies), + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress$jscomp$0.updateQueue; + hasForceUpdate = !1; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress$jscomp$0.alternate; null !== current && - checkIfContextChanged(current) && - (didReceiveUpdate = !0)); -} -function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); - thenableIndexCounter$1 = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); - numberOfReRenders += 1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); - } - ReactSharedInternals.H = HooksDispatcherOnRerender; - children = Component(props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; -} -function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && - (currentlyRenderingFiber$1.flags |= 1024); - return maybeThenable; -} -function checkDidRenderIdHook() { - var didRenderIdHook = 0 !== localIdCounter; - localIdCounter = 0; - return didRenderIdHook; + ((current = current.updateQueue), + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); + } + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; + do { + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; + if ( + isHiddenUpdate + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + var workInProgress = workInProgress$jscomp$0, + update = pendingQueue; + updateLane = props; + var instance = instance$jscomp$0; + switch (update.tag) { + case 1: + workInProgress = update.payload; + if ("function" === typeof workInProgress) { + newState = workInProgress.call(instance, newState, updateLane); + break a; + } + newState = workInProgress; + break a; + case 3: + workInProgress.flags = (workInProgress.flags & -65537) | 128; + case 0: + workInProgress = update.payload; + updateLane = + "function" === typeof workInProgress + ? workInProgress.call(instance, newState, updateLane) + : workInProgress; + if (null === updateLane || void 0 === updateLane) break a; + newState = assign({}, newState, updateLane); + break a; + case 2: + hasForceUpdate = !0; + } + } + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress$jscomp$0.flags |= 64), + isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); + } else + (isHiddenUpdate = { + lane: updateLane, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, + next: null + }), + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress$jscomp$0.lanes = lastBaseUpdate; + workInProgress$jscomp$0.memoizedState = newState; + } } -function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags &= -2053; - current.lanes &= ~lanes; +function callCallback(callback, context) { + if ("function" !== typeof callback) + throw Error(formatProdErrorMessage(191, callback)); + callback.call(context); } -function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { +function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; - } - didScheduleRenderPhaseUpdate = !1; - } - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter$1 = localIdCounter = 0; - thenableState$1 = null; + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } -function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null +var AbortControllerLocal = + "undefined" !== typeof AbortController + ? AbortController + : function () { + var listeners = [], + signal = (this.signal = { + aborted: !1, + addEventListener: function (type, listener) { + listeners.push(listener); + } + }); + this.abort = function () { + signal.aborted = !0; + listeners.forEach(function (listener) { + return listener(); + }); + }; + }, + scheduleCallback$1 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }; +function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; } -function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) - throw Error(formatProdErrorMessage(467)); - throw Error(formatProdErrorMessage(310)); - } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; +function releaseCache(cache) { + cache.refCount--; + 0 === cache.refCount && + scheduleCallback$1(NormalPriority, function () { + cache.controller.abort(); + }); } -var createFunctionComponentUpdateQueue; -createFunctionComponentUpdateQueue = function () { - return { lastEffect: null, events: null, stores: null, memoCache: null }; +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps +) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); +} +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + } }; -function useThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = []); - thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null === index || null === index.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate)); - return thenable; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } -function use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); +} +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } - throw Error(formatProdErrorMessage(438, String(usable))); + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$32 in Component) + void 0 === newProps[propName$32] && + (newProps[propName$32] = Component[propName$32]); + } + return newProps; } -function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; - null !== current && - ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); +var CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + CapturedStacks.set(value, source); + return source; } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; - current < size; - current++ - ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - memoCache.index++; - return updateQueue; + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } -function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; -} -function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); -} -function updateReducerImpl(hook, current, reducer) { - var queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var baseQueue = hook.baseQueue, - pendingQueue = queue.pending; - if (null !== pendingQueue) { - if (null !== baseQueue) { - var baseFirst = baseQueue.next; - baseQueue.next = pendingQueue.next; - pendingQueue.next = baseFirst; - } - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; - } - pendingQueue = hook.baseState; - if (null === baseQueue) hook.memoizedState = pendingQueue; - else { - current = baseQueue.next; - var newBaseQueueFirst = (baseFirst = null), - newBaseQueueLast = null, - update = current, - didReadFromEntangledAsyncAction$30 = !1; - do { - var updateLane = update.lane & -536870913; - if ( - updateLane !== update.lane - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - var revertLane = update.revertLane; - if (0 === revertLane) - null !== newBaseQueueLast && - (newBaseQueueLast = newBaseQueueLast.next = - { - lane: 0, - revertLane: 0, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$30 = !0); - else if ((renderLanes & revertLane) === revertLane) { - update = update.next; - revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$30 = !0); - continue; - } else - (updateLane = { - lane: 0, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); - } else - (revertLane = { - lane: updateLane, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); - if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$30 && - ((reducer = currentEntangledActionThenable), null !== reducer)) - ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; - } - null === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; -} -function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; +var forkStack = [], + forkStackIndex = 0, + treeForkProvider = null, + treeForkCount = 0, + idStack = [], + idStackIndex = 0, + treeContextProvider = null, + treeContextId = 1, + treeContextOverflow = ""; +function pushTreeFork(workInProgress, totalChildren) { + forkStack[forkStackIndex++] = treeForkCount; + forkStack[forkStackIndex++] = treeForkProvider; + treeForkProvider = workInProgress; + treeForkCount = totalChildren; } -function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = updateWorkInProgressHook(), - isHydrating$jscomp$0 = isHydrating; - if (isHydrating$jscomp$0) { - if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else getServerSnapshot = getSnapshot(); - var snapshotChanged = !objectIs( - (currentHook || hook).memoizedState, - getServerSnapshot - ); - snapshotChanged && - ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); - hook = hook.queue; - updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ - subscribe - ]); - if ( - hook.getSnapshot !== getSnapshot || - snapshotChanged || - (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) - ) { - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - hook, - getServerSnapshot, - getSnapshot - ), - null - ); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - return getServerSnapshot; +function pushTreeId(workInProgress, totalChildren, index) { + idStack[idStackIndex++] = treeContextId; + idStack[idStackIndex++] = treeContextOverflow; + idStack[idStackIndex++] = treeContextProvider; + treeContextProvider = workInProgress; + var baseIdWithLeadingBit = treeContextId; + workInProgress = treeContextOverflow; + var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; + baseIdWithLeadingBit &= ~(1 << baseLength); + index += 1; + var length = 32 - clz32(totalChildren) + baseLength; + if (30 < length) { + var numberOfOverflowBits = baseLength - (baseLength % 5); + length = ( + baseIdWithLeadingBit & + ((1 << numberOfOverflowBits) - 1) + ).toString(32); + baseIdWithLeadingBit >>= numberOfOverflowBits; + baseLength -= numberOfOverflowBits; + treeContextId = + (1 << (32 - clz32(totalChildren) + baseLength)) | + (index << baseLength) | + baseIdWithLeadingBit; + treeContextOverflow = length + workInProgress; + } else + (treeContextId = + (1 << length) | (index << baseLength) | baseIdWithLeadingBit), + (treeContextOverflow = workInProgress); } -function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); +function pushMaterializedTreeId(workInProgress) { + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); } -function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); +function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider; ) + (treeForkProvider = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null), + (treeForkCount = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null); + for (; workInProgress === treeContextProvider; ) + (treeContextProvider = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextOverflow = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextId = idStack[--idStackIndex]), + (idStack[idStackIndex] = null); } -function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); - }); +var hydrationParentFiber = null, + nextHydratableInstance = null, + isHydrating = !1, + hydrationErrors = null, + rootOrSingletonContext = !1, + HydrationMismatchException = Error(formatProdErrorMessage(519)); +function throwOnHydrationMismatch(fiber) { + var error = Error(formatProdErrorMessage(418, "")); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } -function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - inst = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(inst, nextValue); - } catch (error) { - return !0; +function prepareToHydrateHostInstance(fiber) { + var instance = fiber.stateNode, + type = fiber.type, + props = fiber.memoizedProps; + instance[internalInstanceKey] = fiber; + instance[internalPropsKey] = props; + switch (type) { + case "dialog": + listenToNonDelegatedEvent("cancel", instance); + listenToNonDelegatedEvent("close", instance); + break; + case "iframe": + case "object": + case "embed": + listenToNonDelegatedEvent("load", instance); + break; + case "video": + case "audio": + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], instance); + break; + case "source": + listenToNonDelegatedEvent("error", instance); + break; + case "img": + case "image": + case "link": + listenToNonDelegatedEvent("error", instance); + listenToNonDelegatedEvent("load", instance); + break; + case "details": + listenToNonDelegatedEvent("toggle", instance); + break; + case "input": + listenToNonDelegatedEvent("invalid", instance); + initInput( + instance, + props.value, + props.defaultValue, + props.checked, + props.defaultChecked, + props.type, + props.name, + !0 + ); + track(instance); + break; + case "select": + listenToNonDelegatedEvent("invalid", instance); + break; + case "textarea": + listenToNonDelegatedEvent("invalid", instance), + initTextarea(instance, props.value, props.defaultValue, props.children), + track(instance); } + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + instance.textContent === "" + type || + !0 === props.suppressHydrationWarning || + checkForUnmatchedText(instance.textContent, type) + ? (null != props.popover && + (listenToNonDelegatedEvent("beforetoggle", instance), + listenToNonDelegatedEvent("toggle", instance)), + null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), + null != props.onScrollEnd && + listenToNonDelegatedEvent("scrollend", instance), + null != props.onClick && (instance.onclick = noop$2), + (instance = !0)) + : (instance = !1); + instance || throwOnHydrationMismatch(fiber); } -function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); -} -function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - initialStateInitializer(); - } finally { - setIsStrictModeForDevtools(!1); - } +function popToNextHostParent(fiber) { + for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) + switch (hydrationParentFiber.tag) { + case 3: + case 27: + rootOrSingletonContext = !0; + return; + case 5: + case 13: + rootOrSingletonContext = !1; + return; + default: + hydrationParentFiber = hydrationParentFiber.return; } - } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState - }; - return hook; -} -function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer - ); } -function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload -) { - if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); - fiber = actionQueue.action; - if (null !== fiber) { - var actionNode = { - payload: payload, - action: fiber, - next: null, - isTransition: !0, - status: "pending", - value: null, - reason: null, - listeners: [], - then: function (listener) { - actionNode.listeners.push(listener); - } - }; - null !== ReactSharedInternals.T - ? setPendingState(!0) - : (actionNode.isTransition = !1); - setState(actionNode); - setPendingState = actionQueue.pending; - null === setPendingState - ? ((actionNode.next = actionQueue.pending = actionNode), - runActionStateAction(actionQueue, actionNode)) - : ((actionNode.next = setPendingState.next), - (actionQueue.pending = setPendingState.next = actionNode)); +function popHydrationState(fiber) { + if (fiber !== hydrationParentFiber) return !1; + if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; + var shouldClear = !1, + JSCompiler_temp; + if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { + if ((JSCompiler_temp = 5 === fiber.tag)) + (JSCompiler_temp = fiber.type), + (JSCompiler_temp = + !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || + shouldSetTextContent(fiber.type, fiber.memoizedProps)); + JSCompiler_temp = !JSCompiler_temp; } -} -function runActionStateAction(actionQueue, node) { - var action = node.action, - payload = node.payload, - prevState = actionQueue.state; - if (node.isTransition) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error) { - onActionError(actionQueue, node, error); - } finally { - ReactSharedInternals.T = prevTransition; + JSCompiler_temp && (shouldClear = !0); + shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); + popToNextHostParent(fiber); + if (13 === fiber.tag) { + fiber = fiber.memoizedState; + fiber = null !== fiber ? fiber.dehydrated : null; + if (!fiber) throw Error(formatProdErrorMessage(317)); + a: { + fiber = fiber.nextSibling; + for (shouldClear = 0; fiber; ) { + if (8 === fiber.nodeType) + if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { + if (0 === shouldClear) { + nextHydratableInstance = getNextHydratable(fiber.nextSibling); + break a; + } + shouldClear--; + } else + ("$" !== JSCompiler_temp && + "$!" !== JSCompiler_temp && + "$?" !== JSCompiler_temp) || + shouldClear++; + fiber = fiber.nextSibling; + } + nextHydratableInstance = null; } } else - try { - (prevTransition = action(prevState, payload)), - handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$36) { - onActionError(actionQueue, node, error$36); - } + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; } -function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ) - : onActionSuccess(actionQueue, node, returnValue); +function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + isHydrating = !1; } -function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); +function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); } -function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); - } - actionQueue.action = null; -} -function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); -} -function actionStateReducer(oldState, newState) { - return newState; +var SuspenseException = Error(formatProdErrorMessage(460)), + SuspenseyCommitException = Error(formatProdErrorMessage(474)), + SuspenseActionException = Error(formatProdErrorMessage(542)), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; } -function mountActionState(action, initialStateProp) { - if (isHydrating) { - var ssrFormState = workInProgressRoot.formState; - if (null !== ssrFormState) { - a: { - var JSCompiler_inline_result = currentlyRenderingFiber$1; - if (isHydrating) { - if (nextHydratableInstance) { - b: { - var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; - for ( - var inRootOrSingleton = rootOrSingletonContext; - 8 !== JSCompiler_inline_result$jscomp$0.nodeType; - - ) { - if (!inRootOrSingleton) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - JSCompiler_inline_result$jscomp$0 = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - if (null === JSCompiler_inline_result$jscomp$0) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - } - inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; - JSCompiler_inline_result$jscomp$0 = - "F!" === inRootOrSingleton || "F" === inRootOrSingleton - ? JSCompiler_inline_result$jscomp$0 - : null; +function noop$4() {} +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop$4, noop$4), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop$4, noop$4); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error(formatProdErrorMessage(482)); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; } - if (JSCompiler_inline_result$jscomp$0) { - nextHydratableInstance = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - JSCompiler_inline_result = - "F!" === JSCompiler_inline_result$jscomp$0.data; - break a; + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; } } - throwOnHydrationMismatch(JSCompiler_inline_result); - } - JSCompiler_inline_result = !1; + ); } - JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); - } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; } - ssrFormState = mountWorkInProgressHook(); - ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; - JSCompiler_inline_result = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - ssrFormState.queue = JSCompiler_inline_result; - ssrFormState = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result - ); - JSCompiler_inline_result.dispatch = ssrFormState; - JSCompiler_inline_result = mountStateImpl(!1); - inRootOrSingleton = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !1, - JSCompiler_inline_result.queue - ); - JSCompiler_inline_result = mountWorkInProgressHook(); - JSCompiler_inline_result$jscomp$0 = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; - ssrFormState = dispatchActionState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result$jscomp$0, - inRootOrSingleton, - ssrFormState - ); - JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; - JSCompiler_inline_result.memoizedState = action; - return [initialStateProp, ssrFormState, !1]; } -function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; } -function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; +function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; - } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), - pushSimpleEffect( - 9, - createEffectInstance(), - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; -} -function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; -} -function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; -} -function pushSimpleEffect(tag, inst, create, deps) { - tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; - inst = currentlyRenderingFiber$1.updateQueue; - null === inst && - ((inst = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = inst)); - create = inst.lastEffect; - null === create - ? (inst.lastEffect = tag.next = tag) - : ((deps = create.next), - (create.next = tag), - (tag.next = deps), - (inst.lastEffect = tag)); - return tag; + throw Error(formatProdErrorMessage(483)); } -function createEffectInstance() { - return { destroy: void 0, resource: void 0 }; +var currentTreeHiddenStackCursor = createCursor(null), + prevEntangledRenderLanesCursor = createCursor(0); +function pushHiddenContext(fiber, context) { + fiber = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, fiber); + push(currentTreeHiddenStackCursor, context); + entangledRenderLanes = fiber | context.baseLanes; } -function updateRef() { - return updateWorkInProgressHook().memoizedState; +function reuseHiddenContextOnStack() { + push(prevEntangledRenderLanesCursor, entangledRenderLanes); + push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); } -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - createEffectInstance(), - create, - deps - ); +function popHiddenContext() { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor); + pop(prevEntangledRenderLanesCursor); } -function updateEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var inst = hook.memoizedState.inst; - null !== currentHook && - null !== deps && - areHookInputsEqual(deps, currentHook.memoizedState.deps) - ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - inst, - create, - deps - ))); +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + if ( + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then + ) { + if (0 > transitionStartTime && 0 > transitionUpdateTime) { + transitionStartTime = now(); + var newEventTime = resolveEventTimeStamp(), + newEventType = resolveEventType(); + if ( + newEventTime !== transitionEventTime || + newEventType !== transitionEventType + ) + transitionEventIsRepeat = !1; + transitionEventTime = newEventTime; + transitionEventType = newEventType; + } + entangleAsyncAction(transition, returnValue); + } + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } -function useEffectEventImpl(payload) { - currentlyRenderingFiber$1.flags |= 4; - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; - if (null === componentUpdateQueue) - (componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue), - (componentUpdateQueue.events = [payload]); - else { - var events = componentUpdateQueue.events; - null === events - ? (componentUpdateQueue.events = [payload]) - : events.push(payload); - } +var renderLanes = 0, + currentlyRenderingFiber = null, + currentHook = null, + workInProgressHook = null, + didScheduleRenderPhaseUpdate = !1, + didScheduleRenderPhaseUpdateDuringThisPass = !1, + shouldDoubleInvokeUserFnsInHooksDEV = !1, + localIdCounter = 0, + thenableIndexCounter$1 = 0, + thenableState$1 = null, + globalClientIdCounter = 0; +function throwInvalidHookError() { + throw Error(formatProdErrorMessage(321)); } -function updateEvent(callback) { - var ref = updateWorkInProgressHook().memoizedState; - useEffectEventImpl({ ref: ref, nextImpl: callback }); - return function () { - if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; +function areHookInputsEqual(nextDeps, prevDeps) { + if (null === prevDeps) return !1; + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) + if (!objectIs(nextDeps[i], prevDeps[i])) return !1; + return !0; } -function updateInsertionEffect(create, deps) { - return updateEffectImpl(4, 2, create, deps); +function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes +) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null === current || null === current.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate; + shouldDoubleInvokeUserFnsInHooksDEV = !1; + nextRenderLanes = Component(props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (nextRenderLanes = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + finishRenderingHooks(current); + return nextRenderLanes; } -function updateLayoutEffect(create, deps) { - return updateEffectImpl(4, 4, create, deps); +function finishRenderingHooks(current) { + ReactSharedInternals.H = ContextOnlyDispatcher; + var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdate = !1; + thenableIndexCounter$1 = 0; + thenableState$1 = null; + if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); + null === current || + didReceiveUpdate || + ((current = current.dependencies), + null !== current && + checkIfContextChanged(current) && + (didReceiveUpdate = !0)); } -function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; - } - if (null !== ref && void 0 !== ref) - return ( - (create = create()), - (ref.current = create), - function () { - ref.current = null; - } - ); +function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = workInProgress; + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); + thenableIndexCounter$1 = 0; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); + numberOfReRenders += 1; + workInProgressHook = currentHook = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } + ReactSharedInternals.H = HooksDispatcherOnRerender; + children = Component(props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; } -function updateImperativeHandle(ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); +function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && + (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; } -function mountDebugValue() {} -function updateCallback(callback, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - hook.memoizedState = [callback, deps]; - return callback; +function checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; } -function updateMemo(nextCreate, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - prevState = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); +function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags &= -2053; + current.lanes &= ~lanes; +} +function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; } + didScheduleRenderPhaseUpdate = !1; } - hook.memoizedState = [prevState, deps]; - return prevState; + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; } -function mountDeferredValueImpl(hook, value, initialValue) { - if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; +function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, + baseQueue: null, + queue: null, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; } -function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook - ); - if (0 === (renderLanes & 42)) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; -} -function startTransition(fiber, queue, pendingState, finishedState, callback) { - var previousPriority = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = - 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ) { - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) - ); - } catch (error) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane() - ); - } finally { - (ReactDOMSharedInternals.p = previousPriority), - (ReactSharedInternals.T = prevTransition); +function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); + else { + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) + throw Error(formatProdErrorMessage(467)); + throw Error(formatProdErrorMessage(310)); + } + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } + return workInProgressHook; } -function noop$3() {} -function startHostTransition(formFiber, pendingState, action, formData) { - if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); - var queue = ensureFormComponentIsStateful(formFiber).queue; - startTransition( - formFiber, - queue, - pendingState, - sharedNotPendingObject, - null === action - ? noop$3 - : function () { - requestFormReset$2(formFiber); - return action(formData); - } - ); +function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } -function ensureFormComponentIsStateful(formFiber) { - var existingStateHook = formFiber.memoizedState; - if (null !== existingStateHook) return existingStateHook; - existingStateHook = { - memoizedState: sharedNotPendingObject, - baseState: sharedNotPendingObject, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: sharedNotPendingObject - }, - next: null - }; - var initialResetState = {}; - existingStateHook.next = { - memoizedState: initialResetState, - baseState: initialResetState, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, - next: null - }; - formFiber.memoizedState = existingStateHook; - formFiber = formFiber.alternate; - null !== formFiber && (formFiber.memoizedState = existingStateHook); - return existingStateHook; +function useThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = []); + thenable = trackUsedThenable(thenableState$1, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null === index || null === index.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate)); + return thenable; } -function requestFormReset$2(formFiber) { - var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane()); +function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); + } + throw Error(formatProdErrorMessage(438, String(usable))); } -function useHostTransitionStatus() { - return readContext(HostTransitionContext); +function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue) + for ( + updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + memoCache.index++; + return updateQueue; } -function updateId() { - return updateWorkInProgressHook().memoizedState; +function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; } -function updateRefresh() { - return updateWorkInProgressHook().memoizedState; +function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); } -function refreshCache(fiber, seedKey, seedValue) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(); - fiber = createUpdate(lane); - var root$39 = enqueueUpdate(provider, fiber, lane); - null !== root$39 && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(root$39, provider, lane), - entangleTransitions(root$39, provider, lane)); - provider = createCache(); - null !== seedKey && - void 0 !== seedKey && - null !== root$39 && - provider.data.set(seedKey, seedValue); - fiber.payload = { cache: provider }; - return; +function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var baseQueue = hook.baseQueue, + pendingQueue = queue.pending; + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; } - provider = provider.return; + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; } -} -function dispatchReducerAction(fiber, queue, action) { - var lane = requestUpdateLane(); - action = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), - null !== action && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane))); -} -function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(); - dispatchSetStateInternal(fiber, queue, action, lane) && - startUpdateTimerByLane(lane); -} -function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); - else { - var alternate = fiber.alternate; + pendingQueue = hook.baseState; + if (null === baseQueue) hook.memoizedState = pendingQueue; + else { + current = baseQueue.next; + var newBaseQueueFirst = (baseFirst = null), + newBaseQueueLast = null, + update = current, + didReadFromEntangledAsyncAction$37 = !1; + do { + var updateLane = update.lane & -536870913; + if ( + updateLane !== update.lane + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + var revertLane = update.revertLane; + if (0 === revertLane) + null !== newBaseQueueLast && + (newBaseQueueLast = newBaseQueueLast.next = + { + lane: 0, + revertLane: 0, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$37 = !0); + else if ((renderLanes & revertLane) === revertLane) { + update = update.next; + revertLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$37 = !0); + continue; + } else + (updateLane = { + lane: 0, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction$37 && + ((reducer = currentEntangledActionThenable), null !== reducer)) ) - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) - return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && finishQueueingConcurrentUpdates(), - !1 - ); - } catch (error) { - } finally { - } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) - return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 - ); + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; } - return !1; -} -function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { - action = { - lane: 2, - revertLane: requestTransitionLane(), - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) { - if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - (startUpdateTimerByLane(2), - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); -} -function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) - ); -} -function enqueueRenderPhaseUpdate(queue, update) { - didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = - !0; - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; } -function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { - var queueLanes = queue.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - queue.lanes = lane; - markRootEntangled(root, lane); +function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; } + return [newState, dispatch]; } -var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError -}; -ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; -ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; -ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; -ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; -ContextOnlyDispatcher.useFormState = throwInvalidHookError; -ContextOnlyDispatcher.useActionState = throwInvalidHookError; -ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; -var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - init(initialArg); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber$1, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber$1, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); +function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(), + isHydrating$jscomp$0 = isHydrating; + if (isHydrating$jscomp$0) { + if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else getServerSnapshot = getSnapshot(); + var snapshotChanged = !objectIs( + (currentHook || hook).memoizedState, + getServerSnapshot + ); + snapshotChanged && + ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); + hook = hook.queue; + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); + if ( + hook.getSnapshot !== getSnapshot || + snapshotChanged || + (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) + ) { fiber.flags |= 2048; pushSimpleEffect( 9, @@ -4548,3494 +4039,3834 @@ var HooksDispatcherOnMount = { updateStoreInstance.bind( null, fiber, - inst, + hook, getServerSnapshot, getSnapshot ), null ); - return getServerSnapshot; - }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var JSCompiler_inline_result = treeContextOverflow; - var idWithLeadingBit = treeContextId; - JSCompiler_inline_result = - ( - idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) - ).toString(32) + JSCompiler_inline_result; - identifierPrefix = - ":" + identifierPrefix + "R" + JSCompiler_inline_result; - JSCompiler_inline_result = localIdCounter++; - 0 < JSCompiler_inline_result && - (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); - identifierPrefix += ":"; - } else - (JSCompiler_inline_result = globalClientIdCounter++), - (identifierPrefix = - ":" + - identifierPrefix + - "r" + - JSCompiler_inline_result.toString(32) + - ":"); - return (hook.memoizedState = identifierPrefix); - }, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber$1 - )); + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } -}; -HooksDispatcherOnMount.useMemoCache = useMemoCache; -HooksDispatcherOnMount.useEffectEvent = function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; -}; -HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnMount.useFormState = mountActionState; -HooksDispatcherOnMount.useActionState = mountActionState; -HooksDispatcherOnMount.useOptimistic = function (passthrough) { + return getServerSnapshot; +} +function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); +} +function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); +} +function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); +} +function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; + } +} +function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); +} +function mountStateImpl(initialState) { var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { + if ("function" === typeof initialState) { + var initialStateInitializer = initialState; + initialState = initialStateInitializer(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } + hook.memoizedState = hook.baseState = initialState; + hook.queue = { pending: null, lanes: 0, dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; -}; -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId -}; -HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh; -HooksDispatcherOnUpdate.useMemoCache = useMemoCache; -HooksDispatcherOnUpdate.useEffectEvent = updateEvent; -HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnUpdate.useFormState = updateActionState; -HooksDispatcherOnUpdate.useActionState = updateActionState; -HooksDispatcherOnUpdate.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); -}; -var HooksDispatcherOnRerender = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: rerenderReducer, - useRef: updateRef, - useState: function () { - return rerenderReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId -}; -HooksDispatcherOnRerender.useCacheRefresh = updateRefresh; -HooksDispatcherOnRerender.useMemoCache = useMemoCache; -HooksDispatcherOnRerender.useEffectEvent = updateEvent; -HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnRerender.useFormState = rerenderActionState; -HooksDispatcherOnRerender.useActionState = rerenderActionState; -HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; -}; -var thenableState = null, - thenableIndexCounter = 0; -function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, thenable, index); -} -function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; + return hook; } -function throwOnInvalidObjectType(returnFiber, newChild) { - if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) - throw Error(formatProdErrorMessage(525)); - returnFiber = Object.prototype.toString.call(newChild); - throw Error( - formatProdErrorMessage( - 31, - "[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber - ) +function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer ); } -function resolveLazy(lazyType) { - var init = lazyType._init; - return init(lazyType._payload); +function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload +) { + if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + fiber = actionQueue.action; + if (null !== fiber) { + var actionNode = { + payload: payload, + action: fiber, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); + setPendingState = actionQueue.pending; + null === setPendingState + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = setPendingState.next), + (actionQueue.pending = setPendingState.next = actionNode)); + } } -function createChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (shouldTrackSideEffects) { - var deletions = returnFiber.deletions; - null === deletions - ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) - : deletions.push(childToDelete); +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; } - } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; - } - function mapRemainingChildren(currentFirstChild) { - for (var existingChildren = new Map(); null !== currentFirstChild; ) - null !== currentFirstChild.key - ? existingChildren.set(currentFirstChild.key, currentFirstChild) - : existingChildren.set(currentFirstChild.index, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return existingChildren; - } - function useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; - } - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) - return (newFiber.flags |= 1048576), lastPlacedIndex; - newIndex = newFiber.alternate; - if (null !== newIndex) - return ( - (newIndex = newIndex.index), - newIndex < lastPlacedIndex - ? ((newFiber.flags |= 33554434), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 33554434; - return lastPlacedIndex; - } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; - } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText(textContent, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, textContent); - current.return = returnFiber; - return current; - } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key - ); - if ( - null !== current && - (current.elementType === elementType || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - resolveLazy(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - current - ); - current = createFiberFromTypeAndProps( - element.type, - element.key, - element.props, - null, - returnFiber.mode, - lanes - ); - coerceRef(current, element); - current.return = returnFiber; - return current; - } - function updatePortal(returnFiber, current, portal, lanes) { - if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - return current; - } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - current - ); - current = useFiber(current, fragment); - current.return = returnFiber; - return current; - } - function createChild(returnFiber, newChild, lanes) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild - ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return createChild(returnFiber, newChild, lanes); - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (newChild = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (newChild.return = returnFiber), - newChild - ); - if ("function" === typeof newChild.then) - return createChild(returnFiber, unwrapThenable(newChild), lanes); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$43) { + onActionError(actionQueue, node, error$43); } - return null; - } - function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = null !== oldFiber ? oldFiber.key : null; - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return null !== key - ? null - : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return newChild.key === key - ? updateElement(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - updateSlot(returnFiber, oldFiber, newChild, lanes) - ); - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] +} +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } ) - return null !== key - ? null - : updateFragment(returnFiber, oldFiber, newChild, lanes, null); - if ("function" === typeof newChild.then) - return updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; - } - function updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updateElement(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_PORTAL_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updatePortal(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ); - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateFragment(returnFiber, existingChildren, newChild, lanes, null) - ); - if ("function" === typeof newChild.then) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; + : onActionSuccess(actionQueue, node, returnValue); +} +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null; - null !== oldFiber && newIdx < newChildren.length; - newIdx++ - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot( - returnFiber, - oldFiber, - newChildren[newIdx], - lanes - ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; + actionQueue.action = null; +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); +} +function actionStateReducer(oldState, newState) { + return newState; +} +function mountActionState(action, initialStateProp) { + if (isHydrating) { + var ssrFormState = workInProgressRoot.formState; + if (null !== ssrFormState) { + a: { + var JSCompiler_inline_result = currentlyRenderingFiber; + if (isHydrating) { + if (nextHydratableInstance) { + b: { + var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; + for ( + var inRootOrSingleton = rootOrSingletonContext; + 8 !== JSCompiler_inline_result$jscomp$0.nodeType; + + ) { + if (!inRootOrSingleton) { + JSCompiler_inline_result$jscomp$0 = null; + break b; + } + JSCompiler_inline_result$jscomp$0 = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + if (null === JSCompiler_inline_result$jscomp$0) { + JSCompiler_inline_result$jscomp$0 = null; + break b; + } + } + inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; + JSCompiler_inline_result$jscomp$0 = + "F!" === inRootOrSingleton || "F" === inRootOrSingleton + ? JSCompiler_inline_result$jscomp$0 + : null; + } + if (JSCompiler_inline_result$jscomp$0) { + nextHydratableInstance = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + JSCompiler_inline_result = + "F!" === JSCompiler_inline_result$jscomp$0.data; + break a; + } + } + throwOnHydrationMismatch(JSCompiler_inline_result); + } + JSCompiler_inline_result = !1; } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (newIdx === newChildren.length) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild - ); - if (null === oldFiber) { - for (; newIdx < newChildren.length; newIdx++) - (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), - null !== oldFiber && - ((currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); } - for ( - oldFiber = mapRemainingChildren(oldFiber); - newIdx < newChildren.length; - newIdx++ - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - newChildren[newIdx], - lanes - )), - null !== nextOldFiber && - (shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - function reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChildrenIterable, - lanes - ) { - var newChildren = newChildrenIterable[ASYNC_ITERATOR](); - if (null == newChildren) throw Error(formatProdErrorMessage(151)); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - { - next: function () { - return unwrapThenable(newChildren.next()); - } - }, - lanes - ); } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - if (null == newChildren) throw Error(formatProdErrorMessage(151)); - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null, - step = newChildren.next(); - null !== oldFiber && !step.done; - newIdx++, step = newChildren.next() - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (step.done) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild - ); - if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildren.next()) - (step = createChild(returnFiber, step.value, lanes)), - null !== step && - ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + ssrFormState = mountWorkInProgressHook(); + ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; + JSCompiler_inline_result = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + ssrFormState.queue = JSCompiler_inline_result; + ssrFormState = dispatchSetState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result + ); + JSCompiler_inline_result.dispatch = ssrFormState; + JSCompiler_inline_result = mountStateImpl(!1); + inRootOrSingleton = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + JSCompiler_inline_result.queue + ); + JSCompiler_inline_result = mountWorkInProgressHook(); + JSCompiler_inline_result$jscomp$0 = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null + }; + JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; + ssrFormState = dispatchActionState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result$jscomp$0, + inRootOrSingleton, + ssrFormState + ); + JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; + JSCompiler_inline_result.memoizedState = action; + return [initialStateProp, ssrFormState, !1]; +} +function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); +} +function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() - ) - (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), - null !== step && - (shouldTrackSideEffects && - null !== step.alternate && - oldFiber.delete(null === step.key ? newIdx : step.key), - (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + 9, + createEffectInstance(), + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; +} +function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; +} +function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; +} +function pushSimpleEffect(tag, inst, create, deps) { + tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; + inst = currentlyRenderingFiber.updateQueue; + null === inst && + ((inst = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = inst)); + create = inst.lastEffect; + null === create + ? (inst.lastEffect = tag.next = tag) + : ((deps = create.next), + (create.next = tag), + (tag.next = deps), + (inst.lastEffect = tag)); + return tag; +} +function createEffectInstance() { + return { destroy: void 0, resource: void 0 }; +} +function updateRef() { + return updateWorkInProgressHook().memoizedState; +} +function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + createEffectInstance(), + create, + deps + ); +} +function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var inst = hook.memoizedState.inst; + null !== currentHook && + null !== deps && + areHookInputsEqual(deps, currentHook.memoizedState.deps) + ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + inst, + create, + deps + ))); +} +function mountEffect(create, deps) { + mountEffectImpl(8390656, 8, create, deps); +} +function updateEffect(create, deps) { + updateEffectImpl(2048, 8, create, deps); +} +function useEffectEventImpl(payload) { + currentlyRenderingFiber.flags |= 4; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + if (null === componentUpdateQueue) + (componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = componentUpdateQueue), + (componentUpdateQueue.events = [payload]); + else { + var events = componentUpdateQueue.events; + null === events + ? (componentUpdateQueue.events = [payload]) + : events.push(payload); } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - (newChild = newChild.props.children); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - a: { - for (var key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) { - key = newChild.type; - if (key === REACT_FRAGMENT_TYPE) { - if (7 === currentFirstChild.tag) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - newChild.props.children - ); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - } else if ( - currentFirstChild.elementType === key || - ("object" === typeof key && - null !== key && - key.$$typeof === REACT_LAZY_TYPE && - resolveLazy(key) === currentFirstChild.type) - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.props); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - newChild.type === REACT_FRAGMENT_TYPE - ? ((lanes = createFiberFromFragment( - newChild.props.children, - returnFiber.mode, - lanes, - newChild.key - )), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : ((lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = lanes)); - } - return placeSingleChild(returnFiber); - case REACT_PORTAL_TYPE: - a: { - for (key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) - if ( - 4 === currentFirstChild.tag && - currentFirstChild.stateNode.containerInfo === - newChild.containerInfo && - currentFirstChild.stateNode.implementation === - newChild.implementation - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.children || []); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } else { - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); - lanes.return = returnFiber; - returnFiber = lanes; - } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: - return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) - ); - } - if (isArrayImpl(newChild)) - return reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - if (getIteratorFn(newChild)) { - key = getIteratorFn(newChild); - if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); - newChild = key.call(newChild); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - } - if ("function" === typeof newChild[ASYNC_ITERATOR]) - return reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - if ("function" === typeof newChild.then) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ? ((newChild = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), - (lanes = useFiber(currentFirstChild, newChild)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), - (lanes.return = returnFiber), - (returnFiber = lanes)), - placeSingleChild(returnFiber)) - : deleteRemainingChildren(returnFiber, currentFirstChild); - } - return function (returnFiber, currentFirstChild, newChild, lanes) { - try { - thenableIndexCounter = 0; - var firstChildFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - thenableState = null; - return firstChildFiber; - } catch (x) { - if (x === SuspenseException || x === SuspenseActionException) throw x; - var fiber = createFiberImplClass(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - return fiber; - } finally { - } - }; -} -var reconcileChildFibers = createChildReconciler(!0), - mountChildFibers = createChildReconciler(!1), - suspenseHandlerStackCursor = createCursor(null), - shellBoundary = null; -function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push(suspenseStackCursor, suspenseStackCursor.current & 1); - push(suspenseHandlerStackCursor, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); } -function pushOffscreenSuspenseHandler(fiber) { - if (22 === fiber.tag) { - if ( - (push(suspenseStackCursor, suspenseStackCursor.current), - push(suspenseHandlerStackCursor, fiber), - null === shellBoundary) - ) { - var current = fiber.alternate; - null !== current && - null !== current.memoizedState && - (shellBoundary = fiber); - } - } else reuseSuspenseHandlerOnStack(fiber); +function updateEvent(callback) { + var ref = updateWorkInProgressHook().memoizedState; + useEffectEventImpl({ ref: ref, nextImpl: callback }); + return function () { + if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; } -function reuseSuspenseHandlerOnStack() { - push(suspenseStackCursor, suspenseStackCursor.current); - push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); +function updateInsertionEffect(create, deps) { + return updateEffectImpl(4, 2, create, deps); } -function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor); +function updateLayoutEffect(create, deps) { + return updateEffectImpl(4, 4, create, deps); } -var suspenseStackCursor = createCursor(0); -function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - ((state = state.dehydrated), - null === state || - "$?" === state.data || - isSuspenseInstanceFallback(state)) - ) - return node; - } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { - if (0 !== (node.flags & 128)) return node; - } else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; - } - if (node === row) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === row) return null; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; +function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; } - return null; + if (null !== ref && void 0 !== ref) + return ( + (create = create()), + (ref.current = create), + function () { + ref.current = null; + } + ); } -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); -} -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext -) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; +function updateImperativeHandle(ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); } -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext -) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); +function mountDebugValue() {} +function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; } -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$72 in Component) - void 0 === newProps[propName$72] && - (newProps[propName$72] = Component[propName$72]); +function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } - return newProps; -} -var reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }; -function defaultOnUncaughtError(error) { - reportGlobalError(error); -} -function defaultOnCaughtError(error) { - console.error(error); + hook.memoizedState = [prevState, deps]; + return prevState; } -function defaultOnRecoverableError(error) { - reportGlobalError(error); +function mountDeferredValueImpl(hook, value, initialValue) { + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; } -function logUncaughtError(root, errorInfo) { - try { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$73) { - setTimeout(function () { - throw e$73; - }); - } +function updateDeferredValueImpl(hook, prevValue, value, initialValue) { + if (objectIs(value, prevValue)) return value; + if (null !== currentTreeHiddenStackCursor.current) + return ( + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook + ); + if (0 === (renderLanes & 42)) + return (didReceiveUpdate = !0), (hook.memoizedState = value); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; } -function logCaughtError(root, boundary, errorInfo) { +function startTransition(fiber, queue, pendingState, finishedState, callback) { + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = + 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); try { - var onCaughtError = root.onCaughtError; - onCaughtError(errorInfo.value, { - componentStack: errorInfo.stack, - errorBoundary: 1 === boundary.tag ? boundary.stateNode : null - }); - } catch (e$74) { - setTimeout(function () { - throw e$74; - }); + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + if ( + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState + ); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane() + ); + } finally { + (ReactDOMSharedInternals.p = previousPriority), + (ReactSharedInternals.T = prevTransition); } } -function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = 3; - lane.payload = { element: null }; - lane.callback = function () { - logUncaughtError(root, errorInfo); - }; - return lane; +function noop$3() {} +function startHostTransition(formFiber, pendingState, action, formData) { + if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + sharedNotPendingObject, + null === action + ? noop$3 + : function () { + requestFormReset$2(formFiber); + return action(formData); + } + ); } -function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = 3; - return lane; +function ensureFormComponentIsStateful(formFiber) { + var existingStateHook = formFiber.memoizedState; + if (null !== existingStateHook) return existingStateHook; + existingStateHook = { + memoizedState: sharedNotPendingObject, + baseState: sharedNotPendingObject, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: sharedNotPendingObject + }, + next: null + }; + var initialResetState = {}; + existingStateHook.next = { + memoizedState: initialResetState, + baseState: initialResetState, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialResetState + }, + next: null + }; + formFiber.memoizedState = existingStateHook; + formFiber = formFiber.alternate; + null !== formFiber && (formFiber.memoizedState = existingStateHook); + return existingStateHook; } -function initializeClassErrorUpdate(update, root, fiber, errorInfo) { - var getDerivedStateFromError = fiber.type.getDerivedStateFromError; - if ("function" === typeof getDerivedStateFromError) { - var error = errorInfo.value; - update.payload = function () { - return getDerivedStateFromError(error); - }; - update.callback = function () { - logCaughtError(root, fiber, errorInfo); - }; +function requestFormReset$2(formFiber) { + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane()); +} +function useHostTransitionStatus() { + return readContext(HostTransitionContext); +} +function updateId() { + return updateWorkInProgressHook().memoizedState; +} +function updateRefresh() { + return updateWorkInProgressHook().memoizedState; +} +function refreshCache(fiber, seedKey, seedValue) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(); + fiber = createUpdate(lane); + var root$46 = enqueueUpdate(provider, fiber, lane); + null !== root$46 && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(root$46, provider, lane), + entangleTransitions(root$46, provider, lane)); + provider = createCache(); + null !== seedKey && + void 0 !== seedKey && + null !== root$46 && + provider.data.set(seedKey, seedValue); + fiber.payload = { cache: provider }; + return; + } + provider = provider.return; } - var inst = fiber.stateNode; - null !== inst && - "function" === typeof inst.componentDidCatch && - (update.callback = function () { - logCaughtError(root, fiber, errorInfo); - "function" !== typeof getDerivedStateFromError && - (null === legacyErrorBoundariesThatAlreadyFailed - ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) - : legacyErrorBoundariesThatAlreadyFailed.add(this)); - var stack = errorInfo.stack; - this.componentDidCatch(errorInfo.value, { - componentStack: null !== stack ? stack : "" - }); - }); } -function resetSuspendedComponent(sourceFiber, rootRenderLanes) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 - ); +function dispatchReducerAction(fiber, queue, action) { + var lane = requestUpdateLane(); + action = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, action) + : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), + null !== action && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane))); } -function markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes -) { - suspenseBoundary.flags |= 65536; - suspenseBoundary.lanes = rootRenderLanes; - return suspenseBoundary; +function dispatchSetState(fiber, queue, action) { + var lane = requestUpdateLane(); + dispatchSetStateInternal(fiber, queue, action, lane) && + startUpdateTimerByLane(lane); } -function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes -) { - sourceFiber.flags |= 32768; - isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); - if ( - null !== value && - "object" === typeof value && - (value.$$typeof === REACT_POSTPONE_TYPE && - (value = { then: function () {} }), - "function" === typeof value.then) - ) { - resetSuspendedComponent(sourceFiber, rootRenderLanes); - var suspenseBoundary = suspenseHandlerStackCursor.current; - if (null !== suspenseBoundary) { - switch (suspenseBoundary.tag) { - case 13: - return ( - null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === suspenseBoundary.alternate && - 0 === workInProgressRootExitStatus && - (workInProgressRootExitStatus = 3), - (suspenseBoundary.flags &= -257), - markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value === noopSuspenseyCommitThenable - ? (suspenseBoundary.flags |= 16384) - : ((sourceFiber = suspenseBoundary.updateQueue), - null === sourceFiber - ? (suspenseBoundary.updateQueue = new Set([value])) - : sourceFiber.add(value), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - case 22: +function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + else { + var alternate = fiber.alternate; + if ( + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) + ) + try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) return ( - (suspenseBoundary.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (suspenseBoundary.flags |= 16384) - : ((sourceFiber = suspenseBoundary.updateQueue), - null === sourceFiber - ? ((sourceFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (suspenseBoundary.updateQueue = sourceFiber)) - : ((returnFiber = sourceFiber.retryQueue), - null === returnFiber - ? (sourceFiber.retryQueue = new Set([value])) - : returnFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && finishQueueingConcurrentUpdates(), !1 ); + } catch (error) { + } finally { } - throw Error(formatProdErrorMessage(435, suspenseBoundary.tag)); - } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) + return ( + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 + ); } - if (isHydrating) - return ( - (suspenseBoundary = suspenseHandlerStackCursor.current), - null !== suspenseBoundary - ? (0 === (suspenseBoundary.flags & 65536) && - (suspenseBoundary.flags |= 256), - markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value !== HydrationMismatchException && - ((root = Error(formatProdErrorMessage(422), { cause: value })), - queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) - : (value !== HydrationMismatchException && - ((returnFiber = Error(formatProdErrorMessage(423), { - cause: value - })), - queueHydrationError( - createCapturedValueAtFiber(returnFiber, sourceFiber) - )), - (root = root.current.alternate), - (root.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (root.lanes |= rootRenderLanes), - (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), - (rootRenderLanes = createRootErrorUpdate( - root.stateNode, - sourceFiber, - rootRenderLanes - )), - enqueueCapturedUpdate(root, rootRenderLanes), - 4 !== workInProgressRootExitStatus && - (workInProgressRootExitStatus = 2)), - !1 - ); - suspenseBoundary = Error(formatProdErrorMessage(520), { cause: value }); - queueConcurrentError( - createCapturedValueAtFiber(suspenseBoundary, sourceFiber) - ); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); - if (null === returnFiber) return !0; - sourceFiber = createCapturedValueAtFiber(value, sourceFiber); - do { - switch (returnFiber.tag) { - case 3: - return ( - (returnFiber.flags |= 65536), - (root = rootRenderLanes & -rootRenderLanes), - (returnFiber.lanes |= root), - (root = createRootErrorUpdate( - returnFiber.stateNode, - sourceFiber, - root - )), - enqueueCapturedUpdate(returnFiber, root), - !1 - ); - case 1: - if ( - ((value = returnFiber.type), - (suspenseBoundary = returnFiber.stateNode), - 0 === (returnFiber.flags & 128) && - ("function" === typeof value.getDerivedStateFromError || - (null !== suspenseBoundary && - "function" === typeof suspenseBoundary.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - suspenseBoundary - ))))) - ) - return ( - (returnFiber.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - returnFiber, - sourceFiber - ), - enqueueCapturedUpdate(returnFiber, rootRenderLanes), - !1 - ); - } - returnFiber = returnFiber.return; - } while (null !== returnFiber); return !1; } -var SelectiveHydrationException = Error(formatProdErrorMessage(461)), - didReceiveUpdate = !1; -function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); +function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { + action = { + lane: 2, + revertLane: requestTransitionLane(), + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + (startUpdateTimerByLane(2), + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); } -function updateForwardRef( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - Component = Component.render; - var ref = workInProgress.ref; - if ("ref" in nextProps) { - var propsWithoutRef = {}; - for (var key in nextProps) - "ref" !== key && (propsWithoutRef[key] = nextProps[key]); - } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress); - nextProps = renderWithHooks( - current, - workInProgress, - Component, - propsWithoutRef, - ref, - renderLanes +function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); - key = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && key && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; } -function updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null === current) { - var type = Component.type; - if ( - "function" === typeof type && - !shouldConstruct(type) && - void 0 === type.defaultProps && - null === Component.compare - ) - return ( - (workInProgress.tag = 15), - (workInProgress.type = type), - updateSimpleMemoComponent( - current, - workInProgress, - type, - nextProps, - renderLanes - ) - ); - current = createFiberFromTypeAndProps( - Component.type, - null, - nextProps, - workInProgress, - workInProgress.mode, - renderLanes - ); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); - } - type = current.child; - if (!checkScheduledUpdateOrContext(current, renderLanes)) { - var prevProps = type.memoizedProps; - Component = Component.compare; - Component = null !== Component ? Component : shallowEqual; - if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); - } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); +function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = + !0; + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; } -function updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null !== current) { - var prevProps = current.memoizedProps; - if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref - ) - if ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) - ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); - else - return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); +function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194176)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ); } -function updateOffscreenComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - nextChildren = nextProps.children, - nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2), - prevState = null !== current ? current.memoizedState : null; - markRef(current, workInProgress); - if ("hidden" === nextProps.mode || nextIsDetached) { - if (0 !== (workInProgress.flags & 128)) { - nextProps = - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; - if (null !== current) { - nextChildren = workInProgress.child = current.child; - for (nextIsDetached = 0; null !== nextChildren; ) - (nextIsDetached = - nextIsDetached | nextChildren.lanes | nextChildren.childLanes), - (nextChildren = nextChildren.sibling); - workInProgress.childLanes = nextIsDetached & ~nextProps; - } else (workInProgress.childLanes = 0), (workInProgress.child = null); - return deferHiddenOffscreenComponent( - current, - workInProgress, - nextProps, - renderLanes - ); - } - if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); - else - return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, - renderLanes - ) +var ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError +}; +ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; +var HooksDispatcherOnMount = { + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps ); - } else - null !== prevState - ? (pushTransition(workInProgress, prevState.cachePool), - pushHiddenContext(workInProgress, prevState), - reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.memoizedState = null)) - : (null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(), - reuseSuspenseHandlerOnStack(workInProgress)); - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; -} -function deferHiddenOffscreenComponent( - current, - workInProgress, - nextBaseLanes, - renderLanes -) { - var JSCompiler_inline_result = peekCacheFromPool(); - JSCompiler_inline_result = - null === JSCompiler_inline_result - ? null - : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result }; - workInProgress.memoizedState = { - baseLanes: nextBaseLanes, - cachePool: JSCompiler_inline_result + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) + throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null + ); + return getServerSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var JSCompiler_inline_result = treeContextOverflow; + var idWithLeadingBit = treeContextId; + JSCompiler_inline_result = + ( + idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) + ).toString(32) + JSCompiler_inline_result; + identifierPrefix = + ":" + identifierPrefix + "R" + JSCompiler_inline_result; + JSCompiler_inline_result = localIdCounter++; + 0 < JSCompiler_inline_result && + (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); + identifierPrefix += ":"; + } else + (JSCompiler_inline_result = globalClientIdCounter++), + (identifierPrefix = + ":" + + identifierPrefix + + "r" + + JSCompiler_inline_result.toString(32) + + ":"); + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; + } + }, + HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh }; - null !== current && pushTransition(workInProgress, null); - reuseHiddenContextOnStack(); - pushOffscreenSuspenseHandler(workInProgress); - null !== current && - propagateParentContextChanges(current, workInProgress, renderLanes, !0); - return null; -} -function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (null === ref) - null !== current && - null !== current.ref && - (workInProgress.flags |= 2097664); - else { - if ("function" !== typeof ref && "object" !== typeof ref) - throw Error(formatProdErrorMessage(284)); - if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; - } +HooksDispatcherOnUpdate.useEffectEvent = updateEvent; +var HooksDispatcherOnRerender = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: rerenderReducer, + useRef: updateRef, + useState: function () { + return rerenderReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return null === currentHook + ? mountDeferredValueImpl(hook, value, initialValue) + : updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: rerenderActionState, + useActionState: rerenderActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh +}; +HooksDispatcherOnRerender.useEffectEvent = updateEvent; +var thenableState = null, + thenableIndexCounter = 0; +function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, thenable, index); } -function updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - prepareToReadContext(workInProgress); - Component = renderWithHooks( - current, - workInProgress, - Component, - nextProps, - void 0, - renderLanes - ); - nextProps = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && nextProps && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, Component, renderLanes); - return workInProgress.child; +function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; } -function replayFunctionComponent( - current, - workInProgress, - nextProps, - Component, - secondArg, - renderLanes -) { - prepareToReadContext(workInProgress); - workInProgress.updateQueue = null; - nextProps = renderWithHooksAgain( - workInProgress, - Component, - nextProps, - secondArg +function throwOnInvalidObjectType(returnFiber, newChild) { + if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) + throw Error(formatProdErrorMessage(525)); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + formatProdErrorMessage( + 31, + "[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber + ) ); - finishRenderingHooks(current); - Component = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && Component && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; } -function updateClassComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) { - var context = emptyContextObject, - contextType = Component.contextType; - "object" === typeof contextType && - null !== contextType && - (context = readContext(contextType)); - context = new Component(nextProps, context); - workInProgress.memoizedState = - null !== context.state && void 0 !== context.state ? context.state : null; - context.updater = classComponentUpdater; - workInProgress.stateNode = context; - context._reactInternals = workInProgress; - context = workInProgress.stateNode; - context.props = nextProps; - context.state = workInProgress.memoizedState; - context.refs = {}; - initializeUpdateQueue(workInProgress); - contextType = Component.contextType; - context.context = - "object" === typeof contextType && null !== contextType - ? readContext(contextType) - : emptyContextObject; - context.state = workInProgress.memoizedState; - contextType = Component.getDerivedStateFromProps; - "function" === typeof contextType && - (applyDerivedStateFromProps( - workInProgress, - Component, - contextType, - nextProps - ), - (context.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof context.getSnapshotBeforeUpdate || - ("function" !== typeof context.UNSAFE_componentWillMount && - "function" !== typeof context.componentWillMount) || - ((contextType = context.state), - "function" === typeof context.componentWillMount && - context.componentWillMount(), - "function" === typeof context.UNSAFE_componentWillMount && - context.UNSAFE_componentWillMount(), - contextType !== context.state && - classComponentUpdater.enqueueReplaceState(context, context.state, null), - processUpdateQueue(workInProgress, nextProps, context, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (context.state = workInProgress.memoizedState)); - "function" === typeof context.componentDidMount && - (workInProgress.flags |= 4194308); - nextProps = !0; - } else if (null === current) { - context = workInProgress.stateNode; - var unresolvedOldProps = workInProgress.memoizedProps, - oldProps = resolveClassComponentProps(Component, unresolvedOldProps); - context.props = oldProps; - var oldContext = context.context, - contextType$jscomp$0 = Component.contextType; - contextType = emptyContextObject; - "object" === typeof contextType$jscomp$0 && - null !== contextType$jscomp$0 && - (contextType = readContext(contextType$jscomp$0)); - var getDerivedStateFromProps = Component.getDerivedStateFromProps; - contextType$jscomp$0 = - "function" === typeof getDerivedStateFromProps || - "function" === typeof context.getSnapshotBeforeUpdate; - unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - contextType$jscomp$0 || - ("function" !== typeof context.UNSAFE_componentWillReceiveProps && - "function" !== typeof context.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== contextType) && - callComponentWillReceiveProps( - workInProgress, - context, - nextProps, - contextType - )); - hasForceUpdate = !1; - var oldState = workInProgress.memoizedState; - context.state = oldState; - processUpdateQueue(workInProgress, nextProps, context, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - oldContext = workInProgress.memoizedState; - unresolvedOldProps || oldState !== oldContext || hasForceUpdate - ? ("function" === typeof getDerivedStateFromProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - getDerivedStateFromProps, - nextProps - ), - (oldContext = workInProgress.memoizedState)), - (oldProps = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - oldProps, - nextProps, - oldState, - oldContext, - contextType - )) - ? (contextType$jscomp$0 || - ("function" !== typeof context.UNSAFE_componentWillMount && - "function" !== typeof context.componentWillMount) || - ("function" === typeof context.componentWillMount && - context.componentWillMount(), - "function" === typeof context.UNSAFE_componentWillMount && - context.UNSAFE_componentWillMount()), - "function" === typeof context.componentDidMount && - (workInProgress.flags |= 4194308)) - : ("function" === typeof context.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = oldContext)), - (context.props = nextProps), - (context.state = oldContext), - (context.context = contextType), - (nextProps = oldProps)) - : ("function" === typeof context.componentDidMount && - (workInProgress.flags |= 4194308), - (nextProps = !1)); - } else { - context = workInProgress.stateNode; - cloneUpdateQueue(current, workInProgress); - contextType = workInProgress.memoizedProps; - contextType$jscomp$0 = resolveClassComponentProps(Component, contextType); - context.props = contextType$jscomp$0; - getDerivedStateFromProps = workInProgress.pendingProps; - oldState = context.context; - oldContext = Component.contextType; - oldProps = emptyContextObject; - "object" === typeof oldContext && - null !== oldContext && - (oldProps = readContext(oldContext)); - unresolvedOldProps = Component.getDerivedStateFromProps; - (oldContext = - "function" === typeof unresolvedOldProps || - "function" === typeof context.getSnapshotBeforeUpdate) || - ("function" !== typeof context.UNSAFE_componentWillReceiveProps && - "function" !== typeof context.componentWillReceiveProps) || - ((contextType !== getDerivedStateFromProps || oldState !== oldProps) && - callComponentWillReceiveProps( - workInProgress, - context, - nextProps, - oldProps - )); - hasForceUpdate = !1; - oldState = workInProgress.memoizedState; - context.state = oldState; - processUpdateQueue(workInProgress, nextProps, context, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - contextType !== getDerivedStateFromProps || - oldState !== newState || - hasForceUpdate || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies)) - ? ("function" === typeof unresolvedOldProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - unresolvedOldProps, - nextProps - ), - (newState = workInProgress.memoizedState)), - (contextType$jscomp$0 = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - contextType$jscomp$0, - nextProps, - oldState, - newState, - oldProps - ) || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies))) - ? (oldContext || - ("function" !== typeof context.UNSAFE_componentWillUpdate && - "function" !== typeof context.componentWillUpdate) || - ("function" === typeof context.componentWillUpdate && - context.componentWillUpdate(nextProps, newState, oldProps), - "function" === typeof context.UNSAFE_componentWillUpdate && - context.UNSAFE_componentWillUpdate( - nextProps, - newState, - oldProps - )), - "function" === typeof context.componentDidUpdate && - (workInProgress.flags |= 4), - "function" === typeof context.getSnapshotBeforeUpdate && - (workInProgress.flags |= 1024)) - : ("function" !== typeof context.componentDidUpdate || - (contextType === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof context.getSnapshotBeforeUpdate || - (contextType === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 1024), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = newState)), - (context.props = nextProps), - (context.state = newState), - (context.context = oldProps), - (nextProps = contextType$jscomp$0)) - : ("function" !== typeof context.componentDidUpdate || - (contextType === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof context.getSnapshotBeforeUpdate || - (contextType === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 1024), - (nextProps = !1)); +function resolveLazy(lazyType) { + var init = lazyType._init; + return init(lazyType._payload); +} +function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) + : deletions.push(childToDelete); + } } - context = nextProps; - markRef(current, workInProgress); - nextProps = 0 !== (workInProgress.flags & 128); - context || nextProps - ? ((context = workInProgress.stateNode), - nextProps && "function" !== typeof Component.getDerivedStateFromError - ? ((Component = null), (profilerStartTime = -1)) - : (Component = context.render()), - (workInProgress.flags |= 1), - null !== current && nextProps - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - Component, - renderLanes - ))) - : reconcileChildren(current, workInProgress, Component, renderLanes), - (workInProgress.memoizedState = context.state), - (current = workInProgress.child)) - : (current = bailoutOnAlreadyFinishedWork( + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; + } + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null !== currentFirstChild.key + ? existingChildren.set(currentFirstChild.key, currentFirstChild) + : existingChildren.set(currentFirstChild.index, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return existingChildren; + } + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) + return (newFiber.flags |= 1048576), lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) + return ( + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex + ); + newFiber.flags |= 33554434; + return lastPlacedIndex; + } + function placeSingleChild(newFiber) { + shouldTrackSideEffects && + null === newFiber.alternate && + (newFiber.flags |= 33554434); + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) + return ( + (current = createFiberFromText(textContent, returnFiber.mode, lanes)), + (current.return = returnFiber), + current + ); + current = useFiber(current, textContent); + current.return = returnFiber; + return current; + } + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return updateFragment( + returnFiber, current, - workInProgress, - renderLanes - )); - return current; -} -function mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes -) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; -} -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; -function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; -} -function getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes -) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; -} -function updateSuspenseComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - showFallback = !1, - didSuspend = 0 !== (workInProgress.flags & 128), - JSCompiler_temp; - (JSCompiler_temp = didSuspend) || - (JSCompiler_temp = - null !== current && null === current.memoizedState - ? !1 - : 0 !== (suspenseStackCursor.current & 2)); - JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); - JSCompiler_temp = 0 !== (workInProgress.flags & 32); - workInProgress.flags &= -33; - if (null === current) { - if (isHydrating) { - showFallback - ? pushPrimaryTreeSuspenseHandler(workInProgress) - : reuseSuspenseHandlerOnStack(workInProgress); - if (isHydrating) { - var nextInstance = nextHydratableInstance, - JSCompiler_temp$jscomp$0; - if ((JSCompiler_temp$jscomp$0 = nextInstance)) { - c: { - JSCompiler_temp$jscomp$0 = nextInstance; - for ( - nextInstance = rootOrSingletonContext; - 8 !== JSCompiler_temp$jscomp$0.nodeType; - - ) { - if (!nextInstance) { - nextInstance = null; - break c; - } - JSCompiler_temp$jscomp$0 = getNextHydratable( - JSCompiler_temp$jscomp$0.nextSibling - ); - if (null === JSCompiler_temp$jscomp$0) { - nextInstance = null; - break c; - } - } - nextInstance = JSCompiler_temp$jscomp$0; - } - null !== nextInstance - ? ((workInProgress.memoizedState = { - dehydrated: nextInstance, - treeContext: - null !== treeContextProvider - ? { id: treeContextId, overflow: treeContextOverflow } - : null, - retryLane: 536870912 - }), - (JSCompiler_temp$jscomp$0 = createFiberImplClass( - 18, - null, - null, - 0 - )), - (JSCompiler_temp$jscomp$0.stateNode = nextInstance), - (JSCompiler_temp$jscomp$0.return = workInProgress), - (workInProgress.child = JSCompiler_temp$jscomp$0), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (JSCompiler_temp$jscomp$0 = !0)) - : (JSCompiler_temp$jscomp$0 = !1); - } - JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); - } - nextInstance = workInProgress.memoizedState; - if ( - null !== nextInstance && - ((nextInstance = nextInstance.dehydrated), null !== nextInstance) - ) - return ( - isSuspenseInstanceFallback(nextInstance) - ? (workInProgress.lanes = 16) - : (workInProgress.lanes = 536870912), - null - ); - popSuspenseHandler(workInProgress); - } - nextInstance = nextProps.children; - JSCompiler_temp$jscomp$0 = nextProps.fallback; - if (showFallback) + element.props.children, + lanes, + element.key + ); + if ( + null !== current && + (current.elementType === elementType || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + resolveLazy(elementType) === current.type)) + ) return ( - reuseSuspenseHandlerOnStack(workInProgress), - (nextProps = mountSuspenseFallbackChildren( - workInProgress, - nextInstance, - JSCompiler_temp$jscomp$0, - renderLanes - )), - (showFallback = workInProgress.child), - (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - nextProps + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + current ); - if ("number" === typeof nextProps.unstable_expectedLoadTime) + current = createFiberFromTypeAndProps( + element.type, + element.key, + element.props, + null, + returnFiber.mode, + lanes + ); + coerceRef(current, element); + current.return = returnFiber; + return current; + } + function updatePortal(returnFiber, current, portal, lanes) { + if ( + null === current || + 4 !== current.tag || + current.stateNode.containerInfo !== portal.containerInfo || + current.stateNode.implementation !== portal.implementation + ) return ( - reuseSuspenseHandlerOnStack(workInProgress), - (nextProps = mountSuspenseFallbackChildren( - workInProgress, - nextInstance, - JSCompiler_temp$jscomp$0, - renderLanes - )), - (showFallback = workInProgress.child), - (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress.lanes = 4194304), - nextProps + (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), + (current.return = returnFiber), + current ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren(workInProgress, nextInstance); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + return current; } - JSCompiler_temp$jscomp$0 = current.memoizedState; - if ( - null !== JSCompiler_temp$jscomp$0 && - ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated), - null !== nextInstance) - ) { - if (didSuspend) - workInProgress.flags & 256 - ? (pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags &= -257), - (workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ))) - : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (showFallback = nextProps.fallback), - (nextInstance = workInProgress.mode), - (nextProps = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: nextProps.children }, - nextInstance - )), - (showFallback = createFiberFromFragment( - showFallback, - nextInstance, - renderLanes, - null - )), - (showFallback.flags |= 2), - (nextProps.return = workInProgress), - (showFallback.return = workInProgress), - (nextProps.sibling = showFallback), - (workInProgress.child = nextProps), - reconcileChildFibers( - workInProgress, - current.child, + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + current + ); + current = useFiber(current, fragment); + current.return = returnFiber; + return current; + } + function createChild(returnFiber, newChild, lanes) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, null, - renderLanes - ), - (nextProps = workInProgress.child), - (nextProps.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes + returnFiber.mode, + lanes )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = showFallback)); - else if ( - (pushPrimaryTreeSuspenseHandler(workInProgress), - isSuspenseInstanceFallback(nextInstance)) - ) { - JSCompiler_temp = - nextInstance.nextSibling && nextInstance.nextSibling.dataset; - if (JSCompiler_temp) var digest = JSCompiler_temp.dgst; - JSCompiler_temp = digest; - "POSTPONE" !== JSCompiler_temp && - ((nextProps = Error(formatProdErrorMessage(419))), - (nextProps.stack = ""), - (nextProps.digest = JSCompiler_temp), - queueHydrationError({ value: nextProps, source: null, stack: null })); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else if ( - (didReceiveUpdate || - propagateParentContextChanges(current, workInProgress, renderLanes, !1), - (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_temp) - ) { - JSCompiler_temp = workInProgressRoot; - if (null !== JSCompiler_temp) { - nextProps = renderLanes & -renderLanes; - if (0 !== (nextProps & 42)) nextProps = 1; - else - switch (nextProps) { - case 2: - nextProps = 1; - break; - case 8: - nextProps = 4; - break; - case 32: - nextProps = 16; - break; - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - nextProps = 64; - break; - case 268435456: - nextProps = 134217728; - break; - default: - nextProps = 0; - } - nextProps = - 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) - ? 0 - : nextProps; - if (0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) - throw ( - ((JSCompiler_temp$jscomp$0.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), - SelectiveHydrationException) + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return createChild(returnFiber, newChild, lanes); } - "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else - "$?" === nextInstance.data - ? ((workInProgress.flags |= 192), - (workInProgress.child = current.child), - (workInProgress = null)) - : ((current = JSCompiler_temp$jscomp$0.treeContext), - (nextHydratableInstance = getNextHydratable( - nextInstance.nextSibling - )), - (hydrationParentFiber = workInProgress), - (isHydrating = !0), - (hydrationErrors = null), - (rootOrSingletonContext = !1), - null !== current && - ((idStack[idStackIndex++] = treeContextId), - (idStack[idStackIndex++] = treeContextOverflow), - (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = current.id), - (treeContextOverflow = current.overflow), - (treeContextProvider = workInProgress)), - (workInProgress = mountSuspensePrimaryChildren( - workInProgress, - nextProps.children - )), - (workInProgress.flags |= 4096)); - return workInProgress; - } - if (showFallback) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (showFallback = nextProps.fallback), - (nextInstance = workInProgress.mode), - (JSCompiler_temp$jscomp$0 = current.child), - (digest = JSCompiler_temp$jscomp$0.sibling), - (nextProps = createWorkInProgress(JSCompiler_temp$jscomp$0, { - mode: "hidden", - children: nextProps.children - })), - (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280), - null !== digest - ? (showFallback = createWorkInProgress(digest, showFallback)) - : ((showFallback = createFiberFromFragment( - showFallback, - nextInstance, - renderLanes, + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (newChild = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, null )), - (showFallback.flags |= 2)), - (showFallback.return = workInProgress), - (nextProps.return = workInProgress), - (nextProps.sibling = showFallback), - (workInProgress.child = nextProps), - (nextProps = showFallback), - (showFallback = workInProgress.child), - (nextInstance = current.child.memoizedState), - null === nextInstance - ? (nextInstance = mountSuspenseOffscreenState(renderLanes)) - : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool), - null !== JSCompiler_temp$jscomp$0 - ? ((digest = CacheContext._currentValue), - (JSCompiler_temp$jscomp$0 = - JSCompiler_temp$jscomp$0.parent !== digest - ? { parent: digest, pool: digest } - : JSCompiler_temp$jscomp$0)) - : (JSCompiler_temp$jscomp$0 = getSuspendedCache()), - (nextInstance = { - baseLanes: nextInstance.baseLanes | renderLanes, - cachePool: JSCompiler_temp$jscomp$0 - })), - (showFallback.memoizedState = nextInstance), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - nextProps - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { - mode: "visible", - children: nextProps.children - }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; - null !== current && - ((JSCompiler_temp = workInProgress.deletions), - null === JSCompiler_temp - ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_temp.push(current)); - workInProgress.child = renderLanes; - workInProgress.memoizedState = null; - return renderLanes; -} -function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: primaryChildren }, - workInProgress.mode - ); - primaryChildren.return = workInProgress; - return (workInProgress.child = primaryChildren); -} -function mountSuspenseFallbackChildren( - workInProgress, - primaryChildren, - fallbackChildren, - renderLanes -) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); - fallbackChildren = createFiberFromFragment( - fallbackChildren, - mode, - renderLanes, - null - ); - primaryChildren.return = workInProgress; - fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; - return fallbackChildren; -} -function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); -} -function retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes -) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountSuspensePrimaryChildren( - workInProgress, - workInProgress.pendingProps.children - ); - current.flags |= 2; - workInProgress.memoizedState = null; - return current; -} -function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { - fiber.lanes |= renderLanes; - var alternate = fiber.alternate; - null !== alternate && (alternate.lanes |= renderLanes); - scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); -} -function initSuspenseListRenderState( - workInProgress, - isBackwards, - tail, - lastContentRow, - tailMode -) { - var renderState = workInProgress.memoizedState; - null === renderState - ? (workInProgress.memoizedState = { - isBackwards: isBackwards, - rendering: null, - renderingStartTime: 0, - last: lastContentRow, - tail: tail, - tailMode: tailMode - }) - : ((renderState.isBackwards = isBackwards), - (renderState.rendering = null), - (renderState.renderingStartTime = 0), - (renderState.last = lastContentRow), - (renderState.tail = tail), - (renderState.tailMode = tailMode)); -} -function updateSuspenseListComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - revealOrder = nextProps.revealOrder, - tailMode = nextProps.tail; - reconcileChildren(current, workInProgress, nextProps.children, renderLanes); - nextProps = suspenseStackCursor.current; - if (0 !== (nextProps & 2)) - (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128); - else { - if (null !== current && 0 !== (current.flags & 128)) - a: for (current = workInProgress.child; null !== current; ) { - if (13 === current.tag) - null !== current.memoizedState && - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (19 === current.tag) - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (null !== current.child) { - current.child.return = current; - current = current.child; - continue; - } - if (current === workInProgress) break a; - for (; null === current.sibling; ) { - if (null === current.return || current.return === workInProgress) - break a; - current = current.return; - } - current.sibling.return = current.return; - current = current.sibling; - } - nextProps &= 1; + (newChild.return = returnFiber), + newChild + ); + if ("function" === typeof newChild.then) + return createChild(returnFiber, unwrapThenable(newChild), lanes); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; } - push(suspenseStackCursor, nextProps); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return null !== key + ? null + : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return newChild.key === key + ? updateElement(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + updateSlot(returnFiber, oldFiber, newChild, lanes) + ); } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode - ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } - return workInProgress.child; -} -function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { - null !== current && (workInProgress.dependencies = current.dependencies); - profilerStartTime = -1; - workInProgressRootSkippedLanes |= workInProgress.lanes; - if (0 === (renderLanes & workInProgress.childLanes)) - if (null !== current) { if ( - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - 0 === (renderLanes & workInProgress.childLanes)) + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] ) - return null; - } else return null; - if (null !== current && workInProgress.child !== current.child) - throw Error(formatProdErrorMessage(153)); - if (null !== workInProgress.child) { - current = workInProgress.child; - renderLanes = createWorkInProgress(current, current.pendingProps); - workInProgress.child = renderLanes; - for (renderLanes.return = workInProgress; null !== current.sibling; ) - (current = current.sibling), - (renderLanes = renderLanes.sibling = - createWorkInProgress(current, current.pendingProps)), - (renderLanes.return = workInProgress); - renderLanes.sibling = null; + return null !== key + ? null + : updateFragment(returnFiber, oldFiber, newChild, lanes, null); + if ("function" === typeof newChild.then) + return updateSlot( + returnFiber, + oldFiber, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( + returnFiber, + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; } - return workInProgress.child; -} -function checkScheduledUpdateOrContext(current, renderLanes) { - if (0 !== (current.lanes & renderLanes)) return !0; - current = current.dependencies; - return null !== current && checkIfContextChanged(current) ? !0 : !1; -} -function attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes -) { - switch (workInProgress.tag) { - case 3: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); - resetHydrationState(); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 4: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) ); - break; - case 12: - 0 !== (renderLanes & workInProgress.childLanes) && - (workInProgress.flags |= 4); - workInProgress.flags |= 2048; - var stateNode = workInProgress.stateNode; - stateNode.effectDuration = -0; - stateNode.passiveEffectDuration = -0; - break; - case 13: - stateNode = workInProgress.memoizedState; - if (null !== stateNode) { - if (null !== stateNode.dehydrated) + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updateElement(returnFiber, existingChildren, newChild, lanes) ); - if (0 !== (renderLanes & workInProgress.child.childLanes)) - return updateSuspenseComponent(current, workInProgress, renderLanes); - pushPrimaryTreeSuspenseHandler(workInProgress); - current = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - return null !== current ? current.sibling : null; - } - pushPrimaryTreeSuspenseHandler(workInProgress); - break; - case 19: - var didSuspendBefore = 0 !== (current.flags & 128); - stateNode = 0 !== (renderLanes & workInProgress.childLanes); - stateNode || - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); - if (didSuspendBefore) { - if (stateNode) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes + case REACT_PORTAL_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updatePortal(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes ); - workInProgress.flags |= 128; } - didSuspendBefore = workInProgress.memoizedState; - null !== didSuspendBefore && - ((didSuspendBefore.rendering = null), - (didSuspendBefore.tail = null), - (didSuspendBefore.lastEffect = null)); - push(suspenseStackCursor, suspenseStackCursor.current); - if (stateNode) break; - else return null; - case 22: - case 23: - return ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) - ); - case 24: - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); - } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); -} -function beginWork(current, workInProgress, renderLanes) { - if (null !== current) - if (current.memoizedProps !== workInProgress.pendingProps) - didReceiveUpdate = !0; - else { if ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] ) return ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) + (existingChildren = existingChildren.get(newIdx) || null), + updateFragment(returnFiber, existingChildren, newChild, lanes, null) ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; - } - else - (didReceiveUpdate = !1), - isHydrating && - 0 !== (workInProgress.flags & 1048576) && - pushTreeId(workInProgress, treeForkCount, workInProgress.index); - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 16: - a: { - current = workInProgress.pendingProps; - var lazyComponent = workInProgress.elementType, - init = lazyComponent._init; - lazyComponent = init(lazyComponent._payload); - workInProgress.type = lazyComponent; - if ("function" === typeof lazyComponent) - shouldConstruct(lazyComponent) - ? ((current = resolveClassComponentProps(lazyComponent, current)), - (workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - lazyComponent, - current, - renderLanes - ))) - : ((workInProgress.tag = 0), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - lazyComponent, - current, - renderLanes - ))); - else { - if (void 0 !== lazyComponent && null !== lazyComponent) - if ( - ((init = lazyComponent.$$typeof), init === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - lazyComponent, - current, - renderLanes - ); - break a; - } else if (init === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - lazyComponent, - current, - renderLanes - ); - break a; - } - workInProgress = - getComponentNameFromType(lazyComponent) || lazyComponent; - throw Error(formatProdErrorMessage(306, workInProgress, "")); - } - } - return workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 1: - return ( - (lazyComponent = workInProgress.type), - (init = resolveClassComponentProps( - lazyComponent, - workInProgress.pendingProps - )), - updateClassComponent( - current, - workInProgress, - lazyComponent, - init, - renderLanes - ) - ); - case 3: - a: { - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo + if ("function" === typeof newChild.then) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + unwrapThenable(newChild), + lanes ); - if (null === current) throw Error(formatProdErrorMessage(387)); - var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - lazyComponent = init.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - var nextState = workInProgress.memoizedState; - nextProps = nextState.cache; - pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ); - suspendIfUpdateReadFromEntangledAsyncAction(); - nextProps = nextState.element; - if (init.isDehydrated) - if ( - ((init = { - element: nextProps, - isDehydrated: !1, - cache: nextState.cache - }), - (workInProgress.updateQueue.baseState = init), - (workInProgress.memoizedState = init), - workInProgress.flags & 256) - ) { - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else if (nextProps !== lazyComponent) { - lazyComponent = createCapturedValueAtFiber( - Error(formatProdErrorMessage(424)), - workInProgress - ); - queueHydrationError(lazyComponent); - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else - for ( - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ), - hydrationParentFiber = workInProgress, - isHydrating = !0, - hydrationErrors = null, - rootOrSingletonContext = !0, - renderLanes = mountChildFibers( - workInProgress, - null, - nextProps, - renderLanes - ), - workInProgress.child = renderLanes; - renderLanes; - - ) - (renderLanes.flags = (renderLanes.flags & -3) | 4096), - (renderLanes = renderLanes.sibling); - else { - resetHydrationState(); - if (nextProps === lazyComponent) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - reconcileChildren(current, workInProgress, nextProps, renderLanes); - } - workInProgress = workInProgress.child; + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; + } + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( + returnFiber, + oldFiber, + newChildren[newIdx], + lanes + ); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; } - return workInProgress; - case 26: + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (newIdx === newChildren.length) return ( - markRef(current, workInProgress), - null === current - ? (renderLanes = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - )) - ? (workInProgress.memoizedState = renderLanes) - : isHydrating || - ((renderLanes = workInProgress.type), - (current = workInProgress.pendingProps), - (lazyComponent = getOwnerDocumentFromRootContainer( - rootInstanceStackCursor.current - ).createElement(renderLanes)), - (lazyComponent[internalInstanceKey] = workInProgress), - (lazyComponent[internalPropsKey] = current), - setInitialProperties(lazyComponent, renderLanes, current), - markNodeAsHoistable(lazyComponent), - (workInProgress.stateNode = lazyComponent)) - : (workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - )), - null + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - case 27: - return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((lazyComponent = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - rootInstanceStackCursor.current - )), - (hydrationParentFiber = workInProgress), - (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable( - lazyComponent.firstChild - ))), - (lazyComponent = workInProgress.pendingProps.children), - null !== current || isHydrating - ? reconcileChildren( - current, - workInProgress, - lazyComponent, - renderLanes - ) - : (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - lazyComponent, - renderLanes + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx )), - markRef(current, workInProgress), - workInProgress.child - ); - case 5: - if (null === current && isHydrating) { - if ((init = lazyComponent = nextHydratableInstance)) - (lazyComponent = canHydrateInstance( - lazyComponent, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + newIdx < newChildren.length; + newIdx++ + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + newChildren[newIdx], + lanes + )), + null !== nextOldFiber && + (shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx )), - null !== lazyComponent - ? ((workInProgress.stateNode = lazyComponent), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = getNextHydratable( - lazyComponent.firstChild - )), - (rootOrSingletonContext = !1), - (init = !0)) - : (init = !1); - init || throwOnHydrationMismatch(workInProgress); - } - pushHostContext(workInProgress); - init = workInProgress.type; - nextProps = workInProgress.pendingProps; - nextState = null !== current ? current.memoizedProps : null; - lazyComponent = nextProps.children; - shouldSetTextContent(init, nextProps) - ? (lazyComponent = null) - : null !== nextState && - shouldSetTextContent(init, nextState) && - (workInProgress.flags |= 32); - null !== workInProgress.memoizedState && - ((init = renderWithHooks( - current, - workInProgress, - TransitionAwareHostComponent, - null, - null, - renderLanes - )), - (HostTransitionContext._currentValue = init)); - markRef(current, workInProgress); - reconcileChildren(current, workInProgress, lazyComponent, renderLanes); - return workInProgress.child; - case 6: - if (null === current && isHydrating) { - if ((current = renderLanes = nextHydratableInstance)) - (renderLanes = canHydrateTextInstance( - renderLanes, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== renderLanes - ? ((workInProgress.stateNode = renderLanes), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (current = !0)) - : (current = !1); - current || throwOnHydrationMismatch(workInProgress); + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChildrenIterable, + lanes + ) { + var newChildren = newChildrenIterable[ASYNC_ITERATOR](); + if (null == newChildren) throw Error(formatProdErrorMessage(151)); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + { + next: function () { + return unwrapThenable(newChildren.next()); + } + }, + lanes + ); + } + function reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + if (null == newChildren) throw Error(formatProdErrorMessage(151)); + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null, + step = newChildren.next(); + null !== oldFiber && !step.done; + newIdx++, step = newChildren.next() + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; } - return null; - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ), - (lazyComponent = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - lazyComponent, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - lazyComponent, - renderLanes - ), - workInProgress.child - ); - case 11: - return updateForwardRef( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 7: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child - ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 12: - return ( - (workInProgress.flags |= 4), - (workInProgress.flags |= 2048), - (lazyComponent = workInProgress.stateNode), - (lazyComponent.effectDuration = -0), - (lazyComponent.passiveEffectDuration = -0), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 10: - return ( - (lazyComponent = workInProgress.pendingProps), - pushProvider(workInProgress, workInProgress.type, lazyComponent.value), - reconcileChildren( - current, - workInProgress, - lazyComponent.children, - renderLanes - ), - workInProgress.child - ); - case 9: + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (step.done) return ( - (init = workInProgress.type._context), - (lazyComponent = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress), - (init = readContext(init)), - (lazyComponent = lazyComponent(init)), - (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, lazyComponent, renderLanes), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 15: - return updateSimpleMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (lazyComponent = readContext(CacheContext)), - null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), - (nextProps = createCache()), - (init.pooledCache = nextProps), - nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), - (workInProgress.memoizedState = { - parent: lazyComponent, - cache: init - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), - (nextProps = workInProgress.memoizedState), - init.parent !== lazyComponent - ? ((init = { parent: lazyComponent, cache: lazyComponent }), - (workInProgress.memoizedState = init), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, lazyComponent)) - : ((lazyComponent = nextProps.cache), - pushProvider(workInProgress, CacheContext, lazyComponent), - lazyComponent !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error(formatProdErrorMessage(156, workInProgress.tag)); -} -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = null; -function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue); - context._currentValue = nextValue; -} -function popProvider(context) { - context._currentValue = valueCursor.current; - pop(valueCursor); -} -function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { - for (; null !== parent; ) { - var alternate = parent.alternate; - (parent.childLanes & renderLanes) !== renderLanes - ? ((parent.childLanes |= renderLanes), - null !== alternate && (alternate.childLanes |= renderLanes)) - : null !== alternate && - (alternate.childLanes & renderLanes) !== renderLanes && - (alternate.childLanes |= renderLanes); - if (parent === propagationRoot) break; - parent = parent.return; + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (step = createChild(returnFiber, step.value, lanes)), + null !== step && + ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() + ) + (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), + null !== step && + (shouldTrackSideEffects && + null !== step.alternate && + oldFiber.delete(null === step.key ? newIdx : step.key), + (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; } -} -function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) { + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + (newChild = newChild.props.children); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + a: { + for (var key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === currentFirstChild.tag) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + newChild.props.children + ); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + } else if ( + currentFirstChild.elementType === key || + ("object" === typeof key && + null !== key && + key.$$typeof === REACT_LAZY_TYPE && + resolveLazy(key) === currentFirstChild.type) + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.props); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + newChild.type === REACT_FRAGMENT_TYPE + ? ((lanes = createFiberFromFragment( + newChild.props.children, + returnFiber.mode, + lanes, + newChild.key + )), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = lanes)); } - list = dependency.next; + return placeSingleChild(returnFiber); + case REACT_PORTAL_TYPE: + a: { + for (key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + newChild.containerInfo && + currentFirstChild.stateNode.implementation === + newChild.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.children || []); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); + lanes.return = returnFiber; + returnFiber = lanes; + } + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) + ); } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; + if (isArrayImpl(newChild)) + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if (getIteratorFn(newChild)) { + key = getIteratorFn(newChild); + if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); + newChild = key.call(newChild); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChild, + lanes + ); } - fiber = nextFiber; - } -} -function propagateParentContextChanges( - current, - workInProgress, - renderLanes, - forcePropagateEntireTree -) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; - - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current ? current.push(context) : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); + if ("function" === typeof newChild[ASYNC_ITERATOR]) + return reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if ("function" === typeof newChild.then) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } - parent = parent.return; + return ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ? ((newChild = "" + newChild), + null !== currentFirstChild && 6 === currentFirstChild.tag + ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), + (lanes = useFiber(currentFirstChild, newChild)), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : (deleteRemainingChildren(returnFiber, currentFirstChild), + (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), + (lanes.return = returnFiber), + (returnFiber = lanes)), + placeSingleChild(returnFiber)) + : deleteRemainingChildren(returnFiber, currentFirstChild); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; + return function (returnFiber, currentFirstChild, newChild, lanes) { + try { + thenableIndexCounter = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + thenableState = null; + return firstChildFiber; + } catch (x) { + if (x === SuspenseException || x === SuspenseActionException) throw x; + var fiber = createFiberImplClass(29, x, null, returnFiber.mode); + fiber.lanes = lanes; + fiber.return = returnFiber; + return fiber; + } finally { + } + }; } -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { +var reconcileChildFibers = createChildReconciler(!0), + mountChildFibers = createChildReconciler(!1), + suspenseHandlerStackCursor = createCursor(null), + shellBoundary = null; +function pushPrimaryTreeSuspenseHandler(handler) { + var current = handler.alternate; + push(suspenseStackCursor, suspenseStackCursor.current & 1); + push(suspenseHandlerStackCursor, handler); + null === shellBoundary && + (null === current || null !== currentTreeHiddenStackCursor.current + ? (shellBoundary = handler) + : null !== current.memoizedState && (shellBoundary = handler)); +} +function pushOffscreenSuspenseHandler(fiber) { + if (22 === fiber.tag) { if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; + (push(suspenseStackCursor, suspenseStackCursor.current), + push(suspenseHandlerStackCursor, fiber), + null === shellBoundary) + ) { + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); } -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); +function reuseSuspenseHandlerOnStack() { + push(suspenseStackCursor, suspenseStackCursor.current); + push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); } -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); +function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor); } -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); +var suspenseStackCursor = createCursor(0); +function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; + if ( + null !== state && + ((state = state.dehydrated), + null === state || + "$?" === state.data || + isSuspenseInstanceFallback(state)) + ) + return node; + } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + return null; } -function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; +var reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }; +function defaultOnUncaughtError(error) { + reportGlobalError(error); } -var hasForceUpdate = !1; -function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; +function defaultOnCaughtError(error) { + console.error(error); } -function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); +function defaultOnRecoverableError(error) { + reportGlobalError(error); } -function createUpdate(lane) { - return { lane: lane, tag: 0, payload: null, callback: null, next: null }; +function logUncaughtError(root, errorInfo) { + try { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); + } catch (e$79) { + setTimeout(function () { + throw e$79; + }); + } } -function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if (0 !== (executionContext & 2)) { - var pending = updateQueue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - updateQueue.pending = update; - update = getRootForUpdatedFiber(fiber); - markUpdateLaneFromFiberToRoot(fiber, null, lane); - return update; +function logCaughtError(root, boundary, errorInfo) { + try { + var onCaughtError = root.onCaughtError; + onCaughtError(errorInfo.value, { + componentStack: errorInfo.stack, + errorBoundary: 1 === boundary.tag ? boundary.stateNode : null + }); + } catch (e$80) { + setTimeout(function () { + throw e$80; + }); } - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); } -function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); - } +function createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = 3; + lane.payload = { element: null }; + lane.callback = function () { + logUncaughtError(root, errorInfo); + }; + return lane; } -function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( - null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks +function createClassErrorUpdate(lane) { + lane = createUpdate(lane); + lane.tag = 3; + return lane; +} +function initializeClassErrorUpdate(update, root, fiber, errorInfo) { + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if ("function" === typeof getDerivedStateFromError) { + var error = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error); + }; + update.callback = function () { + logCaughtError(root, fiber, errorInfo); }; - workInProgress.updateQueue = queue; - return; } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + logCaughtError(root, fiber, errorInfo); + "function" !== typeof getDerivedStateFromError && + (null === legacyErrorBoundariesThatAlreadyFailed + ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) + : legacyErrorBoundariesThatAlreadyFailed.add(this)); + var stack = errorInfo.stack; + this.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + }); } -var didReadFromEntangledAsyncAction = !1; -function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; - } +function resetSuspendedComponent(sourceFiber, rootRenderLanes) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); } -function processUpdateQueue( - workInProgress$jscomp$0, - props, - instance$jscomp$0, - renderLanes +function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes ) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress$jscomp$0.updateQueue; - hasForceUpdate = !1; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress$jscomp$0.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); - } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; - if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - var workInProgress = workInProgress$jscomp$0, - update = pendingQueue; - updateLane = props; - var instance = instance$jscomp$0; - switch (update.tag) { - case 1: - workInProgress = update.payload; - if ("function" === typeof workInProgress) { - newState = workInProgress.call(instance, newState, updateLane); - break a; - } - newState = workInProgress; - break a; - case 3: - workInProgress.flags = (workInProgress.flags & -65537) | 128; - case 0: - workInProgress = update.payload; - updateLane = - "function" === typeof workInProgress - ? workInProgress.call(instance, newState, updateLane) - : workInProgress; - if (null === updateLane || void 0 === updateLane) break a; - newState = assign({}, newState, updateLane); - break a; - case 2: - hasForceUpdate = !0; - } - } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress$jscomp$0.flags |= 64), - isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null - }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) - break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress$jscomp$0.lanes = lastBaseUpdate; - workInProgress$jscomp$0.memoizedState = newState; + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; +} +function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes +) { + sourceFiber.flags |= 32768; + isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); + if ( + null !== value && + "object" === typeof value && + (value.$$typeof === REACT_POSTPONE_TYPE && + (value = { then: function () {} }), + "function" === typeof value.then) + ) { + resetSuspendedComponent(sourceFiber, rootRenderLanes); + var suspenseBoundary = suspenseHandlerStackCursor.current; + if (null !== suspenseBoundary) { + switch (suspenseBoundary.tag) { + case 13: + return ( + null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === suspenseBoundary.alternate && + 0 === workInProgressRootExitStatus && + (workInProgressRootExitStatus = 3), + (suspenseBoundary.flags &= -257), + markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value === noopSuspenseyCommitThenable + ? (suspenseBoundary.flags |= 16384) + : ((sourceFiber = suspenseBoundary.updateQueue), + null === sourceFiber + ? (suspenseBoundary.updateQueue = new Set([value])) + : sourceFiber.add(value), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + case 22: + return ( + (suspenseBoundary.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (suspenseBoundary.flags |= 16384) + : ((sourceFiber = suspenseBoundary.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (suspenseBoundary.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + } + throw Error(formatProdErrorMessage(435, suspenseBoundary.tag)); + } + attachPingListener(root, value, rootRenderLanes); + renderDidSuspendDelayIfPossible(); + return !1; } + if (isHydrating) + return ( + (suspenseBoundary = suspenseHandlerStackCursor.current), + null !== suspenseBoundary + ? (0 === (suspenseBoundary.flags & 65536) && + (suspenseBoundary.flags |= 256), + markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value !== HydrationMismatchException && + ((root = Error(formatProdErrorMessage(422), { cause: value })), + queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) + : (value !== HydrationMismatchException && + ((returnFiber = Error(formatProdErrorMessage(423), { + cause: value + })), + queueHydrationError( + createCapturedValueAtFiber(returnFiber, sourceFiber) + )), + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes + )), + enqueueCapturedUpdate(root, rootRenderLanes), + 4 !== workInProgressRootExitStatus && + (workInProgressRootExitStatus = 2)), + !1 + ); + suspenseBoundary = Error(formatProdErrorMessage(520), { cause: value }); + queueConcurrentError( + createCapturedValueAtFiber(suspenseBoundary, sourceFiber) + ); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + do { + switch (returnFiber.tag) { + case 3: + return ( + (returnFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(returnFiber, root), + !1 + ); + case 1: + if ( + ((value = returnFiber.type), + (suspenseBoundary = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== suspenseBoundary && + "function" === typeof suspenseBoundary.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has( + suspenseBoundary + ))))) + ) + return ( + (returnFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + returnFiber, + sourceFiber + ), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), + !1 + ); + } + returnFiber = returnFiber.return; + } while (null !== returnFiber); + return !1; } -function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error(formatProdErrorMessage(191, callback)); - callback.call(context); +var SelectiveHydrationException = Error(formatProdErrorMessage(461)), + didReceiveUpdate = !1; +function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { + workInProgress.child = + null === current + ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) + : reconcileChildFibers( + workInProgress, + current.child, + nextChildren, + renderLanes + ); } -function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ +function updateForwardRef( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + Component = Component.render; + var ref = workInProgress.ref; + if ("ref" in nextProps) { + var propsWithoutRef = {}; + for (var key in nextProps) + "ref" !== key && (propsWithoutRef[key] = nextProps[key]); + } else propsWithoutRef = nextProps; + prepareToReadContext(workInProgress); + nextProps = renderWithHooks( + current, + workInProgress, + Component, + propsWithoutRef, + ref, + renderLanes + ); + key = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && key && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; +} +function updateMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (null === current) { + var type = Component.type; + if ( + "function" === typeof type && + !shouldConstruct(type) && + void 0 === type.defaultProps && + null === Component.compare ) - callCallback(callbacks[updateQueue], context); + return ( + (workInProgress.tag = 15), + (workInProgress.type = type), + updateSimpleMemoComponent( + current, + workInProgress, + type, + nextProps, + renderLanes + ) + ); + current = createFiberFromTypeAndProps( + Component.type, + null, + nextProps, + workInProgress, + workInProgress.mode, + renderLanes + ); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + type = current.child; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); +} +function updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (null !== current) { + var prevProps = current.memoizedProps; + if ( + shallowEqual(prevProps, nextProps) && + current.ref === workInProgress.ref + ) + if ( + ((didReceiveUpdate = !1), + (workInProgress.pendingProps = nextProps = prevProps), + checkScheduledUpdateOrContext(current, renderLanes)) + ) + 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + else + return ( + (workInProgress.lanes = current.lanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + } + return updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ); +} +function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2), + prevState = null !== current ? current.memoizedState : null; + markRef(current, workInProgress); + if ("hidden" === nextProps.mode || nextIsDetached) { + if (0 !== (workInProgress.flags & 128)) { + nextProps = + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; + if (null !== current) { + nextChildren = workInProgress.child = current.child; + for (nextIsDetached = 0; null !== nextChildren; ) + (nextIsDetached = + nextIsDetached | nextChildren.lanes | nextChildren.childLanes), + (nextChildren = nextChildren.sibling); + workInProgress.childLanes = nextIsDetached & ~nextProps; + } else (workInProgress.childLanes = 0), (workInProgress.child = null); + return deferHiddenOffscreenComponent( + current, + workInProgress, + nextProps, + renderLanes + ); + } + if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else + return ( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( + current, + workInProgress, + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, + renderLanes + ) + ); + } else + null !== prevState + ? (pushTransition(workInProgress, prevState.cachePool), + pushHiddenContext(workInProgress, prevState), + reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.memoizedState = null)) + : (null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(), + reuseSuspenseHandlerOnStack(workInProgress)); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; +} +function deferHiddenOffscreenComponent( + current, + workInProgress, + nextBaseLanes, + renderLanes +) { + var JSCompiler_inline_result = peekCacheFromPool(); + JSCompiler_inline_result = + null === JSCompiler_inline_result + ? null + : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result }; + workInProgress.memoizedState = { + baseLanes: nextBaseLanes, + cachePool: JSCompiler_inline_result + }; + null !== current && pushTransition(workInProgress, null); + reuseHiddenContextOnStack(); + pushOffscreenSuspenseHandler(workInProgress); + null !== current && + propagateParentContextChanges(current, workInProgress, renderLanes, !0); + return null; +} +function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error(formatProdErrorMessage(284)); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } +} +function updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + prepareToReadContext(workInProgress); + Component = renderWithHooks( + current, + workInProgress, + Component, + nextProps, + void 0, + renderLanes + ); + nextProps = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && nextProps && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; +} +function replayFunctionComponent( + current, + workInProgress, + nextProps, + Component, + secondArg, + renderLanes +) { + prepareToReadContext(workInProgress); + workInProgress.updateQueue = null; + nextProps = renderWithHooksAgain( + workInProgress, + Component, + nextProps, + secondArg + ); + finishRenderingHooks(current); + Component = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && Component && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; +} +function updateClassComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + prepareToReadContext(workInProgress); + if (null === workInProgress.stateNode) { + var context = emptyContextObject, + contextType = Component.contextType; + "object" === typeof contextType && + null !== contextType && + (context = readContext(contextType)); + context = new Component(nextProps, context); + workInProgress.memoizedState = + null !== context.state && void 0 !== context.state ? context.state : null; + context.updater = classComponentUpdater; + workInProgress.stateNode = context; + context._reactInternals = workInProgress; + context = workInProgress.stateNode; + context.props = nextProps; + context.state = workInProgress.memoizedState; + context.refs = {}; + initializeUpdateQueue(workInProgress); + contextType = Component.contextType; + context.context = + "object" === typeof contextType && null !== contextType + ? readContext(contextType) + : emptyContextObject; + context.state = workInProgress.memoizedState; + contextType = Component.getDerivedStateFromProps; + "function" === typeof contextType && + (applyDerivedStateFromProps( + workInProgress, + Component, + contextType, + nextProps + ), + (context.state = workInProgress.memoizedState)); + "function" === typeof Component.getDerivedStateFromProps || + "function" === typeof context.getSnapshotBeforeUpdate || + ("function" !== typeof context.UNSAFE_componentWillMount && + "function" !== typeof context.componentWillMount) || + ((contextType = context.state), + "function" === typeof context.componentWillMount && + context.componentWillMount(), + "function" === typeof context.UNSAFE_componentWillMount && + context.UNSAFE_componentWillMount(), + contextType !== context.state && + classComponentUpdater.enqueueReplaceState(context, context.state, null), + processUpdateQueue(workInProgress, nextProps, context, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (context.state = workInProgress.memoizedState)); + "function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308); + nextProps = !0; + } else if (null === current) { + context = workInProgress.stateNode; + var unresolvedOldProps = workInProgress.memoizedProps, + oldProps = resolveClassComponentProps(Component, unresolvedOldProps); + context.props = oldProps; + var oldContext = context.context, + contextType$jscomp$0 = Component.contextType; + contextType = emptyContextObject; + "object" === typeof contextType$jscomp$0 && + null !== contextType$jscomp$0 && + (contextType = readContext(contextType$jscomp$0)); + var getDerivedStateFromProps = Component.getDerivedStateFromProps; + contextType$jscomp$0 = + "function" === typeof getDerivedStateFromProps || + "function" === typeof context.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + contextType$jscomp$0 || + ("function" !== typeof context.UNSAFE_componentWillReceiveProps && + "function" !== typeof context.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && + callComponentWillReceiveProps( + workInProgress, + context, + nextProps, + contextType + )); + hasForceUpdate = !1; + var oldState = workInProgress.memoizedState; + context.state = oldState; + processUpdateQueue(workInProgress, nextProps, context, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + oldContext = workInProgress.memoizedState; + unresolvedOldProps || oldState !== oldContext || hasForceUpdate + ? ("function" === typeof getDerivedStateFromProps && + (applyDerivedStateFromProps( + workInProgress, + Component, + getDerivedStateFromProps, + nextProps + ), + (oldContext = workInProgress.memoizedState)), + (oldProps = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + oldProps, + nextProps, + oldState, + oldContext, + contextType + )) + ? (contextType$jscomp$0 || + ("function" !== typeof context.UNSAFE_componentWillMount && + "function" !== typeof context.componentWillMount) || + ("function" === typeof context.componentWillMount && + context.componentWillMount(), + "function" === typeof context.UNSAFE_componentWillMount && + context.UNSAFE_componentWillMount()), + "function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308)) + : ("function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (context.props = nextProps), + (context.state = oldContext), + (context.context = contextType), + (nextProps = oldProps)) + : ("function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308), + (nextProps = !1)); + } else { + context = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + contextType = workInProgress.memoizedProps; + contextType$jscomp$0 = resolveClassComponentProps(Component, contextType); + context.props = contextType$jscomp$0; + getDerivedStateFromProps = workInProgress.pendingProps; + oldState = context.context; + oldContext = Component.contextType; + oldProps = emptyContextObject; + "object" === typeof oldContext && + null !== oldContext && + (oldProps = readContext(oldContext)); + unresolvedOldProps = Component.getDerivedStateFromProps; + (oldContext = + "function" === typeof unresolvedOldProps || + "function" === typeof context.getSnapshotBeforeUpdate) || + ("function" !== typeof context.UNSAFE_componentWillReceiveProps && + "function" !== typeof context.componentWillReceiveProps) || + ((contextType !== getDerivedStateFromProps || oldState !== oldProps) && + callComponentWillReceiveProps( + workInProgress, + context, + nextProps, + oldProps + )); + hasForceUpdate = !1; + oldState = workInProgress.memoizedState; + context.state = oldState; + processUpdateQueue(workInProgress, nextProps, context, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + contextType !== getDerivedStateFromProps || + oldState !== newState || + hasForceUpdate || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) + ? ("function" === typeof unresolvedOldProps && + (applyDerivedStateFromProps( + workInProgress, + Component, + unresolvedOldProps, + nextProps + ), + (newState = workInProgress.memoizedState)), + (contextType$jscomp$0 = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + contextType$jscomp$0, + nextProps, + oldState, + newState, + oldProps + ) || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) + ? (oldContext || + ("function" !== typeof context.UNSAFE_componentWillUpdate && + "function" !== typeof context.componentWillUpdate) || + ("function" === typeof context.componentWillUpdate && + context.componentWillUpdate(nextProps, newState, oldProps), + "function" === typeof context.UNSAFE_componentWillUpdate && + context.UNSAFE_componentWillUpdate( + nextProps, + newState, + oldProps + )), + "function" === typeof context.componentDidUpdate && + (workInProgress.flags |= 4), + "function" === typeof context.getSnapshotBeforeUpdate && + (workInProgress.flags |= 1024)) + : ("function" !== typeof context.componentDidUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof context.getSnapshotBeforeUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 1024), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = newState)), + (context.props = nextProps), + (context.state = newState), + (context.context = oldProps), + (nextProps = contextType$jscomp$0)) + : ("function" !== typeof context.componentDidUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof context.getSnapshotBeforeUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 1024), + (nextProps = !1)); + } + context = nextProps; + markRef(current, workInProgress); + nextProps = 0 !== (workInProgress.flags & 128); + context || nextProps + ? ((context = workInProgress.stateNode), + nextProps && "function" !== typeof Component.getDerivedStateFromError + ? ((Component = null), (profilerStartTime = -1)) + : (Component = context.render()), + (workInProgress.flags |= 1), + null !== current && nextProps + ? ((workInProgress.child = reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + Component, + renderLanes + ))) + : reconcileChildren(current, workInProgress, Component, renderLanes), + (workInProgress.memoizedState = context.state), + (current = workInProgress.child)) + : (current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + )); + return current; +} +function mountHostRootWithoutHydrating( + current, + workInProgress, + nextChildren, + renderLanes +) { + resetHydrationState(); + workInProgress.flags |= 256; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; +} +var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; +function mountSuspenseOffscreenState(renderLanes) { + return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; +} +function getRemainingWorkInPrimaryTree( + current, + primaryTreeDidDefer, + renderLanes +) { + current = null !== current ? current.childLanes & ~renderLanes : 0; + primaryTreeDidDefer && (current |= workInProgressDeferredLane); + return current; +} +function updateSuspenseComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + showFallback = !1, + didSuspend = 0 !== (workInProgress.flags & 128), + JSCompiler_temp; + (JSCompiler_temp = didSuspend) || + (JSCompiler_temp = + null !== current && null === current.memoizedState + ? !1 + : 0 !== (suspenseStackCursor.current & 2)); + JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); + JSCompiler_temp = 0 !== (workInProgress.flags & 32); + workInProgress.flags &= -33; + if (null === current) { + if (isHydrating) { + showFallback + ? pushPrimaryTreeSuspenseHandler(workInProgress) + : reuseSuspenseHandlerOnStack(workInProgress); + if (isHydrating) { + var nextInstance = nextHydratableInstance, + JSCompiler_temp$jscomp$0; + if ((JSCompiler_temp$jscomp$0 = nextInstance)) { + c: { + JSCompiler_temp$jscomp$0 = nextInstance; + for ( + nextInstance = rootOrSingletonContext; + 8 !== JSCompiler_temp$jscomp$0.nodeType; + + ) { + if (!nextInstance) { + nextInstance = null; + break c; + } + JSCompiler_temp$jscomp$0 = getNextHydratable( + JSCompiler_temp$jscomp$0.nextSibling + ); + if (null === JSCompiler_temp$jscomp$0) { + nextInstance = null; + break c; + } + } + nextInstance = JSCompiler_temp$jscomp$0; + } + null !== nextInstance + ? ((workInProgress.memoizedState = { + dehydrated: nextInstance, + treeContext: + null !== treeContextProvider + ? { id: treeContextId, overflow: treeContextOverflow } + : null, + retryLane: 536870912 + }), + (JSCompiler_temp$jscomp$0 = createFiberImplClass( + 18, + null, + null, + 0 + )), + (JSCompiler_temp$jscomp$0.stateNode = nextInstance), + (JSCompiler_temp$jscomp$0.return = workInProgress), + (workInProgress.child = JSCompiler_temp$jscomp$0), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (JSCompiler_temp$jscomp$0 = !0)) + : (JSCompiler_temp$jscomp$0 = !1); + } + JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); + } + nextInstance = workInProgress.memoizedState; + if ( + null !== nextInstance && + ((nextInstance = nextInstance.dehydrated), null !== nextInstance) + ) + return ( + isSuspenseInstanceFallback(nextInstance) + ? (workInProgress.lanes = 32) + : (workInProgress.lanes = 536870912), + null + ); + popSuspenseHandler(workInProgress); + } + nextInstance = nextProps.children; + JSCompiler_temp$jscomp$0 = nextProps.fallback; + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (nextProps = mountSuspenseFallbackChildren( + workInProgress, + nextInstance, + JSCompiler_temp$jscomp$0, + renderLanes + )), + (showFallback = workInProgress.child), + (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + nextProps + ); + if ("number" === typeof nextProps.unstable_expectedLoadTime) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (nextProps = mountSuspenseFallbackChildren( + workInProgress, + nextInstance, + JSCompiler_temp$jscomp$0, + renderLanes + )), + (showFallback = workInProgress.child), + (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress.lanes = 4194304), + nextProps + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren(workInProgress, nextInstance); + } + JSCompiler_temp$jscomp$0 = current.memoizedState; + if ( + null !== JSCompiler_temp$jscomp$0 && + ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated), + null !== nextInstance) + ) { + if (didSuspend) + workInProgress.flags & 256 + ? (pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags &= -257), + (workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ))) + : null !== workInProgress.memoizedState + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = nextProps.fallback), + (nextInstance = workInProgress.mode), + (nextProps = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: nextProps.children }, + nextInstance + )), + (showFallback = createFiberFromFragment( + showFallback, + nextInstance, + renderLanes, + null + )), + (showFallback.flags |= 2), + (nextProps.return = workInProgress), + (showFallback.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = showFallback)); + else if ( + (pushPrimaryTreeSuspenseHandler(workInProgress), + isSuspenseInstanceFallback(nextInstance)) + ) { + JSCompiler_temp = + nextInstance.nextSibling && nextInstance.nextSibling.dataset; + if (JSCompiler_temp) var digest = JSCompiler_temp.dgst; + JSCompiler_temp = digest; + "POSTPONE" !== JSCompiler_temp && + ((nextProps = Error(formatProdErrorMessage(419))), + (nextProps.stack = ""), + (nextProps.digest = JSCompiler_temp), + queueHydrationError({ value: nextProps, source: null, stack: null })); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else if ( + (didReceiveUpdate || + propagateParentContextChanges(current, workInProgress, renderLanes, !1), + (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), + didReceiveUpdate || JSCompiler_temp) + ) { + JSCompiler_temp = workInProgressRoot; + if ( + null !== JSCompiler_temp && + ((nextProps = renderLanes & -renderLanes), + (nextProps = + 0 !== (nextProps & 42) + ? 1 + : getBumpedLaneForHydrationByLane(nextProps)), + (nextProps = + 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) + ? 0 + : nextProps), + 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) + ) + throw ( + ((JSCompiler_temp$jscomp$0.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), + SelectiveHydrationException) + ); + "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else + "$?" === nextInstance.data + ? ((workInProgress.flags |= 192), + (workInProgress.child = current.child), + (workInProgress = null)) + : ((current = JSCompiler_temp$jscomp$0.treeContext), + (nextHydratableInstance = getNextHydratable( + nextInstance.nextSibling + )), + (hydrationParentFiber = workInProgress), + (isHydrating = !0), + (hydrationErrors = null), + (rootOrSingletonContext = !1), + null !== current && + ((idStack[idStackIndex++] = treeContextId), + (idStack[idStackIndex++] = treeContextOverflow), + (idStack[idStackIndex++] = treeContextProvider), + (treeContextId = current.id), + (treeContextOverflow = current.overflow), + (treeContextProvider = workInProgress)), + (workInProgress = mountSuspensePrimaryChildren( + workInProgress, + nextProps.children + )), + (workInProgress.flags |= 4096)); + return workInProgress; + } + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = nextProps.fallback), + (nextInstance = workInProgress.mode), + (JSCompiler_temp$jscomp$0 = current.child), + (digest = JSCompiler_temp$jscomp$0.sibling), + (nextProps = createWorkInProgress(JSCompiler_temp$jscomp$0, { + mode: "hidden", + children: nextProps.children + })), + (nextProps.subtreeFlags = + JSCompiler_temp$jscomp$0.subtreeFlags & 31457280), + null !== digest + ? (showFallback = createWorkInProgress(digest, showFallback)) + : ((showFallback = createFiberFromFragment( + showFallback, + nextInstance, + renderLanes, + null + )), + (showFallback.flags |= 2)), + (showFallback.return = workInProgress), + (nextProps.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + (nextProps = showFallback), + (showFallback = workInProgress.child), + (nextInstance = current.child.memoizedState), + null === nextInstance + ? (nextInstance = mountSuspenseOffscreenState(renderLanes)) + : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool), + null !== JSCompiler_temp$jscomp$0 + ? ((digest = CacheContext._currentValue), + (JSCompiler_temp$jscomp$0 = + JSCompiler_temp$jscomp$0.parent !== digest + ? { parent: digest, pool: digest } + : JSCompiler_temp$jscomp$0)) + : (JSCompiler_temp$jscomp$0 = getSuspendedCache()), + (nextInstance = { + baseLanes: nextInstance.baseLanes | renderLanes, + cachePool: JSCompiler_temp$jscomp$0 + })), + (showFallback.memoizedState = nextInstance), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + nextProps + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + renderLanes = current.child; + current = renderLanes.sibling; + renderLanes = createWorkInProgress(renderLanes, { + mode: "visible", + children: nextProps.children + }); + renderLanes.return = workInProgress; + renderLanes.sibling = null; + null !== current && + ((JSCompiler_temp = workInProgress.deletions), + null === JSCompiler_temp + ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) + : JSCompiler_temp.push(current)); + workInProgress.child = renderLanes; + workInProgress.memoizedState = null; + return renderLanes; +} +function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: primaryChildren }, + workInProgress.mode + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); +} +function mountSuspenseFallbackChildren( + workInProgress, + primaryChildren, + fallbackChildren, + renderLanes +) { + var mode = workInProgress.mode; + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "hidden", children: primaryChildren }, + mode + ); + fallbackChildren = createFiberFromFragment( + fallbackChildren, + mode, + renderLanes, + null + ); + primaryChildren.return = workInProgress; + fallbackChildren.return = workInProgress; + primaryChildren.sibling = fallbackChildren; + workInProgress.child = primaryChildren; + return fallbackChildren; +} +function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { + return createFiberFromOffscreen(offscreenProps, mode, 0, null); +} +function retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes +) { + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren( + workInProgress, + workInProgress.pendingProps.children + ); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; +} +function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); +} +function initSuspenseListRenderState( + workInProgress, + isBackwards, + tail, + lastContentRow, + tailMode +) { + var renderState = workInProgress.memoizedState; + null === renderState + ? (workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + }) + : ((renderState.isBackwards = isBackwards), + (renderState.rendering = null), + (renderState.renderingStartTime = 0), + (renderState.last = lastContentRow), + (renderState.tail = tail), + (renderState.tailMode = tailMode)); +} +function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + reconcileChildren(current, workInProgress, nextProps.children, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & 2)) + (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128); + else { + if (null !== current && 0 !== (current.flags & 128)) + a: for (current = workInProgress.child; null !== current; ) { + if (13 === current.tag) + null !== current.memoizedState && + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (19 === current.tag) + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling; ) { + if (null === current.return || current.return === workInProgress) + break a; + current = current.return; + } + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= 1; + } + push(suspenseStackCursor, nextProps); + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); + renderLanes = revealOrder; + null === renderLanes + ? ((revealOrder = workInProgress.child), (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + return workInProgress.child; +} +function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { + null !== current && (workInProgress.dependencies = current.dependencies); + profilerStartTime = -1; + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) + if (null !== current) { + if ( + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + 0 === (renderLanes & workInProgress.childLanes)) + ) + return null; + } else return null; + if (null !== current && workInProgress.child !== current.child) + throw Error(formatProdErrorMessage(153)); + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + for (renderLanes.return = workInProgress; null !== current.sibling; ) + (current = current.sibling), + (renderLanes = renderLanes.sibling = + createWorkInProgress(current, current.pendingProps)), + (renderLanes.return = workInProgress); + renderLanes.sibling = null; + } + return workInProgress.child; +} +function checkScheduledUpdateOrContext(current, renderLanes) { + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; +} +function attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes +) { + switch (workInProgress.tag) { + case 3: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); + resetHydrationState(); + break; + case 27: + case 5: + pushHostContext(workInProgress); + break; + case 4: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + break; + case 10: + pushProvider( + workInProgress, + workInProgress.type, + workInProgress.memoizedProps.value + ); + break; + case 12: + 0 !== (renderLanes & workInProgress.childLanes) && + (workInProgress.flags |= 4); + workInProgress.flags |= 2048; + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = -0; + stateNode.passiveEffectDuration = -0; + break; + case 13: + stateNode = workInProgress.memoizedState; + if (null !== stateNode) { + if (null !== stateNode.dehydrated) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags |= 128), + null + ); + if (0 !== (renderLanes & workInProgress.child.childLanes)) + return updateSuspenseComponent(current, workInProgress, renderLanes); + pushPrimaryTreeSuspenseHandler(workInProgress); + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + return null !== current ? current.sibling : null; + } + pushPrimaryTreeSuspenseHandler(workInProgress); + break; + case 19: + var didSuspendBefore = 0 !== (current.flags & 128); + stateNode = 0 !== (renderLanes & workInProgress.childLanes); + stateNode || + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); + if (didSuspendBefore) { + if (stateNode) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + workInProgress.flags |= 128; + } + didSuspendBefore = workInProgress.memoizedState; + null !== didSuspendBefore && + ((didSuspendBefore.rendering = null), + (didSuspendBefore.tail = null), + (didSuspendBefore.lastEffect = null)); + push(suspenseStackCursor, suspenseStackCursor.current); + if (stateNode) break; + else return null; + case 22: + case 23: + return ( + (workInProgress.lanes = 0), + updateOffscreenComponent(current, workInProgress, renderLanes) + ); + case 24: + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); + } + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); +} +function beginWork(current, workInProgress, renderLanes) { + if (null !== current) + if (current.memoizedProps !== workInProgress.pendingProps) + didReceiveUpdate = !0; + else { + if ( + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) + ) + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + } + else + (didReceiveUpdate = !1), + isHydrating && + 0 !== (workInProgress.flags & 1048576) && + pushTreeId(workInProgress, treeForkCount, workInProgress.index); + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 16: + a: { + current = workInProgress.pendingProps; + var lazyComponent = workInProgress.elementType, + init = lazyComponent._init; + lazyComponent = init(lazyComponent._payload); + workInProgress.type = lazyComponent; + if ("function" === typeof lazyComponent) + shouldConstruct(lazyComponent) + ? ((current = resolveClassComponentProps(lazyComponent, current)), + (workInProgress.tag = 1), + (workInProgress = updateClassComponent( + null, + workInProgress, + lazyComponent, + current, + renderLanes + ))) + : ((workInProgress.tag = 0), + (workInProgress = updateFunctionComponent( + null, + workInProgress, + lazyComponent, + current, + renderLanes + ))); + else { + if (void 0 !== lazyComponent && null !== lazyComponent) + if ( + ((init = lazyComponent.$$typeof), init === REACT_FORWARD_REF_TYPE) + ) { + workInProgress.tag = 11; + workInProgress = updateForwardRef( + null, + workInProgress, + lazyComponent, + current, + renderLanes + ); + break a; + } else if (init === REACT_MEMO_TYPE) { + workInProgress.tag = 14; + workInProgress = updateMemoComponent( + null, + workInProgress, + lazyComponent, + current, + renderLanes + ); + break a; + } + workInProgress = + getComponentNameFromType(lazyComponent) || lazyComponent; + throw Error(formatProdErrorMessage(306, workInProgress, "")); + } + } + return workInProgress; + case 0: + return updateFunctionComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 1: + return ( + (lazyComponent = workInProgress.type), + (init = resolveClassComponentProps( + lazyComponent, + workInProgress.pendingProps + )), + updateClassComponent( + current, + workInProgress, + lazyComponent, + init, + renderLanes + ) + ); + case 3: + a: { + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + if (null === current) throw Error(formatProdErrorMessage(387)); + var nextProps = workInProgress.pendingProps; + init = workInProgress.memoizedState; + lazyComponent = init.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + var nextState = workInProgress.memoizedState; + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); + suspendIfUpdateReadFromEntangledAsyncAction(); + nextProps = nextState.element; + if (init.isDehydrated) + if ( + ((init = { + element: nextProps, + isDehydrated: !1, + cache: nextState.cache + }), + (workInProgress.updateQueue.baseState = init), + (workInProgress.memoizedState = init), + workInProgress.flags & 256) + ) { + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else if (nextProps !== lazyComponent) { + lazyComponent = createCapturedValueAtFiber( + Error(formatProdErrorMessage(424)), + workInProgress + ); + queueHydrationError(lazyComponent); + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else + for ( + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ), + hydrationParentFiber = workInProgress, + isHydrating = !0, + hydrationErrors = null, + rootOrSingletonContext = !0, + renderLanes = mountChildFibers( + workInProgress, + null, + nextProps, + renderLanes + ), + workInProgress.child = renderLanes; + renderLanes; + + ) + (renderLanes.flags = (renderLanes.flags & -3) | 4096), + (renderLanes = renderLanes.sibling); + else { + resetHydrationState(); + if (nextProps === lazyComponent) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + break a; + } + reconcileChildren(current, workInProgress, nextProps, renderLanes); + } + workInProgress = workInProgress.child; + } + return workInProgress; + case 26: + return ( + markRef(current, workInProgress), + null === current + ? (renderLanes = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + )) + ? (workInProgress.memoizedState = renderLanes) + : isHydrating || + ((renderLanes = workInProgress.type), + (current = workInProgress.pendingProps), + (lazyComponent = getOwnerDocumentFromRootContainer( + rootInstanceStackCursor.current + ).createElement(renderLanes)), + (lazyComponent[internalInstanceKey] = workInProgress), + (lazyComponent[internalPropsKey] = current), + setInitialProperties(lazyComponent, renderLanes, current), + markNodeAsHoistable(lazyComponent), + (workInProgress.stateNode = lazyComponent)) + : (workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + )), + null + ); + case 27: + return ( + pushHostContext(workInProgress), + null === current && + isHydrating && + ((lazyComponent = workInProgress.stateNode = + resolveSingletonInstance( + workInProgress.type, + workInProgress.pendingProps, + rootInstanceStackCursor.current + )), + (hydrationParentFiber = workInProgress), + (rootOrSingletonContext = !0), + (nextHydratableInstance = getNextHydratable( + lazyComponent.firstChild + ))), + (lazyComponent = workInProgress.pendingProps.children), + null !== current || isHydrating + ? reconcileChildren( + current, + workInProgress, + lazyComponent, + renderLanes + ) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + lazyComponent, + renderLanes + )), + markRef(current, workInProgress), + workInProgress.child + ); + case 5: + if (null === current && isHydrating) { + if ((init = lazyComponent = nextHydratableInstance)) + (lazyComponent = canHydrateInstance( + lazyComponent, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== lazyComponent + ? ((workInProgress.stateNode = lazyComponent), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = getNextHydratable( + lazyComponent.firstChild + )), + (rootOrSingletonContext = !1), + (init = !0)) + : (init = !1); + init || throwOnHydrationMismatch(workInProgress); + } + pushHostContext(workInProgress); + init = workInProgress.type; + nextProps = workInProgress.pendingProps; + nextState = null !== current ? current.memoizedProps : null; + lazyComponent = nextProps.children; + shouldSetTextContent(init, nextProps) + ? (lazyComponent = null) + : null !== nextState && + shouldSetTextContent(init, nextState) && + (workInProgress.flags |= 32); + null !== workInProgress.memoizedState && + ((init = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue = init)); + markRef(current, workInProgress); + reconcileChildren(current, workInProgress, lazyComponent, renderLanes); + return workInProgress.child; + case 6: + if (null === current && isHydrating) { + if ((current = renderLanes = nextHydratableInstance)) + (renderLanes = canHydrateTextInstance( + renderLanes, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== renderLanes + ? ((workInProgress.stateNode = renderLanes), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (current = !0)) + : (current = !1); + current || throwOnHydrationMismatch(workInProgress); + } + return null; + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (lazyComponent = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + lazyComponent, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + lazyComponent, + renderLanes + ), + workInProgress.child + ); + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child + ); + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), + (lazyComponent = workInProgress.stateNode), + (lazyComponent.effectDuration = -0), + (lazyComponent.passiveEffectDuration = -0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return ( + (lazyComponent = workInProgress.pendingProps), + pushProvider(workInProgress, workInProgress.type, lazyComponent.value), + reconcileChildren( + current, + workInProgress, + lazyComponent.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (init = workInProgress.type._context), + (lazyComponent = workInProgress.pendingProps.children), + prepareToReadContext(workInProgress), + (init = readContext(init)), + (lazyComponent = lazyComponent(init)), + (workInProgress.flags |= 1), + reconcileChildren(current, workInProgress, lazyComponent, renderLanes), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (lazyComponent = readContext(CacheContext)), + null === current + ? ((init = peekCacheFromPool()), + null === init && + ((init = workInProgressRoot), + (nextProps = createCache()), + (init.pooledCache = nextProps), + nextProps.refCount++, + null !== nextProps && (init.pooledCacheLanes |= renderLanes), + (init = nextProps)), + (workInProgress.memoizedState = { + parent: lazyComponent, + cache: init + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, init)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (init = current.memoizedState), + (nextProps = workInProgress.memoizedState), + init.parent !== lazyComponent + ? ((init = { parent: lazyComponent, cache: lazyComponent }), + (workInProgress.memoizedState = init), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + init), + pushProvider(workInProgress, CacheContext, lazyComponent)) + : ((lazyComponent = nextProps.cache), + pushProvider(workInProgress, CacheContext, lazyComponent), + lazyComponent !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; + } + throw Error(formatProdErrorMessage(156, workInProgress.tag)); } function shouldProfile(current) { return 0 !== (current.mode & 2); @@ -8387,178 +8218,7 @@ var offscreenSubtreeIsHidden = !1, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, nextEffect = null, inProgressLanes = null, - inProgressRoot = null, - shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - root = root.containerInfo; - eventsEnabled = _enabled; - root = getActiveElementDeep(root); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, - focusNode = selection.focusNode; - selection = selection.focusOffset; - try { - JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$22) { - JSCompiler_temp = null; - break a; - } - var length = 0, - start = -1, - end = -1, - indexWithinAnchor = 0, - indexWithinFocus = 0, - node = root, - parentNode = null; - b: for (;;) { - for (var next; ; ) { - node !== JSCompiler_temp || - (0 !== anchorOffset && 3 !== node.nodeType) || - (start = length + anchorOffset); - node !== focusNode || - (0 !== selection && 3 !== node.nodeType) || - (end = length + selection); - 3 === node.nodeType && (length += node.nodeValue.length); - if (null === (next = node.firstChild)) break; - parentNode = node; - node = next; - } - for (;;) { - if (node === root) break b; - parentNode === JSCompiler_temp && - ++indexWithinAnchor === anchorOffset && - (start = length); - parentNode === focusNode && - ++indexWithinFocus === selection && - (end = length); - if (null !== (next = node.nextSibling)) break; - node = parentNode; - parentNode = node.parentNode; - } - node = next; - } - JSCompiler_temp = - -1 === start || -1 === end ? null : { start: start, end: end }; - } else JSCompiler_temp = null; - } - JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 }; - } else JSCompiler_temp = null; - selectionInformation = { focusedElem: root, selectionRange: JSCompiler_temp }; - _enabled = !1; - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((firstChild = nextEffect), - (root = firstChild.child), - 0 !== (firstChild.subtreeFlags & 1028) && null !== root) - ) - (root.return = firstChild), (nextEffect = root); - else - for (; null !== nextEffect; ) { - firstChild = nextEffect; - focusNode = firstChild.alternate; - root = firstChild.flags; - switch (firstChild.tag) { - case 0: - if ( - 0 !== (root & 4) && - ((root = firstChild.updateQueue), - (root = null !== root ? root.events : null), - null !== root) - ) - for ( - JSCompiler_temp = 0; - JSCompiler_temp < root.length; - JSCompiler_temp++ - ) - (anchorOffset = root[JSCompiler_temp]), - (anchorOffset.ref.impl = anchorOffset.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (root & 1024) && null !== focusNode) { - root = void 0; - JSCompiler_temp = firstChild; - anchorOffset = focusNode.memoizedProps; - focusNode = focusNode.memoizedState; - selection = JSCompiler_temp.stateNode; - try { - var resolvedPrevProps = resolveClassComponentProps( - JSCompiler_temp.type, - anchorOffset, - JSCompiler_temp.elementType === JSCompiler_temp.type - ); - root = selection.getSnapshotBeforeUpdate( - resolvedPrevProps, - focusNode - ); - selection.__reactInternalSnapshotBeforeUpdate = root; - } catch (error) { - captureCommitPhaseError( - JSCompiler_temp, - JSCompiler_temp.return, - error - ); - } - } - break; - case 3: - if (0 !== (root & 1024)) - if ( - ((root = firstChild.stateNode.containerInfo), - (JSCompiler_temp = root.nodeType), - 9 === JSCompiler_temp) - ) - clearContainerSparingly(root); - else if (1 === JSCompiler_temp) - switch (root.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(root); - break; - default: - root.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163)); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return resolvedPrevProps; -} + inProgressRoot = null; function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var prevEffectStart = pushComponentEffectStart(), flags = finishedWork.flags; @@ -8979,13 +8639,6 @@ function attachSuspenseRetryListeners(finishedWork, wakeables) { } }); } -function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - resetComponentEffectTimers(); - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; -} function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -9515,13 +9168,6 @@ function recursivelyResetForms(parentFiber) { parentFiber = parentFiber.sibling; } } -function commitLayoutEffects(finishedWork, root, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - resetComponentEffectTimers(); - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - inProgressRoot = inProgressLanes = null; -} function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -9530,7 +9176,8 @@ function recursivelyTraverseLayoutEffects(root, parentFiber) { } function recursivelyTraverseDisappearLayoutEffects(parentFiber) { for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var finishedWork = parentFiber; + var finishedWork = parentFiber, + prevEffectStart = pushComponentEffectStart(); switch (finishedWork.tag) { case 0: case 11: @@ -9564,6 +9211,17 @@ function recursivelyTraverseDisappearLayoutEffects(parentFiber) { default: recursivelyTraverseDisappearLayoutEffects(finishedWork); } + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); parentFiber = parentFiber.sibling; } } @@ -9578,6 +9236,7 @@ function recursivelyTraverseReappearLayoutEffects( var current = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, + prevEffectStart = pushComponentEffectStart(), flags = finishedWork.flags; switch (finishedWork.tag) { case 0: @@ -9688,6 +9347,17 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects ); } + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); parentFiber = parentFiber.sibling; } } @@ -9746,39 +9416,11 @@ function commitPassiveMountOnFiber( endTime ) { var prevEffectStart = pushComponentEffectStart(); - if ( - 0 !== (finishedWork.mode & 2) && + 0 !== (finishedWork.mode & 2) && 0 < finishedWork.actualStartTime && - 0 !== (finishedWork.flags & 1) - ) { - var startTime = finishedWork.actualStartTime, - name = getComponentNameFromFiber(finishedWork); - if (null !== name && supportsUserTiming) { - var selfTime = finishedWork.actualDuration; - if ( - null === finishedWork.alternate || - finishedWork.alternate.child !== finishedWork.child - ) - for ( - var child = finishedWork.child; - null !== child; - child = child.sibling - ) - selfTime -= child.actualDuration; - reusableComponentDevToolDetails.color = - 0.5 > selfTime - ? "primary-light" - : 10 > selfTime - ? "primary" - : 100 > selfTime - ? "primary-dark" - : "error"; - reusableComponentOptions.start = startTime; - reusableComponentOptions.end = endTime; - performance.measure(name, reusableComponentOptions); - } - } - startTime = finishedWork.flags; + 0 !== (finishedWork.flags & 1) && + logComponentRender(finishedWork, finishedWork.actualStartTime, endTime); + var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: @@ -9790,7 +9432,7 @@ function commitPassiveMountOnFiber( committedTransitions, endTime ); - startTime & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); break; case 3: var prevEffectDuration = pushNestedEffectDurations(); @@ -9801,7 +9443,7 @@ function commitPassiveMountOnFiber( committedTransitions, endTime ); - startTime & 2048 && + flags & 2048 && ((committedLanes = null), null !== finishedWork.alternate && (committedLanes = finishedWork.alternate.memoizedState.cache), @@ -9813,8 +9455,8 @@ function commitPassiveMountOnFiber( popNestedEffectDurations(prevEffectDuration); break; case 12: - if (startTime & 2048) { - startTime = pushNestedEffectDurations(); + if (flags & 2048) { + flags = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -9824,7 +9466,7 @@ function commitPassiveMountOnFiber( ); finishedRoot = finishedWork.stateNode; finishedRoot.passiveEffectDuration += - bubbleNestedEffectDurations(startTime); + bubbleNestedEffectDurations(flags); try { prevEffectDuration = finishedWork.memoizedProps; var id = prevEffectDuration.id, @@ -9863,7 +9505,13 @@ function commitPassiveMountOnFiber( committedTransitions, endTime ) - : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) + : recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ) : prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, @@ -9878,9 +9526,10 @@ function commitPassiveMountOnFiber( finishedWork, committedLanes, committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) + 0 !== (finishedWork.subtreeFlags & 10256), + endTime )); - startTime & 2048 && + flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork @@ -9894,7 +9543,7 @@ function commitPassiveMountOnFiber( committedTransitions, endTime ); - startTime & 2048 && + flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); break; default: @@ -9923,112 +9572,161 @@ function recursivelyTraverseReconnectPassiveEffects( parentFiber, committedLanes$jscomp$0, committedTransitions$jscomp$0, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime$jscomp$0 ) { includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); - for (parentFiber = parentFiber.child; null !== parentFiber; ) { + for (var child = parentFiber.child; null !== child; ) { + parentFiber = child.sibling; var finishedRoot = finishedRoot$jscomp$0, - finishedWork = parentFiber, committedLanes = committedLanes$jscomp$0, committedTransitions = committedTransitions$jscomp$0, - flags = finishedWork.flags; - switch (finishedWork.tag) { + endTime = + null !== parentFiber ? parentFiber.actualStartTime : endTime$jscomp$0, + prevEffectStart = pushComponentEffectStart(); + 0 !== (child.mode & 2) && + 0 < child.actualStartTime && + 0 !== (child.flags & 1) && + logComponentRender(child, child.actualStartTime, endTime); + var flags = child.flags; + switch (child.tag) { case 0: case 11: case 15: recursivelyTraverseReconnectPassiveEffects( finishedRoot, - finishedWork, + child, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); - commitHookPassiveMountEffects(finishedWork, 8); + commitHookPassiveMountEffects(child, 8); break; case 23: break; case 22: - var instance = finishedWork.stateNode; - null !== finishedWork.memoizedState + var instance = child.stateNode; + null !== child.memoizedState ? instance._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, - finishedWork, + child, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + child, + committedLanes, + committedTransitions, + endTime ) : ((instance._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, - finishedWork, + child, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime )); includeWorkInProgressEffects && flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); + commitOffscreenPassiveMountEffects(child.alternate, child); break; case 24: recursivelyTraverseReconnectPassiveEffects( finishedRoot, - finishedWork, + child, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); includeWorkInProgressEffects && flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); + commitCachePassiveMountEffect(child.alternate, child); break; default: recursivelyTraverseReconnectPassiveEffects( finishedRoot, - finishedWork, + child, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); } - parentFiber = parentFiber.sibling; + 0 !== (child.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + child, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); + child = parentFiber; } } function recursivelyTraverseAtomicPassiveEffects( finishedRoot$jscomp$0, - parentFiber + parentFiber, + committedLanes$jscomp$0, + committedTransitions$jscomp$0, + endTime$jscomp$0 ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) { + for (var child = parentFiber.child; null !== child; ) { + parentFiber = child.sibling; var finishedRoot = finishedRoot$jscomp$0, - finishedWork = parentFiber, - flags = finishedWork.flags; - switch (finishedWork.tag) { + committedLanes = committedLanes$jscomp$0, + committedTransitions = committedTransitions$jscomp$0, + endTime = + null !== parentFiber ? parentFiber.actualStartTime : endTime$jscomp$0; + 0 !== (child.mode & 2) && + 0 < child.actualStartTime && + 0 !== (child.flags & 1) && + logComponentRender(child, child.actualStartTime, endTime); + var flags = child.flags; + switch (child.tag) { case 22: - recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + endTime + ); flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); + commitOffscreenPassiveMountEffects(child.alternate, child); break; case 24: - recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + endTime + ); + flags & 2048 && commitCachePassiveMountEffect(child.alternate, child); break; default: - recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + endTime + ); } - parentFiber = parentFiber.sibling; + child = parentFiber; } } var suspenseyCommitFlag = 8192; @@ -10191,10 +9889,12 @@ function recursivelyTraverseDisconnectPassiveEffects(parentFiber) { } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; + var fiber = nextEffect, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0, + prevEffectStart = pushComponentEffectStart(); switch (fiber.tag) { case 0: case 11: @@ -10203,32 +9903,41 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( break; case 23: case 22: - if ( - null !== fiber.memoizedState && - null !== fiber.memoizedState.cachePool - ) { - var cache = fiber.memoizedState.cachePool.pool; - null != cache && cache.refCount++; - } + null !== fiber.memoizedState && + null !== fiber.memoizedState.cachePool && + ((nearestMountedAncestor = fiber.memoizedState.cachePool.pool), + null != nearestMountedAncestor && nearestMountedAncestor.refCount++); break; case 24: releaseCache(fiber.memoizedState.cache); } - cache = fiber.child; - if (null !== cache) (cache.return = fiber), (nextEffect = cache); + 0 !== (fiber.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + fiber, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); + prevEffectStart = fiber.child; + if (null !== prevEffectStart) + (prevEffectStart.return = fiber), (nextEffect = prevEffectStart); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - cache = nextEffect; - var sibling = cache.sibling, - returnFiber = cache.return; - detachFiberAfterEffects(cache); - if (cache === fiber) { + prevEffectStart = nextEffect; + nearestMountedAncestor = prevEffectStart.sibling; + var returnFiber = prevEffectStart.return; + detachFiberAfterEffects(prevEffectStart); + if (prevEffectStart === fiber) { nextEffect = null; break a; } - if (null !== sibling) { - sibling.return = returnFiber; - nextEffect = sibling; + if (null !== nearestMountedAncestor) { + nearestMountedAncestor.return = returnFiber; + nextEffect = nearestMountedAncestor; break a; } nextEffect = returnFiber; @@ -11198,7 +10907,6 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -11396,7 +11104,7 @@ function performWorkOnRoot(root, lanes, forceSync) { if ((lanes & 4194176) !== lanes) break; case 6: setCurrentTrackFromLanes(lanes); - logSuspendedRenderPhase(renderStartTime, startTime); + logSuspendedRenderPhase(renderStartTime, startTime, lanes); finalizeRender(lanes, startTime); forceSync = lanes; 0 !== (forceSync & 3) || 0 !== (forceSync & 60) @@ -11608,7 +11316,7 @@ function resetWorkInProgressStack() { var interruptedWork = workInProgress.return; else (interruptedWork = workInProgress), - (lastContextDependency = currentlyRenderingFiber = null), + (lastContextDependency = currentlyRenderingFiber$1 = null), resetHooksOnUnwind(interruptedWork), (thenableState = null), (thenableIndexCounter = 0), @@ -11638,14 +11346,22 @@ function prepareFreshStack(root, lanes) { 3 === workInProgressRootExitStatus || 4 === workInProgressRootExitStatus ) - logSuspendedRenderPhase(previousRenderStartTime, renderStartTime); + logSuspendedRenderPhase(previousRenderStartTime, renderStartTime, lanes); else { var endTime = renderStartTime; supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = endTime), - performance.measure("Interrupted Render", reusableLaneOptions)); + performance.measure( + (lanes & 536870912) === lanes + ? "Prewarm" + : (lanes & 201326677) === lanes + ? "Interrupted Hydration" + : "Interrupted Render", + reusableLaneOptions + )); } finalizeRender(workInProgressRootRenderLanes, renderStartTime); } @@ -11666,7 +11382,8 @@ function prepareFreshStack(root, lanes) { ? endTime : 0 <= previousRenderStartTime ? previousRenderStartTime - : renderStartTime + : renderStartTime, + lanes )); var eventType = blockingEventType, eventIsRepeat = blockingEventIsRepeat, @@ -11688,7 +11405,8 @@ function prepareFreshStack(root, lanes) { reusableLaneOptions )), 0 < previousRenderStartTime && - ((reusableLaneDevToolDetails.color = "primary-light"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-light" : "primary-light"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = renderStartTime$jscomp$0), performance.measure("Blocked", reusableLaneOptions))); @@ -11712,7 +11430,8 @@ function prepareFreshStack(root, lanes) { (setCurrentTrackFromLanes(lanes), logSuspendedWithDelayPhase( transitionSuspendedTime, - 0 <= eventType ? eventType : 0 <= endTime ? endTime : renderStartTime + 0 <= eventType ? eventType : 0 <= endTime ? endTime : renderStartTime, + lanes )); eventIsRepeat = transitionEventType; renderStartTime$jscomp$0 = transitionEventIsRepeat; @@ -11792,7 +11511,7 @@ function prepareFreshStack(root, lanes) { return previousRenderStartTime; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; thrownValue === SuspenseException || thrownValue === SuspenseActionException ? ((thrownValue = getSuspendedThenable()), @@ -11911,7 +11630,7 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -12032,7 +11751,7 @@ function renderRootConcurrent(root, lanes) { handleThrow(root, thrownValue$187); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -12104,7 +11823,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -12218,7 +11937,7 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { workInProgress = null; } function commitRoot( - root, + root$jscomp$0, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -12233,146 +11952,478 @@ function commitRoot( var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; try { - (ReactDOMSharedInternals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); + ReactDOMSharedInternals.p = 2; + ReactSharedInternals.T = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); + var finishedWork = root$jscomp$0.finishedWork, + lanes = root$jscomp$0.finishedLanes; + setCurrentTrackFromLanes(lanes); + 2 === exitStatus + ? logErroredRenderPhase(completedRenderStartTime, completedRenderEndTime) + : supportsUserTiming && + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (reusableLaneOptions.start = completedRenderStartTime), + (reusableLaneOptions.end = completedRenderEndTime), + performance.measure( + (lanes & 536870912) === lanes + ? "Prepared" + : (lanes & 201326677) === lanes + ? "Hydrated" + : "Render", + reusableLaneOptions + )); + if (null !== finishedWork) { + root$jscomp$0.finishedWork = null; + root$jscomp$0.finishedLanes = 0; + if (finishedWork === root$jscomp$0.current) + throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes, + remainingLanes$jscomp$0 = (remainingLanes |= concurrentlyUpdatedLanes), + previouslyPendingLanes = root$jscomp$0.pendingLanes; + root$jscomp$0.pendingLanes = remainingLanes$jscomp$0; + root$jscomp$0.suspendedLanes = 0; + root$jscomp$0.pingedLanes = 0; + root$jscomp$0.warmLanes = 0; + root$jscomp$0.expiredLanes &= remainingLanes$jscomp$0; + root$jscomp$0.entangledLanes &= remainingLanes$jscomp$0; + root$jscomp$0.errorRecoveryDisabledLanes &= remainingLanes$jscomp$0; + root$jscomp$0.shellSuspendCounter = 0; + for ( + var entanglements = root$jscomp$0.entanglements, + expirationTimes = root$jscomp$0.expirationTimes, + hiddenUpdates = root$jscomp$0.hiddenUpdates, + lanes$jscomp$0 = previouslyPendingLanes & ~remainingLanes$jscomp$0; + 0 < lanes$jscomp$0; + + ) { + var index$7 = 31 - clz32(lanes$jscomp$0), + lane = 1 << index$7; + entanglements[index$7] = 0; + expirationTimes[index$7] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$7]; + if (null !== hiddenUpdatesForLane) { + hiddenUpdates[index$7] = null; + for (var i = 0; i < hiddenUpdatesForLane.length; i++) { + var update = hiddenUpdatesForLane[i]; + null !== update && (update.lane &= -536870913); + } + } + lanes$jscomp$0 &= ~lane; + } + 0 !== spawnedLane && + markSpawnedDeferredLane(root$jscomp$0, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root$jscomp$0.tag && + (root$jscomp$0.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~lanes)); + root$jscomp$0 === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + var rootDoesHavePassiveEffects = !1; + 0 !== finishedWork.actualDuration || + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((rootDoesHavePassiveEffects = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), + (pendingPassiveTransitions = transitions)) + : ((root$jscomp$0.callbackNode = null), + (root$jscomp$0.callbackPriority = 0), + (root$jscomp$0.cancelPendingCommit = null)); + commitStartTime = now(); + if (1 === suspendedCommitReason) { + var endTime = commitStartTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-light"), + (reusableLaneOptions.start = completedRenderEndTime), + (reusableLaneOptions.end = endTime), + performance.measure("Suspended", reusableLaneOptions)); + } else if (2 === suspendedCommitReason) { + var endTime$jscomp$0 = commitStartTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-light"), + (reusableLaneOptions.start = completedRenderEndTime), + (reusableLaneOptions.end = endTime$jscomp$0), + performance.measure("Throttled", reusableLaneOptions)); + } + var rootHasEffect = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || rootHasEffect) { + var prevTransition$jscomp$0 = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + var containerInfo = root$jscomp$0.containerInfo; + eventsEnabled = _enabled; + var focusedElem = getActiveElementDeep(containerInfo); + if (hasSelectionCapabilities(focusedElem)) { + if ("selectionStart" in focusedElem) + var selection = { + start: focusedElem.selectionStart, + end: focusedElem.selectionEnd + }; + else + b: { + var ownerDocument = focusedElem.ownerDocument, + win = (ownerDocument && ownerDocument.defaultView) || window, + selection$jscomp$0 = win.getSelection && win.getSelection(); + if (selection$jscomp$0 && 0 !== selection$jscomp$0.rangeCount) { + var anchorNode = selection$jscomp$0.anchorNode, + anchorOffset = selection$jscomp$0.anchorOffset, + focusNode = selection$jscomp$0.focusNode, + focusOffset = selection$jscomp$0.focusOffset; + try { + anchorNode.nodeType, focusNode.nodeType; + } catch (e$22) { + selection = null; + break b; + } + var length = 0, + start = -1, + end = -1, + indexWithinAnchor = 0, + indexWithinFocus = 0, + node = focusedElem, + parentNode = null; + c: for (;;) { + for (var next; ; ) { + node !== anchorNode || + (0 !== anchorOffset && 3 !== node.nodeType) || + (start = length + anchorOffset); + node !== focusNode || + (0 !== focusOffset && 3 !== node.nodeType) || + (end = length + focusOffset); + 3 === node.nodeType && (length += node.nodeValue.length); + if (null === (next = node.firstChild)) break; + parentNode = node; + node = next; + } + for (;;) { + if (node === focusedElem) break c; + parentNode === anchorNode && + ++indexWithinAnchor === anchorOffset && + (start = length); + parentNode === focusNode && + ++indexWithinFocus === focusOffset && + (end = length); + if (null !== (next = node.nextSibling)) break; + node = parentNode; + parentNode = node.parentNode; + } + node = next; + } + selection = + -1 === start || -1 === end + ? null + : { start: start, end: end }; + } else selection = null; + } + var JSCompiler_temp = selection || { start: 0, end: 0 }; + } else JSCompiler_temp = null; + selectionInformation = { + focusedElem: focusedElem, + selectionRange: JSCompiler_temp + }; + _enabled = !1; + for (nextEffect = finishedWork; null !== nextEffect; ) { + var fiber = nextEffect, + child = fiber.child; + if (0 !== (fiber.subtreeFlags & 1028) && null !== child) + (child.return = fiber), (nextEffect = child); + else + b: for (; null !== nextEffect; ) { + var fiber$jscomp$0 = nextEffect, + snapshot = void 0, + finishedWork$jscomp$0 = fiber$jscomp$0, + current = finishedWork$jscomp$0.alternate, + flags = finishedWork$jscomp$0.flags; + switch (finishedWork$jscomp$0.tag) { + case 0: + if (0 !== (flags & 4)) { + var updateQueue = finishedWork$jscomp$0.updateQueue, + eventPayloads = + null !== updateQueue ? updateQueue.events : null; + if (null !== eventPayloads) + for (var ii = 0; ii < eventPayloads.length; ii++) { + var _eventPayloads$ii = eventPayloads[ii]; + _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; + } + } + break; + case 11: + case 15: + break; + case 1: + if (0 !== (flags & 1024) && null !== current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState, + instance = finishedWork$jscomp$0.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + finishedWork$jscomp$0.type, + prevProps, + finishedWork$jscomp$0.elementType === + finishedWork$jscomp$0.type + ); + snapshot = instance.getSnapshotBeforeUpdate( + resolvedPrevProps, + prevState + ); + instance.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error) { + captureCommitPhaseError( + finishedWork$jscomp$0, + finishedWork$jscomp$0.return, + error + ); + } + } + break; + case 3: + if (0 !== (flags & 1024)) + c: { + var container = + finishedWork$jscomp$0.stateNode.containerInfo, + nodeType = container.nodeType; + if (9 === nodeType) clearContainerSparingly(container); + else if (1 === nodeType) + switch (container.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(container); + break c; + default: + container.textContent = ""; + } + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (flags & 1024)) + throw Error(formatProdErrorMessage(163)); + } + var sibling = fiber$jscomp$0.sibling; + if (null !== sibling) { + sibling.return = fiber$jscomp$0.return; + nextEffect = sibling; + break b; + } + nextEffect = fiber$jscomp$0.return; + } + } + inProgressLanes = lanes; + inProgressRoot = root$jscomp$0; + resetComponentEffectTimers(); + commitMutationEffectsOnFiber(finishedWork, root$jscomp$0); + inProgressRoot = inProgressLanes = null; + var priorSelectionInformation = selectionInformation, + curFocusedElem = getActiveElementDeep(root$jscomp$0.containerInfo), + priorFocusedElem = priorSelectionInformation.focusedElem, + priorSelectionRange = priorSelectionInformation.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start$jscomp$0 = priorSelectionRange.start, + end$jscomp$0 = priorSelectionRange.end; + void 0 === end$jscomp$0 && (end$jscomp$0 = start$jscomp$0); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start$jscomp$0), + (priorFocusedElem.selectionEnd = Math.min( + end$jscomp$0, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win$jscomp$0 = (doc && doc.defaultView) || window; + if (win$jscomp$0.getSelection) { + var selection$jscomp$1 = win$jscomp$0.getSelection(), + length$jscomp$0 = priorFocusedElem.textContent.length, + start$jscomp$1 = Math.min( + priorSelectionRange.start, + length$jscomp$0 + ), + end$jscomp$1 = + void 0 === priorSelectionRange.end + ? start$jscomp$1 + : Math.min(priorSelectionRange.end, length$jscomp$0); + if ( + !selection$jscomp$1.extend && + start$jscomp$1 > end$jscomp$1 + ) { + var temp = end$jscomp$1; + end$jscomp$1 = start$jscomp$1; + start$jscomp$1 = temp; + } + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$1 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$1 + ); + if ( + startMarker && + endMarker && + (1 !== selection$jscomp$1.rangeCount || + selection$jscomp$1.anchorNode !== startMarker.node || + selection$jscomp$1.anchorOffset !== startMarker.offset || + selection$jscomp$1.focusNode !== endMarker.node || + selection$jscomp$1.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection$jscomp$1.removeAllRanges(); + start$jscomp$1 > end$jscomp$1 + ? (selection$jscomp$1.addRange(range), + selection$jscomp$1.extend( + endMarker.node, + endMarker.offset + )) + : (range.setEnd(endMarker.node, endMarker.offset), + selection$jscomp$1.addRange(range)); + } + } + } + } + for ( + var ancestors = [], ancestor = priorFocusedElem; + (ancestor = ancestor.parentNode); + + ) + 1 === ancestor.nodeType && + ancestors.push({ + element: ancestor, + left: ancestor.scrollLeft, + top: ancestor.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + var i$jscomp$0 = 0; + i$jscomp$0 < ancestors.length; + i$jscomp$0++ + ) { + var info = ancestors[i$jscomp$0]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + root$jscomp$0.current = finishedWork; + inProgressLanes = lanes; + inProgressRoot = root$jscomp$0; + resetComponentEffectTimers(); + commitLayoutEffectOnFiber( + root$jscomp$0, + finishedWork.alternate, + finishedWork + ); + inProgressRoot = inProgressLanes = null; + requestPaint(); + executionContext = prevExecutionContext; + ReactDOMSharedInternals.p = previousPriority; + ReactSharedInternals.T = prevTransition$jscomp$0; + } else root$jscomp$0.current = finishedWork; + commitEndTime = now(); + var startTime = + 0 === suspendedCommitReason + ? completedRenderEndTime + : commitStartTime, + endTime$jscomp$1 = commitEndTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-dark"), + (reusableLaneOptions.start = startTime), + (reusableLaneOptions.end = endTime$jscomp$1), + performance.measure("Commit", reusableLaneOptions)); + var rootDidHavePassiveEffects = rootDoesHavePassiveEffects; + rootDoesHavePassiveEffects + ? ((rootWithPendingPassiveEffects = root$jscomp$0), + (pendingPassiveEffectsLanes = lanes)) + : releaseRootPooledCache(root$jscomp$0, remainingLanes); + remainingLanes = root$jscomp$0.pendingLanes; + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + var root = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + var didError = 128 === (root.current.flags & 128); + switch (previousUpdateLanePriority) { + case 2: + var schedulerPriority = ImmediatePriority; + break; + case 8: + schedulerPriority = UserBlockingPriority; + break; + case 32: + schedulerPriority = NormalPriority$1; + break; + case 268435456: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority$1; + } + injectedHook.onCommitFiberRoot( + rendererID, + root, + schedulerPriority, + didError + ); + } catch (err) {} + isDevToolsPresent && root$jscomp$0.memoizedUpdaters.clear(); + if (null !== recoverableErrors) + for ( + var onRecoverableError = root$jscomp$0.onRecoverableError, + i$jscomp$1 = 0; + i$jscomp$1 < recoverableErrors.length; + i$jscomp$1++ + ) { + var recoverableError = recoverableErrors[i$jscomp$1]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); + ensureRootIsScheduled(root$jscomp$0); + remainingLanes = root$jscomp$0.pendingLanes; + 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + ? ((nestedUpdateScheduled = !0), + root$jscomp$0 === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), + (rootWithNestedUpdates = root$jscomp$0))) + : (nestedUpdateCount = 0); + rootDidHavePassiveEffects || finalizeRender(lanes, commitEndTime); + flushSyncWorkAcrossRoots_impl(0, !1); + } } finally { (ReactSharedInternals.T = prevTransition), (ReactDOMSharedInternals.p = previousUpdateLanePriority); } } -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime -) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork; - didIncludeRenderPhaseUpdate = root.finishedLanes; - setCurrentTrackFromLanes(didIncludeRenderPhaseUpdate); - 2 === exitStatus - ? logErroredRenderPhase(completedRenderStartTime, completedRenderEndTime) - : logRenderPhase(completedRenderStartTime, completedRenderEndTime); - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; - exitStatus = finishedWork.lanes | finishedWork.childLanes; - exitStatus |= concurrentlyUpdatedLanes; - markRootFinished( - root, - didIncludeRenderPhaseUpdate, - exitStatus, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - (0 === finishedWork.actualDuration && - 0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = exitStatus), - (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), - (pendingPassiveTransitions = transitions), - scheduleCallback$1(NormalPriority$1, function () { - schedulerEvent = window.event; - flushPassiveEffects(!0); - return null; - })); - commitStartTime = now(); - 1 === suspendedCommitReason - ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) - : 2 === suspendedCommitReason && - logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), - (ReactDOMSharedInternals.p = 2), - (updatedLanes = executionContext), - (executionContext |= 4), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffects(root, finishedWork, didIncludeRenderPhaseUpdate), - restoreSelection(selectionInformation, root.containerInfo), - (_enabled = !!eventsEnabled), - (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - commitLayoutEffects(finishedWork, root, didIncludeRenderPhaseUpdate), - requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - commitEndTime = now(); - logCommitPhase( - 0 === suspendedCommitReason ? completedRenderEndTime : commitStartTime, - commitEndTime - ); - (suspendedCommitReason = rootDoesHavePassiveEffects) - ? ((rootDoesHavePassiveEffects = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) - : releaseRootPooledCache(root, exitStatus); - exitStatus = root.pendingLanes; - 0 === exitStatus && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - ensureRootIsScheduled(root); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, completedRenderEndTime = 0; - completedRenderEndTime < recoverableErrors.length; - completedRenderEndTime++ - ) - (finishedWork = recoverableErrors[completedRenderEndTime]), - renderPriorityLevel(finishedWork.value, { - componentStack: finishedWork.stack - }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - exitStatus = root.pendingLanes; - 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (exitStatus & 42) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - suspendedCommitReason || - finalizeRender(didIncludeRenderPhaseUpdate, commitEndTime); - flushSyncWorkAcrossRoots_impl(0, !1); - return null; -} function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && ((remainingLanes = root.pooledCache), @@ -12399,6 +12450,9 @@ function flushPassiveEffects(wasDelayedCommit) { var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; + renderPriority.callbackNode = null; + renderPriority.callbackPriority = 0; + renderPriority.cancelPendingCommit = null; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); setCurrentTrackFromLanes(lanes); @@ -12440,6 +12494,7 @@ function flushPassiveEffects(wasDelayedCommit) { performance.measure("Remaining Effects", reusableLaneOptions)); finalizeRender(lanes, passiveEffectsEndTime); flushSyncWorkAcrossRoots_impl(0, !1); + ensureRootIsScheduled(renderPriority); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot @@ -12586,9 +12641,6 @@ function restorePendingUpdaters(root, lanes) { addFiberToLanesMap(root, schedulingFiber, lanes); }); } -function scheduleCallback$1(priorityLevel, callback) { - return scheduleCallback$3(priorityLevel, callback); -} var firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = !1, @@ -12694,12 +12746,13 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } + suspendedLanes = pendingPassiveEffectsLanes; currentTime = workInProgressRoot; - suspendedLanes = workInProgressRootRenderLanes; - suspendedLanes = getNextLanes( - root, - root === currentTime ? suspendedLanes : 0 - ); + pingedLanes = workInProgressRootRenderLanes; + suspendedLanes = + root === rootWithPendingPassiveEffects + ? suspendedLanes + : getNextLanes(root, root === currentTime ? pingedLanes : 0); pingedLanes = root.callbackNode; if ( 0 === suspendedLanes || @@ -12745,7 +12798,7 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = NormalPriority$1; } pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); - suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); + suspendedLanes = scheduleCallback$2(suspendedLanes, pingedLanes); root.callbackPriority = currentTime; root.callbackNode = suspendedLanes; return currentTime; @@ -12777,7 +12830,7 @@ function performSyncWorkOnRoot(root, lanes) { function scheduleImmediateTask(cb) { scheduleMicrotask(function () { 0 !== (executionContext & 6) - ? scheduleCallback$3(ImmediatePriority, cb) + ? scheduleCallback$2(ImmediatePriority, cb) : cb(); }); } @@ -12881,20 +12934,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1536 = 0; - i$jscomp$inline_1536 < simpleEventPluginEvents.length; - i$jscomp$inline_1536++ + var i$jscomp$inline_1548 = 0; + i$jscomp$inline_1548 < simpleEventPluginEvents.length; + i$jscomp$inline_1548++ ) { - var eventName$jscomp$inline_1537 = - simpleEventPluginEvents[i$jscomp$inline_1536], - domEventName$jscomp$inline_1538 = - eventName$jscomp$inline_1537.toLowerCase(), - capitalizedEvent$jscomp$inline_1539 = - eventName$jscomp$inline_1537[0].toUpperCase() + - eventName$jscomp$inline_1537.slice(1); + var eventName$jscomp$inline_1549 = + simpleEventPluginEvents[i$jscomp$inline_1548], + domEventName$jscomp$inline_1550 = + eventName$jscomp$inline_1549.toLowerCase(), + capitalizedEvent$jscomp$inline_1551 = + eventName$jscomp$inline_1549[0].toUpperCase() + + eventName$jscomp$inline_1549.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1538, - "on" + capitalizedEvent$jscomp$inline_1539 + domEventName$jscomp$inline_1550, + "on" + capitalizedEvent$jscomp$inline_1551 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -16177,8 +16230,9 @@ function attemptExplicitHydrationTarget(queuedTarget) { queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(), - root = enqueueConcurrentRenderForLane(nearestMounted, lane); + var lane = requestUpdateLane(); + lane = getBumpedLaneForHydrationByLane(lane); + var root = enqueueConcurrentRenderForLane(nearestMounted, lane); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); markRetryLaneIfNotHydrated(nearestMounted, lane); @@ -16380,16 +16434,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1783 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1812 = React.version; if ( - "19.0.0-experimental-7283a213-20241206" !== - isomorphicReactPackageVersion$jscomp$inline_1783 + "19.1.0-experimental-7eb8234f-20241218" !== + isomorphicReactPackageVersion$jscomp$inline_1812 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1783, - "19.0.0-experimental-7283a213-20241206" + isomorphicReactPackageVersion$jscomp$inline_1812, + "19.1.0-experimental-7eb8234f-20241218" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -16409,25 +16463,24 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2225 = { +var internals$jscomp$inline_2304 = { bundleType: 0, - version: "19.0.0-experimental-7283a213-20241206", + version: "19.1.0-experimental-7eb8234f-20241218", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7283a213-20241206" + reconcilerVersion: "19.1.0-experimental-7eb8234f-20241218" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2226 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2305 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2226.isDisabled && - hook$jscomp$inline_2226.supportsFiber + !hook$jscomp$inline_2305.isDisabled && + hook$jscomp$inline_2305.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2226.inject( - internals$jscomp$inline_2225 + (rendererID = hook$jscomp$inline_2305.inject( + internals$jscomp$inline_2304 )), - (injectedHook = hook$jscomp$inline_2226); + (injectedHook = hook$jscomp$inline_2305); } catch (err) {} } function noop() {} @@ -16550,11 +16603,13 @@ exports.hydrateRoot = function (container, initialChildren, options) { initialChildren.context = getContextForSubtree(null); options = initialChildren.current; isStrictMode = requestUpdateLane(); + isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode); identifierPrefix = createUpdate(isStrictMode); identifierPrefix.callback = null; enqueueUpdate(options, identifierPrefix, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated$1(initialChildren, isStrictMode); + options = isStrictMode; + initialChildren.current.lanes = options; + markRootUpdated$1(initialChildren, options); ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); @@ -16680,7 +16735,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-experimental-7283a213-20241206"; +exports.version = "19.1.0-experimental-7eb8234f-20241218"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js index e28dc62426401..40d645aac5a79 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js @@ -2132,7 +2132,7 @@ : children$jscomp$6; Array.isArray(children$jscomp$6) && 1 < children$jscomp$6.length ? console.error( - "React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an Array with length %s instead. Browsers treat all child Nodes of <title> tags as Text content and React expects to be able to convert `children` of <title> tags to a single string value which is why Arrays of length greater than 1 are not supported. When using JSX it can be commong to combine text nodes and value nodes. For example: <title>hello {nameOfUser}. While not immediately apparent, `children` in this case is an Array with length 2. If your `children` prop is using this form try rewriting it using a template string: {`hello ${nameOfUser}`}.", + "React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an Array with length %s instead. Browsers treat all child Nodes of <title> tags as Text content and React expects to be able to convert `children` of <title> tags to a single string value which is why Arrays of length greater than 1 are not supported. When using JSX it can be common to combine text nodes and value nodes. For example: <title>hello {nameOfUser}. While not immediately apparent, `children` in this case is an Array with length 2. If your `children` prop is using this form try rewriting it using a template string: {`hello ${nameOfUser}`}.", children$jscomp$6.length ) : "function" === typeof child || "symbol" === typeof child @@ -3999,9 +3999,6 @@ index ); } - function unsupportedRefresh() { - throw Error("Cache cannot be refreshed during server rendering."); - } function noop$1() {} function disabledLog() {} function disableLogs() { @@ -4247,7 +4244,7 @@ if ("string" === typeof type) return describeBuiltInComponentFrame(type); if ("function" === typeof type) return type.prototype && type.prototype.isReactComponent - ? ((type = describeNativeComponentFrame(type, !0)), type) + ? describeNativeComponentFrame(type, !0) : describeNativeComponentFrame(type, !1); if ("object" === typeof type && null !== type) { switch (type.$$typeof) { @@ -5291,7 +5288,6 @@ } else { switch (type) { case REACT_LEGACY_HIDDEN_TYPE: - case REACT_DEBUG_TRACING_MODE_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_PROFILER_TYPE: case REACT_FRAGMENT_TYPE: @@ -7848,10 +7844,8 @@ REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), - REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), REACT_POSTPONE_TYPE = Symbol.for("react.postpone"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, ASYNC_ITERATOR = Symbol.asyncIterator, @@ -9195,29 +9189,21 @@ ); return getServerSnapshot(); }, - useCacheRefresh: function () { - return unsupportedRefresh; - }, - useEffectEvent: function () { - return throwOnUseEffectEventCall; - }, - useMemoCache: function (size) { - for (var data = Array(size), i = 0; i < size; i++) - data[i] = REACT_MEMO_CACHE_SENTINEL; - return data; + useOptimistic: function (passthrough) { + resolveCurrentlyRenderingComponent(); + return [passthrough, unsupportedSetOptimisticState]; }, + useActionState: useActionState, + useFormState: useActionState, useHostTransitionStatus: function () { resolveCurrentlyRenderingComponent(); return NotPending; }, - useOptimistic: function (passthrough) { - resolveCurrentlyRenderingComponent(); - return [passthrough, unsupportedSetOptimisticState]; + useEffectEvent: function () { + return throwOnUseEffectEventCall; } - }; - HooksDispatcher.useFormState = useActionState; - HooksDispatcher.useActionState = useActionState; - var currentResumableState = null, + }, + currentResumableState = null, currentTaskInDEV = null, DefaultAsyncDispatcher = { getCacheForType: function () { @@ -9295,5 +9281,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-experimental-7283a213-20241206"; + exports.version = "19.1.0-experimental-7eb8234f-20241218"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js index d04c19bb94c91..a03425b9fb179 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js @@ -64,10 +64,8 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), - REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), REACT_POSTPONE_TYPE = Symbol.for("react.postpone"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, ASYNC_ITERATOR = Symbol.asyncIterator, @@ -2668,16 +2666,16 @@ function createRenderState(resumableState, generateStaticMarkup) { "\x3c/script>" ); bootstrapScriptContent = idPrefix + "P:"; - var JSCompiler_object_inline_segmentPrefix_1643 = idPrefix + "S:"; + var JSCompiler_object_inline_segmentPrefix_1640 = idPrefix + "S:"; idPrefix += "B:"; - var JSCompiler_object_inline_preconnects_1657 = new Set(), - JSCompiler_object_inline_fontPreloads_1658 = new Set(), - JSCompiler_object_inline_highImagePreloads_1659 = new Set(), - JSCompiler_object_inline_styles_1660 = new Map(), - JSCompiler_object_inline_bootstrapScripts_1661 = new Set(), - JSCompiler_object_inline_scripts_1662 = new Set(), - JSCompiler_object_inline_bulkPreloads_1663 = new Set(), - JSCompiler_object_inline_preloads_1664 = { + var JSCompiler_object_inline_preconnects_1654 = new Set(), + JSCompiler_object_inline_fontPreloads_1655 = new Set(), + JSCompiler_object_inline_highImagePreloads_1656 = new Set(), + JSCompiler_object_inline_styles_1657 = new Map(), + JSCompiler_object_inline_bootstrapScripts_1658 = new Set(), + JSCompiler_object_inline_scripts_1659 = new Set(), + JSCompiler_object_inline_bulkPreloads_1660 = new Set(), + JSCompiler_object_inline_preloads_1661 = { images: new Map(), stylesheets: new Map(), scripts: new Map(), @@ -2714,7 +2712,7 @@ function createRenderState(resumableState, generateStaticMarkup) { scriptConfig.moduleScriptResources[href] = null; scriptConfig = []; pushLinkImpl(scriptConfig, props); - JSCompiler_object_inline_bootstrapScripts_1661.add(scriptConfig); + JSCompiler_object_inline_bootstrapScripts_1658.add(scriptConfig); bootstrapChunks.push('