mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: This sync includes the following changes: - **[0cf9fc10b](https://github.com/facebook/react/commit/0cf9fc10b )**: Fix React Native flow types ([#20889](https://github.com/facebook/react/pull/20889)) //<Ricky>// - **[c581cdd48](https://github.com/facebook/react/commit/c581cdd48 )**: Schedule sync updates in microtask ([#20872](https://github.com/facebook/react/pull/20872)) //<Ricky>// - **[90bde6505](https://github.com/facebook/react/commit/90bde6505 )**: Add SuspenseList to react-is ([#20874](https://github.com/facebook/react/pull/20874)) //<Brian Vaughn>// - **[8336f19aa](https://github.com/facebook/react/commit/8336f19aa )**: Update React Native types ([#20883](https://github.com/facebook/react/pull/20883)) //<Rubén Norte>// - **[9209c30ff](https://github.com/facebook/react/commit/9209c30ff )**: Add StrictMode level prop and createRoot unstable_strictModeLevel option ([#20849](https://github.com/facebook/react/pull/20849)) //<Brian Vaughn>// - **[e5f6b91d2](https://github.com/facebook/react/commit/e5f6b91d2 )**: Add Lane labels to scheduling profiler marks ([#20808](https://github.com/facebook/react/pull/20808)) //<Brian Vaughn>// - **[c62986cfd](https://github.com/facebook/react/commit/c62986cfd )**: Add additional messaging for RulesOfHooks lint error ([#20692](https://github.com/facebook/react/pull/20692)) //<Anthony Garritano>// - **[78d2f2d30](https://github.com/facebook/react/commit/78d2f2d30 )**: Fabric-compatible implementation of `JSReponder` feature ([#20768](https://github.com/facebook/react/pull/20768)) //<Valentin Shergin>// - **[4d28eca97](https://github.com/facebook/react/commit/4d28eca97 )**: Land enableNonInterruptingNormalPri ([#20859](https://github.com/facebook/react/pull/20859)) //<Ricky>// - **[8af27aeed](https://github.com/facebook/react/commit/8af27aeed )**: Remove scheduler sampling profiler shared array buffer ([#20840](https://github.com/facebook/react/pull/20840)) //<Brian Vaughn>// - **[af3d52611](https://github.com/facebook/react/commit/af3d52611 )**: Disable (unstable) scheduler sampling profiler for OSS builds ([#20832](https://github.com/facebook/react/pull/20832)) //<Brian Vaughn>// - **[8fa0ccca0](https://github.com/facebook/react/commit/8fa0ccca0 )**: fix: use SharedArrayBuffer only when cross-origin isolation is enabled ([#20831](https://github.com/facebook/react/pull/20831)) //<Toru Kobayashi>// - **[099164792](https://github.com/facebook/react/commit/099164792 )**: Use setImmediate when available over MessageChannel ([#20834](https://github.com/facebook/react/pull/20834)) //<Dan Abramov>// - **[e2fd460cc](https://github.com/facebook/react/commit/e2fd460cc )**: Bailout in sync task if work is not sync ([#20813](https://github.com/facebook/react/pull/20813)) //<Andrew Clark>// - **[1a7472624](https://github.com/facebook/react/commit/1a7472624 )**: Add `supportsMicrotasks` to the host config ([#20809](https://github.com/facebook/react/pull/20809)) //<Andrew Clark>// - **[696e736be](https://github.com/facebook/react/commit/696e736be )**: Warn if static flag is accidentally cleared ([#20807](https://github.com/facebook/react/pull/20807)) //<Andrew Clark>// - **[483358c38](https://github.com/facebook/react/commit/483358c38 )**: Omit TransitionHydrationLane from TransitionLanes ([#20802](https://github.com/facebook/react/pull/20802)) //<Andrew Clark>// - **[78ec97d34](https://github.com/facebook/react/commit/78ec97d34 )**: Fix typo ([#20466](https://github.com/facebook/react/pull/20466)) //<inokawa>// - **[6cdc35972](https://github.com/facebook/react/commit/6cdc35972 )**: fix comments of markUpdateLaneFromFiberToRoot ([#20546](https://github.com/facebook/react/pull/20546)) //<neroneroffy>// - **[47dd9f441](https://github.com/facebook/react/commit/47dd9f441 )**: Remove fakeCallbackNode ([#20799](https://github.com/facebook/react/pull/20799)) //<Andrew Clark>// - **[114ab5295](https://github.com/facebook/react/commit/114ab5295 )**: Make remaining empty lanes Transition lanes ([#20793](https://github.com/facebook/react/pull/20793)) //<Andrew Clark>// - **[d3d2451a0](https://github.com/facebook/react/commit/d3d2451a0 )**: Use a single lane per priority level ([#20791](https://github.com/facebook/react/pull/20791)) //<Andrew Clark>// - **[eee874ce6](https://github.com/facebook/react/commit/eee874ce6 )**: Cross-fork lint: Support named export declaration ([#20784](https://github.com/facebook/react/pull/20784)) //<Andrew Clark>// - **[3b870b1e0](https://github.com/facebook/react/commit/3b870b1e0 )**: Lane enableTransitionEntanglement flag ([#20775](https://github.com/facebook/react/pull/20775)) //<Andrew Clark>// - **[d1845ad0f](https://github.com/facebook/react/commit/d1845ad0f )**: Default updates should not interrupt transitions ([#20771](https://github.com/facebook/react/pull/20771)) //<Andrew Clark>// - **[3499c343a](https://github.com/facebook/react/commit/3499c343a )**: Apply #20778 to new fork, too ([#20782](https://github.com/facebook/react/pull/20782)) //<Andrew Clark>// - **[3d10eca24](https://github.com/facebook/react/commit/3d10eca24 )**: Move scheduler priority check into ReactDOM ([#20778](https://github.com/facebook/react/pull/20778)) //<Dan Abramov>// - **[97fce318a](https://github.com/facebook/react/commit/97fce318a )**: Experiment: Infer the current event priority from the native event ([#20748](https://github.com/facebook/react/pull/20748)) //<Dan Abramov>// - **[6c526c515](https://github.com/facebook/react/commit/6c526c515 )**: Don't shift interleaved updates to separate lane ([#20681](https://github.com/facebook/react/pull/20681)) //<Andrew Clark>// - **[35f7441d3](https://github.com/facebook/react/commit/35f7441d3 )**: Use Lanes instead of priority event constants ([#20762](https://github.com/facebook/react/pull/20762)) //<Dan Abramov>// - **[a014c915c](https://github.com/facebook/react/commit/a014c915c )**: Parallel transitions: Assign different lanes to consecutive transitions ([#20672](https://github.com/facebook/react/pull/20672)) //<Andrew Clark>// - **[77754ae61](https://github.com/facebook/react/commit/77754ae61 )**: Decouple event priority list from event name list ([#20760](https://github.com/facebook/react/pull/20760)) //<Dan Abramov>// - **[b5bac1821](https://github.com/facebook/react/commit/b5bac1821 )**: Align event group constant naming with lane naming ([#20744](https://github.com/facebook/react/pull/20744)) //<Dan Abramov>// - **[4ecf11977](https://github.com/facebook/react/commit/4ecf11977 )**: Remove the Fundamental internals ([#20745](https://github.com/facebook/react/pull/20745)) //<Dan Abramov>// - **[eeb1325b0](https://github.com/facebook/react/commit/eeb1325b0 )**: Fix UMD bundles by removing usage of global ([#20743](https://github.com/facebook/react/pull/20743)) //<Dan Abramov>// - **[0935a1db3](https://github.com/facebook/react/commit/0935a1db3 )**: Delete consolidateBundleSizes script ([#20724](https://github.com/facebook/react/pull/20724)) //<Andrew Clark>// - **[7cb9fd7ef](https://github.com/facebook/react/commit/7cb9fd7ef )**: Land interleaved updates change in main fork ([#20710](https://github.com/facebook/react/pull/20710)) //<Andrew Clark>// - **[dc27b5aaa](https://github.com/facebook/react/commit/dc27b5aaa )**: useMutableSource: Use StrictMode double render to detect render phase mutation ([#20698](https://github.com/facebook/react/pull/20698)) //<Andrew Clark>// - **[bb1b7951d](https://github.com/facebook/react/commit/bb1b7951d )**: fix: don't run effects if a render phase update results in unchanged deps ([#20676](https://github.com/facebook/react/pull/20676)) //<Sebastian Silbermann>// - **[766a7a28a](https://github.com/facebook/react/commit/766a7a28a )**: Improve React error message when mutable sources are mutated during render ([#20665](https://github.com/facebook/react/pull/20665)) //<Brian Vaughn>// - **[a922f1c71](https://github.com/facebook/react/commit/a922f1c71 )**: Fix cache refresh bug that broke DevTools ([#20687](https://github.com/facebook/react/pull/20687)) //<Andrew Clark>// - **[e51bd6c1f](https://github.com/facebook/react/commit/e51bd6c1f )**: Queue discrete events in microtask ([#20669](https://github.com/facebook/react/pull/20669)) //<Ricky>// - **[aa736a0fa](https://github.com/facebook/react/commit/aa736a0fa )**: Add queue microtask to host configs ([#20668](https://github.com/facebook/react/pull/20668)) //<Ricky>// - **[deeeaf1d2](https://github.com/facebook/react/commit/deeeaf1d2 )**: Entangle overlapping transitions per queue ([#20670](https://github.com/facebook/react/pull/20670)) //<Andrew Clark>// - **[e316f7855](https://github.com/facebook/react/commit/e316f7855 )**: RN: Implement `sendAccessibilityEvent` in RN Renderer that proxies between Fabric/non-Fabric ([#20554](https://github.com/facebook/react/pull/20554)) //<Joshua Gross>// - **[9c32622cf](https://github.com/facebook/react/commit/9c32622cf )**: Improve tests that use discrete events ([#20667](https://github.com/facebook/react/pull/20667)) //<Ricky>// - **[d13f5b953](https://github.com/facebook/react/commit/d13f5b953 )**: Experiment: Unsuspend all lanes on update ([#20660](https://github.com/facebook/react/pull/20660)) //<Andrew Clark>// - **[a511dc709](https://github.com/facebook/react/commit/a511dc709 )**: Error for deferred value and transition in Server Components ([#20657](https://github.com/facebook/react/pull/20657)) //<Sebastian Markbåge>// - **[fb3f63f1a](https://github.com/facebook/react/commit/fb3f63f1a )**: Remove lazy invokation of segments ([#20656](https://github.com/facebook/react/pull/20656)) //<Sebastian Markbåge>// - **[895ae67fd](https://github.com/facebook/react/commit/895ae67fd )**: Improve error boundary handling for unmounted subtrees ([#20645](https://github.com/facebook/react/pull/20645)) //<Brian Vaughn>// - **[f15f8f64b](https://github.com/facebook/react/commit/f15f8f64b )**: Store interleaved updates on separate queue until end of render ([#20615](https://github.com/facebook/react/pull/20615)) //<Andrew Clark>// - **[0fd6805c6](https://github.com/facebook/react/commit/0fd6805c6 )**: Land rest of effects refactor in main fork ([#20644](https://github.com/facebook/react/pull/20644)) //<Andrew Clark>// - **[a6b5256a2](https://github.com/facebook/react/commit/a6b5256a2 )**: Refactored recursive strict effects method to be iterative ([#20642](https://github.com/facebook/react/pull/20642)) //<Brian Vaughn>// - **[3957853ae](https://github.com/facebook/react/commit/3957853ae )**: Re-add "strict effects mode" for legacy roots only ([#20639](https://github.com/facebook/react/pull/20639)) //<Brian Vaughn>// - **[fceb75e89](https://github.com/facebook/react/commit/fceb75e89 )**: Delete remaining references to effect list ([#20625](https://github.com/facebook/react/pull/20625)) //<Andrew Clark>// - **[741dcbdbe](https://github.com/facebook/react/commit/741dcbdbe )**: Schedule passive phase whenever there's a deletion ([#20624](https://github.com/facebook/react/pull/20624)) //<Andrew Clark>// - **[11a983fc7](https://github.com/facebook/react/commit/11a983fc7 )**: Remove references to Deletion flag ([#20623](https://github.com/facebook/react/pull/20623)) //<Andrew Clark>// - **[2e948e0d9](https://github.com/facebook/react/commit/2e948e0d9 )**: Avoid .valueOf to close #20594 ([#20617](https://github.com/facebook/react/pull/20617)) //<Dima Tisnek>// - **[2a646f73e](https://github.com/facebook/react/commit/2a646f73e )**: Convert snapshot phase to depth-first traversal ([#20622](https://github.com/facebook/react/pull/20622)) //<Andrew Clark>// - **[fb3e158a6](https://github.com/facebook/react/commit/fb3e158a6 )**: Convert ReactSuspenseWithNoopRenderer tests to use built-in cache ([#20601](https://github.com/facebook/react/pull/20601)) //<Andrew Clark>// - **[e0fd9e67f](https://github.com/facebook/react/commit/e0fd9e67f )**: Use update lane priority in work loop ([#20621](https://github.com/facebook/react/pull/20621)) //<Ricky>// - **[58e830448](https://github.com/facebook/react/commit/58e830448 )**: Remove custom error message from hook access error ([#20604](https://github.com/facebook/react/pull/20604)) //<Andrew Clark>// - **[9043626f0](https://github.com/facebook/react/commit/9043626f0 )**: Cache tests: Make it easier to test many caches ([#20600](https://github.com/facebook/react/pull/20600)) //<Andrew Clark>// - **[af0bb68e8](https://github.com/facebook/react/commit/af0bb68e8 )**: Land #20595 and #20596 in main fork ([#20602](https://github.com/facebook/react/pull/20602)) //<Andrew Clark>// - **[2b6985114](https://github.com/facebook/react/commit/2b6985114 )**: build-combined: Fix failures when renaming across devices ([#20620](https://github.com/facebook/react/pull/20620)) //<Sebastian Silbermann>// - **[af16f755d](https://github.com/facebook/react/commit/af16f755d )**: Update DevTools to use getCacheForType API ([#20548](https://github.com/facebook/react/pull/20548)) //<Brian Vaughn>// - **[95feb0e70](https://github.com/facebook/react/commit/95feb0e70 )**: Convert mutation phase to depth-first traversal ([#20596](https://github.com/facebook/react/pull/20596)) //<Andrew Clark>// - **[6132919bf](https://github.com/facebook/react/commit/6132919bf )**: Convert layout phase to depth-first traversal ([#20595](https://github.com/facebook/react/pull/20595)) //<Andrew Clark>// - **[42e04b46d](https://github.com/facebook/react/commit/42e04b46d )**: Fix: Detach deleted fiber's alternate, too ([#20587](https://github.com/facebook/react/pull/20587)) //<Andrew Clark>// - **[a656ace8d](https://github.com/facebook/react/commit/a656ace8d )**: Deletion effects should fire parent -> child ([#20584](https://github.com/facebook/react/pull/20584)) //<Andrew Clark>// - **[e6ed2bcf4](https://github.com/facebook/react/commit/e6ed2bcf4 )**: Update package.json versions as part of build step ([#20579](https://github.com/facebook/react/pull/20579)) //<Andrew Clark>// - **[eb0fb3823](https://github.com/facebook/react/commit/eb0fb3823 )**: Build stable and experimental with same command ([#20573](https://github.com/facebook/react/pull/20573)) //<Andrew Clark>// - **[e8eff119e](https://github.com/facebook/react/commit/e8eff119e )**: Fix ESLint crash on empty react effect hook ([#20385](https://github.com/facebook/react/pull/20385)) //<Christian Ruigrok>// - **[27659559e](https://github.com/facebook/react/commit/27659559e )**: Add useRefresh hook to react-debug-tools ([#20460](https://github.com/facebook/react/pull/20460)) //<Brian Vaughn>// - **[99554dc36](https://github.com/facebook/react/commit/99554dc36 )**: Add Flight packages to experimental allowlist ([#20486](https://github.com/facebook/react/pull/20486)) //<Andrew Clark>// - **[efc57e5cb](https://github.com/facebook/react/commit/efc57e5cb )**: Add built-in Suspense cache with support for invalidation (refreshing) ([#20456](https://github.com/facebook/react/pull/20456)) //<Andrew Clark>// - **[00a5b08e2](https://github.com/facebook/react/commit/00a5b08e2 )**: Remove PassiveStatic optimization //<Andrew Clark>// - **[a6329b105](https://github.com/facebook/react/commit/a6329b105 )**: Don't clear static flags in resetWorkInProgress //<Andrew Clark>// - **[1cf59f34b](https://github.com/facebook/react/commit/1cf59f34b )**: Convert passive unmount phase to tree traversal //<Andrew Clark>// - **[ab29695a0](https://github.com/facebook/react/commit/ab29695a0 )**: Defer more field detachments to passive phase //<Andrew Clark>// - **[d37d7a4bb](https://github.com/facebook/react/commit/d37d7a4bb )**: Convert passive mount phase to tree traversal //<Andrew Clark>// - **[19e15a398](https://github.com/facebook/react/commit/19e15a398 )**: Add PassiveStatic to trees with passive effects //<Andrew Clark>// - **[ff17fc176](https://github.com/facebook/react/commit/ff17fc176 )**: Don't clear other flags when adding Deletion //<Andrew Clark>// - **[5687864eb](https://github.com/facebook/react/commit/5687864eb )**: Add back disableSchedulerTimeoutInWorkLoop flag ([#20482](https://github.com/facebook/react/pull/20482)) //<Ricky>// - **[9f338e5d7](https://github.com/facebook/react/commit/9f338e5d7 )**: clone json obj in react native flight client host config parser ([#20474](https://github.com/facebook/react/pull/20474)) //<Luna Ruan>// - **[4e62fd271](https://github.com/facebook/react/commit/4e62fd271 )**: clone json obj in relay flight client host config parser ([#20465](https://github.com/facebook/react/pull/20465)) //<Luna Ruan>// - **[070372cde](https://github.com/facebook/react/commit/070372cde )**: [Flight] Fix webpack watch mode issue ([#20457](https://github.com/facebook/react/pull/20457)) //<Dan Abramov>// - **[0f80dd148](https://github.com/facebook/react/commit/0f80dd148 )**: [Flight] Support concatenated modules in Webpack plugin ([#20449](https://github.com/facebook/react/pull/20449)) //<Dan Abramov>// - **[daf38ecdf](https://github.com/facebook/react/commit/daf38ecdf )**: [Flight] Use lazy reference for existing modules ([#20445](https://github.com/facebook/react/pull/20445)) //<Dan Abramov>// - **[3f9205c33](https://github.com/facebook/react/commit/3f9205c33 )**: Regression test: SuspenseList causes lost unmount ([#20433](https://github.com/facebook/react/pull/20433)) //<Andrew Clark>// - **[cdfde3ae1](https://github.com/facebook/react/commit/cdfde3ae1 )**: Always rethrow original error when we replay errors ([#20425](https://github.com/facebook/react/pull/20425)) //<Sebastian Markbåge>// - **[b15d6e93e](https://github.com/facebook/react/commit/b15d6e93e )**: [Flight] Make PG and FS server-only ([#20424](https://github.com/facebook/react/pull/20424)) //<Dan Abramov>// - **[40ff2395e](https://github.com/facebook/react/commit/40ff2395e )**: [Flight] Prevent non-Server imports of aliased Server entrypoints ([#20422](https://github.com/facebook/react/pull/20422)) //<Dan Abramov>// - **[94aa365e3](https://github.com/facebook/react/commit/94aa365e3 )**: [Flight] Fix webpack plugin to use chunk groups ([#20421](https://github.com/facebook/react/pull/20421)) //<Dan Abramov>// - **[842ee367e](https://github.com/facebook/react/commit/842ee367e )**: [Flight] Rename the shared entry point ([#20420](https://github.com/facebook/react/pull/20420)) //<Dan Abramov>// - **[dbf40ef75](https://github.com/facebook/react/commit/dbf40ef75 )**: Put .server.js at the end of bundle filenames ([#20419](https://github.com/facebook/react/pull/20419)) //<Dan Abramov>// - **[03126dd08](https://github.com/facebook/react/commit/03126dd08 )**: [Flight] Add read-only fs methods ([#20412](https://github.com/facebook/react/pull/20412)) //<Dan Abramov>// - **[b51a686a9](https://github.com/facebook/react/commit/b51a686a9 )**: Turn on double effects for www test renderer ([#20416](https://github.com/facebook/react/pull/20416)) //<Brian Vaughn>// - **[56a632adb](https://github.com/facebook/react/commit/56a632adb )**: Double Invoke Effects in __DEV__ (in old reconciler fork) ([#20415](https://github.com/facebook/react/pull/20415)) //<Brian Vaughn>// - **[1a2422337](https://github.com/facebook/react/commit/1a2422337 )**: fixed typo ([#20351](https://github.com/facebook/react/pull/20351)) //<togami2864>// - **[a233c9e2a](https://github.com/facebook/react/commit/a233c9e2a )**: Rename internal cache helpers ([#20410](https://github.com/facebook/react/pull/20410)) //<Dan Abramov>// - **[6a4b12b81](https://github.com/facebook/react/commit/6a4b12b81 )**: [Flight] Add rudimentary FS binding ([#20409](https://github.com/facebook/react/pull/20409)) //<Dan Abramov>// - **[7659949d6](https://github.com/facebook/react/commit/7659949d6 )**: Clear `deletions` in `detachFiber` ([#20401](https://github.com/facebook/react/pull/20401)) //<Andrew Clark>// - **[b9680aef7](https://github.com/facebook/react/commit/b9680aef7 )**: Cache react-fetch results in the Node version ([#20407](https://github.com/facebook/react/pull/20407)) //<Dan Abramov>// - **[cdae31ab8](https://github.com/facebook/react/commit/cdae31ab8 )**: Fix typo ([#20279](https://github.com/facebook/react/pull/20279)) //<inokawa>// - **[51a7cfe21](https://github.com/facebook/react/commit/51a7cfe21 )**: Fix typo ([#20300](https://github.com/facebook/react/pull/20300)) //<Hollow Man>// - **[373b297c5](https://github.com/facebook/react/commit/373b297c5 )**: fix: Fix typo in react-reconciler docs ([#20284](https://github.com/facebook/react/pull/20284)) //<Sam Zhou>// - **[1b5ca9906](https://github.com/facebook/react/commit/1b5ca9906 )**: Fix module ID deduplication ([#20406](https://github.com/facebook/react/pull/20406)) //<Dan Abramov>// - **[5fd9db732](https://github.com/facebook/react/commit/5fd9db732 )**: [Flight] Rename react-transport-... packages to react-server-... ([#20403](https://github.com/facebook/react/pull/20403)) //<Sebastian Markbåge>// - **[ce40f1dc2](https://github.com/facebook/react/commit/ce40f1dc2 )**: Use assets API + writeToDisk instead of directly writing to disk ([#20402](https://github.com/facebook/react/pull/20402)) //<Sebastian Markbåge>// - **[b66ae09b6](https://github.com/facebook/react/commit/b66ae09b6 )**: Track subtreeFlags et al with bubbleProperties //<Andrew Clark>// - **[de75315d7](https://github.com/facebook/react/commit/de75315d7 )**: Track deletions using an array on the parent //<Andrew Clark>// - **[1377e465d](https://github.com/facebook/react/commit/1377e465d )**: Add Placement bit without removing others ([#20398](https://github.com/facebook/react/pull/20398)) //<Andrew Clark>// - **[18d7574ae](https://github.com/facebook/react/commit/18d7574ae )**: Remove `catch` from Scheduler build ([#20396](https://github.com/facebook/react/pull/20396)) //<Andrew Clark>// - **[30dfb8602](https://github.com/facebook/react/commit/30dfb8602 )**: [Flight] Basic scan of the file system to find Client modules ([#20383](https://github.com/facebook/react/pull/20383)) //<Sebastian Markbåge>// - **[9b8060041](https://github.com/facebook/react/commit/9b8060041 )**: Error when the number of parameters to a query changes ([#20379](https://github.com/facebook/react/pull/20379)) //<Dan Abramov>// - **[60e4a76fa](https://github.com/facebook/react/commit/60e4a76fa )**: [Flight] Add rudimentary PG binding ([#20372](https://github.com/facebook/react/pull/20372)) //<Dan Abramov>// - **[88ef95712](https://github.com/facebook/react/commit/88ef95712 )**: Fork ReactFiberLane ([#20371](https://github.com/facebook/react/pull/20371)) //<Andrew Clark>// - **[41c5d00fc](https://github.com/facebook/react/commit/41c5d00fc )**: [Flight] Minimal webpack plugin ([#20228](https://github.com/facebook/react/pull/20228)) //<Dan Abramov>// - **[e23673b51](https://github.com/facebook/react/commit/e23673b51 )**: [Flight] Add getCacheForType() to the dispatcher ([#20315](https://github.com/facebook/react/pull/20315)) //<Dan Abramov>// - **[555eeae33](https://github.com/facebook/react/commit/555eeae33 )**: Add disableNativeComponentFrames flag ([#20364](https://github.com/facebook/react/pull/20364)) //<Philipp Spiess>// - **[148ffe3cf](https://github.com/facebook/react/commit/148ffe3cf )**: Failing test for Client reconciliation ([#20318](https://github.com/facebook/react/pull/20318)) //<Dan Abramov>// - **[a2a025537](https://github.com/facebook/react/commit/a2a025537 )**: Fixed invalid DevTools work tags ([#20362](https://github.com/facebook/react/pull/20362)) //<Brian Vaughn>// - **[5711811da](https://github.com/facebook/react/commit/5711811da )**: Reconcile element types of lazy component yielding the same type ([#20357](https://github.com/facebook/react/pull/20357)) //<Sebastian Markbåge>// - **[3f73dcee3](https://github.com/facebook/react/commit/3f73dcee3 )**: Support named exports from client references ([#20312](https://github.com/facebook/react/pull/20312)) //<Sebastian Markbåge>// - **[565148d75](https://github.com/facebook/react/commit/565148d75 )**: Disallow *.server.js imports from any other files ([#20309](https://github.com/facebook/react/pull/20309)) //<Sebastian Markbåge>// - **[e6a0f2763](https://github.com/facebook/react/commit/e6a0f2763 )**: Profiler: Improve nested-update checks ([#20299](https://github.com/facebook/react/pull/20299)) //<Brian Vaughn>// - **[d93b58a5e](https://github.com/facebook/react/commit/d93b58a5e )**: Add flight specific entry point for react package ([#20304](https://github.com/facebook/react/pull/20304)) //<Sebastian Markbåge>// - **[a81c02ac1](https://github.com/facebook/react/commit/a81c02ac1 )**: Profiler onNestedUpdateScheduled accepts id as first param ([#20293](https://github.com/facebook/react/pull/20293)) //<Brian Vaughn>// - **[ac2cff4b1](https://github.com/facebook/react/commit/ac2cff4b1 )**: Warn if commit phase error thrown in detached tree ([#20286](https://github.com/facebook/react/pull/20286)) //<Andrew Clark>// - **[0f83a64ed](https://github.com/facebook/react/commit/0f83a64ed )**: Regression test: Missing unmount after re-order ([#20285](https://github.com/facebook/react/pull/20285)) //<Andrew Clark>// - **[ebf158965](https://github.com/facebook/react/commit/ebf158965 )**: Add best-effort documentation for third-party renderers ([#20278](https://github.com/facebook/react/pull/20278)) //<Dan Abramov>// - **[82e99e1b0](https://github.com/facebook/react/commit/82e99e1b0 )**: Add Node ESM Loader and Register Entrypoints ([#20274](https://github.com/facebook/react/pull/20274)) //<Sebastian Markbåge>// - **[bf7b7aeb1](https://github.com/facebook/react/commit/bf7b7aeb1 )**: findDOMNode: Remove return pointer mutation ([#20272](https://github.com/facebook/react/pull/20272)) //<Andrew Clark>// - **[369c3db62](https://github.com/facebook/react/commit/369c3db62 )**: Add separate ChildDeletion flag ([#20264](https://github.com/facebook/react/pull/20264)) //<Andrew Clark>// - **[765e89b90](https://github.com/facebook/react/commit/765e89b90 )**: Reset new fork to old fork ([#20254](https://github.com/facebook/react/pull/20254)) //<Andrew Clark>// - **[7548dd573](https://github.com/facebook/react/commit/7548dd573 )**: Properly reset Profiler nested-update flag ([#20253](https://github.com/facebook/react/pull/20253)) //<Brian Vaughn>// - **[b44e4b13a](https://github.com/facebook/react/commit/b44e4b13a )**: Check for deletions in `hadNoMutationsEffects` ([#20252](https://github.com/facebook/react/pull/20252)) //<Andrew Clark>// - **[3ebf05183](https://github.com/facebook/react/commit/3ebf05183 )**: Add new effect fields to old fork, and vice versa ([#20246](https://github.com/facebook/react/pull/20246)) //<Andrew Clark>// - **[2fbcc9806](https://github.com/facebook/react/commit/2fbcc9806 )**: Remove cycle between ReactFiberHooks and ReactInternalTypes ([#20242](https://github.com/facebook/react/pull/20242)) //<Paul Doyle>// - **[504222dcd](https://github.com/facebook/react/commit/504222dcd )**: Add Node ESM build option ([#20243](https://github.com/facebook/react/pull/20243)) //<Sebastian Markbåge>// - **[1b96ee444](https://github.com/facebook/react/commit/1b96ee444 )**: Remove noinline directives from new commit phase ([#20241](https://github.com/facebook/react/pull/20241)) //<Andrew Clark>// - **[760d9ab57](https://github.com/facebook/react/commit/760d9ab57 )**: Scheduling profiler tweaks ([#20215](https://github.com/facebook/react/pull/20215)) //<Brian Vaughn>// - **[9403c3b53](https://github.com/facebook/react/commit/9403c3b53 )**: Add Profiler callback when nested updates are scheduled ([#20211](https://github.com/facebook/react/pull/20211)) //<Brian Vaughn>// - **[62efd9618](https://github.com/facebook/react/commit/62efd9618 )**: use-subscription@1.5.1 //<Dan Abramov>// - **[e7006d67d](https://github.com/facebook/react/commit/e7006d67d )**: Widen peer dependency range of use-subscription ([#20225](https://github.com/facebook/react/pull/20225)) //<Billy Janitsch>// - **[15df051c9](https://github.com/facebook/react/commit/15df051c9 )**: Add warning if return pointer is inconsistent ([#20219](https://github.com/facebook/react/pull/20219)) //<Andrew Clark>// - **[9aca239f1](https://github.com/facebook/react/commit/9aca239f1 )**: Improved dev experience when DevTools hook is disabled ([#20208](https://github.com/facebook/react/pull/20208)) //<Alphabet Codes>// - **[12627f93b](https://github.com/facebook/react/commit/12627f93b )**: Perform hasOwnProperty check in Relay Flight ([#20220](https://github.com/facebook/react/pull/20220)) //<Sebastian Markbåge>// - **[163199d8c](https://github.com/facebook/react/commit/163199d8c )**: Dedupe module id generation ([#20172](https://github.com/facebook/react/pull/20172)) //<Sebastian Markbåge>// - **[76a6dbcb9](https://github.com/facebook/react/commit/76a6dbcb9 )**: [Flight] Encode Symbols as special rows that can be referenced by models … ([#20171](https://github.com/facebook/react/pull/20171)) //<Sebastian Markbåge>// - **[35e53b465](https://github.com/facebook/react/commit/35e53b465 )**: [Flight] Simplify Relay row protocol ([#20168](https://github.com/facebook/react/pull/20168)) //<Sebastian Markbåge>// - **[16e6dadba](https://github.com/facebook/react/commit/16e6dadba )**: Encode throwing server components as lazy throwing references ([#20217](https://github.com/facebook/react/pull/20217)) //<Sebastian Markbåge>// - **[c896cf961](https://github.com/facebook/react/commit/c896cf961 )**: Set return pointer when reusing current tree ([#20212](https://github.com/facebook/react/pull/20212)) //<Andrew Clark>// - **[089866015](https://github.com/facebook/react/commit/089866015 )**: Add version of scheduler that only swaps MessageChannel for postTask ([#20206](https://github.com/facebook/react/pull/20206)) //<Ricky>// - **[393c452e3](https://github.com/facebook/react/commit/393c452e3 )**: Add "nested-update" phase to Profiler API ([#20163](https://github.com/facebook/react/pull/20163)) //<Brian Vaughn>// - **[13a62feab](https://github.com/facebook/react/commit/13a62feab )**: Fix path for SchedulerFeatureFlags ([#20200](https://github.com/facebook/react/pull/20200)) //<Ricky>// - **[7a73d6a0f](https://github.com/facebook/react/commit/7a73d6a0f )**: (Temporarily) revert unmounting error boundaries changes ([#20147](https://github.com/facebook/react/pull/20147)) //<Brian Vaughn>// - **[c29710a57](https://github.com/facebook/react/commit/c29710a57 )**: fix: useImperativeMethods to useImperativeHandle ([#20194](https://github.com/facebook/react/pull/20194)) //<Jack Works>// jest_e2e[run_all_tests] Changelog: [General][Changed] - React Native sync for revisions c3e20f1...4d28eca Reviewed By: mdvacca Differential Revision: D26583597 fbshipit-source-id: a042df12c587fa9248d8de6f0b21b3ab231b3a7d
8457 lines
286 KiB
JavaScript
8457 lines
286 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @noflow
|
|
* @nolint
|
|
* @preventMunge
|
|
* @generated
|
|
*/
|
|
|
|
"use strict";
|
|
require("react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore");
|
|
var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/ReactNativePrivateInterface"),
|
|
React = require("react"),
|
|
Scheduler = require("scheduler"),
|
|
tracing = require("scheduler/tracing");
|
|
function invokeGuardedCallbackImpl(name, func, context, a, b, c, d, e, f) {
|
|
var funcArgs = Array.prototype.slice.call(arguments, 3);
|
|
try {
|
|
func.apply(context, funcArgs);
|
|
} catch (error) {
|
|
this.onError(error);
|
|
}
|
|
}
|
|
var hasError = !1,
|
|
caughtError = null,
|
|
hasRethrowError = !1,
|
|
rethrowError = null,
|
|
reporter = {
|
|
onError: function(error) {
|
|
hasError = !0;
|
|
caughtError = error;
|
|
}
|
|
};
|
|
function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
|
|
hasError = !1;
|
|
caughtError = null;
|
|
invokeGuardedCallbackImpl.apply(reporter, arguments);
|
|
}
|
|
function invokeGuardedCallbackAndCatchFirstError(
|
|
name,
|
|
func,
|
|
context,
|
|
a,
|
|
b,
|
|
c,
|
|
d,
|
|
e,
|
|
f
|
|
) {
|
|
invokeGuardedCallback.apply(this, arguments);
|
|
if (hasError) {
|
|
if (hasError) {
|
|
var error = caughtError;
|
|
hasError = !1;
|
|
caughtError = null;
|
|
} else
|
|
throw Error(
|
|
"clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
hasRethrowError || ((hasRethrowError = !0), (rethrowError = error));
|
|
}
|
|
}
|
|
var getFiberCurrentPropsFromNode = null,
|
|
getInstanceFromNode = null,
|
|
getNodeFromInstance = null;
|
|
function executeDispatch(event, listener, inst) {
|
|
var type = event.type || "unknown-event";
|
|
event.currentTarget = getNodeFromInstance(inst);
|
|
invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event);
|
|
event.currentTarget = null;
|
|
}
|
|
function executeDirectDispatch(event) {
|
|
var dispatchListener = event._dispatchListeners,
|
|
dispatchInstance = event._dispatchInstances;
|
|
if (Array.isArray(dispatchListener))
|
|
throw Error("executeDirectDispatch(...): Invalid `event`.");
|
|
event.currentTarget = dispatchListener
|
|
? getNodeFromInstance(dispatchInstance)
|
|
: null;
|
|
dispatchListener = dispatchListener ? dispatchListener(event) : null;
|
|
event.currentTarget = null;
|
|
event._dispatchListeners = null;
|
|
event._dispatchInstances = null;
|
|
return dispatchListener;
|
|
}
|
|
function functionThatReturnsTrue() {
|
|
return !0;
|
|
}
|
|
function functionThatReturnsFalse() {
|
|
return !1;
|
|
}
|
|
function SyntheticEvent(
|
|
dispatchConfig,
|
|
targetInst,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
) {
|
|
this.dispatchConfig = dispatchConfig;
|
|
this._targetInst = targetInst;
|
|
this.nativeEvent = nativeEvent;
|
|
this._dispatchInstances = this._dispatchListeners = null;
|
|
dispatchConfig = this.constructor.Interface;
|
|
for (var propName in dispatchConfig)
|
|
dispatchConfig.hasOwnProperty(propName) &&
|
|
((targetInst = dispatchConfig[propName])
|
|
? (this[propName] = targetInst(nativeEvent))
|
|
: "target" === propName
|
|
? (this.target = nativeEventTarget)
|
|
: (this[propName] = nativeEvent[propName]));
|
|
this.isDefaultPrevented = (null != nativeEvent.defaultPrevented
|
|
? nativeEvent.defaultPrevented
|
|
: !1 === nativeEvent.returnValue)
|
|
? functionThatReturnsTrue
|
|
: functionThatReturnsFalse;
|
|
this.isPropagationStopped = functionThatReturnsFalse;
|
|
return this;
|
|
}
|
|
Object.assign(SyntheticEvent.prototype, {
|
|
preventDefault: function() {
|
|
this.defaultPrevented = !0;
|
|
var event = this.nativeEvent;
|
|
event &&
|
|
(event.preventDefault
|
|
? event.preventDefault()
|
|
: "unknown" !== typeof event.returnValue && (event.returnValue = !1),
|
|
(this.isDefaultPrevented = functionThatReturnsTrue));
|
|
},
|
|
stopPropagation: function() {
|
|
var event = this.nativeEvent;
|
|
event &&
|
|
(event.stopPropagation
|
|
? event.stopPropagation()
|
|
: "unknown" !== typeof event.cancelBubble && (event.cancelBubble = !0),
|
|
(this.isPropagationStopped = functionThatReturnsTrue));
|
|
},
|
|
persist: function() {
|
|
this.isPersistent = functionThatReturnsTrue;
|
|
},
|
|
isPersistent: functionThatReturnsFalse,
|
|
destructor: function() {
|
|
var Interface = this.constructor.Interface,
|
|
propName;
|
|
for (propName in Interface) this[propName] = null;
|
|
this.nativeEvent = this._targetInst = this.dispatchConfig = null;
|
|
this.isPropagationStopped = this.isDefaultPrevented = functionThatReturnsFalse;
|
|
this._dispatchInstances = this._dispatchListeners = null;
|
|
}
|
|
});
|
|
SyntheticEvent.Interface = {
|
|
type: null,
|
|
target: null,
|
|
currentTarget: function() {
|
|
return null;
|
|
},
|
|
eventPhase: null,
|
|
bubbles: null,
|
|
cancelable: null,
|
|
timeStamp: function(event) {
|
|
return event.timeStamp || Date.now();
|
|
},
|
|
defaultPrevented: null,
|
|
isTrusted: null
|
|
};
|
|
SyntheticEvent.extend = function(Interface) {
|
|
function E() {}
|
|
function Class() {
|
|
return Super.apply(this, arguments);
|
|
}
|
|
var Super = this;
|
|
E.prototype = Super.prototype;
|
|
var prototype = new E();
|
|
Object.assign(prototype, Class.prototype);
|
|
Class.prototype = prototype;
|
|
Class.prototype.constructor = Class;
|
|
Class.Interface = Object.assign({}, Super.Interface, Interface);
|
|
Class.extend = Super.extend;
|
|
addEventPoolingTo(Class);
|
|
return Class;
|
|
};
|
|
addEventPoolingTo(SyntheticEvent);
|
|
function createOrGetPooledEvent(
|
|
dispatchConfig,
|
|
targetInst,
|
|
nativeEvent,
|
|
nativeInst
|
|
) {
|
|
if (this.eventPool.length) {
|
|
var instance = this.eventPool.pop();
|
|
this.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
|
|
return instance;
|
|
}
|
|
return new this(dispatchConfig, targetInst, nativeEvent, nativeInst);
|
|
}
|
|
function releasePooledEvent(event) {
|
|
if (!(event instanceof this))
|
|
throw Error(
|
|
"Trying to release an event instance into a pool of a different type."
|
|
);
|
|
event.destructor();
|
|
10 > this.eventPool.length && this.eventPool.push(event);
|
|
}
|
|
function addEventPoolingTo(EventConstructor) {
|
|
EventConstructor.getPooled = createOrGetPooledEvent;
|
|
EventConstructor.eventPool = [];
|
|
EventConstructor.release = releasePooledEvent;
|
|
}
|
|
var ResponderSyntheticEvent = SyntheticEvent.extend({
|
|
touchHistory: function() {
|
|
return null;
|
|
}
|
|
});
|
|
function isStartish(topLevelType) {
|
|
return "topTouchStart" === topLevelType;
|
|
}
|
|
function isMoveish(topLevelType) {
|
|
return "topTouchMove" === topLevelType;
|
|
}
|
|
var startDependencies = ["topTouchStart"],
|
|
moveDependencies = ["topTouchMove"],
|
|
endDependencies = ["topTouchCancel", "topTouchEnd"],
|
|
touchBank = [],
|
|
touchHistory = {
|
|
touchBank: touchBank,
|
|
numberActiveTouches: 0,
|
|
indexOfSingleActiveTouch: -1,
|
|
mostRecentTimeStamp: 0
|
|
};
|
|
function timestampForTouch(touch) {
|
|
return touch.timeStamp || touch.timestamp;
|
|
}
|
|
function getTouchIdentifier(_ref) {
|
|
_ref = _ref.identifier;
|
|
if (null == _ref) throw Error("Touch object is missing identifier.");
|
|
return _ref;
|
|
}
|
|
function recordTouchStart(touch) {
|
|
var identifier = getTouchIdentifier(touch),
|
|
touchRecord = touchBank[identifier];
|
|
touchRecord
|
|
? ((touchRecord.touchActive = !0),
|
|
(touchRecord.startPageX = touch.pageX),
|
|
(touchRecord.startPageY = touch.pageY),
|
|
(touchRecord.startTimeStamp = timestampForTouch(touch)),
|
|
(touchRecord.currentPageX = touch.pageX),
|
|
(touchRecord.currentPageY = touch.pageY),
|
|
(touchRecord.currentTimeStamp = timestampForTouch(touch)),
|
|
(touchRecord.previousPageX = touch.pageX),
|
|
(touchRecord.previousPageY = touch.pageY),
|
|
(touchRecord.previousTimeStamp = timestampForTouch(touch)))
|
|
: ((touchRecord = {
|
|
touchActive: !0,
|
|
startPageX: touch.pageX,
|
|
startPageY: touch.pageY,
|
|
startTimeStamp: timestampForTouch(touch),
|
|
currentPageX: touch.pageX,
|
|
currentPageY: touch.pageY,
|
|
currentTimeStamp: timestampForTouch(touch),
|
|
previousPageX: touch.pageX,
|
|
previousPageY: touch.pageY,
|
|
previousTimeStamp: timestampForTouch(touch)
|
|
}),
|
|
(touchBank[identifier] = touchRecord));
|
|
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
|
|
}
|
|
function recordTouchMove(touch) {
|
|
var touchRecord = touchBank[getTouchIdentifier(touch)];
|
|
touchRecord &&
|
|
((touchRecord.touchActive = !0),
|
|
(touchRecord.previousPageX = touchRecord.currentPageX),
|
|
(touchRecord.previousPageY = touchRecord.currentPageY),
|
|
(touchRecord.previousTimeStamp = touchRecord.currentTimeStamp),
|
|
(touchRecord.currentPageX = touch.pageX),
|
|
(touchRecord.currentPageY = touch.pageY),
|
|
(touchRecord.currentTimeStamp = timestampForTouch(touch)),
|
|
(touchHistory.mostRecentTimeStamp = timestampForTouch(touch)));
|
|
}
|
|
function recordTouchEnd(touch) {
|
|
var touchRecord = touchBank[getTouchIdentifier(touch)];
|
|
touchRecord &&
|
|
((touchRecord.touchActive = !1),
|
|
(touchRecord.previousPageX = touchRecord.currentPageX),
|
|
(touchRecord.previousPageY = touchRecord.currentPageY),
|
|
(touchRecord.previousTimeStamp = touchRecord.currentTimeStamp),
|
|
(touchRecord.currentPageX = touch.pageX),
|
|
(touchRecord.currentPageY = touch.pageY),
|
|
(touchRecord.currentTimeStamp = timestampForTouch(touch)),
|
|
(touchHistory.mostRecentTimeStamp = timestampForTouch(touch)));
|
|
}
|
|
var ResponderTouchHistoryStore = {
|
|
recordTouchTrack: function(topLevelType, nativeEvent) {
|
|
if (isMoveish(topLevelType))
|
|
nativeEvent.changedTouches.forEach(recordTouchMove);
|
|
else if (isStartish(topLevelType))
|
|
nativeEvent.changedTouches.forEach(recordTouchStart),
|
|
(touchHistory.numberActiveTouches = nativeEvent.touches.length),
|
|
1 === touchHistory.numberActiveTouches &&
|
|
(touchHistory.indexOfSingleActiveTouch =
|
|
nativeEvent.touches[0].identifier);
|
|
else if (
|
|
"topTouchEnd" === topLevelType ||
|
|
"topTouchCancel" === topLevelType
|
|
)
|
|
if (
|
|
(nativeEvent.changedTouches.forEach(recordTouchEnd),
|
|
(touchHistory.numberActiveTouches = nativeEvent.touches.length),
|
|
1 === touchHistory.numberActiveTouches)
|
|
)
|
|
for (topLevelType = 0; topLevelType < touchBank.length; topLevelType++)
|
|
if (
|
|
((nativeEvent = touchBank[topLevelType]),
|
|
null != nativeEvent && nativeEvent.touchActive)
|
|
) {
|
|
touchHistory.indexOfSingleActiveTouch = topLevelType;
|
|
break;
|
|
}
|
|
},
|
|
touchHistory: touchHistory
|
|
};
|
|
function accumulate(current, next) {
|
|
if (null == next)
|
|
throw Error(
|
|
"accumulate(...): Accumulated items must not be null or undefined."
|
|
);
|
|
return null == current
|
|
? next
|
|
: Array.isArray(current)
|
|
? current.concat(next)
|
|
: Array.isArray(next)
|
|
? [current].concat(next)
|
|
: [current, next];
|
|
}
|
|
function accumulateInto(current, next) {
|
|
if (null == next)
|
|
throw Error(
|
|
"accumulateInto(...): Accumulated items must not be null or undefined."
|
|
);
|
|
if (null == current) return next;
|
|
if (Array.isArray(current)) {
|
|
if (Array.isArray(next)) return current.push.apply(current, next), current;
|
|
current.push(next);
|
|
return current;
|
|
}
|
|
return Array.isArray(next) ? [current].concat(next) : [current, next];
|
|
}
|
|
function forEachAccumulated(arr, cb, scope) {
|
|
Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr);
|
|
}
|
|
var responderInst = null,
|
|
trackedTouchCount = 0;
|
|
function changeResponder(nextResponderInst, blockHostResponder) {
|
|
var oldResponderInst = responderInst;
|
|
responderInst = nextResponderInst;
|
|
if (null !== ResponderEventPlugin.GlobalResponderHandler)
|
|
ResponderEventPlugin.GlobalResponderHandler.onChange(
|
|
oldResponderInst,
|
|
nextResponderInst,
|
|
blockHostResponder
|
|
);
|
|
}
|
|
var eventTypes = {
|
|
startShouldSetResponder: {
|
|
phasedRegistrationNames: {
|
|
bubbled: "onStartShouldSetResponder",
|
|
captured: "onStartShouldSetResponderCapture"
|
|
},
|
|
dependencies: startDependencies
|
|
},
|
|
scrollShouldSetResponder: {
|
|
phasedRegistrationNames: {
|
|
bubbled: "onScrollShouldSetResponder",
|
|
captured: "onScrollShouldSetResponderCapture"
|
|
},
|
|
dependencies: ["topScroll"]
|
|
},
|
|
selectionChangeShouldSetResponder: {
|
|
phasedRegistrationNames: {
|
|
bubbled: "onSelectionChangeShouldSetResponder",
|
|
captured: "onSelectionChangeShouldSetResponderCapture"
|
|
},
|
|
dependencies: ["topSelectionChange"]
|
|
},
|
|
moveShouldSetResponder: {
|
|
phasedRegistrationNames: {
|
|
bubbled: "onMoveShouldSetResponder",
|
|
captured: "onMoveShouldSetResponderCapture"
|
|
},
|
|
dependencies: moveDependencies
|
|
},
|
|
responderStart: {
|
|
registrationName: "onResponderStart",
|
|
dependencies: startDependencies
|
|
},
|
|
responderMove: {
|
|
registrationName: "onResponderMove",
|
|
dependencies: moveDependencies
|
|
},
|
|
responderEnd: {
|
|
registrationName: "onResponderEnd",
|
|
dependencies: endDependencies
|
|
},
|
|
responderRelease: {
|
|
registrationName: "onResponderRelease",
|
|
dependencies: endDependencies
|
|
},
|
|
responderTerminationRequest: {
|
|
registrationName: "onResponderTerminationRequest",
|
|
dependencies: []
|
|
},
|
|
responderGrant: { registrationName: "onResponderGrant", dependencies: [] },
|
|
responderReject: { registrationName: "onResponderReject", dependencies: [] },
|
|
responderTerminate: {
|
|
registrationName: "onResponderTerminate",
|
|
dependencies: []
|
|
}
|
|
};
|
|
function getParent(inst) {
|
|
do inst = inst.return;
|
|
while (inst && 5 !== inst.tag);
|
|
return inst ? inst : null;
|
|
}
|
|
function traverseTwoPhase(inst, fn, arg) {
|
|
for (var path = []; inst; ) path.push(inst), (inst = getParent(inst));
|
|
for (inst = path.length; 0 < inst--; ) fn(path[inst], "captured", arg);
|
|
for (inst = 0; inst < path.length; inst++) fn(path[inst], "bubbled", arg);
|
|
}
|
|
function getListener(inst, registrationName) {
|
|
inst = inst.stateNode;
|
|
if (null === inst) return null;
|
|
inst = getFiberCurrentPropsFromNode(inst);
|
|
if (null === inst) return null;
|
|
if ((inst = inst[registrationName]) && "function" !== typeof inst)
|
|
throw Error(
|
|
"Expected `" +
|
|
registrationName +
|
|
"` listener to be a function, instead got a value of `" +
|
|
typeof inst +
|
|
"` type."
|
|
);
|
|
return inst;
|
|
}
|
|
function accumulateDirectionalDispatches(inst, phase, event) {
|
|
if (
|
|
(phase = getListener(
|
|
inst,
|
|
event.dispatchConfig.phasedRegistrationNames[phase]
|
|
))
|
|
)
|
|
(event._dispatchListeners = accumulateInto(
|
|
event._dispatchListeners,
|
|
phase
|
|
)),
|
|
(event._dispatchInstances = accumulateInto(
|
|
event._dispatchInstances,
|
|
inst
|
|
));
|
|
}
|
|
function accumulateDirectDispatchesSingle(event) {
|
|
if (event && event.dispatchConfig.registrationName) {
|
|
var inst = event._targetInst;
|
|
if (inst && event && event.dispatchConfig.registrationName) {
|
|
var listener = getListener(inst, event.dispatchConfig.registrationName);
|
|
listener &&
|
|
((event._dispatchListeners = accumulateInto(
|
|
event._dispatchListeners,
|
|
listener
|
|
)),
|
|
(event._dispatchInstances = accumulateInto(
|
|
event._dispatchInstances,
|
|
inst
|
|
)));
|
|
}
|
|
}
|
|
}
|
|
function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
|
|
if (event && event.dispatchConfig.phasedRegistrationNames) {
|
|
var targetInst = event._targetInst;
|
|
targetInst = targetInst ? getParent(targetInst) : null;
|
|
traverseTwoPhase(targetInst, accumulateDirectionalDispatches, event);
|
|
}
|
|
}
|
|
function accumulateTwoPhaseDispatchesSingle(event) {
|
|
event &&
|
|
event.dispatchConfig.phasedRegistrationNames &&
|
|
traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
|
|
}
|
|
var ResponderEventPlugin = {
|
|
_getResponder: function() {
|
|
return responderInst;
|
|
},
|
|
eventTypes: eventTypes,
|
|
extractEvents: function(
|
|
topLevelType,
|
|
targetInst,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
) {
|
|
if (isStartish(topLevelType)) trackedTouchCount += 1;
|
|
else if (
|
|
"topTouchEnd" === topLevelType ||
|
|
"topTouchCancel" === topLevelType
|
|
)
|
|
if (0 <= trackedTouchCount) --trackedTouchCount;
|
|
else return null;
|
|
ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent);
|
|
if (
|
|
targetInst &&
|
|
(("topScroll" === topLevelType && !nativeEvent.responderIgnoreScroll) ||
|
|
(0 < trackedTouchCount && "topSelectionChange" === topLevelType) ||
|
|
isStartish(topLevelType) ||
|
|
isMoveish(topLevelType))
|
|
) {
|
|
var shouldSetEventType = isStartish(topLevelType)
|
|
? eventTypes.startShouldSetResponder
|
|
: isMoveish(topLevelType)
|
|
? eventTypes.moveShouldSetResponder
|
|
: "topSelectionChange" === topLevelType
|
|
? eventTypes.selectionChangeShouldSetResponder
|
|
: eventTypes.scrollShouldSetResponder;
|
|
if (responderInst)
|
|
b: {
|
|
var JSCompiler_temp = responderInst;
|
|
for (
|
|
var depthA = 0, tempA = JSCompiler_temp;
|
|
tempA;
|
|
tempA = getParent(tempA)
|
|
)
|
|
depthA++;
|
|
tempA = 0;
|
|
for (var tempB = targetInst; tempB; tempB = getParent(tempB))
|
|
tempA++;
|
|
for (; 0 < depthA - tempA; )
|
|
(JSCompiler_temp = getParent(JSCompiler_temp)), depthA--;
|
|
for (; 0 < tempA - depthA; )
|
|
(targetInst = getParent(targetInst)), tempA--;
|
|
for (; depthA--; ) {
|
|
if (
|
|
JSCompiler_temp === targetInst ||
|
|
JSCompiler_temp === targetInst.alternate
|
|
)
|
|
break b;
|
|
JSCompiler_temp = getParent(JSCompiler_temp);
|
|
targetInst = getParent(targetInst);
|
|
}
|
|
JSCompiler_temp = null;
|
|
}
|
|
else JSCompiler_temp = targetInst;
|
|
targetInst = JSCompiler_temp;
|
|
JSCompiler_temp = targetInst === responderInst;
|
|
shouldSetEventType = ResponderSyntheticEvent.getPooled(
|
|
shouldSetEventType,
|
|
targetInst,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
);
|
|
shouldSetEventType.touchHistory =
|
|
ResponderTouchHistoryStore.touchHistory;
|
|
JSCompiler_temp
|
|
? forEachAccumulated(
|
|
shouldSetEventType,
|
|
accumulateTwoPhaseDispatchesSingleSkipTarget
|
|
)
|
|
: forEachAccumulated(
|
|
shouldSetEventType,
|
|
accumulateTwoPhaseDispatchesSingle
|
|
);
|
|
b: {
|
|
JSCompiler_temp = shouldSetEventType._dispatchListeners;
|
|
targetInst = shouldSetEventType._dispatchInstances;
|
|
if (Array.isArray(JSCompiler_temp))
|
|
for (
|
|
depthA = 0;
|
|
depthA < JSCompiler_temp.length &&
|
|
!shouldSetEventType.isPropagationStopped();
|
|
depthA++
|
|
) {
|
|
if (
|
|
JSCompiler_temp[depthA](shouldSetEventType, targetInst[depthA])
|
|
) {
|
|
JSCompiler_temp = targetInst[depthA];
|
|
break b;
|
|
}
|
|
}
|
|
else if (
|
|
JSCompiler_temp &&
|
|
JSCompiler_temp(shouldSetEventType, targetInst)
|
|
) {
|
|
JSCompiler_temp = targetInst;
|
|
break b;
|
|
}
|
|
JSCompiler_temp = null;
|
|
}
|
|
shouldSetEventType._dispatchInstances = null;
|
|
shouldSetEventType._dispatchListeners = null;
|
|
shouldSetEventType.isPersistent() ||
|
|
shouldSetEventType.constructor.release(shouldSetEventType);
|
|
if (JSCompiler_temp && JSCompiler_temp !== responderInst)
|
|
if (
|
|
((shouldSetEventType = ResponderSyntheticEvent.getPooled(
|
|
eventTypes.responderGrant,
|
|
JSCompiler_temp,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
)),
|
|
(shouldSetEventType.touchHistory =
|
|
ResponderTouchHistoryStore.touchHistory),
|
|
forEachAccumulated(
|
|
shouldSetEventType,
|
|
accumulateDirectDispatchesSingle
|
|
),
|
|
(targetInst = !0 === executeDirectDispatch(shouldSetEventType)),
|
|
responderInst)
|
|
)
|
|
if (
|
|
((depthA = ResponderSyntheticEvent.getPooled(
|
|
eventTypes.responderTerminationRequest,
|
|
responderInst,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
)),
|
|
(depthA.touchHistory = ResponderTouchHistoryStore.touchHistory),
|
|
forEachAccumulated(depthA, accumulateDirectDispatchesSingle),
|
|
(tempA =
|
|
!depthA._dispatchListeners || executeDirectDispatch(depthA)),
|
|
depthA.isPersistent() || depthA.constructor.release(depthA),
|
|
tempA)
|
|
) {
|
|
depthA = ResponderSyntheticEvent.getPooled(
|
|
eventTypes.responderTerminate,
|
|
responderInst,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
);
|
|
depthA.touchHistory = ResponderTouchHistoryStore.touchHistory;
|
|
forEachAccumulated(depthA, accumulateDirectDispatchesSingle);
|
|
var JSCompiler_temp$jscomp$0 = accumulate(
|
|
JSCompiler_temp$jscomp$0,
|
|
[shouldSetEventType, depthA]
|
|
);
|
|
changeResponder(JSCompiler_temp, targetInst);
|
|
} else
|
|
(shouldSetEventType = ResponderSyntheticEvent.getPooled(
|
|
eventTypes.responderReject,
|
|
JSCompiler_temp,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
)),
|
|
(shouldSetEventType.touchHistory =
|
|
ResponderTouchHistoryStore.touchHistory),
|
|
forEachAccumulated(
|
|
shouldSetEventType,
|
|
accumulateDirectDispatchesSingle
|
|
),
|
|
(JSCompiler_temp$jscomp$0 = accumulate(
|
|
JSCompiler_temp$jscomp$0,
|
|
shouldSetEventType
|
|
));
|
|
else
|
|
(JSCompiler_temp$jscomp$0 = accumulate(
|
|
JSCompiler_temp$jscomp$0,
|
|
shouldSetEventType
|
|
)),
|
|
changeResponder(JSCompiler_temp, targetInst);
|
|
else JSCompiler_temp$jscomp$0 = null;
|
|
} else JSCompiler_temp$jscomp$0 = null;
|
|
shouldSetEventType = responderInst && isStartish(topLevelType);
|
|
JSCompiler_temp = responderInst && isMoveish(topLevelType);
|
|
targetInst =
|
|
responderInst &&
|
|
("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType);
|
|
if (
|
|
(shouldSetEventType = shouldSetEventType
|
|
? eventTypes.responderStart
|
|
: JSCompiler_temp
|
|
? eventTypes.responderMove
|
|
: targetInst
|
|
? eventTypes.responderEnd
|
|
: null)
|
|
)
|
|
(shouldSetEventType = ResponderSyntheticEvent.getPooled(
|
|
shouldSetEventType,
|
|
responderInst,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
)),
|
|
(shouldSetEventType.touchHistory =
|
|
ResponderTouchHistoryStore.touchHistory),
|
|
forEachAccumulated(
|
|
shouldSetEventType,
|
|
accumulateDirectDispatchesSingle
|
|
),
|
|
(JSCompiler_temp$jscomp$0 = accumulate(
|
|
JSCompiler_temp$jscomp$0,
|
|
shouldSetEventType
|
|
));
|
|
shouldSetEventType = responderInst && "topTouchCancel" === topLevelType;
|
|
if (
|
|
(topLevelType =
|
|
responderInst &&
|
|
!shouldSetEventType &&
|
|
("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType))
|
|
)
|
|
a: {
|
|
if ((topLevelType = nativeEvent.touches) && 0 !== topLevelType.length)
|
|
for (
|
|
JSCompiler_temp = 0;
|
|
JSCompiler_temp < topLevelType.length;
|
|
JSCompiler_temp++
|
|
)
|
|
if (
|
|
((targetInst = topLevelType[JSCompiler_temp].target),
|
|
null !== targetInst &&
|
|
void 0 !== targetInst &&
|
|
0 !== targetInst)
|
|
) {
|
|
depthA = getInstanceFromNode(targetInst);
|
|
b: {
|
|
for (targetInst = responderInst; depthA; ) {
|
|
if (
|
|
targetInst === depthA ||
|
|
targetInst === depthA.alternate
|
|
) {
|
|
targetInst = !0;
|
|
break b;
|
|
}
|
|
depthA = getParent(depthA);
|
|
}
|
|
targetInst = !1;
|
|
}
|
|
if (targetInst) {
|
|
topLevelType = !1;
|
|
break a;
|
|
}
|
|
}
|
|
topLevelType = !0;
|
|
}
|
|
if (
|
|
(topLevelType = shouldSetEventType
|
|
? eventTypes.responderTerminate
|
|
: topLevelType
|
|
? eventTypes.responderRelease
|
|
: null)
|
|
)
|
|
(nativeEvent = ResponderSyntheticEvent.getPooled(
|
|
topLevelType,
|
|
responderInst,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
)),
|
|
(nativeEvent.touchHistory = ResponderTouchHistoryStore.touchHistory),
|
|
forEachAccumulated(nativeEvent, accumulateDirectDispatchesSingle),
|
|
(JSCompiler_temp$jscomp$0 = accumulate(
|
|
JSCompiler_temp$jscomp$0,
|
|
nativeEvent
|
|
)),
|
|
changeResponder(null);
|
|
return JSCompiler_temp$jscomp$0;
|
|
},
|
|
GlobalResponderHandler: null,
|
|
injection: {
|
|
injectGlobalResponderHandler: function(GlobalResponderHandler) {
|
|
ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler;
|
|
}
|
|
}
|
|
},
|
|
eventPluginOrder = null,
|
|
namesToPlugins = {};
|
|
function recomputePluginOrdering() {
|
|
if (eventPluginOrder)
|
|
for (var pluginName in namesToPlugins) {
|
|
var pluginModule = namesToPlugins[pluginName],
|
|
pluginIndex = eventPluginOrder.indexOf(pluginName);
|
|
if (!(-1 < pluginIndex))
|
|
throw Error(
|
|
"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" +
|
|
pluginName +
|
|
"`."
|
|
);
|
|
if (!plugins[pluginIndex]) {
|
|
if (!pluginModule.extractEvents)
|
|
throw Error(
|
|
"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" +
|
|
pluginName +
|
|
"` does not."
|
|
);
|
|
plugins[pluginIndex] = pluginModule;
|
|
pluginIndex = pluginModule.eventTypes;
|
|
for (var eventName in pluginIndex) {
|
|
var JSCompiler_inline_result = void 0;
|
|
var dispatchConfig = pluginIndex[eventName],
|
|
eventName$jscomp$0 = eventName;
|
|
if (eventNameDispatchConfigs.hasOwnProperty(eventName$jscomp$0))
|
|
throw Error(
|
|
"EventPluginRegistry: More than one plugin attempted to publish the same event name, `" +
|
|
eventName$jscomp$0 +
|
|
"`."
|
|
);
|
|
eventNameDispatchConfigs[eventName$jscomp$0] = dispatchConfig;
|
|
var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
|
|
if (phasedRegistrationNames) {
|
|
for (JSCompiler_inline_result in phasedRegistrationNames)
|
|
phasedRegistrationNames.hasOwnProperty(
|
|
JSCompiler_inline_result
|
|
) &&
|
|
publishRegistrationName(
|
|
phasedRegistrationNames[JSCompiler_inline_result],
|
|
pluginModule,
|
|
eventName$jscomp$0
|
|
);
|
|
JSCompiler_inline_result = !0;
|
|
} else
|
|
dispatchConfig.registrationName
|
|
? (publishRegistrationName(
|
|
dispatchConfig.registrationName,
|
|
pluginModule,
|
|
eventName$jscomp$0
|
|
),
|
|
(JSCompiler_inline_result = !0))
|
|
: (JSCompiler_inline_result = !1);
|
|
if (!JSCompiler_inline_result)
|
|
throw Error(
|
|
"EventPluginRegistry: Failed to publish event `" +
|
|
eventName +
|
|
"` for plugin `" +
|
|
pluginName +
|
|
"`."
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function publishRegistrationName(registrationName, pluginModule) {
|
|
if (registrationNameModules[registrationName])
|
|
throw Error(
|
|
"EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" +
|
|
registrationName +
|
|
"`."
|
|
);
|
|
registrationNameModules[registrationName] = pluginModule;
|
|
}
|
|
var plugins = [],
|
|
eventNameDispatchConfigs = {},
|
|
registrationNameModules = {};
|
|
function getListener$1(inst, registrationName) {
|
|
inst = inst.stateNode;
|
|
if (null === inst) return null;
|
|
inst = getFiberCurrentPropsFromNode(inst);
|
|
if (null === inst) return null;
|
|
if ((inst = inst[registrationName]) && "function" !== typeof inst)
|
|
throw Error(
|
|
"Expected `" +
|
|
registrationName +
|
|
"` listener to be a function, instead got a value of `" +
|
|
typeof inst +
|
|
"` type."
|
|
);
|
|
return inst;
|
|
}
|
|
var customBubblingEventTypes =
|
|
ReactNativePrivateInterface.ReactNativeViewConfigRegistry
|
|
.customBubblingEventTypes,
|
|
customDirectEventTypes =
|
|
ReactNativePrivateInterface.ReactNativeViewConfigRegistry
|
|
.customDirectEventTypes;
|
|
function accumulateDirectionalDispatches$1(inst, phase, event) {
|
|
if (
|
|
(phase = getListener$1(
|
|
inst,
|
|
event.dispatchConfig.phasedRegistrationNames[phase]
|
|
))
|
|
)
|
|
(event._dispatchListeners = accumulateInto(
|
|
event._dispatchListeners,
|
|
phase
|
|
)),
|
|
(event._dispatchInstances = accumulateInto(
|
|
event._dispatchInstances,
|
|
inst
|
|
));
|
|
}
|
|
function accumulateTwoPhaseDispatchesSingle$1(event) {
|
|
if (event && event.dispatchConfig.phasedRegistrationNames) {
|
|
for (var inst = event._targetInst, path = []; inst; ) {
|
|
path.push(inst);
|
|
do inst = inst.return;
|
|
while (inst && 5 !== inst.tag);
|
|
inst = inst ? inst : null;
|
|
}
|
|
for (inst = path.length; 0 < inst--; )
|
|
accumulateDirectionalDispatches$1(path[inst], "captured", event);
|
|
for (inst = 0; inst < path.length; inst++)
|
|
accumulateDirectionalDispatches$1(path[inst], "bubbled", event);
|
|
}
|
|
}
|
|
function accumulateDirectDispatchesSingle$1(event) {
|
|
if (event && event.dispatchConfig.registrationName) {
|
|
var inst = event._targetInst;
|
|
if (inst && event && event.dispatchConfig.registrationName) {
|
|
var listener = getListener$1(inst, event.dispatchConfig.registrationName);
|
|
listener &&
|
|
((event._dispatchListeners = accumulateInto(
|
|
event._dispatchListeners,
|
|
listener
|
|
)),
|
|
(event._dispatchInstances = accumulateInto(
|
|
event._dispatchInstances,
|
|
inst
|
|
)));
|
|
}
|
|
}
|
|
}
|
|
if (eventPluginOrder)
|
|
throw Error(
|
|
"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."
|
|
);
|
|
eventPluginOrder = Array.prototype.slice.call([
|
|
"ResponderEventPlugin",
|
|
"ReactNativeBridgeEventPlugin"
|
|
]);
|
|
recomputePluginOrdering();
|
|
var injectedNamesToPlugins$jscomp$inline_219 = {
|
|
ResponderEventPlugin: ResponderEventPlugin,
|
|
ReactNativeBridgeEventPlugin: {
|
|
eventTypes: {},
|
|
extractEvents: function(
|
|
topLevelType,
|
|
targetInst,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
) {
|
|
if (null == targetInst) return null;
|
|
var bubbleDispatchConfig = customBubblingEventTypes[topLevelType],
|
|
directDispatchConfig = customDirectEventTypes[topLevelType];
|
|
if (!bubbleDispatchConfig && !directDispatchConfig)
|
|
throw Error(
|
|
'Unsupported top level event type "' + topLevelType + '" dispatched'
|
|
);
|
|
topLevelType = SyntheticEvent.getPooled(
|
|
bubbleDispatchConfig || directDispatchConfig,
|
|
targetInst,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
);
|
|
if (bubbleDispatchConfig)
|
|
forEachAccumulated(
|
|
topLevelType,
|
|
accumulateTwoPhaseDispatchesSingle$1
|
|
);
|
|
else if (directDispatchConfig)
|
|
forEachAccumulated(topLevelType, accumulateDirectDispatchesSingle$1);
|
|
else return null;
|
|
return topLevelType;
|
|
}
|
|
}
|
|
},
|
|
isOrderingDirty$jscomp$inline_220 = !1,
|
|
pluginName$jscomp$inline_221;
|
|
for (pluginName$jscomp$inline_221 in injectedNamesToPlugins$jscomp$inline_219)
|
|
if (
|
|
injectedNamesToPlugins$jscomp$inline_219.hasOwnProperty(
|
|
pluginName$jscomp$inline_221
|
|
)
|
|
) {
|
|
var pluginModule$jscomp$inline_222 =
|
|
injectedNamesToPlugins$jscomp$inline_219[pluginName$jscomp$inline_221];
|
|
if (
|
|
!namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_221) ||
|
|
namesToPlugins[pluginName$jscomp$inline_221] !==
|
|
pluginModule$jscomp$inline_222
|
|
) {
|
|
if (namesToPlugins[pluginName$jscomp$inline_221])
|
|
throw Error(
|
|
"EventPluginRegistry: Cannot inject two different event plugins using the same name, `" +
|
|
pluginName$jscomp$inline_221 +
|
|
"`."
|
|
);
|
|
namesToPlugins[
|
|
pluginName$jscomp$inline_221
|
|
] = pluginModule$jscomp$inline_222;
|
|
isOrderingDirty$jscomp$inline_220 = !0;
|
|
}
|
|
}
|
|
isOrderingDirty$jscomp$inline_220 && recomputePluginOrdering();
|
|
var instanceCache = new Map(),
|
|
instanceProps = new Map();
|
|
function getInstanceFromTag(tag) {
|
|
return instanceCache.get(tag) || null;
|
|
}
|
|
function batchedUpdatesImpl(fn, bookkeeping) {
|
|
return fn(bookkeeping);
|
|
}
|
|
var isInsideEventHandler = !1;
|
|
function batchedUpdates(fn, bookkeeping) {
|
|
if (isInsideEventHandler) return fn(bookkeeping);
|
|
isInsideEventHandler = !0;
|
|
try {
|
|
return batchedUpdatesImpl(fn, bookkeeping);
|
|
} finally {
|
|
isInsideEventHandler = !1;
|
|
}
|
|
}
|
|
var eventQueue = null;
|
|
function executeDispatchesAndReleaseTopLevel(e) {
|
|
if (e) {
|
|
var dispatchListeners = e._dispatchListeners,
|
|
dispatchInstances = e._dispatchInstances;
|
|
if (Array.isArray(dispatchListeners))
|
|
for (
|
|
var i = 0;
|
|
i < dispatchListeners.length && !e.isPropagationStopped();
|
|
i++
|
|
)
|
|
executeDispatch(e, dispatchListeners[i], dispatchInstances[i]);
|
|
else
|
|
dispatchListeners &&
|
|
executeDispatch(e, dispatchListeners, dispatchInstances);
|
|
e._dispatchListeners = null;
|
|
e._dispatchInstances = null;
|
|
e.isPersistent() || e.constructor.release(e);
|
|
}
|
|
}
|
|
var EMPTY_NATIVE_EVENT = {};
|
|
function _receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam) {
|
|
var nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT,
|
|
inst = getInstanceFromTag(rootNodeID),
|
|
target = null;
|
|
null != inst && (target = inst.stateNode);
|
|
batchedUpdates(function() {
|
|
var JSCompiler_inline_result = target;
|
|
for (
|
|
var events = null, legacyPlugins = plugins, i = 0;
|
|
i < legacyPlugins.length;
|
|
i++
|
|
) {
|
|
var possiblePlugin = legacyPlugins[i];
|
|
possiblePlugin &&
|
|
(possiblePlugin = possiblePlugin.extractEvents(
|
|
topLevelType,
|
|
inst,
|
|
nativeEvent,
|
|
JSCompiler_inline_result
|
|
)) &&
|
|
(events = accumulateInto(events, possiblePlugin));
|
|
}
|
|
JSCompiler_inline_result = events;
|
|
null !== JSCompiler_inline_result &&
|
|
(eventQueue = accumulateInto(eventQueue, JSCompiler_inline_result));
|
|
JSCompiler_inline_result = eventQueue;
|
|
eventQueue = null;
|
|
if (JSCompiler_inline_result) {
|
|
forEachAccumulated(
|
|
JSCompiler_inline_result,
|
|
executeDispatchesAndReleaseTopLevel
|
|
);
|
|
if (eventQueue)
|
|
throw Error(
|
|
"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented."
|
|
);
|
|
if (hasRethrowError)
|
|
throw ((JSCompiler_inline_result = rethrowError),
|
|
(hasRethrowError = !1),
|
|
(rethrowError = null),
|
|
JSCompiler_inline_result);
|
|
}
|
|
});
|
|
}
|
|
ReactNativePrivateInterface.RCTEventEmitter.register({
|
|
receiveEvent: function(rootNodeID, topLevelType, nativeEventParam) {
|
|
_receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam);
|
|
},
|
|
receiveTouches: function(eventTopLevelType, touches, changedIndices) {
|
|
if (
|
|
"topTouchEnd" === eventTopLevelType ||
|
|
"topTouchCancel" === eventTopLevelType
|
|
) {
|
|
var JSCompiler_temp = [];
|
|
for (var i = 0; i < changedIndices.length; i++) {
|
|
var index$0 = changedIndices[i];
|
|
JSCompiler_temp.push(touches[index$0]);
|
|
touches[index$0] = null;
|
|
}
|
|
for (i = changedIndices = 0; i < touches.length; i++)
|
|
(index$0 = touches[i]),
|
|
null !== index$0 && (touches[changedIndices++] = index$0);
|
|
touches.length = changedIndices;
|
|
} else
|
|
for (JSCompiler_temp = [], i = 0; i < changedIndices.length; i++)
|
|
JSCompiler_temp.push(touches[changedIndices[i]]);
|
|
for (
|
|
changedIndices = 0;
|
|
changedIndices < JSCompiler_temp.length;
|
|
changedIndices++
|
|
) {
|
|
i = JSCompiler_temp[changedIndices];
|
|
i.changedTouches = JSCompiler_temp;
|
|
i.touches = touches;
|
|
index$0 = null;
|
|
var target = i.target;
|
|
null === target || void 0 === target || 1 > target || (index$0 = target);
|
|
_receiveRootNodeIDEvent(index$0, eventTopLevelType, i);
|
|
}
|
|
}
|
|
});
|
|
getFiberCurrentPropsFromNode = function(stateNode) {
|
|
return instanceProps.get(stateNode._nativeTag) || null;
|
|
};
|
|
getInstanceFromNode = getInstanceFromTag;
|
|
getNodeFromInstance = function(inst) {
|
|
inst = inst.stateNode;
|
|
var tag = inst._nativeTag;
|
|
void 0 === tag && ((inst = inst.canonical), (tag = inst._nativeTag));
|
|
if (!tag) throw Error("All native instances should have a tag.");
|
|
return inst;
|
|
};
|
|
ResponderEventPlugin.injection.injectGlobalResponderHandler({
|
|
onChange: function(from, to, blockNativeResponder) {
|
|
null !== to
|
|
? ReactNativePrivateInterface.UIManager.setJSResponder(
|
|
to.stateNode._nativeTag,
|
|
blockNativeResponder
|
|
)
|
|
: ReactNativePrivateInterface.UIManager.clearJSResponder();
|
|
}
|
|
});
|
|
var ReactSharedInternals =
|
|
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
|
|
REACT_ELEMENT_TYPE = 60103,
|
|
REACT_PORTAL_TYPE = 60106,
|
|
REACT_FRAGMENT_TYPE = 60107,
|
|
REACT_STRICT_MODE_TYPE = 60108,
|
|
REACT_PROFILER_TYPE = 60114,
|
|
REACT_PROVIDER_TYPE = 60109,
|
|
REACT_CONTEXT_TYPE = 60110,
|
|
REACT_FORWARD_REF_TYPE = 60112,
|
|
REACT_SUSPENSE_TYPE = 60113,
|
|
REACT_SUSPENSE_LIST_TYPE = 60120,
|
|
REACT_MEMO_TYPE = 60115,
|
|
REACT_LAZY_TYPE = 60116,
|
|
REACT_DEBUG_TRACING_MODE_TYPE = 60129,
|
|
REACT_OFFSCREEN_TYPE = 60130,
|
|
REACT_LEGACY_HIDDEN_TYPE = 60131,
|
|
REACT_CACHE_TYPE = 60132;
|
|
if ("function" === typeof Symbol && Symbol.for) {
|
|
var symbolFor = Symbol.for;
|
|
REACT_ELEMENT_TYPE = symbolFor("react.element");
|
|
REACT_PORTAL_TYPE = symbolFor("react.portal");
|
|
REACT_FRAGMENT_TYPE = symbolFor("react.fragment");
|
|
REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode");
|
|
REACT_PROFILER_TYPE = symbolFor("react.profiler");
|
|
REACT_PROVIDER_TYPE = symbolFor("react.provider");
|
|
REACT_CONTEXT_TYPE = symbolFor("react.context");
|
|
REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref");
|
|
REACT_SUSPENSE_TYPE = symbolFor("react.suspense");
|
|
REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list");
|
|
REACT_MEMO_TYPE = symbolFor("react.memo");
|
|
REACT_LAZY_TYPE = symbolFor("react.lazy");
|
|
symbolFor("react.scope");
|
|
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode");
|
|
REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen");
|
|
REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden");
|
|
REACT_CACHE_TYPE = symbolFor("react.cache");
|
|
}
|
|
var MAYBE_ITERATOR_SYMBOL = "function" === typeof Symbol && Symbol.iterator;
|
|
function getIteratorFn(maybeIterable) {
|
|
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
|
maybeIterable =
|
|
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
|
maybeIterable["@@iterator"];
|
|
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
}
|
|
function getComponentName(type) {
|
|
if (null == type) return null;
|
|
if ("function" === typeof type) return type.displayName || type.name || null;
|
|
if ("string" === typeof type) return type;
|
|
switch (type) {
|
|
case REACT_FRAGMENT_TYPE:
|
|
return "Fragment";
|
|
case REACT_PORTAL_TYPE:
|
|
return "Portal";
|
|
case REACT_PROFILER_TYPE:
|
|
return "Profiler";
|
|
case REACT_STRICT_MODE_TYPE:
|
|
return "StrictMode";
|
|
case REACT_SUSPENSE_TYPE:
|
|
return "Suspense";
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return "SuspenseList";
|
|
case REACT_CACHE_TYPE:
|
|
return "Cache";
|
|
}
|
|
if ("object" === typeof type)
|
|
switch (type.$$typeof) {
|
|
case REACT_CONTEXT_TYPE:
|
|
return (type.displayName || "Context") + ".Consumer";
|
|
case REACT_PROVIDER_TYPE:
|
|
return (type._context.displayName || "Context") + ".Provider";
|
|
case REACT_FORWARD_REF_TYPE:
|
|
var innerType = type.render;
|
|
innerType = innerType.displayName || innerType.name || "";
|
|
return (
|
|
type.displayName ||
|
|
("" !== innerType ? "ForwardRef(" + innerType + ")" : "ForwardRef")
|
|
);
|
|
case REACT_MEMO_TYPE:
|
|
return getComponentName(type.type);
|
|
case REACT_LAZY_TYPE:
|
|
innerType = type._payload;
|
|
type = type._init;
|
|
try {
|
|
return getComponentName(type(innerType));
|
|
} catch (x) {}
|
|
}
|
|
return null;
|
|
}
|
|
function getNearestMountedFiber(fiber) {
|
|
var node = fiber,
|
|
nearestMounted = fiber;
|
|
if (fiber.alternate) for (; node.return; ) node = node.return;
|
|
else {
|
|
fiber = node;
|
|
do
|
|
(node = fiber),
|
|
0 !== (node.flags & 2050) && (nearestMounted = node.return),
|
|
(fiber = node.return);
|
|
while (fiber);
|
|
}
|
|
return 3 === node.tag ? nearestMounted : null;
|
|
}
|
|
function assertIsMounted(fiber) {
|
|
if (getNearestMountedFiber(fiber) !== fiber)
|
|
throw Error("Unable to find node on an unmounted component.");
|
|
}
|
|
function findCurrentFiberUsingSlowPath(fiber) {
|
|
var alternate = fiber.alternate;
|
|
if (!alternate) {
|
|
alternate = getNearestMountedFiber(fiber);
|
|
if (null === alternate)
|
|
throw Error("Unable to find node on an unmounted component.");
|
|
return alternate !== fiber ? null : fiber;
|
|
}
|
|
for (var a = fiber, b = alternate; ; ) {
|
|
var parentA = a.return;
|
|
if (null === parentA) break;
|
|
var parentB = parentA.alternate;
|
|
if (null === parentB) {
|
|
b = parentA.return;
|
|
if (null !== b) {
|
|
a = b;
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
if (parentA.child === parentB.child) {
|
|
for (parentB = parentA.child; parentB; ) {
|
|
if (parentB === a) return assertIsMounted(parentA), fiber;
|
|
if (parentB === b) return assertIsMounted(parentA), alternate;
|
|
parentB = parentB.sibling;
|
|
}
|
|
throw Error("Unable to find node on an unmounted component.");
|
|
}
|
|
if (a.return !== b.return) (a = parentA), (b = parentB);
|
|
else {
|
|
for (var didFindChild = !1, child$1 = parentA.child; child$1; ) {
|
|
if (child$1 === a) {
|
|
didFindChild = !0;
|
|
a = parentA;
|
|
b = parentB;
|
|
break;
|
|
}
|
|
if (child$1 === b) {
|
|
didFindChild = !0;
|
|
b = parentA;
|
|
a = parentB;
|
|
break;
|
|
}
|
|
child$1 = child$1.sibling;
|
|
}
|
|
if (!didFindChild) {
|
|
for (child$1 = parentB.child; child$1; ) {
|
|
if (child$1 === a) {
|
|
didFindChild = !0;
|
|
a = parentB;
|
|
b = parentA;
|
|
break;
|
|
}
|
|
if (child$1 === b) {
|
|
didFindChild = !0;
|
|
b = parentB;
|
|
a = parentA;
|
|
break;
|
|
}
|
|
child$1 = child$1.sibling;
|
|
}
|
|
if (!didFindChild)
|
|
throw Error(
|
|
"Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue."
|
|
);
|
|
}
|
|
}
|
|
if (a.alternate !== b)
|
|
throw Error(
|
|
"Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
}
|
|
if (3 !== a.tag)
|
|
throw Error("Unable to find node on an unmounted component.");
|
|
return a.stateNode.current === a ? fiber : alternate;
|
|
}
|
|
function findCurrentHostFiber(parent) {
|
|
parent = findCurrentFiberUsingSlowPath(parent);
|
|
return null !== parent ? findCurrentHostFiberImpl(parent) : null;
|
|
}
|
|
function findCurrentHostFiberImpl(node) {
|
|
if (5 === node.tag || 6 === node.tag) return node;
|
|
for (node = node.child; null !== node; ) {
|
|
var match = findCurrentHostFiberImpl(node);
|
|
if (null !== match) return match;
|
|
node = node.sibling;
|
|
}
|
|
return null;
|
|
}
|
|
function doesFiberContain(parentFiber, childFiber) {
|
|
for (
|
|
var parentFiberAlternate = parentFiber.alternate;
|
|
null !== childFiber;
|
|
|
|
) {
|
|
if (childFiber === parentFiber || childFiber === parentFiberAlternate)
|
|
return !0;
|
|
childFiber = childFiber.return;
|
|
}
|
|
return !1;
|
|
}
|
|
var emptyObject = {},
|
|
removedKeys = null,
|
|
removedKeyCount = 0,
|
|
deepDifferOptions = { unsafelyIgnoreFunctions: !0 };
|
|
function defaultDiffer(prevProp, nextProp) {
|
|
return "object" !== typeof nextProp || null === nextProp
|
|
? !0
|
|
: ReactNativePrivateInterface.deepDiffer(
|
|
prevProp,
|
|
nextProp,
|
|
deepDifferOptions
|
|
);
|
|
}
|
|
function restoreDeletedValuesInNestedArray(
|
|
updatePayload,
|
|
node,
|
|
validAttributes
|
|
) {
|
|
if (Array.isArray(node))
|
|
for (var i = node.length; i-- && 0 < removedKeyCount; )
|
|
restoreDeletedValuesInNestedArray(
|
|
updatePayload,
|
|
node[i],
|
|
validAttributes
|
|
);
|
|
else if (node && 0 < removedKeyCount)
|
|
for (i in removedKeys)
|
|
if (removedKeys[i]) {
|
|
var nextProp = node[i];
|
|
if (void 0 !== nextProp) {
|
|
var attributeConfig = validAttributes[i];
|
|
if (attributeConfig) {
|
|
"function" === typeof nextProp && (nextProp = !0);
|
|
"undefined" === typeof nextProp && (nextProp = null);
|
|
if ("object" !== typeof attributeConfig)
|
|
updatePayload[i] = nextProp;
|
|
else if (
|
|
"function" === typeof attributeConfig.diff ||
|
|
"function" === typeof attributeConfig.process
|
|
)
|
|
(nextProp =
|
|
"function" === typeof attributeConfig.process
|
|
? attributeConfig.process(nextProp)
|
|
: nextProp),
|
|
(updatePayload[i] = nextProp);
|
|
removedKeys[i] = !1;
|
|
removedKeyCount--;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function diffNestedProperty(
|
|
updatePayload,
|
|
prevProp,
|
|
nextProp,
|
|
validAttributes
|
|
) {
|
|
if (!updatePayload && prevProp === nextProp) return updatePayload;
|
|
if (!prevProp || !nextProp)
|
|
return nextProp
|
|
? addNestedProperty(updatePayload, nextProp, validAttributes)
|
|
: prevProp
|
|
? clearNestedProperty(updatePayload, prevProp, validAttributes)
|
|
: updatePayload;
|
|
if (!Array.isArray(prevProp) && !Array.isArray(nextProp))
|
|
return diffProperties(updatePayload, prevProp, nextProp, validAttributes);
|
|
if (Array.isArray(prevProp) && Array.isArray(nextProp)) {
|
|
var minLength =
|
|
prevProp.length < nextProp.length ? prevProp.length : nextProp.length,
|
|
i;
|
|
for (i = 0; i < minLength; i++)
|
|
updatePayload = diffNestedProperty(
|
|
updatePayload,
|
|
prevProp[i],
|
|
nextProp[i],
|
|
validAttributes
|
|
);
|
|
for (; i < prevProp.length; i++)
|
|
updatePayload = clearNestedProperty(
|
|
updatePayload,
|
|
prevProp[i],
|
|
validAttributes
|
|
);
|
|
for (; i < nextProp.length; i++)
|
|
updatePayload = addNestedProperty(
|
|
updatePayload,
|
|
nextProp[i],
|
|
validAttributes
|
|
);
|
|
return updatePayload;
|
|
}
|
|
return Array.isArray(prevProp)
|
|
? diffProperties(
|
|
updatePayload,
|
|
ReactNativePrivateInterface.flattenStyle(prevProp),
|
|
nextProp,
|
|
validAttributes
|
|
)
|
|
: diffProperties(
|
|
updatePayload,
|
|
prevProp,
|
|
ReactNativePrivateInterface.flattenStyle(nextProp),
|
|
validAttributes
|
|
);
|
|
}
|
|
function addNestedProperty(updatePayload, nextProp, validAttributes) {
|
|
if (!nextProp) return updatePayload;
|
|
if (!Array.isArray(nextProp))
|
|
return diffProperties(
|
|
updatePayload,
|
|
emptyObject,
|
|
nextProp,
|
|
validAttributes
|
|
);
|
|
for (var i = 0; i < nextProp.length; i++)
|
|
updatePayload = addNestedProperty(
|
|
updatePayload,
|
|
nextProp[i],
|
|
validAttributes
|
|
);
|
|
return updatePayload;
|
|
}
|
|
function clearNestedProperty(updatePayload, prevProp, validAttributes) {
|
|
if (!prevProp) return updatePayload;
|
|
if (!Array.isArray(prevProp))
|
|
return diffProperties(
|
|
updatePayload,
|
|
prevProp,
|
|
emptyObject,
|
|
validAttributes
|
|
);
|
|
for (var i = 0; i < prevProp.length; i++)
|
|
updatePayload = clearNestedProperty(
|
|
updatePayload,
|
|
prevProp[i],
|
|
validAttributes
|
|
);
|
|
return updatePayload;
|
|
}
|
|
function diffProperties(updatePayload, prevProps, nextProps, validAttributes) {
|
|
var attributeConfig, propKey;
|
|
for (propKey in nextProps)
|
|
if ((attributeConfig = validAttributes[propKey])) {
|
|
var prevProp = prevProps[propKey];
|
|
var nextProp = nextProps[propKey];
|
|
"function" === typeof nextProp &&
|
|
((nextProp = !0), "function" === typeof prevProp && (prevProp = !0));
|
|
"undefined" === typeof nextProp &&
|
|
((nextProp = null),
|
|
"undefined" === typeof prevProp && (prevProp = null));
|
|
removedKeys && (removedKeys[propKey] = !1);
|
|
if (updatePayload && void 0 !== updatePayload[propKey])
|
|
if ("object" !== typeof attributeConfig)
|
|
updatePayload[propKey] = nextProp;
|
|
else {
|
|
if (
|
|
"function" === typeof attributeConfig.diff ||
|
|
"function" === typeof attributeConfig.process
|
|
)
|
|
(attributeConfig =
|
|
"function" === typeof attributeConfig.process
|
|
? attributeConfig.process(nextProp)
|
|
: nextProp),
|
|
(updatePayload[propKey] = attributeConfig);
|
|
}
|
|
else if (prevProp !== nextProp)
|
|
if ("object" !== typeof attributeConfig)
|
|
defaultDiffer(prevProp, nextProp) &&
|
|
((updatePayload || (updatePayload = {}))[propKey] = nextProp);
|
|
else if (
|
|
"function" === typeof attributeConfig.diff ||
|
|
"function" === typeof attributeConfig.process
|
|
) {
|
|
if (
|
|
void 0 === prevProp ||
|
|
("function" === typeof attributeConfig.diff
|
|
? attributeConfig.diff(prevProp, nextProp)
|
|
: defaultDiffer(prevProp, nextProp))
|
|
)
|
|
(attributeConfig =
|
|
"function" === typeof attributeConfig.process
|
|
? attributeConfig.process(nextProp)
|
|
: nextProp),
|
|
((updatePayload || (updatePayload = {}))[
|
|
propKey
|
|
] = attributeConfig);
|
|
} else
|
|
(removedKeys = null),
|
|
(removedKeyCount = 0),
|
|
(updatePayload = diffNestedProperty(
|
|
updatePayload,
|
|
prevProp,
|
|
nextProp,
|
|
attributeConfig
|
|
)),
|
|
0 < removedKeyCount &&
|
|
updatePayload &&
|
|
(restoreDeletedValuesInNestedArray(
|
|
updatePayload,
|
|
nextProp,
|
|
attributeConfig
|
|
),
|
|
(removedKeys = null));
|
|
}
|
|
for (var propKey$3 in prevProps)
|
|
void 0 === nextProps[propKey$3] &&
|
|
(!(attributeConfig = validAttributes[propKey$3]) ||
|
|
(updatePayload && void 0 !== updatePayload[propKey$3]) ||
|
|
((prevProp = prevProps[propKey$3]),
|
|
void 0 !== prevProp &&
|
|
("object" !== typeof attributeConfig ||
|
|
"function" === typeof attributeConfig.diff ||
|
|
"function" === typeof attributeConfig.process
|
|
? (((updatePayload || (updatePayload = {}))[propKey$3] = null),
|
|
removedKeys || (removedKeys = {}),
|
|
removedKeys[propKey$3] ||
|
|
((removedKeys[propKey$3] = !0), removedKeyCount++))
|
|
: (updatePayload = clearNestedProperty(
|
|
updatePayload,
|
|
prevProp,
|
|
attributeConfig
|
|
)))));
|
|
return updatePayload;
|
|
}
|
|
function mountSafeCallback_NOT_REALLY_SAFE(context, callback) {
|
|
return function() {
|
|
if (
|
|
callback &&
|
|
("boolean" !== typeof context.__isMounted || context.__isMounted)
|
|
)
|
|
return callback.apply(context, arguments);
|
|
};
|
|
}
|
|
var ReactNativeFiberHostComponent = (function() {
|
|
function ReactNativeFiberHostComponent(tag, viewConfig) {
|
|
this._nativeTag = tag;
|
|
this._children = [];
|
|
this.viewConfig = viewConfig;
|
|
}
|
|
var _proto = ReactNativeFiberHostComponent.prototype;
|
|
_proto.blur = function() {
|
|
ReactNativePrivateInterface.TextInputState.blurTextInput(this);
|
|
};
|
|
_proto.focus = function() {
|
|
ReactNativePrivateInterface.TextInputState.focusTextInput(this);
|
|
};
|
|
_proto.measure = function(callback) {
|
|
ReactNativePrivateInterface.UIManager.measure(
|
|
this._nativeTag,
|
|
mountSafeCallback_NOT_REALLY_SAFE(this, callback)
|
|
);
|
|
};
|
|
_proto.measureInWindow = function(callback) {
|
|
ReactNativePrivateInterface.UIManager.measureInWindow(
|
|
this._nativeTag,
|
|
mountSafeCallback_NOT_REALLY_SAFE(this, callback)
|
|
);
|
|
};
|
|
_proto.measureLayout = function(relativeToNativeNode, onSuccess, onFail) {
|
|
if ("number" === typeof relativeToNativeNode)
|
|
var relativeNode = relativeToNativeNode;
|
|
else
|
|
relativeToNativeNode._nativeTag &&
|
|
(relativeNode = relativeToNativeNode._nativeTag);
|
|
null != relativeNode &&
|
|
ReactNativePrivateInterface.UIManager.measureLayout(
|
|
this._nativeTag,
|
|
relativeNode,
|
|
mountSafeCallback_NOT_REALLY_SAFE(this, onFail),
|
|
mountSafeCallback_NOT_REALLY_SAFE(this, onSuccess)
|
|
);
|
|
};
|
|
_proto.setNativeProps = function(nativeProps) {
|
|
nativeProps = diffProperties(
|
|
null,
|
|
emptyObject,
|
|
nativeProps,
|
|
this.viewConfig.validAttributes
|
|
);
|
|
null != nativeProps &&
|
|
ReactNativePrivateInterface.UIManager.updateView(
|
|
this._nativeTag,
|
|
this.viewConfig.uiViewClassName,
|
|
nativeProps
|
|
);
|
|
};
|
|
return ReactNativeFiberHostComponent;
|
|
})(),
|
|
Scheduler_runWithPriority = Scheduler.unstable_runWithPriority,
|
|
Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback,
|
|
Scheduler_cancelCallback = Scheduler.unstable_cancelCallback,
|
|
Scheduler_shouldYield = Scheduler.unstable_shouldYield,
|
|
Scheduler_requestPaint = Scheduler.unstable_requestPaint,
|
|
Scheduler_now = Scheduler.unstable_now,
|
|
Scheduler_getCurrentPriorityLevel =
|
|
Scheduler.unstable_getCurrentPriorityLevel,
|
|
Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority,
|
|
Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,
|
|
Scheduler_NormalPriority = Scheduler.unstable_NormalPriority,
|
|
Scheduler_LowPriority = Scheduler.unstable_LowPriority,
|
|
Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;
|
|
if (
|
|
null == tracing.__interactionsRef ||
|
|
null == tracing.__interactionsRef.current
|
|
)
|
|
throw Error(
|
|
"It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling"
|
|
);
|
|
var requestPaint =
|
|
void 0 !== Scheduler_requestPaint ? Scheduler_requestPaint : function() {},
|
|
syncQueue = null,
|
|
immediateQueueCallbackNode = null,
|
|
isFlushingSyncQueue = !1,
|
|
initialTimeMs = Scheduler_now(),
|
|
now =
|
|
1e4 > initialTimeMs
|
|
? Scheduler_now
|
|
: function() {
|
|
return Scheduler_now() - initialTimeMs;
|
|
};
|
|
function getCurrentPriorityLevel() {
|
|
switch (Scheduler_getCurrentPriorityLevel()) {
|
|
case Scheduler_ImmediatePriority:
|
|
return 99;
|
|
case Scheduler_UserBlockingPriority:
|
|
return 98;
|
|
case Scheduler_NormalPriority:
|
|
return 97;
|
|
case Scheduler_LowPriority:
|
|
return 96;
|
|
case Scheduler_IdlePriority:
|
|
return 95;
|
|
default:
|
|
throw Error("Unknown priority level.");
|
|
}
|
|
}
|
|
function reactPriorityToSchedulerPriority(reactPriorityLevel) {
|
|
switch (reactPriorityLevel) {
|
|
case 99:
|
|
return Scheduler_ImmediatePriority;
|
|
case 98:
|
|
return Scheduler_UserBlockingPriority;
|
|
case 97:
|
|
return Scheduler_NormalPriority;
|
|
case 96:
|
|
return Scheduler_LowPriority;
|
|
case 95:
|
|
return Scheduler_IdlePriority;
|
|
default:
|
|
throw Error("Unknown priority level.");
|
|
}
|
|
}
|
|
function runWithPriority(reactPriorityLevel, fn) {
|
|
reactPriorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
|
|
return Scheduler_runWithPriority(reactPriorityLevel, fn);
|
|
}
|
|
function scheduleCallback(reactPriorityLevel, callback, options) {
|
|
reactPriorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
|
|
return Scheduler_scheduleCallback(reactPriorityLevel, callback, options);
|
|
}
|
|
function flushSyncCallbackQueue() {
|
|
if (null !== immediateQueueCallbackNode) {
|
|
var node = immediateQueueCallbackNode;
|
|
immediateQueueCallbackNode = null;
|
|
Scheduler_cancelCallback(node);
|
|
}
|
|
flushSyncCallbackQueueImpl();
|
|
}
|
|
function flushSyncCallbackQueueImpl() {
|
|
if (!isFlushingSyncQueue && null !== syncQueue) {
|
|
isFlushingSyncQueue = !0;
|
|
var i = 0;
|
|
try {
|
|
var queue = syncQueue;
|
|
runWithPriority(99, function() {
|
|
for (; i < queue.length; i++) {
|
|
var callback = queue[i];
|
|
do callback = callback(!0);
|
|
while (null !== callback);
|
|
}
|
|
});
|
|
syncQueue = null;
|
|
} catch (error) {
|
|
throw (null !== syncQueue && (syncQueue = syncQueue.slice(i + 1)),
|
|
Scheduler_scheduleCallback(
|
|
Scheduler_ImmediatePriority,
|
|
flushSyncCallbackQueue
|
|
),
|
|
error);
|
|
} finally {
|
|
isFlushingSyncQueue = !1;
|
|
}
|
|
}
|
|
}
|
|
var nextTransitionLane = 512,
|
|
nextRetryLane = 8388608,
|
|
return_highestLanePriority = 8;
|
|
function getHighestPriorityLanes(lanes) {
|
|
switch (lanes & -lanes) {
|
|
case 1:
|
|
return (return_highestLanePriority = 15), 1;
|
|
case 2:
|
|
return (return_highestLanePriority = 14), 2;
|
|
case 4:
|
|
return (return_highestLanePriority = 13), 4;
|
|
case 8:
|
|
return (return_highestLanePriority = 12), 8;
|
|
case 16:
|
|
return (return_highestLanePriority = 11), 16;
|
|
case 32:
|
|
return (return_highestLanePriority = 10), 32;
|
|
case 64:
|
|
return (return_highestLanePriority = 9), 64;
|
|
case 128:
|
|
return (return_highestLanePriority = 8), 128;
|
|
case 256:
|
|
return (return_highestLanePriority = 7), 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:
|
|
return (return_highestLanePriority = 6), lanes & 8388096;
|
|
case 8388608:
|
|
case 16777216:
|
|
case 33554432:
|
|
case 67108864:
|
|
return (return_highestLanePriority = 5), lanes & 125829120;
|
|
case 134217728:
|
|
return (return_highestLanePriority = 4), 134217728;
|
|
case 268435456:
|
|
return (return_highestLanePriority = 3), 268435456;
|
|
case 536870912:
|
|
return (return_highestLanePriority = 2), 536870912;
|
|
case 1073741824:
|
|
return (return_highestLanePriority = 1), 1073741824;
|
|
default:
|
|
return (return_highestLanePriority = 8), lanes;
|
|
}
|
|
}
|
|
function schedulerPriorityToLanePriority(schedulerPriorityLevel) {
|
|
switch (schedulerPriorityLevel) {
|
|
case 99:
|
|
return 15;
|
|
case 98:
|
|
return 10;
|
|
case 97:
|
|
case 96:
|
|
return 8;
|
|
case 95:
|
|
return 2;
|
|
default:
|
|
return 0;
|
|
}
|
|
}
|
|
function lanePriorityToSchedulerPriority(lanePriority) {
|
|
switch (lanePriority) {
|
|
case 15:
|
|
case 14:
|
|
return 99;
|
|
case 13:
|
|
case 12:
|
|
case 11:
|
|
case 10:
|
|
return 98;
|
|
case 9:
|
|
case 8:
|
|
case 7:
|
|
case 6:
|
|
case 4:
|
|
case 5:
|
|
return 97;
|
|
case 3:
|
|
case 2:
|
|
case 1:
|
|
return 95;
|
|
case 0:
|
|
return 90;
|
|
default:
|
|
throw Error(
|
|
"Invalid update priority: " + lanePriority + ". This is a bug in React."
|
|
);
|
|
}
|
|
}
|
|
function getNextLanes(root, wipLanes) {
|
|
var pendingLanes = root.pendingLanes;
|
|
if (0 === pendingLanes) return (return_highestLanePriority = 0);
|
|
var nextLanes = 0,
|
|
nextLanePriority = 0,
|
|
expiredLanes = root.expiredLanes,
|
|
suspendedLanes = root.suspendedLanes,
|
|
pingedLanes = root.pingedLanes;
|
|
0 !== expiredLanes
|
|
? ((nextLanes = expiredLanes),
|
|
(nextLanePriority = return_highestLanePriority = 15))
|
|
: ((expiredLanes = pendingLanes & 268435455),
|
|
0 !== expiredLanes
|
|
? ((pendingLanes = expiredLanes & ~suspendedLanes),
|
|
0 !== pendingLanes
|
|
? ((nextLanes = getHighestPriorityLanes(pendingLanes)),
|
|
(nextLanePriority = return_highestLanePriority))
|
|
: ((pingedLanes &= expiredLanes),
|
|
0 !== pingedLanes &&
|
|
((nextLanes = getHighestPriorityLanes(pingedLanes)),
|
|
(nextLanePriority = return_highestLanePriority))))
|
|
: ((pendingLanes &= ~suspendedLanes),
|
|
0 !== pendingLanes
|
|
? ((nextLanes = getHighestPriorityLanes(pendingLanes)),
|
|
(nextLanePriority = return_highestLanePriority))
|
|
: 0 !== pingedLanes &&
|
|
((nextLanes = getHighestPriorityLanes(pingedLanes)),
|
|
(nextLanePriority = return_highestLanePriority))));
|
|
if (0 === nextLanes) return 0;
|
|
if (
|
|
0 !== wipLanes &&
|
|
wipLanes !== nextLanes &&
|
|
0 === (wipLanes & suspendedLanes)
|
|
) {
|
|
getHighestPriorityLanes(wipLanes);
|
|
suspendedLanes = return_highestLanePriority;
|
|
if (
|
|
nextLanePriority <= suspendedLanes ||
|
|
(8 === nextLanePriority && 6 === suspendedLanes)
|
|
)
|
|
return wipLanes;
|
|
return_highestLanePriority = nextLanePriority;
|
|
}
|
|
wipLanes = root.entangledLanes;
|
|
if (0 !== wipLanes)
|
|
for (root = root.entanglements, wipLanes &= nextLanes; 0 < wipLanes; )
|
|
(nextLanePriority = 31 - clz32(wipLanes)),
|
|
(suspendedLanes = 1 << nextLanePriority),
|
|
(nextLanes |= root[nextLanePriority]),
|
|
(wipLanes &= ~suspendedLanes);
|
|
return nextLanes;
|
|
}
|
|
function getLanesToRetrySynchronouslyOnError(root) {
|
|
root = root.pendingLanes & -1073741825;
|
|
return 0 !== root ? root : root & 1073741824 ? 1073741824 : 0;
|
|
}
|
|
function findUpdateLane(lanePriority) {
|
|
switch (lanePriority) {
|
|
case 15:
|
|
return 1;
|
|
case 14:
|
|
return 2;
|
|
case 12:
|
|
return 8;
|
|
case 10:
|
|
return 32;
|
|
case 8:
|
|
return 128;
|
|
case 2:
|
|
return 536870912;
|
|
}
|
|
throw Error(
|
|
"Invalid update priority: " + lanePriority + ". This is a bug in React."
|
|
);
|
|
}
|
|
function createLaneMap(initial) {
|
|
for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial);
|
|
return laneMap;
|
|
}
|
|
function markRootUpdated(root, updateLane, eventTime) {
|
|
root.pendingLanes |= updateLane;
|
|
536870912 !== updateLane &&
|
|
((root.suspendedLanes = 0), (root.pingedLanes = 0));
|
|
root = root.eventTimes;
|
|
updateLane = 31 - clz32(updateLane);
|
|
root[updateLane] = eventTime;
|
|
}
|
|
function markRootFinished(root, remainingLanes) {
|
|
var noLongerPendingLanes = root.pendingLanes & ~remainingLanes;
|
|
root.pendingLanes = remainingLanes;
|
|
root.suspendedLanes = 0;
|
|
root.pingedLanes = 0;
|
|
root.expiredLanes &= remainingLanes;
|
|
root.mutableReadLanes &= remainingLanes;
|
|
root.entangledLanes &= remainingLanes;
|
|
remainingLanes = root.entanglements;
|
|
var eventTimes = root.eventTimes;
|
|
for (root = root.expirationTimes; 0 < noLongerPendingLanes; ) {
|
|
var index$8 = 31 - clz32(noLongerPendingLanes),
|
|
lane = 1 << index$8;
|
|
remainingLanes[index$8] = 0;
|
|
eventTimes[index$8] = -1;
|
|
root[index$8] = -1;
|
|
noLongerPendingLanes &= ~lane;
|
|
}
|
|
}
|
|
function markRootEntangled(root, entangledLanes) {
|
|
var rootEntangledLanes = (root.entangledLanes |= entangledLanes);
|
|
for (root = root.entanglements; rootEntangledLanes; ) {
|
|
var index$9 = 31 - clz32(rootEntangledLanes),
|
|
lane = 1 << index$9;
|
|
(lane & entangledLanes) | (root[index$9] & entangledLanes) &&
|
|
(root[index$9] |= entangledLanes);
|
|
rootEntangledLanes &= ~lane;
|
|
}
|
|
}
|
|
var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback,
|
|
log = Math.log,
|
|
LN2 = Math.LN2;
|
|
function clz32Fallback(lanes) {
|
|
return 0 === lanes ? 32 : (31 - ((log(lanes) / LN2) | 0)) | 0;
|
|
}
|
|
var Scheduler_now$1 = Scheduler.unstable_now;
|
|
if (
|
|
null == tracing.__interactionsRef ||
|
|
null == tracing.__interactionsRef.current
|
|
)
|
|
throw Error(
|
|
"It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling"
|
|
);
|
|
Scheduler_now$1();
|
|
function shim() {
|
|
throw Error(
|
|
"The current renderer does not support hydration. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
}
|
|
var getViewConfigForType =
|
|
ReactNativePrivateInterface.ReactNativeViewConfigRegistry.get,
|
|
UPDATE_SIGNAL = {},
|
|
nextReactTag = 3;
|
|
function allocateTag() {
|
|
var tag = nextReactTag;
|
|
1 === tag % 10 && (tag += 2);
|
|
nextReactTag = tag + 2;
|
|
return tag;
|
|
}
|
|
function recursivelyUncacheFiberNode(node) {
|
|
if ("number" === typeof node)
|
|
instanceCache.delete(node), instanceProps.delete(node);
|
|
else {
|
|
var tag = node._nativeTag;
|
|
instanceCache.delete(tag);
|
|
instanceProps.delete(tag);
|
|
node._children.forEach(recursivelyUncacheFiberNode);
|
|
}
|
|
}
|
|
function finalizeInitialChildren(parentInstance) {
|
|
if (0 === parentInstance._children.length) return !1;
|
|
var nativeTags = parentInstance._children.map(function(child) {
|
|
return "number" === typeof child ? child : child._nativeTag;
|
|
});
|
|
ReactNativePrivateInterface.UIManager.setChildren(
|
|
parentInstance._nativeTag,
|
|
nativeTags
|
|
);
|
|
return !1;
|
|
}
|
|
var scheduleTimeout = setTimeout,
|
|
cancelTimeout = clearTimeout;
|
|
function describeComponentFrame(name, source, ownerName) {
|
|
source = "";
|
|
ownerName && (source = " (created by " + ownerName + ")");
|
|
return "\n in " + (name || "Unknown") + source;
|
|
}
|
|
function describeFunctionComponentFrame(fn, source) {
|
|
return fn
|
|
? describeComponentFrame(fn.displayName || fn.name || null, source, null)
|
|
: "";
|
|
}
|
|
var valueStack = [],
|
|
index = -1;
|
|
function createCursor(defaultValue) {
|
|
return { current: defaultValue };
|
|
}
|
|
function pop(cursor) {
|
|
0 > index ||
|
|
((cursor.current = valueStack[index]), (valueStack[index] = null), index--);
|
|
}
|
|
function push(cursor, value) {
|
|
index++;
|
|
valueStack[index] = cursor.current;
|
|
cursor.current = value;
|
|
}
|
|
var emptyContextObject = {},
|
|
contextStackCursor = createCursor(emptyContextObject),
|
|
didPerformWorkStackCursor = createCursor(!1),
|
|
previousContext = emptyContextObject;
|
|
function getMaskedContext(workInProgress, unmaskedContext) {
|
|
var contextTypes = workInProgress.type.contextTypes;
|
|
if (!contextTypes) return emptyContextObject;
|
|
var instance = workInProgress.stateNode;
|
|
if (
|
|
instance &&
|
|
instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext
|
|
)
|
|
return instance.__reactInternalMemoizedMaskedChildContext;
|
|
var context = {},
|
|
key;
|
|
for (key in contextTypes) context[key] = unmaskedContext[key];
|
|
instance &&
|
|
((workInProgress = workInProgress.stateNode),
|
|
(workInProgress.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext),
|
|
(workInProgress.__reactInternalMemoizedMaskedChildContext = context));
|
|
return context;
|
|
}
|
|
function isContextProvider(type) {
|
|
type = type.childContextTypes;
|
|
return null !== type && void 0 !== type;
|
|
}
|
|
function popContext() {
|
|
pop(didPerformWorkStackCursor);
|
|
pop(contextStackCursor);
|
|
}
|
|
function pushTopLevelContextObject(fiber, context, didChange) {
|
|
if (contextStackCursor.current !== emptyContextObject)
|
|
throw Error(
|
|
"Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
push(contextStackCursor, context);
|
|
push(didPerformWorkStackCursor, didChange);
|
|
}
|
|
function processChildContext(fiber, type, parentContext) {
|
|
var instance = fiber.stateNode;
|
|
fiber = type.childContextTypes;
|
|
if ("function" !== typeof instance.getChildContext) return parentContext;
|
|
instance = instance.getChildContext();
|
|
for (var contextKey in instance)
|
|
if (!(contextKey in fiber))
|
|
throw Error(
|
|
(getComponentName(type) || "Unknown") +
|
|
'.getChildContext(): key "' +
|
|
contextKey +
|
|
'" is not defined in childContextTypes.'
|
|
);
|
|
return Object.assign({}, parentContext, instance);
|
|
}
|
|
function pushContextProvider(workInProgress) {
|
|
workInProgress =
|
|
((workInProgress = workInProgress.stateNode) &&
|
|
workInProgress.__reactInternalMemoizedMergedChildContext) ||
|
|
emptyContextObject;
|
|
previousContext = contextStackCursor.current;
|
|
push(contextStackCursor, workInProgress);
|
|
push(didPerformWorkStackCursor, didPerformWorkStackCursor.current);
|
|
return !0;
|
|
}
|
|
function invalidateContextProvider(workInProgress, type, didChange) {
|
|
var instance = workInProgress.stateNode;
|
|
if (!instance)
|
|
throw Error(
|
|
"Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
didChange
|
|
? ((workInProgress = processChildContext(
|
|
workInProgress,
|
|
type,
|
|
previousContext
|
|
)),
|
|
(instance.__reactInternalMemoizedMergedChildContext = workInProgress),
|
|
pop(didPerformWorkStackCursor),
|
|
pop(contextStackCursor),
|
|
push(contextStackCursor, workInProgress))
|
|
: pop(didPerformWorkStackCursor);
|
|
push(didPerformWorkStackCursor, didChange);
|
|
}
|
|
var rendererID = null,
|
|
injectedHook = null,
|
|
isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
function onCommitRoot(root, priorityLevel) {
|
|
if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot)
|
|
try {
|
|
injectedHook.onCommitFiberRoot(
|
|
rendererID,
|
|
root,
|
|
priorityLevel,
|
|
128 === (root.current.flags & 128)
|
|
);
|
|
} catch (err) {}
|
|
}
|
|
var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
|
|
function is(x, y) {
|
|
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
}
|
|
var objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
function shallowEqual(objA, objB) {
|
|
if (objectIs(objA, objB)) return !0;
|
|
if (
|
|
"object" !== typeof objA ||
|
|
null === objA ||
|
|
"object" !== typeof objB ||
|
|
null === objB
|
|
)
|
|
return !1;
|
|
var keysA = Object.keys(objA),
|
|
keysB = Object.keys(objB);
|
|
if (keysA.length !== keysB.length) return !1;
|
|
for (keysB = 0; keysB < keysA.length; keysB++)
|
|
if (
|
|
!hasOwnProperty.call(objB, keysA[keysB]) ||
|
|
!objectIs(objA[keysA[keysB]], objB[keysA[keysB]])
|
|
)
|
|
return !1;
|
|
return !0;
|
|
}
|
|
function describeFiber(fiber) {
|
|
switch (fiber.tag) {
|
|
case 5:
|
|
return describeComponentFrame(fiber.type, null, null);
|
|
case 16:
|
|
return describeComponentFrame("Lazy", null, null);
|
|
case 13:
|
|
return describeComponentFrame("Suspense", null, null);
|
|
case 19:
|
|
return describeComponentFrame("SuspenseList", null, null);
|
|
case 0:
|
|
case 2:
|
|
case 15:
|
|
return describeFunctionComponentFrame(fiber.type, null);
|
|
case 11:
|
|
return describeFunctionComponentFrame(fiber.type.render, null);
|
|
case 1:
|
|
return (fiber = describeFunctionComponentFrame(fiber.type, null)), fiber;
|
|
default:
|
|
return "";
|
|
}
|
|
}
|
|
function getStackByFiberInDevAndProd(workInProgress) {
|
|
try {
|
|
var info = "";
|
|
do
|
|
(info += describeFiber(workInProgress)),
|
|
(workInProgress = workInProgress.return);
|
|
while (workInProgress);
|
|
return info;
|
|
} catch (x) {
|
|
return "\nError generating stack: " + x.message + "\n" + x.stack;
|
|
}
|
|
}
|
|
function resolveDefaultProps(Component, baseProps) {
|
|
if (Component && Component.defaultProps) {
|
|
baseProps = Object.assign({}, baseProps);
|
|
Component = Component.defaultProps;
|
|
for (var propName in Component)
|
|
void 0 === baseProps[propName] &&
|
|
(baseProps[propName] = Component[propName]);
|
|
return baseProps;
|
|
}
|
|
return baseProps;
|
|
}
|
|
var valueCursor = createCursor(null),
|
|
currentlyRenderingFiber = null,
|
|
lastContextDependency = null,
|
|
lastContextWithAllBitsObserved = null;
|
|
function resetContextDependencies() {
|
|
lastContextWithAllBitsObserved = lastContextDependency = currentlyRenderingFiber = null;
|
|
}
|
|
function popProvider(context) {
|
|
var currentValue = valueCursor.current;
|
|
pop(valueCursor);
|
|
context._currentValue = currentValue;
|
|
}
|
|
function scheduleWorkOnParentPath(parent, renderLanes) {
|
|
for (; null !== parent; ) {
|
|
var alternate = parent.alternate;
|
|
if ((parent.childLanes & renderLanes) === renderLanes)
|
|
if (
|
|
null === alternate ||
|
|
(alternate.childLanes & renderLanes) === renderLanes
|
|
)
|
|
break;
|
|
else alternate.childLanes |= renderLanes;
|
|
else
|
|
(parent.childLanes |= renderLanes),
|
|
null !== alternate && (alternate.childLanes |= renderLanes);
|
|
parent = parent.return;
|
|
}
|
|
}
|
|
function prepareToReadContext(workInProgress, renderLanes) {
|
|
currentlyRenderingFiber = workInProgress;
|
|
lastContextWithAllBitsObserved = lastContextDependency = null;
|
|
workInProgress = workInProgress.dependencies;
|
|
null !== workInProgress &&
|
|
null !== workInProgress.firstContext &&
|
|
(0 !== (workInProgress.lanes & renderLanes) && (didReceiveUpdate = !0),
|
|
(workInProgress.firstContext = null));
|
|
}
|
|
function readContext(context, observedBits) {
|
|
if (
|
|
lastContextWithAllBitsObserved !== context &&
|
|
!1 !== observedBits &&
|
|
0 !== observedBits
|
|
) {
|
|
if ("number" !== typeof observedBits || 1073741823 === observedBits)
|
|
(lastContextWithAllBitsObserved = context), (observedBits = 1073741823);
|
|
observedBits = { context: context, observedBits: observedBits, next: null };
|
|
if (null === lastContextDependency) {
|
|
if (null === currentlyRenderingFiber)
|
|
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 = observedBits;
|
|
currentlyRenderingFiber.dependencies = {
|
|
lanes: 0,
|
|
firstContext: observedBits,
|
|
responders: null
|
|
};
|
|
} else lastContextDependency = lastContextDependency.next = observedBits;
|
|
}
|
|
return context._currentValue;
|
|
}
|
|
var interleavedQueues = null,
|
|
hasForceUpdate = !1;
|
|
function initializeUpdateQueue(fiber) {
|
|
fiber.updateQueue = {
|
|
baseState: fiber.memoizedState,
|
|
firstBaseUpdate: null,
|
|
lastBaseUpdate: null,
|
|
shared: { pending: null, interleaved: null, lanes: 0 },
|
|
effects: 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,
|
|
effects: current.effects
|
|
});
|
|
}
|
|
function createUpdate(eventTime, lane) {
|
|
return {
|
|
eventTime: eventTime,
|
|
lane: lane,
|
|
tag: 0,
|
|
payload: null,
|
|
callback: null,
|
|
next: null
|
|
};
|
|
}
|
|
function enqueueUpdate(fiber, update) {
|
|
var updateQueue = fiber.updateQueue;
|
|
null !== updateQueue &&
|
|
((updateQueue = updateQueue.shared),
|
|
null !== workInProgressRoot && 0 !== (fiber.mode & 1)
|
|
? ((fiber = updateQueue.interleaved),
|
|
null === fiber
|
|
? ((update.next = update),
|
|
null === interleavedQueues
|
|
? (interleavedQueues = [updateQueue])
|
|
: interleavedQueues.push(updateQueue))
|
|
: ((update.next = fiber.next), (fiber.next = update)),
|
|
(updateQueue.interleaved = update))
|
|
: ((fiber = updateQueue.pending),
|
|
null === fiber
|
|
? (update.next = update)
|
|
: ((update.next = fiber.next), (fiber.next = update)),
|
|
(updateQueue.pending = update)));
|
|
}
|
|
function entangleTransitions(root, fiber, lane) {
|
|
fiber = fiber.updateQueue;
|
|
if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 8388096))) {
|
|
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 = {
|
|
eventTime: queue.eventTime,
|
|
lane: queue.lane,
|
|
tag: queue.tag,
|
|
payload: queue.payload,
|
|
callback: queue.callback,
|
|
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,
|
|
effects: current.effects
|
|
};
|
|
workInProgress.updateQueue = queue;
|
|
return;
|
|
}
|
|
workInProgress = queue.lastBaseUpdate;
|
|
null === workInProgress
|
|
? (queue.firstBaseUpdate = capturedUpdate)
|
|
: (workInProgress.next = capturedUpdate);
|
|
queue.lastBaseUpdate = capturedUpdate;
|
|
}
|
|
function processUpdateQueue(
|
|
workInProgress$jscomp$0,
|
|
props,
|
|
instance,
|
|
renderLanes
|
|
) {
|
|
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,
|
|
updateEventTime = pendingQueue.eventTime;
|
|
if ((renderLanes & updateLane) === updateLane) {
|
|
null !== current &&
|
|
(current = current.next = {
|
|
eventTime: updateEventTime,
|
|
lane: 0,
|
|
tag: pendingQueue.tag,
|
|
payload: pendingQueue.payload,
|
|
callback: pendingQueue.callback,
|
|
next: null
|
|
});
|
|
a: {
|
|
var workInProgress = workInProgress$jscomp$0,
|
|
update = pendingQueue;
|
|
updateLane = props;
|
|
updateEventTime = instance;
|
|
switch (update.tag) {
|
|
case 1:
|
|
workInProgress = update.payload;
|
|
if ("function" === typeof workInProgress) {
|
|
newState = workInProgress.call(
|
|
updateEventTime,
|
|
newState,
|
|
updateLane
|
|
);
|
|
break a;
|
|
}
|
|
newState = workInProgress;
|
|
break a;
|
|
case 3:
|
|
workInProgress.flags = (workInProgress.flags & -16385) | 128;
|
|
case 0:
|
|
workInProgress = update.payload;
|
|
updateLane =
|
|
"function" === typeof workInProgress
|
|
? workInProgress.call(updateEventTime, newState, updateLane)
|
|
: workInProgress;
|
|
if (null === updateLane || void 0 === updateLane) break a;
|
|
newState = Object.assign({}, newState, updateLane);
|
|
break a;
|
|
case 2:
|
|
hasForceUpdate = !0;
|
|
}
|
|
}
|
|
null !== pendingQueue.callback &&
|
|
((workInProgress$jscomp$0.flags |= 64),
|
|
(updateLane = queue.effects),
|
|
null === updateLane
|
|
? (queue.effects = [pendingQueue])
|
|
: updateLane.push(pendingQueue));
|
|
} else
|
|
(updateEventTime = {
|
|
eventTime: updateEventTime,
|
|
lane: updateLane,
|
|
tag: pendingQueue.tag,
|
|
payload: pendingQueue.payload,
|
|
callback: pendingQueue.callback,
|
|
next: null
|
|
}),
|
|
null === current
|
|
? ((firstPendingUpdate = current = updateEventTime),
|
|
(lastPendingUpdate = newState))
|
|
: (current = current.next = updateEventTime),
|
|
(lastBaseUpdate |= updateLane);
|
|
pendingQueue = pendingQueue.next;
|
|
if (null === pendingQueue)
|
|
if (((pendingQueue = queue.shared.pending), null === pendingQueue))
|
|
break;
|
|
else
|
|
(updateLane = pendingQueue),
|
|
(pendingQueue = updateLane.next),
|
|
(updateLane.next = null),
|
|
(queue.lastBaseUpdate = updateLane),
|
|
(queue.shared.pending = null);
|
|
} while (1);
|
|
null === current && (lastPendingUpdate = newState);
|
|
queue.baseState = lastPendingUpdate;
|
|
queue.firstBaseUpdate = firstPendingUpdate;
|
|
queue.lastBaseUpdate = current;
|
|
props = queue.shared.interleaved;
|
|
if (null !== props) {
|
|
queue = props;
|
|
do (lastBaseUpdate |= queue.lane), (queue = queue.next);
|
|
while (queue !== props);
|
|
} else null === firstBaseUpdate && (queue.shared.lanes = 0);
|
|
workInProgressRootSkippedLanes |= lastBaseUpdate;
|
|
workInProgress$jscomp$0.lanes = lastBaseUpdate;
|
|
workInProgress$jscomp$0.memoizedState = newState;
|
|
}
|
|
}
|
|
function commitUpdateQueue(finishedWork, finishedQueue, instance) {
|
|
finishedWork = finishedQueue.effects;
|
|
finishedQueue.effects = null;
|
|
if (null !== finishedWork)
|
|
for (
|
|
finishedQueue = 0;
|
|
finishedQueue < finishedWork.length;
|
|
finishedQueue++
|
|
) {
|
|
var effect = finishedWork[finishedQueue],
|
|
callback = effect.callback;
|
|
if (null !== callback) {
|
|
effect.callback = null;
|
|
if ("function" !== typeof callback)
|
|
throw Error(
|
|
"Invalid argument passed as callback. Expected a function. Instead received: " +
|
|
callback
|
|
);
|
|
callback.call(instance);
|
|
}
|
|
}
|
|
}
|
|
var emptyRefsObject = new React.Component().refs;
|
|
function applyDerivedStateFromProps(
|
|
workInProgress,
|
|
ctor,
|
|
getDerivedStateFromProps,
|
|
nextProps
|
|
) {
|
|
ctor = workInProgress.memoizedState;
|
|
getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor);
|
|
getDerivedStateFromProps =
|
|
null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps
|
|
? ctor
|
|
: Object.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 eventTime = requestEventTime(),
|
|
lane = requestUpdateLane(inst),
|
|
update = createUpdate(eventTime, lane);
|
|
update.payload = payload;
|
|
void 0 !== callback && null !== callback && (update.callback = callback);
|
|
enqueueUpdate(inst, update);
|
|
payload = scheduleUpdateOnFiber(inst, lane, eventTime);
|
|
null !== payload && entangleTransitions(payload, inst, lane);
|
|
},
|
|
enqueueReplaceState: function(inst, payload, callback) {
|
|
inst = inst._reactInternals;
|
|
var eventTime = requestEventTime(),
|
|
lane = requestUpdateLane(inst),
|
|
update = createUpdate(eventTime, lane);
|
|
update.tag = 1;
|
|
update.payload = payload;
|
|
void 0 !== callback && null !== callback && (update.callback = callback);
|
|
enqueueUpdate(inst, update);
|
|
payload = scheduleUpdateOnFiber(inst, lane, eventTime);
|
|
null !== payload && entangleTransitions(payload, inst, lane);
|
|
},
|
|
enqueueForceUpdate: function(inst, callback) {
|
|
inst = inst._reactInternals;
|
|
var eventTime = requestEventTime(),
|
|
lane = requestUpdateLane(inst),
|
|
update = createUpdate(eventTime, lane);
|
|
update.tag = 2;
|
|
void 0 !== callback && null !== callback && (update.callback = callback);
|
|
enqueueUpdate(inst, update);
|
|
callback = scheduleUpdateOnFiber(inst, lane, eventTime);
|
|
null !== callback && 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 constructClassInstance(workInProgress, ctor, props) {
|
|
var isLegacyContextConsumer = !1,
|
|
unmaskedContext = emptyContextObject;
|
|
var context = ctor.contextType;
|
|
"object" === typeof context && null !== context
|
|
? (context = readContext(context))
|
|
: ((unmaskedContext = isContextProvider(ctor)
|
|
? previousContext
|
|
: contextStackCursor.current),
|
|
(isLegacyContextConsumer = ctor.contextTypes),
|
|
(context = (isLegacyContextConsumer =
|
|
null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer)
|
|
? getMaskedContext(workInProgress, unmaskedContext)
|
|
: emptyContextObject));
|
|
ctor = new ctor(props, context);
|
|
workInProgress.memoizedState =
|
|
null !== ctor.state && void 0 !== ctor.state ? ctor.state : null;
|
|
ctor.updater = classComponentUpdater;
|
|
workInProgress.stateNode = ctor;
|
|
ctor._reactInternals = workInProgress;
|
|
isLegacyContextConsumer &&
|
|
((workInProgress = workInProgress.stateNode),
|
|
(workInProgress.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext),
|
|
(workInProgress.__reactInternalMemoizedMaskedChildContext = context));
|
|
return ctor;
|
|
}
|
|
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 mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
|
|
var instance = workInProgress.stateNode;
|
|
instance.props = newProps;
|
|
instance.state = workInProgress.memoizedState;
|
|
instance.refs = emptyRefsObject;
|
|
initializeUpdateQueue(workInProgress);
|
|
var contextType = ctor.contextType;
|
|
"object" === typeof contextType && null !== contextType
|
|
? (instance.context = readContext(contextType))
|
|
: ((contextType = isContextProvider(ctor)
|
|
? previousContext
|
|
: contextStackCursor.current),
|
|
(instance.context = getMaskedContext(workInProgress, contextType)));
|
|
processUpdateQueue(workInProgress, newProps, instance, renderLanes);
|
|
instance.state = workInProgress.memoizedState;
|
|
contextType = ctor.getDerivedStateFromProps;
|
|
"function" === typeof contextType &&
|
|
(applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps),
|
|
(instance.state = workInProgress.memoizedState));
|
|
"function" === typeof ctor.getDerivedStateFromProps ||
|
|
"function" === typeof instance.getSnapshotBeforeUpdate ||
|
|
("function" !== typeof instance.UNSAFE_componentWillMount &&
|
|
"function" !== typeof instance.componentWillMount) ||
|
|
((ctor = instance.state),
|
|
"function" === typeof instance.componentWillMount &&
|
|
instance.componentWillMount(),
|
|
"function" === typeof instance.UNSAFE_componentWillMount &&
|
|
instance.UNSAFE_componentWillMount(),
|
|
ctor !== instance.state &&
|
|
classComponentUpdater.enqueueReplaceState(instance, instance.state, null),
|
|
processUpdateQueue(workInProgress, newProps, instance, renderLanes),
|
|
(instance.state = workInProgress.memoizedState));
|
|
"function" === typeof instance.componentDidMount &&
|
|
(workInProgress.flags |= 4);
|
|
}
|
|
var isArray = Array.isArray;
|
|
function coerceRef(returnFiber, current, element) {
|
|
returnFiber = element.ref;
|
|
if (
|
|
null !== returnFiber &&
|
|
"function" !== typeof returnFiber &&
|
|
"object" !== typeof returnFiber
|
|
) {
|
|
if (element._owner) {
|
|
element = element._owner;
|
|
if (element) {
|
|
if (1 !== element.tag)
|
|
throw Error(
|
|
"Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref"
|
|
);
|
|
var inst = element.stateNode;
|
|
}
|
|
if (!inst)
|
|
throw Error(
|
|
"Missing owner for string ref " +
|
|
returnFiber +
|
|
". This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
var stringRef = "" + returnFiber;
|
|
if (
|
|
null !== current &&
|
|
null !== current.ref &&
|
|
"function" === typeof current.ref &&
|
|
current.ref._stringRef === stringRef
|
|
)
|
|
return current.ref;
|
|
current = function(value) {
|
|
var refs = inst.refs;
|
|
refs === emptyRefsObject && (refs = inst.refs = {});
|
|
null === value ? delete refs[stringRef] : (refs[stringRef] = value);
|
|
};
|
|
current._stringRef = stringRef;
|
|
return current;
|
|
}
|
|
if ("string" !== typeof returnFiber)
|
|
throw Error(
|
|
"Expected ref to be a function, a string, an object returned by React.createRef(), or null."
|
|
);
|
|
if (!element._owner)
|
|
throw Error(
|
|
"Element ref was specified as a string (" +
|
|
returnFiber +
|
|
") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information."
|
|
);
|
|
}
|
|
return returnFiber;
|
|
}
|
|
function throwOnInvalidObjectType(returnFiber, newChild) {
|
|
if ("textarea" !== returnFiber.type)
|
|
throw ((returnFiber = Object.prototype.toString.call(newChild)),
|
|
Error(
|
|
"Objects are not valid as a React child (found: " +
|
|
("[object Object]" === returnFiber
|
|
? "object with keys {" + Object.keys(newChild).join(", ") + "}"
|
|
: returnFiber) +
|
|
"). If you meant to render a collection of children, use an array instead."
|
|
));
|
|
}
|
|
function ChildReconciler(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(returnFiber, currentFirstChild) {
|
|
for (returnFiber = new Map(); null !== currentFirstChild; )
|
|
null !== currentFirstChild.key
|
|
? returnFiber.set(currentFirstChild.key, currentFirstChild)
|
|
: returnFiber.set(currentFirstChild.index, currentFirstChild),
|
|
(currentFirstChild = currentFirstChild.sibling);
|
|
return returnFiber;
|
|
}
|
|
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 lastPlacedIndex;
|
|
newIndex = newFiber.alternate;
|
|
if (null !== newIndex)
|
|
return (
|
|
(newIndex = newIndex.index),
|
|
newIndex < lastPlacedIndex
|
|
? ((newFiber.flags |= 2), lastPlacedIndex)
|
|
: newIndex
|
|
);
|
|
newFiber.flags |= 2;
|
|
return lastPlacedIndex;
|
|
}
|
|
function placeSingleChild(newFiber) {
|
|
shouldTrackSideEffects &&
|
|
null === newFiber.alternate &&
|
|
(newFiber.flags |= 2);
|
|
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)
|
|
return (
|
|
(lanes = useFiber(current, element.props)),
|
|
(lanes.ref = coerceRef(returnFiber, current, element)),
|
|
(lanes.return = returnFiber),
|
|
lanes
|
|
);
|
|
lanes = createFiberFromTypeAndProps(
|
|
element.type,
|
|
element.key,
|
|
element.props,
|
|
null,
|
|
returnFiber.mode,
|
|
lanes
|
|
);
|
|
lanes.ref = coerceRef(returnFiber, current, element);
|
|
lanes.return = returnFiber;
|
|
return lanes;
|
|
}
|
|
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 || "number" === 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
|
|
)),
|
|
(lanes.ref = coerceRef(returnFiber, null, newChild)),
|
|
(lanes.return = returnFiber),
|
|
lanes
|
|
);
|
|
case REACT_PORTAL_TYPE:
|
|
return (
|
|
(newChild = createFiberFromPortal(
|
|
newChild,
|
|
returnFiber.mode,
|
|
lanes
|
|
)),
|
|
(newChild.return = returnFiber),
|
|
newChild
|
|
);
|
|
}
|
|
if (isArray(newChild) || getIteratorFn(newChild))
|
|
return (
|
|
(newChild = createFiberFromFragment(
|
|
newChild,
|
|
returnFiber.mode,
|
|
lanes,
|
|
null
|
|
)),
|
|
(newChild.return = returnFiber),
|
|
newChild
|
|
);
|
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
}
|
|
return null;
|
|
}
|
|
function updateSlot(returnFiber, oldFiber, newChild, lanes) {
|
|
var key = null !== oldFiber ? oldFiber.key : null;
|
|
if ("string" === typeof newChild || "number" === 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;
|
|
}
|
|
if (isArray(newChild) || getIteratorFn(newChild))
|
|
return null !== key
|
|
? null
|
|
: updateFragment(returnFiber, oldFiber, newChild, lanes, null);
|
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
}
|
|
return null;
|
|
}
|
|
function updateFromMap(
|
|
existingChildren,
|
|
returnFiber,
|
|
newIdx,
|
|
newChild,
|
|
lanes
|
|
) {
|
|
if ("string" === typeof newChild || "number" === 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)
|
|
);
|
|
}
|
|
if (isArray(newChild) || getIteratorFn(newChild))
|
|
return (
|
|
(existingChildren = existingChildren.get(newIdx) || null),
|
|
updateFragment(returnFiber, existingChildren, newChild, lanes, null)
|
|
);
|
|
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;
|
|
}
|
|
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), 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));
|
|
return resultingFirstChild;
|
|
}
|
|
for (
|
|
oldFiber = mapRemainingChildren(returnFiber, 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);
|
|
});
|
|
return resultingFirstChild;
|
|
}
|
|
function reconcileChildrenIterator(
|
|
returnFiber,
|
|
currentFirstChild,
|
|
newChildrenIterable,
|
|
lanes
|
|
) {
|
|
var iteratorFn = getIteratorFn(newChildrenIterable);
|
|
if ("function" !== typeof iteratorFn)
|
|
throw Error(
|
|
"An object is not an iterable. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
newChildrenIterable = iteratorFn.call(newChildrenIterable);
|
|
if (null == newChildrenIterable)
|
|
throw Error("An iterable object provided no iterator.");
|
|
for (
|
|
var previousNewFiber = (iteratorFn = null),
|
|
oldFiber = currentFirstChild,
|
|
newIdx = (currentFirstChild = 0),
|
|
nextOldFiber = null,
|
|
step = newChildrenIterable.next();
|
|
null !== oldFiber && !step.done;
|
|
newIdx++, step = newChildrenIterable.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
|
|
? (iteratorFn = newFiber)
|
|
: (previousNewFiber.sibling = newFiber);
|
|
previousNewFiber = newFiber;
|
|
oldFiber = nextOldFiber;
|
|
}
|
|
if (step.done)
|
|
return deleteRemainingChildren(returnFiber, oldFiber), iteratorFn;
|
|
if (null === oldFiber) {
|
|
for (; !step.done; newIdx++, step = newChildrenIterable.next())
|
|
(step = createChild(returnFiber, step.value, lanes)),
|
|
null !== step &&
|
|
((currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
|
|
null === previousNewFiber
|
|
? (iteratorFn = step)
|
|
: (previousNewFiber.sibling = step),
|
|
(previousNewFiber = step));
|
|
return iteratorFn;
|
|
}
|
|
for (
|
|
oldFiber = mapRemainingChildren(returnFiber, oldFiber);
|
|
!step.done;
|
|
newIdx++, step = newChildrenIterable.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
|
|
? (iteratorFn = step)
|
|
: (previousNewFiber.sibling = step),
|
|
(previousNewFiber = step));
|
|
shouldTrackSideEffects &&
|
|
oldFiber.forEach(function(child) {
|
|
return deleteChild(returnFiber, child);
|
|
});
|
|
return iteratorFn;
|
|
}
|
|
return function(returnFiber, currentFirstChild, newChild, lanes) {
|
|
var isUnkeyedTopLevelFragment =
|
|
"object" === typeof newChild &&
|
|
null !== newChild &&
|
|
newChild.type === REACT_FRAGMENT_TYPE &&
|
|
null === newChild.key;
|
|
isUnkeyedTopLevelFragment && (newChild = newChild.props.children);
|
|
var isObject = "object" === typeof newChild && null !== newChild;
|
|
if (isObject)
|
|
switch (newChild.$$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
a: {
|
|
isObject = newChild.key;
|
|
for (
|
|
isUnkeyedTopLevelFragment = currentFirstChild;
|
|
null !== isUnkeyedTopLevelFragment;
|
|
|
|
) {
|
|
if (isUnkeyedTopLevelFragment.key === isObject) {
|
|
isObject = newChild.type;
|
|
if (isObject === REACT_FRAGMENT_TYPE) {
|
|
if (7 === isUnkeyedTopLevelFragment.tag) {
|
|
deleteRemainingChildren(
|
|
returnFiber,
|
|
isUnkeyedTopLevelFragment.sibling
|
|
);
|
|
currentFirstChild = useFiber(
|
|
isUnkeyedTopLevelFragment,
|
|
newChild.props.children
|
|
);
|
|
currentFirstChild.return = returnFiber;
|
|
returnFiber = currentFirstChild;
|
|
break a;
|
|
}
|
|
} else if (isUnkeyedTopLevelFragment.elementType === isObject) {
|
|
deleteRemainingChildren(
|
|
returnFiber,
|
|
isUnkeyedTopLevelFragment.sibling
|
|
);
|
|
currentFirstChild = useFiber(
|
|
isUnkeyedTopLevelFragment,
|
|
newChild.props
|
|
);
|
|
currentFirstChild.ref = coerceRef(
|
|
returnFiber,
|
|
isUnkeyedTopLevelFragment,
|
|
newChild
|
|
);
|
|
currentFirstChild.return = returnFiber;
|
|
returnFiber = currentFirstChild;
|
|
break a;
|
|
}
|
|
deleteRemainingChildren(returnFiber, isUnkeyedTopLevelFragment);
|
|
break;
|
|
} else deleteChild(returnFiber, isUnkeyedTopLevelFragment);
|
|
isUnkeyedTopLevelFragment = isUnkeyedTopLevelFragment.sibling;
|
|
}
|
|
newChild.type === REACT_FRAGMENT_TYPE
|
|
? ((currentFirstChild = createFiberFromFragment(
|
|
newChild.props.children,
|
|
returnFiber.mode,
|
|
lanes,
|
|
newChild.key
|
|
)),
|
|
(currentFirstChild.return = returnFiber),
|
|
(returnFiber = currentFirstChild))
|
|
: ((lanes = createFiberFromTypeAndProps(
|
|
newChild.type,
|
|
newChild.key,
|
|
newChild.props,
|
|
null,
|
|
returnFiber.mode,
|
|
lanes
|
|
)),
|
|
(lanes.ref = coerceRef(
|
|
returnFiber,
|
|
currentFirstChild,
|
|
newChild
|
|
)),
|
|
(lanes.return = returnFiber),
|
|
(returnFiber = lanes));
|
|
}
|
|
return placeSingleChild(returnFiber);
|
|
case REACT_PORTAL_TYPE:
|
|
a: {
|
|
for (
|
|
isUnkeyedTopLevelFragment = newChild.key;
|
|
null !== currentFirstChild;
|
|
|
|
) {
|
|
if (currentFirstChild.key === isUnkeyedTopLevelFragment)
|
|
if (
|
|
4 === currentFirstChild.tag &&
|
|
currentFirstChild.stateNode.containerInfo ===
|
|
newChild.containerInfo &&
|
|
currentFirstChild.stateNode.implementation ===
|
|
newChild.implementation
|
|
) {
|
|
deleteRemainingChildren(
|
|
returnFiber,
|
|
currentFirstChild.sibling
|
|
);
|
|
currentFirstChild = useFiber(
|
|
currentFirstChild,
|
|
newChild.children || []
|
|
);
|
|
currentFirstChild.return = returnFiber;
|
|
returnFiber = currentFirstChild;
|
|
break a;
|
|
} else {
|
|
deleteRemainingChildren(returnFiber, currentFirstChild);
|
|
break;
|
|
}
|
|
else deleteChild(returnFiber, currentFirstChild);
|
|
currentFirstChild = currentFirstChild.sibling;
|
|
}
|
|
currentFirstChild = createFiberFromPortal(
|
|
newChild,
|
|
returnFiber.mode,
|
|
lanes
|
|
);
|
|
currentFirstChild.return = returnFiber;
|
|
returnFiber = currentFirstChild;
|
|
}
|
|
return placeSingleChild(returnFiber);
|
|
}
|
|
if ("string" === typeof newChild || "number" === typeof newChild)
|
|
return (
|
|
(newChild = "" + newChild),
|
|
null !== currentFirstChild && 6 === currentFirstChild.tag
|
|
? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),
|
|
(currentFirstChild = useFiber(currentFirstChild, newChild)),
|
|
(currentFirstChild.return = returnFiber),
|
|
(returnFiber = currentFirstChild))
|
|
: (deleteRemainingChildren(returnFiber, currentFirstChild),
|
|
(currentFirstChild = createFiberFromText(
|
|
newChild,
|
|
returnFiber.mode,
|
|
lanes
|
|
)),
|
|
(currentFirstChild.return = returnFiber),
|
|
(returnFiber = currentFirstChild)),
|
|
placeSingleChild(returnFiber)
|
|
);
|
|
if (isArray(newChild))
|
|
return reconcileChildrenArray(
|
|
returnFiber,
|
|
currentFirstChild,
|
|
newChild,
|
|
lanes
|
|
);
|
|
if (getIteratorFn(newChild))
|
|
return reconcileChildrenIterator(
|
|
returnFiber,
|
|
currentFirstChild,
|
|
newChild,
|
|
lanes
|
|
);
|
|
isObject && throwOnInvalidObjectType(returnFiber, newChild);
|
|
if ("undefined" === typeof newChild && !isUnkeyedTopLevelFragment)
|
|
switch (returnFiber.tag) {
|
|
case 1:
|
|
case 0:
|
|
case 11:
|
|
case 15:
|
|
throw Error(
|
|
(getComponentName(returnFiber.type) || "Component") +
|
|
"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null."
|
|
);
|
|
}
|
|
return deleteRemainingChildren(returnFiber, currentFirstChild);
|
|
};
|
|
}
|
|
var reconcileChildFibers = ChildReconciler(!0),
|
|
mountChildFibers = ChildReconciler(!1),
|
|
NO_CONTEXT = {},
|
|
contextStackCursor$1 = createCursor(NO_CONTEXT),
|
|
contextFiberStackCursor = createCursor(NO_CONTEXT),
|
|
rootInstanceStackCursor = createCursor(NO_CONTEXT);
|
|
function requiredContext(c) {
|
|
if (c === NO_CONTEXT)
|
|
throw Error(
|
|
"Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
return c;
|
|
}
|
|
function pushHostContainer(fiber, nextRootInstance) {
|
|
push(rootInstanceStackCursor, nextRootInstance);
|
|
push(contextFiberStackCursor, fiber);
|
|
push(contextStackCursor$1, NO_CONTEXT);
|
|
pop(contextStackCursor$1);
|
|
push(contextStackCursor$1, { isInAParentText: !1 });
|
|
}
|
|
function popHostContainer() {
|
|
pop(contextStackCursor$1);
|
|
pop(contextFiberStackCursor);
|
|
pop(rootInstanceStackCursor);
|
|
}
|
|
function pushHostContext(fiber) {
|
|
requiredContext(rootInstanceStackCursor.current);
|
|
var context = requiredContext(contextStackCursor$1.current);
|
|
var JSCompiler_inline_result = fiber.type;
|
|
JSCompiler_inline_result =
|
|
"AndroidTextInput" === JSCompiler_inline_result ||
|
|
"RCTMultilineTextInputView" === JSCompiler_inline_result ||
|
|
"RCTSinglelineTextInputView" === JSCompiler_inline_result ||
|
|
"RCTText" === JSCompiler_inline_result ||
|
|
"RCTVirtualText" === JSCompiler_inline_result;
|
|
JSCompiler_inline_result =
|
|
context.isInAParentText !== JSCompiler_inline_result
|
|
? { isInAParentText: JSCompiler_inline_result }
|
|
: context;
|
|
context !== JSCompiler_inline_result &&
|
|
(push(contextFiberStackCursor, fiber),
|
|
push(contextStackCursor$1, JSCompiler_inline_result));
|
|
}
|
|
function popHostContext(fiber) {
|
|
contextFiberStackCursor.current === fiber &&
|
|
(pop(contextStackCursor$1), pop(contextFiberStackCursor));
|
|
}
|
|
var suspenseStackCursor = createCursor(0);
|
|
function findFirstSuspended(row) {
|
|
for (var node = row; null !== node; ) {
|
|
if (13 === node.tag) {
|
|
var state = node.memoizedState;
|
|
if (null !== state && (null === state.dehydrated || shim() || shim()))
|
|
return node;
|
|
} else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) {
|
|
if (0 !== (node.flags & 128)) return node;
|
|
} else if (null !== node.child) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === row) break;
|
|
for (; null === node.sibling; ) {
|
|
if (null === node.return || node.return === row) return null;
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
return null;
|
|
}
|
|
var workInProgressSources = [];
|
|
function resetWorkInProgressVersions() {
|
|
for (var i = 0; i < workInProgressSources.length; i++)
|
|
workInProgressSources[i]._workInProgressVersionPrimary = null;
|
|
workInProgressSources.length = 0;
|
|
}
|
|
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
|
|
ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig,
|
|
renderLanes = 0,
|
|
currentlyRenderingFiber$1 = null,
|
|
currentHook = null,
|
|
workInProgressHook = null,
|
|
didScheduleRenderPhaseUpdate = !1,
|
|
didScheduleRenderPhaseUpdateDuringThisPass = !1;
|
|
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://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."
|
|
);
|
|
}
|
|
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 renderWithHooks(
|
|
current,
|
|
workInProgress,
|
|
Component,
|
|
props,
|
|
secondArg,
|
|
nextRenderLanes
|
|
) {
|
|
renderLanes = nextRenderLanes;
|
|
currentlyRenderingFiber$1 = workInProgress;
|
|
workInProgress.memoizedState = null;
|
|
workInProgress.updateQueue = null;
|
|
workInProgress.lanes = 0;
|
|
ReactCurrentDispatcher$1.current =
|
|
null === current || null === current.memoizedState
|
|
? HooksDispatcherOnMount
|
|
: HooksDispatcherOnUpdate;
|
|
current = Component(props, secondArg);
|
|
if (didScheduleRenderPhaseUpdateDuringThisPass) {
|
|
nextRenderLanes = 0;
|
|
do {
|
|
didScheduleRenderPhaseUpdateDuringThisPass = !1;
|
|
if (!(25 > nextRenderLanes))
|
|
throw Error(
|
|
"Too many re-renders. React limits the number of renders to prevent an infinite loop."
|
|
);
|
|
nextRenderLanes += 1;
|
|
workInProgressHook = currentHook = null;
|
|
workInProgress.updateQueue = null;
|
|
ReactCurrentDispatcher$1.current = HooksDispatcherOnRerender;
|
|
current = Component(props, secondArg);
|
|
} while (didScheduleRenderPhaseUpdateDuringThisPass);
|
|
}
|
|
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
|
workInProgress = null !== currentHook && null !== currentHook.next;
|
|
renderLanes = 0;
|
|
workInProgressHook = currentHook = currentlyRenderingFiber$1 = null;
|
|
didScheduleRenderPhaseUpdate = !1;
|
|
if (workInProgress)
|
|
throw Error(
|
|
"Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
|
|
);
|
|
return current;
|
|
}
|
|
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)
|
|
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 basicStateReducer(state, action) {
|
|
return "function" === typeof action ? action(state) : action;
|
|
}
|
|
function updateReducer(reducer) {
|
|
var hook = updateWorkInProgressHook(),
|
|
queue = hook.queue;
|
|
if (null === queue)
|
|
throw Error(
|
|
"Should have a queue. This is likely a bug in React. Please file an issue."
|
|
);
|
|
queue.lastRenderedReducer = reducer;
|
|
var current = currentHook,
|
|
baseQueue = current.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;
|
|
}
|
|
if (null !== baseQueue) {
|
|
pendingQueue = baseQueue.next;
|
|
current = current.baseState;
|
|
var newBaseQueueFirst = (baseFirst = null),
|
|
newBaseQueueLast = null,
|
|
update = pendingQueue;
|
|
do {
|
|
var updateLane = update.lane;
|
|
if ((renderLanes & updateLane) === updateLane)
|
|
null !== newBaseQueueLast &&
|
|
(newBaseQueueLast = newBaseQueueLast.next = {
|
|
lane: 0,
|
|
action: update.action,
|
|
eagerReducer: update.eagerReducer,
|
|
eagerState: update.eagerState,
|
|
next: null
|
|
}),
|
|
(current =
|
|
update.eagerReducer === reducer
|
|
? update.eagerState
|
|
: reducer(current, update.action));
|
|
else {
|
|
var clone = {
|
|
lane: updateLane,
|
|
action: update.action,
|
|
eagerReducer: update.eagerReducer,
|
|
eagerState: update.eagerState,
|
|
next: null
|
|
};
|
|
null === newBaseQueueLast
|
|
? ((newBaseQueueFirst = newBaseQueueLast = clone),
|
|
(baseFirst = current))
|
|
: (newBaseQueueLast = newBaseQueueLast.next = clone);
|
|
currentlyRenderingFiber$1.lanes |= updateLane;
|
|
workInProgressRootSkippedLanes |= updateLane;
|
|
}
|
|
update = update.next;
|
|
} while (null !== update && update !== pendingQueue);
|
|
null === newBaseQueueLast
|
|
? (baseFirst = current)
|
|
: (newBaseQueueLast.next = newBaseQueueFirst);
|
|
objectIs(current, hook.memoizedState) || (didReceiveUpdate = !0);
|
|
hook.memoizedState = current;
|
|
hook.baseState = baseFirst;
|
|
hook.baseQueue = newBaseQueueLast;
|
|
queue.lastRenderedState = current;
|
|
}
|
|
reducer = queue.interleaved;
|
|
if (null !== reducer) {
|
|
baseQueue = reducer;
|
|
do
|
|
(pendingQueue = baseQueue.lane),
|
|
(currentlyRenderingFiber$1.lanes |= pendingQueue),
|
|
(workInProgressRootSkippedLanes |= pendingQueue),
|
|
(baseQueue = baseQueue.next);
|
|
while (baseQueue !== reducer);
|
|
} else null === baseQueue && (queue.lanes = 0);
|
|
return [hook.memoizedState, queue.dispatch];
|
|
}
|
|
function rerenderReducer(reducer) {
|
|
var hook = updateWorkInProgressHook(),
|
|
queue = hook.queue;
|
|
if (null === queue)
|
|
throw Error(
|
|
"Should have a queue. This is likely a bug in React. Please file an issue."
|
|
);
|
|
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 readFromUnsubcribedMutableSource(root, source, getSnapshot) {
|
|
var getVersion = source._getVersion;
|
|
getVersion = getVersion(source._source);
|
|
var JSCompiler_inline_result = source._workInProgressVersionPrimary;
|
|
if (null !== JSCompiler_inline_result)
|
|
root = JSCompiler_inline_result === getVersion;
|
|
else if (
|
|
((root = root.mutableReadLanes), (root = (renderLanes & root) === root))
|
|
)
|
|
(source._workInProgressVersionPrimary = getVersion),
|
|
workInProgressSources.push(source);
|
|
if (root) return getSnapshot(source._source);
|
|
workInProgressSources.push(source);
|
|
throw Error(
|
|
"Cannot read from mutable source during the current render without tearing. This may be a bug in React. Please file an issue."
|
|
);
|
|
}
|
|
function useMutableSource(hook, source, getSnapshot, subscribe) {
|
|
var root = workInProgressRoot;
|
|
if (null === root)
|
|
throw Error(
|
|
"Expected a work-in-progress root. This is a bug in React. Please file an issue."
|
|
);
|
|
var getVersion = source._getVersion,
|
|
version = getVersion(source._source),
|
|
dispatcher = ReactCurrentDispatcher$1.current,
|
|
_dispatcher$useState = dispatcher.useState(function() {
|
|
return readFromUnsubcribedMutableSource(root, source, getSnapshot);
|
|
}),
|
|
setSnapshot = _dispatcher$useState[1],
|
|
snapshot = _dispatcher$useState[0];
|
|
_dispatcher$useState = workInProgressHook;
|
|
var memoizedState = hook.memoizedState,
|
|
refs = memoizedState.refs,
|
|
prevGetSnapshot = refs.getSnapshot,
|
|
prevSource = memoizedState.source;
|
|
memoizedState = memoizedState.subscribe;
|
|
var fiber = currentlyRenderingFiber$1;
|
|
hook.memoizedState = { refs: refs, source: source, subscribe: subscribe };
|
|
dispatcher.useEffect(
|
|
function() {
|
|
refs.getSnapshot = getSnapshot;
|
|
refs.setSnapshot = setSnapshot;
|
|
var maybeNewVersion = getVersion(source._source);
|
|
objectIs(version, maybeNewVersion) ||
|
|
((maybeNewVersion = getSnapshot(source._source)),
|
|
objectIs(snapshot, maybeNewVersion) ||
|
|
(setSnapshot(maybeNewVersion),
|
|
(maybeNewVersion = requestUpdateLane(fiber)),
|
|
(root.mutableReadLanes |= maybeNewVersion & root.pendingLanes)),
|
|
markRootEntangled(root, root.mutableReadLanes));
|
|
},
|
|
[getSnapshot, source, subscribe]
|
|
);
|
|
dispatcher.useEffect(
|
|
function() {
|
|
return subscribe(source._source, function() {
|
|
var latestGetSnapshot = refs.getSnapshot,
|
|
latestSetSnapshot = refs.setSnapshot;
|
|
try {
|
|
latestSetSnapshot(latestGetSnapshot(source._source));
|
|
var lane = requestUpdateLane(fiber);
|
|
root.mutableReadLanes |= lane & root.pendingLanes;
|
|
} catch (error) {
|
|
latestSetSnapshot(function() {
|
|
throw error;
|
|
});
|
|
}
|
|
});
|
|
},
|
|
[source, subscribe]
|
|
);
|
|
(objectIs(prevGetSnapshot, getSnapshot) &&
|
|
objectIs(prevSource, source) &&
|
|
objectIs(memoizedState, subscribe)) ||
|
|
((hook = {
|
|
pending: null,
|
|
interleaved: null,
|
|
lanes: 0,
|
|
dispatch: null,
|
|
lastRenderedReducer: basicStateReducer,
|
|
lastRenderedState: snapshot
|
|
}),
|
|
(hook.dispatch = setSnapshot = dispatchAction.bind(
|
|
null,
|
|
currentlyRenderingFiber$1,
|
|
hook
|
|
)),
|
|
(_dispatcher$useState.queue = hook),
|
|
(_dispatcher$useState.baseQueue = null),
|
|
(snapshot = readFromUnsubcribedMutableSource(root, source, getSnapshot)),
|
|
(_dispatcher$useState.memoizedState = _dispatcher$useState.baseState = snapshot));
|
|
return snapshot;
|
|
}
|
|
function updateMutableSource(source, getSnapshot, subscribe) {
|
|
var hook = updateWorkInProgressHook();
|
|
return useMutableSource(hook, source, getSnapshot, subscribe);
|
|
}
|
|
function mountState(initialState) {
|
|
var hook = mountWorkInProgressHook();
|
|
"function" === typeof initialState && (initialState = initialState());
|
|
hook.memoizedState = hook.baseState = initialState;
|
|
initialState = hook.queue = {
|
|
pending: null,
|
|
interleaved: null,
|
|
lanes: 0,
|
|
dispatch: null,
|
|
lastRenderedReducer: basicStateReducer,
|
|
lastRenderedState: initialState
|
|
};
|
|
initialState = initialState.dispatch = dispatchAction.bind(
|
|
null,
|
|
currentlyRenderingFiber$1,
|
|
initialState
|
|
);
|
|
return [hook.memoizedState, initialState];
|
|
}
|
|
function pushEffect(tag, create, destroy, deps) {
|
|
tag = { tag: tag, create: create, destroy: destroy, deps: deps, next: null };
|
|
create = currentlyRenderingFiber$1.updateQueue;
|
|
null === create
|
|
? ((create = { lastEffect: null }),
|
|
(currentlyRenderingFiber$1.updateQueue = create),
|
|
(create.lastEffect = tag.next = tag))
|
|
: ((destroy = create.lastEffect),
|
|
null === destroy
|
|
? (create.lastEffect = tag.next = tag)
|
|
: ((deps = destroy.next),
|
|
(destroy.next = tag),
|
|
(tag.next = deps),
|
|
(create.lastEffect = tag)));
|
|
return tag;
|
|
}
|
|
function updateRef() {
|
|
return updateWorkInProgressHook().memoizedState;
|
|
}
|
|
function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
|
|
var hook = mountWorkInProgressHook();
|
|
currentlyRenderingFiber$1.flags |= fiberFlags;
|
|
hook.memoizedState = pushEffect(
|
|
1 | hookFlags,
|
|
create,
|
|
void 0,
|
|
void 0 === deps ? null : deps
|
|
);
|
|
}
|
|
function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
|
|
var hook = updateWorkInProgressHook();
|
|
deps = void 0 === deps ? null : deps;
|
|
var destroy = void 0;
|
|
if (null !== currentHook) {
|
|
var prevEffect = currentHook.memoizedState;
|
|
destroy = prevEffect.destroy;
|
|
if (null !== deps && areHookInputsEqual(deps, prevEffect.deps)) {
|
|
hook.memoizedState = pushEffect(hookFlags, create, destroy, deps);
|
|
return;
|
|
}
|
|
}
|
|
currentlyRenderingFiber$1.flags |= fiberFlags;
|
|
hook.memoizedState = pushEffect(1 | hookFlags, create, destroy, deps);
|
|
}
|
|
function mountEffect(create, deps) {
|
|
return mountEffectImpl(132096, 4, create, deps);
|
|
}
|
|
function updateEffect(create, deps) {
|
|
return updateEffectImpl(1024, 4, create, deps);
|
|
}
|
|
function updateLayoutEffect(create, deps) {
|
|
return updateEffectImpl(4, 2, create, deps);
|
|
}
|
|
function imperativeHandleEffect(create, ref) {
|
|
if ("function" === typeof ref)
|
|
return (
|
|
(create = create()),
|
|
ref(create),
|
|
function() {
|
|
ref(null);
|
|
}
|
|
);
|
|
if (null !== ref && void 0 !== ref)
|
|
return (
|
|
(create = create()),
|
|
(ref.current = create),
|
|
function() {
|
|
ref.current = null;
|
|
}
|
|
);
|
|
}
|
|
function updateImperativeHandle(ref, create, deps) {
|
|
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
|
|
return updateEffectImpl(
|
|
4,
|
|
2,
|
|
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 !== prevState &&
|
|
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 !== prevState &&
|
|
null !== deps &&
|
|
areHookInputsEqual(deps, prevState[1])
|
|
)
|
|
return prevState[0];
|
|
nextCreate = nextCreate();
|
|
hook.memoizedState = [nextCreate, deps];
|
|
return nextCreate;
|
|
}
|
|
function startTransition(setPending, callback) {
|
|
var priorityLevel = getCurrentPriorityLevel();
|
|
runWithPriority(98 > priorityLevel ? 98 : priorityLevel, function() {
|
|
setPending(!0);
|
|
});
|
|
runWithPriority(97 < priorityLevel ? 97 : priorityLevel, function() {
|
|
var prevTransition = ReactCurrentBatchConfig$1.transition;
|
|
ReactCurrentBatchConfig$1.transition = 1;
|
|
try {
|
|
setPending(!1), callback();
|
|
} finally {
|
|
ReactCurrentBatchConfig$1.transition = prevTransition;
|
|
}
|
|
});
|
|
}
|
|
function dispatchAction(fiber, queue, action) {
|
|
var eventTime = requestEventTime(),
|
|
lane = requestUpdateLane(fiber),
|
|
update = {
|
|
lane: lane,
|
|
action: action,
|
|
eagerReducer: null,
|
|
eagerState: null,
|
|
next: null
|
|
},
|
|
alternate = fiber.alternate;
|
|
if (
|
|
fiber === currentlyRenderingFiber$1 ||
|
|
(null !== alternate && alternate === currentlyRenderingFiber$1)
|
|
)
|
|
(didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = !0),
|
|
(lane = queue.pending),
|
|
null === lane
|
|
? (update.next = update)
|
|
: ((update.next = lane.next), (lane.next = update)),
|
|
(queue.pending = update);
|
|
else {
|
|
if (null !== workInProgressRoot && 0 !== (fiber.mode & 1)) {
|
|
var interleaved = queue.interleaved;
|
|
null === interleaved
|
|
? ((update.next = update),
|
|
null === interleavedQueues
|
|
? (interleavedQueues = [queue])
|
|
: interleavedQueues.push(queue))
|
|
: ((update.next = interleaved.next), (interleaved.next = update));
|
|
queue.interleaved = update;
|
|
} else
|
|
(interleaved = queue.pending),
|
|
null === interleaved
|
|
? (update.next = update)
|
|
: ((update.next = interleaved.next), (interleaved.next = update)),
|
|
(queue.pending = update);
|
|
if (
|
|
0 === fiber.lanes &&
|
|
(null === alternate || 0 === alternate.lanes) &&
|
|
((alternate = queue.lastRenderedReducer), null !== alternate)
|
|
)
|
|
try {
|
|
var currentState = queue.lastRenderedState,
|
|
eagerState = alternate(currentState, action);
|
|
update.eagerReducer = alternate;
|
|
update.eagerState = eagerState;
|
|
if (objectIs(eagerState, currentState)) return;
|
|
} catch (error) {
|
|
} finally {
|
|
}
|
|
update = scheduleUpdateOnFiber(fiber, lane, eventTime);
|
|
0 !== (lane & 8388096) &&
|
|
null !== update &&
|
|
((fiber = queue.lanes),
|
|
(fiber &= update.pendingLanes),
|
|
(lane |= fiber),
|
|
(queue.lanes = lane),
|
|
markRootEntangled(update, lane));
|
|
}
|
|
}
|
|
var ContextOnlyDispatcher = {
|
|
readContext: readContext,
|
|
useCallback: throwInvalidHookError,
|
|
useContext: throwInvalidHookError,
|
|
useEffect: throwInvalidHookError,
|
|
useImperativeHandle: throwInvalidHookError,
|
|
useLayoutEffect: throwInvalidHookError,
|
|
useMemo: throwInvalidHookError,
|
|
useReducer: throwInvalidHookError,
|
|
useRef: throwInvalidHookError,
|
|
useState: throwInvalidHookError,
|
|
useDebugValue: throwInvalidHookError,
|
|
useDeferredValue: throwInvalidHookError,
|
|
useTransition: throwInvalidHookError,
|
|
useMutableSource: throwInvalidHookError,
|
|
useOpaqueIdentifier: throwInvalidHookError,
|
|
unstable_isNewReconciler: !1
|
|
},
|
|
HooksDispatcherOnMount = {
|
|
readContext: readContext,
|
|
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;
|
|
return mountEffectImpl(
|
|
4,
|
|
2,
|
|
imperativeHandleEffect.bind(null, create, ref),
|
|
deps
|
|
);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
return mountEffectImpl(4, 2, create, deps);
|
|
},
|
|
useMemo: function(nextCreate, deps) {
|
|
var hook = mountWorkInProgressHook();
|
|
deps = void 0 === deps ? null : deps;
|
|
nextCreate = nextCreate();
|
|
hook.memoizedState = [nextCreate, deps];
|
|
return nextCreate;
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
var hook = mountWorkInProgressHook();
|
|
initialArg = void 0 !== init ? init(initialArg) : initialArg;
|
|
hook.memoizedState = hook.baseState = initialArg;
|
|
reducer = hook.queue = {
|
|
pending: null,
|
|
interleaved: null,
|
|
lanes: 0,
|
|
dispatch: null,
|
|
lastRenderedReducer: reducer,
|
|
lastRenderedState: initialArg
|
|
};
|
|
reducer = reducer.dispatch = dispatchAction.bind(
|
|
null,
|
|
currentlyRenderingFiber$1,
|
|
reducer
|
|
);
|
|
return [hook.memoizedState, reducer];
|
|
},
|
|
useRef: function(initialValue) {
|
|
var hook = mountWorkInProgressHook();
|
|
initialValue = { current: initialValue };
|
|
return (hook.memoizedState = initialValue);
|
|
},
|
|
useState: mountState,
|
|
useDebugValue: mountDebugValue,
|
|
useDeferredValue: function(value) {
|
|
var _mountState = mountState(value),
|
|
prevValue = _mountState[0],
|
|
setValue = _mountState[1];
|
|
mountEffect(
|
|
function() {
|
|
var prevTransition = ReactCurrentBatchConfig$1.transition;
|
|
ReactCurrentBatchConfig$1.transition = 1;
|
|
try {
|
|
setValue(value);
|
|
} finally {
|
|
ReactCurrentBatchConfig$1.transition = prevTransition;
|
|
}
|
|
},
|
|
[value]
|
|
);
|
|
return prevValue;
|
|
},
|
|
useTransition: function() {
|
|
var _mountState2 = mountState(!1),
|
|
isPending = _mountState2[0];
|
|
_mountState2 = startTransition.bind(null, _mountState2[1]);
|
|
mountWorkInProgressHook().memoizedState = _mountState2;
|
|
return [_mountState2, isPending];
|
|
},
|
|
useMutableSource: function(source, getSnapshot, subscribe) {
|
|
var hook = mountWorkInProgressHook();
|
|
hook.memoizedState = {
|
|
refs: { getSnapshot: getSnapshot, setSnapshot: null },
|
|
source: source,
|
|
subscribe: subscribe
|
|
};
|
|
return useMutableSource(hook, source, getSnapshot, subscribe);
|
|
},
|
|
useOpaqueIdentifier: function() {
|
|
throw Error("Not yet implemented");
|
|
},
|
|
unstable_isNewReconciler: !1
|
|
},
|
|
HooksDispatcherOnUpdate = {
|
|
readContext: readContext,
|
|
useCallback: updateCallback,
|
|
useContext: readContext,
|
|
useEffect: updateEffect,
|
|
useImperativeHandle: updateImperativeHandle,
|
|
useLayoutEffect: updateLayoutEffect,
|
|
useMemo: updateMemo,
|
|
useReducer: updateReducer,
|
|
useRef: updateRef,
|
|
useState: function() {
|
|
return updateReducer(basicStateReducer);
|
|
},
|
|
useDebugValue: mountDebugValue,
|
|
useDeferredValue: function(value) {
|
|
var _updateState = updateReducer(basicStateReducer),
|
|
prevValue = _updateState[0],
|
|
setValue = _updateState[1];
|
|
updateEffect(
|
|
function() {
|
|
var prevTransition = ReactCurrentBatchConfig$1.transition;
|
|
ReactCurrentBatchConfig$1.transition = 1;
|
|
try {
|
|
setValue(value);
|
|
} finally {
|
|
ReactCurrentBatchConfig$1.transition = prevTransition;
|
|
}
|
|
},
|
|
[value]
|
|
);
|
|
return prevValue;
|
|
},
|
|
useTransition: function() {
|
|
var isPending = updateReducer(basicStateReducer)[0];
|
|
return [updateWorkInProgressHook().memoizedState, isPending];
|
|
},
|
|
useMutableSource: updateMutableSource,
|
|
useOpaqueIdentifier: function() {
|
|
return updateReducer(basicStateReducer)[0];
|
|
},
|
|
unstable_isNewReconciler: !1
|
|
},
|
|
HooksDispatcherOnRerender = {
|
|
readContext: readContext,
|
|
useCallback: updateCallback,
|
|
useContext: readContext,
|
|
useEffect: updateEffect,
|
|
useImperativeHandle: updateImperativeHandle,
|
|
useLayoutEffect: updateLayoutEffect,
|
|
useMemo: updateMemo,
|
|
useReducer: rerenderReducer,
|
|
useRef: updateRef,
|
|
useState: function() {
|
|
return rerenderReducer(basicStateReducer);
|
|
},
|
|
useDebugValue: mountDebugValue,
|
|
useDeferredValue: function(value) {
|
|
var _rerenderState = rerenderReducer(basicStateReducer),
|
|
prevValue = _rerenderState[0],
|
|
setValue = _rerenderState[1];
|
|
updateEffect(
|
|
function() {
|
|
var prevTransition = ReactCurrentBatchConfig$1.transition;
|
|
ReactCurrentBatchConfig$1.transition = 1;
|
|
try {
|
|
setValue(value);
|
|
} finally {
|
|
ReactCurrentBatchConfig$1.transition = prevTransition;
|
|
}
|
|
},
|
|
[value]
|
|
);
|
|
return prevValue;
|
|
},
|
|
useTransition: function() {
|
|
var isPending = rerenderReducer(basicStateReducer)[0];
|
|
return [updateWorkInProgressHook().memoizedState, isPending];
|
|
},
|
|
useMutableSource: updateMutableSource,
|
|
useOpaqueIdentifier: function() {
|
|
return rerenderReducer(basicStateReducer)[0];
|
|
},
|
|
unstable_isNewReconciler: !1
|
|
},
|
|
now$1 = Scheduler.unstable_now,
|
|
commitTime = 0,
|
|
profilerStartTime = -1;
|
|
function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
|
|
if (0 <= profilerStartTime) {
|
|
var elapsedTime = now$1() - profilerStartTime;
|
|
fiber.actualDuration += elapsedTime;
|
|
overrideBaseTime && (fiber.selfBaseDuration = elapsedTime);
|
|
profilerStartTime = -1;
|
|
}
|
|
}
|
|
function transferActualDuration(fiber) {
|
|
for (var child = fiber.child; child; )
|
|
(fiber.actualDuration += child.actualDuration), (child = child.sibling);
|
|
}
|
|
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner,
|
|
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;
|
|
prepareToReadContext(workInProgress, renderLanes);
|
|
nextProps = renderWithHooks(
|
|
current,
|
|
workInProgress,
|
|
Component,
|
|
nextProps,
|
|
ref,
|
|
renderLanes
|
|
);
|
|
if (null !== current && !didReceiveUpdate)
|
|
return (
|
|
(workInProgress.updateQueue = current.updateQueue),
|
|
(workInProgress.flags &= -1029),
|
|
(current.lanes &= ~renderLanes),
|
|
bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
|
|
);
|
|
workInProgress.flags |= 1;
|
|
reconcileChildren(current, workInProgress, nextProps, renderLanes);
|
|
return workInProgress.child;
|
|
}
|
|
function updateMemoComponent(
|
|
current,
|
|
workInProgress,
|
|
Component,
|
|
nextProps,
|
|
updateLanes,
|
|
renderLanes
|
|
) {
|
|
if (null === current) {
|
|
var type = Component.type;
|
|
if (
|
|
"function" === typeof type &&
|
|
!shouldConstruct(type) &&
|
|
void 0 === type.defaultProps &&
|
|
null === Component.compare &&
|
|
void 0 === Component.defaultProps
|
|
)
|
|
return (
|
|
(workInProgress.tag = 15),
|
|
(workInProgress.type = type),
|
|
updateSimpleMemoComponent(
|
|
current,
|
|
workInProgress,
|
|
type,
|
|
nextProps,
|
|
updateLanes,
|
|
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 (
|
|
0 === (updateLanes & renderLanes) &&
|
|
((updateLanes = type.memoizedProps),
|
|
(Component = Component.compare),
|
|
(Component = null !== Component ? Component : shallowEqual),
|
|
Component(updateLanes, 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,
|
|
updateLanes,
|
|
renderLanes
|
|
) {
|
|
if (
|
|
null !== current &&
|
|
shallowEqual(current.memoizedProps, nextProps) &&
|
|
current.ref === workInProgress.ref
|
|
) {
|
|
didReceiveUpdate = !1;
|
|
if (0 === (renderLanes & updateLanes))
|
|
return (
|
|
(workInProgress.lanes = current.lanes),
|
|
bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
|
|
);
|
|
0 !== (current.flags & 65536) && (didReceiveUpdate = !0);
|
|
}
|
|
return updateFunctionComponent(
|
|
current,
|
|
workInProgress,
|
|
Component,
|
|
nextProps,
|
|
renderLanes
|
|
);
|
|
}
|
|
function updateOffscreenComponent(current, workInProgress, renderLanes) {
|
|
var nextProps = workInProgress.pendingProps,
|
|
nextChildren = nextProps.children,
|
|
prevState = null !== current ? current.memoizedState : null;
|
|
if (
|
|
"hidden" === nextProps.mode ||
|
|
"unstable-defer-without-hiding" === nextProps.mode
|
|
)
|
|
if (0 === (workInProgress.mode & 2))
|
|
(workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
|
|
push(subtreeRenderLanesCursor, subtreeRenderLanes),
|
|
(subtreeRenderLanes |= renderLanes);
|
|
else {
|
|
if (0 === (renderLanes & 1073741824))
|
|
return (
|
|
(current =
|
|
null !== prevState
|
|
? prevState.baseLanes | renderLanes
|
|
: renderLanes),
|
|
markSpawnedWork(1073741824),
|
|
(workInProgress.lanes = workInProgress.childLanes = 1073741824),
|
|
(workInProgress.memoizedState = {
|
|
baseLanes: current,
|
|
cachePool: null
|
|
}),
|
|
(workInProgress.updateQueue = null),
|
|
push(subtreeRenderLanesCursor, subtreeRenderLanes),
|
|
(subtreeRenderLanes |= current),
|
|
null
|
|
);
|
|
workInProgress.memoizedState = { baseLanes: 0, cachePool: null };
|
|
nextProps = null !== prevState ? prevState.baseLanes : renderLanes;
|
|
push(subtreeRenderLanesCursor, subtreeRenderLanes);
|
|
subtreeRenderLanes |= nextProps;
|
|
}
|
|
else
|
|
null !== prevState
|
|
? ((nextProps = prevState.baseLanes | renderLanes),
|
|
(workInProgress.memoizedState = null))
|
|
: (nextProps = renderLanes),
|
|
push(subtreeRenderLanesCursor, subtreeRenderLanes),
|
|
(subtreeRenderLanes |= nextProps);
|
|
reconcileChildren(current, workInProgress, nextChildren, renderLanes);
|
|
return workInProgress.child;
|
|
}
|
|
function markRef(current, workInProgress) {
|
|
var ref = workInProgress.ref;
|
|
if (
|
|
(null === current && null !== ref) ||
|
|
(null !== current && current.ref !== ref)
|
|
)
|
|
workInProgress.flags |= 256;
|
|
}
|
|
function updateFunctionComponent(
|
|
current,
|
|
workInProgress,
|
|
Component,
|
|
nextProps,
|
|
renderLanes
|
|
) {
|
|
var context = isContextProvider(Component)
|
|
? previousContext
|
|
: contextStackCursor.current;
|
|
context = getMaskedContext(workInProgress, context);
|
|
prepareToReadContext(workInProgress, renderLanes);
|
|
Component = renderWithHooks(
|
|
current,
|
|
workInProgress,
|
|
Component,
|
|
nextProps,
|
|
context,
|
|
renderLanes
|
|
);
|
|
if (null !== current && !didReceiveUpdate)
|
|
return (
|
|
(workInProgress.updateQueue = current.updateQueue),
|
|
(workInProgress.flags &= -1029),
|
|
(current.lanes &= ~renderLanes),
|
|
bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
|
|
);
|
|
workInProgress.flags |= 1;
|
|
reconcileChildren(current, workInProgress, Component, renderLanes);
|
|
return workInProgress.child;
|
|
}
|
|
function updateClassComponent(
|
|
current,
|
|
workInProgress,
|
|
Component,
|
|
nextProps,
|
|
renderLanes
|
|
) {
|
|
if (isContextProvider(Component)) {
|
|
var hasContext = !0;
|
|
pushContextProvider(workInProgress);
|
|
} else hasContext = !1;
|
|
prepareToReadContext(workInProgress, renderLanes);
|
|
if (null === workInProgress.stateNode)
|
|
null !== current &&
|
|
((current.alternate = null),
|
|
(workInProgress.alternate = null),
|
|
(workInProgress.flags |= 2)),
|
|
constructClassInstance(workInProgress, Component, nextProps),
|
|
mountClassInstance(workInProgress, Component, nextProps, renderLanes),
|
|
(nextProps = !0);
|
|
else if (null === current) {
|
|
var instance = workInProgress.stateNode,
|
|
oldProps = workInProgress.memoizedProps;
|
|
instance.props = oldProps;
|
|
var oldContext = instance.context,
|
|
contextType = Component.contextType;
|
|
"object" === typeof contextType && null !== contextType
|
|
? (contextType = readContext(contextType))
|
|
: ((contextType = isContextProvider(Component)
|
|
? previousContext
|
|
: contextStackCursor.current),
|
|
(contextType = getMaskedContext(workInProgress, contextType)));
|
|
var getDerivedStateFromProps = Component.getDerivedStateFromProps,
|
|
hasNewLifecycles =
|
|
"function" === typeof getDerivedStateFromProps ||
|
|
"function" === typeof instance.getSnapshotBeforeUpdate;
|
|
hasNewLifecycles ||
|
|
("function" !== typeof instance.UNSAFE_componentWillReceiveProps &&
|
|
"function" !== typeof instance.componentWillReceiveProps) ||
|
|
((oldProps !== nextProps || oldContext !== contextType) &&
|
|
callComponentWillReceiveProps(
|
|
workInProgress,
|
|
instance,
|
|
nextProps,
|
|
contextType
|
|
));
|
|
hasForceUpdate = !1;
|
|
var oldState = workInProgress.memoizedState;
|
|
instance.state = oldState;
|
|
processUpdateQueue(workInProgress, nextProps, instance, renderLanes);
|
|
oldContext = workInProgress.memoizedState;
|
|
oldProps !== nextProps ||
|
|
oldState !== oldContext ||
|
|
didPerformWorkStackCursor.current ||
|
|
hasForceUpdate
|
|
? ("function" === typeof getDerivedStateFromProps &&
|
|
(applyDerivedStateFromProps(
|
|
workInProgress,
|
|
Component,
|
|
getDerivedStateFromProps,
|
|
nextProps
|
|
),
|
|
(oldContext = workInProgress.memoizedState)),
|
|
(oldProps =
|
|
hasForceUpdate ||
|
|
checkShouldComponentUpdate(
|
|
workInProgress,
|
|
Component,
|
|
oldProps,
|
|
nextProps,
|
|
oldState,
|
|
oldContext,
|
|
contextType
|
|
))
|
|
? (hasNewLifecycles ||
|
|
("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 |= 4))
|
|
: ("function" === typeof instance.componentDidMount &&
|
|
(workInProgress.flags |= 4),
|
|
(workInProgress.memoizedProps = nextProps),
|
|
(workInProgress.memoizedState = oldContext)),
|
|
(instance.props = nextProps),
|
|
(instance.state = oldContext),
|
|
(instance.context = contextType),
|
|
(nextProps = oldProps))
|
|
: ("function" === typeof instance.componentDidMount &&
|
|
(workInProgress.flags |= 4),
|
|
(nextProps = !1));
|
|
} else {
|
|
instance = workInProgress.stateNode;
|
|
cloneUpdateQueue(current, workInProgress);
|
|
oldProps = workInProgress.memoizedProps;
|
|
contextType =
|
|
workInProgress.type === workInProgress.elementType
|
|
? oldProps
|
|
: resolveDefaultProps(workInProgress.type, oldProps);
|
|
instance.props = contextType;
|
|
hasNewLifecycles = workInProgress.pendingProps;
|
|
oldState = instance.context;
|
|
oldContext = Component.contextType;
|
|
"object" === typeof oldContext && null !== oldContext
|
|
? (oldContext = readContext(oldContext))
|
|
: ((oldContext = isContextProvider(Component)
|
|
? previousContext
|
|
: contextStackCursor.current),
|
|
(oldContext = getMaskedContext(workInProgress, oldContext)));
|
|
var getDerivedStateFromProps$jscomp$0 = Component.getDerivedStateFromProps;
|
|
(getDerivedStateFromProps =
|
|
"function" === typeof getDerivedStateFromProps$jscomp$0 ||
|
|
"function" === typeof instance.getSnapshotBeforeUpdate) ||
|
|
("function" !== typeof instance.UNSAFE_componentWillReceiveProps &&
|
|
"function" !== typeof instance.componentWillReceiveProps) ||
|
|
((oldProps !== hasNewLifecycles || oldState !== oldContext) &&
|
|
callComponentWillReceiveProps(
|
|
workInProgress,
|
|
instance,
|
|
nextProps,
|
|
oldContext
|
|
));
|
|
hasForceUpdate = !1;
|
|
oldState = workInProgress.memoizedState;
|
|
instance.state = oldState;
|
|
processUpdateQueue(workInProgress, nextProps, instance, renderLanes);
|
|
var newState = workInProgress.memoizedState;
|
|
oldProps !== hasNewLifecycles ||
|
|
oldState !== newState ||
|
|
didPerformWorkStackCursor.current ||
|
|
hasForceUpdate
|
|
? ("function" === typeof getDerivedStateFromProps$jscomp$0 &&
|
|
(applyDerivedStateFromProps(
|
|
workInProgress,
|
|
Component,
|
|
getDerivedStateFromProps$jscomp$0,
|
|
nextProps
|
|
),
|
|
(newState = workInProgress.memoizedState)),
|
|
(contextType =
|
|
hasForceUpdate ||
|
|
checkShouldComponentUpdate(
|
|
workInProgress,
|
|
Component,
|
|
contextType,
|
|
nextProps,
|
|
oldState,
|
|
newState,
|
|
oldContext
|
|
))
|
|
? (getDerivedStateFromProps ||
|
|
("function" !== typeof instance.UNSAFE_componentWillUpdate &&
|
|
"function" !== typeof instance.componentWillUpdate) ||
|
|
("function" === typeof instance.componentWillUpdate &&
|
|
instance.componentWillUpdate(nextProps, newState, oldContext),
|
|
"function" === typeof instance.UNSAFE_componentWillUpdate &&
|
|
instance.UNSAFE_componentWillUpdate(
|
|
nextProps,
|
|
newState,
|
|
oldContext
|
|
)),
|
|
"function" === typeof instance.componentDidUpdate &&
|
|
(workInProgress.flags |= 4),
|
|
"function" === typeof instance.getSnapshotBeforeUpdate &&
|
|
(workInProgress.flags |= 512))
|
|
: ("function" !== typeof instance.componentDidUpdate ||
|
|
(oldProps === current.memoizedProps &&
|
|
oldState === current.memoizedState) ||
|
|
(workInProgress.flags |= 4),
|
|
"function" !== typeof instance.getSnapshotBeforeUpdate ||
|
|
(oldProps === current.memoizedProps &&
|
|
oldState === current.memoizedState) ||
|
|
(workInProgress.flags |= 512),
|
|
(workInProgress.memoizedProps = nextProps),
|
|
(workInProgress.memoizedState = newState)),
|
|
(instance.props = nextProps),
|
|
(instance.state = newState),
|
|
(instance.context = oldContext),
|
|
(nextProps = contextType))
|
|
: ("function" !== typeof instance.componentDidUpdate ||
|
|
(oldProps === current.memoizedProps &&
|
|
oldState === current.memoizedState) ||
|
|
(workInProgress.flags |= 4),
|
|
"function" !== typeof instance.getSnapshotBeforeUpdate ||
|
|
(oldProps === current.memoizedProps &&
|
|
oldState === current.memoizedState) ||
|
|
(workInProgress.flags |= 512),
|
|
(nextProps = !1));
|
|
}
|
|
return finishClassComponent(
|
|
current,
|
|
workInProgress,
|
|
Component,
|
|
nextProps,
|
|
hasContext,
|
|
renderLanes
|
|
);
|
|
}
|
|
function finishClassComponent(
|
|
current,
|
|
workInProgress,
|
|
Component,
|
|
shouldUpdate,
|
|
hasContext,
|
|
renderLanes
|
|
) {
|
|
markRef(current, workInProgress);
|
|
var didCaptureError = 0 !== (workInProgress.flags & 128);
|
|
if (!shouldUpdate && !didCaptureError)
|
|
return (
|
|
hasContext && invalidateContextProvider(workInProgress, Component, !1),
|
|
bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
|
|
);
|
|
shouldUpdate = workInProgress.stateNode;
|
|
ReactCurrentOwner$1.current = workInProgress;
|
|
if (
|
|
didCaptureError &&
|
|
"function" !== typeof Component.getDerivedStateFromError
|
|
) {
|
|
var nextChildren = null;
|
|
profilerStartTime = -1;
|
|
} else nextChildren = shouldUpdate.render();
|
|
workInProgress.flags |= 1;
|
|
null !== current && didCaptureError
|
|
? ((didCaptureError = nextChildren),
|
|
(workInProgress.child = reconcileChildFibers(
|
|
workInProgress,
|
|
current.child,
|
|
null,
|
|
renderLanes
|
|
)),
|
|
(workInProgress.child = reconcileChildFibers(
|
|
workInProgress,
|
|
null,
|
|
didCaptureError,
|
|
renderLanes
|
|
)))
|
|
: reconcileChildren(current, workInProgress, nextChildren, renderLanes);
|
|
workInProgress.memoizedState = shouldUpdate.state;
|
|
hasContext && invalidateContextProvider(workInProgress, Component, !0);
|
|
return workInProgress.child;
|
|
}
|
|
function pushHostRootContext(workInProgress) {
|
|
var root = workInProgress.stateNode;
|
|
root.pendingContext
|
|
? pushTopLevelContextObject(
|
|
workInProgress,
|
|
root.pendingContext,
|
|
root.pendingContext !== root.context
|
|
)
|
|
: root.context &&
|
|
pushTopLevelContextObject(workInProgress, root.context, !1);
|
|
pushHostContainer(workInProgress, root.containerInfo);
|
|
}
|
|
var SUSPENDED_MARKER = { dehydrated: null, retryLane: 0 };
|
|
function mountSuspenseOffscreenState(renderLanes) {
|
|
return { baseLanes: renderLanes, cachePool: null };
|
|
}
|
|
function updateSuspenseComponent(current, workInProgress, renderLanes) {
|
|
var nextProps = workInProgress.pendingProps,
|
|
suspenseContext = suspenseStackCursor.current,
|
|
showFallback = !1,
|
|
JSCompiler_temp;
|
|
(JSCompiler_temp = 0 !== (workInProgress.flags & 128)) ||
|
|
(JSCompiler_temp =
|
|
null !== current && null === current.memoizedState
|
|
? !1
|
|
: 0 !== (suspenseContext & 2));
|
|
JSCompiler_temp
|
|
? ((showFallback = !0), (workInProgress.flags &= -129))
|
|
: (null !== current && null === current.memoizedState) ||
|
|
void 0 === nextProps.fallback ||
|
|
!0 === nextProps.unstable_avoidThisFallback ||
|
|
(suspenseContext |= 1);
|
|
push(suspenseStackCursor, suspenseContext & 1);
|
|
if (null === current) {
|
|
current = nextProps.children;
|
|
suspenseContext = nextProps.fallback;
|
|
if (showFallback)
|
|
return (
|
|
(current = mountSuspenseFallbackChildren(
|
|
workInProgress,
|
|
current,
|
|
suspenseContext,
|
|
renderLanes
|
|
)),
|
|
(workInProgress.child.memoizedState = mountSuspenseOffscreenState(
|
|
renderLanes
|
|
)),
|
|
(workInProgress.memoizedState = SUSPENDED_MARKER),
|
|
current
|
|
);
|
|
if ("number" === typeof nextProps.unstable_expectedLoadTime)
|
|
return (
|
|
(current = mountSuspenseFallbackChildren(
|
|
workInProgress,
|
|
current,
|
|
suspenseContext,
|
|
renderLanes
|
|
)),
|
|
(workInProgress.child.memoizedState = mountSuspenseOffscreenState(
|
|
renderLanes
|
|
)),
|
|
(workInProgress.memoizedState = SUSPENDED_MARKER),
|
|
(workInProgress.lanes = 8388608),
|
|
markSpawnedWork(8388608),
|
|
current
|
|
);
|
|
renderLanes = createFiberFromOffscreen(
|
|
{ mode: "visible", children: current },
|
|
workInProgress.mode,
|
|
renderLanes,
|
|
null
|
|
);
|
|
renderLanes.return = workInProgress;
|
|
return (workInProgress.child = renderLanes);
|
|
}
|
|
if (null !== current.memoizedState) {
|
|
if (showFallback)
|
|
return (
|
|
(nextProps = updateSuspenseFallbackChildren(
|
|
current,
|
|
workInProgress,
|
|
nextProps.children,
|
|
nextProps.fallback,
|
|
renderLanes
|
|
)),
|
|
(showFallback = workInProgress.child),
|
|
(suspenseContext = current.child.memoizedState),
|
|
(showFallback.memoizedState =
|
|
null === suspenseContext
|
|
? mountSuspenseOffscreenState(renderLanes)
|
|
: {
|
|
baseLanes: suspenseContext.baseLanes | renderLanes,
|
|
cachePool: null
|
|
}),
|
|
(showFallback.childLanes = current.childLanes & ~renderLanes),
|
|
(workInProgress.memoizedState = SUSPENDED_MARKER),
|
|
nextProps
|
|
);
|
|
renderLanes = updateSuspensePrimaryChildren(
|
|
current,
|
|
workInProgress,
|
|
nextProps.children,
|
|
renderLanes
|
|
);
|
|
workInProgress.memoizedState = null;
|
|
return renderLanes;
|
|
}
|
|
if (showFallback)
|
|
return (
|
|
(nextProps = updateSuspenseFallbackChildren(
|
|
current,
|
|
workInProgress,
|
|
nextProps.children,
|
|
nextProps.fallback,
|
|
renderLanes
|
|
)),
|
|
(showFallback = workInProgress.child),
|
|
(suspenseContext = current.child.memoizedState),
|
|
(showFallback.memoizedState =
|
|
null === suspenseContext
|
|
? mountSuspenseOffscreenState(renderLanes)
|
|
: {
|
|
baseLanes: suspenseContext.baseLanes | renderLanes,
|
|
cachePool: null
|
|
}),
|
|
(showFallback.childLanes = current.childLanes & ~renderLanes),
|
|
(workInProgress.memoizedState = SUSPENDED_MARKER),
|
|
nextProps
|
|
);
|
|
renderLanes = updateSuspensePrimaryChildren(
|
|
current,
|
|
workInProgress,
|
|
nextProps.children,
|
|
renderLanes
|
|
);
|
|
workInProgress.memoizedState = null;
|
|
return renderLanes;
|
|
}
|
|
function mountSuspenseFallbackChildren(
|
|
workInProgress,
|
|
primaryChildren,
|
|
fallbackChildren,
|
|
renderLanes
|
|
) {
|
|
var mode = workInProgress.mode,
|
|
progressedPrimaryFragment = workInProgress.child;
|
|
primaryChildren = { mode: "hidden", children: primaryChildren };
|
|
0 === (mode & 1) && null !== progressedPrimaryFragment
|
|
? ((progressedPrimaryFragment.childLanes = 0),
|
|
(progressedPrimaryFragment.pendingProps = primaryChildren),
|
|
workInProgress.mode & 4 &&
|
|
((progressedPrimaryFragment.actualDuration = 0),
|
|
(progressedPrimaryFragment.actualStartTime = -1),
|
|
(progressedPrimaryFragment.selfBaseDuration = 0),
|
|
(progressedPrimaryFragment.treeBaseDuration = 0)))
|
|
: (progressedPrimaryFragment = createFiberFromOffscreen(
|
|
primaryChildren,
|
|
mode,
|
|
0,
|
|
null
|
|
));
|
|
fallbackChildren = createFiberFromFragment(
|
|
fallbackChildren,
|
|
mode,
|
|
renderLanes,
|
|
null
|
|
);
|
|
progressedPrimaryFragment.return = workInProgress;
|
|
fallbackChildren.return = workInProgress;
|
|
progressedPrimaryFragment.sibling = fallbackChildren;
|
|
workInProgress.child = progressedPrimaryFragment;
|
|
return fallbackChildren;
|
|
}
|
|
function updateSuspensePrimaryChildren(
|
|
current,
|
|
workInProgress,
|
|
primaryChildren,
|
|
renderLanes
|
|
) {
|
|
var currentPrimaryChildFragment = current.child;
|
|
current = currentPrimaryChildFragment.sibling;
|
|
primaryChildren = createWorkInProgress(currentPrimaryChildFragment, {
|
|
mode: "visible",
|
|
children: primaryChildren
|
|
});
|
|
0 === (workInProgress.mode & 1) && (primaryChildren.lanes = renderLanes);
|
|
primaryChildren.return = workInProgress;
|
|
primaryChildren.sibling = null;
|
|
null !== current &&
|
|
((renderLanes = workInProgress.deletions),
|
|
null === renderLanes
|
|
? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16))
|
|
: renderLanes.push(current));
|
|
return (workInProgress.child = primaryChildren);
|
|
}
|
|
function updateSuspenseFallbackChildren(
|
|
current,
|
|
workInProgress,
|
|
primaryChildren,
|
|
fallbackChildren,
|
|
renderLanes
|
|
) {
|
|
var mode = workInProgress.mode;
|
|
current = current.child;
|
|
var currentFallbackChildFragment = current.sibling,
|
|
primaryChildProps = { mode: "hidden", children: primaryChildren };
|
|
0 === (mode & 1) && workInProgress.child !== current
|
|
? ((primaryChildren = workInProgress.child),
|
|
(primaryChildren.childLanes = 0),
|
|
(primaryChildren.pendingProps = primaryChildProps),
|
|
workInProgress.mode & 4 &&
|
|
((primaryChildren.actualDuration = 0),
|
|
(primaryChildren.actualStartTime = -1),
|
|
(primaryChildren.selfBaseDuration = current.selfBaseDuration),
|
|
(primaryChildren.treeBaseDuration = current.treeBaseDuration)),
|
|
(workInProgress.deletions = null))
|
|
: ((primaryChildren = createWorkInProgress(current, primaryChildProps)),
|
|
(primaryChildren.subtreeFlags = current.subtreeFlags & 131072));
|
|
null !== currentFallbackChildFragment
|
|
? (fallbackChildren = createWorkInProgress(
|
|
currentFallbackChildFragment,
|
|
fallbackChildren
|
|
))
|
|
: ((fallbackChildren = createFiberFromFragment(
|
|
fallbackChildren,
|
|
mode,
|
|
renderLanes,
|
|
null
|
|
)),
|
|
(fallbackChildren.flags |= 2));
|
|
fallbackChildren.return = workInProgress;
|
|
primaryChildren.return = workInProgress;
|
|
primaryChildren.sibling = fallbackChildren;
|
|
workInProgress.child = primaryChildren;
|
|
return fallbackChildren;
|
|
}
|
|
function scheduleWorkOnFiber(fiber, renderLanes) {
|
|
fiber.lanes |= renderLanes;
|
|
var alternate = fiber.alternate;
|
|
null !== alternate && (alternate.lanes |= renderLanes);
|
|
scheduleWorkOnParentPath(fiber.return, renderLanes);
|
|
}
|
|
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 &&
|
|
scheduleWorkOnFiber(current, renderLanes);
|
|
else if (19 === current.tag) scheduleWorkOnFiber(current, renderLanes);
|
|
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);
|
|
if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = null;
|
|
else
|
|
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)) 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;
|
|
}
|
|
var appendAllChildren,
|
|
updateHostContainer,
|
|
updateHostComponent$1,
|
|
updateHostText$1;
|
|
appendAllChildren = function(parent, workInProgress) {
|
|
for (var node = workInProgress.child; null !== node; ) {
|
|
if (5 === node.tag || 6 === node.tag) parent._children.push(node.stateNode);
|
|
else if (4 !== node.tag && null !== node.child) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === workInProgress) break;
|
|
for (; null === node.sibling; ) {
|
|
if (null === node.return || node.return === workInProgress) return;
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
};
|
|
updateHostContainer = function() {};
|
|
updateHostComponent$1 = function(current, workInProgress, type, newProps) {
|
|
current.memoizedProps !== newProps &&
|
|
(requiredContext(contextStackCursor$1.current),
|
|
(workInProgress.updateQueue = UPDATE_SIGNAL)) &&
|
|
(workInProgress.flags |= 4);
|
|
};
|
|
updateHostText$1 = function(current, workInProgress, oldText, newText) {
|
|
oldText !== newText && (workInProgress.flags |= 4);
|
|
};
|
|
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
|
|
switch (renderState.tailMode) {
|
|
case "hidden":
|
|
hasRenderedATailFallback = renderState.tail;
|
|
for (var lastTailNode = null; null !== hasRenderedATailFallback; )
|
|
null !== hasRenderedATailFallback.alternate &&
|
|
(lastTailNode = hasRenderedATailFallback),
|
|
(hasRenderedATailFallback = hasRenderedATailFallback.sibling);
|
|
null === lastTailNode
|
|
? (renderState.tail = null)
|
|
: (lastTailNode.sibling = null);
|
|
break;
|
|
case "collapsed":
|
|
lastTailNode = renderState.tail;
|
|
for (var lastTailNode$63 = null; null !== lastTailNode; )
|
|
null !== lastTailNode.alternate && (lastTailNode$63 = lastTailNode),
|
|
(lastTailNode = lastTailNode.sibling);
|
|
null === lastTailNode$63
|
|
? hasRenderedATailFallback || null === renderState.tail
|
|
? (renderState.tail = null)
|
|
: (renderState.tail.sibling = null)
|
|
: (lastTailNode$63.sibling = null);
|
|
}
|
|
}
|
|
function bubbleProperties(completedWork) {
|
|
var didBailout =
|
|
null !== completedWork.alternate &&
|
|
completedWork.alternate.child === completedWork.child,
|
|
newChildLanes = 0,
|
|
subtreeFlags = 0;
|
|
if (didBailout)
|
|
if (0 !== (completedWork.mode & 4)) {
|
|
for (
|
|
var treeBaseDuration$65 = completedWork.selfBaseDuration,
|
|
child$66 = completedWork.child;
|
|
null !== child$66;
|
|
|
|
)
|
|
(newChildLanes |= child$66.lanes | child$66.childLanes),
|
|
(subtreeFlags |= child$66.subtreeFlags & 131072),
|
|
(subtreeFlags |= child$66.flags & 131072),
|
|
(treeBaseDuration$65 += child$66.treeBaseDuration),
|
|
(child$66 = child$66.sibling);
|
|
completedWork.treeBaseDuration = treeBaseDuration$65;
|
|
} else
|
|
for (
|
|
treeBaseDuration$65 = completedWork.child;
|
|
null !== treeBaseDuration$65;
|
|
|
|
)
|
|
(newChildLanes |=
|
|
treeBaseDuration$65.lanes | treeBaseDuration$65.childLanes),
|
|
(subtreeFlags |= treeBaseDuration$65.subtreeFlags & 131072),
|
|
(subtreeFlags |= treeBaseDuration$65.flags & 131072),
|
|
(treeBaseDuration$65.return = completedWork),
|
|
(treeBaseDuration$65 = treeBaseDuration$65.sibling);
|
|
else if (0 !== (completedWork.mode & 4)) {
|
|
treeBaseDuration$65 = completedWork.actualDuration;
|
|
child$66 = completedWork.selfBaseDuration;
|
|
for (var child = completedWork.child; null !== child; )
|
|
(newChildLanes |= child.lanes | child.childLanes),
|
|
(subtreeFlags |= child.subtreeFlags),
|
|
(subtreeFlags |= child.flags),
|
|
(treeBaseDuration$65 += child.actualDuration),
|
|
(child$66 += child.treeBaseDuration),
|
|
(child = child.sibling);
|
|
completedWork.actualDuration = treeBaseDuration$65;
|
|
completedWork.treeBaseDuration = child$66;
|
|
} else
|
|
for (
|
|
treeBaseDuration$65 = completedWork.child;
|
|
null !== treeBaseDuration$65;
|
|
|
|
)
|
|
(newChildLanes |=
|
|
treeBaseDuration$65.lanes | treeBaseDuration$65.childLanes),
|
|
(subtreeFlags |= treeBaseDuration$65.subtreeFlags),
|
|
(subtreeFlags |= treeBaseDuration$65.flags),
|
|
(treeBaseDuration$65.return = completedWork),
|
|
(treeBaseDuration$65 = treeBaseDuration$65.sibling);
|
|
completedWork.subtreeFlags |= subtreeFlags;
|
|
completedWork.childLanes = newChildLanes;
|
|
return didBailout;
|
|
}
|
|
function completeWork(current, workInProgress, renderLanes) {
|
|
var newProps = workInProgress.pendingProps;
|
|
switch (workInProgress.tag) {
|
|
case 2:
|
|
case 16:
|
|
case 15:
|
|
case 0:
|
|
case 11:
|
|
case 7:
|
|
case 8:
|
|
case 12:
|
|
case 9:
|
|
case 14:
|
|
return bubbleProperties(workInProgress), null;
|
|
case 1:
|
|
return (
|
|
isContextProvider(workInProgress.type) && popContext(),
|
|
bubbleProperties(workInProgress),
|
|
null
|
|
);
|
|
case 3:
|
|
return (
|
|
(newProps = workInProgress.stateNode),
|
|
popHostContainer(),
|
|
pop(didPerformWorkStackCursor),
|
|
pop(contextStackCursor),
|
|
resetWorkInProgressVersions(),
|
|
newProps.pendingContext &&
|
|
((newProps.context = newProps.pendingContext),
|
|
(newProps.pendingContext = null)),
|
|
(null !== current && null !== current.child) ||
|
|
newProps.hydrate ||
|
|
(workInProgress.flags |= 512),
|
|
updateHostContainer(current, workInProgress),
|
|
bubbleProperties(workInProgress),
|
|
null
|
|
);
|
|
case 5:
|
|
popHostContext(workInProgress);
|
|
renderLanes = requiredContext(rootInstanceStackCursor.current);
|
|
var type = workInProgress.type;
|
|
if (null !== current && null != workInProgress.stateNode)
|
|
updateHostComponent$1(
|
|
current,
|
|
workInProgress,
|
|
type,
|
|
newProps,
|
|
renderLanes
|
|
),
|
|
current.ref !== workInProgress.ref && (workInProgress.flags |= 256);
|
|
else {
|
|
if (!newProps) {
|
|
if (null === workInProgress.stateNode)
|
|
throw Error(
|
|
"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
bubbleProperties(workInProgress);
|
|
return null;
|
|
}
|
|
requiredContext(contextStackCursor$1.current);
|
|
current = allocateTag();
|
|
type = getViewConfigForType(type);
|
|
var updatePayload = diffProperties(
|
|
null,
|
|
emptyObject,
|
|
newProps,
|
|
type.validAttributes
|
|
);
|
|
ReactNativePrivateInterface.UIManager.createView(
|
|
current,
|
|
type.uiViewClassName,
|
|
renderLanes,
|
|
updatePayload
|
|
);
|
|
renderLanes = new ReactNativeFiberHostComponent(
|
|
current,
|
|
type,
|
|
workInProgress
|
|
);
|
|
instanceCache.set(current, workInProgress);
|
|
instanceProps.set(current, newProps);
|
|
appendAllChildren(renderLanes, workInProgress, !1, !1);
|
|
workInProgress.stateNode = renderLanes;
|
|
finalizeInitialChildren(renderLanes) && (workInProgress.flags |= 4);
|
|
null !== workInProgress.ref && (workInProgress.flags |= 256);
|
|
}
|
|
bubbleProperties(workInProgress);
|
|
return null;
|
|
case 6:
|
|
if (current && null != workInProgress.stateNode)
|
|
updateHostText$1(
|
|
current,
|
|
workInProgress,
|
|
current.memoizedProps,
|
|
newProps
|
|
);
|
|
else {
|
|
if ("string" !== typeof newProps && null === workInProgress.stateNode)
|
|
throw Error(
|
|
"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
current = requiredContext(rootInstanceStackCursor.current);
|
|
if (!requiredContext(contextStackCursor$1.current).isInAParentText)
|
|
throw Error(
|
|
"Text strings must be rendered within a <Text> component."
|
|
);
|
|
renderLanes = allocateTag();
|
|
ReactNativePrivateInterface.UIManager.createView(
|
|
renderLanes,
|
|
"RCTRawText",
|
|
current,
|
|
{ text: newProps }
|
|
);
|
|
instanceCache.set(renderLanes, workInProgress);
|
|
workInProgress.stateNode = renderLanes;
|
|
}
|
|
bubbleProperties(workInProgress);
|
|
return null;
|
|
case 13:
|
|
pop(suspenseStackCursor);
|
|
newProps = workInProgress.memoizedState;
|
|
if (0 !== (workInProgress.flags & 128))
|
|
return (
|
|
(workInProgress.lanes = renderLanes),
|
|
0 !== (workInProgress.mode & 4) &&
|
|
transferActualDuration(workInProgress),
|
|
workInProgress
|
|
);
|
|
newProps = null !== newProps;
|
|
renderLanes = !1;
|
|
null !== current && (renderLanes = null !== current.memoizedState);
|
|
if (newProps && !renderLanes && 0 !== (workInProgress.mode & 1))
|
|
if (
|
|
(null === current &&
|
|
!0 !== workInProgress.memoizedProps.unstable_avoidThisFallback) ||
|
|
0 !== (suspenseStackCursor.current & 1)
|
|
)
|
|
0 === workInProgressRootExitStatus &&
|
|
(workInProgressRootExitStatus = 3);
|
|
else {
|
|
if (
|
|
0 === workInProgressRootExitStatus ||
|
|
3 === workInProgressRootExitStatus
|
|
)
|
|
workInProgressRootExitStatus = 4;
|
|
null === workInProgressRoot ||
|
|
(0 === (workInProgressRootSkippedLanes & 268435455) &&
|
|
0 === (workInProgressRootUpdatedLanes & 268435455)) ||
|
|
markRootSuspended$1(
|
|
workInProgressRoot,
|
|
workInProgressRootRenderLanes
|
|
);
|
|
}
|
|
if (newProps || renderLanes) workInProgress.flags |= 4;
|
|
bubbleProperties(workInProgress);
|
|
0 !== (workInProgress.mode & 4) &&
|
|
newProps &&
|
|
((current = workInProgress.child),
|
|
null !== current &&
|
|
(workInProgress.treeBaseDuration -= current.treeBaseDuration));
|
|
return null;
|
|
case 4:
|
|
return (
|
|
popHostContainer(),
|
|
updateHostContainer(current, workInProgress),
|
|
bubbleProperties(workInProgress),
|
|
null
|
|
);
|
|
case 10:
|
|
return (
|
|
popProvider(workInProgress.type._context),
|
|
bubbleProperties(workInProgress),
|
|
null
|
|
);
|
|
case 17:
|
|
return (
|
|
isContextProvider(workInProgress.type) && popContext(),
|
|
bubbleProperties(workInProgress),
|
|
null
|
|
);
|
|
case 19:
|
|
pop(suspenseStackCursor);
|
|
type = workInProgress.memoizedState;
|
|
if (null === type) return bubbleProperties(workInProgress), null;
|
|
newProps = 0 !== (workInProgress.flags & 128);
|
|
updatePayload = type.rendering;
|
|
if (null === updatePayload)
|
|
if (newProps) cutOffTailIfNeeded(type, !1);
|
|
else {
|
|
if (
|
|
0 !== workInProgressRootExitStatus ||
|
|
(null !== current && 0 !== (current.flags & 128))
|
|
)
|
|
for (current = workInProgress.child; null !== current; ) {
|
|
updatePayload = findFirstSuspended(current);
|
|
if (null !== updatePayload) {
|
|
workInProgress.flags |= 128;
|
|
cutOffTailIfNeeded(type, !1);
|
|
current = updatePayload.updateQueue;
|
|
null !== current &&
|
|
((workInProgress.updateQueue = current),
|
|
(workInProgress.flags |= 4));
|
|
workInProgress.subtreeFlags = 0;
|
|
current = renderLanes;
|
|
for (newProps = workInProgress.child; null !== newProps; )
|
|
(renderLanes = newProps),
|
|
(updatePayload = current),
|
|
(renderLanes.flags &= 131074),
|
|
(type = renderLanes.alternate),
|
|
null === type
|
|
? ((renderLanes.childLanes = 0),
|
|
(renderLanes.lanes = updatePayload),
|
|
(renderLanes.child = null),
|
|
(renderLanes.subtreeFlags = 0),
|
|
(renderLanes.memoizedProps = null),
|
|
(renderLanes.memoizedState = null),
|
|
(renderLanes.updateQueue = null),
|
|
(renderLanes.dependencies = null),
|
|
(renderLanes.stateNode = null),
|
|
(renderLanes.selfBaseDuration = 0),
|
|
(renderLanes.treeBaseDuration = 0))
|
|
: ((renderLanes.childLanes = type.childLanes),
|
|
(renderLanes.lanes = type.lanes),
|
|
(renderLanes.child = type.child),
|
|
(renderLanes.subtreeFlags = type.subtreeFlags),
|
|
(renderLanes.deletions = null),
|
|
(renderLanes.memoizedProps = type.memoizedProps),
|
|
(renderLanes.memoizedState = type.memoizedState),
|
|
(renderLanes.updateQueue = type.updateQueue),
|
|
(renderLanes.type = type.type),
|
|
(updatePayload = type.dependencies),
|
|
(renderLanes.dependencies =
|
|
null === updatePayload
|
|
? null
|
|
: {
|
|
lanes: updatePayload.lanes,
|
|
firstContext: updatePayload.firstContext
|
|
}),
|
|
(renderLanes.selfBaseDuration = type.selfBaseDuration),
|
|
(renderLanes.treeBaseDuration = type.treeBaseDuration)),
|
|
(newProps = newProps.sibling);
|
|
push(
|
|
suspenseStackCursor,
|
|
(suspenseStackCursor.current & 1) | 2
|
|
);
|
|
return workInProgress.child;
|
|
}
|
|
current = current.sibling;
|
|
}
|
|
null !== type.tail &&
|
|
now() > workInProgressRootRenderTargetTime &&
|
|
((workInProgress.flags |= 128),
|
|
(newProps = !0),
|
|
cutOffTailIfNeeded(type, !1),
|
|
(workInProgress.lanes = 8388608),
|
|
markSpawnedWork(8388608));
|
|
}
|
|
else {
|
|
if (!newProps)
|
|
if (
|
|
((current = findFirstSuspended(updatePayload)), null !== current)
|
|
) {
|
|
if (
|
|
((workInProgress.flags |= 128),
|
|
(newProps = !0),
|
|
(current = current.updateQueue),
|
|
null !== current &&
|
|
((workInProgress.updateQueue = current),
|
|
(workInProgress.flags |= 4)),
|
|
cutOffTailIfNeeded(type, !0),
|
|
null === type.tail &&
|
|
"hidden" === type.tailMode &&
|
|
!updatePayload.alternate)
|
|
)
|
|
return bubbleProperties(workInProgress), null;
|
|
} else
|
|
2 * now() - type.renderingStartTime >
|
|
workInProgressRootRenderTargetTime &&
|
|
1073741824 !== renderLanes &&
|
|
((workInProgress.flags |= 128),
|
|
(newProps = !0),
|
|
cutOffTailIfNeeded(type, !1),
|
|
(workInProgress.lanes = 8388608),
|
|
markSpawnedWork(8388608));
|
|
type.isBackwards
|
|
? ((updatePayload.sibling = workInProgress.child),
|
|
(workInProgress.child = updatePayload))
|
|
: ((current = type.last),
|
|
null !== current
|
|
? (current.sibling = updatePayload)
|
|
: (workInProgress.child = updatePayload),
|
|
(type.last = updatePayload));
|
|
}
|
|
if (null !== type.tail)
|
|
return (
|
|
(workInProgress = type.tail),
|
|
(type.rendering = workInProgress),
|
|
(type.tail = workInProgress.sibling),
|
|
(type.renderingStartTime = now()),
|
|
(workInProgress.sibling = null),
|
|
(current = suspenseStackCursor.current),
|
|
push(suspenseStackCursor, newProps ? (current & 1) | 2 : current & 1),
|
|
workInProgress
|
|
);
|
|
bubbleProperties(workInProgress);
|
|
return null;
|
|
case 22:
|
|
case 23:
|
|
return (
|
|
popRenderLanes(),
|
|
(renderLanes = null !== workInProgress.memoizedState),
|
|
null !== current &&
|
|
(null !== current.memoizedState) !== renderLanes &&
|
|
"unstable-defer-without-hiding" !== newProps.mode &&
|
|
(workInProgress.flags |= 4),
|
|
(renderLanes &&
|
|
0 === (subtreeRenderLanes & 1073741824) &&
|
|
0 !== (workInProgress.mode & 2)) ||
|
|
bubbleProperties(workInProgress),
|
|
null
|
|
);
|
|
}
|
|
throw Error(
|
|
"Unknown unit of work tag (" +
|
|
workInProgress.tag +
|
|
"). This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
}
|
|
function unwindWork(workInProgress) {
|
|
switch (workInProgress.tag) {
|
|
case 1:
|
|
isContextProvider(workInProgress.type) && popContext();
|
|
var flags = workInProgress.flags;
|
|
return flags & 16384
|
|
? ((workInProgress.flags = (flags & -16385) | 128),
|
|
0 !== (workInProgress.mode & 4) &&
|
|
transferActualDuration(workInProgress),
|
|
workInProgress)
|
|
: null;
|
|
case 3:
|
|
popHostContainer();
|
|
pop(didPerformWorkStackCursor);
|
|
pop(contextStackCursor);
|
|
resetWorkInProgressVersions();
|
|
flags = workInProgress.flags;
|
|
if (0 !== (flags & 128))
|
|
throw Error(
|
|
"The root failed to unmount after an error. This is likely a bug in React. Please file an issue."
|
|
);
|
|
workInProgress.flags = (flags & -16385) | 128;
|
|
return workInProgress;
|
|
case 5:
|
|
return popHostContext(workInProgress), null;
|
|
case 13:
|
|
return (
|
|
pop(suspenseStackCursor),
|
|
(flags = workInProgress.flags),
|
|
flags & 16384
|
|
? ((workInProgress.flags = (flags & -16385) | 128),
|
|
0 !== (workInProgress.mode & 4) &&
|
|
transferActualDuration(workInProgress),
|
|
workInProgress)
|
|
: null
|
|
);
|
|
case 19:
|
|
return pop(suspenseStackCursor), null;
|
|
case 4:
|
|
return popHostContainer(), null;
|
|
case 10:
|
|
return popProvider(workInProgress.type._context), null;
|
|
case 22:
|
|
case 23:
|
|
return popRenderLanes(), null;
|
|
case 24:
|
|
return null;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
function createCapturedValue(value, source) {
|
|
return {
|
|
value: value,
|
|
source: source,
|
|
stack: getStackByFiberInDevAndProd(source)
|
|
};
|
|
}
|
|
if (
|
|
"function" !==
|
|
typeof ReactNativePrivateInterface.ReactFiberErrorDialog.showErrorDialog
|
|
)
|
|
throw Error(
|
|
"Expected ReactFiberErrorDialog.showErrorDialog to be a function."
|
|
);
|
|
function logCapturedError(boundary, errorInfo) {
|
|
try {
|
|
!1 !==
|
|
ReactNativePrivateInterface.ReactFiberErrorDialog.showErrorDialog({
|
|
componentStack: null !== errorInfo.stack ? errorInfo.stack : "",
|
|
error: errorInfo.value,
|
|
errorBoundary:
|
|
null !== boundary && 1 === boundary.tag ? boundary.stateNode : null
|
|
}) && console.error(errorInfo.value);
|
|
} catch (e) {
|
|
setTimeout(function() {
|
|
throw e;
|
|
});
|
|
}
|
|
}
|
|
var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map;
|
|
function createRootErrorUpdate(fiber, errorInfo, lane) {
|
|
lane = createUpdate(-1, lane);
|
|
lane.tag = 3;
|
|
lane.payload = { element: null };
|
|
var error = errorInfo.value;
|
|
lane.callback = function() {
|
|
hasUncaughtError || ((hasUncaughtError = !0), (firstUncaughtError = error));
|
|
logCapturedError(fiber, errorInfo);
|
|
};
|
|
return lane;
|
|
}
|
|
function createClassErrorUpdate(fiber, errorInfo, lane) {
|
|
lane = createUpdate(-1, lane);
|
|
lane.tag = 3;
|
|
var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
|
|
if ("function" === typeof getDerivedStateFromError) {
|
|
var error = errorInfo.value;
|
|
lane.payload = function() {
|
|
logCapturedError(fiber, errorInfo);
|
|
return getDerivedStateFromError(error);
|
|
};
|
|
}
|
|
var inst = fiber.stateNode;
|
|
null !== inst &&
|
|
"function" === typeof inst.componentDidCatch &&
|
|
(lane.callback = function() {
|
|
"function" !== typeof getDerivedStateFromError &&
|
|
(null === legacyErrorBoundariesThatAlreadyFailed
|
|
? (legacyErrorBoundariesThatAlreadyFailed = new Set([this]))
|
|
: legacyErrorBoundariesThatAlreadyFailed.add(this),
|
|
logCapturedError(fiber, errorInfo));
|
|
var stack = errorInfo.stack;
|
|
this.componentDidCatch(errorInfo.value, {
|
|
componentStack: null !== stack ? stack : ""
|
|
});
|
|
});
|
|
return lane;
|
|
}
|
|
var PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set,
|
|
nextEffect = null;
|
|
function safelyDetachRef(current, nearestMountedAncestor) {
|
|
var ref = current.ref;
|
|
if (null !== ref)
|
|
if ("function" === typeof ref)
|
|
try {
|
|
ref(null);
|
|
} catch (refError) {
|
|
captureCommitPhaseError(current, nearestMountedAncestor, refError);
|
|
}
|
|
else ref.current = null;
|
|
}
|
|
var focusedInstanceHandle = null,
|
|
shouldFireAfterActiveInstanceBlur = !1;
|
|
function commitBeforeMutationEffects(root, firstChild) {
|
|
focusedInstanceHandle = null;
|
|
for (nextEffect = firstChild; null !== nextEffect; ) {
|
|
root = nextEffect;
|
|
firstChild = root.deletions;
|
|
if (null !== firstChild)
|
|
for (var i = 0; i < firstChild.length; i++)
|
|
doesFiberContain(firstChild[i], focusedInstanceHandle) &&
|
|
(shouldFireAfterActiveInstanceBlur = !0);
|
|
firstChild = root.child;
|
|
if (0 !== (root.subtreeFlags & 516) && null !== firstChild)
|
|
(firstChild.return = root), (nextEffect = firstChild);
|
|
else
|
|
for (; null !== nextEffect; ) {
|
|
root = nextEffect;
|
|
try {
|
|
var current = root.alternate,
|
|
flags = root.flags;
|
|
if (
|
|
!shouldFireAfterActiveInstanceBlur &&
|
|
null !== focusedInstanceHandle
|
|
) {
|
|
var JSCompiler_temp;
|
|
if ((JSCompiler_temp = 13 === root.tag))
|
|
a: {
|
|
if (null !== current) {
|
|
var oldState = current.memoizedState;
|
|
if (null === oldState || null !== oldState.dehydrated) {
|
|
var newState = root.memoizedState;
|
|
JSCompiler_temp =
|
|
null !== newState && null === newState.dehydrated;
|
|
break a;
|
|
}
|
|
}
|
|
JSCompiler_temp = !1;
|
|
}
|
|
JSCompiler_temp &&
|
|
doesFiberContain(root, focusedInstanceHandle) &&
|
|
(shouldFireAfterActiveInstanceBlur = !0);
|
|
}
|
|
if (0 !== (flags & 512))
|
|
switch (root.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 15:
|
|
break;
|
|
case 1:
|
|
if (null !== current) {
|
|
var prevProps = current.memoizedProps,
|
|
prevState = current.memoizedState,
|
|
instance = root.stateNode,
|
|
snapshot = instance.getSnapshotBeforeUpdate(
|
|
root.elementType === root.type
|
|
? prevProps
|
|
: resolveDefaultProps(root.type, prevProps),
|
|
prevState
|
|
);
|
|
instance.__reactInternalSnapshotBeforeUpdate = snapshot;
|
|
}
|
|
break;
|
|
case 3:
|
|
break;
|
|
case 5:
|
|
case 6:
|
|
case 4:
|
|
case 17:
|
|
break;
|
|
default:
|
|
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."
|
|
);
|
|
}
|
|
} catch (error) {
|
|
captureCommitPhaseError(root, root.return, error);
|
|
}
|
|
firstChild = root.sibling;
|
|
if (null !== firstChild) {
|
|
firstChild.return = root.return;
|
|
nextEffect = firstChild;
|
|
break;
|
|
}
|
|
nextEffect = root.return;
|
|
}
|
|
}
|
|
current = shouldFireAfterActiveInstanceBlur;
|
|
shouldFireAfterActiveInstanceBlur = !1;
|
|
focusedInstanceHandle = null;
|
|
return current;
|
|
}
|
|
function commitHookEffectListUnmount(
|
|
flags,
|
|
finishedWork,
|
|
nearestMountedAncestor$jscomp$0
|
|
) {
|
|
var updateQueue = finishedWork.updateQueue;
|
|
updateQueue = null !== updateQueue ? updateQueue.lastEffect : null;
|
|
if (null !== updateQueue) {
|
|
var effect = (updateQueue = updateQueue.next);
|
|
do {
|
|
if ((effect.tag & flags) === flags) {
|
|
var destroy = effect.destroy;
|
|
effect.destroy = void 0;
|
|
if (void 0 !== destroy) {
|
|
var current = finishedWork,
|
|
nearestMountedAncestor = nearestMountedAncestor$jscomp$0;
|
|
try {
|
|
destroy();
|
|
} catch (error) {
|
|
captureCommitPhaseError(current, nearestMountedAncestor, error);
|
|
}
|
|
}
|
|
}
|
|
effect = effect.next;
|
|
} while (effect !== updateQueue);
|
|
}
|
|
}
|
|
function commitHookEffectListMount(tag, finishedWork) {
|
|
finishedWork = finishedWork.updateQueue;
|
|
finishedWork = null !== finishedWork ? finishedWork.lastEffect : null;
|
|
if (null !== finishedWork) {
|
|
var effect = (finishedWork = finishedWork.next);
|
|
do {
|
|
if ((effect.tag & tag) === tag) {
|
|
var create$84 = effect.create;
|
|
effect.destroy = create$84();
|
|
}
|
|
effect = effect.next;
|
|
} while (effect !== finishedWork);
|
|
}
|
|
}
|
|
function hideOrUnhideAllChildren(finishedWork, isHidden) {
|
|
for (var node = finishedWork; ; ) {
|
|
if (5 === node.tag) {
|
|
var instance = node.stateNode;
|
|
if (isHidden) {
|
|
var viewConfig = instance.viewConfig;
|
|
var updatePayload = diffProperties(
|
|
null,
|
|
emptyObject,
|
|
{ style: { display: "none" } },
|
|
viewConfig.validAttributes
|
|
);
|
|
ReactNativePrivateInterface.UIManager.updateView(
|
|
instance._nativeTag,
|
|
viewConfig.uiViewClassName,
|
|
updatePayload
|
|
);
|
|
} else {
|
|
instance = node.stateNode;
|
|
updatePayload = node.memoizedProps;
|
|
viewConfig = instance.viewConfig;
|
|
var prevProps = Object.assign({}, updatePayload, {
|
|
style: [updatePayload.style, { display: "none" }]
|
|
});
|
|
updatePayload = diffProperties(
|
|
null,
|
|
prevProps,
|
|
updatePayload,
|
|
viewConfig.validAttributes
|
|
);
|
|
ReactNativePrivateInterface.UIManager.updateView(
|
|
instance._nativeTag,
|
|
viewConfig.uiViewClassName,
|
|
updatePayload
|
|
);
|
|
}
|
|
} else {
|
|
if (6 === node.tag) throw Error("Not yet implemented.");
|
|
if (
|
|
((22 !== node.tag && 23 !== node.tag) ||
|
|
null === node.memoizedState ||
|
|
node === finishedWork) &&
|
|
null !== node.child
|
|
) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
}
|
|
if (node === finishedWork) break;
|
|
for (; null === node.sibling; ) {
|
|
if (null === node.return || node.return === finishedWork) return;
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
}
|
|
function commitUnmount(finishedRoot, current, nearestMountedAncestor$jscomp$0) {
|
|
if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount)
|
|
try {
|
|
injectedHook.onCommitFiberUnmount(rendererID, current);
|
|
} catch (err) {}
|
|
switch (current.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 14:
|
|
case 15:
|
|
finishedRoot = current.updateQueue;
|
|
if (
|
|
null !== finishedRoot &&
|
|
((finishedRoot = finishedRoot.lastEffect), null !== finishedRoot)
|
|
) {
|
|
var effect = (finishedRoot = finishedRoot.next);
|
|
do {
|
|
var _effect = effect,
|
|
destroy = _effect.destroy;
|
|
_effect = _effect.tag;
|
|
if (void 0 !== destroy && 0 !== (_effect & 2)) {
|
|
_effect = current;
|
|
var nearestMountedAncestor = nearestMountedAncestor$jscomp$0;
|
|
try {
|
|
destroy();
|
|
} catch (error) {
|
|
captureCommitPhaseError(_effect, nearestMountedAncestor, error);
|
|
}
|
|
}
|
|
effect = effect.next;
|
|
} while (effect !== finishedRoot);
|
|
}
|
|
break;
|
|
case 1:
|
|
safelyDetachRef(current, nearestMountedAncestor$jscomp$0);
|
|
finishedRoot = current.stateNode;
|
|
if ("function" === typeof finishedRoot.componentWillUnmount)
|
|
try {
|
|
(finishedRoot.props = current.memoizedProps),
|
|
(finishedRoot.state = current.memoizedState),
|
|
finishedRoot.componentWillUnmount();
|
|
} catch (unmountError) {
|
|
captureCommitPhaseError(
|
|
current,
|
|
nearestMountedAncestor$jscomp$0,
|
|
unmountError
|
|
);
|
|
}
|
|
break;
|
|
case 5:
|
|
safelyDetachRef(current, nearestMountedAncestor$jscomp$0);
|
|
break;
|
|
case 4:
|
|
unmountHostComponents(
|
|
finishedRoot,
|
|
current,
|
|
nearestMountedAncestor$jscomp$0
|
|
);
|
|
}
|
|
}
|
|
function detachFiberAfterEffects(fiber) {
|
|
fiber.alternate = null;
|
|
fiber.child = null;
|
|
fiber.deletions = null;
|
|
fiber.dependencies = null;
|
|
fiber.memoizedProps = null;
|
|
fiber.memoizedState = null;
|
|
fiber.pendingProps = null;
|
|
fiber.sibling = null;
|
|
fiber.stateNode = null;
|
|
fiber.updateQueue = null;
|
|
}
|
|
function isHostParent(fiber) {
|
|
return 5 === fiber.tag || 3 === fiber.tag || 4 === fiber.tag;
|
|
}
|
|
function commitPlacement(finishedWork) {
|
|
a: {
|
|
for (var parent = finishedWork.return; null !== parent; ) {
|
|
if (isHostParent(parent)) break a;
|
|
parent = parent.return;
|
|
}
|
|
throw Error(
|
|
"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
}
|
|
var parentFiber = parent;
|
|
parent = parentFiber.stateNode;
|
|
switch (parentFiber.tag) {
|
|
case 5:
|
|
var isContainer = !1;
|
|
break;
|
|
case 3:
|
|
parent = parent.containerInfo;
|
|
isContainer = !0;
|
|
break;
|
|
case 4:
|
|
parent = parent.containerInfo;
|
|
isContainer = !0;
|
|
break;
|
|
default:
|
|
throw Error(
|
|
"Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
}
|
|
parentFiber.flags & 32 && (parentFiber.flags &= -33);
|
|
a: b: for (parentFiber = finishedWork; ; ) {
|
|
for (; null === parentFiber.sibling; ) {
|
|
if (null === parentFiber.return || isHostParent(parentFiber.return)) {
|
|
parentFiber = null;
|
|
break a;
|
|
}
|
|
parentFiber = parentFiber.return;
|
|
}
|
|
parentFiber.sibling.return = parentFiber.return;
|
|
for (
|
|
parentFiber = parentFiber.sibling;
|
|
5 !== parentFiber.tag && 6 !== parentFiber.tag && 18 !== parentFiber.tag;
|
|
|
|
) {
|
|
if (parentFiber.flags & 2) continue b;
|
|
if (null === parentFiber.child || 4 === parentFiber.tag) continue b;
|
|
else
|
|
(parentFiber.child.return = parentFiber),
|
|
(parentFiber = parentFiber.child);
|
|
}
|
|
if (!(parentFiber.flags & 2)) {
|
|
parentFiber = parentFiber.stateNode;
|
|
break a;
|
|
}
|
|
}
|
|
isContainer
|
|
? insertOrAppendPlacementNodeIntoContainer(
|
|
finishedWork,
|
|
parentFiber,
|
|
parent
|
|
)
|
|
: insertOrAppendPlacementNode(finishedWork, parentFiber, parent);
|
|
}
|
|
function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
|
|
var tag = node.tag,
|
|
isHost = 5 === tag || 6 === tag;
|
|
if (isHost)
|
|
if (((node = isHost ? node.stateNode : node.stateNode.instance), before)) {
|
|
if ("number" === typeof parent)
|
|
throw Error("Container does not support insertBefore operation");
|
|
} else
|
|
ReactNativePrivateInterface.UIManager.setChildren(parent, [
|
|
"number" === typeof node ? node : node._nativeTag
|
|
]);
|
|
else if (4 !== tag && ((node = node.child), null !== node))
|
|
for (
|
|
insertOrAppendPlacementNodeIntoContainer(node, before, parent),
|
|
node = node.sibling;
|
|
null !== node;
|
|
|
|
)
|
|
insertOrAppendPlacementNodeIntoContainer(node, before, parent),
|
|
(node = node.sibling);
|
|
}
|
|
function insertOrAppendPlacementNode(node, before, parent) {
|
|
var tag = node.tag,
|
|
isHost = 5 === tag || 6 === tag;
|
|
if (isHost)
|
|
(node = isHost ? node.stateNode : node.stateNode.instance),
|
|
before
|
|
? ((tag = parent._children),
|
|
(isHost = tag.indexOf(node)),
|
|
0 <= isHost
|
|
? (tag.splice(isHost, 1),
|
|
(before = tag.indexOf(before)),
|
|
tag.splice(before, 0, node),
|
|
ReactNativePrivateInterface.UIManager.manageChildren(
|
|
parent._nativeTag,
|
|
[isHost],
|
|
[before],
|
|
[],
|
|
[],
|
|
[]
|
|
))
|
|
: ((before = tag.indexOf(before)),
|
|
tag.splice(before, 0, node),
|
|
ReactNativePrivateInterface.UIManager.manageChildren(
|
|
parent._nativeTag,
|
|
[],
|
|
[],
|
|
["number" === typeof node ? node : node._nativeTag],
|
|
[before],
|
|
[]
|
|
)))
|
|
: ((before = "number" === typeof node ? node : node._nativeTag),
|
|
(tag = parent._children),
|
|
(isHost = tag.indexOf(node)),
|
|
0 <= isHost
|
|
? (tag.splice(isHost, 1),
|
|
tag.push(node),
|
|
ReactNativePrivateInterface.UIManager.manageChildren(
|
|
parent._nativeTag,
|
|
[isHost],
|
|
[tag.length - 1],
|
|
[],
|
|
[],
|
|
[]
|
|
))
|
|
: (tag.push(node),
|
|
ReactNativePrivateInterface.UIManager.manageChildren(
|
|
parent._nativeTag,
|
|
[],
|
|
[],
|
|
[before],
|
|
[tag.length - 1],
|
|
[]
|
|
)));
|
|
else if (4 !== tag && ((node = node.child), null !== node))
|
|
for (
|
|
insertOrAppendPlacementNode(node, before, parent), node = node.sibling;
|
|
null !== node;
|
|
|
|
)
|
|
insertOrAppendPlacementNode(node, before, parent), (node = node.sibling);
|
|
}
|
|
function unmountHostComponents(
|
|
finishedRoot$jscomp$0,
|
|
current,
|
|
nearestMountedAncestor$jscomp$0
|
|
) {
|
|
for (
|
|
var node = current,
|
|
currentParentIsValid = !1,
|
|
currentParent,
|
|
currentParentIsContainer;
|
|
;
|
|
|
|
) {
|
|
if (!currentParentIsValid) {
|
|
currentParentIsValid = node.return;
|
|
a: for (;;) {
|
|
if (null === currentParentIsValid)
|
|
throw Error(
|
|
"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
currentParent = currentParentIsValid.stateNode;
|
|
switch (currentParentIsValid.tag) {
|
|
case 5:
|
|
currentParentIsContainer = !1;
|
|
break a;
|
|
case 3:
|
|
currentParent = currentParent.containerInfo;
|
|
currentParentIsContainer = !0;
|
|
break a;
|
|
case 4:
|
|
currentParent = currentParent.containerInfo;
|
|
currentParentIsContainer = !0;
|
|
break a;
|
|
}
|
|
currentParentIsValid = currentParentIsValid.return;
|
|
}
|
|
currentParentIsValid = !0;
|
|
}
|
|
if (5 === node.tag || 6 === node.tag) {
|
|
a: for (
|
|
var finishedRoot = finishedRoot$jscomp$0,
|
|
root = node,
|
|
nearestMountedAncestor = nearestMountedAncestor$jscomp$0,
|
|
node$jscomp$0 = root;
|
|
;
|
|
|
|
)
|
|
if (
|
|
(commitUnmount(finishedRoot, node$jscomp$0, nearestMountedAncestor),
|
|
null !== node$jscomp$0.child && 4 !== node$jscomp$0.tag)
|
|
)
|
|
(node$jscomp$0.child.return = node$jscomp$0),
|
|
(node$jscomp$0 = node$jscomp$0.child);
|
|
else {
|
|
if (node$jscomp$0 === root) break a;
|
|
for (; null === node$jscomp$0.sibling; ) {
|
|
if (null === node$jscomp$0.return || node$jscomp$0.return === root)
|
|
break a;
|
|
node$jscomp$0 = node$jscomp$0.return;
|
|
}
|
|
node$jscomp$0.sibling.return = node$jscomp$0.return;
|
|
node$jscomp$0 = node$jscomp$0.sibling;
|
|
}
|
|
currentParentIsContainer
|
|
? ((finishedRoot = currentParent),
|
|
recursivelyUncacheFiberNode(node.stateNode),
|
|
ReactNativePrivateInterface.UIManager.manageChildren(
|
|
finishedRoot,
|
|
[],
|
|
[],
|
|
[],
|
|
[],
|
|
[0]
|
|
))
|
|
: ((finishedRoot = currentParent),
|
|
(nearestMountedAncestor = node.stateNode),
|
|
recursivelyUncacheFiberNode(nearestMountedAncestor),
|
|
(root = finishedRoot._children),
|
|
(nearestMountedAncestor = root.indexOf(nearestMountedAncestor)),
|
|
root.splice(nearestMountedAncestor, 1),
|
|
ReactNativePrivateInterface.UIManager.manageChildren(
|
|
finishedRoot._nativeTag,
|
|
[],
|
|
[],
|
|
[],
|
|
[],
|
|
[nearestMountedAncestor]
|
|
));
|
|
} else if (4 === node.tag) {
|
|
if (null !== node.child) {
|
|
currentParent = node.stateNode.containerInfo;
|
|
currentParentIsContainer = !0;
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
} else if (
|
|
(commitUnmount(
|
|
finishedRoot$jscomp$0,
|
|
node,
|
|
nearestMountedAncestor$jscomp$0
|
|
),
|
|
null !== node.child)
|
|
) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === current) break;
|
|
for (; null === node.sibling; ) {
|
|
if (null === node.return || node.return === current) return;
|
|
node = node.return;
|
|
4 === node.tag && (currentParentIsValid = !1);
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
}
|
|
function commitWork(current, finishedWork) {
|
|
switch (finishedWork.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 14:
|
|
case 15:
|
|
commitHookEffectListUnmount(3, finishedWork, finishedWork.return);
|
|
return;
|
|
case 1:
|
|
return;
|
|
case 5:
|
|
var instance = finishedWork.stateNode;
|
|
if (null != instance) {
|
|
var newProps = finishedWork.memoizedProps;
|
|
current = null !== current ? current.memoizedProps : newProps;
|
|
var updatePayload = finishedWork.updateQueue;
|
|
finishedWork.updateQueue = null;
|
|
null !== updatePayload &&
|
|
((finishedWork = instance.viewConfig),
|
|
instanceProps.set(instance._nativeTag, newProps),
|
|
(newProps = diffProperties(
|
|
null,
|
|
current,
|
|
newProps,
|
|
finishedWork.validAttributes
|
|
)),
|
|
null != newProps &&
|
|
ReactNativePrivateInterface.UIManager.updateView(
|
|
instance._nativeTag,
|
|
finishedWork.uiViewClassName,
|
|
newProps
|
|
));
|
|
}
|
|
return;
|
|
case 6:
|
|
if (null === finishedWork.stateNode)
|
|
throw Error(
|
|
"This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
ReactNativePrivateInterface.UIManager.updateView(
|
|
finishedWork.stateNode,
|
|
"RCTRawText",
|
|
{ text: finishedWork.memoizedProps }
|
|
);
|
|
return;
|
|
case 3:
|
|
return;
|
|
case 12:
|
|
return;
|
|
case 13:
|
|
null !== finishedWork.memoizedState &&
|
|
((globalMostRecentFallbackTime = now()),
|
|
hideOrUnhideAllChildren(finishedWork.child, !0));
|
|
attachSuspenseRetryListeners(finishedWork);
|
|
return;
|
|
case 19:
|
|
attachSuspenseRetryListeners(finishedWork);
|
|
return;
|
|
case 17:
|
|
return;
|
|
case 22:
|
|
case 23:
|
|
hideOrUnhideAllChildren(
|
|
finishedWork,
|
|
null !== finishedWork.memoizedState
|
|
);
|
|
return;
|
|
}
|
|
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."
|
|
);
|
|
}
|
|
function attachSuspenseRetryListeners(finishedWork) {
|
|
var wakeables = finishedWork.updateQueue;
|
|
if (null !== wakeables) {
|
|
finishedWork.updateQueue = null;
|
|
var retryCache = finishedWork.stateNode;
|
|
null === retryCache &&
|
|
(retryCache = finishedWork.stateNode = new PossiblyWeakSet());
|
|
wakeables.forEach(function(wakeable) {
|
|
var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
|
|
retryCache.has(wakeable) ||
|
|
(!0 !== wakeable.__reactDoNotTraceInteractions &&
|
|
(retry = tracing.unstable_wrap(retry)),
|
|
retryCache.add(wakeable),
|
|
wakeable.then(retry, retry));
|
|
});
|
|
}
|
|
}
|
|
function commitMutationEffects(root, renderPriorityLevel, firstChild) {
|
|
for (nextEffect = firstChild; null !== nextEffect; ) {
|
|
renderPriorityLevel = nextEffect;
|
|
firstChild = renderPriorityLevel.deletions;
|
|
if (null !== firstChild)
|
|
for (var i = 0; i < firstChild.length; i++) {
|
|
var childToDelete = firstChild[i];
|
|
try {
|
|
unmountHostComponents(root, childToDelete, renderPriorityLevel);
|
|
var alternate = childToDelete.alternate;
|
|
childToDelete.return = null;
|
|
null !== alternate && (alternate.return = null);
|
|
} catch (error) {
|
|
captureCommitPhaseError(childToDelete, renderPriorityLevel, error);
|
|
}
|
|
}
|
|
firstChild = renderPriorityLevel.child;
|
|
if (0 !== (renderPriorityLevel.subtreeFlags & 6454) && null !== firstChild)
|
|
(firstChild.return = renderPriorityLevel), (nextEffect = firstChild);
|
|
else
|
|
for (; null !== nextEffect; ) {
|
|
renderPriorityLevel = nextEffect;
|
|
try {
|
|
var flags = renderPriorityLevel.flags;
|
|
if (flags & 256) {
|
|
var current = renderPriorityLevel.alternate;
|
|
if (null !== current) {
|
|
var currentRef = current.ref;
|
|
null !== currentRef &&
|
|
("function" === typeof currentRef
|
|
? currentRef(null)
|
|
: (currentRef.current = null));
|
|
}
|
|
}
|
|
switch (flags & 2054) {
|
|
case 2:
|
|
commitPlacement(renderPriorityLevel);
|
|
renderPriorityLevel.flags &= -3;
|
|
break;
|
|
case 6:
|
|
commitPlacement(renderPriorityLevel);
|
|
renderPriorityLevel.flags &= -3;
|
|
commitWork(renderPriorityLevel.alternate, renderPriorityLevel);
|
|
break;
|
|
case 2048:
|
|
renderPriorityLevel.flags &= -2049;
|
|
break;
|
|
case 2052:
|
|
renderPriorityLevel.flags &= -2049;
|
|
commitWork(renderPriorityLevel.alternate, renderPriorityLevel);
|
|
break;
|
|
case 4:
|
|
commitWork(renderPriorityLevel.alternate, renderPriorityLevel);
|
|
}
|
|
} catch (error) {
|
|
captureCommitPhaseError(
|
|
renderPriorityLevel,
|
|
renderPriorityLevel.return,
|
|
error
|
|
);
|
|
}
|
|
firstChild = renderPriorityLevel.sibling;
|
|
if (null !== firstChild) {
|
|
firstChild.return = renderPriorityLevel.return;
|
|
nextEffect = firstChild;
|
|
break;
|
|
}
|
|
nextEffect = renderPriorityLevel.return;
|
|
}
|
|
}
|
|
}
|
|
function commitLayoutEffects(finishedWork, root) {
|
|
for (nextEffect = finishedWork; null !== nextEffect; ) {
|
|
var fiber = nextEffect,
|
|
firstChild = fiber.child;
|
|
if (0 !== (fiber.subtreeFlags & 324) && null !== firstChild)
|
|
(firstChild.return = fiber), (nextEffect = firstChild);
|
|
else
|
|
for (fiber = finishedWork, firstChild = root; null !== nextEffect; ) {
|
|
var fiber$jscomp$0 = nextEffect;
|
|
if (0 !== (fiber$jscomp$0.flags & 324)) {
|
|
var current = fiber$jscomp$0.alternate;
|
|
try {
|
|
var finishedRoot = firstChild;
|
|
if (0 !== (fiber$jscomp$0.flags & 68))
|
|
switch (fiber$jscomp$0.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 15:
|
|
commitHookEffectListMount(3, fiber$jscomp$0);
|
|
break;
|
|
case 1:
|
|
var instance = fiber$jscomp$0.stateNode;
|
|
if (fiber$jscomp$0.flags & 4)
|
|
if (null === current) instance.componentDidMount();
|
|
else {
|
|
var prevProps =
|
|
fiber$jscomp$0.elementType === fiber$jscomp$0.type
|
|
? current.memoizedProps
|
|
: resolveDefaultProps(
|
|
fiber$jscomp$0.type,
|
|
current.memoizedProps
|
|
);
|
|
instance.componentDidUpdate(
|
|
prevProps,
|
|
current.memoizedState,
|
|
instance.__reactInternalSnapshotBeforeUpdate
|
|
);
|
|
}
|
|
var updateQueue = fiber$jscomp$0.updateQueue;
|
|
null !== updateQueue &&
|
|
commitUpdateQueue(fiber$jscomp$0, updateQueue, instance);
|
|
break;
|
|
case 3:
|
|
var updateQueue$85 = fiber$jscomp$0.updateQueue;
|
|
if (null !== updateQueue$85) {
|
|
finishedRoot = null;
|
|
if (null !== fiber$jscomp$0.child)
|
|
switch (fiber$jscomp$0.child.tag) {
|
|
case 5:
|
|
finishedRoot = fiber$jscomp$0.child.stateNode;
|
|
break;
|
|
case 1:
|
|
finishedRoot = fiber$jscomp$0.child.stateNode;
|
|
}
|
|
commitUpdateQueue(
|
|
fiber$jscomp$0,
|
|
updateQueue$85,
|
|
finishedRoot
|
|
);
|
|
}
|
|
break;
|
|
case 5:
|
|
break;
|
|
case 6:
|
|
break;
|
|
case 4:
|
|
break;
|
|
case 12:
|
|
var onRender = fiber$jscomp$0.memoizedProps.onRender,
|
|
commitTime$88 = commitTime;
|
|
current = null === current ? "mount" : "update";
|
|
"function" === typeof onRender &&
|
|
onRender(
|
|
fiber$jscomp$0.memoizedProps.id,
|
|
current,
|
|
fiber$jscomp$0.actualDuration,
|
|
fiber$jscomp$0.treeBaseDuration,
|
|
fiber$jscomp$0.actualStartTime,
|
|
commitTime$88,
|
|
finishedRoot.memoizedInteractions
|
|
);
|
|
break;
|
|
case 13:
|
|
break;
|
|
case 19:
|
|
case 17:
|
|
case 21:
|
|
case 22:
|
|
case 23:
|
|
break;
|
|
default:
|
|
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."
|
|
);
|
|
}
|
|
if (fiber$jscomp$0.flags & 256) {
|
|
finishedRoot = void 0;
|
|
var ref = fiber$jscomp$0.ref;
|
|
if (null !== ref) {
|
|
var instance$jscomp$0 = fiber$jscomp$0.stateNode;
|
|
switch (fiber$jscomp$0.tag) {
|
|
case 5:
|
|
finishedRoot = instance$jscomp$0;
|
|
break;
|
|
default:
|
|
finishedRoot = instance$jscomp$0;
|
|
}
|
|
"function" === typeof ref
|
|
? ref(finishedRoot)
|
|
: (ref.current = finishedRoot);
|
|
}
|
|
}
|
|
} catch (error) {
|
|
captureCommitPhaseError(
|
|
fiber$jscomp$0,
|
|
fiber$jscomp$0.return,
|
|
error
|
|
);
|
|
}
|
|
}
|
|
if (fiber$jscomp$0 === fiber) {
|
|
nextEffect = null;
|
|
break;
|
|
}
|
|
finishedRoot = fiber$jscomp$0.sibling;
|
|
if (null !== finishedRoot) {
|
|
finishedRoot.return = fiber$jscomp$0.return;
|
|
nextEffect = finishedRoot;
|
|
break;
|
|
}
|
|
nextEffect = fiber$jscomp$0.return;
|
|
}
|
|
}
|
|
}
|
|
var ceil = Math.ceil,
|
|
ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher,
|
|
ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,
|
|
executionContext = 0,
|
|
workInProgressRoot = null,
|
|
workInProgress = null,
|
|
workInProgressRootRenderLanes = 0,
|
|
subtreeRenderLanes = 0,
|
|
subtreeRenderLanesCursor = createCursor(0),
|
|
workInProgressRootExitStatus = 0,
|
|
workInProgressRootFatalError = null,
|
|
workInProgressRootSkippedLanes = 0,
|
|
workInProgressRootUpdatedLanes = 0,
|
|
workInProgressRootPingedLanes = 0,
|
|
globalMostRecentFallbackTime = 0,
|
|
workInProgressRootRenderTargetTime = Infinity,
|
|
hasUncaughtError = !1,
|
|
firstUncaughtError = null,
|
|
legacyErrorBoundariesThatAlreadyFailed = null,
|
|
rootDoesHavePassiveEffects = !1,
|
|
rootWithPendingPassiveEffects = null,
|
|
pendingPassiveEffectsRenderPriority = 90,
|
|
pendingPassiveEffectsLanes = 0,
|
|
rootsWithPendingDiscreteUpdates = null,
|
|
nestedUpdateCount = 0,
|
|
rootWithNestedUpdates = null,
|
|
spawnedWorkDuringRender = null,
|
|
currentEventTime = -1,
|
|
currentEventTransitionLane = 0;
|
|
function requestEventTime() {
|
|
return 0 !== (executionContext & 48)
|
|
? now()
|
|
: -1 !== currentEventTime
|
|
? currentEventTime
|
|
: (currentEventTime = now());
|
|
}
|
|
function requestUpdateLane(fiber) {
|
|
fiber = fiber.mode;
|
|
if (0 === (fiber & 1)) return 1;
|
|
if (0 === (fiber & 2)) return 99 === getCurrentPriorityLevel() ? 1 : 2;
|
|
if (0 !== ReactCurrentBatchConfig.transition)
|
|
return (
|
|
0 === currentEventTransitionLane &&
|
|
((fiber = nextTransitionLane),
|
|
(nextTransitionLane <<= 1),
|
|
0 === (nextTransitionLane & 8388096) && (nextTransitionLane = 512),
|
|
(currentEventTransitionLane = fiber)),
|
|
currentEventTransitionLane
|
|
);
|
|
fiber = getCurrentPriorityLevel();
|
|
0 !== (executionContext & 4) && 98 === fiber
|
|
? (fiber = findUpdateLane(12))
|
|
: ((fiber = schedulerPriorityToLanePriority(fiber)),
|
|
(fiber = findUpdateLane(fiber)));
|
|
return fiber;
|
|
}
|
|
function scheduleUpdateOnFiber(fiber, lane, eventTime) {
|
|
if (50 < nestedUpdateCount)
|
|
throw ((nestedUpdateCount = 0),
|
|
(rootWithNestedUpdates = null),
|
|
Error(
|
|
"Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops."
|
|
));
|
|
fiber = markUpdateLaneFromFiberToRoot(fiber, lane);
|
|
if (null === fiber) return null;
|
|
markRootUpdated(fiber, lane, eventTime);
|
|
fiber === workInProgressRoot &&
|
|
((workInProgressRootUpdatedLanes |= lane),
|
|
4 === workInProgressRootExitStatus &&
|
|
markRootSuspended$1(fiber, workInProgressRootRenderLanes));
|
|
var priorityLevel = getCurrentPriorityLevel();
|
|
1 === lane
|
|
? 0 !== (executionContext & 8) && 0 === (executionContext & 48)
|
|
? (schedulePendingInteractions(fiber, lane), performSyncWorkOnRoot(fiber))
|
|
: (ensureRootIsScheduled(fiber, eventTime),
|
|
schedulePendingInteractions(fiber, lane),
|
|
0 === executionContext &&
|
|
((workInProgressRootRenderTargetTime = now() + 500),
|
|
flushSyncCallbackQueue()))
|
|
: (0 === (executionContext & 4) ||
|
|
(98 !== priorityLevel && 99 !== priorityLevel) ||
|
|
(null === rootsWithPendingDiscreteUpdates
|
|
? (rootsWithPendingDiscreteUpdates = new Set([fiber]))
|
|
: rootsWithPendingDiscreteUpdates.add(fiber)),
|
|
ensureRootIsScheduled(fiber, eventTime),
|
|
schedulePendingInteractions(fiber, lane));
|
|
return fiber;
|
|
}
|
|
function markUpdateLaneFromFiberToRoot(sourceFiber, lane) {
|
|
sourceFiber.lanes |= lane;
|
|
var alternate = sourceFiber.alternate;
|
|
null !== alternate && (alternate.lanes |= lane);
|
|
alternate = sourceFiber;
|
|
for (sourceFiber = sourceFiber.return; null !== sourceFiber; )
|
|
(sourceFiber.childLanes |= lane),
|
|
(alternate = sourceFiber.alternate),
|
|
null !== alternate && (alternate.childLanes |= lane),
|
|
(alternate = sourceFiber),
|
|
(sourceFiber = sourceFiber.return);
|
|
return 3 === alternate.tag ? alternate.stateNode : null;
|
|
}
|
|
function ensureRootIsScheduled(root, currentTime) {
|
|
for (
|
|
var existingCallbackNode = root.callbackNode,
|
|
suspendedLanes = root.suspendedLanes,
|
|
pingedLanes = root.pingedLanes,
|
|
expirationTimes = root.expirationTimes,
|
|
lanes = root.pendingLanes;
|
|
0 < lanes;
|
|
|
|
) {
|
|
var index$6 = 31 - clz32(lanes),
|
|
lane = 1 << index$6,
|
|
expirationTime = expirationTimes[index$6];
|
|
if (-1 === expirationTime) {
|
|
if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) {
|
|
expirationTime = currentTime;
|
|
getHighestPriorityLanes(lane);
|
|
var priority = return_highestLanePriority;
|
|
expirationTimes[index$6] =
|
|
10 <= priority
|
|
? expirationTime + 250
|
|
: 6 <= priority
|
|
? expirationTime + 5e3
|
|
: -1;
|
|
}
|
|
} else expirationTime <= currentTime && (root.expiredLanes |= lane);
|
|
lanes &= ~lane;
|
|
}
|
|
suspendedLanes = getNextLanes(
|
|
root,
|
|
root === workInProgressRoot ? workInProgressRootRenderLanes : 0
|
|
);
|
|
currentTime = return_highestLanePriority;
|
|
0 === suspendedLanes
|
|
? (null !== existingCallbackNode &&
|
|
Scheduler_cancelCallback(existingCallbackNode),
|
|
(root.callbackNode = null),
|
|
(root.callbackPriority = 0))
|
|
: root.callbackPriority !== currentTime &&
|
|
(null != existingCallbackNode &&
|
|
Scheduler_cancelCallback(existingCallbackNode),
|
|
15 === currentTime
|
|
? ((existingCallbackNode = performSyncWorkOnRoot.bind(null, root)),
|
|
null === syncQueue
|
|
? ((syncQueue = [existingCallbackNode]),
|
|
(immediateQueueCallbackNode = Scheduler_scheduleCallback(
|
|
Scheduler_ImmediatePriority,
|
|
flushSyncCallbackQueueImpl
|
|
)))
|
|
: syncQueue.push(existingCallbackNode),
|
|
(existingCallbackNode = null))
|
|
: 14 === currentTime
|
|
? (existingCallbackNode = scheduleCallback(
|
|
99,
|
|
performSyncWorkOnRoot.bind(null, root)
|
|
))
|
|
: ((existingCallbackNode = lanePriorityToSchedulerPriority(
|
|
currentTime
|
|
)),
|
|
(existingCallbackNode = scheduleCallback(
|
|
existingCallbackNode,
|
|
performConcurrentWorkOnRoot.bind(null, root)
|
|
))),
|
|
(root.callbackPriority = currentTime),
|
|
(root.callbackNode = existingCallbackNode));
|
|
}
|
|
function performConcurrentWorkOnRoot(root, didTimeout) {
|
|
currentEventTime = -1;
|
|
currentEventTransitionLane = 0;
|
|
if (0 !== (executionContext & 48))
|
|
throw Error("Should not already be working.");
|
|
var originalCallbackNode = root.callbackNode;
|
|
if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode)
|
|
return null;
|
|
var lanes = getNextLanes(
|
|
root,
|
|
root === workInProgressRoot ? workInProgressRootRenderLanes : 0
|
|
);
|
|
if (0 === lanes) return null;
|
|
if (didTimeout)
|
|
return (
|
|
(root.expiredLanes |= lanes & root.pendingLanes),
|
|
ensureRootIsScheduled(root, now()),
|
|
null
|
|
);
|
|
var lanes$jscomp$0 = lanes;
|
|
didTimeout = executionContext;
|
|
executionContext |= 16;
|
|
var prevDispatcher = pushDispatcher();
|
|
if (
|
|
workInProgressRoot !== root ||
|
|
workInProgressRootRenderLanes !== lanes$jscomp$0
|
|
)
|
|
(workInProgressRootRenderTargetTime = now() + 500),
|
|
prepareFreshStack(root, lanes$jscomp$0),
|
|
startWorkOnPendingInteractions(root, lanes$jscomp$0);
|
|
lanes$jscomp$0 = pushInteractions(root);
|
|
do
|
|
try {
|
|
workLoopConcurrent();
|
|
break;
|
|
} catch (thrownValue) {
|
|
handleError(root, thrownValue);
|
|
}
|
|
while (1);
|
|
resetContextDependencies();
|
|
tracing.__interactionsRef.current = lanes$jscomp$0;
|
|
ReactCurrentDispatcher$2.current = prevDispatcher;
|
|
executionContext = didTimeout;
|
|
null !== workInProgress
|
|
? (didTimeout = 0)
|
|
: ((workInProgressRoot = null),
|
|
(workInProgressRootRenderLanes = 0),
|
|
(didTimeout = workInProgressRootExitStatus));
|
|
if (0 !== didTimeout) {
|
|
2 === didTimeout &&
|
|
((executionContext |= 64),
|
|
root.hydrate && (root.hydrate = !1),
|
|
(lanes = getLanesToRetrySynchronouslyOnError(root)),
|
|
0 !== lanes && (didTimeout = renderRootSync(root, lanes)));
|
|
if (1 === didTimeout)
|
|
throw ((originalCallbackNode = workInProgressRootFatalError),
|
|
prepareFreshStack(root, 0),
|
|
markRootSuspended$1(root, lanes),
|
|
ensureRootIsScheduled(root, now()),
|
|
originalCallbackNode);
|
|
root.finishedWork = root.current.alternate;
|
|
root.finishedLanes = lanes;
|
|
switch (didTimeout) {
|
|
case 0:
|
|
case 1:
|
|
throw Error("Root did not complete. This is a bug in React.");
|
|
case 2:
|
|
commitRoot(root);
|
|
break;
|
|
case 3:
|
|
markRootSuspended$1(root, lanes);
|
|
if (
|
|
(lanes & 125829120) === lanes &&
|
|
((didTimeout = globalMostRecentFallbackTime + 500 - now()),
|
|
10 < didTimeout)
|
|
) {
|
|
if (0 !== getNextLanes(root, 0)) break;
|
|
prevDispatcher = root.suspendedLanes;
|
|
if ((prevDispatcher & lanes) !== lanes) {
|
|
requestEventTime();
|
|
root.pingedLanes |= root.suspendedLanes & prevDispatcher;
|
|
break;
|
|
}
|
|
root.timeoutHandle = scheduleTimeout(
|
|
commitRoot.bind(null, root),
|
|
didTimeout
|
|
);
|
|
break;
|
|
}
|
|
commitRoot(root);
|
|
break;
|
|
case 4:
|
|
markRootSuspended$1(root, lanes);
|
|
if ((lanes & 8388096) === lanes) break;
|
|
didTimeout = root.eventTimes;
|
|
for (prevDispatcher = -1; 0 < lanes; ) {
|
|
var index$5 = 31 - clz32(lanes);
|
|
lanes$jscomp$0 = 1 << index$5;
|
|
index$5 = didTimeout[index$5];
|
|
index$5 > prevDispatcher && (prevDispatcher = index$5);
|
|
lanes &= ~lanes$jscomp$0;
|
|
}
|
|
lanes = prevDispatcher;
|
|
lanes = now() - lanes;
|
|
lanes =
|
|
(120 > lanes
|
|
? 120
|
|
: 480 > lanes
|
|
? 480
|
|
: 1080 > lanes
|
|
? 1080
|
|
: 1920 > lanes
|
|
? 1920
|
|
: 3e3 > lanes
|
|
? 3e3
|
|
: 4320 > lanes
|
|
? 4320
|
|
: 1960 * ceil(lanes / 1960)) - lanes;
|
|
if (10 < lanes) {
|
|
root.timeoutHandle = scheduleTimeout(
|
|
commitRoot.bind(null, root),
|
|
lanes
|
|
);
|
|
break;
|
|
}
|
|
commitRoot(root);
|
|
break;
|
|
case 5:
|
|
commitRoot(root);
|
|
break;
|
|
default:
|
|
throw Error("Unknown root exit status.");
|
|
}
|
|
}
|
|
ensureRootIsScheduled(root, now());
|
|
return root.callbackNode === originalCallbackNode
|
|
? performConcurrentWorkOnRoot.bind(null, root)
|
|
: null;
|
|
}
|
|
function markRootSuspended$1(root, suspendedLanes) {
|
|
suspendedLanes &= ~workInProgressRootPingedLanes;
|
|
suspendedLanes &= ~workInProgressRootUpdatedLanes;
|
|
root.suspendedLanes |= suspendedLanes;
|
|
root.pingedLanes &= ~suspendedLanes;
|
|
for (root = root.expirationTimes; 0 < suspendedLanes; ) {
|
|
var index$7 = 31 - clz32(suspendedLanes),
|
|
lane = 1 << index$7;
|
|
root[index$7] = -1;
|
|
suspendedLanes &= ~lane;
|
|
}
|
|
}
|
|
function performSyncWorkOnRoot(root) {
|
|
if (0 !== (executionContext & 48))
|
|
throw Error("Should not already be working.");
|
|
flushPassiveEffects();
|
|
var lanes =
|
|
root === workInProgressRoot &&
|
|
0 !== (root.expiredLanes & workInProgressRootRenderLanes)
|
|
? workInProgressRootRenderLanes
|
|
: getNextLanes(root, 0);
|
|
var exitStatus = renderRootSync(root, lanes);
|
|
0 !== root.tag &&
|
|
2 === exitStatus &&
|
|
((executionContext |= 64),
|
|
root.hydrate && (root.hydrate = !1),
|
|
(lanes = getLanesToRetrySynchronouslyOnError(root)),
|
|
0 !== lanes && (exitStatus = renderRootSync(root, lanes)));
|
|
if (1 === exitStatus)
|
|
throw ((exitStatus = workInProgressRootFatalError),
|
|
prepareFreshStack(root, 0),
|
|
markRootSuspended$1(root, lanes),
|
|
ensureRootIsScheduled(root, now()),
|
|
exitStatus);
|
|
root.finishedWork = root.current.alternate;
|
|
root.finishedLanes = lanes;
|
|
commitRoot(root);
|
|
ensureRootIsScheduled(root, now());
|
|
return null;
|
|
}
|
|
function popRenderLanes() {
|
|
subtreeRenderLanes = subtreeRenderLanesCursor.current;
|
|
pop(subtreeRenderLanesCursor);
|
|
}
|
|
function prepareFreshStack(root, lanes) {
|
|
root.finishedWork = null;
|
|
root.finishedLanes = 0;
|
|
var timeoutHandle = root.timeoutHandle;
|
|
-1 !== timeoutHandle &&
|
|
((root.timeoutHandle = -1), cancelTimeout(timeoutHandle));
|
|
if (null !== workInProgress)
|
|
for (timeoutHandle = workInProgress.return; null !== timeoutHandle; ) {
|
|
var interruptedWork = timeoutHandle;
|
|
switch (interruptedWork.tag) {
|
|
case 1:
|
|
interruptedWork = interruptedWork.type.childContextTypes;
|
|
null !== interruptedWork &&
|
|
void 0 !== interruptedWork &&
|
|
popContext();
|
|
break;
|
|
case 3:
|
|
popHostContainer();
|
|
pop(didPerformWorkStackCursor);
|
|
pop(contextStackCursor);
|
|
resetWorkInProgressVersions();
|
|
break;
|
|
case 5:
|
|
popHostContext(interruptedWork);
|
|
break;
|
|
case 4:
|
|
popHostContainer();
|
|
break;
|
|
case 13:
|
|
pop(suspenseStackCursor);
|
|
break;
|
|
case 19:
|
|
pop(suspenseStackCursor);
|
|
break;
|
|
case 10:
|
|
popProvider(interruptedWork.type._context);
|
|
break;
|
|
case 22:
|
|
case 23:
|
|
popRenderLanes();
|
|
}
|
|
timeoutHandle = timeoutHandle.return;
|
|
}
|
|
workInProgressRoot = root;
|
|
workInProgress = createWorkInProgress(root.current, null);
|
|
workInProgressRootRenderLanes = subtreeRenderLanes = lanes;
|
|
workInProgressRootExitStatus = 0;
|
|
workInProgressRootFatalError = null;
|
|
workInProgressRootPingedLanes = workInProgressRootUpdatedLanes = workInProgressRootSkippedLanes = 0;
|
|
if (null !== interleavedQueues) {
|
|
for (root = 0; root < interleavedQueues.length; root++)
|
|
if (
|
|
((lanes = interleavedQueues[root]),
|
|
(timeoutHandle = lanes.interleaved),
|
|
null !== timeoutHandle)
|
|
) {
|
|
lanes.interleaved = null;
|
|
interruptedWork = timeoutHandle.next;
|
|
var lastPendingUpdate = lanes.pending;
|
|
if (null !== lastPendingUpdate) {
|
|
var firstPendingUpdate = lastPendingUpdate.next;
|
|
lastPendingUpdate.next = interruptedWork;
|
|
timeoutHandle.next = firstPendingUpdate;
|
|
}
|
|
lanes.pending = timeoutHandle;
|
|
}
|
|
interleavedQueues = null;
|
|
}
|
|
spawnedWorkDuringRender = null;
|
|
}
|
|
function handleError(root$jscomp$0, thrownValue) {
|
|
do {
|
|
var erroredWork = workInProgress;
|
|
try {
|
|
resetContextDependencies();
|
|
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
|
if (didScheduleRenderPhaseUpdate) {
|
|
for (
|
|
var hook = currentlyRenderingFiber$1.memoizedState;
|
|
null !== hook;
|
|
|
|
) {
|
|
var queue = hook.queue;
|
|
null !== queue && (queue.pending = null);
|
|
hook = hook.next;
|
|
}
|
|
didScheduleRenderPhaseUpdate = !1;
|
|
}
|
|
renderLanes = 0;
|
|
workInProgressHook = currentHook = currentlyRenderingFiber$1 = null;
|
|
didScheduleRenderPhaseUpdateDuringThisPass = !1;
|
|
ReactCurrentOwner$2.current = null;
|
|
if (null === erroredWork || null === erroredWork.return) {
|
|
workInProgressRootExitStatus = 1;
|
|
workInProgressRootFatalError = thrownValue;
|
|
workInProgress = null;
|
|
break;
|
|
}
|
|
erroredWork.mode & 4 &&
|
|
stopProfilerTimerIfRunningAndRecordDelta(erroredWork, !0);
|
|
a: {
|
|
var root = root$jscomp$0,
|
|
returnFiber = erroredWork.return,
|
|
sourceFiber = erroredWork,
|
|
value = thrownValue;
|
|
thrownValue = workInProgressRootRenderLanes;
|
|
sourceFiber.flags |= 8192;
|
|
if (
|
|
null !== value &&
|
|
"object" === typeof value &&
|
|
"function" === typeof value.then
|
|
) {
|
|
var wakeable = value,
|
|
tag = sourceFiber.tag;
|
|
if (
|
|
0 === (sourceFiber.mode & 1) &&
|
|
(0 === tag || 11 === tag || 15 === tag)
|
|
) {
|
|
var currentSource = sourceFiber.alternate;
|
|
currentSource
|
|
? ((sourceFiber.updateQueue = currentSource.updateQueue),
|
|
(sourceFiber.memoizedState = currentSource.memoizedState),
|
|
(sourceFiber.lanes = currentSource.lanes))
|
|
: ((sourceFiber.updateQueue = null),
|
|
(sourceFiber.memoizedState = null));
|
|
}
|
|
var hasInvisibleParentBoundary =
|
|
0 !== (suspenseStackCursor.current & 1),
|
|
workInProgress$79 = returnFiber;
|
|
do {
|
|
var JSCompiler_temp;
|
|
if ((JSCompiler_temp = 13 === workInProgress$79.tag)) {
|
|
var nextState = workInProgress$79.memoizedState;
|
|
if (null !== nextState)
|
|
JSCompiler_temp = null !== nextState.dehydrated ? !0 : !1;
|
|
else {
|
|
var props = workInProgress$79.memoizedProps;
|
|
JSCompiler_temp =
|
|
void 0 === props.fallback
|
|
? !1
|
|
: !0 !== props.unstable_avoidThisFallback
|
|
? !0
|
|
: hasInvisibleParentBoundary
|
|
? !1
|
|
: !0;
|
|
}
|
|
}
|
|
if (JSCompiler_temp) {
|
|
var wakeables = workInProgress$79.updateQueue;
|
|
if (null === wakeables) {
|
|
var updateQueue = new Set();
|
|
updateQueue.add(wakeable);
|
|
workInProgress$79.updateQueue = updateQueue;
|
|
} else wakeables.add(wakeable);
|
|
if (
|
|
0 === (workInProgress$79.mode & 1) &&
|
|
workInProgress$79 !== returnFiber
|
|
) {
|
|
workInProgress$79.flags |= 128;
|
|
sourceFiber.flags |= 65536;
|
|
sourceFiber.flags &= -10053;
|
|
if (1 === sourceFiber.tag)
|
|
if (null === sourceFiber.alternate) sourceFiber.tag = 17;
|
|
else {
|
|
var update = createUpdate(-1, 1);
|
|
update.tag = 2;
|
|
enqueueUpdate(sourceFiber, update);
|
|
}
|
|
sourceFiber.lanes |= 1;
|
|
break a;
|
|
}
|
|
value = void 0;
|
|
sourceFiber = thrownValue;
|
|
var pingCache = root.pingCache;
|
|
null === pingCache
|
|
? ((pingCache = root.pingCache = new PossiblyWeakMap()),
|
|
(value = new Set()),
|
|
pingCache.set(wakeable, value))
|
|
: ((value = pingCache.get(wakeable)),
|
|
void 0 === value &&
|
|
((value = new Set()), pingCache.set(wakeable, value)));
|
|
if (!value.has(sourceFiber)) {
|
|
value.add(sourceFiber);
|
|
var ping = pingSuspendedRoot.bind(
|
|
null,
|
|
root,
|
|
wakeable,
|
|
sourceFiber
|
|
);
|
|
wakeable.then(ping, ping);
|
|
}
|
|
workInProgress$79.flags |= 16384;
|
|
workInProgress$79.lanes = thrownValue;
|
|
break a;
|
|
}
|
|
workInProgress$79 = workInProgress$79.return;
|
|
} while (null !== workInProgress$79);
|
|
value = Error(
|
|
(getComponentName(sourceFiber.type) || "A React component") +
|
|
" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."
|
|
);
|
|
}
|
|
5 !== workInProgressRootExitStatus &&
|
|
(workInProgressRootExitStatus = 2);
|
|
value = createCapturedValue(value, sourceFiber);
|
|
workInProgress$79 = returnFiber;
|
|
do {
|
|
switch (workInProgress$79.tag) {
|
|
case 3:
|
|
root = value;
|
|
workInProgress$79.flags |= 16384;
|
|
thrownValue &= -thrownValue;
|
|
workInProgress$79.lanes |= thrownValue;
|
|
var update$80 = createRootErrorUpdate(
|
|
workInProgress$79,
|
|
root,
|
|
thrownValue
|
|
);
|
|
enqueueCapturedUpdate(workInProgress$79, update$80);
|
|
break a;
|
|
case 1:
|
|
root = value;
|
|
var ctor = workInProgress$79.type,
|
|
instance = workInProgress$79.stateNode;
|
|
if (
|
|
0 === (workInProgress$79.flags & 128) &&
|
|
("function" === typeof ctor.getDerivedStateFromError ||
|
|
(null !== instance &&
|
|
"function" === typeof instance.componentDidCatch &&
|
|
(null === legacyErrorBoundariesThatAlreadyFailed ||
|
|
!legacyErrorBoundariesThatAlreadyFailed.has(instance))))
|
|
) {
|
|
workInProgress$79.flags |= 16384;
|
|
thrownValue &= -thrownValue;
|
|
workInProgress$79.lanes |= thrownValue;
|
|
var update$83 = createClassErrorUpdate(
|
|
workInProgress$79,
|
|
root,
|
|
thrownValue
|
|
);
|
|
enqueueCapturedUpdate(workInProgress$79, update$83);
|
|
break a;
|
|
}
|
|
}
|
|
workInProgress$79 = workInProgress$79.return;
|
|
} while (null !== workInProgress$79);
|
|
}
|
|
completeUnitOfWork(erroredWork);
|
|
} catch (yetAnotherThrownValue) {
|
|
thrownValue = yetAnotherThrownValue;
|
|
workInProgress === erroredWork &&
|
|
null !== erroredWork &&
|
|
(workInProgress = erroredWork = erroredWork.return);
|
|
continue;
|
|
}
|
|
break;
|
|
} while (1);
|
|
}
|
|
function pushDispatcher() {
|
|
var prevDispatcher = ReactCurrentDispatcher$2.current;
|
|
ReactCurrentDispatcher$2.current = ContextOnlyDispatcher;
|
|
return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher;
|
|
}
|
|
function pushInteractions(root) {
|
|
var prevInteractions = tracing.__interactionsRef.current;
|
|
tracing.__interactionsRef.current = root.memoizedInteractions;
|
|
return prevInteractions;
|
|
}
|
|
function renderRootSync(root, lanes) {
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= 16;
|
|
var prevDispatcher = pushDispatcher();
|
|
if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes)
|
|
prepareFreshStack(root, lanes), startWorkOnPendingInteractions(root, lanes);
|
|
lanes = pushInteractions(root);
|
|
do
|
|
try {
|
|
workLoopSync();
|
|
break;
|
|
} catch (thrownValue) {
|
|
handleError(root, thrownValue);
|
|
}
|
|
while (1);
|
|
resetContextDependencies();
|
|
tracing.__interactionsRef.current = lanes;
|
|
executionContext = prevExecutionContext;
|
|
ReactCurrentDispatcher$2.current = prevDispatcher;
|
|
if (null !== workInProgress)
|
|
throw Error(
|
|
"Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
workInProgressRoot = null;
|
|
workInProgressRootRenderLanes = 0;
|
|
return workInProgressRootExitStatus;
|
|
}
|
|
function workLoopSync() {
|
|
for (; null !== workInProgress; ) performUnitOfWork(workInProgress);
|
|
}
|
|
function workLoopConcurrent() {
|
|
for (; null !== workInProgress && !Scheduler_shouldYield(); )
|
|
performUnitOfWork(workInProgress);
|
|
}
|
|
function performUnitOfWork(unitOfWork) {
|
|
var current = unitOfWork.alternate;
|
|
0 !== (unitOfWork.mode & 4)
|
|
? ((profilerStartTime = now$1()),
|
|
0 > unitOfWork.actualStartTime && (unitOfWork.actualStartTime = now$1()),
|
|
(current = beginWork$1(current, unitOfWork, subtreeRenderLanes)),
|
|
stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0))
|
|
: (current = beginWork$1(current, unitOfWork, subtreeRenderLanes));
|
|
unitOfWork.memoizedProps = unitOfWork.pendingProps;
|
|
null === current
|
|
? completeUnitOfWork(unitOfWork)
|
|
: (workInProgress = current);
|
|
ReactCurrentOwner$2.current = null;
|
|
}
|
|
function completeUnitOfWork(unitOfWork) {
|
|
var completedWork = unitOfWork;
|
|
do {
|
|
var current = completedWork.alternate;
|
|
unitOfWork = completedWork.return;
|
|
if (0 === (completedWork.flags & 8192)) {
|
|
if (0 === (completedWork.mode & 4))
|
|
current = completeWork(current, completedWork, subtreeRenderLanes);
|
|
else {
|
|
var fiber = completedWork;
|
|
profilerStartTime = now$1();
|
|
0 > fiber.actualStartTime && (fiber.actualStartTime = now$1());
|
|
current = completeWork(current, completedWork, subtreeRenderLanes);
|
|
stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1);
|
|
}
|
|
if (null !== current) {
|
|
workInProgress = current;
|
|
return;
|
|
}
|
|
} else {
|
|
current = unwindWork(completedWork);
|
|
if (null !== current) {
|
|
current.flags &= 8191;
|
|
workInProgress = current;
|
|
return;
|
|
}
|
|
if (0 !== (completedWork.mode & 4)) {
|
|
stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1);
|
|
current = completedWork.actualDuration;
|
|
for (fiber = completedWork.child; null !== fiber; )
|
|
(current += fiber.actualDuration), (fiber = fiber.sibling);
|
|
completedWork.actualDuration = current;
|
|
}
|
|
null !== unitOfWork &&
|
|
((unitOfWork.flags |= 8192),
|
|
(unitOfWork.subtreeFlags = 0),
|
|
(unitOfWork.deletions = null));
|
|
}
|
|
completedWork = completedWork.sibling;
|
|
if (null !== completedWork) {
|
|
workInProgress = completedWork;
|
|
return;
|
|
}
|
|
workInProgress = completedWork = unitOfWork;
|
|
} while (null !== completedWork);
|
|
0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5);
|
|
}
|
|
function commitRoot(root) {
|
|
var renderPriorityLevel = getCurrentPriorityLevel();
|
|
runWithPriority(99, commitRootImpl.bind(null, root, renderPriorityLevel));
|
|
return null;
|
|
}
|
|
function commitRootImpl(root, renderPriorityLevel) {
|
|
do flushPassiveEffects();
|
|
while (null !== rootWithPendingPassiveEffects);
|
|
if (0 !== (executionContext & 48))
|
|
throw Error("Should not already be working.");
|
|
var finishedWork = root.finishedWork,
|
|
lanes = root.finishedLanes;
|
|
if (null === finishedWork) return null;
|
|
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;
|
|
var remainingLanes = finishedWork.lanes | finishedWork.childLanes;
|
|
markRootFinished(root, remainingLanes);
|
|
null !== rootsWithPendingDiscreteUpdates &&
|
|
0 === (remainingLanes & 8) &&
|
|
rootsWithPendingDiscreteUpdates.has(root) &&
|
|
rootsWithPendingDiscreteUpdates.delete(root);
|
|
root === workInProgressRoot &&
|
|
((workInProgress = workInProgressRoot = null),
|
|
(workInProgressRootRenderLanes = 0));
|
|
(0 === (finishedWork.subtreeFlags & 1040) &&
|
|
0 === (finishedWork.flags & 1040)) ||
|
|
rootDoesHavePassiveEffects ||
|
|
((rootDoesHavePassiveEffects = !0),
|
|
scheduleCallback(97, function() {
|
|
flushPassiveEffects();
|
|
return null;
|
|
}));
|
|
remainingLanes = 0 !== (finishedWork.flags & 8054);
|
|
if (0 !== (finishedWork.subtreeFlags & 8054) || remainingLanes) {
|
|
remainingLanes = executionContext;
|
|
executionContext |= 32;
|
|
var prevInteractions = pushInteractions(root);
|
|
ReactCurrentOwner$2.current = null;
|
|
commitBeforeMutationEffects(root, finishedWork);
|
|
commitTime = now$1();
|
|
commitMutationEffects(root, renderPriorityLevel, finishedWork);
|
|
root.current = finishedWork;
|
|
commitLayoutEffects(finishedWork, root, lanes);
|
|
requestPaint();
|
|
tracing.__interactionsRef.current = prevInteractions;
|
|
executionContext = remainingLanes;
|
|
} else (root.current = finishedWork), (commitTime = now$1());
|
|
if ((prevInteractions = rootDoesHavePassiveEffects))
|
|
(rootDoesHavePassiveEffects = !1),
|
|
(rootWithPendingPassiveEffects = root),
|
|
(pendingPassiveEffectsLanes = lanes),
|
|
(pendingPassiveEffectsRenderPriority = renderPriorityLevel);
|
|
remainingLanes = root.pendingLanes;
|
|
if (0 !== remainingLanes) {
|
|
if (null !== spawnedWorkDuringRender) {
|
|
var expirationTimes = spawnedWorkDuringRender;
|
|
spawnedWorkDuringRender = null;
|
|
for (var i = 0; i < expirationTimes.length; i++)
|
|
scheduleInteractions(
|
|
root,
|
|
expirationTimes[i],
|
|
root.memoizedInteractions
|
|
);
|
|
}
|
|
schedulePendingInteractions(root, remainingLanes);
|
|
} else legacyErrorBoundariesThatAlreadyFailed = null;
|
|
prevInteractions || finishPendingInteractions(root, lanes);
|
|
0 !== (remainingLanes & 1)
|
|
? root === rootWithNestedUpdates
|
|
? nestedUpdateCount++
|
|
: ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))
|
|
: (nestedUpdateCount = 0);
|
|
onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
|
|
ensureRootIsScheduled(root, now());
|
|
if (hasUncaughtError)
|
|
throw ((hasUncaughtError = !1),
|
|
(root = firstUncaughtError),
|
|
(firstUncaughtError = null),
|
|
root);
|
|
if (0 !== (executionContext & 8)) return null;
|
|
flushSyncCallbackQueue();
|
|
return null;
|
|
}
|
|
function flushPassiveEffects() {
|
|
if (90 !== pendingPassiveEffectsRenderPriority) {
|
|
var priorityLevel =
|
|
97 < pendingPassiveEffectsRenderPriority
|
|
? 97
|
|
: pendingPassiveEffectsRenderPriority;
|
|
pendingPassiveEffectsRenderPriority = 90;
|
|
return runWithPriority(priorityLevel, flushPassiveEffectsImpl);
|
|
}
|
|
return !1;
|
|
}
|
|
function flushPassiveEffectsImpl() {
|
|
if (null === rootWithPendingPassiveEffects) return !1;
|
|
var root = rootWithPendingPassiveEffects,
|
|
lanes = pendingPassiveEffectsLanes;
|
|
rootWithPendingPassiveEffects = null;
|
|
pendingPassiveEffectsLanes = 0;
|
|
if (0 !== (executionContext & 48))
|
|
throw Error("Cannot flush passive effects while already rendering.");
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= 32;
|
|
var prevInteractions = pushInteractions(root);
|
|
for (nextEffect = root.current; null !== nextEffect; ) {
|
|
var fiber = nextEffect,
|
|
child = fiber.child;
|
|
if (0 !== (nextEffect.flags & 16)) {
|
|
var deletions = fiber.deletions;
|
|
if (null !== deletions) {
|
|
for (var i = 0; i < deletions.length; i++) {
|
|
var fiberToDelete = deletions[i];
|
|
for (nextEffect = fiberToDelete; null !== nextEffect; ) {
|
|
var fiber$jscomp$0 = nextEffect;
|
|
switch (fiber$jscomp$0.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 15:
|
|
commitHookEffectListUnmount(4, fiber$jscomp$0, fiber);
|
|
}
|
|
var child$jscomp$0 = fiber$jscomp$0.child;
|
|
if (null !== child$jscomp$0)
|
|
(child$jscomp$0.return = fiber$jscomp$0),
|
|
(nextEffect = child$jscomp$0);
|
|
else
|
|
for (; null !== nextEffect; ) {
|
|
fiber$jscomp$0 = nextEffect;
|
|
if (fiber$jscomp$0 === fiberToDelete) {
|
|
nextEffect = null;
|
|
break;
|
|
}
|
|
child$jscomp$0 = fiber$jscomp$0.sibling;
|
|
if (null !== child$jscomp$0) {
|
|
child$jscomp$0.return = fiber$jscomp$0.return;
|
|
nextEffect = child$jscomp$0;
|
|
break;
|
|
}
|
|
nextEffect = fiber$jscomp$0.return;
|
|
}
|
|
}
|
|
fiber$jscomp$0 = fiberToDelete.alternate;
|
|
detachFiberAfterEffects(fiberToDelete);
|
|
null !== fiber$jscomp$0 && detachFiberAfterEffects(fiber$jscomp$0);
|
|
}
|
|
nextEffect = fiber;
|
|
}
|
|
}
|
|
if (0 !== (fiber.subtreeFlags & 1040) && null !== child)
|
|
(child.return = fiber), (nextEffect = child);
|
|
else
|
|
a: for (; null !== nextEffect; ) {
|
|
fiber = nextEffect;
|
|
if (0 !== (fiber.flags & 1024))
|
|
switch (fiber.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 15:
|
|
commitHookEffectListUnmount(5, fiber, fiber.return);
|
|
}
|
|
child = fiber.sibling;
|
|
if (null !== child) {
|
|
child.return = fiber.return;
|
|
nextEffect = child;
|
|
break a;
|
|
}
|
|
nextEffect = fiber.return;
|
|
}
|
|
}
|
|
for (nextEffect = fiber = root.current; null !== nextEffect; )
|
|
if (
|
|
((child = nextEffect),
|
|
(deletions = child.child),
|
|
0 !== (child.subtreeFlags & 1040) && null !== deletions)
|
|
)
|
|
(deletions.return = child), (nextEffect = deletions);
|
|
else
|
|
a: for (child = fiber; null !== nextEffect; ) {
|
|
deletions = nextEffect;
|
|
if (0 !== (deletions.flags & 1024))
|
|
try {
|
|
switch (deletions.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 15:
|
|
commitHookEffectListMount(5, deletions);
|
|
}
|
|
} catch (error) {
|
|
captureCommitPhaseError(deletions, deletions.return, error);
|
|
}
|
|
if (deletions === child) {
|
|
nextEffect = null;
|
|
break a;
|
|
}
|
|
i = deletions.sibling;
|
|
if (null !== i) {
|
|
i.return = deletions.return;
|
|
nextEffect = i;
|
|
break a;
|
|
}
|
|
nextEffect = deletions.return;
|
|
}
|
|
tracing.__interactionsRef.current = prevInteractions;
|
|
finishPendingInteractions(root, lanes);
|
|
executionContext = prevExecutionContext;
|
|
flushSyncCallbackQueue();
|
|
return !0;
|
|
}
|
|
function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
|
|
sourceFiber = createCapturedValue(error, sourceFiber);
|
|
sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 1);
|
|
enqueueUpdate(rootFiber, sourceFiber);
|
|
sourceFiber = requestEventTime();
|
|
rootFiber = markUpdateLaneFromFiberToRoot(rootFiber, 1);
|
|
null !== rootFiber &&
|
|
(markRootUpdated(rootFiber, 1, sourceFiber),
|
|
ensureRootIsScheduled(rootFiber, sourceFiber),
|
|
schedulePendingInteractions(rootFiber, 1));
|
|
}
|
|
function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) {
|
|
if (3 === sourceFiber.tag)
|
|
captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
|
|
else
|
|
for (
|
|
nearestMountedAncestor = sourceFiber.return;
|
|
null !== nearestMountedAncestor;
|
|
|
|
) {
|
|
if (3 === nearestMountedAncestor.tag) {
|
|
captureCommitPhaseErrorOnRoot(
|
|
nearestMountedAncestor,
|
|
sourceFiber,
|
|
error
|
|
);
|
|
break;
|
|
} else if (1 === nearestMountedAncestor.tag) {
|
|
var instance = nearestMountedAncestor.stateNode;
|
|
if (
|
|
"function" ===
|
|
typeof nearestMountedAncestor.type.getDerivedStateFromError ||
|
|
("function" === typeof instance.componentDidCatch &&
|
|
(null === legacyErrorBoundariesThatAlreadyFailed ||
|
|
!legacyErrorBoundariesThatAlreadyFailed.has(instance)))
|
|
) {
|
|
sourceFiber = createCapturedValue(error, sourceFiber);
|
|
sourceFiber = createClassErrorUpdate(
|
|
nearestMountedAncestor,
|
|
sourceFiber,
|
|
1
|
|
);
|
|
enqueueUpdate(nearestMountedAncestor, sourceFiber);
|
|
sourceFiber = requestEventTime();
|
|
nearestMountedAncestor = markUpdateLaneFromFiberToRoot(
|
|
nearestMountedAncestor,
|
|
1
|
|
);
|
|
null !== nearestMountedAncestor &&
|
|
(markRootUpdated(nearestMountedAncestor, 1, sourceFiber),
|
|
ensureRootIsScheduled(nearestMountedAncestor, sourceFiber),
|
|
schedulePendingInteractions(nearestMountedAncestor, 1));
|
|
break;
|
|
}
|
|
}
|
|
nearestMountedAncestor = nearestMountedAncestor.return;
|
|
}
|
|
}
|
|
function pingSuspendedRoot(root, wakeable, pingedLanes) {
|
|
var pingCache = root.pingCache;
|
|
null !== pingCache && pingCache.delete(wakeable);
|
|
wakeable = requestEventTime();
|
|
root.pingedLanes |= root.suspendedLanes & pingedLanes;
|
|
workInProgressRoot === root &&
|
|
(workInProgressRootRenderLanes & pingedLanes) === pingedLanes &&
|
|
(4 === workInProgressRootExitStatus ||
|
|
(3 === workInProgressRootExitStatus &&
|
|
(workInProgressRootRenderLanes & 125829120) ===
|
|
workInProgressRootRenderLanes &&
|
|
500 > now() - globalMostRecentFallbackTime)
|
|
? prepareFreshStack(root, 0)
|
|
: (workInProgressRootPingedLanes |= pingedLanes));
|
|
ensureRootIsScheduled(root, wakeable);
|
|
schedulePendingInteractions(root, pingedLanes);
|
|
}
|
|
function resolveRetryWakeable(boundaryFiber, wakeable) {
|
|
var retryCache = boundaryFiber.stateNode;
|
|
null !== retryCache && retryCache.delete(wakeable);
|
|
wakeable = 0;
|
|
0 === wakeable &&
|
|
((wakeable = boundaryFiber.mode),
|
|
0 === (wakeable & 1)
|
|
? (wakeable = 1)
|
|
: 0 === (wakeable & 2)
|
|
? (wakeable = 99 === getCurrentPriorityLevel() ? 1 : 2)
|
|
: ((wakeable = nextRetryLane),
|
|
(nextRetryLane <<= 1),
|
|
0 === (nextRetryLane & 125829120) && (nextRetryLane = 8388608)));
|
|
retryCache = requestEventTime();
|
|
boundaryFiber = markUpdateLaneFromFiberToRoot(boundaryFiber, wakeable);
|
|
null !== boundaryFiber &&
|
|
(markRootUpdated(boundaryFiber, wakeable, retryCache),
|
|
ensureRootIsScheduled(boundaryFiber, retryCache),
|
|
schedulePendingInteractions(boundaryFiber, wakeable));
|
|
}
|
|
var beginWork$1;
|
|
beginWork$1 = function(current, workInProgress, renderLanes) {
|
|
var updateLanes = workInProgress.lanes;
|
|
if (null !== current)
|
|
if (
|
|
current.memoizedProps !== workInProgress.pendingProps ||
|
|
didPerformWorkStackCursor.current
|
|
)
|
|
didReceiveUpdate = !0;
|
|
else {
|
|
if (0 === (renderLanes & updateLanes)) {
|
|
didReceiveUpdate = !1;
|
|
switch (workInProgress.tag) {
|
|
case 3:
|
|
pushHostRootContext(workInProgress);
|
|
break;
|
|
case 5:
|
|
pushHostContext(workInProgress);
|
|
break;
|
|
case 1:
|
|
isContextProvider(workInProgress.type) &&
|
|
pushContextProvider(workInProgress);
|
|
break;
|
|
case 4:
|
|
pushHostContainer(
|
|
workInProgress,
|
|
workInProgress.stateNode.containerInfo
|
|
);
|
|
break;
|
|
case 10:
|
|
updateLanes = workInProgress.type._context;
|
|
var nextValue = workInProgress.memoizedProps.value;
|
|
push(valueCursor, updateLanes._currentValue);
|
|
updateLanes._currentValue = nextValue;
|
|
break;
|
|
case 12:
|
|
0 !== (renderLanes & workInProgress.childLanes) &&
|
|
(workInProgress.flags |= 4);
|
|
updateLanes = workInProgress.stateNode;
|
|
updateLanes.effectDuration = 0;
|
|
updateLanes.passiveEffectDuration = 0;
|
|
break;
|
|
case 13:
|
|
if (null !== workInProgress.memoizedState) {
|
|
if (0 !== (renderLanes & workInProgress.child.childLanes))
|
|
return updateSuspenseComponent(
|
|
current,
|
|
workInProgress,
|
|
renderLanes
|
|
);
|
|
push(suspenseStackCursor, suspenseStackCursor.current & 1);
|
|
workInProgress = bailoutOnAlreadyFinishedWork(
|
|
current,
|
|
workInProgress,
|
|
renderLanes
|
|
);
|
|
return null !== workInProgress ? workInProgress.sibling : null;
|
|
}
|
|
push(suspenseStackCursor, suspenseStackCursor.current & 1);
|
|
break;
|
|
case 19:
|
|
updateLanes = 0 !== (renderLanes & workInProgress.childLanes);
|
|
if (0 !== (current.flags & 128)) {
|
|
if (updateLanes)
|
|
return updateSuspenseListComponent(
|
|
current,
|
|
workInProgress,
|
|
renderLanes
|
|
);
|
|
workInProgress.flags |= 128;
|
|
}
|
|
nextValue = workInProgress.memoizedState;
|
|
null !== nextValue &&
|
|
((nextValue.rendering = null),
|
|
(nextValue.tail = null),
|
|
(nextValue.lastEffect = null));
|
|
push(suspenseStackCursor, suspenseStackCursor.current);
|
|
if (updateLanes) break;
|
|
else return null;
|
|
case 22:
|
|
case 23:
|
|
return (
|
|
(workInProgress.lanes = 0),
|
|
updateOffscreenComponent(current, workInProgress, renderLanes)
|
|
);
|
|
}
|
|
return bailoutOnAlreadyFinishedWork(
|
|
current,
|
|
workInProgress,
|
|
renderLanes
|
|
);
|
|
}
|
|
didReceiveUpdate = 0 !== (current.flags & 65536) ? !0 : !1;
|
|
}
|
|
else didReceiveUpdate = !1;
|
|
workInProgress.lanes = 0;
|
|
switch (workInProgress.tag) {
|
|
case 2:
|
|
updateLanes = workInProgress.type;
|
|
null !== current &&
|
|
((current.alternate = null),
|
|
(workInProgress.alternate = null),
|
|
(workInProgress.flags |= 2));
|
|
current = workInProgress.pendingProps;
|
|
nextValue = getMaskedContext(workInProgress, contextStackCursor.current);
|
|
prepareToReadContext(workInProgress, renderLanes);
|
|
nextValue = renderWithHooks(
|
|
null,
|
|
workInProgress,
|
|
updateLanes,
|
|
current,
|
|
nextValue,
|
|
renderLanes
|
|
);
|
|
workInProgress.flags |= 1;
|
|
if (
|
|
"object" === typeof nextValue &&
|
|
null !== nextValue &&
|
|
"function" === typeof nextValue.render &&
|
|
void 0 === nextValue.$$typeof
|
|
) {
|
|
workInProgress.tag = 1;
|
|
workInProgress.memoizedState = null;
|
|
workInProgress.updateQueue = null;
|
|
if (isContextProvider(updateLanes)) {
|
|
var hasContext = !0;
|
|
pushContextProvider(workInProgress);
|
|
} else hasContext = !1;
|
|
workInProgress.memoizedState =
|
|
null !== nextValue.state && void 0 !== nextValue.state
|
|
? nextValue.state
|
|
: null;
|
|
initializeUpdateQueue(workInProgress);
|
|
var getDerivedStateFromProps = updateLanes.getDerivedStateFromProps;
|
|
"function" === typeof getDerivedStateFromProps &&
|
|
applyDerivedStateFromProps(
|
|
workInProgress,
|
|
updateLanes,
|
|
getDerivedStateFromProps,
|
|
current
|
|
);
|
|
nextValue.updater = classComponentUpdater;
|
|
workInProgress.stateNode = nextValue;
|
|
nextValue._reactInternals = workInProgress;
|
|
mountClassInstance(workInProgress, updateLanes, current, renderLanes);
|
|
workInProgress = finishClassComponent(
|
|
null,
|
|
workInProgress,
|
|
updateLanes,
|
|
!0,
|
|
hasContext,
|
|
renderLanes
|
|
);
|
|
} else
|
|
(workInProgress.tag = 0),
|
|
reconcileChildren(null, workInProgress, nextValue, renderLanes),
|
|
(workInProgress = workInProgress.child);
|
|
return workInProgress;
|
|
case 16:
|
|
nextValue = workInProgress.elementType;
|
|
a: {
|
|
null !== current &&
|
|
((current.alternate = null),
|
|
(workInProgress.alternate = null),
|
|
(workInProgress.flags |= 2));
|
|
current = workInProgress.pendingProps;
|
|
hasContext = nextValue._init;
|
|
nextValue = hasContext(nextValue._payload);
|
|
workInProgress.type = nextValue;
|
|
hasContext = workInProgress.tag = resolveLazyComponentTag(nextValue);
|
|
current = resolveDefaultProps(nextValue, current);
|
|
switch (hasContext) {
|
|
case 0:
|
|
workInProgress = updateFunctionComponent(
|
|
null,
|
|
workInProgress,
|
|
nextValue,
|
|
current,
|
|
renderLanes
|
|
);
|
|
break a;
|
|
case 1:
|
|
workInProgress = updateClassComponent(
|
|
null,
|
|
workInProgress,
|
|
nextValue,
|
|
current,
|
|
renderLanes
|
|
);
|
|
break a;
|
|
case 11:
|
|
workInProgress = updateForwardRef(
|
|
null,
|
|
workInProgress,
|
|
nextValue,
|
|
current,
|
|
renderLanes
|
|
);
|
|
break a;
|
|
case 14:
|
|
workInProgress = updateMemoComponent(
|
|
null,
|
|
workInProgress,
|
|
nextValue,
|
|
resolveDefaultProps(nextValue.type, current),
|
|
updateLanes,
|
|
renderLanes
|
|
);
|
|
break a;
|
|
}
|
|
throw Error(
|
|
"Element type is invalid. Received a promise that resolves to: " +
|
|
nextValue +
|
|
". Lazy element type must resolve to a class or function."
|
|
);
|
|
}
|
|
return workInProgress;
|
|
case 0:
|
|
return (
|
|
(updateLanes = workInProgress.type),
|
|
(nextValue = workInProgress.pendingProps),
|
|
(nextValue =
|
|
workInProgress.elementType === updateLanes
|
|
? nextValue
|
|
: resolveDefaultProps(updateLanes, nextValue)),
|
|
updateFunctionComponent(
|
|
current,
|
|
workInProgress,
|
|
updateLanes,
|
|
nextValue,
|
|
renderLanes
|
|
)
|
|
);
|
|
case 1:
|
|
return (
|
|
(updateLanes = workInProgress.type),
|
|
(nextValue = workInProgress.pendingProps),
|
|
(nextValue =
|
|
workInProgress.elementType === updateLanes
|
|
? nextValue
|
|
: resolveDefaultProps(updateLanes, nextValue)),
|
|
updateClassComponent(
|
|
current,
|
|
workInProgress,
|
|
updateLanes,
|
|
nextValue,
|
|
renderLanes
|
|
)
|
|
);
|
|
case 3:
|
|
pushHostRootContext(workInProgress);
|
|
updateLanes = workInProgress.updateQueue;
|
|
if (null === current || null === updateLanes)
|
|
throw Error(
|
|
"If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
nextValue = workInProgress.pendingProps;
|
|
updateLanes = workInProgress.memoizedState.element;
|
|
cloneUpdateQueue(current, workInProgress);
|
|
processUpdateQueue(workInProgress, nextValue, null, renderLanes);
|
|
nextValue = workInProgress.memoizedState.element;
|
|
nextValue === updateLanes
|
|
? (workInProgress = bailoutOnAlreadyFinishedWork(
|
|
current,
|
|
workInProgress,
|
|
renderLanes
|
|
))
|
|
: (reconcileChildren(current, workInProgress, nextValue, renderLanes),
|
|
(workInProgress = workInProgress.child));
|
|
return workInProgress;
|
|
case 5:
|
|
return (
|
|
pushHostContext(workInProgress),
|
|
(updateLanes = workInProgress.pendingProps.children),
|
|
markRef(current, workInProgress),
|
|
reconcileChildren(current, workInProgress, updateLanes, renderLanes),
|
|
workInProgress.child
|
|
);
|
|
case 6:
|
|
return null;
|
|
case 13:
|
|
return updateSuspenseComponent(current, workInProgress, renderLanes);
|
|
case 4:
|
|
return (
|
|
pushHostContainer(
|
|
workInProgress,
|
|
workInProgress.stateNode.containerInfo
|
|
),
|
|
(updateLanes = workInProgress.pendingProps),
|
|
null === current
|
|
? (workInProgress.child = reconcileChildFibers(
|
|
workInProgress,
|
|
null,
|
|
updateLanes,
|
|
renderLanes
|
|
))
|
|
: reconcileChildren(
|
|
current,
|
|
workInProgress,
|
|
updateLanes,
|
|
renderLanes
|
|
),
|
|
workInProgress.child
|
|
);
|
|
case 11:
|
|
return (
|
|
(updateLanes = workInProgress.type),
|
|
(nextValue = workInProgress.pendingProps),
|
|
(nextValue =
|
|
workInProgress.elementType === updateLanes
|
|
? nextValue
|
|
: resolveDefaultProps(updateLanes, nextValue)),
|
|
updateForwardRef(
|
|
current,
|
|
workInProgress,
|
|
updateLanes,
|
|
nextValue,
|
|
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),
|
|
(updateLanes = workInProgress.stateNode),
|
|
(updateLanes.effectDuration = 0),
|
|
(updateLanes.passiveEffectDuration = 0),
|
|
reconcileChildren(
|
|
current,
|
|
workInProgress,
|
|
workInProgress.pendingProps.children,
|
|
renderLanes
|
|
),
|
|
workInProgress.child
|
|
);
|
|
case 10:
|
|
a: {
|
|
updateLanes = workInProgress.type._context;
|
|
nextValue = workInProgress.pendingProps;
|
|
getDerivedStateFromProps = workInProgress.memoizedProps;
|
|
hasContext = nextValue.value;
|
|
push(valueCursor, updateLanes._currentValue);
|
|
updateLanes._currentValue = hasContext;
|
|
if (null !== getDerivedStateFromProps) {
|
|
var oldValue = getDerivedStateFromProps.value;
|
|
hasContext = objectIs(oldValue, hasContext)
|
|
? 0
|
|
: ("function" === typeof updateLanes._calculateChangedBits
|
|
? updateLanes._calculateChangedBits(oldValue, hasContext)
|
|
: 1073741823) | 0;
|
|
if (0 === hasContext) {
|
|
if (
|
|
getDerivedStateFromProps.children === nextValue.children &&
|
|
!didPerformWorkStackCursor.current
|
|
) {
|
|
workInProgress = bailoutOnAlreadyFinishedWork(
|
|
current,
|
|
workInProgress,
|
|
renderLanes
|
|
);
|
|
break a;
|
|
}
|
|
} else
|
|
for (
|
|
oldValue = workInProgress.child,
|
|
null !== oldValue && (oldValue.return = workInProgress);
|
|
null !== oldValue;
|
|
|
|
) {
|
|
var list = oldValue.dependencies;
|
|
if (null !== list) {
|
|
getDerivedStateFromProps = oldValue.child;
|
|
for (
|
|
var dependency = list.firstContext;
|
|
null !== dependency;
|
|
|
|
) {
|
|
if (
|
|
dependency.context === updateLanes &&
|
|
0 !== (dependency.observedBits & hasContext)
|
|
) {
|
|
if (1 === oldValue.tag) {
|
|
dependency = createUpdate(-1, renderLanes & -renderLanes);
|
|
dependency.tag = 2;
|
|
var updateQueue = oldValue.updateQueue;
|
|
if (null !== updateQueue) {
|
|
updateQueue = updateQueue.shared;
|
|
var pending = updateQueue.pending;
|
|
null === pending
|
|
? (dependency.next = dependency)
|
|
: ((dependency.next = pending.next),
|
|
(pending.next = dependency));
|
|
updateQueue.pending = dependency;
|
|
}
|
|
}
|
|
oldValue.lanes |= renderLanes;
|
|
dependency = oldValue.alternate;
|
|
null !== dependency && (dependency.lanes |= renderLanes);
|
|
scheduleWorkOnParentPath(oldValue.return, renderLanes);
|
|
list.lanes |= renderLanes;
|
|
break;
|
|
}
|
|
dependency = dependency.next;
|
|
}
|
|
} else
|
|
getDerivedStateFromProps =
|
|
10 === oldValue.tag
|
|
? oldValue.type === workInProgress.type
|
|
? null
|
|
: oldValue.child
|
|
: oldValue.child;
|
|
if (null !== getDerivedStateFromProps)
|
|
getDerivedStateFromProps.return = oldValue;
|
|
else
|
|
for (
|
|
getDerivedStateFromProps = oldValue;
|
|
null !== getDerivedStateFromProps;
|
|
|
|
) {
|
|
if (getDerivedStateFromProps === workInProgress) {
|
|
getDerivedStateFromProps = null;
|
|
break;
|
|
}
|
|
oldValue = getDerivedStateFromProps.sibling;
|
|
if (null !== oldValue) {
|
|
oldValue.return = getDerivedStateFromProps.return;
|
|
getDerivedStateFromProps = oldValue;
|
|
break;
|
|
}
|
|
getDerivedStateFromProps = getDerivedStateFromProps.return;
|
|
}
|
|
oldValue = getDerivedStateFromProps;
|
|
}
|
|
}
|
|
reconcileChildren(
|
|
current,
|
|
workInProgress,
|
|
nextValue.children,
|
|
renderLanes
|
|
);
|
|
workInProgress = workInProgress.child;
|
|
}
|
|
return workInProgress;
|
|
case 9:
|
|
return (
|
|
(nextValue = workInProgress.type),
|
|
(hasContext = workInProgress.pendingProps),
|
|
(updateLanes = hasContext.children),
|
|
prepareToReadContext(workInProgress, renderLanes),
|
|
(nextValue = readContext(nextValue, hasContext.unstable_observedBits)),
|
|
(updateLanes = updateLanes(nextValue)),
|
|
(workInProgress.flags |= 1),
|
|
reconcileChildren(current, workInProgress, updateLanes, renderLanes),
|
|
workInProgress.child
|
|
);
|
|
case 14:
|
|
return (
|
|
(nextValue = workInProgress.type),
|
|
(hasContext = resolveDefaultProps(
|
|
nextValue,
|
|
workInProgress.pendingProps
|
|
)),
|
|
(hasContext = resolveDefaultProps(nextValue.type, hasContext)),
|
|
updateMemoComponent(
|
|
current,
|
|
workInProgress,
|
|
nextValue,
|
|
hasContext,
|
|
updateLanes,
|
|
renderLanes
|
|
)
|
|
);
|
|
case 15:
|
|
return updateSimpleMemoComponent(
|
|
current,
|
|
workInProgress,
|
|
workInProgress.type,
|
|
workInProgress.pendingProps,
|
|
updateLanes,
|
|
renderLanes
|
|
);
|
|
case 17:
|
|
return (
|
|
(updateLanes = workInProgress.type),
|
|
(nextValue = workInProgress.pendingProps),
|
|
(nextValue =
|
|
workInProgress.elementType === updateLanes
|
|
? nextValue
|
|
: resolveDefaultProps(updateLanes, nextValue)),
|
|
null !== current &&
|
|
((current.alternate = null),
|
|
(workInProgress.alternate = null),
|
|
(workInProgress.flags |= 2)),
|
|
(workInProgress.tag = 1),
|
|
isContextProvider(updateLanes)
|
|
? ((current = !0), pushContextProvider(workInProgress))
|
|
: (current = !1),
|
|
prepareToReadContext(workInProgress, renderLanes),
|
|
constructClassInstance(workInProgress, updateLanes, nextValue),
|
|
mountClassInstance(workInProgress, updateLanes, nextValue, renderLanes),
|
|
finishClassComponent(
|
|
null,
|
|
workInProgress,
|
|
updateLanes,
|
|
!0,
|
|
current,
|
|
renderLanes
|
|
)
|
|
);
|
|
case 19:
|
|
return updateSuspenseListComponent(current, workInProgress, renderLanes);
|
|
case 22:
|
|
return updateOffscreenComponent(current, workInProgress, renderLanes);
|
|
case 23:
|
|
return updateOffscreenComponent(current, workInProgress, renderLanes);
|
|
}
|
|
throw Error(
|
|
"Unknown unit of work tag (" +
|
|
workInProgress.tag +
|
|
"). This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
};
|
|
function markSpawnedWork(lane) {
|
|
null === spawnedWorkDuringRender
|
|
? (spawnedWorkDuringRender = [lane])
|
|
: spawnedWorkDuringRender.push(lane);
|
|
}
|
|
function scheduleInteractions(root, lane, interactions) {
|
|
if (0 < interactions.size) {
|
|
var pendingInteractionMap = root.pendingInteractionMap,
|
|
pendingInteractions = pendingInteractionMap.get(lane);
|
|
null != pendingInteractions
|
|
? interactions.forEach(function(interaction) {
|
|
pendingInteractions.has(interaction) || interaction.__count++;
|
|
pendingInteractions.add(interaction);
|
|
})
|
|
: (pendingInteractionMap.set(lane, new Set(interactions)),
|
|
interactions.forEach(function(interaction) {
|
|
interaction.__count++;
|
|
}));
|
|
pendingInteractionMap = tracing.__subscriberRef.current;
|
|
if (null !== pendingInteractionMap)
|
|
pendingInteractionMap.onWorkScheduled(
|
|
interactions,
|
|
1e3 * lane + root.interactionThreadID
|
|
);
|
|
}
|
|
}
|
|
function schedulePendingInteractions(root, lane) {
|
|
scheduleInteractions(root, lane, tracing.__interactionsRef.current);
|
|
}
|
|
function startWorkOnPendingInteractions(root, lanes) {
|
|
var interactions = new Set();
|
|
root.pendingInteractionMap.forEach(function(
|
|
scheduledInteractions,
|
|
scheduledLane
|
|
) {
|
|
0 !== (lanes & scheduledLane) &&
|
|
scheduledInteractions.forEach(function(interaction) {
|
|
return interactions.add(interaction);
|
|
});
|
|
});
|
|
root.memoizedInteractions = interactions;
|
|
if (0 < interactions.size) {
|
|
var subscriber = tracing.__subscriberRef.current;
|
|
if (null !== subscriber) {
|
|
root = 1e3 * lanes + root.interactionThreadID;
|
|
try {
|
|
subscriber.onWorkStarted(interactions, root);
|
|
} catch (error) {
|
|
scheduleCallback(99, function() {
|
|
throw error;
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function finishPendingInteractions(root, committedLanes) {
|
|
var remainingLanesAfterCommit = root.pendingLanes;
|
|
try {
|
|
var subscriber = tracing.__subscriberRef.current;
|
|
if (null !== subscriber && 0 < root.memoizedInteractions.size)
|
|
subscriber.onWorkStopped(
|
|
root.memoizedInteractions,
|
|
1e3 * committedLanes + root.interactionThreadID
|
|
);
|
|
} catch (error) {
|
|
scheduleCallback(99, function() {
|
|
throw error;
|
|
});
|
|
} finally {
|
|
var pendingInteractionMap = root.pendingInteractionMap;
|
|
pendingInteractionMap.forEach(function(scheduledInteractions, lane) {
|
|
0 === (remainingLanesAfterCommit & lane) &&
|
|
(pendingInteractionMap.delete(lane),
|
|
scheduledInteractions.forEach(function(interaction) {
|
|
interaction.__count--;
|
|
if (null !== subscriber && 0 === interaction.__count)
|
|
try {
|
|
subscriber.onInteractionScheduledWorkCompleted(interaction);
|
|
} catch (error$96) {
|
|
scheduleCallback(99, function() {
|
|
throw error$96;
|
|
});
|
|
}
|
|
}));
|
|
});
|
|
}
|
|
}
|
|
function FiberNode(tag, pendingProps, key, mode) {
|
|
this.tag = tag;
|
|
this.key = key;
|
|
this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null;
|
|
this.index = 0;
|
|
this.ref = null;
|
|
this.pendingProps = pendingProps;
|
|
this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null;
|
|
this.mode = mode;
|
|
this.subtreeFlags = this.flags = 0;
|
|
this.deletions = null;
|
|
this.childLanes = this.lanes = 0;
|
|
this.alternate = null;
|
|
this.actualDuration = 0;
|
|
this.actualStartTime = -1;
|
|
this.treeBaseDuration = this.selfBaseDuration = 0;
|
|
}
|
|
function createFiber(tag, pendingProps, key, mode) {
|
|
return new FiberNode(tag, pendingProps, key, mode);
|
|
}
|
|
function shouldConstruct(Component) {
|
|
Component = Component.prototype;
|
|
return !(!Component || !Component.isReactComponent);
|
|
}
|
|
function resolveLazyComponentTag(Component) {
|
|
if ("function" === typeof Component)
|
|
return shouldConstruct(Component) ? 1 : 0;
|
|
if (void 0 !== Component && null !== Component) {
|
|
Component = Component.$$typeof;
|
|
if (Component === REACT_FORWARD_REF_TYPE) return 11;
|
|
if (Component === REACT_MEMO_TYPE) return 14;
|
|
}
|
|
return 2;
|
|
}
|
|
function createWorkInProgress(current, pendingProps) {
|
|
var workInProgress = current.alternate;
|
|
null === workInProgress
|
|
? ((workInProgress = createFiber(
|
|
current.tag,
|
|
pendingProps,
|
|
current.key,
|
|
current.mode
|
|
)),
|
|
(workInProgress.elementType = current.elementType),
|
|
(workInProgress.type = current.type),
|
|
(workInProgress.stateNode = current.stateNode),
|
|
(workInProgress.alternate = current),
|
|
(current.alternate = workInProgress))
|
|
: ((workInProgress.pendingProps = pendingProps),
|
|
(workInProgress.type = current.type),
|
|
(workInProgress.flags = 0),
|
|
(workInProgress.subtreeFlags = 0),
|
|
(workInProgress.deletions = null),
|
|
(workInProgress.actualDuration = 0),
|
|
(workInProgress.actualStartTime = -1));
|
|
workInProgress.flags = current.flags & 131072;
|
|
workInProgress.childLanes = current.childLanes;
|
|
workInProgress.lanes = current.lanes;
|
|
workInProgress.child = current.child;
|
|
workInProgress.memoizedProps = current.memoizedProps;
|
|
workInProgress.memoizedState = current.memoizedState;
|
|
workInProgress.updateQueue = current.updateQueue;
|
|
pendingProps = current.dependencies;
|
|
workInProgress.dependencies =
|
|
null === pendingProps
|
|
? null
|
|
: { lanes: pendingProps.lanes, firstContext: pendingProps.firstContext };
|
|
workInProgress.sibling = current.sibling;
|
|
workInProgress.index = current.index;
|
|
workInProgress.ref = current.ref;
|
|
workInProgress.selfBaseDuration = current.selfBaseDuration;
|
|
workInProgress.treeBaseDuration = current.treeBaseDuration;
|
|
return workInProgress;
|
|
}
|
|
function createFiberFromTypeAndProps(
|
|
type,
|
|
key,
|
|
pendingProps,
|
|
owner,
|
|
mode,
|
|
lanes
|
|
) {
|
|
var fiberTag = 2;
|
|
owner = type;
|
|
if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1);
|
|
else if ("string" === typeof type) fiberTag = 5;
|
|
else
|
|
a: switch (type) {
|
|
case REACT_FRAGMENT_TYPE:
|
|
return createFiberFromFragment(pendingProps.children, mode, lanes, key);
|
|
case REACT_DEBUG_TRACING_MODE_TYPE:
|
|
fiberTag = 8;
|
|
mode |= 8;
|
|
break;
|
|
case REACT_STRICT_MODE_TYPE:
|
|
fiberTag = 8;
|
|
1 <=
|
|
(null == pendingProps.unstable_level
|
|
? 1
|
|
: pendingProps.unstable_level) && (mode |= 16);
|
|
break;
|
|
case REACT_PROFILER_TYPE:
|
|
return (
|
|
(type = createFiber(12, pendingProps, key, mode | 4)),
|
|
(type.elementType = REACT_PROFILER_TYPE),
|
|
(type.type = REACT_PROFILER_TYPE),
|
|
(type.lanes = lanes),
|
|
(type.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }),
|
|
type
|
|
);
|
|
case REACT_SUSPENSE_TYPE:
|
|
return (
|
|
(type = createFiber(13, pendingProps, key, mode)),
|
|
(type.type = REACT_SUSPENSE_TYPE),
|
|
(type.elementType = REACT_SUSPENSE_TYPE),
|
|
(type.lanes = lanes),
|
|
type
|
|
);
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return (
|
|
(type = createFiber(19, pendingProps, key, mode)),
|
|
(type.elementType = REACT_SUSPENSE_LIST_TYPE),
|
|
(type.lanes = lanes),
|
|
type
|
|
);
|
|
case REACT_OFFSCREEN_TYPE:
|
|
return createFiberFromOffscreen(pendingProps, mode, lanes, key);
|
|
case REACT_LEGACY_HIDDEN_TYPE:
|
|
return (
|
|
(type = createFiber(23, pendingProps, key, mode)),
|
|
(type.elementType = REACT_LEGACY_HIDDEN_TYPE),
|
|
(type.lanes = lanes),
|
|
type
|
|
);
|
|
default:
|
|
if ("object" === typeof type && null !== type)
|
|
switch (type.$$typeof) {
|
|
case REACT_PROVIDER_TYPE:
|
|
fiberTag = 10;
|
|
break a;
|
|
case REACT_CONTEXT_TYPE:
|
|
fiberTag = 9;
|
|
break a;
|
|
case REACT_FORWARD_REF_TYPE:
|
|
fiberTag = 11;
|
|
break a;
|
|
case REACT_MEMO_TYPE:
|
|
fiberTag = 14;
|
|
break a;
|
|
case REACT_LAZY_TYPE:
|
|
fiberTag = 16;
|
|
owner = null;
|
|
break a;
|
|
}
|
|
throw Error(
|
|
"Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " +
|
|
(null == type ? type : typeof type) +
|
|
"."
|
|
);
|
|
}
|
|
key = createFiber(fiberTag, pendingProps, key, mode);
|
|
key.elementType = type;
|
|
key.type = owner;
|
|
key.lanes = lanes;
|
|
return key;
|
|
}
|
|
function createFiberFromFragment(elements, mode, lanes, key) {
|
|
elements = createFiber(7, elements, key, mode);
|
|
elements.lanes = lanes;
|
|
return elements;
|
|
}
|
|
function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
|
|
pendingProps = createFiber(22, pendingProps, key, mode);
|
|
pendingProps.elementType = REACT_OFFSCREEN_TYPE;
|
|
pendingProps.lanes = lanes;
|
|
return pendingProps;
|
|
}
|
|
function createFiberFromText(content, mode, lanes) {
|
|
content = createFiber(6, content, null, mode);
|
|
content.lanes = lanes;
|
|
return content;
|
|
}
|
|
function createFiberFromPortal(portal, mode, lanes) {
|
|
mode = createFiber(
|
|
4,
|
|
null !== portal.children ? portal.children : [],
|
|
portal.key,
|
|
mode
|
|
);
|
|
mode.lanes = lanes;
|
|
mode.stateNode = {
|
|
containerInfo: portal.containerInfo,
|
|
pendingChildren: null,
|
|
implementation: portal.implementation
|
|
};
|
|
return mode;
|
|
}
|
|
function FiberRootNode(containerInfo, tag, hydrate) {
|
|
this.tag = tag;
|
|
this.containerInfo = containerInfo;
|
|
this.finishedWork = this.pingCache = this.current = this.pendingChildren = null;
|
|
this.timeoutHandle = -1;
|
|
this.pendingContext = this.context = null;
|
|
this.hydrate = hydrate;
|
|
this.callbackNode = null;
|
|
this.callbackPriority = 0;
|
|
this.eventTimes = createLaneMap(0);
|
|
this.expirationTimes = createLaneMap(-1);
|
|
this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0;
|
|
this.entanglements = createLaneMap(0);
|
|
this.interactionThreadID = tracing.unstable_getThreadID();
|
|
this.memoizedInteractions = new Set();
|
|
this.pendingInteractionMap = new Map();
|
|
}
|
|
function createPortal(children, containerInfo, implementation) {
|
|
var key =
|
|
3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
|
return {
|
|
$$typeof: REACT_PORTAL_TYPE,
|
|
key: null == key ? null : "" + key,
|
|
children: children,
|
|
containerInfo: containerInfo,
|
|
implementation: implementation
|
|
};
|
|
}
|
|
function findHostInstance(component) {
|
|
var fiber = component._reactInternals;
|
|
if (void 0 === fiber) {
|
|
if ("function" === typeof component.render)
|
|
throw Error("Unable to find node on an unmounted component.");
|
|
throw Error(
|
|
"Argument appears to not be a ReactComponent. Keys: " +
|
|
Object.keys(component)
|
|
);
|
|
}
|
|
component = findCurrentHostFiber(fiber);
|
|
return null === component ? null : component.stateNode;
|
|
}
|
|
function updateContainer(element, container, parentComponent, callback) {
|
|
var current = container.current,
|
|
eventTime = requestEventTime(),
|
|
lane = requestUpdateLane(current);
|
|
a: if (parentComponent) {
|
|
parentComponent = parentComponent._reactInternals;
|
|
b: {
|
|
if (
|
|
getNearestMountedFiber(parentComponent) !== parentComponent ||
|
|
1 !== parentComponent.tag
|
|
)
|
|
throw Error(
|
|
"Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
var JSCompiler_inline_result = parentComponent;
|
|
do {
|
|
switch (JSCompiler_inline_result.tag) {
|
|
case 3:
|
|
JSCompiler_inline_result =
|
|
JSCompiler_inline_result.stateNode.context;
|
|
break b;
|
|
case 1:
|
|
if (isContextProvider(JSCompiler_inline_result.type)) {
|
|
JSCompiler_inline_result =
|
|
JSCompiler_inline_result.stateNode
|
|
.__reactInternalMemoizedMergedChildContext;
|
|
break b;
|
|
}
|
|
}
|
|
JSCompiler_inline_result = JSCompiler_inline_result.return;
|
|
} while (null !== JSCompiler_inline_result);
|
|
throw Error(
|
|
"Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
}
|
|
if (1 === parentComponent.tag) {
|
|
var Component = parentComponent.type;
|
|
if (isContextProvider(Component)) {
|
|
parentComponent = processChildContext(
|
|
parentComponent,
|
|
Component,
|
|
JSCompiler_inline_result
|
|
);
|
|
break a;
|
|
}
|
|
}
|
|
parentComponent = JSCompiler_inline_result;
|
|
} else parentComponent = emptyContextObject;
|
|
null === container.context
|
|
? (container.context = parentComponent)
|
|
: (container.pendingContext = parentComponent);
|
|
container = createUpdate(eventTime, lane);
|
|
container.payload = { element: element };
|
|
callback = void 0 === callback ? null : callback;
|
|
null !== callback && (container.callback = callback);
|
|
enqueueUpdate(current, container);
|
|
element = scheduleUpdateOnFiber(current, lane, eventTime);
|
|
null !== element && entangleTransitions(element, current, lane);
|
|
return lane;
|
|
}
|
|
function emptyFindFiberByHostInstance() {
|
|
return null;
|
|
}
|
|
function findNodeHandle(componentOrHandle) {
|
|
if (null == componentOrHandle) return null;
|
|
if ("number" === typeof componentOrHandle) return componentOrHandle;
|
|
if (componentOrHandle._nativeTag) return componentOrHandle._nativeTag;
|
|
if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag)
|
|
return componentOrHandle.canonical._nativeTag;
|
|
componentOrHandle = findHostInstance(componentOrHandle);
|
|
return null == componentOrHandle
|
|
? componentOrHandle
|
|
: componentOrHandle.canonical
|
|
? componentOrHandle.canonical._nativeTag
|
|
: componentOrHandle._nativeTag;
|
|
}
|
|
function unmountComponentAtNode(containerTag) {
|
|
var root = roots.get(containerTag);
|
|
root &&
|
|
updateContainer(null, root, null, function() {
|
|
roots.delete(containerTag);
|
|
});
|
|
}
|
|
batchedUpdatesImpl = function(fn, a) {
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= 1;
|
|
try {
|
|
return fn(a);
|
|
} finally {
|
|
(executionContext = prevExecutionContext),
|
|
0 === executionContext &&
|
|
((workInProgressRootRenderTargetTime = now() + 500),
|
|
flushSyncCallbackQueue());
|
|
}
|
|
};
|
|
var roots = new Map(),
|
|
devToolsConfig$jscomp$inline_986 = {
|
|
findFiberByHostInstance: getInstanceFromTag,
|
|
bundleType: 0,
|
|
version: "17.0.2",
|
|
rendererPackageName: "react-native-renderer",
|
|
rendererConfig: {
|
|
getInspectorDataForViewTag: function() {
|
|
throw Error(
|
|
"getInspectorDataForViewTag() is not available in production"
|
|
);
|
|
},
|
|
getInspectorDataForViewAtPoint: function() {
|
|
throw Error(
|
|
"getInspectorDataForViewAtPoint() is not available in production."
|
|
);
|
|
}.bind(null, findNodeHandle)
|
|
}
|
|
};
|
|
var internals$jscomp$inline_1282 = {
|
|
bundleType: devToolsConfig$jscomp$inline_986.bundleType,
|
|
version: devToolsConfig$jscomp$inline_986.version,
|
|
rendererPackageName: devToolsConfig$jscomp$inline_986.rendererPackageName,
|
|
rendererConfig: devToolsConfig$jscomp$inline_986.rendererConfig,
|
|
overrideHookState: null,
|
|
overrideHookStateDeletePath: null,
|
|
overrideHookStateRenamePath: null,
|
|
overrideProps: null,
|
|
overridePropsDeletePath: null,
|
|
overridePropsRenamePath: null,
|
|
setSuspenseHandler: null,
|
|
scheduleUpdate: null,
|
|
currentDispatcherRef: ReactSharedInternals.ReactCurrentDispatcher,
|
|
findHostInstanceByFiber: function(fiber) {
|
|
fiber = findCurrentHostFiber(fiber);
|
|
return null === fiber ? null : fiber.stateNode;
|
|
},
|
|
findFiberByHostInstance:
|
|
devToolsConfig$jscomp$inline_986.findFiberByHostInstance ||
|
|
emptyFindFiberByHostInstance,
|
|
findHostInstancesForRefresh: null,
|
|
scheduleRefresh: null,
|
|
scheduleRoot: null,
|
|
setRefreshHandler: null,
|
|
getCurrentFiber: null
|
|
};
|
|
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
|
var hook$jscomp$inline_1283 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
if (
|
|
!hook$jscomp$inline_1283.isDisabled &&
|
|
hook$jscomp$inline_1283.supportsFiber
|
|
)
|
|
try {
|
|
(rendererID = hook$jscomp$inline_1283.inject(
|
|
internals$jscomp$inline_1282
|
|
)),
|
|
(injectedHook = hook$jscomp$inline_1283);
|
|
} catch (err) {}
|
|
}
|
|
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
|
|
computeComponentStackForErrorReporting: function(reactTag) {
|
|
return (reactTag = getInstanceFromTag(reactTag))
|
|
? getStackByFiberInDevAndProd(reactTag)
|
|
: "";
|
|
}
|
|
};
|
|
exports.createPortal = function(children, containerTag) {
|
|
return createPortal(
|
|
children,
|
|
containerTag,
|
|
null,
|
|
2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null
|
|
);
|
|
};
|
|
exports.dispatchCommand = function(handle, command, args) {
|
|
null != handle._nativeTag &&
|
|
(handle._internalInstanceHandle
|
|
? nativeFabricUIManager.dispatchCommand(
|
|
handle._internalInstanceHandle.stateNode.node,
|
|
command,
|
|
args
|
|
)
|
|
: ReactNativePrivateInterface.UIManager.dispatchViewManagerCommand(
|
|
handle._nativeTag,
|
|
command,
|
|
args
|
|
));
|
|
};
|
|
exports.findHostInstance_DEPRECATED = function(componentOrHandle) {
|
|
if (null == componentOrHandle) return null;
|
|
if (componentOrHandle._nativeTag) return componentOrHandle;
|
|
if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag)
|
|
return componentOrHandle.canonical;
|
|
componentOrHandle = findHostInstance(componentOrHandle);
|
|
return null == componentOrHandle
|
|
? componentOrHandle
|
|
: componentOrHandle.canonical
|
|
? componentOrHandle.canonical
|
|
: componentOrHandle;
|
|
};
|
|
exports.findNodeHandle = findNodeHandle;
|
|
exports.render = function(element, containerTag, callback) {
|
|
var root = roots.get(containerTag);
|
|
if (!root) {
|
|
root = new FiberRootNode(containerTag, 0, !1);
|
|
var JSCompiler_inline_result = 0;
|
|
isDevToolsPresent && (JSCompiler_inline_result |= 4);
|
|
JSCompiler_inline_result = createFiber(
|
|
3,
|
|
null,
|
|
null,
|
|
JSCompiler_inline_result
|
|
);
|
|
root.current = JSCompiler_inline_result;
|
|
JSCompiler_inline_result.stateNode = root;
|
|
JSCompiler_inline_result.memoizedState = { element: null };
|
|
initializeUpdateQueue(JSCompiler_inline_result);
|
|
roots.set(containerTag, root);
|
|
}
|
|
updateContainer(element, root, null, callback);
|
|
a: if (((element = root.current), element.child))
|
|
switch (element.child.tag) {
|
|
case 5:
|
|
element = element.child.stateNode;
|
|
break a;
|
|
default:
|
|
element = element.child.stateNode;
|
|
}
|
|
else element = null;
|
|
return element;
|
|
};
|
|
exports.sendAccessibilityEvent = function(handle, eventType) {
|
|
null != handle._nativeTag &&
|
|
(handle._internalInstanceHandle
|
|
? nativeFabricUIManager.sendAccessibilityEvent(
|
|
handle._internalInstanceHandle.stateNode.node,
|
|
eventType
|
|
)
|
|
: ReactNativePrivateInterface.legacySendAccessibilityEvent(
|
|
handle._nativeTag,
|
|
eventType
|
|
));
|
|
};
|
|
exports.unmountComponentAtNode = unmountComponentAtNode;
|
|
exports.unmountComponentAtNodeAndRemoveContainer = function(containerTag) {
|
|
unmountComponentAtNode(containerTag);
|
|
ReactNativePrivateInterface.UIManager.removeRootView(containerTag);
|
|
};
|
|
exports.unstable_batchedUpdates = batchedUpdates;
|