diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 13c3b00..243db52 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -10,7 +10,7 @@ body: options: - label: 我已阅读 [常见问题](https://lyswhut.github.io/lx-music-doc/mobile/faq),但没有找到解决方案。 required: true - - label: 我已搜索 [Issue 列表](https://github.com/lyswhut/lx-music-mobile/issues?q=is%3Aissue+),但没有发现类似的问题。 + - label: 我已搜索 [Issue 列表](https://github.com/ikunshare/ikun-music-mobile/issues?q=is%3Aissue+),但没有发现类似的问题。 required: true - type: textarea id: expected-behavior diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml index 0994b80..b58d9c6 100644 --- a/.github/ISSUE_TEMPLATE/feature.yml +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -10,7 +10,7 @@ body: options: - label: 我已阅读 [常见问题](https://lyswhut.github.io/lx-music-doc/mobile/faq),但没有找到解决方案。 required: true - - label: 我已搜索 [Issue 列表](https://github.com/lyswhut/lx-music-mobile/issues?q=is%3Aissue+),但没有发现类似的问题。 + - label: 我已搜索 [Issue 列表](https://github.com/ikunshare/ikun-music-mobile/issues?q=is%3Aissue+),但没有发现类似的问题。 required: true - type: textarea id: problem-description diff --git a/README.md b/README.md index 51c378b..75f6d38 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -

lx-music logo

+

lx-music logo

LX Music 移动版

- Release version - Build status - Build status - React native version - - Dev branch version - + Release version + Build status + Build status + React native version + + Dev branch version +

一个基于 React Native 开发的音乐软件

@@ -23,13 +23,13 @@ *注:由于没有相关开发环境及证书,所以 **没有计划支持 iOS**。*
*桌面版项目地址:* -软件变化请查看 [更新日志](https://github.com/lyswhut/lx-music-mobile/blob/master/CHANGELOG.md)。 +软件变化请查看 [更新日志](https://github.com/ikunshare/ikun-music-mobile/blob/master/CHANGELOG.md)。 -软件下载请查看 [GitHub Releases](https://github.com/lyswhut/lx-music-mobile/releases)。 +软件下载请查看 [GitHub Releases](https://github.com/ikunshare/ikun-music-mobile/releases)。 使用常见问题请参阅 [常见问题](https://lyswhut.github.io/lx-music-doc/mobile/faq)。 -目前本项目的原始发布地址只有 [**GitHub Releases**](https://github.com/lyswhut/lx-music-mobile/releases),其他渠道均为第三方转载发布,与本项目无关! +目前本项目的原始发布地址只有 [**GitHub Releases**](https://github.com/ikunshare/ikun-music-mobile/releases),其他渠道均为第三方转载发布,与本项目无关! 为了提高使用门槛,本软件内的默认设置、UI 操作不以新手友好为目标,所以使用前建议先根据你的喜好浏览调整一遍软件设置,阅读一遍 [音乐播放列表机制](https://lyswhut.github.io/lx-music-doc/mobile/faq/playlist)。 @@ -54,11 +54,11 @@ +

lx-music mobile UI

--> ## 项目协议 -本项目基于 [Apache License 2.0](https://github.com/lyswhut/lx-music-mobile/blob/master/LICENSE) 许可证发行,以下协议是对于 Apache License 2.0 的补充,如有冲突,以以下协议为准。 +本项目基于 [Apache License 2.0](https://github.com/ikunshare/ikun-music-mobile/blob/master/LICENSE) 许可证发行,以下协议是对于 Apache License 2.0 的补充,如有冲突,以以下协议为准。 --- diff --git a/index.android.bundle b/index.android.bundle new file mode 100644 index 0000000..e709856 --- /dev/null +++ b/index.android.bundle @@ -0,0 +1,240610 @@ +var __BUNDLE_START_TIME__=this.nativePerformanceNow?nativePerformanceNow():Date.now(),__DEV__=true,process=this.process||{},__METRO_GLOBAL_PREFIX__='',__requireCycleIgnorePatterns=[/(^|\/|\\)node_modules($|\/|\\)/];process.env=process.env||{};process.env.NODE_ENV=process.env.NODE_ENV||"development"; +(function (global) { + "use strict"; + + global.__r = metroRequire; + global[`${__METRO_GLOBAL_PREFIX__}__d`] = define; + global.__c = clear; + global.__registerSegment = registerSegment; + var modules = clear(); + var EMPTY = {}; + var CYCLE_DETECTED = {}; + var _ref = {}, + hasOwnProperty = _ref.hasOwnProperty; + if (__DEV__) { + global.$RefreshReg$ = function () {}; + global.$RefreshSig$ = function () { + return function (type) { + return type; + }; + }; + } + function clear() { + modules = new Map(); + return modules; + } + if (__DEV__) { + var verboseNamesToModuleIds = new Map(); + var getModuleIdForVerboseName = function getModuleIdForVerboseName(verboseName) { + var moduleId = verboseNamesToModuleIds.get(verboseName); + if (moduleId == null) { + throw new Error(`Unknown named module: "${verboseName}"`); + } + return moduleId; + }; + var initializingModuleIds = []; + } + function define(factory, moduleId, dependencyMap) { + if (modules.has(moduleId)) { + if (__DEV__) { + var inverseDependencies = arguments[4]; + if (inverseDependencies) { + global.__accept(moduleId, factory, dependencyMap, inverseDependencies); + } + } + return; + } + var mod = { + dependencyMap: dependencyMap, + factory: factory, + hasError: false, + importedAll: EMPTY, + importedDefault: EMPTY, + isInitialized: false, + publicModule: { + exports: {} + } + }; + modules.set(moduleId, mod); + if (__DEV__) { + mod.hot = createHotReloadingObject(); + var verboseName = arguments[3]; + if (verboseName) { + mod.verboseName = verboseName; + verboseNamesToModuleIds.set(verboseName, moduleId); + } + } + } + function metroRequire(moduleId) { + if (__DEV__ && typeof moduleId === "string") { + var verboseName = moduleId; + moduleId = getModuleIdForVerboseName(verboseName); + console.warn(`Requiring module "${verboseName}" by name is only supported for ` + "debugging purposes and will BREAK IN PRODUCTION!"); + } + var moduleIdReallyIsNumber = moduleId; + if (__DEV__) { + var initializingIndex = initializingModuleIds.indexOf(moduleIdReallyIsNumber); + if (initializingIndex !== -1) { + var cycle = initializingModuleIds.slice(initializingIndex).map(function (id) { + var _modules$get$verboseN, _modules$get; + return (_modules$get$verboseN = (_modules$get = modules.get(id)) == null ? void 0 : _modules$get.verboseName) != null ? _modules$get$verboseN : "[unknown]"; + }); + if (shouldPrintRequireCycle(cycle)) { + cycle.push(cycle[0]); + console.warn(`Require cycle: ${cycle.join(" -> ")}\n\n` + "Require cycles are allowed, but can result in uninitialized values. " + "Consider refactoring to remove the need for a cycle."); + } + } + } + var module = modules.get(moduleIdReallyIsNumber); + return module && module.isInitialized ? module.publicModule.exports : guardedLoadModule(moduleIdReallyIsNumber, module); + } + function shouldPrintRequireCycle(modules) { + var regExps = global[__METRO_GLOBAL_PREFIX__ + "__requireCycleIgnorePatterns"]; + if (!Array.isArray(regExps)) { + return true; + } + var isIgnored = function isIgnored(module) { + return module != null && regExps.some(function (regExp) { + return regExp.test(module); + }); + }; + return modules.every(function (module) { + return !isIgnored(module); + }); + } + function metroImportDefault(moduleId) { + if (__DEV__ && typeof moduleId === "string") { + var verboseName = moduleId; + moduleId = getModuleIdForVerboseName(verboseName); + } + var moduleIdReallyIsNumber = moduleId; + var maybeInitializedModule = modules.get(moduleIdReallyIsNumber); + if (maybeInitializedModule && maybeInitializedModule.importedDefault !== EMPTY) { + return maybeInitializedModule.importedDefault; + } + var exports = metroRequire(moduleIdReallyIsNumber); + var importedDefault = exports && exports.__esModule ? exports.default : exports; + var initializedModule = modules.get(moduleIdReallyIsNumber); + return initializedModule.importedDefault = importedDefault; + } + metroRequire.importDefault = metroImportDefault; + function metroImportAll(moduleId) { + if (__DEV__ && typeof moduleId === "string") { + var verboseName = moduleId; + moduleId = getModuleIdForVerboseName(verboseName); + } + var moduleIdReallyIsNumber = moduleId; + var maybeInitializedModule = modules.get(moduleIdReallyIsNumber); + if (maybeInitializedModule && maybeInitializedModule.importedAll !== EMPTY) { + return maybeInitializedModule.importedAll; + } + var exports = metroRequire(moduleIdReallyIsNumber); + var importedAll; + if (exports && exports.__esModule) { + importedAll = exports; + } else { + importedAll = {}; + if (exports) { + for (var key in exports) { + if (hasOwnProperty.call(exports, key)) { + importedAll[key] = exports[key]; + } + } + } + importedAll.default = exports; + } + var initializedModule = modules.get(moduleIdReallyIsNumber); + return initializedModule.importedAll = importedAll; + } + metroRequire.importAll = metroImportAll; + metroRequire.context = function fallbackRequireContext() { + if (__DEV__) { + throw new Error("The experimental Metro feature `require.context` is not enabled in your project.\nThis can be enabled by setting the `transformer.unstable_allowRequireContext` property to `true` in your Metro configuration."); + } + throw new Error("The experimental Metro feature `require.context` is not enabled in your project."); + }; + metroRequire.resolveWeak = function fallbackRequireResolveWeak() { + if (__DEV__) { + throw new Error("require.resolveWeak cannot be called dynamically. Ensure you are using the same version of `metro` and `metro-runtime`."); + } + throw new Error("require.resolveWeak cannot be called dynamically."); + }; + var inGuard = false; + function guardedLoadModule(moduleId, module) { + if (!inGuard && global.ErrorUtils) { + inGuard = true; + var returnValue; + try { + returnValue = loadModuleImplementation(moduleId, module); + } catch (e) { + global.ErrorUtils.reportFatalError(e); + } + inGuard = false; + return returnValue; + } else { + return loadModuleImplementation(moduleId, module); + } + } + var ID_MASK_SHIFT = 16; + var LOCAL_ID_MASK = ~0 >>> ID_MASK_SHIFT; + function unpackModuleId(moduleId) { + var segmentId = moduleId >>> ID_MASK_SHIFT; + var localId = moduleId & LOCAL_ID_MASK; + return { + segmentId: segmentId, + localId: localId + }; + } + metroRequire.unpackModuleId = unpackModuleId; + function packModuleId(value) { + return (value.segmentId << ID_MASK_SHIFT) + value.localId; + } + metroRequire.packModuleId = packModuleId; + var moduleDefinersBySegmentID = []; + var definingSegmentByModuleID = new Map(); + function registerSegment(segmentId, moduleDefiner, moduleIds) { + moduleDefinersBySegmentID[segmentId] = moduleDefiner; + if (__DEV__) { + if (segmentId === 0 && moduleIds) { + throw new Error("registerSegment: Expected moduleIds to be null for main segment"); + } + if (segmentId !== 0 && !moduleIds) { + throw new Error("registerSegment: Expected moduleIds to be passed for segment #" + segmentId); + } + } + if (moduleIds) { + moduleIds.forEach(function (moduleId) { + if (!modules.has(moduleId) && !definingSegmentByModuleID.has(moduleId)) { + definingSegmentByModuleID.set(moduleId, segmentId); + } + }); + } + } + function loadModuleImplementation(moduleId, module) { + if (!module && moduleDefinersBySegmentID.length > 0) { + var _definingSegmentByMod; + var segmentId = (_definingSegmentByMod = definingSegmentByModuleID.get(moduleId)) != null ? _definingSegmentByMod : 0; + var definer = moduleDefinersBySegmentID[segmentId]; + if (definer != null) { + definer(moduleId); + module = modules.get(moduleId); + definingSegmentByModuleID.delete(moduleId); + } + } + var nativeRequire = global.nativeRequire; + if (!module && nativeRequire) { + var _unpackModuleId = unpackModuleId(moduleId), + _segmentId = _unpackModuleId.segmentId, + localId = _unpackModuleId.localId; + nativeRequire(localId, _segmentId); + module = modules.get(moduleId); + } + if (!module) { + throw unknownModuleError(moduleId); + } + if (module.hasError) { + throw module.error; + } + if (__DEV__) { + var Systrace = requireSystrace(); + var Refresh = requireRefresh(); + } + module.isInitialized = true; + var _module = module, + factory = _module.factory, + dependencyMap = _module.dependencyMap; + if (__DEV__) { + initializingModuleIds.push(moduleId); + } + try { + if (__DEV__) { + Systrace.beginEvent("JS_require_" + (module.verboseName || moduleId)); + } + var moduleObject = module.publicModule; + if (__DEV__) { + moduleObject.hot = module.hot; + var prevRefreshReg = global.$RefreshReg$; + var prevRefreshSig = global.$RefreshSig$; + if (Refresh != null) { + var RefreshRuntime = Refresh; + global.$RefreshReg$ = function (type, id) { + RefreshRuntime.register(type, moduleId + " " + id); + }; + global.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform; + } + } + moduleObject.id = moduleId; + factory(global, metroRequire, metroImportDefault, metroImportAll, moduleObject, moduleObject.exports, dependencyMap); + if (!__DEV__) { + module.factory = undefined; + module.dependencyMap = undefined; + } + if (__DEV__) { + Systrace.endEvent(); + if (Refresh != null) { + registerExportsForReactRefresh(Refresh, moduleObject.exports, moduleId); + } + } + return moduleObject.exports; + } catch (e) { + module.hasError = true; + module.error = e; + module.isInitialized = false; + module.publicModule.exports = undefined; + throw e; + } finally { + if (__DEV__) { + if (initializingModuleIds.pop() !== moduleId) { + throw new Error("initializingModuleIds is corrupt; something is terribly wrong"); + } + global.$RefreshReg$ = prevRefreshReg; + global.$RefreshSig$ = prevRefreshSig; + } + } + } + function unknownModuleError(id) { + var message = 'Requiring unknown module "' + id + '".'; + if (__DEV__) { + message += " If you are sure the module exists, try restarting Metro. " + "You may also want to run `yarn` or `npm install`."; + } + return Error(message); + } + if (__DEV__) { + metroRequire.Systrace = { + beginEvent: function beginEvent() {}, + endEvent: function endEvent() {} + }; + metroRequire.getModules = function () { + return modules; + }; + var createHotReloadingObject = function createHotReloadingObject() { + var hot = { + _acceptCallback: null, + _disposeCallback: null, + _didAccept: false, + accept: function accept(callback) { + hot._didAccept = true; + hot._acceptCallback = callback; + }, + dispose: function dispose(callback) { + hot._disposeCallback = callback; + } + }; + return hot; + }; + var reactRefreshTimeout = null; + var metroHotUpdateModule = function metroHotUpdateModule(id, factory, dependencyMap, inverseDependencies) { + var mod = modules.get(id); + if (!mod) { + if (factory) { + return; + } + throw unknownModuleError(id); + } + if (!mod.hasError && !mod.isInitialized) { + mod.factory = factory; + mod.dependencyMap = dependencyMap; + return; + } + var Refresh = requireRefresh(); + var refreshBoundaryIDs = new Set(); + var didBailOut = false; + var updatedModuleIDs; + try { + updatedModuleIDs = topologicalSort([id], function (pendingID) { + var pendingModule = modules.get(pendingID); + if (pendingModule == null) { + return []; + } + var pendingHot = pendingModule.hot; + if (pendingHot == null) { + throw new Error("[Refresh] Expected module.hot to always exist in DEV."); + } + var canAccept = pendingHot._didAccept; + if (!canAccept && Refresh != null) { + var isBoundary = isReactRefreshBoundary(Refresh, pendingModule.publicModule.exports); + if (isBoundary) { + canAccept = true; + refreshBoundaryIDs.add(pendingID); + } + } + if (canAccept) { + return []; + } + var parentIDs = inverseDependencies[pendingID]; + if (parentIDs.length === 0) { + performFullRefresh("No root boundary", { + source: mod, + failed: pendingModule + }); + didBailOut = true; + return []; + } + return parentIDs; + }, function () { + return didBailOut; + }).reverse(); + } catch (e) { + if (e === CYCLE_DETECTED) { + performFullRefresh("Dependency cycle", { + source: mod + }); + return; + } + throw e; + } + if (didBailOut) { + return; + } + var seenModuleIDs = new Set(); + for (var i = 0; i < updatedModuleIDs.length; i++) { + var updatedID = updatedModuleIDs[i]; + if (seenModuleIDs.has(updatedID)) { + continue; + } + seenModuleIDs.add(updatedID); + var updatedMod = modules.get(updatedID); + if (updatedMod == null) { + throw new Error("[Refresh] Expected to find the updated module."); + } + var prevExports = updatedMod.publicModule.exports; + var didError = runUpdatedModule(updatedID, updatedID === id ? factory : undefined, updatedID === id ? dependencyMap : undefined); + var nextExports = updatedMod.publicModule.exports; + if (didError) { + return; + } + if (refreshBoundaryIDs.has(updatedID)) { + var isNoLongerABoundary = !isReactRefreshBoundary(Refresh, nextExports); + var didInvalidate = shouldInvalidateReactRefreshBoundary(Refresh, prevExports, nextExports); + if (isNoLongerABoundary || didInvalidate) { + var parentIDs = inverseDependencies[updatedID]; + if (parentIDs.length === 0) { + performFullRefresh(isNoLongerABoundary ? "No longer a boundary" : "Invalidated boundary", { + source: mod, + failed: updatedMod + }); + return; + } + for (var j = 0; j < parentIDs.length; j++) { + var parentID = parentIDs[j]; + var parentMod = modules.get(parentID); + if (parentMod == null) { + throw new Error("[Refresh] Expected to find parent module."); + } + var canAcceptParent = isReactRefreshBoundary(Refresh, parentMod.publicModule.exports); + if (canAcceptParent) { + refreshBoundaryIDs.add(parentID); + updatedModuleIDs.push(parentID); + } else { + performFullRefresh("Invalidated boundary", { + source: mod, + failed: parentMod + }); + return; + } + } + } + } + } + if (Refresh != null) { + if (reactRefreshTimeout == null) { + reactRefreshTimeout = setTimeout(function () { + reactRefreshTimeout = null; + Refresh.performReactRefresh(); + }, 30); + } + } + }; + var topologicalSort = function topologicalSort(roots, getEdges, earlyStop) { + var result = []; + var visited = new Set(); + var stack = new Set(); + function traverseDependentNodes(node) { + if (stack.has(node)) { + throw CYCLE_DETECTED; + } + if (visited.has(node)) { + return; + } + visited.add(node); + stack.add(node); + var dependentNodes = getEdges(node); + if (earlyStop(node)) { + stack.delete(node); + return; + } + dependentNodes.forEach(function (dependent) { + traverseDependentNodes(dependent); + }); + stack.delete(node); + result.push(node); + } + roots.forEach(function (root) { + traverseDependentNodes(root); + }); + return result; + }; + var runUpdatedModule = function runUpdatedModule(id, factory, dependencyMap) { + var mod = modules.get(id); + if (mod == null) { + throw new Error("[Refresh] Expected to find the module."); + } + var hot = mod.hot; + if (!hot) { + throw new Error("[Refresh] Expected module.hot to always exist in DEV."); + } + if (hot._disposeCallback) { + try { + hot._disposeCallback(); + } catch (error) { + console.error(`Error while calling dispose handler for module ${id}: `, error); + } + } + if (factory) { + mod.factory = factory; + } + if (dependencyMap) { + mod.dependencyMap = dependencyMap; + } + mod.hasError = false; + mod.error = undefined; + mod.importedAll = EMPTY; + mod.importedDefault = EMPTY; + mod.isInitialized = false; + var prevExports = mod.publicModule.exports; + mod.publicModule.exports = {}; + hot._didAccept = false; + hot._acceptCallback = null; + hot._disposeCallback = null; + metroRequire(id); + if (mod.hasError) { + mod.hasError = false; + mod.isInitialized = true; + mod.error = null; + mod.publicModule.exports = prevExports; + return true; + } + if (hot._acceptCallback) { + try { + hot._acceptCallback(); + } catch (error) { + console.error(`Error while calling accept handler for module ${id}: `, error); + } + } + return false; + }; + var performFullRefresh = function performFullRefresh(reason, modules) { + if (typeof window !== "undefined" && window.location != null && typeof window.location.reload === "function") { + window.location.reload(); + } else { + var Refresh = requireRefresh(); + if (Refresh != null) { + var _modules$source$verbo, _modules$source, _modules$failed$verbo, _modules$failed; + var sourceName = (_modules$source$verbo = (_modules$source = modules.source) == null ? void 0 : _modules$source.verboseName) != null ? _modules$source$verbo : "unknown"; + var failedName = (_modules$failed$verbo = (_modules$failed = modules.failed) == null ? void 0 : _modules$failed.verboseName) != null ? _modules$failed$verbo : "unknown"; + Refresh.performFullRefresh(`Fast Refresh - ${reason} <${sourceName}> <${failedName}>`); + } else { + console.warn("Could not reload the application after an edit."); + } + } + }; + var isReactRefreshBoundary = function isReactRefreshBoundary(Refresh, moduleExports) { + if (Refresh.isLikelyComponentType(moduleExports)) { + return true; + } + if (moduleExports == null || typeof moduleExports !== "object") { + return false; + } + var hasExports = false; + var areAllExportsComponents = true; + for (var key in moduleExports) { + hasExports = true; + if (key === "__esModule") { + continue; + } + var desc = Object.getOwnPropertyDescriptor(moduleExports, key); + if (desc && desc.get) { + return false; + } + var exportValue = moduleExports[key]; + if (!Refresh.isLikelyComponentType(exportValue)) { + areAllExportsComponents = false; + } + } + return hasExports && areAllExportsComponents; + }; + var shouldInvalidateReactRefreshBoundary = function shouldInvalidateReactRefreshBoundary(Refresh, prevExports, nextExports) { + var prevSignature = getRefreshBoundarySignature(Refresh, prevExports); + var nextSignature = getRefreshBoundarySignature(Refresh, nextExports); + if (prevSignature.length !== nextSignature.length) { + return true; + } + for (var i = 0; i < nextSignature.length; i++) { + if (prevSignature[i] !== nextSignature[i]) { + return true; + } + } + return false; + }; + var getRefreshBoundarySignature = function getRefreshBoundarySignature(Refresh, moduleExports) { + var signature = []; + signature.push(Refresh.getFamilyByType(moduleExports)); + if (moduleExports == null || typeof moduleExports !== "object") { + return signature; + } + for (var key in moduleExports) { + if (key === "__esModule") { + continue; + } + var desc = Object.getOwnPropertyDescriptor(moduleExports, key); + if (desc && desc.get) { + continue; + } + var exportValue = moduleExports[key]; + signature.push(key); + signature.push(Refresh.getFamilyByType(exportValue)); + } + return signature; + }; + var registerExportsForReactRefresh = function registerExportsForReactRefresh(Refresh, moduleExports, moduleID) { + Refresh.register(moduleExports, moduleID + " %exports%"); + if (moduleExports == null || typeof moduleExports !== "object") { + return; + } + for (var key in moduleExports) { + var desc = Object.getOwnPropertyDescriptor(moduleExports, key); + if (desc && desc.get) { + continue; + } + var exportValue = moduleExports[key]; + var typeID = moduleID + " %exports% " + key; + Refresh.register(exportValue, typeID); + } + }; + global.__accept = metroHotUpdateModule; + } + if (__DEV__) { + var requireSystrace = function requireSystrace() { + return global[__METRO_GLOBAL_PREFIX__ + "__SYSTRACE"] || metroRequire.Systrace; + }; + var requireRefresh = function requireRefresh() { + return global[__METRO_GLOBAL_PREFIX__ + "__ReactRefresh"] || metroRequire.Refresh; + }; + } +})(typeof globalThis !== 'undefined' ? globalThis : typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this); +(function (global) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @polyfill + * @nolint + * @format + */ + + /* eslint-disable no-shadow, eqeqeq, curly, no-unused-vars, no-void, no-control-regex */ + + /** + * This pipes all of our console logging functions to native logging so that + * JavaScript errors in required modules show up in Xcode via NSLog. + */ + var inspect = function () { + // Copyright Joyent, Inc. and other Node contributors. + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the + // "Software"), to deal in the Software without restriction, including + // without limitation the rights to use, copy, modify, merge, publish, + // distribute, sublicense, and/or sell copies of the Software, and to permit + // persons to whom the Software is furnished to do so, subject to the + // following conditions: + // + // The above copyright notice and this permission notice shall be included + // in all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + // + // https://github.com/joyent/node/blob/master/lib/util.js + + function inspect(obj, opts) { + var ctx = { + seen: [], + formatValueCalls: 0, + stylize: stylizeNoColor + }; + return formatValue(ctx, obj, opts.depth); + } + function stylizeNoColor(str, styleType) { + return str; + } + function arrayToHash(array) { + var hash = {}; + array.forEach(function (val, idx) { + hash[val] = true; + }); + return hash; + } + function formatValue(ctx, value, recurseTimes) { + ctx.formatValueCalls++; + if (ctx.formatValueCalls > 200) { + return `[TOO BIG formatValueCalls ${ctx.formatValueCalls} exceeded limit of 200]`; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + var base = '', + array = false, + braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + ctx.seen.push(value); + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function (key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + ctx.seen.pop(); + return reduceToSingleString(output, base, braces); + } + function formatPrimitive(ctx, value) { + if (isUndefined(value)) return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) return ctx.stylize('null', 'null'); + } + function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; + } + function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function (key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); + } + }); + return output; + } + function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { + value: value[key] + }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function (line) { + return ' ' + line; + }).join('\n').slice(2); + } else { + str = '\n' + str.split('\n').map(function (line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.slice(1, name.length - 1); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + return name + ': ' + str; + } + function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function (prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + if (length > 60) { + return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1]; + } + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; + } + + // NOTE: These type checking functions intentionally don't use `instanceof` + // because it is fragile and can be easily faked with `Object.create()`. + function isArray(ar) { + return Array.isArray(ar); + } + function isBoolean(arg) { + return typeof arg === 'boolean'; + } + function isNull(arg) { + return arg === null; + } + function isNullOrUndefined(arg) { + return arg == null; + } + function isNumber(arg) { + return typeof arg === 'number'; + } + function isString(arg) { + return typeof arg === 'string'; + } + function isSymbol(arg) { + return typeof arg === 'symbol'; + } + function isUndefined(arg) { + return arg === void 0; + } + function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; + } + function isObject(arg) { + return typeof arg === 'object' && arg !== null; + } + function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; + } + function isError(e) { + return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error); + } + function isFunction(arg) { + return typeof arg === 'function'; + } + function objectToString(o) { + return Object.prototype.toString.call(o); + } + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + return inspect; + }(); + var OBJECT_COLUMN_NAME = '(index)'; + var LOG_LEVELS = { + trace: 0, + info: 1, + warn: 2, + error: 3 + }; + var INSPECTOR_LEVELS = []; + INSPECTOR_LEVELS[LOG_LEVELS.trace] = 'debug'; + INSPECTOR_LEVELS[LOG_LEVELS.info] = 'log'; + INSPECTOR_LEVELS[LOG_LEVELS.warn] = 'warning'; + INSPECTOR_LEVELS[LOG_LEVELS.error] = 'error'; + + // Strip the inner function in getNativeLogFunction(), if in dev also + // strip method printing to originalConsole. + var INSPECTOR_FRAMES_TO_SKIP = __DEV__ ? 2 : 1; + function getNativeLogFunction(level) { + return function () { + var str; + if (arguments.length === 1 && typeof arguments[0] === 'string') { + str = arguments[0]; + } else { + str = Array.prototype.map.call(arguments, function (arg) { + return inspect(arg, { + depth: 10 + }); + }).join(', '); + } + + // TRICKY + // If more than one argument is provided, the code above collapses them all + // into a single formatted string. This transform wraps string arguments in + // single quotes (e.g. "foo" -> "'foo'") which then breaks the "Warning:" + // check below. So it's important that we look at the first argument, rather + // than the formatted argument string. + var firstArg = arguments[0]; + var logLevel = level; + if (typeof firstArg === 'string' && firstArg.slice(0, 9) === 'Warning: ' && logLevel >= LOG_LEVELS.error) { + // React warnings use console.error so that a stack trace is shown, + // but we don't (currently) want these to show a redbox + // (Note: Logic duplicated in ExceptionsManager.js.) + logLevel = LOG_LEVELS.warn; + } + if (global.__inspectorLog) { + global.__inspectorLog(INSPECTOR_LEVELS[logLevel], str, [].slice.call(arguments), INSPECTOR_FRAMES_TO_SKIP); + } + if (groupStack.length) { + str = groupFormat('', str); + } + global.nativeLoggingHook(str, logLevel); + }; + } + function repeat(element, n) { + return Array.apply(null, Array(n)).map(function () { + return element; + }); + } + function consoleTablePolyfill(rows) { + // convert object -> array + if (!Array.isArray(rows)) { + var data = rows; + rows = []; + for (var key in data) { + if (data.hasOwnProperty(key)) { + var row = data[key]; + row[OBJECT_COLUMN_NAME] = key; + rows.push(row); + } + } + } + if (rows.length === 0) { + global.nativeLoggingHook('', LOG_LEVELS.info); + return; + } + var columns = Object.keys(rows[0]).sort(); + var stringRows = []; + var columnWidths = []; + + // Convert each cell to a string. Also + // figure out max cell width for each column + columns.forEach(function (k, i) { + columnWidths[i] = k.length; + for (var j = 0; j < rows.length; j++) { + var cellStr = (rows[j][k] || '?').toString(); + stringRows[j] = stringRows[j] || []; + stringRows[j][i] = cellStr; + columnWidths[i] = Math.max(columnWidths[i], cellStr.length); + } + }); + + // Join all elements in the row into a single string with | separators + // (appends extra spaces to each cell to make separators | aligned) + function joinRow(row, space) { + var cells = row.map(function (cell, i) { + var extraSpaces = repeat(' ', columnWidths[i] - cell.length).join(''); + return cell + extraSpaces; + }); + space = space || ' '; + return cells.join(space + '|' + space); + } + var separators = columnWidths.map(function (columnWidth) { + return repeat('-', columnWidth).join(''); + }); + var separatorRow = joinRow(separators, '-'); + var header = joinRow(columns); + var table = [header, separatorRow]; + for (var i = 0; i < rows.length; i++) { + table.push(joinRow(stringRows[i])); + } + + // Notice extra empty line at the beginning. + // Native logging hook adds "RCTLog >" at the front of every + // logged string, which would shift the header and screw up + // the table + global.nativeLoggingHook('\n' + table.join('\n'), LOG_LEVELS.info); + } + var GROUP_PAD = "\u2502"; // Box light vertical + var GROUP_OPEN = "\u2510"; // Box light down+left + var GROUP_CLOSE = "\u2518"; // Box light up+left + + var groupStack = []; + function groupFormat(prefix, msg) { + // Insert group formatting before the console message + return groupStack.join('') + prefix + ' ' + (msg || ''); + } + function consoleGroupPolyfill(label) { + global.nativeLoggingHook(groupFormat(GROUP_OPEN, label), LOG_LEVELS.info); + groupStack.push(GROUP_PAD); + } + function consoleGroupCollapsedPolyfill(label) { + global.nativeLoggingHook(groupFormat(GROUP_CLOSE, label), LOG_LEVELS.info); + groupStack.push(GROUP_PAD); + } + function consoleGroupEndPolyfill() { + groupStack.pop(); + global.nativeLoggingHook(groupFormat(GROUP_CLOSE), LOG_LEVELS.info); + } + function consoleAssertPolyfill(expression, label) { + if (!expression) { + global.nativeLoggingHook('Assertion failed: ' + label, LOG_LEVELS.error); + } + } + if (global.nativeLoggingHook) { + var originalConsole = global.console; + // Preserve the original `console` as `originalConsole` + if (__DEV__ && originalConsole) { + var descriptor = Object.getOwnPropertyDescriptor(global, 'console'); + if (descriptor) { + Object.defineProperty(global, 'originalConsole', descriptor); + } + } + global.console = { + error: getNativeLogFunction(LOG_LEVELS.error), + info: getNativeLogFunction(LOG_LEVELS.info), + log: getNativeLogFunction(LOG_LEVELS.info), + warn: getNativeLogFunction(LOG_LEVELS.warn), + trace: getNativeLogFunction(LOG_LEVELS.trace), + debug: getNativeLogFunction(LOG_LEVELS.trace), + table: consoleTablePolyfill, + group: consoleGroupPolyfill, + groupEnd: consoleGroupEndPolyfill, + groupCollapsed: consoleGroupCollapsedPolyfill, + assert: consoleAssertPolyfill + }; + Object.defineProperty(console, '_isPolyfilled', { + value: true, + enumerable: false + }); + + // If available, also call the original `console` method since that is + // sometimes useful. Ex: on OS X, this will let you see rich output in + // the Safari Web Inspector console. + if (__DEV__ && originalConsole) { + Object.keys(console).forEach(function (methodName) { + var reactNativeMethod = console[methodName]; + if (originalConsole[methodName]) { + console[methodName] = function () { + originalConsole[methodName].apply(originalConsole, arguments); + reactNativeMethod.apply(console, arguments); + }; + } + }); + + // The following methods are not supported by this polyfill but + // we still should pass them to original console if they are + // supported by it. + ['clear', 'dir', 'dirxml', 'profile', 'profileEnd'].forEach(function (methodName) { + if (typeof originalConsole[methodName] === 'function') { + console[methodName] = function () { + originalConsole[methodName].apply(originalConsole, arguments); + }; + } + }); + } + } else if (!global.console) { + var stub = function stub() {}; + var log = global.print || stub; + global.console = { + debug: log, + error: log, + info: log, + log: log, + trace: log, + warn: log, + assert: function assert(expression, label) { + if (!expression) { + log('Assertion failed: ' + label); + } + }, + clear: stub, + dir: stub, + dirxml: stub, + group: stub, + groupCollapsed: stub, + groupEnd: stub, + profile: stub, + profileEnd: stub, + table: stub + }; + Object.defineProperty(console, '_isPolyfilled', { + value: true, + enumerable: false + }); + } +})(typeof globalThis !== 'undefined' ? globalThis : typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this); +(function (global) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + * @polyfill + */ + + var _inGuard = 0; + /** + * This is the error handler that is called when we encounter an exception + * when loading a module. This will report any errors encountered before + * ExceptionsManager is configured. + */ + var _globalHandler = function onError(e, isFatal) { + throw e; + }; + + /** + * The particular require runtime that we are using looks for a global + * `ErrorUtils` object and if it exists, then it requires modules with the + * error handler specified via ErrorUtils.setGlobalHandler by calling the + * require function with applyWithGuard. Since the require module is loaded + * before any of the modules, this ErrorUtils must be defined (and the handler + * set) globally before requiring anything. + */ + var ErrorUtils = { + setGlobalHandler: function setGlobalHandler(fun) { + _globalHandler = fun; + }, + getGlobalHandler: function getGlobalHandler() { + return _globalHandler; + }, + reportError: function reportError(error) { + _globalHandler && _globalHandler(error, false); + }, + reportFatalError: function reportFatalError(error) { + // NOTE: This has an untyped call site in Metro. + _globalHandler && _globalHandler(error, true); + }, + applyWithGuard: function applyWithGuard(fun, context, args, + // Unused, but some code synced from www sets it to null. + unused_onError, + // Some callers pass a name here, which we ignore. + unused_name) { + try { + _inGuard++; + /* $FlowFixMe[incompatible-call] : TODO T48204745 (1) apply(context, + * null) is fine. (2) array -> rest array should work */ + /* $FlowFixMe[incompatible-type] : TODO T48204745 (1) apply(context, + * null) is fine. (2) array -> rest array should work */ + return fun.apply(context, args); + } catch (e) { + ErrorUtils.reportError(e); + } finally { + _inGuard--; + } + return null; + }, + applyWithGuardIfNeeded: function applyWithGuardIfNeeded(fun, context, args) { + if (ErrorUtils.inGuard()) { + /* $FlowFixMe[incompatible-call] : TODO T48204745 (1) apply(context, + * null) is fine. (2) array -> rest array should work */ + /* $FlowFixMe[incompatible-type] : TODO T48204745 (1) apply(context, + * null) is fine. (2) array -> rest array should work */ + return fun.apply(context, args); + } else { + ErrorUtils.applyWithGuard(fun, context, args); + } + return null; + }, + inGuard: function inGuard() { + return !!_inGuard; + }, + guard: function guard(fun, name, context) { + var _ref; + // TODO: (moti) T48204753 Make sure this warning is never hit and remove it - types + // should be sufficient. + if (typeof fun !== 'function') { + console.warn('A function must be passed to ErrorUtils.guard, got ', fun); + return null; + } + var guardName = (_ref = name != null ? name : fun.name) != null ? _ref : ''; + /* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by + * Flow's LTI update could not be added via codemod */ + function guarded() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return ErrorUtils.applyWithGuard(fun, context != null ? context : this, args, null, guardName); + } + return guarded; + } + }; + global.ErrorUtils = ErrorUtils; +})(typeof globalThis !== 'undefined' ? globalThis : typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + _$$_REQUIRE(_dependencyMap[0], "./shim"); + _$$_REQUIRE(_dependencyMap[1], "./src/app"); +},0,[1,5],"index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + global.Buffer = _$$_REQUIRE(_dependencyMap[0], "buffer").Buffer; +},1,[2],"shim.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + /* eslint-disable no-proto */ + + 'use strict'; + + var customInspectSymbol = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' // eslint-disable-line dot-notation + ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation + : null; + exports.Buffer = Buffer; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 0x7fffffff; + exports.kMaxLength = K_MAX_LENGTH; + + /** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ + Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); + if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') { + console.error('This browser lacks typed array (Uint8Array) support which is required by ' + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'); + } + function typedArraySupport() { + // Can typed array instances can be augmented? + try { + var arr = new Uint8Array(1); + var proto = { + foo: function foo() { + return 42; + } + }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.buffer; + } + }); + Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.byteOffset; + } + }); + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"'); + } + // Return an augmented `Uint8Array` instance + var buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + + /** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + + function Buffer(arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + return allocUnsafe(arg); + } + return from(arg, encodingOrOffset, length); + } + Buffer.poolSize = 8192; // not used by this implementation + + function from(value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset); + } + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + if (value == null) { + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + typeof value); + } + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + if (typeof SharedArrayBuffer !== 'undefined' && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + var valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length); + } + var b = fromObject(value); + if (b) return b; + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length); + } + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + typeof value); + } + + /** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ + Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length); + }; + + // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: + // https://github.com/feross/buffer/pull/148 + Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer, Uint8Array); + function assertSize(size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + function alloc(size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(size); + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpreted as a start offset. + return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + return createBuffer(size); + } + + /** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ + Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding); + }; + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + + /** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ + Buffer.allocUnsafe = function (size) { + return allocUnsafe(size); + }; + /** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ + Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size); + }; + function fromString(string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8'; + } + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + var length = byteLength(string, encoding) | 0; + var buf = createBuffer(length); + var actual = buf.write(string, encoding); + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual); + } + return buf; + } + function fromArrayLike(array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0; + var buf = createBuffer(length); + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255; + } + return buf; + } + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + var copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + return fromArrayLike(arrayView); + } + function fromArrayBuffer(array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + var buf; + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array); + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } + + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + function fromObject(obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0; + var buf = createBuffer(len); + if (buf.length === 0) { + return buf; + } + obj.copy(buf, 0, 0, len); + return buf; + } + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0); + } + return fromArrayLike(obj); + } + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + function checked(length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes'); + } + return length | 0; + } + function SlowBuffer(length) { + if (+length != length) { + // eslint-disable-line eqeqeq + length = 0; + } + return Buffer.alloc(+length); + } + Buffer.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer.prototype; // so Buffer.isBuffer(Buffer.prototype) will be false + }; + Buffer.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + if (a === b) return 0; + var x = a.length; + var y = b.length; + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + Buffer.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true; + default: + return false; + } + }; + Buffer.concat = function concat(list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + if (list.length === 0) { + return Buffer.alloc(0); + } + var i; + if (length === undefined) { + length = 0; + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + var buffer = Buffer.allocUnsafe(length); + var pos = 0; + for (i = 0; i < list.length; ++i) { + var buf = list[i]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + Buffer.from(buf).copy(buffer, pos); + } else { + Uint8Array.prototype.set.call(buffer, buf, pos); + } + } else if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer, pos); + } + pos += buf.length; + } + return buffer; + }; + function byteLength(string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length; + } + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength; + } + if (typeof string !== 'string') { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + typeof string); + } + var len = string.length; + var mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) return 0; + + // Use a for loop to avoid recursion + var loweredCase = false; + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len; + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2; + case 'hex': + return len >>> 1; + case 'base64': + return base64ToBytes(string).length; + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length; // assume utf8 + } + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer.byteLength = byteLength; + function slowToString(encoding, start, end) { + var loweredCase = false; + + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0; + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return ''; + } + if (end === undefined || end > this.length) { + end = this.length; + } + if (end <= 0) { + return ''; + } + + // Force coercion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0; + start >>>= 0; + if (end <= start) { + return ''; + } + if (!encoding) encoding = 'utf8'; + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end); + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end); + case 'ascii': + return asciiSlice(this, start, end); + case 'latin1': + case 'binary': + return latin1Slice(this, start, end); + case 'base64': + return base64Slice(this, start, end); + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end); + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = (encoding + '').toLowerCase(); + loweredCase = true; + } + } + } + + // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) + // to detect a Buffer instance. It's not possible to use `instanceof Buffer` + // reliably in a browserify context because there could be multiple different + // copies of the 'buffer' package in use. This method works even for Buffer + // instances that were created from another copy of the `buffer` package. + // See: https://github.com/feross/buffer/issues/154 + Buffer.prototype._isBuffer = true; + function swap(b, n, m) { + var i = b[n]; + b[n] = b[m]; + b[m] = i; + } + Buffer.prototype.swap16 = function swap16() { + var len = this.length; + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits'); + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + return this; + }; + Buffer.prototype.swap32 = function swap32() { + var len = this.length; + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits'); + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this; + }; + Buffer.prototype.swap64 = function swap64() { + var len = this.length; + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits'); + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + return this; + }; + Buffer.prototype.toString = function toString() { + var length = this.length; + if (length === 0) return ''; + if (arguments.length === 0) return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + Buffer.prototype.toLocaleString = Buffer.prototype.toString; + Buffer.prototype.equals = function equals(b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer'); + if (this === b) return true; + return Buffer.compare(this, b) === 0; + }; + Buffer.prototype.inspect = function inspect() { + var str = ''; + var max = exports.INSPECT_MAX_BYTES; + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); + if (this.length > max) str += ' ... '; + return ''; + }; + if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; + } + Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength); + } + if (!Buffer.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ' + typeof target); + } + if (start === undefined) { + start = 0; + } + if (end === undefined) { + end = target ? target.length : 0; + } + if (thisStart === undefined) { + thisStart = 0; + } + if (thisEnd === undefined) { + thisEnd = this.length; + } + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index'); + } + if (thisStart >= thisEnd && start >= end) { + return 0; + } + if (thisStart >= thisEnd) { + return -1; + } + if (start >= end) { + return 1; + } + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) return 0; + var x = thisEnd - thisStart; + var y = end - start; + var len = Math.min(x, y); + var thisCopy = this.slice(thisStart, thisEnd); + var targetCopy = target.slice(start, end); + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + + // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, + // OR the last index of `val` in `buffer` at offset <= `byteOffset`. + // + // Arguments: + // - buffer - a Buffer to search + // - val - a string, Buffer, or number + // - byteOffset - an index into `buffer`; will be clamped to an int32 + // - encoding - an optional encoding, relevant is val is a string + // - dir - true for indexOf, false for lastIndexOf + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1; + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff; + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000; + } + byteOffset = +byteOffset; // Coerce to Number. + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : buffer.length - 1; + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset; + if (byteOffset >= buffer.length) { + if (dir) return -1;else byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0;else return -1; + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding); + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1; + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === 'number') { + val = val & 0xFF; // Search for a byte value [0-255] + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + throw new TypeError('val must be string, number or Buffer'); + } + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + var indexSize = 1; + var arrLength = arr.length; + var valLength = val.length; + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase(); + if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1; + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + function read(buf, i) { + if (indexSize === 1) { + return buf[i]; + } else { + return buf.readUInt16BE(i * indexSize); + } + } + var i; + if (dir) { + var foundIndex = -1; + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i; + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize; + } else { + if (foundIndex !== -1) i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; + for (i = byteOffset; i >= 0; i--) { + var found = true; + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break; + } + } + if (found) return i; + } + } + return -1; + } + Buffer.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + function hexWrite(buf, string, offset, length) { + offset = Number(offset) || 0; + var remaining = buf.length - offset; + if (!length) { + length = remaining; + } else { + length = Number(length); + if (length > remaining) { + length = remaining; + } + } + var strLen = string.length; + if (length > strLen / 2) { + length = strLen / 2; + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) return i; + buf[offset + i] = parsed; + } + return i; + } + function utf8Write(buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); + } + function asciiWrite(buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length); + } + function base64Write(buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length); + } + function ucs2Write(buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); + } + Buffer.prototype.write = function write(string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8'; + length = this.length; + offset = 0; + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset; + length = this.length; + offset = 0; + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length)) { + length = length >>> 0; + if (encoding === undefined) encoding = 'utf8'; + } else { + encoding = length; + length = undefined; + } + } else { + throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported'); + } + var remaining = this.length - offset; + if (length === undefined || length > remaining) length = remaining; + if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds'); + } + if (!encoding) encoding = 'utf8'; + var loweredCase = false; + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length); + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length); + case 'ascii': + case 'latin1': + case 'binary': + return asciiWrite(this, string, offset, length); + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length); + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length); + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + Buffer.prototype.toJSON = function toJSON() { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return _$$_REQUIRE(_dependencyMap[0], "base64-js").fromByteArray(buf); + } else { + return _$$_REQUIRE(_dependencyMap[0], "base64-js").fromByteArray(buf.slice(start, end)); + } + } + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + var res = []; + var i = start; + while (i < end) { + var firstByte = buf[i]; + var codePoint = null; + var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1; + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint; + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte; + } + break; + case 2: + secondByte = buf[i + 1]; + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F; + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint; + } + } + break; + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F; + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint; + } + } + break; + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F; + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint; + } + } + } + } + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD; + bytesPerSequence = 1; + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000; + res.push(codePoint >>> 10 & 0x3FF | 0xD800); + codePoint = 0xDC00 | codePoint & 0x3FF; + } + res.push(codePoint); + i += bytesPerSequence; + } + return decodeCodePointsArray(res); + } + + // Based on http://stackoverflow.com/a/22747272/680742, the browser with + // the lowest limit is Chrome, with 0x10000 args. + // We go 1 magnitude less, for safety + var MAX_ARGUMENTS_LENGTH = 0x1000; + function decodeCodePointsArray(codePoints) { + var len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + var res = ''; + var i = 0; + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + return res; + } + function asciiSlice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F); + } + return ret; + } + function latin1Slice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + return ret; + } + function hexSlice(buf, start, end) { + var len = buf.length; + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + var out = ''; + for (var i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + return out; + } + function utf16leSlice(buf, start, end) { + var bytes = buf.slice(start, end); + var res = ''; + // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) + for (var i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + return res; + } + Buffer.prototype.slice = function slice(start, end) { + var len = this.length; + start = ~~start; + end = end === undefined ? len : ~~end; + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + if (end < start) end = start; + var newBuf = this.subarray(start, end); + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(newBuf, Buffer.prototype); + return newBuf; + }; + + /* + * Need to make sure that buffer isn't trying to write out of bounds. + */ + function checkOffset(offset, ext, length) { + if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint'); + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length'); + } + Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + return val; + }; + Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength, this.length); + } + var val = this[offset + --byteLength]; + var mul = 1; + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul; + } + return val; + }; + Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset]; + }; + Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000; + }; + Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var i = byteLength; + var mul = 1; + var val = this[offset + --i]; + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul; + } + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 0x80)) return this[offset]; + return (0xff - this[offset] + 1) * -1; + }; + Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset] | this[offset + 1] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset + 1] | this[offset] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return _$$_REQUIRE(_dependencyMap[1], "ieee754").read(this, offset, true, 23, 4); + }; + Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return _$$_REQUIRE(_dependencyMap[1], "ieee754").read(this, offset, false, 23, 4); + }; + Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return _$$_REQUIRE(_dependencyMap[1], "ieee754").read(this, offset, true, 52, 8); + }; + Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return _$$_REQUIRE(_dependencyMap[1], "ieee754").read(this, offset, false, 52, 8); + }; + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + } + Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + var mul = 1; + var i = 0; + this[offset] = value & 0xFF; + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + return offset + byteLength; + }; + Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + var i = byteLength - 1; + var mul = 1; + this[offset + i] = value & 0xFF; + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + return offset + byteLength; + }; + Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); + this[offset] = value & 0xff; + return offset + 1; + }; + Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 0xff; + return offset + 4; + }; + Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + var i = 0; + var mul = 1; + var sub = 0; + this[offset] = value & 0xFF; + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + return offset + byteLength; + }; + Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + var i = byteLength - 1; + var mul = 1; + var sub = 0; + this[offset + i] = value & 0xFF; + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + return offset + byteLength; + }; + Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80); + if (value < 0) value = 0xff + value + 1; + this[offset] = value & 0xff; + return offset + 1; + }; + Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + if (value < 0) value = 0xffffffff + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + if (offset < 0) throw new RangeError('Index out of range'); + } + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38); + } + _$$_REQUIRE(_dependencyMap[1], "ieee754").write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308); + } + _$$_REQUIRE(_dependencyMap[1], "ieee754").write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; + + // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) + Buffer.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer'); + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; + + // Copy 0 bytes; we're done + if (end === start) return 0; + if (target.length === 0 || this.length === 0) return 0; + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds'); + } + if (start < 0 || start >= this.length) throw new RangeError('Index out of range'); + if (end < 0) throw new RangeError('sourceEnd out of bounds'); + + // Are we oob? + if (end > this.length) end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + var len = end - start; + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + return len; + }; + + // Usage: + // buffer.fill(number[, offset[, end]]) + // buffer.fill(buffer[, offset[, end]]) + // buffer.fill(string[, offset[, end]][, encoding]) + Buffer.prototype.fill = function fill(val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === 'string') { + encoding = end; + end = this.length; + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string'); + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + if (val.length === 1) { + var code = val.charCodeAt(0); + if (encoding === 'utf8' && code < 128 || encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code; + } + } + } else if (typeof val === 'number') { + val = val & 255; + } else if (typeof val === 'boolean') { + val = Number(val); + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index'); + } + if (end <= start) { + return this; + } + start = start >>> 0; + end = end === undefined ? this.length : end >>> 0; + if (!val) val = 0; + var i; + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + var bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding); + var len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + return this; + }; + + // HELPER FUNCTIONS + // ================ + + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + function base64clean(str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0]; + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = str.trim().replace(INVALID_BASE64_RE, ''); + // Node converts strings with length < 2 to '' + if (str.length < 2) return ''; + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '='; + } + return str; + } + function utf8ToBytes(string, units) { + units = units || Infinity; + var codePoint; + var length = string.length; + var leadSurrogate = null; + var bytes = []; + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } + + // valid lead + leadSurrogate = codePoint; + continue; + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + leadSurrogate = codePoint; + continue; + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + } + leadSurrogate = null; + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break; + bytes.push(codePoint); + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break; + bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break; + bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break; + bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else { + throw new Error('Invalid code point'); + } + } + return bytes; + } + function asciiToBytes(str) { + var byteArray = []; + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF); + } + return byteArray; + } + function utf16leToBytes(str, units) { + var c, hi, lo; + var byteArray = []; + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + return byteArray; + } + function base64ToBytes(str) { + return _$$_REQUIRE(_dependencyMap[0], "base64-js").toByteArray(base64clean(str)); + } + function blitBuffer(src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if (i + offset >= dst.length || i >= src.length) break; + dst[i + offset] = src[i]; + } + return i; + } + + // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass + // the `instanceof` check but they should be treated as of that type. + // See: https://github.com/feross/buffer/issues/166 + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + function numberIsNaN(obj) { + // For IE11 support + return obj !== obj; // eslint-disable-line no-self-compare + } + + // Create lookup table for `toString('hex')` + // See: https://github.com/feross/buffer/issues/219 + var hexSliceLookupTable = function () { + var alphabet = '0123456789abcdef'; + var table = new Array(256); + for (var i = 0; i < 16; ++i) { + var i16 = i * 16; + for (var j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + return table; + }(); +},2,[3,4],"node_modules\\buffer\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + exports.byteLength = byteLength; + exports.toByteArray = toByteArray; + exports.fromByteArray = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; + var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } + + // Support decoding URL-safe base64 strings, as Node.js does. + // See: https://en.wikipedia.org/wiki/Base64#URL_applications + revLookup['-'.charCodeAt(0)] = 62; + revLookup['_'.charCodeAt(0)] = 63; + function getLens(b64) { + var len = b64.length; + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4'); + } + + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('='); + if (validLen === -1) validLen = len; + var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; + } + + // base64 is 4/3 + up to two characters of the original data + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; + + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i; + for (i = 0; i < len; i += 4) { + tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)]; + arr[curByte++] = tmp >> 16 & 0xFF; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4; + arr[curByte++] = tmp & 0xFF; + } + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + return arr; + } + function tripletToBase64(num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; + } + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF); + output.push(tripletToBase64(tmp)); + } + return output.join(''); + } + function fromByteArray(uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes + var parts = []; + var maxChunkLength = 16383; // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength)); + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '=='); + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '='); + } + return parts.join(''); + } +},3,[],"node_modules\\base64-js\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + buffer[offset + i - d] |= s * 128; + }; +},4,[],"node_modules\\ieee754\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _asyncToGenerator2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/asyncToGenerator")); + _$$_REQUIRE(_dependencyMap[3], "./utils/errorHandle"); + _$$_REQUIRE(_dependencyMap[4], "./config/globalData"); + console.log('starting app...'); + (0, _$$_REQUIRE(_dependencyMap[5], "./navigation/regLaunchedEvent").listenLaunchEvent)(); + void Promise.all([(0, _$$_REQUIRE(_dependencyMap[6], "./utils/data").getFontSize)(), _$$_REQUIRE(_dependencyMap[7], "./utils/windowSizeTools").windowSizeTools.init()]).then(/*#__PURE__*/function () { + var _ref2 = (0, _asyncToGenerator2.default)(function* (_ref) { + var _ref3 = (0, _slicedToArray2.default)(_ref, 1), + fontSize = _ref3[0]; + global.lx.fontSize = fontSize; + (0, _$$_REQUIRE(_dependencyMap[8], "./utils/bootLog").bootLog)('Font size setting loaded.'); + var isInited = false; + var handlePushedHomeScreen; + var tryGetBootLog = function tryGetBootLog() { + try { + return (0, _$$_REQUIRE(_dependencyMap[8], "./utils/bootLog").getBootLog)(); + } catch (err) { + return 'Get boot log failed.'; + } + }; + var handleInit = /*#__PURE__*/function () { + var _ref4 = (0, _asyncToGenerator2.default)(function* () { + if (isInited) return; + void (0, _$$_REQUIRE(_dependencyMap[9], "./utils/log").init)(); + var _yield$import = yield _$$_REQUIRE(_dependencyMap[11], "E:\\source\\ikun-music-mobile\\node_modules\\metro-runtime\\src\\modules\\asyncRequire.js")(_dependencyMap[10], _dependencyMap.paths, "./core/init"), + init = _yield$import.default; + try { + handlePushedHomeScreen = yield init(); + } catch (err) { + var _err$stack; + void (0, _$$_REQUIRE(_dependencyMap[12], "./utils/tools").tipDialog)({ + title: '初始化失败 (Init Failed)', + message: `Boot Log:\n${tryGetBootLog()}\n\n${(_err$stack = err.stack) != null ? _err$stack : err.message}`, + btnText: 'Exit', + bgClose: false + }).then(function () { + (0, _$$_REQUIRE(_dependencyMap[13], "./utils/nativeModules/utils").exitApp)(); + }); + return; + } + isInited || (isInited = true); + }); + return function handleInit() { + return _ref4.apply(this, arguments); + }; + }(); + var _yield$import2 = yield _$$_REQUIRE(_dependencyMap[11], "E:\\source\\ikun-music-mobile\\node_modules\\metro-runtime\\src\\modules\\asyncRequire.js")(_dependencyMap[14], _dependencyMap.paths, "./navigation"), + initNavigation = _yield$import2.init, + navigations = _yield$import2.navigations; + initNavigation(/*#__PURE__*/(0, _asyncToGenerator2.default)(function* () { + yield handleInit(); + if (!isInited) return; + // import('@/utils/nativeModules/cryptoTest') + + yield navigations.pushHomeScreen().then(function () { + void handlePushedHomeScreen(); + }).catch(function (err) { + void (0, _$$_REQUIRE(_dependencyMap[12], "./utils/tools").tipDialog)({ + title: 'Error', + message: err.message, + btnText: 'Exit', + bgClose: false + }).then(function () { + (0, _$$_REQUIRE(_dependencyMap[13], "./utils/nativeModules/utils").exitApp)(); + }); + }); + })); + }); + return function (_x) { + return _ref2.apply(this, arguments); + }; + }()).catch(function (err) { + var _err$stack2; + void (0, _$$_REQUIRE(_dependencyMap[12], "./utils/tools").tipDialog)({ + title: '初始化失败 (Init Failed)', + message: `Boot Log:\n\n${(_err$stack2 = err.stack) != null ? _err$stack2 : err.message}`, + btnText: 'Exit', + bgClose: false + }).then(function () { + (0, _$$_REQUIRE(_dependencyMap[13], "./utils/nativeModules/utils").exitApp)(); + }); + }); +},5,[6,7,13,14,550,1434,575,695,1438,543,1439,1457,576,693,716],"src\\app.ts"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _interopRequireDefault(e) { + return e && e.__esModule ? e : { + "default": e + }; + } + module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; +},6,[],"node_modules\\@babel\\runtime\\helpers\\interopRequireDefault.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _slicedToArray(r, e) { + return _$$_REQUIRE(_dependencyMap[0], "./arrayWithHoles.js")(r) || _$$_REQUIRE(_dependencyMap[1], "./iterableToArrayLimit.js")(r, e) || _$$_REQUIRE(_dependencyMap[2], "./unsupportedIterableToArray.js")(r, e) || _$$_REQUIRE(_dependencyMap[3], "./nonIterableRest.js")(); + } + module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},7,[8,9,10,12],"node_modules\\@babel\\runtime\\helpers\\slicedToArray.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _arrayWithHoles(r) { + if (Array.isArray(r)) return r; + } + module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; +},8,[],"node_modules\\@babel\\runtime\\helpers\\arrayWithHoles.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _iterableToArrayLimit(r, l) { + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (null != t) { + var e, + n, + i, + u, + a = [], + f = !0, + o = !1; + try { + if (i = (t = t.call(r)).next, 0 === l) { + if (Object(t) !== t) return; + f = !1; + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); + } catch (r) { + o = !0, n = r; + } finally { + try { + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; + } finally { + if (o) throw n; + } + } + return a; + } + } + module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; +},9,[],"node_modules\\@babel\\runtime\\helpers\\iterableToArrayLimit.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _unsupportedIterableToArray(r, a) { + if (r) { + if ("string" == typeof r) return _$$_REQUIRE(_dependencyMap[0], "./arrayLikeToArray.js")(r, a); + var t = {}.toString.call(r).slice(8, -1); + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _$$_REQUIRE(_dependencyMap[0], "./arrayLikeToArray.js")(r, a) : void 0; + } + } + module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},10,[11],"node_modules\\@babel\\runtime\\helpers\\unsupportedIterableToArray.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _arrayLikeToArray(r, a) { + (null == a || a > r.length) && (a = r.length); + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; + return n; + } + module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},11,[],"node_modules\\@babel\\runtime\\helpers\\arrayLikeToArray.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; +},12,[],"node_modules\\@babel\\runtime\\helpers\\nonIterableRest.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function asyncGeneratorStep(n, t, e, r, o, a, c) { + try { + var i = n[a](c), + u = i.value; + } catch (n) { + return void e(n); + } + i.done ? t(u) : Promise.resolve(u).then(r, o); + } + function _asyncToGenerator(n) { + return function () { + var t = this, + e = arguments; + return new Promise(function (r, o) { + var a = n.apply(t, e); + function _next(n) { + asyncGeneratorStep(a, r, o, _next, _throw, "next", n); + } + function _throw(n) { + asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); + } + _next(void 0); + }); + }; + } + module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; +},13,[],"node_modules\\@babel\\runtime\\helpers\\asyncToGenerator.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _reactNative = _$$_REQUIRE(_dependencyMap[0], "react-native"); + // import { exitApp } from '@/utils/common' + + var errorHandler = function errorHandler(e, isFatal) { + if (isFatal) { + _reactNative.Alert.alert('💥Unexpected error occurred💥', ` +应用出bug了😭,以下是错误异常信息,请截图(并附上刚才你进行了什么操作)通过企鹅群或者GitHub反馈,现在应用可能会出现异常,若出现异常请尝试强制结束APP后重新启动! + +Error: +${isFatal ? 'Fatal:' : ''} ${e.name} ${e.message} +`, [{ + text: '关闭 (Close)', + onPress: function onPress() { + // exitApp() + } + }]); + } + _$$_REQUIRE(_dependencyMap[1], "./log").log.error(e.stack); + }; + if (process.env.NODE_ENV !== 'development') { + (0, _$$_REQUIRE(_dependencyMap[2], "react-native-exception-handler").setJSExceptionHandler)(errorHandler); + (0, _$$_REQUIRE(_dependencyMap[2], "react-native-exception-handler").setNativeExceptionHandler)(function (errorString) { + _$$_REQUIRE(_dependencyMap[1], "./log").log.error(errorString); + console.log('+++++', errorString, '+++++'); + }, false); + } +},14,[15,543,549],"src\\utils\\errorHandle.ts"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + // Components + // APIs + // Plugins + module.exports = { + // Components + get AccessibilityInfo() { + return _$$_REQUIRE(_dependencyMap[0], "./Libraries/Components/AccessibilityInfo/AccessibilityInfo").default; + }, + get ActivityIndicator() { + return _$$_REQUIRE(_dependencyMap[1], "./Libraries/Components/ActivityIndicator/ActivityIndicator").default; + }, + get Button() { + return _$$_REQUIRE(_dependencyMap[2], "./Libraries/Components/Button"); + }, + // $FlowFixMe[value-as-type] + get DrawerLayoutAndroid() { + return _$$_REQUIRE(_dependencyMap[3], "./Libraries/Components/DrawerAndroid/DrawerLayoutAndroid"); + }, + get FlatList() { + return _$$_REQUIRE(_dependencyMap[4], "./Libraries/Lists/FlatList"); + }, + get Image() { + return _$$_REQUIRE(_dependencyMap[5], "./Libraries/Image/Image"); + }, + get ImageBackground() { + return _$$_REQUIRE(_dependencyMap[6], "./Libraries/Image/ImageBackground"); + }, + get InputAccessoryView() { + return _$$_REQUIRE(_dependencyMap[7], "./Libraries/Components/TextInput/InputAccessoryView"); + }, + get KeyboardAvoidingView() { + return _$$_REQUIRE(_dependencyMap[8], "./Libraries/Components/Keyboard/KeyboardAvoidingView").default; + }, + get Modal() { + return _$$_REQUIRE(_dependencyMap[9], "./Libraries/Modal/Modal"); + }, + get Pressable() { + return _$$_REQUIRE(_dependencyMap[10], "./Libraries/Components/Pressable/Pressable").default; + }, + // $FlowFixMe[value-as-type] + get ProgressBarAndroid() { + _$$_REQUIRE(_dependencyMap[11], "./Libraries/Utilities/warnOnce")('progress-bar-android-moved', 'ProgressBarAndroid has been extracted from react-native core and will be removed in a future release. ' + "It can now be installed and imported from '@react-native-community/progress-bar-android' instead of 'react-native'. " + 'See https://github.com/react-native-progress-view/progress-bar-android'); + return _$$_REQUIRE(_dependencyMap[12], "./Libraries/Components/ProgressBarAndroid/ProgressBarAndroid"); + }, + get RefreshControl() { + return _$$_REQUIRE(_dependencyMap[13], "./Libraries/Components/RefreshControl/RefreshControl"); + }, + get SafeAreaView() { + return _$$_REQUIRE(_dependencyMap[14], "./Libraries/Components/SafeAreaView/SafeAreaView").default; + }, + get ScrollView() { + return _$$_REQUIRE(_dependencyMap[15], "./Libraries/Components/ScrollView/ScrollView"); + }, + get SectionList() { + return _$$_REQUIRE(_dependencyMap[16], "./Libraries/Lists/SectionList").default; + }, + get StatusBar() { + return _$$_REQUIRE(_dependencyMap[17], "./Libraries/Components/StatusBar/StatusBar"); + }, + get Switch() { + return _$$_REQUIRE(_dependencyMap[18], "./Libraries/Components/Switch/Switch").default; + }, + get Text() { + return _$$_REQUIRE(_dependencyMap[19], "./Libraries/Text/Text"); + }, + get TextInput() { + return _$$_REQUIRE(_dependencyMap[20], "./Libraries/Components/TextInput/TextInput"); + }, + get Touchable() { + return _$$_REQUIRE(_dependencyMap[21], "./Libraries/Components/Touchable/Touchable"); + }, + get TouchableHighlight() { + return _$$_REQUIRE(_dependencyMap[22], "./Libraries/Components/Touchable/TouchableHighlight"); + }, + get TouchableNativeFeedback() { + return _$$_REQUIRE(_dependencyMap[23], "./Libraries/Components/Touchable/TouchableNativeFeedback"); + }, + get TouchableOpacity() { + return _$$_REQUIRE(_dependencyMap[24], "./Libraries/Components/Touchable/TouchableOpacity"); + }, + get TouchableWithoutFeedback() { + return _$$_REQUIRE(_dependencyMap[25], "./Libraries/Components/Touchable/TouchableWithoutFeedback"); + }, + get View() { + return _$$_REQUIRE(_dependencyMap[26], "./Libraries/Components/View/View"); + }, + get VirtualizedList() { + return _$$_REQUIRE(_dependencyMap[27], "./Libraries/Lists/VirtualizedList"); + }, + get VirtualizedSectionList() { + return _$$_REQUIRE(_dependencyMap[28], "./Libraries/Lists/VirtualizedSectionList"); + }, + // APIs + get ActionSheetIOS() { + return _$$_REQUIRE(_dependencyMap[29], "./Libraries/ActionSheetIOS/ActionSheetIOS"); + }, + get Alert() { + return _$$_REQUIRE(_dependencyMap[30], "./Libraries/Alert/Alert"); + }, + // Include any types exported in the Animated module together with its default export, so + // you can references types such as Animated.Numeric + get Animated() { + // $FlowExpectedError[prop-missing]: we only return the default export, all other exports are types + return _$$_REQUIRE(_dependencyMap[31], "./Libraries/Animated/Animated").default; + }, + get Appearance() { + return _$$_REQUIRE(_dependencyMap[32], "./Libraries/Utilities/Appearance"); + }, + get AppRegistry() { + return _$$_REQUIRE(_dependencyMap[33], "./Libraries/ReactNative/AppRegistry"); + }, + get AppState() { + return _$$_REQUIRE(_dependencyMap[34], "./Libraries/AppState/AppState"); + }, + get BackHandler() { + return _$$_REQUIRE(_dependencyMap[35], "./Libraries/Utilities/BackHandler"); + }, + get Clipboard() { + _$$_REQUIRE(_dependencyMap[11], "./Libraries/Utilities/warnOnce")('clipboard-moved', 'Clipboard has been extracted from react-native core and will be removed in a future release. ' + "It can now be installed and imported from '@react-native-clipboard/clipboard' instead of 'react-native'. " + 'See https://github.com/react-native-clipboard/clipboard'); + return _$$_REQUIRE(_dependencyMap[36], "./Libraries/Components/Clipboard/Clipboard"); + }, + get DeviceInfo() { + return _$$_REQUIRE(_dependencyMap[37], "./Libraries/Utilities/DeviceInfo"); + }, + get DevSettings() { + return _$$_REQUIRE(_dependencyMap[38], "./Libraries/Utilities/DevSettings"); + }, + get Dimensions() { + return _$$_REQUIRE(_dependencyMap[39], "./Libraries/Utilities/Dimensions").default; + }, + get Easing() { + return _$$_REQUIRE(_dependencyMap[40], "./Libraries/Animated/Easing").default; + }, + get findNodeHandle() { + return _$$_REQUIRE(_dependencyMap[41], "./Libraries/ReactNative/RendererProxy").findNodeHandle; + }, + get I18nManager() { + return _$$_REQUIRE(_dependencyMap[42], "./Libraries/ReactNative/I18nManager"); + }, + get InteractionManager() { + return _$$_REQUIRE(_dependencyMap[43], "./Libraries/Interaction/InteractionManager"); + }, + get Keyboard() { + return _$$_REQUIRE(_dependencyMap[44], "./Libraries/Components/Keyboard/Keyboard"); + }, + get LayoutAnimation() { + return _$$_REQUIRE(_dependencyMap[45], "./Libraries/LayoutAnimation/LayoutAnimation"); + }, + get Linking() { + return _$$_REQUIRE(_dependencyMap[46], "./Libraries/Linking/Linking"); + }, + get LogBox() { + return _$$_REQUIRE(_dependencyMap[47], "./Libraries/LogBox/LogBox").default; + }, + get NativeDialogManagerAndroid() { + return _$$_REQUIRE(_dependencyMap[48], "./Libraries/NativeModules/specs/NativeDialogManagerAndroid").default; + }, + get NativeEventEmitter() { + return _$$_REQUIRE(_dependencyMap[49], "./Libraries/EventEmitter/NativeEventEmitter").default; + }, + get Networking() { + return _$$_REQUIRE(_dependencyMap[50], "./Libraries/Network/RCTNetworking").default; + }, + get PanResponder() { + return _$$_REQUIRE(_dependencyMap[51], "./Libraries/Interaction/PanResponder").default; + }, + get PermissionsAndroid() { + return _$$_REQUIRE(_dependencyMap[52], "./Libraries/PermissionsAndroid/PermissionsAndroid"); + }, + get PixelRatio() { + return _$$_REQUIRE(_dependencyMap[53], "./Libraries/Utilities/PixelRatio").default; + }, + get PushNotificationIOS() { + _$$_REQUIRE(_dependencyMap[11], "./Libraries/Utilities/warnOnce")('pushNotificationIOS-moved', 'PushNotificationIOS has been extracted from react-native core and will be removed in a future release. ' + "It can now be installed and imported from '@react-native-community/push-notification-ios' instead of 'react-native'. " + 'See https://github.com/react-native-push-notification-ios/push-notification-ios'); + return _$$_REQUIRE(_dependencyMap[54], "./Libraries/PushNotificationIOS/PushNotificationIOS"); + }, + get Settings() { + return _$$_REQUIRE(_dependencyMap[55], "./Libraries/Settings/Settings"); + }, + get Share() { + return _$$_REQUIRE(_dependencyMap[56], "./Libraries/Share/Share"); + }, + get StyleSheet() { + return _$$_REQUIRE(_dependencyMap[57], "./Libraries/StyleSheet/StyleSheet"); + }, + get Systrace() { + return _$$_REQUIRE(_dependencyMap[58], "./Libraries/Performance/Systrace"); + }, + // $FlowFixMe[value-as-type] + get ToastAndroid() { + return _$$_REQUIRE(_dependencyMap[59], "./Libraries/Components/ToastAndroid/ToastAndroid"); + }, + get TurboModuleRegistry() { + return _$$_REQUIRE(_dependencyMap[60], "./Libraries/TurboModule/TurboModuleRegistry"); + }, + get UIManager() { + return _$$_REQUIRE(_dependencyMap[61], "./Libraries/ReactNative/UIManager"); + }, + get unstable_batchedUpdates() { + return _$$_REQUIRE(_dependencyMap[41], "./Libraries/ReactNative/RendererProxy").unstable_batchedUpdates; + }, + get useAnimatedValue() { + return _$$_REQUIRE(_dependencyMap[62], "./Libraries/Animated/useAnimatedValue").default; + }, + get useColorScheme() { + return _$$_REQUIRE(_dependencyMap[63], "./Libraries/Utilities/useColorScheme").default; + }, + get useWindowDimensions() { + return _$$_REQUIRE(_dependencyMap[64], "./Libraries/Utilities/useWindowDimensions").default; + }, + get UTFSequence() { + return _$$_REQUIRE(_dependencyMap[65], "./Libraries/UTFSequence").default; + }, + get Vibration() { + return _$$_REQUIRE(_dependencyMap[66], "./Libraries/Vibration/Vibration"); + }, + get YellowBox() { + return _$$_REQUIRE(_dependencyMap[67], "./Libraries/YellowBox/YellowBoxDeprecated"); + }, + // Plugins + get DeviceEventEmitter() { + return _$$_REQUIRE(_dependencyMap[68], "./Libraries/EventEmitter/RCTDeviceEventEmitter").default; + }, + get DynamicColorIOS() { + return _$$_REQUIRE(_dependencyMap[69], "./Libraries/StyleSheet/PlatformColorValueTypesIOS").DynamicColorIOS; + }, + get NativeAppEventEmitter() { + return _$$_REQUIRE(_dependencyMap[70], "./Libraries/EventEmitter/RCTNativeAppEventEmitter"); + }, + get NativeModules() { + return _$$_REQUIRE(_dependencyMap[71], "./Libraries/BatchedBridge/NativeModules"); + }, + get Platform() { + return _$$_REQUIRE(_dependencyMap[72], "./Libraries/Utilities/Platform"); + }, + get PlatformColor() { + return _$$_REQUIRE(_dependencyMap[73], "./Libraries/StyleSheet/PlatformColorValueTypes").PlatformColor; + }, + get processColor() { + return _$$_REQUIRE(_dependencyMap[74], "./Libraries/StyleSheet/processColor").default; + }, + get requireNativeComponent() { + return _$$_REQUIRE(_dependencyMap[75], "./Libraries/ReactNative/requireNativeComponent").default; + }, + get RootTagContext() { + return _$$_REQUIRE(_dependencyMap[76], "./Libraries/ReactNative/RootTag").RootTagContext; + }, + get unstable_enableLogBox() { + return function () { + return console.warn('LogBox is enabled by default so there is no need to call unstable_enableLogBox() anymore. This is a no op and will be removed in the next version.'); + }; + }, + // Deprecated Prop Types + get ColorPropType() { + console.error('ColorPropType will be removed from React Native, along with all ' + 'other PropTypes. We recommend that you migrate away from PropTypes ' + 'and switch to a type system like TypeScript. If you need to ' + 'continue using ColorPropType, migrate to the ' + "'deprecated-react-native-prop-types' package."); + return _$$_REQUIRE(_dependencyMap[77], "deprecated-react-native-prop-types").ColorPropType; + }, + get EdgeInsetsPropType() { + console.error('EdgeInsetsPropType will be removed from React Native, along with all ' + 'other PropTypes. We recommend that you migrate away from PropTypes ' + 'and switch to a type system like TypeScript. If you need to ' + 'continue using EdgeInsetsPropType, migrate to the ' + "'deprecated-react-native-prop-types' package."); + return _$$_REQUIRE(_dependencyMap[77], "deprecated-react-native-prop-types").EdgeInsetsPropType; + }, + get PointPropType() { + console.error('PointPropType will be removed from React Native, along with all ' + 'other PropTypes. We recommend that you migrate away from PropTypes ' + 'and switch to a type system like TypeScript. If you need to ' + 'continue using PointPropType, migrate to the ' + "'deprecated-react-native-prop-types' package."); + return _$$_REQUIRE(_dependencyMap[77], "deprecated-react-native-prop-types").PointPropType; + }, + get ViewPropTypes() { + console.error('ViewPropTypes will be removed from React Native, along with all ' + 'other PropTypes. We recommend that you migrate away from PropTypes ' + 'and switch to a type system like TypeScript. If you need to ' + 'continue using ViewPropTypes, migrate to the ' + "'deprecated-react-native-prop-types' package."); + return _$$_REQUIRE(_dependencyMap[77], "deprecated-react-native-prop-types").ViewPropTypes; + } + }; + if (__DEV__) { + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access ART. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access ART. */ + Object.defineProperty(module.exports, 'ART', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'ART has been removed from React Native. ' + "It can now be installed and imported from '@react-native-community/art' instead of 'react-native'. " + 'See https://github.com/react-native-art/art'); + } + }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access ListView. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access ListView. */ + Object.defineProperty(module.exports, 'ListView', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'ListView has been removed from React Native. ' + 'See https://fb.me/nolistview for more information or use ' + '`deprecated-react-native-listview`.'); + } + }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access SwipeableListView. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access SwipeableListView. */ + Object.defineProperty(module.exports, 'SwipeableListView', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'SwipeableListView has been removed from React Native. ' + 'See https://fb.me/nolistview for more information or use ' + '`deprecated-react-native-swipeable-listview`.'); + } + }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access WebView. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access WebView. */ + Object.defineProperty(module.exports, 'WebView', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'WebView has been removed from React Native. ' + "It can now be installed and imported from 'react-native-webview' instead of 'react-native'. " + 'See https://github.com/react-native-webview/react-native-webview'); + } + }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access NetInfo. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access NetInfo. */ + Object.defineProperty(module.exports, 'NetInfo', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'NetInfo has been removed from React Native. ' + "It can now be installed and imported from '@react-native-community/netinfo' instead of 'react-native'. " + 'See https://github.com/react-native-netinfo/react-native-netinfo'); + } + }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access CameraRoll. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access CameraRoll. */ + Object.defineProperty(module.exports, 'CameraRoll', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'CameraRoll has been removed from React Native. ' + "It can now be installed and imported from '@react-native-community/cameraroll' instead of 'react-native'. " + 'See https://github.com/react-native-cameraroll/react-native-cameraroll'); + } + }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access ImageStore. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access ImageStore. */ + Object.defineProperty(module.exports, 'ImageStore', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'ImageStore has been removed from React Native. ' + 'To get a base64-encoded string from a local image use either of the following third-party libraries:' + "* expo-file-system: `readAsStringAsync(filepath, 'base64')`" + "* react-native-fs: `readFile(filepath, 'base64')`"); + } + }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access ImageEditor. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access ImageEditor. */ + Object.defineProperty(module.exports, 'ImageEditor', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'ImageEditor has been removed from React Native. ' + "It can now be installed and imported from '@react-native-community/image-editor' instead of 'react-native'. " + 'See https://github.com/callstack/react-native-image-editor'); + } + }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access TimePickerAndroid. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access TimePickerAndroid. */ + Object.defineProperty(module.exports, 'TimePickerAndroid', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'TimePickerAndroid has been removed from React Native. ' + "It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. " + 'See https://github.com/react-native-datetimepicker/datetimepicker'); + } + }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access ToolbarAndroid. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access ToolbarAndroid. */ + Object.defineProperty(module.exports, 'ToolbarAndroid', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'ToolbarAndroid has been removed from React Native. ' + "It can now be installed and imported from '@react-native-community/toolbar-android' instead of 'react-native'. " + 'See https://github.com/react-native-toolbar-android/toolbar-android'); + } + }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access ViewPagerAndroid. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access ViewPagerAndroid. */ + Object.defineProperty(module.exports, 'ViewPagerAndroid', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'ViewPagerAndroid has been removed from React Native. ' + "It can now be installed and imported from 'react-native-pager-view' instead of 'react-native'. " + 'See https://github.com/callstack/react-native-pager-view'); + } + }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access CheckBox. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access CheckBox. */ + Object.defineProperty(module.exports, 'CheckBox', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'CheckBox has been removed from React Native. ' + "It can now be installed and imported from '@react-native-community/checkbox' instead of 'react-native'. " + 'See https://github.com/react-native-checkbox/react-native-checkbox'); + } + }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access SegmentedControlIOS. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access SegmentedControlIOS. */ + Object.defineProperty(module.exports, 'SegmentedControlIOS', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'SegmentedControlIOS has been removed from React Native. ' + "It can now be installed and imported from '@react-native-community/segmented-checkbox' instead of 'react-native'." + 'See https://github.com/react-native-segmented-control/segmented-control'); + } + }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access StatusBarIOS. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access StatusBarIOS. */ + Object.defineProperty(module.exports, 'StatusBarIOS', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'StatusBarIOS has been removed from React Native. ' + 'Has been merged with StatusBar. ' + 'See https://reactnative.dev/docs/statusbar'); + } + }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access PickerIOS. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access PickerIOS. */ + Object.defineProperty(module.exports, 'PickerIOS', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'PickerIOS has been removed from React Native. ' + "It can now be installed and imported from '@react-native-picker/picker' instead of 'react-native'. " + 'See https://github.com/react-native-picker/picker'); + } + }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access Picker. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access Picker. */ + Object.defineProperty(module.exports, 'Picker', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'Picker has been removed from React Native. ' + "It can now be installed and imported from '@react-native-picker/picker' instead of 'react-native'. " + 'See https://github.com/react-native-picker/picker'); + } + }); + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access DatePickerAndroid. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access DatePickerAndroid. */ + Object.defineProperty(module.exports, 'DatePickerAndroid', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'DatePickerAndroid has been removed from React Native. ' + "It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. " + 'See https://github.com/react-native-datetimepicker/datetimepicker'); + } + }); + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access MaskedViewIOS. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access MaskedViewIOS. */ + Object.defineProperty(module.exports, 'MaskedViewIOS', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'MaskedViewIOS has been removed from React Native. ' + "It can now be installed and imported from '@react-native-community/react-native-masked-view' instead of 'react-native'. " + 'See https://github.com/react-native-masked-view/masked-view'); + } + }); + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access AsyncStorage. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access AsyncStorage. */ + Object.defineProperty(module.exports, 'AsyncStorage', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'AsyncStorage has been removed from react-native core. ' + "It can now be installed and imported from '@react-native-async-storage/async-storage' instead of 'react-native'. " + 'See https://github.com/react-native-async-storage/async-storage'); + } + }); + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access ImagePickerIOS. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access ImagePickerIOS. */ + Object.defineProperty(module.exports, 'ImagePickerIOS', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'ImagePickerIOS has been removed from React Native. ' + "Please upgrade to use either '@react-native-community/react-native-image-picker' or 'expo-image-picker'. " + "If you cannot upgrade to a different library, please install the deprecated '@react-native-community/image-picker-ios' package. " + 'See https://github.com/rnc-archive/react-native-image-picker-ios'); + } + }); + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access ProgressViewIOS. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access ProgressViewIOS. */ + Object.defineProperty(module.exports, 'ProgressViewIOS', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'ProgressViewIOS has been removed from react-native core. ' + "It can now be installed and imported from '@react-native-community/progress-view' instead of 'react-native'. " + 'See https://github.com/react-native-progress-view/progress-view'); + } + }); + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access DatePickerIOS. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access DatePickerIOS. */ + Object.defineProperty(module.exports, 'DatePickerIOS', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'DatePickerIOS has been removed from react-native core. ' + "It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. " + 'See https://github.com/react-native-datetimepicker/datetimepicker'); + } + }); + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access Slider. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access Slider. */ + Object.defineProperty(module.exports, 'Slider', { + configurable: true, + get: function get() { + _$$_REQUIRE(_dependencyMap[78], "invariant")(false, 'Slider has been removed from react-native core. ' + "It can now be installed and imported from '@react-native-community/slider' instead of 'react-native'. " + 'See https://github.com/callstack/react-native-slider'); + } + }); + } +},15,[16,490,494,497,402,421,499,500,502,503,507,45,491,430,308,346,434,477,509,310,512,514,444,495,496,446,241,518,519,520,176,399,193,231,210,467,522,524,199,255,359,61,270,356,388,389,459,95,178,160,159,525,527,254,529,531,532,266,33,534,36,51,536,537,538,110,539,541,17,542,185,38,34,192,189,277,464,318,37],"node_modules\\react-native\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _RCTDeviceEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../EventEmitter/RCTDeviceEventEmitter")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Utilities/Platform")); + var _legacySendAccessibilityEvent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "./legacySendAccessibilityEvent")); + var _NativeAccessibilityInfo = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "./NativeAccessibilityInfo")); + var _NativeAccessibilityManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "./NativeAccessibilityManager")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + // Events that are only supported on Android. + + // Events that are only supported on iOS. + + // Mapping of public event names to platform-specific event names. + var EventNames = _Platform.default.OS === 'android' ? new Map([['change', 'touchExplorationDidChange'], ['reduceMotionChanged', 'reduceMotionDidChange'], ['screenReaderChanged', 'touchExplorationDidChange'], ['accessibilityServiceChanged', 'accessibilityServiceDidChange']]) : new Map([['announcementFinished', 'announcementFinished'], ['boldTextChanged', 'boldTextChanged'], ['change', 'screenReaderChanged'], ['grayscaleChanged', 'grayscaleChanged'], ['invertColorsChanged', 'invertColorsChanged'], ['reduceMotionChanged', 'reduceMotionChanged'], ['reduceTransparencyChanged', 'reduceTransparencyChanged'], ['screenReaderChanged', 'screenReaderChanged']]); + + /** + * Sometimes it's useful to know whether or not the device has a screen reader + * that is currently active. The `AccessibilityInfo` API is designed for this + * purpose. You can use it to query the current state of the screen reader as + * well as to register to be notified when the state of the screen reader + * changes. + * + * See https://reactnative.dev/docs/accessibilityinfo + */ + var AccessibilityInfo = { + /** + * Query whether bold text is currently enabled. + * + * Returns a promise which resolves to a boolean. + * The result is `true` when bold text is enabled and `false` otherwise. + * + * See https://reactnative.dev/docs/accessibilityinfo#isBoldTextEnabled + */ + isBoldTextEnabled: function isBoldTextEnabled() { + if (_Platform.default.OS === 'android') { + return Promise.resolve(false); + } else { + return new Promise(function (resolve, reject) { + if (_NativeAccessibilityManager.default != null) { + _NativeAccessibilityManager.default.getCurrentBoldTextState(resolve, reject); + } else { + reject(null); + } + }); + } + }, + /** + * Query whether grayscale is currently enabled. + * + * Returns a promise which resolves to a boolean. + * The result is `true` when grayscale is enabled and `false` otherwise. + * + * See https://reactnative.dev/docs/accessibilityinfo#isGrayscaleEnabled + */ + isGrayscaleEnabled: function isGrayscaleEnabled() { + if (_Platform.default.OS === 'android') { + return Promise.resolve(false); + } else { + return new Promise(function (resolve, reject) { + if (_NativeAccessibilityManager.default != null) { + _NativeAccessibilityManager.default.getCurrentGrayscaleState(resolve, reject); + } else { + reject(null); + } + }); + } + }, + /** + * Query whether inverted colors are currently enabled. + * + * Returns a promise which resolves to a boolean. + * The result is `true` when invert color is enabled and `false` otherwise. + * + * See https://reactnative.dev/docs/accessibilityinfo#isInvertColorsEnabled + */ + isInvertColorsEnabled: function isInvertColorsEnabled() { + if (_Platform.default.OS === 'android') { + return Promise.resolve(false); + } else { + return new Promise(function (resolve, reject) { + if (_NativeAccessibilityManager.default != null) { + _NativeAccessibilityManager.default.getCurrentInvertColorsState(resolve, reject); + } else { + reject(null); + } + }); + } + }, + /** + * Query whether reduced motion is currently enabled. + * + * Returns a promise which resolves to a boolean. + * The result is `true` when a reduce motion is enabled and `false` otherwise. + * + * See https://reactnative.dev/docs/accessibilityinfo#isReduceMotionEnabled + */ + isReduceMotionEnabled: function isReduceMotionEnabled() { + return new Promise(function (resolve, reject) { + if (_Platform.default.OS === 'android') { + if (_NativeAccessibilityInfo.default != null) { + _NativeAccessibilityInfo.default.isReduceMotionEnabled(resolve); + } else { + reject(null); + } + } else { + if (_NativeAccessibilityManager.default != null) { + _NativeAccessibilityManager.default.getCurrentReduceMotionState(resolve, reject); + } else { + reject(null); + } + } + }); + }, + /** + * Query whether reduce motion and prefer cross-fade transitions settings are currently enabled. + * + * Returns a promise which resolves to a boolean. + * The result is `true` when prefer cross-fade transitions is enabled and `false` otherwise. + * + * See https://reactnative.dev/docs/accessibilityinfo#prefersCrossFadeTransitions + */ + prefersCrossFadeTransitions: function prefersCrossFadeTransitions() { + return new Promise(function (resolve, reject) { + if (_Platform.default.OS === 'android') { + return Promise.resolve(false); + } else { + if ((_NativeAccessibilityManager.default == null ? void 0 : _NativeAccessibilityManager.default.getCurrentPrefersCrossFadeTransitionsState) != null) { + _NativeAccessibilityManager.default.getCurrentPrefersCrossFadeTransitionsState(resolve, reject); + } else { + reject(null); + } + } + }); + }, + /** + * Query whether reduced transparency is currently enabled. + * + * Returns a promise which resolves to a boolean. + * The result is `true` when a reduce transparency is enabled and `false` otherwise. + * + * See https://reactnative.dev/docs/accessibilityinfo#isReduceTransparencyEnabled + */ + isReduceTransparencyEnabled: function isReduceTransparencyEnabled() { + if (_Platform.default.OS === 'android') { + return Promise.resolve(false); + } else { + return new Promise(function (resolve, reject) { + if (_NativeAccessibilityManager.default != null) { + _NativeAccessibilityManager.default.getCurrentReduceTransparencyState(resolve, reject); + } else { + reject(null); + } + }); + } + }, + /** + * Query whether a screen reader is currently enabled. + * + * Returns a promise which resolves to a boolean. + * The result is `true` when a screen reader is enabled and `false` otherwise. + * + * See https://reactnative.dev/docs/accessibilityinfo#isScreenReaderEnabled + */ + isScreenReaderEnabled: function isScreenReaderEnabled() { + return new Promise(function (resolve, reject) { + if (_Platform.default.OS === 'android') { + if (_NativeAccessibilityInfo.default != null) { + _NativeAccessibilityInfo.default.isTouchExplorationEnabled(resolve); + } else { + reject(null); + } + } else { + if (_NativeAccessibilityManager.default != null) { + _NativeAccessibilityManager.default.getCurrentVoiceOverState(resolve, reject); + } else { + reject(null); + } + } + }); + }, + /** + * Query whether Accessibility Service is currently enabled. + * + * Returns a promise which resolves to a boolean. + * The result is `true` when any service is enabled and `false` otherwise. + * + * @platform android + * + * See https://reactnative.dev/docs/accessibilityinfo/#isaccessibilityserviceenabled-android + */ + isAccessibilityServiceEnabled: function isAccessibilityServiceEnabled() { + return new Promise(function (resolve, reject) { + if (_Platform.default.OS === 'android') { + if (_NativeAccessibilityInfo.default != null && _NativeAccessibilityInfo.default.isAccessibilityServiceEnabled != null) { + _NativeAccessibilityInfo.default.isAccessibilityServiceEnabled(resolve); + } else { + reject(null); + } + } else { + reject(null); + } + }); + }, + /** + * Add an event handler. Supported events: + * + * - `reduceMotionChanged`: Fires when the state of the reduce motion toggle changes. + * The argument to the event handler is a boolean. The boolean is `true` when a reduce + * motion is enabled (or when "Transition Animation Scale" in "Developer options" is + * "Animation off") and `false` otherwise. + * - `screenReaderChanged`: Fires when the state of the screen reader changes. The argument + * to the event handler is a boolean. The boolean is `true` when a screen + * reader is enabled and `false` otherwise. + * + * These events are only supported on iOS: + * + * - `boldTextChanged`: iOS-only event. Fires when the state of the bold text toggle changes. + * The argument to the event handler is a boolean. The boolean is `true` when a bold text + * is enabled and `false` otherwise. + * - `grayscaleChanged`: iOS-only event. Fires when the state of the gray scale toggle changes. + * The argument to the event handler is a boolean. The boolean is `true` when a gray scale + * is enabled and `false` otherwise. + * - `invertColorsChanged`: iOS-only event. Fires when the state of the invert colors toggle + * changes. The argument to the event handler is a boolean. The boolean is `true` when a invert + * colors is enabled and `false` otherwise. + * - `reduceTransparencyChanged`: iOS-only event. Fires when the state of the reduce transparency + * toggle changes. The argument to the event handler is a boolean. The boolean is `true` + * when a reduce transparency is enabled and `false` otherwise. + * - `announcementFinished`: iOS-only event. Fires when the screen reader has + * finished making an announcement. The argument to the event handler is a + * dictionary with these keys: + * - `announcement`: The string announced by the screen reader. + * - `success`: A boolean indicating whether the announcement was + * successfully made. + * + * See https://reactnative.dev/docs/accessibilityinfo#addeventlistener + */ + addEventListener: function addEventListener(eventName, + // $FlowIssue[incompatible-type] - Flow bug with unions and generics (T128099423) + handler) { + var deviceEventName = EventNames.get(eventName); + return deviceEventName == null ? { + remove: function remove() {} + } : + // $FlowFixMe[incompatible-call] + _RCTDeviceEventEmitter.default.addListener(deviceEventName, handler); + }, + /** + * Set accessibility focus to a React component. + * + * See https://reactnative.dev/docs/accessibilityinfo#setaccessibilityfocus + */ + setAccessibilityFocus: function setAccessibilityFocus(reactTag) { + (0, _legacySendAccessibilityEvent.default)(reactTag, 'focus'); + }, + /** + * Send a named accessibility event to a HostComponent. + */ + sendAccessibilityEvent: function sendAccessibilityEvent(handle, eventType) { + // iOS only supports 'focus' event types + if (_Platform.default.OS === 'ios' && eventType === 'click') { + return; + } + // route through React renderer to distinguish between Fabric and non-Fabric handles + (0, _$$_REQUIRE(_dependencyMap[6], "../../ReactNative/RendererProxy").sendAccessibilityEvent)(handle, eventType); + }, + /** + * Post a string to be announced by the screen reader. + * + * See https://reactnative.dev/docs/accessibilityinfo#announceforaccessibility + */ + announceForAccessibility: function announceForAccessibility(announcement) { + if (_Platform.default.OS === 'android') { + _NativeAccessibilityInfo.default == null ? void 0 : _NativeAccessibilityInfo.default.announceForAccessibility(announcement); + } else { + _NativeAccessibilityManager.default == null ? void 0 : _NativeAccessibilityManager.default.announceForAccessibility(announcement); + } + }, + /** + * Post a string to be announced by the screen reader. + * - `announcement`: The string announced by the screen reader. + * - `options`: An object that configures the reading options. + * - `queue`: The announcement will be queued behind existing announcements. iOS only. + */ + announceForAccessibilityWithOptions: function announceForAccessibilityWithOptions(announcement, options) { + if (_Platform.default.OS === 'android') { + _NativeAccessibilityInfo.default == null ? void 0 : _NativeAccessibilityInfo.default.announceForAccessibility(announcement); + } else { + if (_NativeAccessibilityManager.default != null && _NativeAccessibilityManager.default.announceForAccessibilityWithOptions) { + _NativeAccessibilityManager.default == null ? void 0 : _NativeAccessibilityManager.default.announceForAccessibilityWithOptions(announcement, options); + } else { + _NativeAccessibilityManager.default == null ? void 0 : _NativeAccessibilityManager.default.announceForAccessibility(announcement); + } + } + }, + /** + * Get the recommended timeout for changes to the UI needed by this user. + * + * See https://reactnative.dev/docs/accessibilityinfo#getrecommendedtimeoutmillis + */ + getRecommendedTimeoutMillis: function getRecommendedTimeoutMillis(originalTimeout) { + if (_Platform.default.OS === 'android') { + return new Promise(function (resolve, reject) { + if (_NativeAccessibilityInfo.default != null && _NativeAccessibilityInfo.default.getRecommendedTimeoutMillis) { + _NativeAccessibilityInfo.default.getRecommendedTimeoutMillis(originalTimeout, resolve); + } else { + resolve(originalTimeout); + } + }); + } else { + return Promise.resolve(originalTimeout); + } + } + }; + var _default = exports.default = AccessibilityInfo; +},16,[6,17,34,50,59,60,61],"node_modules\\react-native\\Libraries\\Components\\AccessibilityInfo\\AccessibilityInfo.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _EventEmitter2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../vendor/emitter/EventEmitter")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + // FIXME: use typed events + /** + * Global EventEmitter used by the native platform to emit events to JavaScript. + * Events are identified by globally unique event names. + * + * NativeModules that emit events should instead subclass `NativeEventEmitter`. + */ + var RCTDeviceEventEmitter = /*#__PURE__*/function (_EventEmitter) { + function RCTDeviceEventEmitter() { + (0, _classCallCheck2.default)(this, RCTDeviceEventEmitter); + return _callSuper(this, RCTDeviceEventEmitter, arguments); + } + (0, _inherits2.default)(RCTDeviceEventEmitter, _EventEmitter); + return (0, _createClass2.default)(RCTDeviceEventEmitter, [{ + key: "emit", + value: + // Add systrace to RCTDeviceEventEmitter.emit method for debugging + function emit(eventType) { + (0, _$$_REQUIRE(_dependencyMap[8], "../Performance/Systrace").beginEvent)(function () { + return `RCTDeviceEventEmitter.emit#${eventType}`; + }); + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + _superPropGet(RCTDeviceEventEmitter, "emit", this, 3)([eventType].concat(args)); + (0, _$$_REQUIRE(_dependencyMap[8], "../Performance/Systrace").endEvent)(); + } + }]); + }(_EventEmitter2.default); + var instance = new RCTDeviceEventEmitter(); + Object.defineProperty(global, '__rctDeviceEventEmitter', { + configurable: true, + value: instance + }); + var _default = exports.default = instance; +},17,[6,18,19,23,25,26,28,30,33],"node_modules\\react-native\\Libraries\\EventEmitter\\RCTDeviceEventEmitter.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _classCallCheck(a, n) { + if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); + } + module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; +},18,[],"node_modules\\@babel\\runtime\\helpers\\classCallCheck.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _defineProperties(e, r) { + for (var t = 0; t < r.length; t++) { + var o = r[t]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _$$_REQUIRE(_dependencyMap[0], "./toPropertyKey.js")(o.key), o); + } + } + function _createClass(e, r, t) { + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { + writable: !1 + }), e; + } + module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; +},19,[20],"node_modules\\@babel\\runtime\\helpers\\createClass.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function toPropertyKey(t) { + var i = _$$_REQUIRE(_dependencyMap[0], "./toPrimitive.js")(t, "string"); + return "symbol" == _$$_REQUIRE(_dependencyMap[1], "./typeof.js")["default"](i) ? i : i + ""; + } + module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; +},20,[21,22],"node_modules\\@babel\\runtime\\helpers\\toPropertyKey.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function toPrimitive(t, r) { + if ("object" != _$$_REQUIRE(_dependencyMap[0], "./typeof.js")["default"](t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _$$_REQUIRE(_dependencyMap[0], "./typeof.js")["default"](i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); + } + module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; +},21,[22],"node_modules\\@babel\\runtime\\helpers\\toPrimitive.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _typeof(o) { + "@babel/helpers - typeof"; + + return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return typeof o; + } : function (o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); + } + module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; +},22,[],"node_modules\\@babel\\runtime\\helpers\\typeof.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _possibleConstructorReturn(t, e) { + if (e && ("object" == _$$_REQUIRE(_dependencyMap[0], "./typeof.js")["default"](e) || "function" == typeof e)) return e; + if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); + return _$$_REQUIRE(_dependencyMap[1], "./assertThisInitialized.js")(t); + } + module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; +},23,[22,24],"node_modules\\@babel\\runtime\\helpers\\possibleConstructorReturn.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _assertThisInitialized(e) { + if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return e; + } + module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; +},24,[],"node_modules\\@babel\\runtime\\helpers\\assertThisInitialized.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _getPrototypeOf(t) { + return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t); + } + module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; +},25,[],"node_modules\\@babel\\runtime\\helpers\\getPrototypeOf.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _get() { + return module.exports = _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { + var p = _$$_REQUIRE(_dependencyMap[0], "./superPropBase.js")(e, t); + if (p) { + var n = Object.getOwnPropertyDescriptor(p, t); + return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; + } + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _get.apply(null, arguments); + } + module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports; +},26,[27],"node_modules\\@babel\\runtime\\helpers\\get.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _superPropBase(t, o) { + for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _$$_REQUIRE(_dependencyMap[0], "./getPrototypeOf.js")(t));); + return t; + } + module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports; +},27,[25],"node_modules\\@babel\\runtime\\helpers\\superPropBase.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _inherits(t, e) { + if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); + t.prototype = Object.create(e && e.prototype, { + constructor: { + value: t, + writable: !0, + configurable: !0 + } + }), Object.defineProperty(t, "prototype", { + writable: !1 + }), e && _$$_REQUIRE(_dependencyMap[0], "./setPrototypeOf.js")(t, e); + } + module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; +},28,[29],"node_modules\\@babel\\runtime\\helpers\\inherits.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _setPrototypeOf(t, e) { + return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { + return t.__proto__ = e, t; + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e); + } + module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; +},29,[],"node_modules\\@babel\\runtime\\helpers\\setPrototypeOf.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _classPrivateFieldLooseBase2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/classPrivateFieldLooseBase")); + var _classPrivateFieldLooseKey2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/classPrivateFieldLooseKey")); + var _registry = /*#__PURE__*/(0, _classPrivateFieldLooseKey2.default)("registry"); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + /** + * EventEmitter manages listeners and publishes events to them. + * + * EventEmitter accepts a single type parameter that defines the valid events + * and associated listener argument(s). + * + * @example + * + * const emitter = new EventEmitter<{ + * success: [number, string], + * error: [Error], + * }>(); + * + * emitter.on('success', (statusCode, responseText) => {...}); + * emitter.emit('success', 200, '...'); + * + * emitter.on('error', error => {...}); + * emitter.emit('error', new Error('Resource not found')); + * + */ + var EventEmitter = exports.default = /*#__PURE__*/function () { + function EventEmitter() { + (0, _classCallCheck2.default)(this, EventEmitter); + Object.defineProperty(this, _registry, { + writable: true, + value: {} + }); + } + return (0, _createClass2.default)(EventEmitter, [{ + key: "addListener", + value: + /** + * Registers a listener that is called when the supplied event is emitted. + * Returns a subscription that has a `remove` method to undo registration. + */ + function addListener(eventType, listener, context) { + if (typeof listener !== 'function') { + throw new TypeError('EventEmitter.addListener(...): 2nd argument must be a function.'); + } + var registrations = allocate((0, _classPrivateFieldLooseBase2.default)(this, _registry)[_registry], eventType); + var registration = { + context: context, + listener: listener, + remove: function remove() { + registrations.delete(registration); + } + }; + registrations.add(registration); + return registration; + } + + /** + * Emits the supplied event. Additional arguments supplied to `emit` will be + * passed through to each of the registered listeners. + * + * If a listener modifies the listeners registered for the same event, those + * changes will not be reflected in the current invocation of `emit`. + */ + }, { + key: "emit", + value: function emit(eventType) { + var registrations = (0, _classPrivateFieldLooseBase2.default)(this, _registry)[_registry][eventType]; + if (registrations != null) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + // Copy `registrations` to take a snapshot when we invoke `emit`, in case + // registrations are added or removed when listeners are invoked. + for (var registration of Array.from(registrations)) { + registration.listener.apply(registration.context, args); + } + } + } + + /** + * Removes all registered listeners. + */ + }, { + key: "removeAllListeners", + value: function removeAllListeners(eventType) { + if (eventType == null) { + (0, _classPrivateFieldLooseBase2.default)(this, _registry)[_registry] = {}; + } else { + delete (0, _classPrivateFieldLooseBase2.default)(this, _registry)[_registry][eventType]; + } + } + + /** + * Returns the number of registered listeners for the supplied event. + */ + }, { + key: "listenerCount", + value: function listenerCount(eventType) { + var registrations = (0, _classPrivateFieldLooseBase2.default)(this, _registry)[_registry][eventType]; + return registrations == null ? 0 : registrations.size; + } + }]); + }(); + function allocate(registry, eventType) { + var registrations = registry[eventType]; + if (registrations == null) { + registrations = new Set(); + registry[eventType] = registrations; + } + return registrations; + } +},30,[6,18,19,31,32],"node_modules\\react-native\\Libraries\\vendor\\emitter\\EventEmitter.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _classPrivateFieldBase(e, t) { + if (!{}.hasOwnProperty.call(e, t)) throw new TypeError("attempted to use private field on non-instance"); + return e; + } + module.exports = _classPrivateFieldBase, module.exports.__esModule = true, module.exports["default"] = module.exports; +},31,[],"node_modules\\@babel\\runtime\\helpers\\classPrivateFieldLooseBase.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var id = 0; + function _classPrivateFieldKey(e) { + return "__private_" + id++ + "_" + e; + } + module.exports = _classPrivateFieldKey, module.exports.__esModule = true, module.exports["default"] = module.exports; +},32,[],"node_modules\\@babel\\runtime\\helpers\\classPrivateFieldLooseKey.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.beginAsyncEvent = beginAsyncEvent; + exports.beginEvent = beginEvent; + exports.counterEvent = counterEvent; + exports.endAsyncEvent = endAsyncEvent; + exports.endEvent = endEvent; + exports.isEnabled = isEnabled; + exports.setEnabled = setEnabled; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var TRACE_TAG_REACT_APPS = 1 << 17; // eslint-disable-line no-bitwise + + var _asyncCookie = 0; + /** + * Indicates if the application is currently being traced. + * + * Calling methods on this module when the application isn't being traced is + * cheap, but this method can be used to avoid computing expensive values for + * those functions. + * + * @example + * if (Systrace.isEnabled()) { + * const expensiveArgs = computeExpensiveArgs(); + * Systrace.beginEvent('myEvent', expensiveArgs); + * } + */ + function isEnabled() { + return global.nativeTraceIsTracing ? global.nativeTraceIsTracing(TRACE_TAG_REACT_APPS) : Boolean(global.__RCTProfileIsProfiling); + } + + /** + * @deprecated This function is now a no-op but it's left for backwards + * compatibility. `isEnabled` will now synchronously check if we're actively + * profiling or not. This is necessary because we don't have callbacks to know + * when profiling has started/stopped on Android APIs. + */ + function setEnabled(_doEnable) {} + + /** + * Marks the start of a synchronous event that should end in the same stack + * frame. The end of this event should be marked using the `endEvent` function. + */ + function beginEvent(eventName, args) { + if (isEnabled()) { + var eventNameString = typeof eventName === 'function' ? eventName() : eventName; + global.nativeTraceBeginSection(TRACE_TAG_REACT_APPS, eventNameString, args); + } + } + + /** + * Marks the end of a synchronous event started in the same stack frame. + */ + function endEvent(args) { + if (isEnabled()) { + global.nativeTraceEndSection(TRACE_TAG_REACT_APPS, args); + } + } + + /** + * Marks the start of a potentially asynchronous event. The end of this event + * should be marked calling the `endAsyncEvent` function with the cookie + * returned by this function. + */ + function beginAsyncEvent(eventName, args) { + var cookie = _asyncCookie; + if (isEnabled()) { + _asyncCookie++; + var eventNameString = typeof eventName === 'function' ? eventName() : eventName; + global.nativeTraceBeginAsyncSection(TRACE_TAG_REACT_APPS, eventNameString, cookie, args); + } + return cookie; + } + + /** + * Marks the end of a potentially asynchronous event, which was started with + * the given cookie. + */ + function endAsyncEvent(eventName, cookie, args) { + if (isEnabled()) { + var eventNameString = typeof eventName === 'function' ? eventName() : eventName; + global.nativeTraceEndAsyncSection(TRACE_TAG_REACT_APPS, eventNameString, cookie, args); + } + } + + /** + * Registers a new value for a counter event. + */ + function counterEvent(eventName, value) { + if (isEnabled()) { + var eventNameString = typeof eventName === 'function' ? eventName() : eventName; + global.nativeTraceCounter && global.nativeTraceCounter(TRACE_TAG_REACT_APPS, eventNameString, value); + } + } + if (__DEV__) { + var Systrace = { + isEnabled: isEnabled, + setEnabled: setEnabled, + beginEvent: beginEvent, + endEvent: endEvent, + beginAsyncEvent: beginAsyncEvent, + endAsyncEvent: endAsyncEvent, + counterEvent: counterEvent + }; + + // The metro require polyfill can not have dependencies (true for all polyfills). + // Ensure that `Systrace` is available in polyfill by exposing it globally. + global[(global.__METRO_GLOBAL_PREFIX__ || '') + '__SYSTRACE'] = Systrace; + } +},33,[],"node_modules\\react-native\\Libraries\\Performance\\Systrace.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _NativePlatformConstantsAndroid = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./NativePlatformConstantsAndroid")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var Platform = { + __constants: null, + OS: 'android', + // $FlowFixMe[unsafe-getters-setters] + get Version() { + // $FlowFixMe[object-this-reference] + return this.constants.Version; + }, + // $FlowFixMe[unsafe-getters-setters] + get constants() { + // $FlowFixMe[object-this-reference] + if (this.__constants == null) { + // $FlowFixMe[object-this-reference] + this.__constants = _NativePlatformConstantsAndroid.default.getConstants(); + } + // $FlowFixMe[object-this-reference] + return this.__constants; + }, + // $FlowFixMe[unsafe-getters-setters] + get isTesting() { + if (__DEV__) { + // $FlowFixMe[object-this-reference] + return this.constants.isTesting; + } + return false; + }, + // $FlowFixMe[unsafe-getters-setters] + get isDisableAnimations() { + var _this$constants$isDis; + // $FlowFixMe[object-this-reference] + return (_this$constants$isDis = this.constants.isDisableAnimations) != null ? _this$constants$isDis : this.isTesting; + }, + // $FlowFixMe[unsafe-getters-setters] + get isTV() { + // $FlowFixMe[object-this-reference] + return this.constants.uiMode === 'tv'; + }, + select: function select(spec) { + return 'android' in spec ? + // $FlowFixMe[incompatible-return] + spec.android : 'native' in spec ? + // $FlowFixMe[incompatible-return] + spec.native : + // $FlowFixMe[incompatible-return] + spec.default; + } + }; + module.exports = Platform; +},34,[6,35],"node_modules\\react-native\\Libraries\\Utilities\\Platform.android.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.getEnforcing('PlatformConstants'); +},35,[36],"node_modules\\react-native\\Libraries\\Utilities\\NativePlatformConstantsAndroid.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.get = get; + exports.getEnforcing = getEnforcing; + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "invariant")); /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var turboModuleProxy = global.__turboModuleProxy; + var moduleLoadHistory = { + NativeModules: [], + TurboModules: [], + NotFound: [] + }; + function isBridgeless() { + return global.RN$Bridgeless === true; + } + function isTurboModuleInteropEnabled() { + return global.RN$TurboInterop === true; + } + + // TODO(154308585): Remove "module not found" debug info logging + function shouldReportDebugInfo() { + return true; + } + + // TODO(148943970): Consider reversing the lookup here: + // Lookup on __turboModuleProxy, then lookup on nativeModuleProxy + function requireModule(name) { + if (!isBridgeless() || isTurboModuleInteropEnabled()) { + // Backward compatibility layer during migration. + var legacyModule = _$$_REQUIRE(_dependencyMap[2], "../BatchedBridge/NativeModules")[name]; + if (legacyModule != null) { + if (shouldReportDebugInfo()) { + moduleLoadHistory.NativeModules.push(name); + } + return legacyModule; + } + } + if (turboModuleProxy != null) { + var module = turboModuleProxy(name); + if (module != null) { + if (shouldReportDebugInfo()) { + moduleLoadHistory.TurboModules.push(name); + } + return module; + } + } + if (shouldReportDebugInfo() && !moduleLoadHistory.NotFound.includes(name)) { + moduleLoadHistory.NotFound.push(name); + } + return null; + } + function get(name) { + return requireModule(name); + } + function getEnforcing(name) { + var module = requireModule(name); + var message = `TurboModuleRegistry.getEnforcing(...): '${name}' could not be found. ` + 'Verify that a module by this name is registered in the native binary.'; + if (shouldReportDebugInfo()) { + message += 'Bridgeless mode: ' + (isBridgeless() ? 'true' : 'false') + '. '; + message += 'TurboModule interop: ' + (isTurboModuleInteropEnabled() ? 'true' : 'false') + '. '; + message += 'Modules loaded: ' + JSON.stringify(moduleLoadHistory); + } + (0, _invariant.default)(module != null, message); + return module; + } +},36,[6,37,38],"node_modules\\react-native\\Libraries\\TurboModule\\TurboModuleRegistry.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + 'use strict'; + + /** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + var invariant = function invariant(condition, format, a, b, c, d, e, f) { + if (process.env.NODE_ENV !== 'production') { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + } + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } + }; + module.exports = invariant; +},37,[],"node_modules\\invariant\\browser.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _slicedToArray = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/slicedToArray"); + function genModule(config, moduleID) { + if (!config) { + return null; + } + var _config = _slicedToArray(config, 5), + moduleName = _config[0], + constants = _config[1], + methods = _config[2], + promiseMethods = _config[3], + syncMethods = _config[4]; + _$$_REQUIRE(_dependencyMap[1], "invariant")(!moduleName.startsWith('RCT') && !moduleName.startsWith('RK'), "Module name prefixes should've been stripped by the native side " + "but wasn't for " + moduleName); + if (!constants && !methods) { + // Module contents will be filled in lazily later + return { + name: moduleName + }; + } + var module = {}; + methods && methods.forEach(function (methodName, methodID) { + var isPromise = promiseMethods && arrayContains(promiseMethods, methodID) || false; + var isSync = syncMethods && arrayContains(syncMethods, methodID) || false; + _$$_REQUIRE(_dependencyMap[1], "invariant")(!isPromise || !isSync, 'Cannot have a method that is both async and a sync hook'); + var methodType = isPromise ? 'promise' : isSync ? 'sync' : 'async'; + module[methodName] = genMethod(moduleID, methodID, methodType); + }); + Object.assign(module, constants); + if (module.getConstants == null) { + module.getConstants = function () { + return constants || Object.freeze({}); + }; + } else { + console.warn(`Unable to define method 'getConstants()' on NativeModule '${moduleName}'. NativeModule '${moduleName}' already has a constant or method called 'getConstants'. Please remove it.`); + } + if (__DEV__) { + _$$_REQUIRE(_dependencyMap[2], "./BatchedBridge").createDebugLookup(moduleID, moduleName, methods); + } + return { + name: moduleName, + module: module + }; + } + + // export this method as a global so we can call it from native + global.__fbGenNativeModule = genModule; + function loadModule(name, moduleID) { + _$$_REQUIRE(_dependencyMap[1], "invariant")(global.nativeRequireModuleConfig, "Can't lazily create module without nativeRequireModuleConfig"); + var config = global.nativeRequireModuleConfig(name); + var info = genModule(config, moduleID); + return info && info.module; + } + function genMethod(moduleID, methodID, type) { + var fn = null; + if (type === 'promise') { + fn = function promiseMethodWrapper() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + // In case we reject, capture a useful stack trace here. + /* $FlowFixMe[class-object-subtyping] added when improving typing for + * this parameters */ + var enqueueingFrameError = new Error(); + return new Promise(function (resolve, reject) { + _$$_REQUIRE(_dependencyMap[2], "./BatchedBridge").enqueueNativeCall(moduleID, methodID, args, function (data) { + return resolve(data); + }, function (errorData) { + return reject(updateErrorWithErrorData(errorData, enqueueingFrameError)); + }); + }); + }; + } else { + fn = function nonPromiseMethodWrapper() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + var lastArg = args.length > 0 ? args[args.length - 1] : null; + var secondLastArg = args.length > 1 ? args[args.length - 2] : null; + var hasSuccessCallback = typeof lastArg === 'function'; + var hasErrorCallback = typeof secondLastArg === 'function'; + hasErrorCallback && _$$_REQUIRE(_dependencyMap[1], "invariant")(hasSuccessCallback, 'Cannot have a non-function arg after a function arg.'); + // $FlowFixMe[incompatible-type] + var onSuccess = hasSuccessCallback ? lastArg : null; + // $FlowFixMe[incompatible-type] + var onFail = hasErrorCallback ? secondLastArg : null; + // $FlowFixMe[unsafe-addition] + var callbackCount = hasSuccessCallback + hasErrorCallback; + var newArgs = args.slice(0, args.length - callbackCount); + if (type === 'sync') { + return _$$_REQUIRE(_dependencyMap[2], "./BatchedBridge").callNativeSyncHook(moduleID, methodID, newArgs, onFail, onSuccess); + } else { + _$$_REQUIRE(_dependencyMap[2], "./BatchedBridge").enqueueNativeCall(moduleID, methodID, newArgs, onFail, onSuccess); + } + }; + } + // $FlowFixMe[prop-missing] + fn.type = type; + return fn; + } + function arrayContains(array, value) { + return array.indexOf(value) !== -1; + } + function updateErrorWithErrorData(errorData, error) { + /* $FlowFixMe[class-object-subtyping] added when improving typing for this + * parameters */ + return Object.assign(error, errorData || {}); + } + var NativeModules = {}; + if (global.nativeModuleProxy) { + NativeModules = global.nativeModuleProxy; + } else if (!global.nativeExtensions) { + var bridgeConfig = global.__fbBatchedBridgeConfig; + _$$_REQUIRE(_dependencyMap[1], "invariant")(bridgeConfig, '__fbBatchedBridgeConfig is not set, cannot invoke native modules'); + var defineLazyObjectProperty = _$$_REQUIRE(_dependencyMap[3], "../Utilities/defineLazyObjectProperty"); + (bridgeConfig.remoteModuleConfig || []).forEach(function (config, moduleID) { + // Initially this config will only contain the module name when running in JSC. The actual + // configuration of the module will be lazily loaded. + var info = genModule(config, moduleID); + if (!info) { + return; + } + if (info.module) { + NativeModules[info.name] = info.module; + } + // If there's no module config, define a lazy getter + else { + defineLazyObjectProperty(NativeModules, info.name, { + get: function get() { + return loadModule(info.name, moduleID); + } + }); + } + }); + } + module.exports = NativeModules; +},38,[7,37,39,49],"node_modules\\react-native\\Libraries\\BatchedBridge\\NativeModules.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var BatchedBridge = new (_$$_REQUIRE(_dependencyMap[0], "./MessageQueue"))(); + + // Wire up the batched bridge on the global object so that we can call into it. + // Ideally, this would be the inverse relationship. I.e. the native environment + // provides this global directly with its script embedded. Then this module + // would export it. A possible fix would be to trim the dependencies in + // MessageQueue to its minimal features and embed that in the native runtime. + + Object.defineProperty(global, '__fbBatchedBridge', { + configurable: true, + value: BatchedBridge + }); + module.exports = BatchedBridge; +},39,[40],"node_modules\\react-native\\Libraries\\BatchedBridge\\BatchedBridge.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _toConsumableArray = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/toConsumableArray"); + var _classCallCheck = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass"); + var TO_JS = 0; + var TO_NATIVE = 1; + var MODULE_IDS = 0; + var METHOD_IDS = 1; + var PARAMS = 2; + var MIN_TIME_BETWEEN_FLUSHES_MS = 5; + + // eslint-disable-next-line no-bitwise + var TRACE_TAG_REACT_APPS = 1 << 17; + var DEBUG_INFO_LIMIT = 32; + var MessageQueue = /*#__PURE__*/function () { + function MessageQueue() { + _classCallCheck(this, MessageQueue); + this._lazyCallableModules = {}; + this._queue = [[], [], [], 0]; + this._successCallbacks = new Map(); + this._failureCallbacks = new Map(); + this._callID = 0; + this._lastFlush = 0; + this._eventLoopStartTime = Date.now(); + this._reactNativeMicrotasksCallback = null; + if (__DEV__) { + this._debugInfo = {}; + this._remoteModuleTable = {}; + this._remoteMethodTable = {}; + } + + // $FlowFixMe[cannot-write] + this.callFunctionReturnFlushedQueue = + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + this.callFunctionReturnFlushedQueue.bind(this); + // $FlowFixMe[cannot-write] + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + this.flushedQueue = this.flushedQueue.bind(this); + + // $FlowFixMe[cannot-write] + this.invokeCallbackAndReturnFlushedQueue = + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + this.invokeCallbackAndReturnFlushedQueue.bind(this); + } + + /** + * Public APIs + */ + return _createClass(MessageQueue, [{ + key: "callFunctionReturnFlushedQueue", + value: function callFunctionReturnFlushedQueue(module, method, args) { + var _this = this; + this.__guard(function () { + _this.__callFunction(module, method, args); + }); + return this.flushedQueue(); + } + }, { + key: "invokeCallbackAndReturnFlushedQueue", + value: function invokeCallbackAndReturnFlushedQueue(cbID, args) { + var _this2 = this; + this.__guard(function () { + _this2.__invokeCallback(cbID, args); + }); + return this.flushedQueue(); + } + }, { + key: "flushedQueue", + value: function flushedQueue() { + var _this3 = this; + this.__guard(function () { + _this3.__callReactNativeMicrotasks(); + }); + var queue = this._queue; + this._queue = [[], [], [], this._callID]; + return queue[0].length ? queue : null; + } + }, { + key: "getEventLoopRunningTime", + value: function getEventLoopRunningTime() { + return Date.now() - this._eventLoopStartTime; + } + }, { + key: "registerCallableModule", + value: function registerCallableModule(name, module) { + this._lazyCallableModules[name] = function () { + return module; + }; + } + }, { + key: "registerLazyCallableModule", + value: function registerLazyCallableModule(name, factory) { + var module; + var getValue = factory; + this._lazyCallableModules[name] = function () { + if (getValue) { + module = getValue(); + getValue = null; + } + /* $FlowFixMe[class-object-subtyping] added when improving typing for + * this parameters */ + return module; + }; + } + }, { + key: "getCallableModule", + value: function getCallableModule(name) { + var getValue = this._lazyCallableModules[name]; + return getValue ? getValue() : null; + } + }, { + key: "callNativeSyncHook", + value: function callNativeSyncHook(moduleID, methodID, params, onFail, onSucc) { + if (__DEV__) { + _$$_REQUIRE(_dependencyMap[3], "invariant")(global.nativeCallSyncHook, 'Calling synchronous methods on native ' + 'modules is not supported in Chrome.\n\n Consider providing alternative ' + 'methods to expose this method in debug mode, e.g. by exposing constants ' + 'ahead-of-time.'); + } + this.processCallbacks(moduleID, methodID, params, onFail, onSucc); + return global.nativeCallSyncHook(moduleID, methodID, params); + } + }, { + key: "processCallbacks", + value: function processCallbacks(moduleID, methodID, params, onFail, onSucc) { + var _this4 = this; + if (onFail || onSucc) { + if (__DEV__) { + this._debugInfo[this._callID] = [moduleID, methodID]; + if (this._callID > DEBUG_INFO_LIMIT) { + delete this._debugInfo[this._callID - DEBUG_INFO_LIMIT]; + } + if (this._successCallbacks.size > 500) { + var info = {}; + this._successCallbacks.forEach(function (_, callID) { + var debug = _this4._debugInfo[callID]; + var module = debug && _this4._remoteModuleTable[debug[0]]; + var method = debug && _this4._remoteMethodTable[debug[0]][debug[1]]; + info[callID] = { + module: module, + method: method + }; + }); + _$$_REQUIRE(_dependencyMap[4], "../Utilities/warnOnce")('excessive-number-of-pending-callbacks', `Excessive number of pending callbacks: ${this._successCallbacks.size}. Some pending callbacks that might have leaked by never being called from native code: ${_$$_REQUIRE(_dependencyMap[5], "../Utilities/stringifySafe").default(info)}`); + } + } + // Encode callIDs into pairs of callback identifiers by shifting left and using the rightmost bit + // to indicate fail (0) or success (1) + // eslint-disable-next-line no-bitwise + onFail && params.push(this._callID << 1); + // eslint-disable-next-line no-bitwise + onSucc && params.push(this._callID << 1 | 1); + this._successCallbacks.set(this._callID, onSucc); + this._failureCallbacks.set(this._callID, onFail); + } + if (__DEV__) { + global.nativeTraceBeginAsyncFlow && global.nativeTraceBeginAsyncFlow(TRACE_TAG_REACT_APPS, 'native', this._callID); + } + this._callID++; + } + }, { + key: "enqueueNativeCall", + value: function enqueueNativeCall(moduleID, methodID, params, onFail, onSucc) { + this.processCallbacks(moduleID, methodID, params, onFail, onSucc); + this._queue[MODULE_IDS].push(moduleID); + this._queue[METHOD_IDS].push(methodID); + if (__DEV__) { + // Validate that parameters passed over the bridge are + // folly-convertible. As a special case, if a prop value is a + // function it is permitted here, and special-cased in the + // conversion. + var _isValidArgument = function isValidArgument(val) { + switch (typeof val) { + case 'undefined': + case 'boolean': + case 'string': + return true; + case 'number': + return isFinite(val); + case 'object': + if (val == null) { + return true; + } + if (Array.isArray(val)) { + return val.every(_isValidArgument); + } + for (var k in val) { + if (typeof val[k] !== 'function' && !_isValidArgument(val[k])) { + return false; + } + } + return true; + case 'function': + return false; + default: + return false; + } + }; + + // Replacement allows normally non-JSON-convertible values to be + // seen. There is ambiguity with string values, but in context, + // it should at least be a strong hint. + var replacer = function replacer(key, val) { + var t = typeof val; + if (t === 'function') { + return '<>'; + } else if (t === 'number' && !isFinite(val)) { + return '<<' + val.toString() + '>>'; + } else { + return val; + } + }; + + // Note that JSON.stringify + _$$_REQUIRE(_dependencyMap[3], "invariant")(_isValidArgument(params), '%s is not usable as a native method argument', JSON.stringify(params, replacer)); + + // The params object should not be mutated after being queued + _$$_REQUIRE(_dependencyMap[6], "../Utilities/deepFreezeAndThrowOnMutationInDev")(params); + } + this._queue[PARAMS].push(params); + var now = Date.now(); + if (global.nativeFlushQueueImmediate && now - this._lastFlush >= MIN_TIME_BETWEEN_FLUSHES_MS) { + var queue = this._queue; + this._queue = [[], [], [], this._callID]; + this._lastFlush = now; + global.nativeFlushQueueImmediate(queue); + } + _$$_REQUIRE(_dependencyMap[7], "../Performance/Systrace").counterEvent('pending_js_to_native_queue', this._queue[0].length); + if (__DEV__ && this.__spy && isFinite(moduleID)) { + // $FlowFixMe[not-a-function] + this.__spy({ + type: TO_NATIVE, + module: this._remoteModuleTable[moduleID], + method: this._remoteMethodTable[moduleID][methodID], + args: params + }); + } else if (this.__spy) { + this.__spy({ + type: TO_NATIVE, + module: moduleID + '', + method: methodID, + args: params + }); + } + } + }, { + key: "createDebugLookup", + value: function createDebugLookup(moduleID, name, methods) { + if (__DEV__) { + this._remoteModuleTable[moduleID] = name; + this._remoteMethodTable[moduleID] = methods || []; + } + } + + // For JSTimers to register its callback. Otherwise a circular dependency + // between modules is introduced. Note that only one callback may be + // registered at a time. + }, { + key: "setReactNativeMicrotasksCallback", + value: function setReactNativeMicrotasksCallback(fn) { + this._reactNativeMicrotasksCallback = fn; + } + + /** + * Private methods + */ + }, { + key: "__guard", + value: function __guard(fn) { + if (this.__shouldPauseOnThrow()) { + fn(); + } else { + try { + fn(); + } catch (error) { + _$$_REQUIRE(_dependencyMap[8], "../vendor/core/ErrorUtils").reportFatalError(error); + } + } + } + + // MessageQueue installs a global handler to catch all exceptions where JS users can register their own behavior + // This handler makes all exceptions to be propagated from inside MessageQueue rather than by the VM at their origin + // This makes stacktraces to be placed at MessageQueue rather than at where they were launched + // The parameter DebuggerInternal.shouldPauseOnThrow is used to check before catching all exceptions and + // can be configured by the VM or any Inspector + }, { + key: "__shouldPauseOnThrow", + value: function __shouldPauseOnThrow() { + return ( + // $FlowFixMe[cannot-resolve-name] + typeof DebuggerInternal !== 'undefined' && + // $FlowFixMe[cannot-resolve-name] + DebuggerInternal.shouldPauseOnThrow === true + ); + } + }, { + key: "__callReactNativeMicrotasks", + value: function __callReactNativeMicrotasks() { + _$$_REQUIRE(_dependencyMap[7], "../Performance/Systrace").beginEvent('JSTimers.callReactNativeMicrotasks()'); + try { + if (this._reactNativeMicrotasksCallback != null) { + this._reactNativeMicrotasksCallback(); + } + } finally { + _$$_REQUIRE(_dependencyMap[7], "../Performance/Systrace").endEvent(); + } + } + }, { + key: "__callFunction", + value: function __callFunction(module, method, args) { + this._lastFlush = Date.now(); + this._eventLoopStartTime = this._lastFlush; + if (__DEV__ || this.__spy) { + _$$_REQUIRE(_dependencyMap[7], "../Performance/Systrace").beginEvent(`${module}.${method}(${_$$_REQUIRE(_dependencyMap[5], "../Utilities/stringifySafe").default(args)})`); + } else { + _$$_REQUIRE(_dependencyMap[7], "../Performance/Systrace").beginEvent(`${module}.${method}(...)`); + } + try { + if (this.__spy) { + this.__spy({ + type: TO_JS, + module: module, + method: method, + args: args + }); + } + var moduleMethods = this.getCallableModule(module); + if (!moduleMethods) { + var callableModuleNames = Object.keys(this._lazyCallableModules); + var n = callableModuleNames.length; + var callableModuleNameList = callableModuleNames.join(', '); + + // TODO(T122225939): Remove after investigation: Why are we getting to this line in bridgeless mode? + var isBridgelessMode = global.RN$Bridgeless === true ? 'true' : 'false'; + _$$_REQUIRE(_dependencyMap[3], "invariant")(false, `Failed to call into JavaScript module method ${module}.${method}(). Module has not been registered as callable. Bridgeless Mode: ${isBridgelessMode}. Registered callable JavaScript modules (n = ${n}): ${callableModuleNameList}. + A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.`); + } + if (!moduleMethods[method]) { + _$$_REQUIRE(_dependencyMap[3], "invariant")(false, `Failed to call into JavaScript module method ${module}.${method}(). Module exists, but the method is undefined.`); + } + moduleMethods[method].apply(moduleMethods, args); + } finally { + _$$_REQUIRE(_dependencyMap[7], "../Performance/Systrace").endEvent(); + } + } + }, { + key: "__invokeCallback", + value: function __invokeCallback(cbID, args) { + this._lastFlush = Date.now(); + this._eventLoopStartTime = this._lastFlush; + + // The rightmost bit of cbID indicates fail (0) or success (1), the other bits are the callID shifted left. + // eslint-disable-next-line no-bitwise + var callID = cbID >>> 1; + // eslint-disable-next-line no-bitwise + var isSuccess = cbID & 1; + var callback = isSuccess ? this._successCallbacks.get(callID) : this._failureCallbacks.get(callID); + if (__DEV__) { + var debug = this._debugInfo[callID]; + var _module = debug && this._remoteModuleTable[debug[0]]; + var method = debug && this._remoteMethodTable[debug[0]][debug[1]]; + _$$_REQUIRE(_dependencyMap[3], "invariant")(callback, `No callback found with cbID ${cbID} and callID ${callID} for ` + (method ? ` ${_module}.${method} - most likely the callback was already invoked` : `module ${_module || ''}`) + `. Args: '${_$$_REQUIRE(_dependencyMap[5], "../Utilities/stringifySafe").default(args)}'`); + var profileName = debug ? '' : cbID; + if (callback && this.__spy) { + this.__spy({ + type: TO_JS, + module: null, + method: profileName, + args: args + }); + } + _$$_REQUIRE(_dependencyMap[7], "../Performance/Systrace").beginEvent(`MessageQueue.invokeCallback(${profileName}, ${_$$_REQUIRE(_dependencyMap[5], "../Utilities/stringifySafe").default(args)})`); + } + try { + if (!callback) { + return; + } + this._successCallbacks.delete(callID); + this._failureCallbacks.delete(callID); + callback.apply(void 0, _toConsumableArray(args)); + } finally { + if (__DEV__) { + _$$_REQUIRE(_dependencyMap[7], "../Performance/Systrace").endEvent(); + } + } + } + }], [{ + key: "spy", + value: function spy(spyOrToggle) { + if (spyOrToggle === true) { + MessageQueue.prototype.__spy = function (info) { + console.log(`${info.type === TO_JS ? 'N->JS' : 'JS->N'} : ` + `${info.module != null ? info.module + '.' : ''}${info.method}` + `(${JSON.stringify(info.args)})`); + }; + } else if (spyOrToggle === false) { + MessageQueue.prototype.__spy = null; + } else { + MessageQueue.prototype.__spy = spyOrToggle; + } + } + }]); + }(); + module.exports = MessageQueue; +},40,[41,18,19,37,45,46,47,33,48],"node_modules\\react-native\\Libraries\\BatchedBridge\\MessageQueue.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _toConsumableArray(r) { + return _$$_REQUIRE(_dependencyMap[0], "./arrayWithoutHoles.js")(r) || _$$_REQUIRE(_dependencyMap[1], "./iterableToArray.js")(r) || _$$_REQUIRE(_dependencyMap[2], "./unsupportedIterableToArray.js")(r) || _$$_REQUIRE(_dependencyMap[3], "./nonIterableSpread.js")(); + } + module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},41,[42,43,10,44],"node_modules\\@babel\\runtime\\helpers\\toConsumableArray.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _arrayWithoutHoles(r) { + if (Array.isArray(r)) return _$$_REQUIRE(_dependencyMap[0], "./arrayLikeToArray.js")(r); + } + module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; +},42,[11],"node_modules\\@babel\\runtime\\helpers\\arrayWithoutHoles.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _iterableToArray(r) { + if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); + } + module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},43,[],"node_modules\\@babel\\runtime\\helpers\\iterableToArray.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports; +},44,[],"node_modules\\@babel\\runtime\\helpers\\nonIterableSpread.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var warnedKeys = {}; + + /** + * A simple function that prints a warning message once per session. + * + * @param {string} key - The key used to ensure the message is printed once. + * This should be unique to the callsite. + * @param {string} message - The message to print + */ + function warnOnce(key, message) { + if (warnedKeys[key]) { + return; + } + console.warn(message); + warnedKeys[key] = true; + } + module.exports = warnOnce; +},45,[],"node_modules\\react-native\\Libraries\\Utilities\\warnOnce.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createStringifySafeWithLimits = createStringifySafeWithLimits; + exports.default = void 0; + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "invariant")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + /** + * Tries to stringify with JSON.stringify and toString, but catches exceptions + * (e.g. from circular objects) and always returns a string and never throws. + */ + function createStringifySafeWithLimits(limits) { + var _limits$maxDepth = limits.maxDepth, + maxDepth = _limits$maxDepth === void 0 ? Number.POSITIVE_INFINITY : _limits$maxDepth, + _limits$maxStringLimi = limits.maxStringLimit, + maxStringLimit = _limits$maxStringLimi === void 0 ? Number.POSITIVE_INFINITY : _limits$maxStringLimi, + _limits$maxArrayLimit = limits.maxArrayLimit, + maxArrayLimit = _limits$maxArrayLimit === void 0 ? Number.POSITIVE_INFINITY : _limits$maxArrayLimit, + _limits$maxObjectKeys = limits.maxObjectKeysLimit, + maxObjectKeysLimit = _limits$maxObjectKeys === void 0 ? Number.POSITIVE_INFINITY : _limits$maxObjectKeys; + var stack = []; + /* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by + * Flow's LTI update could not be added via codemod */ + function replacer(key, value) { + while (stack.length && this !== stack[0]) { + stack.shift(); + } + if (typeof value === 'string') { + var truncatedString = '...(truncated)...'; + if (value.length > maxStringLimit + truncatedString.length) { + return value.substring(0, maxStringLimit) + truncatedString; + } + return value; + } + if (typeof value !== 'object' || value === null) { + return value; + } + var retval = value; + if (Array.isArray(value)) { + if (stack.length >= maxDepth) { + retval = `[ ... array with ${value.length} values ... ]`; + } else if (value.length > maxArrayLimit) { + retval = value.slice(0, maxArrayLimit).concat([`... extra ${value.length - maxArrayLimit} values truncated ...`]); + } + } else { + // Add refinement after Array.isArray call. + (0, _invariant.default)(typeof value === 'object', 'This was already found earlier'); + var keys = Object.keys(value); + if (stack.length >= maxDepth) { + retval = `{ ... object with ${keys.length} keys ... }`; + } else if (keys.length > maxObjectKeysLimit) { + // Return a sample of the keys. + retval = {}; + for (var k of keys.slice(0, maxObjectKeysLimit)) { + retval[k] = value[k]; + } + var truncatedKey = '...(truncated keys)...'; + retval[truncatedKey] = keys.length - maxObjectKeysLimit; + } + } + stack.unshift(retval); + return retval; + } + return function stringifySafe(arg) { + if (arg === undefined) { + return 'undefined'; + } else if (arg === null) { + return 'null'; + } else if (typeof arg === 'function') { + try { + return arg.toString(); + } catch (e) { + return '[function unknown]'; + } + } else if (arg instanceof Error) { + return arg.name + ': ' + arg.message; + } else { + // Perform a try catch, just in case the object has a circular + // reference or stringify throws for some other reason. + try { + var ret = JSON.stringify(arg, replacer); + if (ret === undefined) { + return '["' + typeof arg + '" failed to stringify]'; + } + return ret; + } catch (e) { + if (typeof arg.toString === 'function') { + try { + // $FlowFixMe[incompatible-use] : toString shouldn't take any arguments in general. + return arg.toString(); + } catch (E) {} + } + } + } + return '["' + typeof arg + '" failed to stringify]'; + }; + } + var stringifySafe = createStringifySafeWithLimits({ + maxDepth: 10, + maxStringLimit: 100, + maxArrayLimit: 50, + maxObjectKeysLimit: 50 + }); + var _default = exports.default = stringifySafe; +},46,[6,37],"node_modules\\react-native\\Libraries\\Utilities\\stringifySafe.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * If your application is accepting different values for the same field over + * time and is doing a diff on them, you can either (1) create a copy or + * (2) ensure that those values are not mutated behind two passes. + * This function helps you with (2) by freezing the object and throwing if + * the user subsequently modifies the value. + * + * There are two caveats with this function: + * - If the call site is not in strict mode, it will only throw when + * mutating existing fields, adding a new one + * will unfortunately fail silently :( + * - If the object is already frozen or sealed, it will not continue the + * deep traversal and will leave leaf nodes unfrozen. + * + * Freezing the object and adding the throw mechanism is expensive and will + * only be used in DEV. + */ + function deepFreezeAndThrowOnMutationInDev(object) { + if (__DEV__) { + if (typeof object !== 'object' || object === null || Object.isFrozen(object) || Object.isSealed(object)) { + return object; + } + + // $FlowFixMe[not-an-object] `object` can be an array, but Object.keys works with arrays too + var keys = Object.keys(object); + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + var _hasOwnProperty = Object.prototype.hasOwnProperty; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (_hasOwnProperty.call(object, key)) { + Object.defineProperty(object, key, { + get: identity.bind(null, object[key]) + }); + Object.defineProperty(object, key, { + set: throwOnImmutableMutation.bind(null, key) + }); + } + } + Object.freeze(object); + Object.seal(object); + for (var _i = 0; _i < keys.length; _i++) { + var _key = keys[_i]; + if (_hasOwnProperty.call(object, _key)) { + deepFreezeAndThrowOnMutationInDev(object[_key]); + } + } + } + return object; + } + + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ + function throwOnImmutableMutation(key, value) { + throw Error('You attempted to set the key `' + key + '` with the value `' + JSON.stringify(value) + '` on an object that is meant to be immutable ' + 'and has been frozen.'); + } + function identity(value) { + return value; + } + module.exports = deepFreezeAndThrowOnMutationInDev; +},47,[],"node_modules\\react-native\\Libraries\\Utilities\\deepFreezeAndThrowOnMutationInDev.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + /** + * The particular require runtime that we are using looks for a global + * `ErrorUtils` object and if it exists, then it requires modules with the + * error handler specified via ErrorUtils.setGlobalHandler by calling the + * require function with applyWithGuard. Since the require module is loaded + * before any of the modules, this ErrorUtils must be defined (and the handler + * set) globally before requiring anything. + * + * However, we still want to treat ErrorUtils as a module so that other modules + * that use it aren't just using a global variable, so simply export the global + * variable here. ErrorUtils is originally defined in a file named error-guard.js. + */ + module.exports = global.ErrorUtils; +},48,[],"node_modules\\react-native\\Libraries\\vendor\\core\\ErrorUtils.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * Defines a lazily evaluated property on the supplied `object`. + */ + function defineLazyObjectProperty(object, name, descriptor) { + var get = descriptor.get; + var enumerable = descriptor.enumerable !== false; + var writable = descriptor.writable !== false; + var value; + var valueSet = false; + function getValue() { + // WORKAROUND: A weird infinite loop occurs where calling `getValue` calls + // `setValue` which calls `Object.defineProperty` which somehow triggers + // `getValue` again. Adding `valueSet` breaks this loop. + if (!valueSet) { + // Calling `get()` here can trigger an infinite loop if it fails to + // remove the getter on the property, which can happen when executing + // JS in a V8 context. `valueSet = true` will break this loop, and + // sets the value of the property to undefined, until the code in `get()` + // finishes, at which point the property is set to the correct value. + valueSet = true; + setValue(get()); + } + return value; + } + function setValue(newValue) { + value = newValue; + valueSet = true; + Object.defineProperty(object, name, { + value: newValue, + configurable: true, + enumerable: enumerable, + writable: writable + }); + } + Object.defineProperty(object, name, { + get: getValue, + set: setValue, + configurable: true, + enumerable: enumerable + }); + } + module.exports = defineLazyObjectProperty; +},49,[],"node_modules\\react-native\\Libraries\\Utilities\\defineLazyObjectProperty.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _UIManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../ReactNative/UIManager")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + /** + * This is a function exposed to the React Renderer that can be used by the + * pre-Fabric renderer to emit accessibility events to pre-Fabric nodes. + */ + function legacySendAccessibilityEvent(reactTag, eventType) { + if (eventType === 'focus') { + _UIManager.default.sendAccessibilityEvent(reactTag, _UIManager.default.getConstants().AccessibilityEventTypes.typeViewFocused); + } + if (eventType === 'click') { + _UIManager.default.sendAccessibilityEvent(reactTag, _UIManager.default.getConstants().AccessibilityEventTypes.typeViewClicked); + } + } + module.exports = legacySendAccessibilityEvent; +},50,[6,51],"node_modules\\react-native\\Libraries\\Components\\AccessibilityInfo\\legacySendAccessibilityEvent.android.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _nullthrows = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "nullthrows")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + function isFabricReactTag(reactTag) { + // React reserves even numbers for Fabric. + return reactTag % 2 === 0; + } + var UIManagerImpl = global.RN$Bridgeless === true ? _$$_REQUIRE(_dependencyMap[2], "./BridgelessUIManager") : _$$_REQUIRE(_dependencyMap[3], "./PaperUIManager"); + + // $FlowFixMe[cannot-spread-interface] + var UIManager = Object.assign({}, UIManagerImpl, { + measure: function measure(reactTag, callback) { + if (isFabricReactTag(reactTag)) { + var FabricUIManager = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[4], "./FabricUIManager").getFabricUIManager)()); + var shadowNode = FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag); + if (shadowNode) { + FabricUIManager.measure(shadowNode, callback); + } else { + console.warn(`measure cannot find view with tag #${reactTag}`); + // $FlowFixMe[incompatible-call] + callback(); + } + } else { + // Paper + UIManagerImpl.measure(reactTag, callback); + } + }, + measureInWindow: function measureInWindow(reactTag, callback) { + if (isFabricReactTag(reactTag)) { + var FabricUIManager = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[4], "./FabricUIManager").getFabricUIManager)()); + var shadowNode = FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag); + if (shadowNode) { + FabricUIManager.measureInWindow(shadowNode, callback); + } else { + console.warn(`measure cannot find view with tag #${reactTag}`); + // $FlowFixMe[incompatible-call] + callback(); + } + } else { + // Paper + UIManagerImpl.measureInWindow(reactTag, callback); + } + }, + measureLayout: function measureLayout(reactTag, ancestorReactTag, errorCallback, callback) { + if (isFabricReactTag(reactTag)) { + var FabricUIManager = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[4], "./FabricUIManager").getFabricUIManager)()); + var shadowNode = FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag); + var ancestorShadowNode = FabricUIManager.findShadowNodeByTag_DEPRECATED(ancestorReactTag); + if (!shadowNode || !ancestorShadowNode) { + return; + } + FabricUIManager.measureLayout(shadowNode, ancestorShadowNode, errorCallback, callback); + } else { + // Paper + UIManagerImpl.measureLayout(reactTag, ancestorReactTag, errorCallback, callback); + } + }, + measureLayoutRelativeToParent: function measureLayoutRelativeToParent(reactTag, errorCallback, callback) { + if (isFabricReactTag(reactTag)) { + console.warn('RCTUIManager.measureLayoutRelativeToParent method is deprecated and it will not be implemented in newer versions of RN (Fabric) - T47686450'); + var FabricUIManager = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[4], "./FabricUIManager").getFabricUIManager)()); + var shadowNode = FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag); + if (shadowNode) { + FabricUIManager.measure(shadowNode, function (left, top, width, height, pageX, pageY) { + callback(left, top, width, height); + }); + } + } else { + // Paper + UIManagerImpl.measureLayoutRelativeToParent(reactTag, errorCallback, callback); + } + }, + dispatchViewManagerCommand: function dispatchViewManagerCommand(reactTag, commandName, commandArgs) { + // Sometimes, libraries directly pass in the output of `findNodeHandle` to + // this function without checking if it's null. This guards against that + // case. We throw early here in Javascript so we can get a JS stacktrace + // instead of a harder-to-debug native Java or Objective-C stacktrace. + if (typeof reactTag !== 'number') { + throw new Error('dispatchViewManagerCommand: found null reactTag'); + } + if (isFabricReactTag(reactTag)) { + var FabricUIManager = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[4], "./FabricUIManager").getFabricUIManager)()); + var shadowNode = FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag); + if (shadowNode) { + // Transform the accidental CommandID into a CommandName which is the stringified number. + // The interop layer knows how to convert this number into the right method name. + // Stringify a string is a no-op, so it's safe. + commandName = `${commandName}`; + FabricUIManager.dispatchCommand(shadowNode, commandName, commandArgs); + } + } else { + UIManagerImpl.dispatchViewManagerCommand(reactTag, + // We have some legacy components that are actually already using strings. ¯\_(ツ)_/¯ + // $FlowFixMe[incompatible-call] + commandName, commandArgs); + } + } + }); + module.exports = UIManager; +},51,[6,52,53,55,58],"node_modules\\react-native\\Libraries\\ReactNative\\UIManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function nullthrows(x, message) { + if (x != null) { + return x; + } + var error = new Error(message !== undefined ? message : 'Got unexpected ' + x); + error.framesToPop = 1; // Skip nullthrows's own stack frame. + throw error; + } + module.exports = nullthrows; + module.exports.default = nullthrows; + Object.defineProperty(module.exports, '__esModule', { + value: true + }); +},52,[],"node_modules\\nullthrows\\nullthrows.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var cachedConstants = null; + var errorMessageForMethod = function errorMessageForMethod(methodName) { + return "[ReactNative Architecture][JS] '" + methodName + "' is not available in the new React Native architecture."; + }; + function nativeViewConfigsInBridgelessModeEnabled() { + return global.RN$LegacyInterop_UIManager_getConstants !== undefined; + } + function getCachedConstants() { + if (!cachedConstants) { + cachedConstants = global.RN$LegacyInterop_UIManager_getConstants(); + } + return cachedConstants; + } + var UIManagerJS = { + getViewManagerConfig: function getViewManagerConfig(viewManagerName) { + if (nativeViewConfigsInBridgelessModeEnabled()) { + return getCachedConstants()[viewManagerName]; + } else { + console.error(errorMessageForMethod('getViewManagerConfig') + 'Use hasViewManagerConfig instead. viewManagerName: ' + viewManagerName); + return null; + } + }, + hasViewManagerConfig: function hasViewManagerConfig(viewManagerName) { + return (0, _$$_REQUIRE(_dependencyMap[0], "../NativeComponent/NativeComponentRegistryUnstable").unstable_hasComponent)(viewManagerName); + }, + getConstants: function getConstants() { + if (nativeViewConfigsInBridgelessModeEnabled()) { + return getCachedConstants(); + } else { + console.error(errorMessageForMethod('getConstants')); + return null; + } + }, + getConstantsForViewManager: function getConstantsForViewManager(viewManagerName) { + console.error(errorMessageForMethod('getConstantsForViewManager')); + return {}; + }, + getDefaultEventTypes: function getDefaultEventTypes() { + console.error(errorMessageForMethod('getDefaultEventTypes')); + return []; + }, + lazilyLoadView: function lazilyLoadView(name) { + console.error(errorMessageForMethod('lazilyLoadView')); + return {}; + }, + createView: function createView(reactTag, viewName, rootTag, props) { + return console.error(errorMessageForMethod('createView')); + }, + updateView: function updateView(reactTag, viewName, props) { + return console.error(errorMessageForMethod('updateView')); + }, + focus: function focus(reactTag) { + return console.error(errorMessageForMethod('focus')); + }, + blur: function blur(reactTag) { + return console.error(errorMessageForMethod('blur')); + }, + findSubviewIn: function findSubviewIn(reactTag, point, callback) { + return console.error(errorMessageForMethod('findSubviewIn')); + }, + dispatchViewManagerCommand: function dispatchViewManagerCommand(reactTag, commandID, commandArgs) { + return console.error(errorMessageForMethod('dispatchViewManagerCommand')); + }, + measure: function measure(reactTag, callback) { + return console.error(errorMessageForMethod('measure')); + }, + measureInWindow: function measureInWindow(reactTag, callback) { + return console.error(errorMessageForMethod('measureInWindow')); + }, + viewIsDescendantOf: function viewIsDescendantOf(reactTag, ancestorReactTag, callback) { + return console.error(errorMessageForMethod('viewIsDescendantOf')); + }, + measureLayout: function measureLayout(reactTag, ancestorReactTag, errorCallback, callback) { + return console.error(errorMessageForMethod('measureLayout')); + }, + measureLayoutRelativeToParent: function measureLayoutRelativeToParent(reactTag, errorCallback, callback) { + return console.error(errorMessageForMethod('measureLayoutRelativeToParent')); + }, + setJSResponder: function setJSResponder(reactTag, blockNativeResponder) { + return console.error(errorMessageForMethod('setJSResponder')); + }, + clearJSResponder: function clearJSResponder() {}, + // Don't log error here because we're aware it gets called + configureNextLayoutAnimation: function configureNextLayoutAnimation(config, callback, errorCallback) { + return console.error(errorMessageForMethod('configureNextLayoutAnimation')); + }, + removeSubviewsFromContainerWithID: function removeSubviewsFromContainerWithID(containerID) { + return console.error(errorMessageForMethod('removeSubviewsFromContainerWithID')); + }, + replaceExistingNonRootView: function replaceExistingNonRootView(reactTag, newReactTag) { + return console.error(errorMessageForMethod('replaceExistingNonRootView')); + }, + setChildren: function setChildren(containerTag, reactTags) { + return console.error(errorMessageForMethod('setChildren')); + }, + manageChildren: function manageChildren(containerTag, moveFromIndices, moveToIndices, addChildReactTags, addAtIndices, removeAtIndices) { + return console.error(errorMessageForMethod('manageChildren')); + }, + // Android only + setLayoutAnimationEnabledExperimental: function setLayoutAnimationEnabledExperimental(enabled) { + console.error(errorMessageForMethod('setLayoutAnimationEnabledExperimental')); + }, + // Please use AccessibilityInfo.sendAccessibilityEvent instead. + // See SetAccessibilityFocusExample in AccessibilityExample.js for a migration example. + sendAccessibilityEvent: function sendAccessibilityEvent(reactTag, eventType) { + return console.error(errorMessageForMethod('sendAccessibilityEvent')); + }, + showPopupMenu: function showPopupMenu(reactTag, items, error, success) { + return console.error(errorMessageForMethod('showPopupMenu')); + }, + dismissPopupMenu: function dismissPopupMenu() { + return console.error(errorMessageForMethod('dismissPopupMenu')); + } + }; + if (nativeViewConfigsInBridgelessModeEnabled()) { + Object.keys(getCachedConstants()).forEach(function (viewConfigName) { + UIManagerJS[viewConfigName] = getCachedConstants()[viewConfigName]; + }); + } + module.exports = UIManagerJS; +},53,[54],"node_modules\\react-native\\Libraries\\ReactNative\\BridgelessUIManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.unstable_hasComponent = unstable_hasComponent; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var componentNameToExists = new Map(); + + /** + * Unstable API. Do not use! + * + * This method returns if the component with name received as a parameter + * is registered in the native platform. + */ + function unstable_hasComponent(name) { + var hasNativeComponent = componentNameToExists.get(name); + if (hasNativeComponent == null) { + if (global.__nativeComponentRegistry__hasComponent) { + hasNativeComponent = global.__nativeComponentRegistry__hasComponent(name); + componentNameToExists.set(name, hasNativeComponent); + } else { + throw `unstable_hasComponent('${name}'): Global function is not registered`; + } + } + return hasNativeComponent; + } +},54,[],"node_modules\\react-native\\Libraries\\NativeComponent\\NativeComponentRegistryUnstable.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _NativeUIManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./NativeUIManager")); /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var viewManagerConfigs = {}; + var triedLoadingConfig = new Set(); + var NativeUIManagerConstants = {}; + var isNativeUIManagerConstantsSet = false; + function _getConstants() { + if (!isNativeUIManagerConstantsSet) { + NativeUIManagerConstants = _NativeUIManager.default.getConstants(); + isNativeUIManagerConstantsSet = true; + } + return NativeUIManagerConstants; + } + function _getViewManagerConfig(viewManagerName) { + if (viewManagerConfigs[viewManagerName] === undefined && global.nativeCallSyncHook && + // If we're in the Chrome Debugger, let's not even try calling the sync method + _NativeUIManager.default.getConstantsForViewManager) { + try { + viewManagerConfigs[viewManagerName] = _NativeUIManager.default.getConstantsForViewManager(viewManagerName); + } catch (e) { + console.error("NativeUIManager.getConstantsForViewManager('" + viewManagerName + "') threw an exception.", e); + viewManagerConfigs[viewManagerName] = null; + } + } + var config = viewManagerConfigs[viewManagerName]; + if (config) { + return config; + } + + // If we're in the Chrome Debugger, let's not even try calling the sync + // method. + if (!global.nativeCallSyncHook) { + return config; + } + if (_NativeUIManager.default.lazilyLoadView && !triedLoadingConfig.has(viewManagerName)) { + var result = _NativeUIManager.default.lazilyLoadView(viewManagerName); + triedLoadingConfig.add(viewManagerName); + if (result != null && result.viewConfig != null) { + _getConstants()[viewManagerName] = result.viewConfig; + lazifyViewManagerConfig(viewManagerName); + } + } + return viewManagerConfigs[viewManagerName]; + } + + /* $FlowFixMe[cannot-spread-interface] (>=0.123.0 site=react_native_fb) This + * comment suppresses an error found when Flow v0.123.0 was deployed. To see + * the error, delete this comment and run Flow. */ + var UIManagerJS = Object.assign({}, _NativeUIManager.default, { + createView: function createView(reactTag, viewName, rootTag, props) { + if ("android" === 'ios' && viewManagerConfigs[viewName] === undefined) { + // This is necessary to force the initialization of native viewManager + // classes in iOS when using static ViewConfigs + _getViewManagerConfig(viewName); + } + _NativeUIManager.default.createView(reactTag, viewName, rootTag, props); + }, + getConstants: function getConstants() { + return _getConstants(); + }, + getViewManagerConfig: function getViewManagerConfig(viewManagerName) { + return _getViewManagerConfig(viewManagerName); + }, + hasViewManagerConfig: function hasViewManagerConfig(viewManagerName) { + return _getViewManagerConfig(viewManagerName) != null; + } + }); + + // TODO (T45220498): Remove this. + // 3rd party libs may be calling `NativeModules.UIManager.getViewManagerConfig()` + // instead of `UIManager.getViewManagerConfig()` off UIManager.js. + // This is a workaround for now. + // $FlowFixMe[prop-missing] + _NativeUIManager.default.getViewManagerConfig = UIManagerJS.getViewManagerConfig; + function lazifyViewManagerConfig(viewName) { + var viewConfig = _getConstants()[viewName]; + viewManagerConfigs[viewName] = viewConfig; + if (viewConfig.Manager) { + _$$_REQUIRE(_dependencyMap[2], "../Utilities/defineLazyObjectProperty")(viewConfig, 'Constants', { + get: function get() { + var viewManager = _$$_REQUIRE(_dependencyMap[3], "../BatchedBridge/NativeModules")[viewConfig.Manager]; + var constants = {}; + viewManager && Object.keys(viewManager).forEach(function (key) { + var value = viewManager[key]; + if (typeof value !== 'function') { + constants[key] = value; + } + }); + return constants; + } + }); + _$$_REQUIRE(_dependencyMap[2], "../Utilities/defineLazyObjectProperty")(viewConfig, 'Commands', { + get: function get() { + var viewManager = _$$_REQUIRE(_dependencyMap[3], "../BatchedBridge/NativeModules")[viewConfig.Manager]; + var commands = {}; + var index = 0; + viewManager && Object.keys(viewManager).forEach(function (key) { + var value = viewManager[key]; + if (typeof value === 'function') { + commands[key] = index++; + } + }); + return commands; + } + }); + } + } + + /** + * Copies the ViewManager constants and commands into UIManager. This is + * only needed for iOS, which puts the constants in the ViewManager + * namespace instead of UIManager, unlike Android. + */ + if ("android" === 'ios') { + Object.keys(_getConstants()).forEach(function (viewName) { + lazifyViewManagerConfig(viewName); + }); + } else if (_getConstants().ViewManagerNames) { + _NativeUIManager.default.getConstants().ViewManagerNames.forEach(function (viewManagerName) { + _$$_REQUIRE(_dependencyMap[2], "../Utilities/defineLazyObjectProperty")(_NativeUIManager.default, viewManagerName, { + get: function get() { + return _NativeUIManager.default.getConstantsForViewManager(viewManagerName); + } + }); + }); + } + if (!global.nativeCallSyncHook) { + Object.keys(_getConstants()).forEach(function (viewManagerName) { + if (!_$$_REQUIRE(_dependencyMap[4], "./UIManagerProperties").includes(viewManagerName)) { + if (!viewManagerConfigs[viewManagerName]) { + viewManagerConfigs[viewManagerName] = _getConstants()[viewManagerName]; + } + _$$_REQUIRE(_dependencyMap[2], "../Utilities/defineLazyObjectProperty")(_NativeUIManager.default, viewManagerName, { + get: function get() { + console.warn(`Accessing view manager configs directly off UIManager via UIManager['${viewManagerName}'] ` + `is no longer supported. Use UIManager.getViewManagerConfig('${viewManagerName}') instead.`); + return UIManagerJS.getViewManagerConfig(viewManagerName); + } + }); + } + }); + } + module.exports = UIManagerJS; +},55,[6,56,49,38,57],"node_modules\\react-native\\Libraries\\ReactNative\\PaperUIManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.getEnforcing('UIManager'); +},56,[36],"node_modules\\react-native\\Libraries\\ReactNative\\NativeUIManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + /** + * The list of non-ViewManager related UIManager properties. + * + * In an effort to improve startup performance by lazily loading view managers, + * the interface to access view managers will change from + * UIManager['viewManagerName'] to UIManager.getViewManagerConfig('viewManagerName'). + * By using a function call instead of a property access, the UIManager will + * be able to initialize and load the required view manager from native + * synchronously. All of React Native's core components have been updated to + * use getViewManagerConfig(). For the next few releases, any usage of + * UIManager['viewManagerName'] will result in a warning. Because React Native + * does not support Proxy objects, a view manager access is implied if any of + * UIManager's properties that are not one of the properties below is being + * accessed. Once UIManager property accesses for view managers has been fully + * deprecated, this file will also be removed. + */ + module.exports = ['clearJSResponder', 'configureNextLayoutAnimation', 'createView', 'dismissPopupMenu', 'dispatchViewManagerCommand', 'findSubviewIn', 'getConstantsForViewManager', 'getDefaultEventTypes', 'manageChildren', 'measure', 'measureInWindow', 'measureLayout', 'measureLayoutRelativeToParent', 'removeRootView', 'removeSubviewsFromContainerWithID', 'replaceExistingNonRootView', 'sendAccessibilityEvent', 'setChildren', 'setJSResponder', 'setLayoutAnimationEnabledExperimental', 'showPopupMenu', 'updateView', 'viewIsDescendantOf', 'PopupMenu', 'LazyViewManagersEnabled', 'ViewManagerNames', 'StyleConstants', 'AccessibilityEventTypes', 'UIView', 'getViewManagerConfig', 'hasViewManagerConfig', 'blur', 'focus', 'genericBubblingEventTypes', 'genericDirectEventTypes', 'lazilyLoadView']; +},57,[],"node_modules\\react-native\\Libraries\\ReactNative\\UIManagerProperties.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getFabricUIManager = getFabricUIManager; + var _defineLazyObjectProperty = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../Utilities/defineLazyObjectProperty")); + var nativeFabricUIManagerProxy; + + // This is a list of all the methods in global.nativeFabricUIManager that we'll + // cache in JavaScript, as the current implementation of the binding + // creates a new host function every time methods are accessed. + var CACHED_PROPERTIES = ['createNode', 'cloneNode', 'cloneNodeWithNewChildren', 'cloneNodeWithNewProps', 'cloneNodeWithNewChildrenAndProps', 'createChildSet', 'appendChild', 'appendChildToSet', 'completeRoot', 'measure', 'measureInWindow', 'measureLayout', 'configureNextLayoutAnimation', 'sendAccessibilityEvent', 'findShadowNodeByTag_DEPRECATED', 'setNativeProps', 'dispatchCommand', 'getParentNode', 'getChildNodes', 'isConnected', 'compareDocumentPosition', 'getTextContent', 'getBoundingClientRect', 'getOffset', 'getScrollPosition', 'getScrollSize', 'getInnerSize', 'getBorderSize', 'getTagName', 'hasPointerCapture', 'setPointerCapture', 'releasePointerCapture']; + + // This is exposed as a getter because apps using the legacy renderer AND + // Fabric can define the binding lazily. If we evaluated the global and cached + // it in the module we might be caching an `undefined` value before it is set. + function getFabricUIManager() { + if (nativeFabricUIManagerProxy == null && global.nativeFabricUIManager != null) { + nativeFabricUIManagerProxy = createProxyWithCachedProperties(global.nativeFabricUIManager, CACHED_PROPERTIES); + } + return nativeFabricUIManagerProxy; + } + + /** + * + * Returns an object that caches the specified properties the first time they + * are accessed, and falls back to the original object for other properties. + */ + function createProxyWithCachedProperties(implementation, propertiesToCache) { + var proxy = Object.create(implementation); + var _loop = function _loop(propertyName) { + (0, _defineLazyObjectProperty.default)(proxy, propertyName, { + // $FlowExpectedError[prop-missing] + get: function get() { + return implementation[propertyName]; + } + }); + }; + for (var propertyName of propertiesToCache) { + _loop(propertyName); + } + return proxy; + } +},58,[6,49],"node_modules\\react-native\\Libraries\\ReactNative\\FabricUIManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('AccessibilityInfo'); +},59,[36],"node_modules\\react-native\\Libraries\\Components\\AccessibilityInfo\\NativeAccessibilityInfo.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('AccessibilityManager'); +},60,[36],"node_modules\\react-native\\Libraries\\Components\\AccessibilityInfo\\NativeAccessibilityManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0], "./RendererImplementation")).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0], "./RendererImplementation")[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0], "./RendererImplementation")[key]; + } + }); + }); +},61,[62],"node_modules\\react-native\\Libraries\\ReactNative\\RendererProxy.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.dispatchCommand = dispatchCommand; + exports.findHostInstance_DEPRECATED = findHostInstance_DEPRECATED; + exports.findNodeHandle = findNodeHandle; + exports.isProfilingRenderer = isProfilingRenderer; + exports.renderElement = renderElement; + exports.sendAccessibilityEvent = sendAccessibilityEvent; + exports.unmountComponentAtNodeAndRemoveContainer = unmountComponentAtNodeAndRemoveContainer; + exports.unstable_batchedUpdates = unstable_batchedUpdates; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + function renderElement(_ref) { + var element = _ref.element, + rootTag = _ref.rootTag, + useFabric = _ref.useFabric, + useConcurrentRoot = _ref.useConcurrentRoot; + if (useFabric) { + _$$_REQUIRE(_dependencyMap[0], "../Renderer/shims/ReactFabric").render(element, rootTag, null, useConcurrentRoot); + } else { + _$$_REQUIRE(_dependencyMap[1], "../Renderer/shims/ReactNative").render(element, rootTag); + } + } + function findHostInstance_DEPRECATED(componentOrHandle) { + return _$$_REQUIRE(_dependencyMap[1], "../Renderer/shims/ReactNative").findHostInstance_DEPRECATED(componentOrHandle); + } + function findNodeHandle(componentOrHandle) { + return _$$_REQUIRE(_dependencyMap[1], "../Renderer/shims/ReactNative").findNodeHandle(componentOrHandle); + } + function dispatchCommand(handle, command, args) { + if (global.RN$Bridgeless === true) { + // Note: this function has the same implementation in the legacy and new renderer. + // However, evaluating the old renderer comes with some side effects. + return _$$_REQUIRE(_dependencyMap[0], "../Renderer/shims/ReactFabric").dispatchCommand(handle, command, args); + } else { + return _$$_REQUIRE(_dependencyMap[1], "../Renderer/shims/ReactNative").dispatchCommand(handle, command, args); + } + } + function sendAccessibilityEvent(handle, eventType) { + return _$$_REQUIRE(_dependencyMap[1], "../Renderer/shims/ReactNative").sendAccessibilityEvent(handle, eventType); + } + + /** + * This method is used by AppRegistry to unmount a root when using the old + * React Native renderer (Paper). + */ + function unmountComponentAtNodeAndRemoveContainer(rootTag) { + // $FlowExpectedError[incompatible-type] rootTag is an opaque type so we can't really cast it as is. + var rootTagAsNumber = rootTag; + _$$_REQUIRE(_dependencyMap[1], "../Renderer/shims/ReactNative").unmountComponentAtNodeAndRemoveContainer(rootTagAsNumber); + } + function unstable_batchedUpdates(fn, bookkeeping) { + // This doesn't actually do anything when batching updates for a Fabric root. + return _$$_REQUIRE(_dependencyMap[1], "../Renderer/shims/ReactNative").unstable_batchedUpdates(fn, bookkeeping); + } + function isProfilingRenderer() { + return Boolean(__DEV__); + } +},62,[63,437],"node_modules\\react-native\\Libraries\\ReactNative\\RendererImplementation.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @noformat + * + * @nolint + * @generated SignedSource<> + */ + + 'use strict'; + + var ReactFabric; + if (__DEV__) { + ReactFabric = _$$_REQUIRE(_dependencyMap[0], "../implementations/ReactFabric-dev"); + } else { + ReactFabric = _$$_REQUIRE(_dependencyMap[1], "../implementations/ReactFabric-prod"); + } + global.RN$stopSurface = ReactFabric.stopSurface; + if (global.RN$Bridgeless !== true) { + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").BatchedBridge.registerCallableModule('ReactFabric', ReactFabric); + } + module.exports = ReactFabric; +},63,[64,489,279],"node_modules\\react-native\\Libraries\\Renderer\\shims\\ReactFabric.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * 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. + * + * + * @nolint + * @providesModule ReactFabric-dev + * @preventMunge + * @generated SignedSource<<343bc15819bccf8610b6ff32fcb59b21>> + */ + + 'use strict'; + + if (__DEV__) { + (function () { + 'use strict'; + + /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === 'function') { + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); + } + "use strict"; + var React = _$$_REQUIRE(_dependencyMap[0], "react"); + _$$_REQUIRE(_dependencyMap[1], "react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore"); + var ReactNativePrivateInterface = _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface"); + var Scheduler = _$$_REQUIRE(_dependencyMap[3], "scheduler"); + var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + + // by calls to these methods by a Babel plugin. + // + // In PROD (or in packages without access to React internals), + // they are left as they are instead. + + function warn(format) { + { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + printWarning("warn", format, args); + } + } + } + function error(format) { + { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + printWarning("error", format, args); + } + } + } + function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + if (stack !== "") { + format += "%s"; + args = args.concat([stack]); + } // eslint-disable-next-line react-internal/safe-string-coercion + + var argsWithFormat = args.map(function (item) { + return String(item); + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift("Warning: " + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } + } + function invokeGuardedCallbackProd(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 invokeGuardedCallbackImpl = invokeGuardedCallbackProd; + { + // In DEV mode, we swap out invokeGuardedCallback for a special version + // that plays more nicely with the browser's DevTools. The idea is to preserve + // "Pause on exceptions" behavior. Because React wraps all user-provided + // functions in invokeGuardedCallback, and the production version of + // invokeGuardedCallback uses a try-catch, all user exceptions are treated + // like caught exceptions, and the DevTools won't pause unless the developer + // takes the extra step of enabling pause on caught exceptions. This is + // unintuitive, though, because even though React has caught the error, from + // the developer's perspective, the error is uncaught. + // + // To preserve the expected "Pause on exceptions" behavior, we don't use a + // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake + // DOM node, and call the user-provided callback from inside an event handler + // for that fake event. If the callback throws, the error is "captured" using + // a global event handler. But because the error happens in a different + // event loop context, it does not interrupt the normal program flow. + // Effectively, this gives us try-catch behavior without actually using + // try-catch. Neat! + // Check that the browser supports the APIs we need to implement our special + // DEV version of invokeGuardedCallback + if (typeof window !== "undefined" && typeof window.dispatchEvent === "function" && typeof document !== "undefined" && typeof document.createEvent === "function") { + var fakeNode = document.createElement("react"); + invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) { + // If document doesn't exist we know for sure we will crash in this method + // when we call document.createEvent(). However this can cause confusing + // errors: https://github.com/facebook/create-react-app/issues/3482 + // So we preemptively throw with a better message instead. + if (typeof document === "undefined" || document === null) { + throw new Error("The `document` global was defined when React was initialized, but is not " + "defined anymore. This can happen in a test environment if a component " + "schedules an update from an asynchronous callback, but the test has already " + "finished running. To solve this, you can either unmount the component at " + "the end of your test (and ensure that any asynchronous operations get " + "canceled in `componentWillUnmount`), or you can change the test itself " + "to be asynchronous."); + } + var evt = document.createEvent("Event"); + var didCall = false; // Keeps track of whether the user-provided callback threw an error. We + // set this to true at the beginning, then set it to false right after + // calling the function. If the function errors, `didError` will never be + // set to false. This strategy works even if the browser is flaky and + // fails to call our global error handler, because it doesn't rely on + // the error event at all. + + var didError = true; // Keeps track of the value of window.event so that we can reset it + // during the callback to let user code access window.event in the + // browsers that support it. + + var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event + // dispatching: https://github.com/facebook/react/issues/13688 + + var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, "event"); + function restoreAfterDispatch() { + // We immediately remove the callback from event listeners so that + // nested `invokeGuardedCallback` calls do not clash. Otherwise, a + // nested call would trigger the fake event handlers of any call higher + // in the stack. + fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the + // window.event assignment in both IE <= 10 as they throw an error + // "Member not found" in strict mode, and in Firefox which does not + // support window.event. + + if (typeof window.event !== "undefined" && window.hasOwnProperty("event")) { + window.event = windowEvent; + } + } // Create an event handler for our fake event. We will synchronously + // dispatch our fake event using `dispatchEvent`. Inside the handler, we + // call the user-provided callback. + + var funcArgs = Array.prototype.slice.call(arguments, 3); + function callCallback() { + didCall = true; + restoreAfterDispatch(); + func.apply(context, funcArgs); + didError = false; + } // Create a global error event handler. We use this to capture the value + // that was thrown. It's possible that this error handler will fire more + // than once; for example, if non-React code also calls `dispatchEvent` + // and a handler for that event throws. We should be resilient to most of + // those cases. Even if our error event handler fires more than once, the + // last error event is always used. If the callback actually does error, + // we know that the last error event is the correct one, because it's not + // possible for anything else to have happened in between our callback + // erroring and the code that follows the `dispatchEvent` call below. If + // the callback doesn't error, but the error event was fired, we know to + // ignore it because `didError` will be false, as described above. + + var error; // Use this to track whether the error event is ever called. + + var didSetError = false; + var isCrossOriginError = false; + function handleWindowError(event) { + error = event.error; + didSetError = true; + if (error === null && event.colno === 0 && event.lineno === 0) { + isCrossOriginError = true; + } + if (event.defaultPrevented) { + // Some other error handler has prevented default. + // Browsers silence the error report if this happens. + // We'll remember this to later decide whether to log it or not. + if (error != null && typeof error === "object") { + try { + error._suppressLogging = true; + } catch (inner) { + // Ignore. + } + } + } + } // Create a fake event type. + + var evtType = "react-" + (name ? name : "invokeguardedcallback"); // Attach our event handlers + + window.addEventListener("error", handleWindowError); + fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function + // errors, it will trigger our global error handler. + + evt.initEvent(evtType, false, false); + fakeNode.dispatchEvent(evt); + if (windowEventDescriptor) { + Object.defineProperty(window, "event", windowEventDescriptor); + } + if (didCall && didError) { + if (!didSetError) { + // The callback errored, but the error event never fired. + // eslint-disable-next-line react-internal/prod-error-codes + error = new Error("An error was thrown inside one of your components, but React " + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + "your browser. Try triggering the error in production mode, " + "or switching to a modern browser. If you suspect that this is " + "actually an issue with React, please file an issue."); + } else if (isCrossOriginError) { + // eslint-disable-next-line react-internal/prod-error-codes + error = new Error("A cross-origin error was thrown. React doesn't have access to " + "the actual error object in development. " + "See https://react.dev/link/crossorigin-error for more information."); + } + this.onError(error); + } // Remove our event listeners + + window.removeEventListener("error", handleWindowError); + if (!didCall) { + // Something went really wrong, and our event was not dispatched. + // https://github.com/facebook/react/issues/16734 + // https://github.com/facebook/react/issues/16585 + // Fall back to the production implementation. + restoreAfterDispatch(); + return invokeGuardedCallbackProd.apply(this, arguments); + } + }; + } + } + var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl; + var hasError = false; + var caughtError = null; // Used by event system to capture/rethrow the first error. + + var hasRethrowError = false; + var rethrowError = null; + var reporter = { + onError: function onError(error) { + hasError = true; + caughtError = error; + } + }; + /** + * Call a function while guarding against errors that happens within it. + * Returns an error if it throws, otherwise null. + * + * In production, this is implemented using a try-catch. The reason we don't + * use a try-catch directly is so that we can swap out a different + * implementation in DEV mode. + * + * @param {String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} context The context to use when calling the function + * @param {...*} args Arguments for function + */ + + function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { + hasError = false; + caughtError = null; + invokeGuardedCallbackImpl$1.apply(reporter, arguments); + } + /** + * Same as invokeGuardedCallback, but instead of returning an error, it stores + * it in a global so it can be rethrown by `rethrowCaughtError` later. + * TODO: See if caughtError and rethrowError can be unified. + * + * @param {String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} context The context to use when calling the function + * @param {...*} args Arguments for function + */ + + function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) { + invokeGuardedCallback.apply(this, arguments); + if (hasError) { + var error = clearCaughtError(); + if (!hasRethrowError) { + hasRethrowError = true; + rethrowError = error; + } + } + } + /** + * During execution of guarded functions we will capture the first error which + * we will rethrow to be handled by the top level error handler. + */ + + function rethrowCaughtError() { + if (hasRethrowError) { + var error = rethrowError; + hasRethrowError = false; + rethrowError = null; + throw error; + } + } + function hasCaughtError() { + return hasError; + } + function clearCaughtError() { + if (hasError) { + var error = caughtError; + hasError = false; + caughtError = null; + return error; + } else { + throw new Error("clearCaughtError was called but no error was captured. This error " + "is likely caused by a bug in React. Please file an issue."); + } + } + var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare + + function isArray(a) { + return isArrayImpl(a); + } + var getFiberCurrentPropsFromNode = null; + var getInstanceFromNode = null; + var getNodeFromInstance = null; + function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) { + getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl; + getInstanceFromNode = getInstanceFromNodeImpl; + getNodeFromInstance = getNodeFromInstanceImpl; + { + if (!getNodeFromInstance || !getInstanceFromNode) { + error("EventPluginUtils.setComponentTree(...): Injected " + "module is missing getNodeFromInstance or getInstanceFromNode."); + } + } + } + var validateEventDispatches; + { + validateEventDispatches = function validateEventDispatches(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + var listenersIsArr = isArray(dispatchListeners); + var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; + var instancesIsArr = isArray(dispatchInstances); + var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; + if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) { + error("EventPluginUtils: Invalid `event`."); + } + }; + } + /** + * Dispatch the event to the listener. + * @param {SyntheticEvent} event SyntheticEvent to handle + * @param {function} listener Application-level callback + * @param {*} inst Internal component instance + */ + + function executeDispatch(event, listener, inst) { + var type = event.type || "unknown-event"; + event.currentTarget = getNodeFromInstance(inst); + invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); + event.currentTarget = null; + } + /** + * Standard/simple iteration through an event's collected dispatches. + */ + + function executeDispatchesInOrder(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + { + validateEventDispatches(event); + } + if (isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } // Listeners and Instances are two parallel arrays that are always in sync. + + executeDispatch(event, dispatchListeners[i], dispatchInstances[i]); + } + } else if (dispatchListeners) { + executeDispatch(event, dispatchListeners, dispatchInstances); + } + event._dispatchListeners = null; + event._dispatchInstances = null; + } + /** + * Standard/simple iteration through an event's collected dispatches, but stops + * at the first dispatch execution returning true, and returns that id. + * + * @return {?string} id of the first dispatch execution who's listener returns + * true, or null if no listener returned true. + */ + + function executeDispatchesInOrderStopAtTrueImpl(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + { + validateEventDispatches(event); + } + if (isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } // Listeners and Instances are two parallel arrays that are always in sync. + + if (dispatchListeners[i](event, dispatchInstances[i])) { + return dispatchInstances[i]; + } + } + } else if (dispatchListeners) { + if (dispatchListeners(event, dispatchInstances)) { + return dispatchInstances; + } + } + return null; + } + /** + * @see executeDispatchesInOrderStopAtTrueImpl + */ + + function executeDispatchesInOrderStopAtTrue(event) { + var ret = executeDispatchesInOrderStopAtTrueImpl(event); + event._dispatchInstances = null; + event._dispatchListeners = null; + return ret; + } + /** + * Execution of a "direct" dispatch - there must be at most one dispatch + * accumulated on the event or it is considered an error. It doesn't really make + * sense for an event with multiple dispatches (bubbled) to keep track of the + * return values at each dispatch execution, but it does tend to make sense when + * dealing with "direct" dispatches. + * + * @return {*} The return value of executing the single dispatch. + */ + + function executeDirectDispatch(event) { + { + validateEventDispatches(event); + } + var dispatchListener = event._dispatchListeners; + var dispatchInstance = event._dispatchInstances; + if (isArray(dispatchListener)) { + throw new Error("executeDirectDispatch(...): Invalid `event`."); + } + event.currentTarget = dispatchListener ? getNodeFromInstance(dispatchInstance) : null; + var res = dispatchListener ? dispatchListener(event) : null; + event.currentTarget = null; + event._dispatchListeners = null; + event._dispatchInstances = null; + return res; + } + /** + * @param {SyntheticEvent} event + * @return {boolean} True iff number of dispatches accumulated is greater than 0. + */ + + function hasDispatches(event) { + return !!event._dispatchListeners; + } + var assign = Object.assign; + var EVENT_POOL_SIZE = 10; + /** + * @interface Event + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + + var EventInterface = { + type: null, + target: null, + // currentTarget is set when dispatching; no use in copying it here + currentTarget: function currentTarget() { + return null; + }, + eventPhase: null, + bubbles: null, + cancelable: null, + timeStamp: function timeStamp(event) { + return event.timeStamp || Date.now(); + }, + defaultPrevented: null, + isTrusted: null + }; + function functionThatReturnsTrue() { + return true; + } + function functionThatReturnsFalse() { + return false; + } + /** + * Synthetic events are dispatched by event plugins, typically in response to a + * top-level event delegation handler. + * + * These systems should generally use pooling to reduce the frequency of garbage + * collection. The system should check `isPersistent` to determine whether the + * event should be released into the pool after being dispatched. Users that + * need a persisted event should invoke `persist`. + * + * Synthetic events (and subclasses) implement the DOM Level 3 Events API by + * normalizing browser quirks. Subclasses do not necessarily have to implement a + * DOM interface; custom application-specific events can also subclass this. + * + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {*} targetInst Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @param {DOMEventTarget} nativeEventTarget Target node. + */ + + function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { + { + // these have a getter/setter for warnings + delete this.nativeEvent; + delete this.preventDefault; + delete this.stopPropagation; + delete this.isDefaultPrevented; + delete this.isPropagationStopped; + } + this.dispatchConfig = dispatchConfig; + this._targetInst = targetInst; + this.nativeEvent = nativeEvent; + this._dispatchListeners = null; + this._dispatchInstances = null; + var Interface = this.constructor.Interface; + for (var propName in Interface) { + if (!Interface.hasOwnProperty(propName)) { + continue; + } + { + delete this[propName]; // this has a getter/setter for warnings + } + var normalize = Interface[propName]; + if (normalize) { + this[propName] = normalize(nativeEvent); + } else { + if (propName === "target") { + this.target = nativeEventTarget; + } else { + this[propName] = nativeEvent[propName]; + } + } + } + var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false; + if (defaultPrevented) { + this.isDefaultPrevented = functionThatReturnsTrue; + } else { + this.isDefaultPrevented = functionThatReturnsFalse; + } + this.isPropagationStopped = functionThatReturnsFalse; + return this; + } + assign(SyntheticEvent.prototype, { + preventDefault: function preventDefault() { + this.defaultPrevented = true; + var event = this.nativeEvent; + if (!event) { + return; + } + if (event.preventDefault) { + event.preventDefault(); + } else if (typeof event.returnValue !== "unknown") { + event.returnValue = false; + } + this.isDefaultPrevented = functionThatReturnsTrue; + }, + stopPropagation: function stopPropagation() { + var event = this.nativeEvent; + if (!event) { + return; + } + if (event.stopPropagation) { + event.stopPropagation(); + } else if (typeof event.cancelBubble !== "unknown") { + // The ChangeEventPlugin registers a "propertychange" event for + // IE. This event does not support bubbling or cancelling, and + // any references to cancelBubble throw "Member not found". A + // typeof check of "unknown" circumvents this issue (and is also + // IE specific). + event.cancelBubble = true; + } + this.isPropagationStopped = functionThatReturnsTrue; + }, + /** + * We release all dispatched `SyntheticEvent`s after each event loop, adding + * them back into the pool. This allows a way to hold onto a reference that + * won't be added back into the pool. + */ + persist: function persist() { + this.isPersistent = functionThatReturnsTrue; + }, + /** + * Checks if this event should be released back into the pool. + * + * @return {boolean} True if this should not be released, false otherwise. + */ + isPersistent: functionThatReturnsFalse, + /** + * `PooledClass` looks for `destructor` on each instance it releases. + */ + destructor: function destructor() { + var Interface = this.constructor.Interface; + for (var propName in Interface) { + { + Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); + } + } + this.dispatchConfig = null; + this._targetInst = null; + this.nativeEvent = null; + this.isDefaultPrevented = functionThatReturnsFalse; + this.isPropagationStopped = functionThatReturnsFalse; + this._dispatchListeners = null; + this._dispatchInstances = null; + { + Object.defineProperty(this, "nativeEvent", getPooledWarningPropertyDefinition("nativeEvent", null)); + Object.defineProperty(this, "isDefaultPrevented", getPooledWarningPropertyDefinition("isDefaultPrevented", functionThatReturnsFalse)); + Object.defineProperty(this, "isPropagationStopped", getPooledWarningPropertyDefinition("isPropagationStopped", functionThatReturnsFalse)); + Object.defineProperty(this, "preventDefault", getPooledWarningPropertyDefinition("preventDefault", function () {})); + Object.defineProperty(this, "stopPropagation", getPooledWarningPropertyDefinition("stopPropagation", function () {})); + } + } + }); + SyntheticEvent.Interface = EventInterface; + /** + * Helper to reduce boilerplate when creating subclasses. + */ + + SyntheticEvent.extend = function (Interface) { + var Super = this; + var E = function E() {}; + E.prototype = Super.prototype; + var prototype = new E(); + function Class() { + return Super.apply(this, arguments); + } + assign(prototype, Class.prototype); + Class.prototype = prototype; + Class.prototype.constructor = Class; + Class.Interface = assign({}, Super.Interface, Interface); + Class.extend = Super.extend; + addEventPoolingTo(Class); + return Class; + }; + addEventPoolingTo(SyntheticEvent); + /** + * Helper to nullify syntheticEvent instance properties when destructing + * + * @param {String} propName + * @param {?object} getVal + * @return {object} defineProperty object + */ + + function getPooledWarningPropertyDefinition(propName, getVal) { + function set(val) { + var action = isFunction ? "setting the method" : "setting the property"; + warn(action, "This is effectively a no-op"); + return val; + } + function get() { + var action = isFunction ? "accessing the method" : "accessing the property"; + var result = isFunction ? "This is a no-op function" : "This is set to null"; + warn(action, result); + return getVal; + } + function warn(action, result) { + { + error("This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + "If you must keep the original synthetic event around, use event.persist(). " + "See https://react.dev/link/event-pooling for more information.", action, propName, result); + } + } + var isFunction = typeof getVal === "function"; + return { + configurable: true, + set: set, + get: get + }; + } + function createOrGetPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) { + var EventConstructor = this; + if (EventConstructor.eventPool.length) { + var instance = EventConstructor.eventPool.pop(); + EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst); + return instance; + } + return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst); + } + function releasePooledEvent(event) { + var EventConstructor = this; + if (!(event instanceof EventConstructor)) { + throw new Error("Trying to release an event instance into a pool of a different type."); + } + event.destructor(); + if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) { + EventConstructor.eventPool.push(event); + } + } + function addEventPoolingTo(EventConstructor) { + EventConstructor.getPooled = createOrGetPooledEvent; + EventConstructor.eventPool = []; + EventConstructor.release = releasePooledEvent; + } + + /** + * `touchHistory` isn't actually on the native event, but putting it in the + * interface will ensure that it is cleaned up when pooled/destroyed. The + * `ResponderEventPlugin` will populate it appropriately. + */ + + var ResponderSyntheticEvent = SyntheticEvent.extend({ + touchHistory: function touchHistory(nativeEvent) { + return null; // Actually doesn't even look at the native event. + } + }); + var TOP_TOUCH_START = "topTouchStart"; + var TOP_TOUCH_MOVE = "topTouchMove"; + var TOP_TOUCH_END = "topTouchEnd"; + var TOP_TOUCH_CANCEL = "topTouchCancel"; + var TOP_SCROLL = "topScroll"; + var TOP_SELECTION_CHANGE = "topSelectionChange"; + function isStartish(topLevelType) { + return topLevelType === TOP_TOUCH_START; + } + function isMoveish(topLevelType) { + return topLevelType === TOP_TOUCH_MOVE; + } + function isEndish(topLevelType) { + return topLevelType === TOP_TOUCH_END || topLevelType === TOP_TOUCH_CANCEL; + } + var startDependencies = [TOP_TOUCH_START]; + var moveDependencies = [TOP_TOUCH_MOVE]; + var endDependencies = [TOP_TOUCH_CANCEL, TOP_TOUCH_END]; + + /** + * Tracks the position and time of each active touch by `touch.identifier`. We + * should typically only see IDs in the range of 1-20 because IDs get recycled + * when touches end and start again. + */ + + var MAX_TOUCH_BANK = 20; + var touchBank = []; + var touchHistory = { + touchBank: touchBank, + numberActiveTouches: 0, + // If there is only one active touch, we remember its location. This prevents + // us having to loop through all of the touches all the time in the most + // common case. + indexOfSingleActiveTouch: -1, + mostRecentTimeStamp: 0 + }; + function timestampForTouch(touch) { + // The legacy internal implementation provides "timeStamp", which has been + // renamed to "timestamp". Let both work for now while we iron it out + // TODO (evv): rename timeStamp to timestamp in internal code + return touch.timeStamp || touch.timestamp; + } + /** + * TODO: Instead of making gestures recompute filtered velocity, we could + * include a built in velocity computation that can be reused globally. + */ + + function createTouchRecord(touch) { + return { + touchActive: true, + 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) + }; + } + function resetTouchRecord(touchRecord, touch) { + touchRecord.touchActive = true; + 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); + } + function getTouchIdentifier(_ref) { + var identifier = _ref.identifier; + if (identifier == null) { + throw new Error("Touch object is missing identifier."); + } + { + if (identifier > MAX_TOUCH_BANK) { + error("Touch identifier %s is greater than maximum supported %s which causes " + "performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK); + } + } + return identifier; + } + function recordTouchStart(touch) { + var identifier = getTouchIdentifier(touch); + var touchRecord = touchBank[identifier]; + if (touchRecord) { + resetTouchRecord(touchRecord, touch); + } else { + touchBank[identifier] = createTouchRecord(touch); + } + touchHistory.mostRecentTimeStamp = timestampForTouch(touch); + } + function recordTouchMove(touch) { + var touchRecord = touchBank[getTouchIdentifier(touch)]; + if (touchRecord) { + touchRecord.touchActive = true; + 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); + } else { + { + warn("Cannot record touch move without a touch start.\n" + "Touch Move: %s\n" + "Touch Bank: %s", printTouch(touch), printTouchBank()); + } + } + } + function recordTouchEnd(touch) { + var touchRecord = touchBank[getTouchIdentifier(touch)]; + if (touchRecord) { + touchRecord.touchActive = false; + 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); + } else { + { + warn("Cannot record touch end without a touch start.\n" + "Touch End: %s\n" + "Touch Bank: %s", printTouch(touch), printTouchBank()); + } + } + } + function printTouch(touch) { + return JSON.stringify({ + identifier: touch.identifier, + pageX: touch.pageX, + pageY: touch.pageY, + timestamp: timestampForTouch(touch) + }); + } + function printTouchBank() { + var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK)); + if (touchBank.length > MAX_TOUCH_BANK) { + printed += " (original size: " + touchBank.length + ")"; + } + return printed; + } + var instrumentationCallback; + var ResponderTouchHistoryStore = { + /** + * Registers a listener which can be used to instrument every touch event. + */ + instrument: function instrument(callback) { + instrumentationCallback = callback; + }, + recordTouchTrack: function recordTouchTrack(topLevelType, nativeEvent) { + if (instrumentationCallback != null) { + instrumentationCallback(topLevelType, nativeEvent); + } + if (isMoveish(topLevelType)) { + nativeEvent.changedTouches.forEach(recordTouchMove); + } else if (isStartish(topLevelType)) { + nativeEvent.changedTouches.forEach(recordTouchStart); + touchHistory.numberActiveTouches = nativeEvent.touches.length; + if (touchHistory.numberActiveTouches === 1) { + touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier; + } + } else if (isEndish(topLevelType)) { + nativeEvent.changedTouches.forEach(recordTouchEnd); + touchHistory.numberActiveTouches = nativeEvent.touches.length; + if (touchHistory.numberActiveTouches === 1) { + for (var i = 0; i < touchBank.length; i++) { + var touchTrackToCheck = touchBank[i]; + if (touchTrackToCheck != null && touchTrackToCheck.touchActive) { + touchHistory.indexOfSingleActiveTouch = i; + break; + } + } + { + var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch]; + if (activeRecord == null || !activeRecord.touchActive) { + error("Cannot find single active touch."); + } + } + } + } + }, + touchHistory: touchHistory + }; + + /** + * Accumulates items that must not be null or undefined. + * + * This is used to conserve memory by avoiding array allocations. + * + * @return {*|array<*>} An accumulation of items. + */ + + function accumulate(current, next) { + if (next == null) { + throw new Error("accumulate(...): Accumulated items must not be null or undefined."); + } + if (current == null) { + return next; + } // Both are not empty. Warning: Never call x.concat(y) when you are not + // certain that x is an Array (x could be a string with concat method). + + if (isArray(current)) { + return current.concat(next); + } + if (isArray(next)) { + return [current].concat(next); + } + return [current, next]; + } + + /** + * Accumulates items that must not be null or undefined into the first one. This + * is used to conserve memory by avoiding array allocations, and thus sacrifices + * API cleanness. Since `current` can be null before being passed in and not + * null after this function, make sure to assign it back to `current`: + * + * `a = accumulateInto(a, b);` + * + * This API should be sparingly used. Try `accumulate` for something cleaner. + * + * @return {*|array<*>} An accumulation of items. + */ + + function accumulateInto(current, next) { + if (next == null) { + throw new Error("accumulateInto(...): Accumulated items must not be null or undefined."); + } + if (current == null) { + return next; + } // Both are not empty. Warning: Never call x.concat(y) when you are not + // certain that x is an Array (x could be a string with concat method). + + if (isArray(current)) { + if (isArray(next)) { + current.push.apply(current, next); + return current; + } + current.push(next); + return current; + } + if (isArray(next)) { + // A bit too dangerous to mutate `next`. + return [current].concat(next); + } + return [current, next]; + } + + /** + * @param {array} arr an "accumulation" of items which is either an Array or + * a single item. Useful when paired with the `accumulate` module. This is a + * simple utility that allows us to reason about a collection of items, but + * handling the case when there is exactly one item (and we do not need to + * allocate an array). + * @param {function} cb Callback invoked with each element or a collection. + * @param {?} [scope] Scope used as `this` in a callback. + */ + function forEachAccumulated(arr, cb, scope) { + if (Array.isArray(arr)) { + arr.forEach(cb, scope); + } else if (arr) { + cb.call(scope, arr); + } + } + var FunctionComponent = 0; + var ClassComponent = 1; + var IndeterminateComponent = 2; // Before we know whether it is function or class + + var HostRoot = 3; // Root of a host tree. Could be nested inside another node. + + var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. + + var HostComponent = 5; + var HostText = 6; + var Fragment = 7; + var Mode = 8; + var ContextConsumer = 9; + var ContextProvider = 10; + var ForwardRef = 11; + var Profiler = 12; + var SuspenseComponent = 13; + var MemoComponent = 14; + var SimpleMemoComponent = 15; + var LazyComponent = 16; + var IncompleteClassComponent = 17; + var DehydratedFragment = 18; + var SuspenseListComponent = 19; + var ScopeComponent = 21; + var OffscreenComponent = 22; + var LegacyHiddenComponent = 23; + var CacheComponent = 24; + var TracingMarkerComponent = 25; + + /** + * Instance of element that should respond to touch/move types of interactions, + * as indicated explicitly by relevant callbacks. + */ + + var responderInst = null; + /** + * Count of current touches. A textInput should become responder iff the + * selection changes while there is a touch on the screen. + */ + + var trackedTouchCount = 0; + var changeResponder = function changeResponder(nextResponderInst, blockHostResponder) { + var oldResponderInst = responderInst; + responderInst = nextResponderInst; + if (ResponderEventPlugin.GlobalResponderHandler !== null) { + ResponderEventPlugin.GlobalResponderHandler.onChange(oldResponderInst, nextResponderInst, blockHostResponder); + } + }; + var eventTypes = { + /** + * On a `touchStart`/`mouseDown`, is it desired that this element become the + * responder? + */ + startShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onStartShouldSetResponder", + captured: "onStartShouldSetResponderCapture" + }, + dependencies: startDependencies + }, + /** + * On a `scroll`, is it desired that this element become the responder? This + * is usually not needed, but should be used to retroactively infer that a + * `touchStart` had occurred during momentum scroll. During a momentum scroll, + * a touch start will be immediately followed by a scroll event if the view is + * currently scrolling. + * + * TODO: This shouldn't bubble. + */ + scrollShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onScrollShouldSetResponder", + captured: "onScrollShouldSetResponderCapture" + }, + dependencies: [TOP_SCROLL] + }, + /** + * On text selection change, should this element become the responder? This + * is needed for text inputs or other views with native selection, so the + * JS view can claim the responder. + * + * TODO: This shouldn't bubble. + */ + selectionChangeShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onSelectionChangeShouldSetResponder", + captured: "onSelectionChangeShouldSetResponderCapture" + }, + dependencies: [TOP_SELECTION_CHANGE] + }, + /** + * On a `touchMove`/`mouseMove`, is it desired that this element become the + * responder? + */ + moveShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onMoveShouldSetResponder", + captured: "onMoveShouldSetResponderCapture" + }, + dependencies: moveDependencies + }, + /** + * Direct responder events dispatched directly to responder. Do not bubble. + */ + 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: [] + } + }; // Start of inline: the below functions were inlined from + // EventPropagator.js, as they deviated from ReactDOM's newer + // implementations. + + function getParent(inst) { + do { + inst = inst.return; // TODO: If this is a HostRoot we might want to bail out. + // That is depending on if we want nested subtrees (layers) to bubble + // events to their parent. We could also go through parentNode on the + // host node but that wouldn't work for React Native and doesn't let us + // do the portal feature. + } while (inst && inst.tag !== HostComponent); + if (inst) { + return inst; + } + return null; + } + /** + * Return the lowest common ancestor of A and B, or null if they are in + * different trees. + */ + + function getLowestCommonAncestor(instA, instB) { + var depthA = 0; + for (var tempA = instA; tempA; tempA = getParent(tempA)) { + depthA++; + } + var depthB = 0; + for (var tempB = instB; tempB; tempB = getParent(tempB)) { + depthB++; + } // If A is deeper, crawl up. + + while (depthA - depthB > 0) { + instA = getParent(instA); + depthA--; + } // If B is deeper, crawl up. + + while (depthB - depthA > 0) { + instB = getParent(instB); + depthB--; + } // Walk in lockstep until we find a match. + + var depth = depthA; + while (depth--) { + if (instA === instB || instA === instB.alternate) { + return instA; + } + instA = getParent(instA); + instB = getParent(instB); + } + return null; + } + /** + * Return if A is an ancestor of B. + */ + + function isAncestor(instA, instB) { + while (instB) { + if (instA === instB || instA === instB.alternate) { + return true; + } + instB = getParent(instB); + } + return false; + } + /** + * Simulates the traversal of a two-phase, capture/bubble event dispatch. + */ + + function traverseTwoPhase(inst, fn, arg) { + var path = []; + while (inst) { + path.push(inst); + inst = getParent(inst); + } + var i; + for (i = path.length; i-- > 0;) { + fn(path[i], "captured", arg); + } + for (i = 0; i < path.length; i++) { + fn(path[i], "bubbled", arg); + } + } + function getListener(inst, registrationName) { + var stateNode = inst.stateNode; + if (stateNode === null) { + // Work in progress (ex: onload events in incremental mode). + return null; + } + var props = getFiberCurrentPropsFromNode(stateNode); + if (props === null) { + // Work in progress. + return null; + } + var listener = props[registrationName]; + if (listener && typeof listener !== "function") { + throw new Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type."); + } + return listener; + } + function listenerAtPhase(inst, event, propagationPhase) { + var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; + return getListener(inst, registrationName); + } + function accumulateDirectionalDispatches(inst, phase, event) { + { + if (!inst) { + error("Dispatching inst must not be null"); + } + } + var listener = listenerAtPhase(inst, event, phase); + if (listener) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); + event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } + } + /** + * Accumulates without regard to direction, does not look for phased + * registration names. Same as `accumulateDirectDispatchesSingle` but without + * requiring that the `dispatchMarker` be the same as the dispatched ID. + */ + + function accumulateDispatches(inst, ignoredDirection, event) { + if (inst && event && event.dispatchConfig.registrationName) { + var registrationName = event.dispatchConfig.registrationName; + var listener = getListener(inst, registrationName); + if (listener) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); + event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } + } + } + /** + * Accumulates dispatches on an `SyntheticEvent`, but only for the + * `dispatchMarker`. + * @param {SyntheticEvent} event + */ + + function accumulateDirectDispatchesSingle(event) { + if (event && event.dispatchConfig.registrationName) { + accumulateDispatches(event._targetInst, null, event); + } + } + function accumulateDirectDispatches(events) { + forEachAccumulated(events, accumulateDirectDispatchesSingle); + } + function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + var targetInst = event._targetInst; + var parentInst = targetInst ? getParent(targetInst) : null; + traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event); + } + } + function accumulateTwoPhaseDispatchesSkipTarget(events) { + forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget); + } + function accumulateTwoPhaseDispatchesSingle(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); + } + } + function accumulateTwoPhaseDispatches(events) { + forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle); + } // End of inline + + /** + * + * Responder System: + * ---------------- + * + * - A global, solitary "interaction lock" on a view. + * - If a node becomes the responder, it should convey visual feedback + * immediately to indicate so, either by highlighting or moving accordingly. + * - To be the responder means, that touches are exclusively important to that + * responder view, and no other view. + * - While touches are still occurring, the responder lock can be transferred to + * a new view, but only to increasingly "higher" views (meaning ancestors of + * the current responder). + * + * Responder being granted: + * ------------------------ + * + * - Touch starts, moves, and scrolls can cause an ID to become the responder. + * - We capture/bubble `startShouldSetResponder`/`moveShouldSetResponder` to + * the "appropriate place". + * - If nothing is currently the responder, the "appropriate place" is the + * initiating event's `targetID`. + * - If something *is* already the responder, the "appropriate place" is the + * first common ancestor of the event target and the current `responderInst`. + * - Some negotiation happens: See the timing diagram below. + * - Scrolled views automatically become responder. The reasoning is that a + * platform scroll view that isn't built on top of the responder system has + * began scrolling, and the active responder must now be notified that the + * interaction is no longer locked to it - the system has taken over. + * + * - Responder being released: + * As soon as no more touches that *started* inside of descendants of the + * *current* responderInst, an `onResponderRelease` event is dispatched to the + * current responder, and the responder lock is released. + * + * TODO: + * - on "end", a callback hook for `onResponderEndShouldRemainResponder` that + * determines if the responder lock should remain. + * - If a view shouldn't "remain" the responder, any active touches should by + * default be considered "dead" and do not influence future negotiations or + * bubble paths. It should be as if those touches do not exist. + * -- For multitouch: Usually a translate-z will choose to "remain" responder + * after one out of many touches ended. For translate-y, usually the view + * doesn't wish to "remain" responder after one of many touches end. + * - Consider building this on top of a `stopPropagation` model similar to + * `W3C` events. + * - Ensure that `onResponderTerminate` is called on touch cancels, whether or + * not `onResponderTerminationRequest` returns `true` or `false`. + * + */ + + /* Negotiation Performed + +-----------------------+ + / \ + Process low level events to + Current Responder + wantsResponderID + determine who to perform negot-| (if any exists at all) | + iation/transition | Otherwise just pass through| + -------------------------------+----------------------------+------------------+ + Bubble to find first ID | | + to return true:wantsResponderID| | + | | + +-------------+ | | + | onTouchStart| | | + +------+------+ none | | + | return| | + +-----------v-------------+true| +------------------------+ | + |onStartShouldSetResponder|----->|onResponderStart (cur) |<-----------+ + +-----------+-------------+ | +------------------------+ | | + | | | +--------+-------+ + | returned true for| false:REJECT +-------->|onResponderReject + | wantsResponderID | | | +----------------+ + | (now attempt | +------------------+-----+ | + | handoff) | | onResponder | | + +------------------->| TerminationRequest| | + | +------------------+-----+ | + | | | +----------------+ + | true:GRANT +-------->|onResponderGrant| + | | +--------+-------+ + | +------------------------+ | | + | | onResponderTerminate |<-----------+ + | +------------------+-----+ | + | | | +----------------+ + | +-------->|onResponderStart| + | | +----------------+ + Bubble to find first ID | | + to return true:wantsResponderID| | + | | + +-------------+ | | + | onTouchMove | | | + +------+------+ none | | + | return| | + +-----------v-------------+true| +------------------------+ | + |onMoveShouldSetResponder |----->|onResponderMove (cur) |<-----------+ + +-----------+-------------+ | +------------------------+ | | + | | | +--------+-------+ + | returned true for| false:REJECT +-------->|onResponderRejec| + | wantsResponderID | | | +----------------+ + | (now attempt | +------------------+-----+ | + | handoff) | | onResponder | | + +------------------->| TerminationRequest| | + | +------------------+-----+ | + | | | +----------------+ + | true:GRANT +-------->|onResponderGrant| + | | +--------+-------+ + | +------------------------+ | | + | | onResponderTerminate |<-----------+ + | +------------------+-----+ | + | | | +----------------+ + | +-------->|onResponderMove | + | | +----------------+ + | | + | | + Some active touch started| | + inside current responder | +------------------------+ | + +------------------------->| onResponderEnd | | + | | +------------------------+ | + +---+---------+ | | + | onTouchEnd | | | + +---+---------+ | | + | | +------------------------+ | + +------------------------->| onResponderEnd | | + No active touches started| +-----------+------------+ | + inside current responder | | | + | v | + | +------------------------+ | + | | onResponderRelease | | + | +------------------------+ | + | | + + + */ + + /** + * A note about event ordering in the `EventPluginRegistry`. + * + * Suppose plugins are injected in the following order: + * + * `[R, S, C]` + * + * To help illustrate the example, assume `S` is `SimpleEventPlugin` (for + * `onClick` etc) and `R` is `ResponderEventPlugin`. + * + * "Deferred-Dispatched Events": + * + * - The current event plugin system will traverse the list of injected plugins, + * in order, and extract events by collecting the plugin's return value of + * `extractEvents()`. + * - These events that are returned from `extractEvents` are "deferred + * dispatched events". + * - When returned from `extractEvents`, deferred-dispatched events contain an + * "accumulation" of deferred dispatches. + * - These deferred dispatches are accumulated/collected before they are + * returned, but processed at a later time by the `EventPluginRegistry` (hence the + * name deferred). + * + * In the process of returning their deferred-dispatched events, event plugins + * themselves can dispatch events on-demand without returning them from + * `extractEvents`. Plugins might want to do this, so that they can use event + * dispatching as a tool that helps them decide which events should be extracted + * in the first place. + * + * "On-Demand-Dispatched Events": + * + * - On-demand-dispatched events are not returned from `extractEvents`. + * - On-demand-dispatched events are dispatched during the process of returning + * the deferred-dispatched events. + * - They should not have side effects. + * - They should be avoided, and/or eventually be replaced with another + * abstraction that allows event plugins to perform multiple "rounds" of event + * extraction. + * + * Therefore, the sequence of event dispatches becomes: + * + * - `R`s on-demand events (if any) (dispatched by `R` on-demand) + * - `S`s on-demand events (if any) (dispatched by `S` on-demand) + * - `C`s on-demand events (if any) (dispatched by `C` on-demand) + * - `R`s extracted events (if any) (dispatched by `EventPluginRegistry`) + * - `S`s extracted events (if any) (dispatched by `EventPluginRegistry`) + * - `C`s extracted events (if any) (dispatched by `EventPluginRegistry`) + * + * In the case of `ResponderEventPlugin`: If the `startShouldSetResponder` + * on-demand dispatch returns `true` (and some other details are satisfied) the + * `onResponderGrant` deferred dispatched event is returned from + * `extractEvents`. The sequence of dispatch executions in this case + * will appear as follows: + * + * - `startShouldSetResponder` (`ResponderEventPlugin` dispatches on-demand) + * - `touchStartCapture` (`EventPluginRegistry` dispatches as usual) + * - `touchStart` (`EventPluginRegistry` dispatches as usual) + * - `responderGrant/Reject` (`EventPluginRegistry` dispatches as usual) + */ + + function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var shouldSetEventType = isStartish(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish(topLevelType) ? eventTypes.moveShouldSetResponder : topLevelType === TOP_SELECTION_CHANGE ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder; // TODO: stop one short of the current responder. + + var bubbleShouldSetFrom = !responderInst ? targetInst : getLowestCommonAncestor(responderInst, targetInst); // When capturing/bubbling the "shouldSet" event, we want to skip the target + // (deepest ID) if it happens to be the current responder. The reasoning: + // It's strange to get an `onMoveShouldSetResponder` when you're *already* + // the responder. + + var skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst; + var shouldSetEvent = ResponderSyntheticEvent.getPooled(shouldSetEventType, bubbleShouldSetFrom, nativeEvent, nativeEventTarget); + shouldSetEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + if (skipOverBubbleShouldSetFrom) { + accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent); + } else { + accumulateTwoPhaseDispatches(shouldSetEvent); + } + var wantsResponderInst = executeDispatchesInOrderStopAtTrue(shouldSetEvent); + if (!shouldSetEvent.isPersistent()) { + shouldSetEvent.constructor.release(shouldSetEvent); + } + if (!wantsResponderInst || wantsResponderInst === responderInst) { + return null; + } + var extracted; + var grantEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderGrant, wantsResponderInst, nativeEvent, nativeEventTarget); + grantEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + accumulateDirectDispatches(grantEvent); + var blockHostResponder = executeDirectDispatch(grantEvent) === true; + if (responderInst) { + var terminationRequestEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget); + terminationRequestEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + accumulateDirectDispatches(terminationRequestEvent); + var shouldSwitch = !hasDispatches(terminationRequestEvent) || executeDirectDispatch(terminationRequestEvent); + if (!terminationRequestEvent.isPersistent()) { + terminationRequestEvent.constructor.release(terminationRequestEvent); + } + if (shouldSwitch) { + var terminateEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget); + terminateEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + accumulateDirectDispatches(terminateEvent); + extracted = accumulate(extracted, [grantEvent, terminateEvent]); + changeResponder(wantsResponderInst, blockHostResponder); + } else { + var rejectEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderReject, wantsResponderInst, nativeEvent, nativeEventTarget); + rejectEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + accumulateDirectDispatches(rejectEvent); + extracted = accumulate(extracted, rejectEvent); + } + } else { + extracted = accumulate(extracted, grantEvent); + changeResponder(wantsResponderInst, blockHostResponder); + } + return extracted; + } + /** + * A transfer is a negotiation between a currently set responder and the next + * element to claim responder status. Any start event could trigger a transfer + * of responderInst. Any move event could trigger a transfer. + * + * @param {string} topLevelType Record from `BrowserEventConstants`. + * @return {boolean} True if a transfer of responder could possibly occur. + */ + + function canTriggerTransfer(topLevelType, topLevelInst, nativeEvent) { + return topLevelInst && ( + // responderIgnoreScroll: We are trying to migrate away from specifically + // tracking native scroll events here and responderIgnoreScroll indicates we + // will send topTouchCancel to handle canceling touch events instead + topLevelType === TOP_SCROLL && !nativeEvent.responderIgnoreScroll || trackedTouchCount > 0 && topLevelType === TOP_SELECTION_CHANGE || isStartish(topLevelType) || isMoveish(topLevelType)); + } + /** + * Returns whether or not this touch end event makes it such that there are no + * longer any touches that started inside of the current `responderInst`. + * + * @param {NativeEvent} nativeEvent Native touch end event. + * @return {boolean} Whether or not this touch end event ends the responder. + */ + + function noResponderTouches(nativeEvent) { + var touches = nativeEvent.touches; + if (!touches || touches.length === 0) { + return true; + } + for (var i = 0; i < touches.length; i++) { + var activeTouch = touches[i]; + var target = activeTouch.target; + if (target !== null && target !== undefined && target !== 0) { + // Is the original touch location inside of the current responder? + var targetInst = getInstanceFromNode(target); + if (isAncestor(responderInst, targetInst)) { + return false; + } + } + } + return true; + } + var ResponderEventPlugin = { + /* For unit testing only */ + _getResponder: function _getResponder() { + return responderInst; + }, + eventTypes: eventTypes, + /** + * We must be resilient to `targetInst` being `null` on `touchMove` or + * `touchEnd`. On certain platforms, this means that a native scroll has + * assumed control and the original touch targets are destroyed. + */ + extractEvents: function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) { + if (isStartish(topLevelType)) { + trackedTouchCount += 1; + } else if (isEndish(topLevelType)) { + if (trackedTouchCount >= 0) { + trackedTouchCount -= 1; + } else { + { + warn("Ended a touch event which was not counted in `trackedTouchCount`."); + } + return null; + } + } + ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent); + var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent) ? setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) : null; // Responder may or may not have transferred on a new touch start/move. + // Regardless, whoever is the responder after any potential transfer, we + // direct all touch start/move/ends to them in the form of + // `onResponderMove/Start/End`. These will be called for *every* additional + // finger that move/start/end, dispatched directly to whoever is the + // current responder at that moment, until the responder is "released". + // + // These multiple individual change touch events are are always bookended + // by `onResponderGrant`, and one of + // (`onResponderRelease/onResponderTerminate`). + + var isResponderTouchStart = responderInst && isStartish(topLevelType); + var isResponderTouchMove = responderInst && isMoveish(topLevelType); + var isResponderTouchEnd = responderInst && isEndish(topLevelType); + var incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove ? eventTypes.responderMove : isResponderTouchEnd ? eventTypes.responderEnd : null; + if (incrementalTouch) { + var gesture = ResponderSyntheticEvent.getPooled(incrementalTouch, responderInst, nativeEvent, nativeEventTarget); + gesture.touchHistory = ResponderTouchHistoryStore.touchHistory; + accumulateDirectDispatches(gesture); + extracted = accumulate(extracted, gesture); + } + var isResponderTerminate = responderInst && topLevelType === TOP_TOUCH_CANCEL; + var isResponderRelease = responderInst && !isResponderTerminate && isEndish(topLevelType) && noResponderTouches(nativeEvent); + var finalTouch = isResponderTerminate ? eventTypes.responderTerminate : isResponderRelease ? eventTypes.responderRelease : null; + if (finalTouch) { + var finalEvent = ResponderSyntheticEvent.getPooled(finalTouch, responderInst, nativeEvent, nativeEventTarget); + finalEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + accumulateDirectDispatches(finalEvent); + extracted = accumulate(extracted, finalEvent); + changeResponder(null); + } + return extracted; + }, + GlobalResponderHandler: null, + injection: { + /** + * @param {{onChange: (ReactID, ReactID) => void} GlobalResponderHandler + * Object that handles any change in responder. Use this to inject + * integration with an existing touch handling system etc. + */ + injectGlobalResponderHandler: function injectGlobalResponderHandler(GlobalResponderHandler) { + ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler; + } + } + }; + + /** + * Injectable ordering of event plugins. + */ + var eventPluginOrder = null; + /** + * Injectable mapping from names to event plugin modules. + */ + + var namesToPlugins = {}; + /** + * Recomputes the plugin list using the injected plugins and plugin ordering. + * + * @private + */ + + function recomputePluginOrdering() { + if (!eventPluginOrder) { + // Wait until an `eventPluginOrder` is injected. + return; + } + for (var pluginName in namesToPlugins) { + var pluginModule = namesToPlugins[pluginName]; + var pluginIndex = eventPluginOrder.indexOf(pluginName); + if (pluginIndex <= -1) { + throw new Error("EventPluginRegistry: Cannot inject event plugins that do not exist in " + ("the plugin ordering, `" + pluginName + "`.")); + } + if (plugins[pluginIndex]) { + continue; + } + if (!pluginModule.extractEvents) { + throw new Error("EventPluginRegistry: Event plugins must implement an `extractEvents` " + ("method, but `" + pluginName + "` does not.")); + } + plugins[pluginIndex] = pluginModule; + var publishedEvents = pluginModule.eventTypes; + for (var eventName in publishedEvents) { + if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) { + throw new Error("EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`."); + } + } + } + } + /** + * Publishes an event so that it can be dispatched by the supplied plugin. + * + * @param {object} dispatchConfig Dispatch configuration for the event. + * @param {object} PluginModule Plugin publishing the event. + * @return {boolean} True if the event was successfully published. + * @private + */ + + function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { + if (eventNameDispatchConfigs.hasOwnProperty(eventName)) { + throw new Error("EventPluginRegistry: More than one plugin attempted to publish the same " + ("event name, `" + eventName + "`.")); + } + eventNameDispatchConfigs[eventName] = dispatchConfig; + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + if (phasedRegistrationNames) { + for (var phaseName in phasedRegistrationNames) { + if (phasedRegistrationNames.hasOwnProperty(phaseName)) { + var phasedRegistrationName = phasedRegistrationNames[phaseName]; + publishRegistrationName(phasedRegistrationName, pluginModule, eventName); + } + } + return true; + } else if (dispatchConfig.registrationName) { + publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); + return true; + } + return false; + } + /** + * Publishes a registration name that is used to identify dispatched events. + * + * @param {string} registrationName Registration name to add. + * @param {object} PluginModule Plugin publishing the event. + * @private + */ + + function publishRegistrationName(registrationName, pluginModule, eventName) { + if (registrationNameModules[registrationName]) { + throw new Error("EventPluginRegistry: More than one plugin attempted to publish the same " + ("registration name, `" + registrationName + "`.")); + } + registrationNameModules[registrationName] = pluginModule; + registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; + { + var lowerCasedName = registrationName.toLowerCase(); + } + } + /** + * Registers plugins so that they can extract and dispatch events. + */ + + /** + * Ordered list of injected plugins. + */ + + var plugins = []; + /** + * Mapping from event name to dispatch config + */ + + var eventNameDispatchConfigs = {}; + /** + * Mapping from registration name to plugin module + */ + + var registrationNameModules = {}; + /** + * Mapping from registration name to event name + */ + + var registrationNameDependencies = {}; + + /** + * Injects an ordering of plugins (by plugin name). This allows the ordering + * to be decoupled from injection of the actual plugins so that ordering is + * always deterministic regardless of packaging, on-the-fly injection, etc. + * + * @param {array} InjectedEventPluginOrder + * @internal + */ + + function injectEventPluginOrder(injectedEventPluginOrder) { + if (eventPluginOrder) { + throw new Error("EventPluginRegistry: Cannot inject event plugin ordering more than " + "once. You are likely trying to load more than one copy of React."); + } // Clone the ordering so it cannot be dynamically mutated. + + eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); + recomputePluginOrdering(); + } + /** + * Injects plugins to be used by plugin event system. The plugin names must be + * in the ordering injected by `injectEventPluginOrder`. + * + * Plugins can be injected as part of page initialization or on-the-fly. + * + * @param {object} injectedNamesToPlugins Map from names to plugin modules. + * @internal + */ + + function injectEventPluginsByName(injectedNamesToPlugins) { + var isOrderingDirty = false; + for (var pluginName in injectedNamesToPlugins) { + if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { + continue; + } + var pluginModule = injectedNamesToPlugins[pluginName]; + if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { + if (namesToPlugins[pluginName]) { + throw new Error("EventPluginRegistry: Cannot inject two different event plugins " + ("using the same name, `" + pluginName + "`.")); + } + namesToPlugins[pluginName] = pluginModule; + isOrderingDirty = true; + } + } + if (isOrderingDirty) { + recomputePluginOrdering(); + } + } + + /** + * Get a list of listeners for a specific event, in-order. + * For React Native we treat the props-based function handlers + * as the first-class citizens, and they are always executed first + * for both capture and bubbling phase. + * + * We need "phase" propagated to this point to support the HostComponent + * EventEmitter API, which does not mutate the name of the handler based + * on phase (whereas prop handlers are registered as `onMyEvent` and `onMyEvent_Capture`). + * + * Native system events emitted into React Native + * will be emitted both to the prop handler function and to imperative event + * listeners. + * + * This will either return null, a single Function without an array, or + * an array of 2+ items. + */ + + function getListeners(inst, registrationName, phase, dispatchToImperativeListeners) { + var stateNode = inst.stateNode; + if (stateNode === null) { + return null; + } // If null: Work in progress (ex: onload events in incremental mode). + + var props = getFiberCurrentPropsFromNode(stateNode); + if (props === null) { + // Work in progress. + return null; + } + var listener = props[registrationName]; + if (listener && typeof listener !== "function") { + throw new Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type."); + } // If there are no imperative listeners, early exit. + + if (!(dispatchToImperativeListeners && stateNode.canonical && stateNode.canonical._eventListeners)) { + return listener; + } // Below this is the de-optimized path. + // If you are using _eventListeners, we do not (yet) + // expect this to be as performant as the props-only path. + // If/when this becomes a bottleneck, it can be refactored + // to avoid unnecessary closures and array allocations. + // + // Previously, there was only one possible listener for an event: + // the onEventName property in props. + // Now, it is also possible to have N listeners + // for a specific event on a node. Thus, we accumulate all of the listeners, + // including the props listener, and return a function that calls them all in + // order, starting with the handler prop and then the listeners in order. + // We return either a non-empty array or null. + + var listeners = []; + if (listener) { + listeners.push(listener); + } // TODO: for now, all of these events get an `rn:` prefix to enforce + // that the user knows they're only getting non-W3C-compliant events + // through this imperative event API. + // Events might not necessarily be noncompliant, but we currently have + // no verification that /any/ events are compliant. + // Thus, we prefix to ensure no collision with W3C event names. + + var requestedPhaseIsCapture = phase === "captured"; + var mangledImperativeRegistrationName = requestedPhaseIsCapture ? "rn:" + registrationName.replace(/Capture$/, "") : "rn:" + registrationName; // Get imperative event listeners for this event + + if (stateNode.canonical._eventListeners[mangledImperativeRegistrationName] && stateNode.canonical._eventListeners[mangledImperativeRegistrationName].length > 0) { + var eventListeners = stateNode.canonical._eventListeners[mangledImperativeRegistrationName]; + eventListeners.forEach(function (listenerObj) { + // Make sure phase of listener matches requested phase + var isCaptureEvent = listenerObj.options.capture != null && listenerObj.options.capture; + if (isCaptureEvent !== requestedPhaseIsCapture) { + return; + } // For now (this is an area of future optimization) we must wrap + // all imperative event listeners in a function to unwrap the SyntheticEvent + // and pass them an Event. + // When this API is more stable and used more frequently, we can revisit. + + var listenerFnWrapper = function listenerFnWrapper(syntheticEvent) { + var eventInst = new ReactNativePrivateInterface.CustomEvent(mangledImperativeRegistrationName, { + detail: syntheticEvent.nativeEvent + }); + eventInst.isTrusted = true; // setSyntheticEvent is present on the React Native Event shim. + // It is used to forward method calls on Event to the underlying SyntheticEvent. + // $FlowFixMe + + eventInst.setSyntheticEvent(syntheticEvent); + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + listenerObj.listener.apply(listenerObj, [eventInst].concat(args)); + }; // Only call once? + // If so, we ensure that it's only called once by setting a flag + // and by removing it from eventListeners once it is called (but only + // when it's actually been executed). + + if (listenerObj.options.once) { + listeners.push(function () { + // Remove from the event listener once it's been called + stateNode.canonical.removeEventListener_unstable(mangledImperativeRegistrationName, listenerObj.listener, listenerObj.capture); // Guard against function being called more than once in + // case there are somehow multiple in-flight references to + // it being processed + + if (!listenerObj.invalidated) { + listenerObj.invalidated = true; + listenerObj.listener.apply(listenerObj, arguments); + } + }); + } else { + listeners.push(listenerFnWrapper); + } + }); + } + if (listeners.length === 0) { + return null; + } + if (listeners.length === 1) { + return listeners[0]; + } + return listeners; + } + var customBubblingEventTypes = ReactNativePrivateInterface.ReactNativeViewConfigRegistry.customBubblingEventTypes, + customDirectEventTypes = ReactNativePrivateInterface.ReactNativeViewConfigRegistry.customDirectEventTypes; // Start of inline: the below functions were inlined from + // EventPropagator.js, as they deviated from ReactDOM's newer + // implementations. + + function listenersAtPhase(inst, event, propagationPhase) { + var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; + return getListeners(inst, registrationName, propagationPhase, true); + } + function accumulateListenersAndInstances(inst, event, listeners) { + var listenersLength = listeners ? isArray(listeners) ? listeners.length : 1 : 0; + if (listenersLength > 0) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listeners); // Avoid allocating additional arrays here + + if (event._dispatchInstances == null && listenersLength === 1) { + event._dispatchInstances = inst; + } else { + event._dispatchInstances = event._dispatchInstances || []; + if (!isArray(event._dispatchInstances)) { + event._dispatchInstances = [event._dispatchInstances]; + } + for (var i = 0; i < listenersLength; i++) { + event._dispatchInstances.push(inst); + } + } + } + } + function accumulateDirectionalDispatches$1(inst, phase, event) { + { + if (!inst) { + error("Dispatching inst must not be null"); + } + } + var listeners = listenersAtPhase(inst, event, phase); + accumulateListenersAndInstances(inst, event, listeners); + } + function getParent$1(inst) { + do { + inst = inst.return; // TODO: If this is a HostRoot we might want to bail out. + // That is depending on if we want nested subtrees (layers) to bubble + // events to their parent. We could also go through parentNode on the + // host node but that wouldn't work for React Native and doesn't let us + // do the portal feature. + } while (inst && inst.tag !== HostComponent); + if (inst) { + return inst; + } + return null; + } + /** + * Simulates the traversal of a two-phase, capture/bubble event dispatch. + */ + + function traverseTwoPhase$1(inst, fn, arg, skipBubbling) { + var path = []; + while (inst) { + path.push(inst); + inst = getParent$1(inst); + } + var i; + for (i = path.length; i-- > 0;) { + fn(path[i], "captured", arg); + } + if (skipBubbling) { + // Dispatch on target only + fn(path[0], "bubbled", arg); + } else { + for (i = 0; i < path.length; i++) { + fn(path[i], "bubbled", arg); + } + } + } + function accumulateTwoPhaseDispatchesSingle$1(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + traverseTwoPhase$1(event._targetInst, accumulateDirectionalDispatches$1, event, false); + } + } + function accumulateTwoPhaseDispatches$1(events) { + forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle$1); + } + function accumulateCapturePhaseDispatches(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + traverseTwoPhase$1(event._targetInst, accumulateDirectionalDispatches$1, event, true); + } + } + /** + * Accumulates without regard to direction, does not look for phased + * registration names. Same as `accumulateDirectDispatchesSingle` but without + * requiring that the `dispatchMarker` be the same as the dispatched ID. + */ + + function accumulateDispatches$1(inst, ignoredDirection, event) { + if (inst && event && event.dispatchConfig.registrationName) { + var registrationName = event.dispatchConfig.registrationName; + var listeners = getListeners(inst, registrationName, "bubbled", false); + accumulateListenersAndInstances(inst, event, listeners); + } + } + /** + * Accumulates dispatches on an `SyntheticEvent`, but only for the + * `dispatchMarker`. + * @param {SyntheticEvent} event + */ + + function accumulateDirectDispatchesSingle$1(event) { + if (event && event.dispatchConfig.registrationName) { + accumulateDispatches$1(event._targetInst, null, event); + } + } + function accumulateDirectDispatches$1(events) { + forEachAccumulated(events, accumulateDirectDispatchesSingle$1); + } // End of inline + + var ReactNativeBridgeEventPlugin = { + eventTypes: {}, + extractEvents: function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + if (targetInst == null) { + // Probably a node belonging to another renderer's tree. + return null; + } + var bubbleDispatchConfig = customBubblingEventTypes[topLevelType]; + var directDispatchConfig = customDirectEventTypes[topLevelType]; + if (!bubbleDispatchConfig && !directDispatchConfig) { + throw new Error( + // $FlowFixMe - Flow doesn't like this string coercion because DOMTopLevelEventType is opaque + 'Unsupported top level event type "' + topLevelType + '" dispatched'); + } + var event = SyntheticEvent.getPooled(bubbleDispatchConfig || directDispatchConfig, targetInst, nativeEvent, nativeEventTarget); + if (bubbleDispatchConfig) { + var skipBubbling = event != null && event.dispatchConfig.phasedRegistrationNames != null && event.dispatchConfig.phasedRegistrationNames.skipBubbling; + if (skipBubbling) { + accumulateCapturePhaseDispatches(event); + } else { + accumulateTwoPhaseDispatches$1(event); + } + } else if (directDispatchConfig) { + accumulateDirectDispatches$1(event); + } else { + return null; + } + return event; + } + }; + var ReactNativeEventPluginOrder = ["ResponderEventPlugin", "ReactNativeBridgeEventPlugin"]; + + /** + * Make sure essential globals are available and are patched correctly. Please don't remove this + * line. Bundles created by react-packager `require` it before executing any application code. This + * ensures it exists in the dependency graph and can be `require`d. + * TODO: require this in packager, not in React #10932517 + */ + /** + * Inject module for resolving DOM hierarchy and plugin ordering. + */ + + injectEventPluginOrder(ReactNativeEventPluginOrder); + /** + * Some important event plugins included by default (without having to require + * them). + */ + + injectEventPluginsByName({ + ResponderEventPlugin: ResponderEventPlugin, + ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin + }); + function getInstanceFromInstance(instanceHandle) { + return instanceHandle; + } + function getTagFromInstance(inst) { + var nativeInstance = inst.stateNode.canonical; + if (!nativeInstance._nativeTag) { + throw new Error("All native instances should have a tag."); + } + return nativeInstance; + } + function getFiberCurrentPropsFromNode$1(inst) { + return inst.canonical.currentProps; + } + + // Module provided by RN: + var ReactFabricGlobalResponderHandler = { + onChange: function onChange(from, to, blockNativeResponder) { + var fromOrTo = from || to; + var fromOrToStateNode = fromOrTo && fromOrTo.stateNode; + var isFabric = !!(fromOrToStateNode && fromOrToStateNode.canonical._internalInstanceHandle); + if (isFabric) { + if (from) { + // equivalent to clearJSResponder + nativeFabricUIManager.setIsJSResponder(from.stateNode.node, false, blockNativeResponder || false); + } + if (to) { + // equivalent to setJSResponder + nativeFabricUIManager.setIsJSResponder(to.stateNode.node, true, blockNativeResponder || false); + } + } else { + if (to !== null) { + var tag = to.stateNode.canonical._nativeTag; + ReactNativePrivateInterface.UIManager.setJSResponder(tag, blockNativeResponder); + } else { + ReactNativePrivateInterface.UIManager.clearJSResponder(); + } + } + } + }; + setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromInstance, getTagFromInstance); + ResponderEventPlugin.injection.injectGlobalResponderHandler(ReactFabricGlobalResponderHandler); + + /** + * `ReactInstanceMap` maintains a mapping from a public facing stateful + * instance (key) and the internal representation (value). This allows public + * methods to accept the user facing instance as an argument and map them back + * to internal methods. + * + * Note that this module is currently shared and assumed to be stateless. + * If this becomes an actual Map, that will break. + */ + function get(key) { + return key._reactInternals; + } + function set(key, value) { + key._reactInternals = value; + } + var enableSchedulingProfiler = false; + var enableProfilerTimer = true; + var enableProfilerCommitHooks = true; + var warnAboutStringRefs = false; + var enableSuspenseAvoidThisFallback = false; + var enableNewReconciler = false; + var enableLazyContextPropagation = false; + var enableLegacyHidden = false; + + // ATTENTION + // When adding new symbols to this file, + // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' + // The Symbol used to tag the ReactElement-like types. + var REACT_ELEMENT_TYPE = Symbol.for("react.element"); + var REACT_PORTAL_TYPE = Symbol.for("react.portal"); + var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); + var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); + var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); + var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); + var REACT_CONTEXT_TYPE = Symbol.for("react.context"); + var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); + var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); + var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); + var REACT_MEMO_TYPE = Symbol.for("react.memo"); + var REACT_LAZY_TYPE = Symbol.for("react.lazy"); + var REACT_SCOPE_TYPE = Symbol.for("react.scope"); + var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); + var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); + var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); + var REACT_CACHE_TYPE = Symbol.for("react.cache"); + var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); + var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = "@@iterator"; + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== "object") { + return null; + } + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + if (typeof maybeIterator === "function") { + return maybeIterator; + } + return null; + } + function getWrappedName(outerType, innerType, wrapperName) { + var displayName = outerType.displayName; + if (displayName) { + return displayName; + } + var functionName = innerType.displayName || innerType.name || ""; + return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; + } // Keep in sync with react-reconciler/getComponentNameFromFiber + + function getContextName(type) { + return type.displayName || "Context"; + } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. + + function getComponentNameFromType(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + { + if (typeof type.tag === "number") { + error("Received an unexpected object in getComponentNameFromType(). " + "This is likely a bug in React. Please file an issue."); + } + } + if (typeof type === "function") { + return type.displayName || type.name || null; + } + if (typeof type === "string") { + 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"; + } + if (typeof type === "object") { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + var context = type; + return getContextName(context) + ".Consumer"; + case REACT_PROVIDER_TYPE: + var provider = type; + return getContextName(provider._context) + ".Provider"; + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, "ForwardRef"); + case REACT_MEMO_TYPE: + var outerName = type.displayName || null; + if (outerName !== null) { + return outerName; + } + return getComponentNameFromType(type.type) || "Memo"; + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + return getComponentNameFromType(init(payload)); + } catch (x) { + return null; + } + } + + // eslint-disable-next-line no-fallthrough + } + } + return null; + } + function getWrappedName$1(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ""; + return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName); + } // Keep in sync with shared/getComponentNameFromType + + function getContextName$1(type) { + return type.displayName || "Context"; + } + function getComponentNameFromFiber(fiber) { + var tag = fiber.tag, + type = fiber.type; + switch (tag) { + case CacheComponent: + return "Cache"; + case ContextConsumer: + var context = type; + return getContextName$1(context) + ".Consumer"; + case ContextProvider: + var provider = type; + return getContextName$1(provider._context) + ".Provider"; + case DehydratedFragment: + return "DehydratedFragment"; + case ForwardRef: + return getWrappedName$1(type, type.render, "ForwardRef"); + case Fragment: + return "Fragment"; + case HostComponent: + // Host component type is the display name (e.g. "div", "View") + return type; + case HostPortal: + return "Portal"; + case HostRoot: + return "Root"; + case HostText: + return "Text"; + case LazyComponent: + // Name comes from the type in this case; we don't have a tag. + return getComponentNameFromType(type); + case Mode: + if (type === REACT_STRICT_MODE_TYPE) { + // Don't be less specific than shared/getComponentNameFromType + return "StrictMode"; + } + return "Mode"; + case OffscreenComponent: + return "Offscreen"; + case Profiler: + return "Profiler"; + case ScopeComponent: + return "Scope"; + case SuspenseComponent: + return "Suspense"; + case SuspenseListComponent: + return "SuspenseList"; + case TracingMarkerComponent: + return "TracingMarker"; + // The display name for this tags come from the user-provided type: + + case ClassComponent: + case FunctionComponent: + case IncompleteClassComponent: + case IndeterminateComponent: + case MemoComponent: + case SimpleMemoComponent: + if (typeof type === "function") { + return type.displayName || type.name || null; + } + if (typeof type === "string") { + return type; + } + break; + } + return null; + } + + // Don't change these two values. They're used by React Dev Tools. + var NoFlags = /* */ + 0; + var PerformedWork = /* */ + 1; // You can change the rest (and add more). + + var Placement = /* */ + 2; + var Update = /* */ + 4; + var ChildDeletion = /* */ + 16; + var ContentReset = /* */ + 32; + var Callback = /* */ + 64; + var DidCapture = /* */ + 128; + var ForceClientRender = /* */ + 256; + var Ref = /* */ + 512; + var Snapshot = /* */ + 1024; + var Passive = /* */ + 2048; + var Hydrating = /* */ + 4096; + var Visibility = /* */ + 8192; + var StoreConsistency = /* */ + 16384; + var LifecycleEffectMask = Passive | Update | Callback | Ref | Snapshot | StoreConsistency; // Union of all commit flags (flags with the lifetime of a particular commit) + + var HostEffectMask = /* */ + 32767; // These are not really side effects, but we still reuse this field. + + var Incomplete = /* */ + 32768; + var ShouldCapture = /* */ + 65536; + var ForceUpdateForLegacySuspense = /* */ + 131072; + var Forked = /* */ + 1048576; // Static tags describe aspects of a fiber that are not specific to a render, + // e.g. a fiber uses a passive effect (even if there are no updates on this particular render). + // This enables us to defer more work in the unmount case, + // since we can defer traversing the tree during layout to look for Passive effects, + // and instead rely on the static flag as a signal that there may be cleanup work. + + var RefStatic = /* */ + 2097152; + var LayoutStatic = /* */ + 4194304; + var PassiveStatic = /* */ + 8388608; // These flags allow us to traverse to fibers that have effects on mount + // don't contain effects, by checking subtreeFlags. + + var BeforeMutationMask = + // TODO: Remove Update flag from before mutation phase by re-landing Visibility + // flag logic (see #20043) + Update | Snapshot | 0; + var MutationMask = Placement | Update | ChildDeletion | ContentReset | Ref | Hydrating | Visibility; + var LayoutMask = Update | Callback | Ref | Visibility; // TODO: Split into PassiveMountMask and PassiveUnmountMask + + var PassiveMask = Passive | ChildDeletion; // Union of tags that don't get reset on clones. + // This allows certain concepts to persist without recalculating them, + // e.g. whether a subtree contains passive effects or portals. + + var StaticMask = LayoutStatic | PassiveStatic | RefStatic; + var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; + function getNearestMountedFiber(fiber) { + var node = fiber; + var nearestMounted = fiber; + if (!fiber.alternate) { + // If there is no alternate, this might be a new tree that isn't inserted + // yet. If it is, then it will have a pending insertion effect on it. + var nextNode = node; + do { + node = nextNode; + if ((node.flags & (Placement | Hydrating)) !== NoFlags) { + // This is an insertion or in-progress hydration. The nearest possible + // mounted fiber is the parent but we need to continue to figure out + // if that one is still mounted. + nearestMounted = node.return; + } + nextNode = node.return; + } while (nextNode); + } else { + while (node.return) { + node = node.return; + } + } + if (node.tag === HostRoot) { + // TODO: Check if this was a nested HostRoot when used with + // renderContainerIntoSubtree. + return nearestMounted; + } // If we didn't hit the root, that means that we're in an disconnected tree + // that has been unmounted. + + return null; + } + function isFiberMounted(fiber) { + return getNearestMountedFiber(fiber) === fiber; + } + function isMounted(component) { + { + var owner = ReactCurrentOwner.current; + if (owner !== null && owner.tag === ClassComponent) { + var ownerFiber = owner; + var instance = ownerFiber.stateNode; + if (!instance._warnedAboutRefsInRender) { + error("%s is accessing isMounted inside its render() function. " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", getComponentNameFromFiber(ownerFiber) || "A component"); + } + instance._warnedAboutRefsInRender = true; + } + } + var fiber = get(component); + if (!fiber) { + return false; + } + return getNearestMountedFiber(fiber) === fiber; + } + function assertIsMounted(fiber) { + if (getNearestMountedFiber(fiber) !== fiber) { + throw new Error("Unable to find node on an unmounted component."); + } + } + function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + if (!alternate) { + // If there is no alternate, then we only need to check if it is mounted. + var nearestMounted = getNearestMountedFiber(fiber); + if (nearestMounted === null) { + throw new Error("Unable to find node on an unmounted component."); + } + if (nearestMounted !== fiber) { + return null; + } + return fiber; + } // If we have two possible branches, we'll walk backwards up to the root + // to see what path the root points to. On the way we may hit one of the + // special cases and we'll deal with them. + + var a = fiber; + var b = alternate; + while (true) { + var parentA = a.return; + if (parentA === null) { + // We're at the root. + break; + } + var parentB = parentA.alternate; + if (parentB === null) { + // There is no alternate. This is an unusual case. Currently, it only + // happens when a Suspense component is hidden. An extra fragment fiber + // is inserted in between the Suspense fiber and its children. Skip + // over this extra fragment fiber and proceed to the next parent. + var nextParent = parentA.return; + if (nextParent !== null) { + a = b = nextParent; + continue; + } // If there's no parent, we're at the root. + + break; + } // If both copies of the parent fiber point to the same child, we can + // assume that the child is current. This happens when we bailout on low + // priority: the bailed out fiber's child reuses the current child. + + if (parentA.child === parentB.child) { + var child = parentA.child; + while (child) { + if (child === a) { + // We've determined that A is the current branch. + assertIsMounted(parentA); + return fiber; + } + if (child === b) { + // We've determined that B is the current branch. + assertIsMounted(parentA); + return alternate; + } + child = child.sibling; + } // We should never have an alternate for any mounting node. So the only + // way this could possibly happen is if this was unmounted, if at all. + + throw new Error("Unable to find node on an unmounted component."); + } + if (a.return !== b.return) { + // The return pointer of A and the return pointer of B point to different + // fibers. We assume that return pointers never criss-cross, so A must + // belong to the child set of A.return, and B must belong to the child + // set of B.return. + a = parentA; + b = parentB; + } else { + // The return pointers point to the same fiber. We'll have to use the + // default, slow path: scan the child sets of each parent alternate to see + // which child belongs to which set. + // + // Search parent A's child set + var didFindChild = false; + var _child = parentA.child; + while (_child) { + if (_child === a) { + didFindChild = true; + a = parentA; + b = parentB; + break; + } + if (_child === b) { + didFindChild = true; + b = parentA; + a = parentB; + break; + } + _child = _child.sibling; + } + if (!didFindChild) { + // Search parent B's child set + _child = parentB.child; + while (_child) { + if (_child === a) { + didFindChild = true; + a = parentB; + b = parentA; + break; + } + if (_child === b) { + didFindChild = true; + b = parentB; + a = parentA; + break; + } + _child = _child.sibling; + } + if (!didFindChild) { + throw new 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 new Error("Return fibers should always be each others' alternates. " + "This error is likely caused by a bug in React. Please file an issue."); + } + } // If the root is not a host container, we're in a disconnected tree. I.e. + // unmounted. + + if (a.tag !== HostRoot) { + throw new Error("Unable to find node on an unmounted component."); + } + if (a.stateNode.current === a) { + // We've determined that A is the current branch. + return fiber; + } // Otherwise B has to be current branch. + + return alternate; + } + function findCurrentHostFiber(parent) { + var currentParent = findCurrentFiberUsingSlowPath(parent); + return currentParent !== null ? findCurrentHostFiberImpl(currentParent) : null; + } + function findCurrentHostFiberImpl(node) { + // Next we'll drill down this component to find the first HostComponent/Text. + if (node.tag === HostComponent || node.tag === HostText) { + return node; + } + var child = node.child; + while (child !== null) { + var match = findCurrentHostFiberImpl(child); + if (match !== null) { + return match; + } + child = child.sibling; + } + return null; + } + + /** + * In the future, we should cleanup callbacks by cancelling them instead of + * using this. + */ + function mountSafeCallback_NOT_REALLY_SAFE(context, callback) { + return function () { + if (!callback) { + return undefined; + } // This protects against createClass() components. + // We don't know if there is code depending on it. + // We intentionally don't use isMounted() because even accessing + // isMounted property on a React ES6 class will trigger a warning. + + if (typeof context.__isMounted === "boolean") { + if (!context.__isMounted) { + return undefined; + } + } // FIXME: there used to be other branches that protected + // against unmounted host components. But RN host components don't + // define isMounted() anymore, so those checks didn't do anything. + // They caused false positive warning noise so we removed them: + // https://github.com/facebook/react-native/issues/18868#issuecomment-413579095 + // However, this means that the callback is NOT guaranteed to be safe + // for host components. The solution we should implement is to make + // UIManager.measure() and similar calls truly cancelable. Then we + // can change our own code calling them to cancel when something unmounts. + + return callback.apply(context, arguments); + }; + } + function warnForStyleProps(props, validAttributes) { + { + for (var key in validAttributes.style) { + if (!(validAttributes[key] || props[key] === undefined)) { + error("You are setting the style `{ %s" + ": ... }` as a prop. You " + "should nest it in a style object. " + "E.g. `{ style: { %s" + ": ... } }`", key, key); + } + } + } + } + + // Modules provided by RN: + var emptyObject = {}; + /** + * Create a payload that contains all the updates between two sets of props. + * + * These helpers are all encapsulated into a single module, because they use + * mutation as a performance optimization which leads to subtle shared + * dependencies between the code paths. To avoid this mutable state leaking + * across modules, I've kept them isolated to this module. + */ + + // Tracks removed keys + var removedKeys = null; + var removedKeyCount = 0; + var deepDifferOptions = { + unsafelyIgnoreFunctions: true + }; + function defaultDiffer(prevProp, nextProp) { + if (typeof nextProp !== "object" || nextProp === null) { + // Scalars have already been checked for equality + return true; + } else { + // For objects and arrays, the default diffing algorithm is a deep compare + return ReactNativePrivateInterface.deepDiffer(prevProp, nextProp, deepDifferOptions); + } + } + function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) { + if (isArray(node)) { + var i = node.length; + while (i-- && removedKeyCount > 0) { + restoreDeletedValuesInNestedArray(updatePayload, node[i], validAttributes); + } + } else if (node && removedKeyCount > 0) { + var obj = node; + for (var propKey in removedKeys) { + if (!removedKeys[propKey]) { + continue; + } + var nextProp = obj[propKey]; + if (nextProp === undefined) { + continue; + } + var attributeConfig = validAttributes[propKey]; + if (!attributeConfig) { + continue; // not a valid native prop + } + if (typeof nextProp === "function") { + nextProp = true; + } + if (typeof nextProp === "undefined") { + nextProp = null; + } + if (typeof attributeConfig !== "object") { + // case: !Object is the default case + updatePayload[propKey] = nextProp; + } else if (typeof attributeConfig.diff === "function" || typeof attributeConfig.process === "function") { + // case: CustomAttributeConfiguration + var nextValue = typeof attributeConfig.process === "function" ? attributeConfig.process(nextProp) : nextProp; + updatePayload[propKey] = nextValue; + } + removedKeys[propKey] = false; + removedKeyCount--; + } + } + } + function diffNestedArrayProperty(updatePayload, prevArray, nextArray, validAttributes) { + var minLength = prevArray.length < nextArray.length ? prevArray.length : nextArray.length; + var i; + for (i = 0; i < minLength; i++) { + // Diff any items in the array in the forward direction. Repeated keys + // will be overwritten by later values. + updatePayload = diffNestedProperty(updatePayload, prevArray[i], nextArray[i], validAttributes); + } + for (; i < prevArray.length; i++) { + // Clear out all remaining properties. + updatePayload = clearNestedProperty(updatePayload, prevArray[i], validAttributes); + } + for (; i < nextArray.length; i++) { + // Add all remaining properties. + updatePayload = addNestedProperty(updatePayload, nextArray[i], validAttributes); + } + return updatePayload; + } + function diffNestedProperty(updatePayload, prevProp, nextProp, validAttributes) { + if (!updatePayload && prevProp === nextProp) { + // If no properties have been added, then we can bail out quickly on object + // equality. + return updatePayload; + } + if (!prevProp || !nextProp) { + if (nextProp) { + return addNestedProperty(updatePayload, nextProp, validAttributes); + } + if (prevProp) { + return clearNestedProperty(updatePayload, prevProp, validAttributes); + } + return updatePayload; + } + if (!isArray(prevProp) && !isArray(nextProp)) { + // Both are leaves, we can diff the leaves. + return diffProperties(updatePayload, prevProp, nextProp, validAttributes); + } + if (isArray(prevProp) && isArray(nextProp)) { + // Both are arrays, we can diff the arrays. + return diffNestedArrayProperty(updatePayload, prevProp, nextProp, validAttributes); + } + if (isArray(prevProp)) { + return diffProperties(updatePayload, + // $FlowFixMe - We know that this is always an object when the input is. + ReactNativePrivateInterface.flattenStyle(prevProp), + // $FlowFixMe - We know that this isn't an array because of above flow. + nextProp, validAttributes); + } + return diffProperties(updatePayload, prevProp, + // $FlowFixMe - We know that this is always an object when the input is. + ReactNativePrivateInterface.flattenStyle(nextProp), validAttributes); + } + /** + * addNestedProperty takes a single set of props and valid attribute + * attribute configurations. It processes each prop and adds it to the + * updatePayload. + */ + + function addNestedProperty(updatePayload, nextProp, validAttributes) { + if (!nextProp) { + return updatePayload; + } + if (!isArray(nextProp)) { + // Add each property of the leaf. + return addProperties(updatePayload, nextProp, validAttributes); + } + for (var i = 0; i < nextProp.length; i++) { + // Add all the properties of the array. + updatePayload = addNestedProperty(updatePayload, nextProp[i], validAttributes); + } + return updatePayload; + } + /** + * clearNestedProperty takes a single set of props and valid attributes. It + * adds a null sentinel to the updatePayload, for each prop key. + */ + + function clearNestedProperty(updatePayload, prevProp, validAttributes) { + if (!prevProp) { + return updatePayload; + } + if (!isArray(prevProp)) { + // Add each property of the leaf. + return clearProperties(updatePayload, prevProp, validAttributes); + } + for (var i = 0; i < prevProp.length; i++) { + // Add all the properties of the array. + updatePayload = clearNestedProperty(updatePayload, prevProp[i], validAttributes); + } + return updatePayload; + } + /** + * diffProperties takes two sets of props and a set of valid attributes + * and write to updatePayload the values that changed or were deleted. + * If no updatePayload is provided, a new one is created and returned if + * anything changed. + */ + + function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { + var attributeConfig; + var nextProp; + var prevProp; + for (var propKey in nextProps) { + attributeConfig = validAttributes[propKey]; + if (!attributeConfig) { + continue; // not a valid native prop + } + prevProp = prevProps[propKey]; + nextProp = nextProps[propKey]; // functions are converted to booleans as markers that the associated + // events should be sent from native. + + if (typeof nextProp === "function") { + nextProp = true; // If nextProp is not a function, then don't bother changing prevProp + // since nextProp will win and go into the updatePayload regardless. + + if (typeof prevProp === "function") { + prevProp = true; + } + } // An explicit value of undefined is treated as a null because it overrides + // any other preceding value. + + if (typeof nextProp === "undefined") { + nextProp = null; + if (typeof prevProp === "undefined") { + prevProp = null; + } + } + if (removedKeys) { + removedKeys[propKey] = false; + } + if (updatePayload && updatePayload[propKey] !== undefined) { + // Something else already triggered an update to this key because another + // value diffed. Since we're now later in the nested arrays our value is + // more important so we need to calculate it and override the existing + // value. It doesn't matter if nothing changed, we'll set it anyway. + // Pattern match on: attributeConfig + if (typeof attributeConfig !== "object") { + // case: !Object is the default case + updatePayload[propKey] = nextProp; + } else if (typeof attributeConfig.diff === "function" || typeof attributeConfig.process === "function") { + // case: CustomAttributeConfiguration + var nextValue = typeof attributeConfig.process === "function" ? attributeConfig.process(nextProp) : nextProp; + updatePayload[propKey] = nextValue; + } + continue; + } + if (prevProp === nextProp) { + continue; // nothing changed + } // Pattern match on: attributeConfig + + if (typeof attributeConfig !== "object") { + // case: !Object is the default case + if (defaultDiffer(prevProp, nextProp)) { + // a normal leaf has changed + (updatePayload || (updatePayload = {}))[propKey] = nextProp; + } + } else if (typeof attributeConfig.diff === "function" || typeof attributeConfig.process === "function") { + // case: CustomAttributeConfiguration + var shouldUpdate = prevProp === undefined || (typeof attributeConfig.diff === "function" ? attributeConfig.diff(prevProp, nextProp) : defaultDiffer(prevProp, nextProp)); + if (shouldUpdate) { + var _nextValue = typeof attributeConfig.process === "function" ? attributeConfig.process(nextProp) : nextProp; + (updatePayload || (updatePayload = {}))[propKey] = _nextValue; + } + } else { + // default: fallthrough case when nested properties are defined + removedKeys = null; + removedKeyCount = 0; // We think that attributeConfig is not CustomAttributeConfiguration at + // this point so we assume it must be AttributeConfiguration. + + updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig); + if (removedKeyCount > 0 && updatePayload) { + restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig); + removedKeys = null; + } + } + } // Also iterate through all the previous props to catch any that have been + // removed and make sure native gets the signal so it can reset them to the + // default. + + for (var _propKey in prevProps) { + if (nextProps[_propKey] !== undefined) { + continue; // we've already covered this key in the previous pass + } + attributeConfig = validAttributes[_propKey]; + if (!attributeConfig) { + continue; // not a valid native prop + } + if (updatePayload && updatePayload[_propKey] !== undefined) { + // This was already updated to a diff result earlier. + continue; + } + prevProp = prevProps[_propKey]; + if (prevProp === undefined) { + continue; // was already empty anyway + } // Pattern match on: attributeConfig + + if (typeof attributeConfig !== "object" || typeof attributeConfig.diff === "function" || typeof attributeConfig.process === "function") { + // case: CustomAttributeConfiguration | !Object + // Flag the leaf property for removal by sending a sentinel. + (updatePayload || (updatePayload = {}))[_propKey] = null; + if (!removedKeys) { + removedKeys = {}; + } + if (!removedKeys[_propKey]) { + removedKeys[_propKey] = true; + removedKeyCount++; + } + } else { + // default: + // This is a nested attribute configuration where all the properties + // were removed so we need to go through and clear out all of them. + updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig); + } + } + return updatePayload; + } + /** + * addProperties adds all the valid props to the payload after being processed. + */ + + function addProperties(updatePayload, props, validAttributes) { + // TODO: Fast path + return diffProperties(updatePayload, emptyObject, props, validAttributes); + } + /** + * clearProperties clears all the previous props by adding a null sentinel + * to the payload for each valid key. + */ + + function clearProperties(updatePayload, prevProps, validAttributes) { + // TODO: Fast path + return diffProperties(updatePayload, prevProps, emptyObject, validAttributes); + } + function create(props, validAttributes) { + return addProperties(null, + // updatePayload + props, validAttributes); + } + function diff(prevProps, nextProps, validAttributes) { + return diffProperties(null, + // updatePayload + prevProps, nextProps, validAttributes); + } + + // Used as a way to call batchedUpdates when we don't have a reference to + // the renderer. Such as when we're dispatching events or if third party + // libraries need to call batchedUpdates. Eventually, this API will go away when + // everything is batched by default. We'll then have a similar API to opt-out of + // scheduled work and instead do synchronous work. + // Defaults + var batchedUpdatesImpl = function batchedUpdatesImpl(fn, bookkeeping) { + return fn(bookkeeping); + }; + var isInsideEventHandler = false; + function batchedUpdates(fn, bookkeeping) { + if (isInsideEventHandler) { + // If we are currently inside another batch, we need to wait until it + // fully completes before restoring state. + return fn(bookkeeping); + } + isInsideEventHandler = true; + try { + return batchedUpdatesImpl(fn, bookkeeping); + } finally { + isInsideEventHandler = false; + } + } + function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl) { + batchedUpdatesImpl = _batchedUpdatesImpl; + } + + /** + * Internal queue of events that have accumulated their dispatches and are + * waiting to have their dispatches executed. + */ + + var eventQueue = null; + /** + * Dispatches an event and releases it back into the pool, unless persistent. + * + * @param {?object} event Synthetic event to be dispatched. + * @private + */ + + var executeDispatchesAndRelease = function executeDispatchesAndRelease(event) { + if (event) { + executeDispatchesInOrder(event); + if (!event.isPersistent()) { + event.constructor.release(event); + } + } + }; + var executeDispatchesAndReleaseTopLevel = function executeDispatchesAndReleaseTopLevel(e) { + return executeDispatchesAndRelease(e); + }; + function runEventsInBatch(events) { + if (events !== null) { + eventQueue = accumulateInto(eventQueue, events); + } // Set `eventQueue` to null before processing it so that we can tell if more + // events get enqueued while processing. + + var processingEventQueue = eventQueue; + eventQueue = null; + if (!processingEventQueue) { + return; + } + forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); + if (eventQueue) { + throw new Error("processEventQueue(): Additional events were enqueued while processing " + "an event queue. Support for this has not yet been implemented."); + } // This would be a good time to rethrow if any of the event handlers threw. + + rethrowCaughtError(); + } + + /** + * Allows registered plugins an opportunity to extract events from top-level + * native browser events. + * + * @return {*} An accumulation of synthetic events. + * @internal + */ + + function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var events = null; + var legacyPlugins = plugins; + for (var i = 0; i < legacyPlugins.length; i++) { + // Not every plugin in the ordering may be loaded at runtime. + var possiblePlugin = legacyPlugins[i]; + if (possiblePlugin) { + var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + if (extractedEvents) { + events = accumulateInto(events, extractedEvents); + } + } + } + return events; + } + function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + runEventsInBatch(events); + } + function dispatchEvent(target, topLevelType, nativeEvent) { + var targetFiber = target; + var eventTarget = null; + if (targetFiber != null) { + var stateNode = targetFiber.stateNode; // Guard against Fiber being unmounted + + if (stateNode != null) { + eventTarget = stateNode.canonical; + } + } + batchedUpdates(function () { + // Emit event to the RawEventEmitter. This is an unused-by-default EventEmitter + // that can be used to instrument event performance monitoring (primarily - could be useful + // for other things too). + // + // NOTE: this merely emits events into the EventEmitter below. + // If *you* do not add listeners to the `RawEventEmitter`, + // then all of these emitted events will just blackhole and are no-ops. + // It is available (although not officially supported... yet) if you want to collect + // perf data on event latency in your application, and could also be useful for debugging + // low-level events issues. + // + // If you do not have any event perf monitoring and are extremely concerned about event perf, + // it is safe to disable these "emit" statements; it will prevent checking the size of + // an empty array twice and prevent two no-ops. Practically the overhead is so low that + // we don't think it's worth thinking about in prod; your perf issues probably lie elsewhere. + // + // We emit two events here: one for listeners to this specific event, + // and one for the catchall listener '*', for any listeners that want + // to be notified for all events. + // Note that extracted events are *not* emitted, + // only events that have a 1:1 mapping with a native event, at least for now. + var event = { + eventName: topLevelType, + nativeEvent: nativeEvent + }; + ReactNativePrivateInterface.RawEventEmitter.emit(topLevelType, event); + ReactNativePrivateInterface.RawEventEmitter.emit("*", event); // Heritage plugin event system + + runExtractedPluginEventsInBatch(topLevelType, targetFiber, nativeEvent, eventTarget); + }); // React Native doesn't use ReactControlledComponent but if it did, here's + // where it would do it. + } + + // This module only exists as an ESM wrapper around the external CommonJS + var scheduleCallback = Scheduler.unstable_scheduleCallback; + var cancelCallback = Scheduler.unstable_cancelCallback; + var shouldYield = Scheduler.unstable_shouldYield; + var requestPaint = Scheduler.unstable_requestPaint; + var now = Scheduler.unstable_now; + var ImmediatePriority = Scheduler.unstable_ImmediatePriority; + var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority; + var NormalPriority = Scheduler.unstable_NormalPriority; + var IdlePriority = Scheduler.unstable_IdlePriority; + var rendererID = null; + var injectedHook = null; + var hasLoggedError = false; + var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined"; + function injectInternals(internals) { + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined") { + // No DevTools + return false; + } + var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; + if (hook.isDisabled) { + // This isn't a real property on the hook, but it can be set to opt out + // of DevTools integration and associated warnings and logs. + // https://github.com/facebook/react/issues/3877 + return true; + } + if (!hook.supportsFiber) { + { + error("The installed version of React DevTools is too old and will not work " + "with the current version of React. Please update React DevTools. " + "https://react.dev/link/react-devtools"); + } // DevTools exists, even though it doesn't support Fiber. + + return true; + } + try { + if (enableSchedulingProfiler) { + // Conditionally inject these hooks only if Timeline profiler is supported by this build. + // This gives DevTools a way to feature detect that isn't tied to version number + // (since profiling and timeline are controlled by different feature flags). + internals = assign({}, internals, { + getLaneLabelMap: getLaneLabelMap, + injectProfilingHooks: injectProfilingHooks + }); + } + rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks. + + injectedHook = hook; + } catch (err) { + // Catch all errors because it is unsafe to throw during initialization. + { + error("React instrumentation encountered an error: %s.", err); + } + } + if (hook.checkDCE) { + // This is the real DevTools. + return true; + } else { + // This is likely a hook installed by Fast Refresh runtime. + return false; + } + } + function onScheduleRoot(root, children) { + { + if (injectedHook && typeof injectedHook.onScheduleFiberRoot === "function") { + try { + injectedHook.onScheduleFiberRoot(rendererID, root, children); + } catch (err) { + if (!hasLoggedError) { + hasLoggedError = true; + error("React instrumentation encountered an error: %s", err); + } + } + } + } + } + function onCommitRoot(root, eventPriority) { + if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") { + try { + var didError = (root.current.flags & DidCapture) === DidCapture; + if (enableProfilerTimer) { + var schedulerPriority; + switch (eventPriority) { + case DiscreteEventPriority: + schedulerPriority = ImmediatePriority; + break; + case ContinuousEventPriority: + schedulerPriority = UserBlockingPriority; + break; + case DefaultEventPriority: + schedulerPriority = NormalPriority; + break; + case IdleEventPriority: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority; + break; + } + injectedHook.onCommitFiberRoot(rendererID, root, schedulerPriority, didError); + } else { + injectedHook.onCommitFiberRoot(rendererID, root, undefined, didError); + } + } catch (err) { + { + if (!hasLoggedError) { + hasLoggedError = true; + error("React instrumentation encountered an error: %s", err); + } + } + } + } + } + function onPostCommitRoot(root) { + if (injectedHook && typeof injectedHook.onPostCommitFiberRoot === "function") { + try { + injectedHook.onPostCommitFiberRoot(rendererID, root); + } catch (err) { + { + if (!hasLoggedError) { + hasLoggedError = true; + error("React instrumentation encountered an error: %s", err); + } + } + } + } + } + function onCommitUnmount(fiber) { + if (injectedHook && typeof injectedHook.onCommitFiberUnmount === "function") { + try { + injectedHook.onCommitFiberUnmount(rendererID, fiber); + } catch (err) { + { + if (!hasLoggedError) { + hasLoggedError = true; + error("React instrumentation encountered an error: %s", err); + } + } + } + } + } + function injectProfilingHooks(profilingHooks) {} + function getLaneLabelMap() { + { + return null; + } + } + function markComponentRenderStopped() {} + function markComponentErrored(fiber, thrownValue, lanes) {} + function markComponentSuspended(fiber, wakeable, lanes) {} + var NoMode = /* */ + 0; // TODO: Remove ConcurrentMode by reading from the root tag instead + + var ConcurrentMode = /* */ + 1; + var ProfileMode = /* */ + 2; + var StrictLegacyMode = /* */ + 8; + + // TODO: This is pretty well supported by browsers. Maybe we can drop it. + var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; // Count leading zeros. + // Based on: + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32 + + var log = Math.log; + var LN2 = Math.LN2; + function clz32Fallback(x) { + var asUint = x >>> 0; + if (asUint === 0) { + return 32; + } + return 31 - (log(asUint) / LN2 | 0) | 0; + } + + // If those values are changed that package should be rebuilt and redeployed. + + var TotalLanes = 31; + var NoLanes = /* */ + 0; + var NoLane = /* */ + 0; + var SyncLane = /* */ + 1; + var InputContinuousHydrationLane = /* */ + 2; + var InputContinuousLane = /* */ + 4; + var DefaultHydrationLane = /* */ + 8; + var DefaultLane = /* */ + 16; + var TransitionHydrationLane = /* */ + 32; + var TransitionLanes = /* */ + 4194240; + var TransitionLane1 = /* */ + 64; + var TransitionLane2 = /* */ + 128; + var TransitionLane3 = /* */ + 256; + var TransitionLane4 = /* */ + 512; + var TransitionLane5 = /* */ + 1024; + var TransitionLane6 = /* */ + 2048; + var TransitionLane7 = /* */ + 4096; + var TransitionLane8 = /* */ + 8192; + var TransitionLane9 = /* */ + 16384; + var TransitionLane10 = /* */ + 32768; + var TransitionLane11 = /* */ + 65536; + var TransitionLane12 = /* */ + 131072; + var TransitionLane13 = /* */ + 262144; + var TransitionLane14 = /* */ + 524288; + var TransitionLane15 = /* */ + 1048576; + var TransitionLane16 = /* */ + 2097152; + var RetryLanes = /* */ + 130023424; + var RetryLane1 = /* */ + 4194304; + var RetryLane2 = /* */ + 8388608; + var RetryLane3 = /* */ + 16777216; + var RetryLane4 = /* */ + 33554432; + var RetryLane5 = /* */ + 67108864; + var SomeRetryLane = RetryLane1; + var SelectiveHydrationLane = /* */ + 134217728; + var NonIdleLanes = /* */ + 268435455; + var IdleHydrationLane = /* */ + 268435456; + var IdleLane = /* */ + 536870912; + var OffscreenLane = /* */ + 1073741824; // This function is used for the experimental timeline (react-devtools-timeline) + var NoTimestamp = -1; + var nextTransitionLane = TransitionLane1; + var nextRetryLane = RetryLane1; + function getHighestPriorityLanes(lanes) { + switch (getHighestPriorityLane(lanes)) { + case SyncLane: + return SyncLane; + case InputContinuousHydrationLane: + return InputContinuousHydrationLane; + case InputContinuousLane: + return InputContinuousLane; + case DefaultHydrationLane: + return DefaultHydrationLane; + case DefaultLane: + return DefaultLane; + case TransitionHydrationLane: + return TransitionHydrationLane; + case TransitionLane1: + case TransitionLane2: + case TransitionLane3: + case TransitionLane4: + case TransitionLane5: + case TransitionLane6: + case TransitionLane7: + case TransitionLane8: + case TransitionLane9: + case TransitionLane10: + case TransitionLane11: + case TransitionLane12: + case TransitionLane13: + case TransitionLane14: + case TransitionLane15: + case TransitionLane16: + return lanes & TransitionLanes; + case RetryLane1: + case RetryLane2: + case RetryLane3: + case RetryLane4: + case RetryLane5: + return lanes & RetryLanes; + case SelectiveHydrationLane: + return SelectiveHydrationLane; + case IdleHydrationLane: + return IdleHydrationLane; + case IdleLane: + return IdleLane; + case OffscreenLane: + return OffscreenLane; + default: + { + error("Should have found matching lanes. This is a bug in React."); + } // This shouldn't be reachable, but as a fallback, return the entire bitmask. + + return lanes; + } + } + function getNextLanes(root, wipLanes) { + // Early bailout if there's no pending work left. + var pendingLanes = root.pendingLanes; + if (pendingLanes === NoLanes) { + return NoLanes; + } + var nextLanes = NoLanes; + var suspendedLanes = root.suspendedLanes; + var pingedLanes = root.pingedLanes; // Do not work on any idle work until all the non-idle work has finished, + // even if the work is suspended. + + var nonIdlePendingLanes = pendingLanes & NonIdleLanes; + if (nonIdlePendingLanes !== NoLanes) { + var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes; + if (nonIdleUnblockedLanes !== NoLanes) { + nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes); + } else { + var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes; + if (nonIdlePingedLanes !== NoLanes) { + nextLanes = getHighestPriorityLanes(nonIdlePingedLanes); + } + } + } else { + // The only remaining work is Idle. + var unblockedLanes = pendingLanes & ~suspendedLanes; + if (unblockedLanes !== NoLanes) { + nextLanes = getHighestPriorityLanes(unblockedLanes); + } else { + if (pingedLanes !== NoLanes) { + nextLanes = getHighestPriorityLanes(pingedLanes); + } + } + } + if (nextLanes === NoLanes) { + // This should only be reachable if we're suspended + // TODO: Consider warning in this path if a fallback timer is not scheduled. + return NoLanes; + } // If we're already in the middle of a render, switching lanes will interrupt + // it and we'll lose our progress. We should only do this if the new lanes are + // higher priority. + + if (wipLanes !== NoLanes && wipLanes !== nextLanes && + // If we already suspended with a delay, then interrupting is fine. Don't + // bother waiting until the root is complete. + (wipLanes & suspendedLanes) === NoLanes) { + var nextLane = getHighestPriorityLane(nextLanes); + var wipLane = getHighestPriorityLane(wipLanes); + if ( + // Tests whether the next lane is equal or lower priority than the wip + // one. This works because the bits decrease in priority as you go left. + nextLane >= wipLane || + // Default priority updates should not interrupt transition updates. The + // only difference between default updates and transition updates is that + // default updates do not support refresh transitions. + nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes) { + // Keep working on the existing in-progress tree. Do not interrupt. + return wipLanes; + } + } + if ((nextLanes & InputContinuousLane) !== NoLanes) { + // When updates are sync by default, we entangle continuous priority updates + // and default updates, so they render in the same batch. The only reason + // they use separate lanes is because continuous updates should interrupt + // transitions, but default updates should not. + nextLanes |= pendingLanes & DefaultLane; + } // Check for entangled lanes and add them to the batch. + // + // A lane is said to be entangled with another when it's not allowed to render + // in a batch that does not also include the other lane. Typically we do this + // when multiple updates have the same source, and we only want to respond to + // the most recent event from that source. + // + // Note that we apply entanglements *after* checking for partial work above. + // This means that if a lane is entangled during an interleaved event while + // it's already rendering, we won't interrupt it. This is intentional, since + // entanglement is usually "best effort": we'll try our best to render the + // lanes in the same batch, but it's not worth throwing out partially + // completed work in order to do it. + // TODO: Reconsider this. The counter-argument is that the partial work + // represents an intermediate state, which we don't want to show to the user. + // And by spending extra time finishing it, we're increasing the amount of + // time it takes to show the final state, which is what they are actually + // waiting for. + // + // For those exceptions where entanglement is semantically important, like + // useMutableSource, we should ensure that there is no partial work at the + // time we apply the entanglement. + + var entangledLanes = root.entangledLanes; + if (entangledLanes !== NoLanes) { + var entanglements = root.entanglements; + var lanes = nextLanes & entangledLanes; + while (lanes > 0) { + var index = pickArbitraryLaneIndex(lanes); + var lane = 1 << index; + nextLanes |= entanglements[index]; + lanes &= ~lane; + } + } + return nextLanes; + } + function getMostRecentEventTime(root, lanes) { + var eventTimes = root.eventTimes; + var mostRecentEventTime = NoTimestamp; + while (lanes > 0) { + var index = pickArbitraryLaneIndex(lanes); + var lane = 1 << index; + var eventTime = eventTimes[index]; + if (eventTime > mostRecentEventTime) { + mostRecentEventTime = eventTime; + } + lanes &= ~lane; + } + return mostRecentEventTime; + } + function computeExpirationTime(lane, currentTime) { + switch (lane) { + case SyncLane: + case InputContinuousHydrationLane: + case InputContinuousLane: + // User interactions should expire slightly more quickly. + // + // NOTE: This is set to the corresponding constant as in Scheduler.js. + // When we made it larger, a product metric in www regressed, suggesting + // there's a user interaction that's being starved by a series of + // synchronous updates. If that theory is correct, the proper solution is + // to fix the starvation. However, this scenario supports the idea that + // expiration times are an important safeguard when starvation + // does happen. + return currentTime + 250; + case DefaultHydrationLane: + case DefaultLane: + case TransitionHydrationLane: + case TransitionLane1: + case TransitionLane2: + case TransitionLane3: + case TransitionLane4: + case TransitionLane5: + case TransitionLane6: + case TransitionLane7: + case TransitionLane8: + case TransitionLane9: + case TransitionLane10: + case TransitionLane11: + case TransitionLane12: + case TransitionLane13: + case TransitionLane14: + case TransitionLane15: + case TransitionLane16: + return currentTime + 5000; + case RetryLane1: + case RetryLane2: + case RetryLane3: + case RetryLane4: + case RetryLane5: + // TODO: Retries should be allowed to expire if they are CPU bound for + // too long, but when I made this change it caused a spike in browser + // crashes. There must be some other underlying bug; not super urgent but + // ideally should figure out why and fix it. Unfortunately we don't have + // a repro for the crashes, only detected via production metrics. + return NoTimestamp; + case SelectiveHydrationLane: + case IdleHydrationLane: + case IdleLane: + case OffscreenLane: + // Anything idle priority or lower should never expire. + return NoTimestamp; + default: + { + error("Should have found matching lanes. This is a bug in React."); + } + return NoTimestamp; + } + } + function markStarvedLanesAsExpired(root, currentTime) { + // TODO: This gets called every time we yield. We can optimize by storing + // the earliest expiration time on the root. Then use that to quickly bail out + // of this function. + var pendingLanes = root.pendingLanes; + var suspendedLanes = root.suspendedLanes; + var pingedLanes = root.pingedLanes; + var expirationTimes = root.expirationTimes; // Iterate through the pending lanes and check if we've reached their + // expiration time. If so, we'll assume the update is being starved and mark + // it as expired to force it to finish. + + var lanes = pendingLanes; + while (lanes > 0) { + var index = pickArbitraryLaneIndex(lanes); + var lane = 1 << index; + var expirationTime = expirationTimes[index]; + if (expirationTime === NoTimestamp) { + // Found a pending lane with no expiration time. If it's not suspended, or + // if it's pinged, assume it's CPU-bound. Compute a new expiration time + // using the current time. + if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) { + // Assumes timestamps are monotonically increasing. + expirationTimes[index] = computeExpirationTime(lane, currentTime); + } + } else if (expirationTime <= currentTime) { + // This lane expired + root.expiredLanes |= lane; + } + lanes &= ~lane; + } + } // This returns the highest priority pending lanes regardless of whether they + function getLanesToRetrySynchronouslyOnError(root) { + var everythingButOffscreen = root.pendingLanes & ~OffscreenLane; + if (everythingButOffscreen !== NoLanes) { + return everythingButOffscreen; + } + if (everythingButOffscreen & OffscreenLane) { + return OffscreenLane; + } + return NoLanes; + } + function includesSyncLane(lanes) { + return (lanes & SyncLane) !== NoLanes; + } + function includesNonIdleWork(lanes) { + return (lanes & NonIdleLanes) !== NoLanes; + } + function includesOnlyRetries(lanes) { + return (lanes & RetryLanes) === lanes; + } + function includesOnlyNonUrgentLanes(lanes) { + var UrgentLanes = SyncLane | InputContinuousLane | DefaultLane; + return (lanes & UrgentLanes) === NoLanes; + } + function includesOnlyTransitions(lanes) { + return (lanes & TransitionLanes) === lanes; + } + function includesBlockingLane(root, lanes) { + var SyncDefaultLanes = InputContinuousHydrationLane | InputContinuousLane | DefaultHydrationLane | DefaultLane; + return (lanes & SyncDefaultLanes) !== NoLanes; + } + function includesExpiredLane(root, lanes) { + // This is a separate check from includesBlockingLane because a lane can + // expire after a render has already started. + return (lanes & root.expiredLanes) !== NoLanes; + } + function isTransitionLane(lane) { + return (lane & TransitionLanes) !== NoLanes; + } + function claimNextTransitionLane() { + // Cycle through the lanes, assigning each new transition to the next lane. + // In most cases, this means every transition gets its own lane, until we + // run out of lanes and cycle back to the beginning. + var lane = nextTransitionLane; + nextTransitionLane <<= 1; + if ((nextTransitionLane & TransitionLanes) === NoLanes) { + nextTransitionLane = TransitionLane1; + } + return lane; + } + function claimNextRetryLane() { + var lane = nextRetryLane; + nextRetryLane <<= 1; + if ((nextRetryLane & RetryLanes) === NoLanes) { + nextRetryLane = RetryLane1; + } + return lane; + } + function getHighestPriorityLane(lanes) { + return lanes & -lanes; + } + function pickArbitraryLane(lanes) { + // This wrapper function gets inlined. Only exists so to communicate that it + // doesn't matter which bit is selected; you can pick any bit without + // affecting the algorithms where its used. Here I'm using + // getHighestPriorityLane because it requires the fewest operations. + return getHighestPriorityLane(lanes); + } + function pickArbitraryLaneIndex(lanes) { + return 31 - clz32(lanes); + } + function laneToIndex(lane) { + return pickArbitraryLaneIndex(lane); + } + function includesSomeLane(a, b) { + return (a & b) !== NoLanes; + } + function isSubsetOfLanes(set, subset) { + return (set & subset) === subset; + } + function mergeLanes(a, b) { + return a | b; + } + function removeLanes(set, subset) { + return set & ~subset; + } + function intersectLanes(a, b) { + return a & b; + } // Seems redundant, but it changes the type from a single lane (used for + // updates) to a group of lanes (used for flushing work). + + function laneToLanes(lane) { + return lane; + } + function createLaneMap(initial) { + // Intentionally pushing one by one. + // https://v8.dev/blog/elements-kinds#avoid-creating-holes + var laneMap = []; + for (var i = 0; i < TotalLanes; i++) { + laneMap.push(initial); + } + return laneMap; + } + function markRootUpdated(root, updateLane, eventTime) { + root.pendingLanes |= updateLane; // If there are any suspended transitions, it's possible this new update + // could unblock them. Clear the suspended lanes so that we can try rendering + // them again. + // + // TODO: We really only need to unsuspend only lanes that are in the + // `subtreeLanes` of the updated fiber, or the update lanes of the return + // path. This would exclude suspended updates in an unrelated sibling tree, + // since there's no way for this update to unblock it. + // + // We don't do this if the incoming update is idle, because we never process + // idle updates until after all the regular updates have finished; there's no + // way it could unblock a transition. + + if (updateLane !== IdleLane) { + root.suspendedLanes = NoLanes; + root.pingedLanes = NoLanes; + } + var eventTimes = root.eventTimes; + var index = laneToIndex(updateLane); // We can always overwrite an existing timestamp because we prefer the most + // recent event, and we assume time is monotonically increasing. + + eventTimes[index] = eventTime; + } + function markRootSuspended(root, suspendedLanes) { + root.suspendedLanes |= suspendedLanes; + root.pingedLanes &= ~suspendedLanes; // The suspended lanes are no longer CPU-bound. Clear their expiration times. + + var expirationTimes = root.expirationTimes; + var lanes = suspendedLanes; + while (lanes > 0) { + var index = pickArbitraryLaneIndex(lanes); + var lane = 1 << index; + expirationTimes[index] = NoTimestamp; + lanes &= ~lane; + } + } + function markRootPinged(root, pingedLanes, eventTime) { + root.pingedLanes |= root.suspendedLanes & pingedLanes; + } + function markRootFinished(root, remainingLanes) { + var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; + root.pendingLanes = remainingLanes; // Let's try everything again + + root.suspendedLanes = NoLanes; + root.pingedLanes = NoLanes; + root.expiredLanes &= remainingLanes; + root.mutableReadLanes &= remainingLanes; + root.entangledLanes &= remainingLanes; + var entanglements = root.entanglements; + var eventTimes = root.eventTimes; + var expirationTimes = root.expirationTimes; // Clear the lanes that no longer have pending work + + var lanes = noLongerPendingLanes; + while (lanes > 0) { + var index = pickArbitraryLaneIndex(lanes); + var lane = 1 << index; + entanglements[index] = NoLanes; + eventTimes[index] = NoTimestamp; + expirationTimes[index] = NoTimestamp; + lanes &= ~lane; + } + } + function markRootEntangled(root, entangledLanes) { + // In addition to entangling each of the given lanes with each other, we also + // have to consider _transitive_ entanglements. For each lane that is already + // entangled with *any* of the given lanes, that lane is now transitively + // entangled with *all* the given lanes. + // + // Translated: If C is entangled with A, then entangling A with B also + // entangles C with B. + // + // If this is hard to grasp, it might help to intentionally break this + // function and look at the tests that fail in ReactTransition-test.js. Try + // commenting out one of the conditions below. + var rootEntangledLanes = root.entangledLanes |= entangledLanes; + var entanglements = root.entanglements; + var lanes = rootEntangledLanes; + while (lanes) { + var index = pickArbitraryLaneIndex(lanes); + var lane = 1 << index; + if ( + // Is this one of the newly entangled lanes? + lane & entangledLanes | + // Is this lane transitively entangled with the newly entangled lanes? + entanglements[index] & entangledLanes) { + entanglements[index] |= entangledLanes; + } + lanes &= ~lane; + } + } + function getBumpedLaneForHydration(root, renderLanes) { + var renderLane = getHighestPriorityLane(renderLanes); + var lane; + switch (renderLane) { + case InputContinuousLane: + lane = InputContinuousHydrationLane; + break; + case DefaultLane: + lane = DefaultHydrationLane; + break; + case TransitionLane1: + case TransitionLane2: + case TransitionLane3: + case TransitionLane4: + case TransitionLane5: + case TransitionLane6: + case TransitionLane7: + case TransitionLane8: + case TransitionLane9: + case TransitionLane10: + case TransitionLane11: + case TransitionLane12: + case TransitionLane13: + case TransitionLane14: + case TransitionLane15: + case TransitionLane16: + case RetryLane1: + case RetryLane2: + case RetryLane3: + case RetryLane4: + case RetryLane5: + lane = TransitionHydrationLane; + break; + case IdleLane: + lane = IdleHydrationLane; + break; + default: + // Everything else is already either a hydration lane, or shouldn't + // be retried at a hydration lane. + lane = NoLane; + break; + } // Check if the lane we chose is suspended. If so, that indicates that we + // already attempted and failed to hydrate at that level. Also check if we're + // already rendering that lane, which is rare but could happen. + + if ((lane & (root.suspendedLanes | renderLanes)) !== NoLane) { + // Give up trying to hydrate and fall back to client render. + return NoLane; + } + return lane; + } + function addFiberToLanesMap(root, fiber, lanes) { + if (!isDevToolsPresent) { + return; + } + var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap; + while (lanes > 0) { + var index = laneToIndex(lanes); + var lane = 1 << index; + var updaters = pendingUpdatersLaneMap[index]; + updaters.add(fiber); + lanes &= ~lane; + } + } + function movePendingFibersToMemoized(root, lanes) { + if (!isDevToolsPresent) { + return; + } + var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap; + var memoizedUpdaters = root.memoizedUpdaters; + while (lanes > 0) { + var index = laneToIndex(lanes); + var lane = 1 << index; + var updaters = pendingUpdatersLaneMap[index]; + if (updaters.size > 0) { + updaters.forEach(function (fiber) { + var alternate = fiber.alternate; + if (alternate === null || !memoizedUpdaters.has(alternate)) { + memoizedUpdaters.add(fiber); + } + }); + updaters.clear(); + } + lanes &= ~lane; + } + } + function getTransitionsForLanes(root, lanes) { + { + return null; + } + } + var DiscreteEventPriority = SyncLane; + var ContinuousEventPriority = InputContinuousLane; + var DefaultEventPriority = DefaultLane; + var IdleEventPriority = IdleLane; + var currentUpdatePriority = NoLane; + function getCurrentUpdatePriority() { + return currentUpdatePriority; + } + function setCurrentUpdatePriority(newPriority) { + currentUpdatePriority = newPriority; + } + function higherEventPriority(a, b) { + return a !== 0 && a < b ? a : b; + } + function lowerEventPriority(a, b) { + return a === 0 || a > b ? a : b; + } + function isHigherEventPriority(a, b) { + return a !== 0 && a < b; + } + function lanesToEventPriority(lanes) { + var lane = getHighestPriorityLane(lanes); + if (!isHigherEventPriority(DiscreteEventPriority, lane)) { + return DiscreteEventPriority; + } + if (!isHigherEventPriority(ContinuousEventPriority, lane)) { + return ContinuousEventPriority; + } + if (includesNonIdleWork(lane)) { + return DefaultEventPriority; + } + return IdleEventPriority; + } + + // Renderers that don't support mutation + // can re-export everything from this module. + function shim() { + throw new Error("The current renderer does not support mutation. " + "This error is likely caused by a bug in React. " + "Please file an issue."); + } // Mutation (when unsupported) + var commitMount = shim; + + // Renderers that don't support hydration + // can re-export everything from this module. + function shim$1() { + throw new Error("The current renderer does not support hydration. " + "This error is likely caused by a bug in React. " + "Please file an issue."); + } // Hydration (when unsupported) + var isSuspenseInstancePending = shim$1; + var isSuspenseInstanceFallback = shim$1; + var getSuspenseInstanceFallbackErrorDetails = shim$1; + var registerSuspenseInstanceRetry = shim$1; + var hydrateTextInstance = shim$1; + var errorHydratingContainer = shim$1; + var _nativeFabricUIManage = nativeFabricUIManager, + createNode = _nativeFabricUIManage.createNode, + cloneNode = _nativeFabricUIManage.cloneNode, + cloneNodeWithNewChildren = _nativeFabricUIManage.cloneNodeWithNewChildren, + cloneNodeWithNewChildrenAndProps = _nativeFabricUIManage.cloneNodeWithNewChildrenAndProps, + cloneNodeWithNewProps = _nativeFabricUIManage.cloneNodeWithNewProps, + createChildNodeSet = _nativeFabricUIManage.createChildSet, + appendChildNode = _nativeFabricUIManage.appendChild, + appendChildNodeToSet = _nativeFabricUIManage.appendChildToSet, + completeRoot = _nativeFabricUIManage.completeRoot, + registerEventHandler = _nativeFabricUIManage.registerEventHandler, + fabricMeasure = _nativeFabricUIManage.measure, + fabricMeasureInWindow = _nativeFabricUIManage.measureInWindow, + fabricMeasureLayout = _nativeFabricUIManage.measureLayout, + FabricDefaultPriority = _nativeFabricUIManage.unstable_DefaultEventPriority, + FabricDiscretePriority = _nativeFabricUIManage.unstable_DiscreteEventPriority, + fabricGetCurrentEventPriority = _nativeFabricUIManage.unstable_getCurrentEventPriority, + _setNativeProps = _nativeFabricUIManage.setNativeProps; + var getViewConfigForType = ReactNativePrivateInterface.ReactNativeViewConfigRegistry.get; // Counter for uniquely identifying views. + // % 10 === 1 means it is a rootTag. + // % 2 === 0 means it is a Fabric tag. + // This means that they never overlap. + + var nextReactTag = 2; + + // TODO: Remove this conditional once all changes have propagated. + if (registerEventHandler) { + /** + * Register the event emitter with the native bridge + */ + registerEventHandler(dispatchEvent); + } + /** + * This is used for refs on host components. + */ + + var ReactFabricHostComponent = /*#__PURE__*/function () { + function ReactFabricHostComponent(tag, viewConfig, props, internalInstanceHandle) { + this._nativeTag = tag; + this.viewConfig = viewConfig; + this.currentProps = props; + this._internalInstanceHandle = internalInstanceHandle; + } + var _proto = ReactFabricHostComponent.prototype; + _proto.blur = function blur() { + ReactNativePrivateInterface.TextInputState.blurTextInput(this); + }; + _proto.focus = function focus() { + ReactNativePrivateInterface.TextInputState.focusTextInput(this); + }; + _proto.measure = function measure(callback) { + var stateNode = this._internalInstanceHandle.stateNode; + if (stateNode != null) { + fabricMeasure(stateNode.node, mountSafeCallback_NOT_REALLY_SAFE(this, callback)); + } + }; + _proto.measureInWindow = function measureInWindow(callback) { + var stateNode = this._internalInstanceHandle.stateNode; + if (stateNode != null) { + fabricMeasureInWindow(stateNode.node, mountSafeCallback_NOT_REALLY_SAFE(this, callback)); + } + }; + _proto.measureLayout = function measureLayout(relativeToNativeNode, onSuccess, onFail) /* currently unused */ + { + if (typeof relativeToNativeNode === "number" || !(relativeToNativeNode instanceof ReactFabricHostComponent)) { + { + error("Warning: ref.measureLayout must be called with a ref to a native component."); + } + return; + } + var toStateNode = this._internalInstanceHandle.stateNode; + var fromStateNode = relativeToNativeNode._internalInstanceHandle.stateNode; + if (toStateNode != null && fromStateNode != null) { + fabricMeasureLayout(toStateNode.node, fromStateNode.node, mountSafeCallback_NOT_REALLY_SAFE(this, onFail), mountSafeCallback_NOT_REALLY_SAFE(this, onSuccess)); + } + }; + _proto.setNativeProps = function setNativeProps(nativeProps) { + { + warnForStyleProps(nativeProps, this.viewConfig.validAttributes); + } + var updatePayload = create(nativeProps, this.viewConfig.validAttributes); + var stateNode = this._internalInstanceHandle.stateNode; + if (stateNode != null && updatePayload != null) { + _setNativeProps(stateNode.node, updatePayload); + } + }; // This API (addEventListener, removeEventListener) attempts to adhere to the + // w3 Level2 Events spec as much as possible, treating HostComponent as a DOM node. + // + // Unless otherwise noted, these methods should "just work" and adhere to the W3 specs. + // If they deviate in a way that is not explicitly noted here, you've found a bug! + // + // See: + // * https://www.w3.org/TR/DOM-Level-2-Events/events.html + // * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener + // * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener + // + // And notably, not implemented (yet?): + // * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent + // + // + // Deviations from spec/TODOs: + // (1) listener must currently be a function, we do not support EventListener objects yet. + // (2) we do not support the `signal` option / AbortSignal yet + + _proto.addEventListener_unstable = function addEventListener_unstable(eventType, listener, options) { + if (typeof eventType !== "string") { + throw new Error("addEventListener_unstable eventType must be a string"); + } + if (typeof listener !== "function") { + throw new Error("addEventListener_unstable listener must be a function"); + } // The third argument is either boolean indicating "captures" or an object. + + var optionsObj = typeof options === "object" && options !== null ? options : {}; + var capture = (typeof options === "boolean" ? options : optionsObj.capture) || false; + var once = optionsObj.once || false; + var passive = optionsObj.passive || false; + var signal = null; // TODO: implement signal/AbortSignal + + var eventListeners = this._eventListeners || {}; + if (this._eventListeners == null) { + this._eventListeners = eventListeners; + } + var namedEventListeners = eventListeners[eventType] || []; + if (eventListeners[eventType] == null) { + eventListeners[eventType] = namedEventListeners; + } + namedEventListeners.push({ + listener: listener, + invalidated: false, + options: { + capture: capture, + once: once, + passive: passive, + signal: signal + } + }); + }; // See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener + + _proto.removeEventListener_unstable = function removeEventListener_unstable(eventType, listener, options) { + // eventType and listener must be referentially equal to be removed from the listeners + // data structure, but in "options" we only check the `capture` flag, according to spec. + // That means if you add the same function as a listener with capture set to true and false, + // you must also call removeEventListener twice with capture set to true/false. + var optionsObj = typeof options === "object" && options !== null ? options : {}; + var capture = (typeof options === "boolean" ? options : optionsObj.capture) || false; // If there are no event listeners or named event listeners, we can bail early - our + // job is already done. + + var eventListeners = this._eventListeners; + if (!eventListeners) { + return; + } + var namedEventListeners = eventListeners[eventType]; + if (!namedEventListeners) { + return; + } // TODO: optimize this path to make remove cheaper + + eventListeners[eventType] = namedEventListeners.filter(function (listenerObj) { + return !(listenerObj.listener === listener && listenerObj.options.capture === capture); + }); + }; + return ReactFabricHostComponent; + }(); // eslint-disable-next-line no-unused-expressions + function appendInitialChild(parentInstance, child) { + appendChildNode(parentInstance.node, child.node); + } + function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) { + var tag = nextReactTag; + nextReactTag += 2; + var viewConfig = getViewConfigForType(type); + { + for (var key in viewConfig.validAttributes) { + if (props.hasOwnProperty(key)) { + ReactNativePrivateInterface.deepFreezeAndThrowOnMutationInDev(props[key]); + } + } + } + var updatePayload = create(props, viewConfig.validAttributes); + var node = createNode(tag, + // reactTag + viewConfig.uiViewClassName, + // viewName + rootContainerInstance, + // rootTag + updatePayload, + // props + internalInstanceHandle // internalInstanceHandle + ); + var component = new ReactFabricHostComponent(tag, viewConfig, props, internalInstanceHandle); + return { + node: node, + canonical: component + }; + } + function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) { + { + if (!hostContext.isInAParentText) { + error("Text strings must be rendered within a component."); + } + } + var tag = nextReactTag; + nextReactTag += 2; + var node = createNode(tag, + // reactTag + "RCTRawText", + // viewName + rootContainerInstance, + // rootTag + { + text: text + }, + // props + internalInstanceHandle // instance handle + ); + return { + node: node + }; + } + function getRootHostContext(rootContainerInstance) { + return { + isInAParentText: false + }; + } + function getChildHostContext(parentHostContext, type, rootContainerInstance) { + var prevIsInAParentText = parentHostContext.isInAParentText; + var isInAParentText = type === "AndroidTextInput" || + // Android + type === "RCTMultilineTextInputView" || + // iOS + type === "RCTSinglelineTextInputView" || + // iOS + type === "RCTText" || type === "RCTVirtualText"; // TODO: If this is an offscreen host container, we should reuse the + // parent context. + + if (prevIsInAParentText !== isInAParentText) { + return { + isInAParentText: isInAParentText + }; + } else { + return parentHostContext; + } + } + function getPublicInstance(instance) { + return instance.canonical; + } + function prepareForCommit(containerInfo) { + // Noop + return null; + } + function prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, hostContext) { + var viewConfig = instance.canonical.viewConfig; + var updatePayload = diff(oldProps, newProps, viewConfig.validAttributes); // TODO: If the event handlers have changed, we need to update the current props + // in the commit phase but there is no host config hook to do it yet. + // So instead we hack it by updating it in the render phase. + + instance.canonical.currentProps = newProps; + return updatePayload; + } + function resetAfterCommit(containerInfo) { + // Noop + } + function shouldSetTextContent(type, props) { + // TODO (bvaughn) Revisit this decision. + // Always returning false simplifies the createInstance() implementation, + // But creates an additional child Fiber for raw text children. + // No additional native views are created though. + // It's not clear to me which is better so I'm deferring for now. + // More context @ github.com/facebook/react/pull/8560#discussion_r92111303 + return false; + } + function getCurrentEventPriority() { + var currentEventPriority = fabricGetCurrentEventPriority ? fabricGetCurrentEventPriority() : null; + if (currentEventPriority != null) { + switch (currentEventPriority) { + case FabricDiscretePriority: + return DiscreteEventPriority; + case FabricDefaultPriority: + default: + return DefaultEventPriority; + } + } + return DefaultEventPriority; + } // The Fabric renderer is secondary to the existing React Native renderer. + + var warnsIfNotActing = false; + var scheduleTimeout = setTimeout; + var cancelTimeout = clearTimeout; + var noTimeout = -1; // ------------------- + function cloneInstance(instance, updatePayload, type, oldProps, newProps, internalInstanceHandle, keepChildren, recyclableInstance) { + var node = instance.node; + var clone; + if (keepChildren) { + if (updatePayload !== null) { + clone = cloneNodeWithNewProps(node, updatePayload); + } else { + clone = cloneNode(node); + } + } else { + if (updatePayload !== null) { + clone = cloneNodeWithNewChildrenAndProps(node, updatePayload); + } else { + clone = cloneNodeWithNewChildren(node); + } + } + return { + node: clone, + canonical: instance.canonical + }; + } + function cloneHiddenInstance(instance, type, props, internalInstanceHandle) { + var viewConfig = instance.canonical.viewConfig; + var node = instance.node; + var updatePayload = create({ + style: { + display: "none" + } + }, viewConfig.validAttributes); + return { + node: cloneNodeWithNewProps(node, updatePayload), + canonical: instance.canonical + }; + } + function cloneHiddenTextInstance(instance, text, internalInstanceHandle) { + throw new Error("Not yet implemented."); + } + function createContainerChildSet(container) { + return createChildNodeSet(container); + } + function appendChildToContainerChildSet(childSet, child) { + appendChildNodeToSet(childSet, child.node); + } + function finalizeContainerChildren(container, newChildren) { + completeRoot(container, newChildren); + } + function replaceContainerChildren(container, newChildren) {} + function preparePortalMount(portalInstance) { + // noop + } + var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; + function describeBuiltInComponentFrame(name, source, ownerFn) { + { + var ownerName = null; + if (ownerFn) { + ownerName = ownerFn.displayName || ownerFn.name || null; + } + return describeComponentFrame(name, source, ownerName); + } + } + var componentFrameCache; + { + var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap(); + } + var BEFORE_SLASH_RE = /^(.*)[\\\/]/; + function describeComponentFrame(name, source, ownerName) { + var sourceInfo = ""; + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ""); // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + if (match) { + var pathBeforeSlash = match[1]; + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ""); + fileName = folderName + "/" + fileName; + } + } + } + sourceInfo = " (at " + fileName + ":" + source.lineNumber + ")"; + } else if (ownerName) { + sourceInfo = " (created by " + ownerName + ")"; + } + return "\n in " + (name || "Unknown") + sourceInfo; + } + function describeClassComponentFrame(ctor, source, ownerFn) { + { + return describeFunctionComponentFrame(ctor, source, ownerFn); + } + } + function describeFunctionComponentFrame(fn, source, ownerFn) { + { + if (!fn) { + return ""; + } + var name = fn.displayName || fn.name || null; + var ownerName = null; + if (ownerFn) { + ownerName = ownerFn.displayName || ownerFn.name || null; + } + return describeComponentFrame(name, source, ownerName); + } + } + function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { + if (type == null) { + return ""; + } + if (typeof type === "function") { + { + return describeFunctionComponentFrame(type, source, ownerFn); + } + } + if (typeof type === "string") { + return describeBuiltInComponentFrame(type, source, ownerFn); + } + switch (type) { + case REACT_SUSPENSE_TYPE: + return describeBuiltInComponentFrame("Suspense", source, ownerFn); + case REACT_SUSPENSE_LIST_TYPE: + return describeBuiltInComponentFrame("SuspenseList", source, ownerFn); + } + if (typeof type === "object") { + switch (type.$$typeof) { + case REACT_FORWARD_REF_TYPE: + return describeFunctionComponentFrame(type.render, source, ownerFn); + case REACT_MEMO_TYPE: + // Memo may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + // Lazy may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); + } catch (x) {} + } + } + } + return ""; + } + var hasOwnProperty = Object.prototype.hasOwnProperty; + var loggedTypeFailures = {}; + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + function setCurrentlyValidatingElement(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame.setExtraStackFrame(null); + } + } + } + function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(hasOwnProperty); + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== "function") { + // eslint-disable-next-line react-internal/prod-error-codes + var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; " + "it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`." + "This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); + err.name = "Invariant Violation"; + throw err; + } + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); + } catch (ex) { + error$1 = ex; + } + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + error("%s: type specification of %s" + " `%s` is invalid; the type checker " + "function must return `null` or an `Error` but returned a %s. " + "You may have forgotten to pass an argument to the type checker " + "creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and " + "shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1); + setCurrentlyValidatingElement(null); + } + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + error("Failed %s type: %s", location, error$1.message); + setCurrentlyValidatingElement(null); + } + } + } + } + } + var valueStack = []; + var fiberStack; + { + fiberStack = []; + } + var index = -1; + function createCursor(defaultValue) { + return { + current: defaultValue + }; + } + function pop(cursor, fiber) { + if (index < 0) { + { + error("Unexpected pop."); + } + return; + } + { + if (fiber !== fiberStack[index]) { + error("Unexpected Fiber popped."); + } + } + cursor.current = valueStack[index]; + valueStack[index] = null; + { + fiberStack[index] = null; + } + index--; + } + function push(cursor, value, fiber) { + index++; + valueStack[index] = cursor.current; + { + fiberStack[index] = fiber; + } + cursor.current = value; + } + var warnedAboutMissingGetChildContext; + { + warnedAboutMissingGetChildContext = {}; + } + var emptyContextObject = {}; + { + Object.freeze(emptyContextObject); + } // A cursor to the current merged context object on the stack. + + var contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed. + + var didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack. + // We use this to get access to the parent context after we have already + // pushed the next context provider, and now need to merge their contexts. + + var previousContext = emptyContextObject; + function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) { + { + if (didPushOwnContextIfProvider && isContextProvider(Component)) { + // If the fiber is a context provider itself, when we read its context + // we may have already pushed its own child context on the stack. A context + // provider should not "see" its own child context. Therefore we read the + // previous (parent) context instead for a context provider. + return previousContext; + } + return contextStackCursor.current; + } + } + function cacheContext(workInProgress, unmaskedContext, maskedContext) { + { + var instance = workInProgress.stateNode; + instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext; + instance.__reactInternalMemoizedMaskedChildContext = maskedContext; + } + } + function getMaskedContext(workInProgress, unmaskedContext) { + { + var type = workInProgress.type; + var contextTypes = type.contextTypes; + if (!contextTypes) { + return emptyContextObject; + } // Avoid recreating masked context unless unmasked context has changed. + // Failing to do this will result in unnecessary calls to componentWillReceiveProps. + // This may trigger infinite loops if componentWillReceiveProps calls setState. + + var instance = workInProgress.stateNode; + if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) { + return instance.__reactInternalMemoizedMaskedChildContext; + } + var context = {}; + for (var key in contextTypes) { + context[key] = unmaskedContext[key]; + } + { + var name = getComponentNameFromFiber(workInProgress) || "Unknown"; + checkPropTypes(contextTypes, context, "context", name); + } // Cache unmasked context so we can avoid recreating masked context unless necessary. + // Context is created before the class component is instantiated so check for instance. + + if (instance) { + cacheContext(workInProgress, unmaskedContext, context); + } + return context; + } + } + function hasContextChanged() { + { + return didPerformWorkStackCursor.current; + } + } + function isContextProvider(type) { + { + var childContextTypes = type.childContextTypes; + return childContextTypes !== null && childContextTypes !== undefined; + } + } + function popContext(fiber) { + { + pop(didPerformWorkStackCursor, fiber); + pop(contextStackCursor, fiber); + } + } + function popTopLevelContextObject(fiber) { + { + pop(didPerformWorkStackCursor, fiber); + pop(contextStackCursor, fiber); + } + } + function pushTopLevelContextObject(fiber, context, didChange) { + { + if (contextStackCursor.current !== emptyContextObject) { + throw new Error("Unexpected context found on stack. " + "This error is likely caused by a bug in React. Please file an issue."); + } + push(contextStackCursor, context, fiber); + push(didPerformWorkStackCursor, didChange, fiber); + } + } + function processChildContext(fiber, type, parentContext) { + { + var instance = fiber.stateNode; + var childContextTypes = type.childContextTypes; // TODO (bvaughn) Replace this behavior with an invariant() in the future. + // It has only been added in Fiber to match the (unintentional) behavior in Stack. + + if (typeof instance.getChildContext !== "function") { + { + var componentName = getComponentNameFromFiber(fiber) || "Unknown"; + if (!warnedAboutMissingGetChildContext[componentName]) { + warnedAboutMissingGetChildContext[componentName] = true; + error("%s.childContextTypes is specified but there is no getChildContext() method " + "on the instance. You can either define getChildContext() on %s or remove " + "childContextTypes from it.", componentName, componentName); + } + } + return parentContext; + } + var childContext = instance.getChildContext(); + for (var contextKey in childContext) { + if (!(contextKey in childContextTypes)) { + throw new Error((getComponentNameFromFiber(fiber) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.'); + } + } + { + var name = getComponentNameFromFiber(fiber) || "Unknown"; + checkPropTypes(childContextTypes, childContext, "child context", name); + } + return assign({}, parentContext, childContext); + } + } + function pushContextProvider(workInProgress) { + { + var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity. + // If the instance does not exist yet, we will push null at first, + // and replace it on the stack later when invalidating the context. + + var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later. + // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates. + + previousContext = contextStackCursor.current; + push(contextStackCursor, memoizedMergedChildContext, workInProgress); + push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress); + return true; + } + } + function invalidateContextProvider(workInProgress, type, didChange) { + { + var instance = workInProgress.stateNode; + if (!instance) { + throw new Error("Expected to have an instance by this point. " + "This error is likely caused by a bug in React. Please file an issue."); + } + if (didChange) { + // Merge parent and own context. + // Skip this if we're not updating due to sCU. + // This avoids unnecessarily recomputing memoized values. + var mergedContext = processChildContext(workInProgress, type, previousContext); + instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one. + // It is important to unwind the context in the reverse order. + + pop(didPerformWorkStackCursor, workInProgress); + pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed. + + push(contextStackCursor, mergedContext, workInProgress); + push(didPerformWorkStackCursor, didChange, workInProgress); + } else { + pop(didPerformWorkStackCursor, workInProgress); + push(didPerformWorkStackCursor, didChange, workInProgress); + } + } + } + function findCurrentUnmaskedContext(fiber) { + { + // Currently this is only used with renderSubtreeIntoContainer; not sure if it + // makes sense elsewhere + if (!isFiberMounted(fiber) || fiber.tag !== ClassComponent) { + throw new 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 node = fiber; + do { + switch (node.tag) { + case HostRoot: + return node.stateNode.context; + case ClassComponent: + { + var Component = node.type; + if (isContextProvider(Component)) { + return node.stateNode.__reactInternalMemoizedMergedChildContext; + } + break; + } + } + node = node.return; + } while (node !== null); + throw new Error("Found unexpected detached subtree parent. " + "This error is likely caused by a bug in React. Please file an issue."); + } + } + var LegacyRoot = 0; + var ConcurrentRoot = 1; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + function is(x, y) { + return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare + ; + } + var objectIs = typeof Object.is === "function" ? Object.is : is; + var syncQueue = null; + var includesLegacySyncCallbacks = false; + var isFlushingSyncQueue = false; + function scheduleSyncCallback(callback) { + // Push this callback into an internal queue. We'll flush these either in + // the next tick, or earlier if something calls `flushSyncCallbackQueue`. + if (syncQueue === null) { + syncQueue = [callback]; + } else { + // Push onto existing queue. Don't need to schedule a callback because + // we already scheduled one when we created the queue. + syncQueue.push(callback); + } + } + function scheduleLegacySyncCallback(callback) { + includesLegacySyncCallbacks = true; + scheduleSyncCallback(callback); + } + function flushSyncCallbacksOnlyInLegacyMode() { + // Only flushes the queue if there's a legacy sync callback scheduled. + // TODO: There's only a single type of callback: performSyncOnWorkOnRoot. So + // it might make more sense for the queue to be a list of roots instead of a + // list of generic callbacks. Then we can have two: one for legacy roots, one + // for concurrent roots. And this method would only flush the legacy ones. + if (includesLegacySyncCallbacks) { + flushSyncCallbacks(); + } + } + function flushSyncCallbacks() { + if (!isFlushingSyncQueue && syncQueue !== null) { + // Prevent re-entrance. + isFlushingSyncQueue = true; + var i = 0; + var previousUpdatePriority = getCurrentUpdatePriority(); + try { + var isSync = true; + var queue = syncQueue; // TODO: Is this necessary anymore? The only user code that runs in this + // queue is in the render or commit phases. + + setCurrentUpdatePriority(DiscreteEventPriority); + for (; i < queue.length; i++) { + var callback = queue[i]; + do { + callback = callback(isSync); + } while (callback !== null); + } + syncQueue = null; + includesLegacySyncCallbacks = false; + } catch (error) { + // If something throws, leave the remaining callbacks on the queue. + if (syncQueue !== null) { + syncQueue = syncQueue.slice(i + 1); + } // Resume flushing in the next tick + + scheduleCallback(ImmediatePriority, flushSyncCallbacks); + throw error; + } finally { + setCurrentUpdatePriority(previousUpdatePriority); + isFlushingSyncQueue = false; + } + } + return null; + } + + // This is imported by the event replaying implementation in React DOM. It's + // in a separate file to break a circular dependency between the renderer and + // the reconciler. + function isRootDehydrated(root) { + var currentState = root.current.memoizedState; + return currentState.isDehydrated; + } + + // TODO: Use the unified fiber stack module instead of this local one? + // Intentionally not using it yet to derisk the initial implementation, because + // the way we push/pop these values is a bit unusual. If there's a mistake, I'd + // rather the ids be wrong than crash the whole reconciler. + var forkStack = []; + var forkStackIndex = 0; + var treeForkProvider = null; + var treeForkCount = 0; + var idStack = []; + var idStackIndex = 0; + var treeContextProvider = null; + var treeContextId = 1; + var treeContextOverflow = ""; + function popTreeContext(workInProgress) { + // Restore the previous values. + // This is a bit more complicated than other context-like modules in Fiber + // because the same Fiber may appear on the stack multiple times and for + // different reasons. We have to keep popping until the work-in-progress is + // no longer at the top of the stack. + while (workInProgress === treeForkProvider) { + treeForkProvider = forkStack[--forkStackIndex]; + forkStack[forkStackIndex] = null; + treeForkCount = forkStack[--forkStackIndex]; + forkStack[forkStackIndex] = null; + } + while (workInProgress === treeContextProvider) { + treeContextProvider = idStack[--idStackIndex]; + idStack[idStackIndex] = null; + treeContextOverflow = idStack[--idStackIndex]; + idStack[idStackIndex] = null; + treeContextId = idStack[--idStackIndex]; + idStack[idStackIndex] = null; + } + } + var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches + // due to earlier mismatches or a suspended fiber. + + var didSuspendOrErrorDEV = false; // Hydration errors that were thrown inside this boundary + + var hydrationErrors = null; + function didSuspendOrErrorWhileHydratingDEV() { + { + return didSuspendOrErrorDEV; + } + } + function reenterHydrationStateFromDehydratedSuspenseInstance(fiber, suspenseInstance, treeContext) { + { + return false; + } + } + function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) { + { + throw new Error("Expected prepareToHydrateHostInstance() to never be called. " + "This error is likely caused by a bug in React. Please file an issue."); + } + } + function prepareToHydrateHostTextInstance(fiber) { + { + throw new Error("Expected prepareToHydrateHostTextInstance() to never be called. " + "This error is likely caused by a bug in React. Please file an issue."); + } + var shouldUpdate = hydrateTextInstance(); + } + function prepareToHydrateHostSuspenseInstance(fiber) { + { + throw new Error("Expected prepareToHydrateHostSuspenseInstance() to never be called. " + "This error is likely caused by a bug in React. Please file an issue."); + } + } + function popHydrationState(fiber) { + { + return false; + } + } + function upgradeHydrationErrorsToRecoverable() { + if (hydrationErrors !== null) { + // Successfully completed a forced client render. The errors that occurred + // during the hydration attempt are now recovered. We will log them in + // commit phase, once the entire tree has finished. + queueRecoverableErrors(hydrationErrors); + hydrationErrors = null; + } + } + function getIsHydrating() { + return isHydrating; + } + function queueHydrationError(error) { + if (hydrationErrors === null) { + hydrationErrors = [error]; + } else { + hydrationErrors.push(error); + } + } + var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; + var NoTransition = null; + function requestCurrentTransition() { + return ReactCurrentBatchConfig.transition; + } + + /** + * Performs equality by iterating through keys on an object and returning false + * when any key has values which are not strictly equal between the arguments. + * Returns true when the values of all keys are strictly equal. + */ + + function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) { + return true; + } + if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { + return false; + } + var keysA = Object.keys(objA); + var keysB = Object.keys(objB); + if (keysA.length !== keysB.length) { + return false; + } // Test for A's keys different from B. + + for (var i = 0; i < keysA.length; i++) { + var currentKey = keysA[i]; + if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey])) { + return false; + } + } + return true; + } + function describeFiber(fiber) { + var owner = fiber._debugOwner ? fiber._debugOwner.type : null; + var source = fiber._debugSource; + switch (fiber.tag) { + case HostComponent: + return describeBuiltInComponentFrame(fiber.type, source, owner); + case LazyComponent: + return describeBuiltInComponentFrame("Lazy", source, owner); + case SuspenseComponent: + return describeBuiltInComponentFrame("Suspense", source, owner); + case SuspenseListComponent: + return describeBuiltInComponentFrame("SuspenseList", source, owner); + case FunctionComponent: + case IndeterminateComponent: + case SimpleMemoComponent: + return describeFunctionComponentFrame(fiber.type, source, owner); + case ForwardRef: + return describeFunctionComponentFrame(fiber.type.render, source, owner); + case ClassComponent: + return describeClassComponentFrame(fiber.type, source, owner); + default: + return ""; + } + } + function getStackByFiberInDevAndProd(workInProgress) { + try { + var info = ""; + var node = workInProgress; + do { + info += describeFiber(node); + node = node.return; + } while (node); + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } + } + var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + var current = null; + var isRendering = false; + function getCurrentFiberOwnerNameInDevOrNull() { + { + if (current === null) { + return null; + } + var owner = current._debugOwner; + if (owner !== null && typeof owner !== "undefined") { + return getComponentNameFromFiber(owner); + } + } + return null; + } + function getCurrentFiberStackInDev() { + { + if (current === null) { + return ""; + } // Safe because if current fiber exists, we are reconciling, + // and it is guaranteed to be the work-in-progress version. + + return getStackByFiberInDevAndProd(current); + } + } + function resetCurrentFiber() { + { + ReactDebugCurrentFrame$1.getCurrentStack = null; + current = null; + isRendering = false; + } + } + function setCurrentFiber(fiber) { + { + ReactDebugCurrentFrame$1.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev; + current = fiber; + isRendering = false; + } + } + function getCurrentFiber() { + { + return current; + } + } + function setIsRendering(rendering) { + { + isRendering = rendering; + } + } + var ReactStrictModeWarnings = { + recordUnsafeLifecycleWarnings: function recordUnsafeLifecycleWarnings(fiber, instance) {}, + flushPendingUnsafeLifecycleWarnings: function flushPendingUnsafeLifecycleWarnings() {}, + recordLegacyContextWarning: function recordLegacyContextWarning(fiber, instance) {}, + flushLegacyContextWarning: function flushLegacyContextWarning() {}, + discardPendingWarnings: function discardPendingWarnings() {} + }; + { + var findStrictRoot = function findStrictRoot(fiber) { + var maybeStrictRoot = null; + var node = fiber; + while (node !== null) { + if (node.mode & StrictLegacyMode) { + maybeStrictRoot = node; + } + node = node.return; + } + return maybeStrictRoot; + }; + var setToSortedString = function setToSortedString(set) { + var array = []; + set.forEach(function (value) { + array.push(value); + }); + return array.sort().join(", "); + }; + var pendingComponentWillMountWarnings = []; + var pendingUNSAFE_ComponentWillMountWarnings = []; + var pendingComponentWillReceivePropsWarnings = []; + var pendingUNSAFE_ComponentWillReceivePropsWarnings = []; + var pendingComponentWillUpdateWarnings = []; + var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about. + + var didWarnAboutUnsafeLifecycles = new Set(); + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) { + // Dedupe strategy: Warn once per component. + if (didWarnAboutUnsafeLifecycles.has(fiber.type)) { + return; + } + if (typeof instance.componentWillMount === "function" && + // Don't warn about react-lifecycles-compat polyfilled components. + instance.componentWillMount.__suppressDeprecationWarning !== true) { + pendingComponentWillMountWarnings.push(fiber); + } + if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillMount === "function") { + pendingUNSAFE_ComponentWillMountWarnings.push(fiber); + } + if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { + pendingComponentWillReceivePropsWarnings.push(fiber); + } + if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillReceiveProps === "function") { + pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber); + } + if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { + pendingComponentWillUpdateWarnings.push(fiber); + } + if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillUpdate === "function") { + pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber); + } + }; + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () { + // We do an initial pass to gather component names + var componentWillMountUniqueNames = new Set(); + if (pendingComponentWillMountWarnings.length > 0) { + pendingComponentWillMountWarnings.forEach(function (fiber) { + componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingComponentWillMountWarnings = []; + } + var UNSAFE_componentWillMountUniqueNames = new Set(); + if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) { + pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) { + UNSAFE_componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingUNSAFE_ComponentWillMountWarnings = []; + } + var componentWillReceivePropsUniqueNames = new Set(); + if (pendingComponentWillReceivePropsWarnings.length > 0) { + pendingComponentWillReceivePropsWarnings.forEach(function (fiber) { + componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingComponentWillReceivePropsWarnings = []; + } + var UNSAFE_componentWillReceivePropsUniqueNames = new Set(); + if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) { + pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) { + UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingUNSAFE_ComponentWillReceivePropsWarnings = []; + } + var componentWillUpdateUniqueNames = new Set(); + if (pendingComponentWillUpdateWarnings.length > 0) { + pendingComponentWillUpdateWarnings.forEach(function (fiber) { + componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingComponentWillUpdateWarnings = []; + } + var UNSAFE_componentWillUpdateUniqueNames = new Set(); + if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) { + pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) { + UNSAFE_componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingUNSAFE_ComponentWillUpdateWarnings = []; + } // Finally, we flush all the warnings + // UNSAFE_ ones before the deprecated ones, since they'll be 'louder' + + if (UNSAFE_componentWillMountUniqueNames.size > 0) { + var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames); + error("Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. " + "See https://react.dev/link/unsafe-component-lifecycles for details.\n\n" + "* Move code with side effects to componentDidMount, and set initial state in the constructor.\n" + "\nPlease update the following components: %s", sortedNames); + } + if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) { + var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames); + error("Using UNSAFE_componentWillReceiveProps in strict mode is not recommended " + "and may indicate bugs in your code. " + "See https://react.dev/link/unsafe-component-lifecycles for details.\n\n" + "* Move data fetching code or side effects to componentDidUpdate.\n" + "* If you're updating state whenever props change, " + "refactor your code to use memoization techniques or move it to " + "static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state\n" + "\nPlease update the following components: %s", _sortedNames); + } + if (UNSAFE_componentWillUpdateUniqueNames.size > 0) { + var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames); + error("Using UNSAFE_componentWillUpdate in strict mode is not recommended " + "and may indicate bugs in your code. " + "See https://react.dev/link/unsafe-component-lifecycles for details.\n\n" + "* Move data fetching code or side effects to componentDidUpdate.\n" + "\nPlease update the following components: %s", _sortedNames2); + } + if (componentWillMountUniqueNames.size > 0) { + var _sortedNames3 = setToSortedString(componentWillMountUniqueNames); + warn("componentWillMount has been renamed, and is not recommended for use. " + "See https://react.dev/link/unsafe-component-lifecycles for details.\n\n" + "* Move code with side effects to componentDidMount, and set initial state in the constructor.\n" + "* Rename componentWillMount to UNSAFE_componentWillMount to suppress " + "this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. " + "To rename all deprecated lifecycles to their new names, you can run " + "`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n" + "\nPlease update the following components: %s", _sortedNames3); + } + if (componentWillReceivePropsUniqueNames.size > 0) { + var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames); + warn("componentWillReceiveProps has been renamed, and is not recommended for use. " + "See https://react.dev/link/unsafe-component-lifecycles for details.\n\n" + "* Move data fetching code or side effects to componentDidUpdate.\n" + "* If you're updating state whenever props change, refactor your " + "code to use memoization techniques or move it to " + "static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state\n" + "* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress " + "this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. " + "To rename all deprecated lifecycles to their new names, you can run " + "`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n" + "\nPlease update the following components: %s", _sortedNames4); + } + if (componentWillUpdateUniqueNames.size > 0) { + var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames); + warn("componentWillUpdate has been renamed, and is not recommended for use. " + "See https://react.dev/link/unsafe-component-lifecycles for details.\n\n" + "* Move data fetching code or side effects to componentDidUpdate.\n" + "* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress " + "this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. " + "To rename all deprecated lifecycles to their new names, you can run " + "`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n" + "\nPlease update the following components: %s", _sortedNames5); + } + }; + var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about. + + var didWarnAboutLegacyContext = new Set(); + ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) { + var strictRoot = findStrictRoot(fiber); + if (strictRoot === null) { + error("Expected to find a StrictMode component in a strict mode tree. " + "This error is likely caused by a bug in React. Please file an issue."); + return; + } // Dedup strategy: Warn once per component. + + if (didWarnAboutLegacyContext.has(fiber.type)) { + return; + } + var warningsForRoot = pendingLegacyContextWarning.get(strictRoot); + if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === "function") { + if (warningsForRoot === undefined) { + warningsForRoot = []; + pendingLegacyContextWarning.set(strictRoot, warningsForRoot); + } + warningsForRoot.push(fiber); + } + }; + ReactStrictModeWarnings.flushLegacyContextWarning = function () { + pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) { + if (fiberArray.length === 0) { + return; + } + var firstFiber = fiberArray[0]; + var uniqueNames = new Set(); + fiberArray.forEach(function (fiber) { + uniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); + didWarnAboutLegacyContext.add(fiber.type); + }); + var sortedNames = setToSortedString(uniqueNames); + try { + setCurrentFiber(firstFiber); + error("Legacy context API has been detected within a strict-mode tree." + "\n\nThe old API will be supported in all 16.x releases, but applications " + "using it should migrate to the new version." + "\n\nPlease update the following components: %s" + "\n\nLearn more about this warning here: https://react.dev/link/legacy-context", sortedNames); + } finally { + resetCurrentFiber(); + } + }); + }; + ReactStrictModeWarnings.discardPendingWarnings = function () { + pendingComponentWillMountWarnings = []; + pendingUNSAFE_ComponentWillMountWarnings = []; + pendingComponentWillReceivePropsWarnings = []; + pendingUNSAFE_ComponentWillReceivePropsWarnings = []; + pendingComponentWillUpdateWarnings = []; + pendingUNSAFE_ComponentWillUpdateWarnings = []; + pendingLegacyContextWarning = new Map(); + }; + } + + /* + * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol + * and Temporal.* types. See https://github.com/facebook/react/pull/22064. + * + * The functions in this module will throw an easier-to-understand, + * easier-to-debug exception with a clear errors message message explaining the + * problem. (Instead of a confusing exception thrown inside the implementation + * of the `value` object). + */ + // $FlowFixMe only called in DEV, so void return is not possible. + function typeName(value) { + { + // toStringTag is needed for namespaced types like Temporal.Instant + var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; + var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; + return type; + } + } // $FlowFixMe only called in DEV, so void return is not possible. + + function willCoercionThrow(value) { + { + try { + testStringCoercion(value); + return false; + } catch (e) { + return true; + } + } + } + function testStringCoercion(value) { + // If you ended up here by following an exception call stack, here's what's + // happened: you supplied an object or symbol value to React (as a prop, key, + // DOM attribute, CSS property, string ref, etc.) and when React tried to + // coerce it to a string using `'' + value`, an exception was thrown. + // + // The most common types that will cause this exception are `Symbol` instances + // and Temporal objects like `Temporal.Instant`. But any object that has a + // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this + // exception. (Library authors do this to prevent users from using built-in + // numeric operators like `+` or comparison operators like `>=` because custom + // methods are needed to perform accurate arithmetic or comparison.) + // + // To fix the problem, coerce this object or symbol value to a string before + // passing it to React. The most reliable way is usually `String(value)`. + // + // To find which value is throwing, check the browser or debugger console. + // Before this exception was thrown, there should be `console.error` output + // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the + // problem and how that type was used: key, atrribute, input value prop, etc. + // In most cases, this console output also shows the component and its + // ancestor components where the exception happened. + // + // eslint-disable-next-line react-internal/safe-string-coercion + return "" + value; + } + function checkKeyStringCoercion(value) { + { + if (willCoercionThrow(value)) { + error("The provided key is an unsupported type %s." + " This value must be coerced to a string before before using it here.", typeName(value)); + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + function checkPropStringCoercion(value, propName) { + { + if (willCoercionThrow(value)) { + error("The provided `%s` prop is an unsupported type %s." + " This value must be coerced to a string before before using it here.", propName, typeName(value)); + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + function resolveDefaultProps(Component, baseProps) { + if (Component && Component.defaultProps) { + // Resolve default props. Taken from ReactElement + var props = assign({}, baseProps); + var defaultProps = Component.defaultProps; + for (var propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + return props; + } + return baseProps; + } + var valueCursor = createCursor(null); + var rendererSigil; + { + // Use this to detect multiple renderers using the same context + rendererSigil = {}; + } + var currentlyRenderingFiber = null; + var lastContextDependency = null; + var lastFullyObservedContext = null; + var isDisallowedContextReadInDEV = false; + function resetContextDependencies() { + // This is called right before React yields execution, to ensure `readContext` + // cannot be called outside the render phase. + currentlyRenderingFiber = null; + lastContextDependency = null; + lastFullyObservedContext = null; + { + isDisallowedContextReadInDEV = false; + } + } + function enterDisallowedContextReadInDEV() { + { + isDisallowedContextReadInDEV = true; + } + } + function exitDisallowedContextReadInDEV() { + { + isDisallowedContextReadInDEV = false; + } + } + function pushProvider(providerFiber, context, nextValue) { + { + push(valueCursor, context._currentValue2, providerFiber); + context._currentValue2 = nextValue; + { + if (context._currentRenderer2 !== undefined && context._currentRenderer2 !== null && context._currentRenderer2 !== rendererSigil) { + error("Detected multiple renderers concurrently rendering the " + "same context provider. This is currently unsupported."); + } + context._currentRenderer2 = rendererSigil; + } + } + } + function popProvider(context, providerFiber) { + var currentValue = valueCursor.current; + pop(valueCursor, providerFiber); + { + { + context._currentValue2 = currentValue; + } + } + } + function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { + // Update the child lanes of all the ancestors, including the alternates. + var node = parent; + while (node !== null) { + var alternate = node.alternate; + if (!isSubsetOfLanes(node.childLanes, renderLanes)) { + node.childLanes = mergeLanes(node.childLanes, renderLanes); + if (alternate !== null) { + alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes); + } + } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes)) { + alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes); + } + if (node === propagationRoot) { + break; + } + node = node.return; + } + { + if (node !== propagationRoot) { + error("Expected to find the propagation root when scheduling context work. " + "This error is likely caused by a bug in React. Please file an issue."); + } + } + } + function propagateContextChange(workInProgress, context, renderLanes) { + { + propagateContextChange_eager(workInProgress, context, renderLanes); + } + } + function propagateContextChange_eager(workInProgress, context, renderLanes) { + var fiber = workInProgress.child; + if (fiber !== null) { + // Set the return pointer of the child to the work-in-progress fiber. + fiber.return = workInProgress; + } + while (fiber !== null) { + var nextFiber = void 0; // Visit this fiber. + + var list = fiber.dependencies; + if (list !== null) { + nextFiber = fiber.child; + var dependency = list.firstContext; + while (dependency !== null) { + // Check if the context matches. + if (dependency.context === context) { + // Match! Schedule an update on this fiber. + if (fiber.tag === ClassComponent) { + // Schedule a force update on the work-in-progress. + var lane = pickArbitraryLane(renderLanes); + var update = createUpdate(NoTimestamp, lane); + update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the + // update to the current fiber, too, which means it will persist even if + // this render is thrown away. Since it's a race condition, not sure it's + // worth fixing. + // Inlined `enqueueUpdate` to remove interleaved update check + + var updateQueue = fiber.updateQueue; + if (updateQueue === null) ;else { + var sharedQueue = updateQueue.shared; + var pending = sharedQueue.pending; + if (pending === null) { + // This is the first update. Create a circular list. + update.next = update; + } else { + update.next = pending.next; + pending.next = update; + } + sharedQueue.pending = update; + } + } + fiber.lanes = mergeLanes(fiber.lanes, renderLanes); + var alternate = fiber.alternate; + if (alternate !== null) { + alternate.lanes = mergeLanes(alternate.lanes, renderLanes); + } + scheduleContextWorkOnParentPath(fiber.return, renderLanes, workInProgress); // Mark the updated lanes on the list, too. + + list.lanes = mergeLanes(list.lanes, renderLanes); // Since we already found a match, we can stop traversing the + // dependency list. + + break; + } + dependency = dependency.next; + } + } else if (fiber.tag === ContextProvider) { + // Don't scan deeper if this is a matching provider + nextFiber = fiber.type === workInProgress.type ? null : fiber.child; + } else if (fiber.tag === DehydratedFragment) { + // If a dehydrated suspense boundary is in this subtree, we don't know + // if it will have any context consumers in it. The best we can do is + // mark it as having updates. + var parentSuspense = fiber.return; + if (parentSuspense === null) { + throw new Error("We just came from a parent so we must have had a parent. This is a bug in React."); + } + parentSuspense.lanes = mergeLanes(parentSuspense.lanes, renderLanes); + var _alternate = parentSuspense.alternate; + if (_alternate !== null) { + _alternate.lanes = mergeLanes(_alternate.lanes, renderLanes); + } // This is intentionally passing this fiber as the parent + // because we want to schedule this fiber as having work + // on its children. We'll use the childLanes on + // this fiber to indicate that a context has changed. + + scheduleContextWorkOnParentPath(parentSuspense, renderLanes, workInProgress); + nextFiber = fiber.sibling; + } else { + // Traverse down. + nextFiber = fiber.child; + } + if (nextFiber !== null) { + // Set the return pointer of the child to the work-in-progress fiber. + nextFiber.return = fiber; + } else { + // No child. Traverse to next sibling. + nextFiber = fiber; + while (nextFiber !== null) { + if (nextFiber === workInProgress) { + // We're back to the root of this subtree. Exit. + nextFiber = null; + break; + } + var sibling = nextFiber.sibling; + if (sibling !== null) { + // Set the return pointer of the sibling to the work-in-progress fiber. + sibling.return = nextFiber.return; + nextFiber = sibling; + break; + } // No more siblings. Traverse up. + + nextFiber = nextFiber.return; + } + } + fiber = nextFiber; + } + } + function prepareToReadContext(workInProgress, renderLanes) { + currentlyRenderingFiber = workInProgress; + lastContextDependency = null; + lastFullyObservedContext = null; + var dependencies = workInProgress.dependencies; + if (dependencies !== null) { + { + var firstContext = dependencies.firstContext; + if (firstContext !== null) { + if (includesSomeLane(dependencies.lanes, renderLanes)) { + // Context list has a pending update. Mark that this fiber performed work. + markWorkInProgressReceivedUpdate(); + } // Reset the work-in-progress list + + dependencies.firstContext = null; + } + } + } + } + function _readContext(context) { + { + // This warning would fire if you read context inside a Hook like useMemo. + // Unlike the class check below, it's not enforced in production for perf. + if (isDisallowedContextReadInDEV) { + 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()."); + } + } + var value = context._currentValue2; + if (lastFullyObservedContext === context) ;else { + var contextItem = { + context: context, + memoizedValue: value, + next: null + }; + if (lastContextDependency === null) { + if (currentlyRenderingFiber === null) { + throw new 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()."); + } // This is the first dependency for this component. Create a new list. + + lastContextDependency = contextItem; + currentlyRenderingFiber.dependencies = { + lanes: NoLanes, + firstContext: contextItem + }; + } else { + // Append a new context item. + lastContextDependency = lastContextDependency.next = contextItem; + } + } + return value; + } + + // render. When this render exits, either because it finishes or because it is + // interrupted, the interleaved updates will be transferred onto the main part + // of the queue. + + var concurrentQueues = null; + function pushConcurrentUpdateQueue(queue) { + if (concurrentQueues === null) { + concurrentQueues = [queue]; + } else { + concurrentQueues.push(queue); + } + } + function finishQueueingConcurrentUpdates() { + // Transfer the interleaved updates onto the main queue. Each queue has a + // `pending` field and an `interleaved` field. When they are not null, they + // point to the last node in a circular linked list. We need to append the + // interleaved list to the end of the pending list by joining them into a + // single, circular list. + if (concurrentQueues !== null) { + for (var i = 0; i < concurrentQueues.length; i++) { + var queue = concurrentQueues[i]; + var lastInterleavedUpdate = queue.interleaved; + if (lastInterleavedUpdate !== null) { + queue.interleaved = null; + var firstInterleavedUpdate = lastInterleavedUpdate.next; + var lastPendingUpdate = queue.pending; + if (lastPendingUpdate !== null) { + var firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = firstInterleavedUpdate; + lastInterleavedUpdate.next = firstPendingUpdate; + } + queue.pending = lastInterleavedUpdate; + } + } + concurrentQueues = null; + } + } + function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { + var interleaved = queue.interleaved; + if (interleaved === null) { + // This is the first update. Create a circular list. + update.next = update; // At the end of the current render, this queue's interleaved updates will + // be transferred to the pending queue. + + pushConcurrentUpdateQueue(queue); + } else { + update.next = interleaved.next; + interleaved.next = update; + } + queue.interleaved = update; + return markUpdateLaneFromFiberToRoot(fiber, lane); + } + function enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane) { + var interleaved = queue.interleaved; + if (interleaved === null) { + // This is the first update. Create a circular list. + update.next = update; // At the end of the current render, this queue's interleaved updates will + // be transferred to the pending queue. + + pushConcurrentUpdateQueue(queue); + } else { + update.next = interleaved.next; + interleaved.next = update; + } + queue.interleaved = update; + } + function enqueueConcurrentClassUpdate(fiber, queue, update, lane) { + var interleaved = queue.interleaved; + if (interleaved === null) { + // This is the first update. Create a circular list. + update.next = update; // At the end of the current render, this queue's interleaved updates will + // be transferred to the pending queue. + + pushConcurrentUpdateQueue(queue); + } else { + update.next = interleaved.next; + interleaved.next = update; + } + queue.interleaved = update; + return markUpdateLaneFromFiberToRoot(fiber, lane); + } + function enqueueConcurrentRenderForLane(fiber, lane) { + return markUpdateLaneFromFiberToRoot(fiber, lane); + } // Calling this function outside this module should only be done for backwards + // compatibility and should always be accompanied by a warning. + + var unsafe_markUpdateLaneFromFiberToRoot = markUpdateLaneFromFiberToRoot; + function markUpdateLaneFromFiberToRoot(sourceFiber, lane) { + // Update the source fiber's lanes + sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane); + var alternate = sourceFiber.alternate; + if (alternate !== null) { + alternate.lanes = mergeLanes(alternate.lanes, lane); + } + { + if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) { + warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); + } + } // Walk the parent path to the root and update the child lanes. + + var node = sourceFiber; + var parent = sourceFiber.return; + while (parent !== null) { + parent.childLanes = mergeLanes(parent.childLanes, lane); + alternate = parent.alternate; + if (alternate !== null) { + alternate.childLanes = mergeLanes(alternate.childLanes, lane); + } else { + { + if ((parent.flags & (Placement | Hydrating)) !== NoFlags) { + warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); + } + } + } + node = parent; + parent = parent.return; + } + if (node.tag === HostRoot) { + var root = node.stateNode; + return root; + } else { + return null; + } + } + var UpdateState = 0; + var ReplaceState = 1; + var ForceUpdate = 2; + var CaptureUpdate = 3; // Global state that is reset at the beginning of calling `processUpdateQueue`. + // It should only be read right after calling `processUpdateQueue`, via + // `checkHasForceUpdateAfterProcessing`. + + var hasForceUpdate = false; + var didWarnUpdateInsideUpdate; + var currentlyProcessingQueue; + { + didWarnUpdateInsideUpdate = false; + currentlyProcessingQueue = null; + } + function initializeUpdateQueue(fiber) { + var queue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { + pending: null, + interleaved: null, + lanes: NoLanes + }, + effects: null + }; + fiber.updateQueue = queue; + } + function cloneUpdateQueue(current, workInProgress) { + // Clone the update queue from current. Unless it's already a clone. + var queue = workInProgress.updateQueue; + var currentQueue = current.updateQueue; + if (queue === currentQueue) { + var clone = { + baseState: currentQueue.baseState, + firstBaseUpdate: currentQueue.firstBaseUpdate, + lastBaseUpdate: currentQueue.lastBaseUpdate, + shared: currentQueue.shared, + effects: currentQueue.effects + }; + workInProgress.updateQueue = clone; + } + } + function createUpdate(eventTime, lane) { + var update = { + eventTime: eventTime, + lane: lane, + tag: UpdateState, + payload: null, + callback: null, + next: null + }; + return update; + } + function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (updateQueue === null) { + // Only occurs if the fiber has been unmounted. + return null; + } + var sharedQueue = updateQueue.shared; + { + if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) { + error("An update (setState, replaceState, or forceUpdate) was scheduled " + "from inside an update function. Update functions should be pure, " + "with zero side-effects. Consider using componentDidUpdate or a " + "callback."); + didWarnUpdateInsideUpdate = true; + } + } + if (isUnsafeClassRenderPhaseUpdate()) { + // This is an unsafe render phase update. Add directly to the update + // queue so we can process it immediately during the current render. + var pending = sharedQueue.pending; + if (pending === null) { + // This is the first update. Create a circular list. + update.next = update; + } else { + update.next = pending.next; + pending.next = update; + } + sharedQueue.pending = update; // Update the childLanes even though we're most likely already rendering + // this fiber. This is for backwards compatibility in the case where you + // update a different component during render phase than the one that is + // currently renderings (a pattern that is accompanied by a warning). + + return unsafe_markUpdateLaneFromFiberToRoot(fiber, lane); + } else { + return enqueueConcurrentClassUpdate(fiber, sharedQueue, update, lane); + } + } + function entangleTransitions(root, fiber, lane) { + var updateQueue = fiber.updateQueue; + if (updateQueue === null) { + // Only occurs if the fiber has been unmounted. + return; + } + var sharedQueue = updateQueue.shared; + if (isTransitionLane(lane)) { + var queueLanes = sharedQueue.lanes; // If any entangled lanes are no longer pending on the root, then they must + // have finished. We can remove them from the shared queue, which represents + // a superset of the actually pending lanes. In some cases we may entangle + // more than we need to, but that's OK. In fact it's worse if we *don't* + // entangle when we should. + + queueLanes = intersectLanes(queueLanes, root.pendingLanes); // Entangle the new transition lane with the other transition lanes. + + var newQueueLanes = mergeLanes(queueLanes, lane); + sharedQueue.lanes = newQueueLanes; // Even if queue.lanes already include lane, we don't know for certain if + // the lane finished since the last time we entangled it. So we need to + // entangle it again, just to be sure. + + markRootEntangled(root, newQueueLanes); + } + } + function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + // Captured updates are updates that are thrown by a child during the render + // phase. They should be discarded if the render is aborted. Therefore, + // we should only put them on the work-in-progress queue, not the current one. + var queue = workInProgress.updateQueue; // Check if the work-in-progress queue is a clone. + + var current = workInProgress.alternate; + if (current !== null) { + var currentQueue = current.updateQueue; + if (queue === currentQueue) { + // The work-in-progress queue is the same as current. This happens when + // we bail out on a parent fiber that then captures an error thrown by + // a child. Since we want to append the update only to the work-in + // -progress queue, we need to clone the updates. We usually clone during + // processUpdateQueue, but that didn't happen in this case because we + // skipped over the parent when we bailed out. + var newFirst = null; + var newLast = null; + var firstBaseUpdate = queue.firstBaseUpdate; + if (firstBaseUpdate !== null) { + // Loop through the updates and clone them. + var update = firstBaseUpdate; + do { + var clone = { + eventTime: update.eventTime, + lane: update.lane, + tag: update.tag, + payload: update.payload, + callback: update.callback, + next: null + }; + if (newLast === null) { + newFirst = newLast = clone; + } else { + newLast.next = clone; + newLast = clone; + } + update = update.next; + } while (update !== null); // Append the captured update the end of the cloned list. + + if (newLast === null) { + newFirst = newLast = capturedUpdate; + } else { + newLast.next = capturedUpdate; + newLast = capturedUpdate; + } + } else { + // There are no base updates. + newFirst = newLast = capturedUpdate; + } + queue = { + baseState: currentQueue.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: currentQueue.shared, + effects: currentQueue.effects + }; + workInProgress.updateQueue = queue; + return; + } + } // Append the update to the end of the list. + + var lastBaseUpdate = queue.lastBaseUpdate; + if (lastBaseUpdate === null) { + queue.firstBaseUpdate = capturedUpdate; + } else { + lastBaseUpdate.next = capturedUpdate; + } + queue.lastBaseUpdate = capturedUpdate; + } + function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) { + switch (update.tag) { + case ReplaceState: + { + var payload = update.payload; + if (typeof payload === "function") { + // Updater function + { + enterDisallowedContextReadInDEV(); + } + var nextState = payload.call(instance, prevState, nextProps); + { + exitDisallowedContextReadInDEV(); + } + return nextState; + } // State object + + return payload; + } + case CaptureUpdate: + { + workInProgress.flags = workInProgress.flags & ~ShouldCapture | DidCapture; + } + // Intentional fallthrough + + case UpdateState: + { + var _payload = update.payload; + var partialState; + if (typeof _payload === "function") { + // Updater function + { + enterDisallowedContextReadInDEV(); + } + partialState = _payload.call(instance, prevState, nextProps); + { + exitDisallowedContextReadInDEV(); + } + } else { + // Partial state object + partialState = _payload; + } + if (partialState === null || partialState === undefined) { + // Null and undefined are treated as no-ops. + return prevState; + } // Merge the partial state and the previous state. + + return assign({}, prevState, partialState); + } + case ForceUpdate: + { + hasForceUpdate = true; + return prevState; + } + } + return prevState; + } + function processUpdateQueue(workInProgress, props, instance, renderLanes) { + // This is always non-null on a ClassComponent or HostRoot + var queue = workInProgress.updateQueue; + hasForceUpdate = false; + { + currentlyProcessingQueue = queue.shared; + } + var firstBaseUpdate = queue.firstBaseUpdate; + var lastBaseUpdate = queue.lastBaseUpdate; // Check if there are pending updates. If so, transfer them to the base queue. + + var pendingQueue = queue.shared.pending; + if (pendingQueue !== null) { + queue.shared.pending = null; // The pending queue is circular. Disconnect the pointer between first + // and last so that it's non-circular. + + var lastPendingUpdate = pendingQueue; + var firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; // Append pending updates to base queue + + if (lastBaseUpdate === null) { + firstBaseUpdate = firstPendingUpdate; + } else { + lastBaseUpdate.next = firstPendingUpdate; + } + lastBaseUpdate = lastPendingUpdate; // If there's a current queue, and it's different from the base queue, then + // we need to transfer the updates to that queue, too. Because the base + // queue is a singly-linked list with no cycles, we can append to both + // lists and take advantage of structural sharing. + // TODO: Pass `current` as argument + + var current = workInProgress.alternate; + if (current !== null) { + // This is always non-null on a ClassComponent or HostRoot + var currentQueue = current.updateQueue; + var currentLastBaseUpdate = currentQueue.lastBaseUpdate; + if (currentLastBaseUpdate !== lastBaseUpdate) { + if (currentLastBaseUpdate === null) { + currentQueue.firstBaseUpdate = firstPendingUpdate; + } else { + currentLastBaseUpdate.next = firstPendingUpdate; + } + currentQueue.lastBaseUpdate = lastPendingUpdate; + } + } + } // These values may change as we process the queue. + + if (firstBaseUpdate !== null) { + // Iterate through the list of updates to compute the result. + var newState = queue.baseState; // TODO: Don't need to accumulate this. Instead, we can remove renderLanes + // from the original lanes. + + var newLanes = NoLanes; + var newBaseState = null; + var newFirstBaseUpdate = null; + var newLastBaseUpdate = null; + var update = firstBaseUpdate; + do { + var updateLane = update.lane; + var updateEventTime = update.eventTime; + if (!isSubsetOfLanes(renderLanes, updateLane)) { + // Priority is insufficient. Skip this update. If this is the first + // skipped update, the previous update/state is the new base + // update/state. + var clone = { + eventTime: updateEventTime, + lane: updateLane, + tag: update.tag, + payload: update.payload, + callback: update.callback, + next: null + }; + if (newLastBaseUpdate === null) { + newFirstBaseUpdate = newLastBaseUpdate = clone; + newBaseState = newState; + } else { + newLastBaseUpdate = newLastBaseUpdate.next = clone; + } // Update the remaining priority in the queue. + + newLanes = mergeLanes(newLanes, updateLane); + } else { + // This update does have sufficient priority. + if (newLastBaseUpdate !== null) { + var _clone = { + eventTime: updateEventTime, + // This update is going to be committed so we never want uncommit + // it. Using NoLane works because 0 is a subset of all bitmasks, so + // this will never be skipped by the check above. + lane: NoLane, + tag: update.tag, + payload: update.payload, + callback: update.callback, + next: null + }; + newLastBaseUpdate = newLastBaseUpdate.next = _clone; + } // Process this update. + + newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance); + var callback = update.callback; + if (callback !== null && + // If the update was already committed, we should not queue its + // callback again. + update.lane !== NoLane) { + workInProgress.flags |= Callback; + var effects = queue.effects; + if (effects === null) { + queue.effects = [update]; + } else { + effects.push(update); + } + } + } + update = update.next; + if (update === null) { + pendingQueue = queue.shared.pending; + if (pendingQueue === null) { + break; + } else { + // An update was scheduled from inside a reducer. Add the new + // pending updates to the end of the list and keep processing. + var _lastPendingUpdate = pendingQueue; // Intentionally unsound. Pending updates form a circular list, but we + // unravel them when transferring them to the base queue. + + var _firstPendingUpdate = _lastPendingUpdate.next; + _lastPendingUpdate.next = null; + update = _firstPendingUpdate; + queue.lastBaseUpdate = _lastPendingUpdate; + queue.shared.pending = null; + } + } + } while (true); + if (newLastBaseUpdate === null) { + newBaseState = newState; + } + queue.baseState = newBaseState; + queue.firstBaseUpdate = newFirstBaseUpdate; + queue.lastBaseUpdate = newLastBaseUpdate; // Interleaved updates are stored on a separate queue. We aren't going to + // process them during this render, but we do need to track which lanes + // are remaining. + + var lastInterleaved = queue.shared.interleaved; + if (lastInterleaved !== null) { + var interleaved = lastInterleaved; + do { + newLanes = mergeLanes(newLanes, interleaved.lane); + interleaved = interleaved.next; + } while (interleaved !== lastInterleaved); + } else if (firstBaseUpdate === null) { + // `queue.lanes` is used for entangling transitions. We can set it back to + // zero once the queue is empty. + queue.shared.lanes = NoLanes; + } // Set the remaining expiration time to be whatever is remaining in the queue. + // This should be fine because the only two other things that contribute to + // expiration time are props and context. We're already in the middle of the + // begin phase by the time we start processing the queue, so we've already + // dealt with the props. Context in components that specify + // shouldComponentUpdate is tricky; but we'll have to account for + // that regardless. + + markSkippedUpdateLanes(newLanes); + workInProgress.lanes = newLanes; + workInProgress.memoizedState = newState; + } + { + currentlyProcessingQueue = null; + } + } + function callCallback(callback, context) { + if (typeof callback !== "function") { + throw new Error("Invalid argument passed as callback. Expected a function. Instead " + ("received: " + callback)); + } + callback.call(context); + } + function resetHasForceUpdateBeforeProcessing() { + hasForceUpdate = false; + } + function checkHasForceUpdateAfterProcessing() { + return hasForceUpdate; + } + function commitUpdateQueue(finishedWork, finishedQueue, instance) { + // Commit the effects + var effects = finishedQueue.effects; + finishedQueue.effects = null; + if (effects !== null) { + for (var i = 0; i < effects.length; i++) { + var effect = effects[i]; + var callback = effect.callback; + if (callback !== null) { + effect.callback = null; + callCallback(callback, instance); + } + } + } + } + var fakeInternalInstance = {}; // React.Component uses a shared frozen object by default. + // We'll use it to determine whether we need to initialize legacy refs. + + var emptyRefsObject = new React.Component().refs; + var didWarnAboutStateAssignmentForComponent; + var didWarnAboutUninitializedState; + var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate; + var didWarnAboutLegacyLifecyclesAndDerivedState; + var didWarnAboutUndefinedDerivedState; + var warnOnUndefinedDerivedState; + var warnOnInvalidCallback; + var didWarnAboutDirectlyAssigningPropsToState; + var didWarnAboutContextTypeAndContextTypes; + var didWarnAboutInvalidateContextType; + { + didWarnAboutStateAssignmentForComponent = new Set(); + didWarnAboutUninitializedState = new Set(); + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); + didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); + didWarnAboutDirectlyAssigningPropsToState = new Set(); + didWarnAboutUndefinedDerivedState = new Set(); + didWarnAboutContextTypeAndContextTypes = new Set(); + didWarnAboutInvalidateContextType = new Set(); + var didWarnOnInvalidCallback = new Set(); + warnOnInvalidCallback = function warnOnInvalidCallback(callback, callerName) { + if (callback === null || typeof callback === "function") { + return; + } + var key = callerName + "_" + callback; + if (!didWarnOnInvalidCallback.has(key)) { + didWarnOnInvalidCallback.add(key); + error("%s(...): Expected the last optional `callback` argument to be a " + "function. Instead received: %s.", callerName, callback); + } + }; + warnOnUndefinedDerivedState = function warnOnUndefinedDerivedState(type, partialState) { + if (partialState === undefined) { + var componentName = getComponentNameFromType(type) || "Component"; + if (!didWarnAboutUndefinedDerivedState.has(componentName)) { + didWarnAboutUndefinedDerivedState.add(componentName); + error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. " + "You have returned undefined.", componentName); + } + } + }; // This is so gross but it's at least non-critical and can be removed if + // it causes problems. This is meant to give a nicer error message for + // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component, + // ...)) which otherwise throws a "_processChildContext is not a function" + // exception. + + Object.defineProperty(fakeInternalInstance, "_processChildContext", { + enumerable: false, + value: function value() { + throw new Error("_processChildContext is not available in React 16+. This likely " + "means you have multiple copies of React and are attempting to nest " + "a React 15 tree inside a React 16 tree using " + "unstable_renderSubtreeIntoContainer, which isn't supported. Try " + "to make sure you have only one copy of React (and ideally, switch " + "to ReactDOM.createPortal)."); + } + }); + Object.freeze(fakeInternalInstance); + } + function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) { + var prevState = workInProgress.memoizedState; + var partialState = getDerivedStateFromProps(nextProps, prevState); + { + warnOnUndefinedDerivedState(ctor, partialState); + } // Merge the partial state and the previous state. + + var memoizedState = partialState === null || partialState === undefined ? prevState : assign({}, prevState, partialState); + workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the + // base state. + + if (workInProgress.lanes === NoLanes) { + // Queue is always non-null for classes + var updateQueue = workInProgress.updateQueue; + updateQueue.baseState = memoizedState; + } + } + var classComponentUpdater = { + isMounted: isMounted, + enqueueSetState: function enqueueSetState(inst, payload, callback) { + var fiber = get(inst); + var eventTime = requestEventTime(); + var lane = requestUpdateLane(fiber); + var update = createUpdate(eventTime, lane); + update.payload = payload; + if (callback !== undefined && callback !== null) { + { + warnOnInvalidCallback(callback, "setState"); + } + update.callback = callback; + } + var root = enqueueUpdate(fiber, update, lane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, lane, eventTime); + entangleTransitions(root, fiber, lane); + } + }, + enqueueReplaceState: function enqueueReplaceState(inst, payload, callback) { + var fiber = get(inst); + var eventTime = requestEventTime(); + var lane = requestUpdateLane(fiber); + var update = createUpdate(eventTime, lane); + update.tag = ReplaceState; + update.payload = payload; + if (callback !== undefined && callback !== null) { + { + warnOnInvalidCallback(callback, "replaceState"); + } + update.callback = callback; + } + var root = enqueueUpdate(fiber, update, lane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, lane, eventTime); + entangleTransitions(root, fiber, lane); + } + }, + enqueueForceUpdate: function enqueueForceUpdate(inst, callback) { + var fiber = get(inst); + var eventTime = requestEventTime(); + var lane = requestUpdateLane(fiber); + var update = createUpdate(eventTime, lane); + update.tag = ForceUpdate; + if (callback !== undefined && callback !== null) { + { + warnOnInvalidCallback(callback, "forceUpdate"); + } + update.callback = callback; + } + var root = enqueueUpdate(fiber, update, lane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, lane, eventTime); + entangleTransitions(root, fiber, lane); + } + } + }; + function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { + var instance = workInProgress.stateNode; + if (typeof instance.shouldComponentUpdate === "function") { + var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); + { + if (shouldUpdate === undefined) { + error("%s.shouldComponentUpdate(): Returned undefined instead of a " + "boolean value. Make sure to return true or false.", getComponentNameFromType(ctor) || "Component"); + } + } + return shouldUpdate; + } + if (ctor.prototype && ctor.prototype.isPureReactComponent) { + return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); + } + return true; + } + function checkClassInstance(workInProgress, ctor, newProps) { + var instance = workInProgress.stateNode; + { + var name = getComponentNameFromType(ctor) || "Component"; + var renderPresent = instance.render; + if (!renderPresent) { + if (ctor.prototype && typeof ctor.prototype.render === "function") { + error("%s(...): No `render` method found on the returned component " + "instance: did you accidentally return an object from the constructor?", name); + } else { + error("%s(...): No `render` method found on the returned component " + "instance: you may have forgotten to define `render`.", name); + } + } + if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) { + error("getInitialState was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Did you mean to define a state property instead?", name); + } + if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) { + error("getDefaultProps was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Use a static property to define defaultProps instead.", name); + } + if (instance.propTypes) { + error("propTypes was defined as an instance property on %s. Use a static " + "property to define propTypes instead.", name); + } + if (instance.contextType) { + error("contextType was defined as an instance property on %s. Use a static " + "property to define contextType instead.", name); + } + { + if (instance.contextTypes) { + error("contextTypes was defined as an instance property on %s. Use a static " + "property to define contextTypes instead.", name); + } + if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) { + didWarnAboutContextTypeAndContextTypes.add(ctor); + error("%s declares both contextTypes and contextType static properties. " + "The legacy contextTypes property will be ignored.", name); + } + } + if (typeof instance.componentShouldUpdate === "function") { + error("%s has a method called " + "componentShouldUpdate(). Did you mean shouldComponentUpdate()? " + "The name is phrased as a question because the function is " + "expected to return a value.", name); + } + if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== "undefined") { + error("%s has a method called shouldComponentUpdate(). " + "shouldComponentUpdate should not be used when extending React.PureComponent. " + "Please extend React.Component if shouldComponentUpdate is used.", getComponentNameFromType(ctor) || "A pure component"); + } + if (typeof instance.componentDidUnmount === "function") { + error("%s has a method called " + "componentDidUnmount(). But there is no such lifecycle method. " + "Did you mean componentWillUnmount()?", name); + } + if (typeof instance.componentDidReceiveProps === "function") { + error("%s has a method called " + "componentDidReceiveProps(). But there is no such lifecycle method. " + "If you meant to update the state in response to changing props, " + "use componentWillReceiveProps(). If you meant to fetch data or " + "run side-effects or mutations after React has updated the UI, use componentDidUpdate().", name); + } + if (typeof instance.componentWillRecieveProps === "function") { + error("%s has a method called " + "componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", name); + } + if (typeof instance.UNSAFE_componentWillRecieveProps === "function") { + error("%s has a method called " + "UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", name); + } + var hasMutatedProps = instance.props !== newProps; + if (instance.props !== undefined && hasMutatedProps) { + error("%s(...): When calling super() in `%s`, make sure to pass " + "up the same props that your component's constructor was passed.", name, name); + } + if (instance.defaultProps) { + error("Setting defaultProps as an instance property on %s is not supported and will be ignored." + " Instead, define defaultProps as a static property on %s.", name, name); + } + if (typeof instance.getSnapshotBeforeUpdate === "function" && typeof instance.componentDidUpdate !== "function" && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) { + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor); + error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). " + "This component defines getSnapshotBeforeUpdate() only.", getComponentNameFromType(ctor)); + } + if (typeof instance.getDerivedStateFromProps === "function") { + error("%s: getDerivedStateFromProps() is defined as an instance method " + "and will be ignored. Instead, declare it as a static method.", name); + } + if (typeof instance.getDerivedStateFromError === "function") { + error("%s: getDerivedStateFromError() is defined as an instance method " + "and will be ignored. Instead, declare it as a static method.", name); + } + if (typeof ctor.getSnapshotBeforeUpdate === "function") { + error("%s: getSnapshotBeforeUpdate() is defined as a static method " + "and will be ignored. Instead, declare it as an instance method.", name); + } + var _state = instance.state; + if (_state && (typeof _state !== "object" || isArray(_state))) { + error("%s.state: must be set to an object or null", name); + } + if (typeof instance.getChildContext === "function" && typeof ctor.childContextTypes !== "object") { + error("%s.getChildContext(): childContextTypes must be defined in order to " + "use getChildContext().", name); + } + } + } + function adoptClassInstance(workInProgress, instance) { + instance.updater = classComponentUpdater; + workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates + + set(instance, workInProgress); + { + instance._reactInternalInstance = fakeInternalInstance; + } + } + function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = false; + var unmaskedContext = emptyContextObject; + var context = emptyContextObject; + var contextType = ctor.contextType; + { + if ("contextType" in ctor) { + var isValid = + // Allow null for conditional declaration + contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a + + if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) { + didWarnAboutInvalidateContextType.add(ctor); + var addendum = ""; + if (contextType === undefined) { + addendum = " However, it is set to undefined. " + "This can be caused by a typo or by mixing up named and default imports. " + "This can also happen due to a circular dependency, so " + "try moving the createContext() call to a separate file."; + } else if (typeof contextType !== "object") { + addendum = " However, it is set to a " + typeof contextType + "."; + } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) { + addendum = " Did you accidentally pass the Context.Provider instead?"; + } else if (contextType._context !== undefined) { + // + addendum = " Did you accidentally pass the Context.Consumer instead?"; + } else { + addendum = " However, it is set to an object with keys {" + Object.keys(contextType).join(", ") + "}."; + } + error("%s defines an invalid contextType. " + "contextType should point to the Context object returned by React.createContext().%s", getComponentNameFromType(ctor) || "Component", addendum); + } + } + } + if (typeof contextType === "object" && contextType !== null) { + context = _readContext(contextType); + } else { + unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + var contextTypes = ctor.contextTypes; + isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined; + context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject; + } + var instance = new ctor(props, context); // Instantiate twice to help detect side-effects. + + var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null; + adoptClassInstance(workInProgress, instance); + { + if (typeof ctor.getDerivedStateFromProps === "function" && state === null) { + var componentName = getComponentNameFromType(ctor) || "Component"; + if (!didWarnAboutUninitializedState.has(componentName)) { + didWarnAboutUninitializedState.add(componentName); + error("`%s` uses `getDerivedStateFromProps` but its initial state is " + "%s. This is not recommended. Instead, define the initial state by " + "assigning an object to `this.state` in the constructor of `%s`. " + "This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", componentName, instance.state === null ? "null" : "undefined", componentName); + } + } // If new component APIs are defined, "unsafe" lifecycles won't be called. + // Warn about these lifecycles if they are present. + // Don't warn about react-lifecycles-compat polyfilled methods though. + + if (typeof ctor.getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function") { + var foundWillMountName = null; + var foundWillReceivePropsName = null; + var foundWillUpdateName = null; + if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) { + foundWillMountName = "componentWillMount"; + } else if (typeof instance.UNSAFE_componentWillMount === "function") { + foundWillMountName = "UNSAFE_componentWillMount"; + } + if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { + foundWillReceivePropsName = "componentWillReceiveProps"; + } else if (typeof instance.UNSAFE_componentWillReceiveProps === "function") { + foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"; + } + if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { + foundWillUpdateName = "componentWillUpdate"; + } else if (typeof instance.UNSAFE_componentWillUpdate === "function") { + foundWillUpdateName = "UNSAFE_componentWillUpdate"; + } + if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) { + var _componentName = getComponentNameFromType(ctor) || "Component"; + var newApiName = typeof ctor.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()"; + if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) { + didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName); + error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n" + "%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n" + "The above lifecycles should be removed. Learn more about this warning here:\n" + "https://react.dev/link/unsafe-component-lifecycles", _componentName, newApiName, foundWillMountName !== null ? "\n " + foundWillMountName : "", foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : "", foundWillUpdateName !== null ? "\n " + foundWillUpdateName : ""); + } + } + } + } // Cache unmasked context so we can avoid recreating masked context unless necessary. + // ReactFiberContext usually updates this cache but can't for newly-created instances. + + if (isLegacyContextConsumer) { + cacheContext(workInProgress, unmaskedContext, context); + } + return instance; + } + function callComponentWillMount(workInProgress, instance) { + var oldState = instance.state; + if (typeof instance.componentWillMount === "function") { + instance.componentWillMount(); + } + if (typeof instance.UNSAFE_componentWillMount === "function") { + instance.UNSAFE_componentWillMount(); + } + if (oldState !== instance.state) { + { + error("%s.componentWillMount(): Assigning directly to this.state is " + "deprecated (except inside a component's " + "constructor). Use setState instead.", getComponentNameFromFiber(workInProgress) || "Component"); + } + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); + } + } + function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) { + var oldState = instance.state; + if (typeof instance.componentWillReceiveProps === "function") { + instance.componentWillReceiveProps(newProps, nextContext); + } + if (typeof instance.UNSAFE_componentWillReceiveProps === "function") { + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + } + if (instance.state !== oldState) { + { + var componentName = getComponentNameFromFiber(workInProgress) || "Component"; + if (!didWarnAboutStateAssignmentForComponent.has(componentName)) { + didWarnAboutStateAssignmentForComponent.add(componentName); + error("%s.componentWillReceiveProps(): Assigning directly to " + "this.state is deprecated (except inside a component's " + "constructor). Use setState instead.", componentName); + } + } + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); + } + } // Invokes the mount life-cycles on a previously never rendered instance. + + function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { + { + checkClassInstance(workInProgress, ctor, newProps); + } + var instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = emptyRefsObject; + initializeUpdateQueue(workInProgress); + var contextType = ctor.contextType; + if (typeof contextType === "object" && contextType !== null) { + instance.context = _readContext(contextType); + } else { + var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + instance.context = getMaskedContext(workInProgress, unmaskedContext); + } + { + if (instance.state === newProps) { + var componentName = getComponentNameFromType(ctor) || "Component"; + if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) { + didWarnAboutDirectlyAssigningPropsToState.add(componentName); + error("%s: It is not recommended to assign props directly to state " + "because updates to props won't be reflected in state. " + "In most cases, it is better to use props directly.", componentName); + } + } + if (workInProgress.mode & StrictLegacyMode) { + ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance); + } + { + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance); + } + } + instance.state = workInProgress.memoizedState; + var getDerivedStateFromProps = ctor.getDerivedStateFromProps; + if (typeof getDerivedStateFromProps === "function") { + applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); + instance.state = workInProgress.memoizedState; + } // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + + if (typeof ctor.getDerivedStateFromProps !== "function" && typeof instance.getSnapshotBeforeUpdate !== "function" && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) { + callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's + // process them now. + + processUpdateQueue(workInProgress, newProps, instance, renderLanes); + instance.state = workInProgress.memoizedState; + } + if (typeof instance.componentDidMount === "function") { + var fiberFlags = Update; + workInProgress.flags |= fiberFlags; + } + } + function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode; + var oldProps = workInProgress.memoizedProps; + instance.props = oldProps; + var oldContext = instance.context; + var contextType = ctor.contextType; + var nextContext = emptyContextObject; + if (typeof contextType === "object" && contextType !== null) { + nextContext = _readContext(contextType); + } else { + var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext); + } + var getDerivedStateFromProps = ctor.getDerivedStateFromProps; + var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function"; // Note: During these life-cycles, instance.props/instance.state are what + // ever the previously attempted to render - not the "current". However, + // during componentDidUpdate we pass the "current" props. + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) { + if (oldProps !== newProps || oldContext !== nextContext) { + callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); + } + } + resetHasForceUpdateBeforeProcessing(); + var oldState = workInProgress.memoizedState; + var newState = instance.state = oldState; + processUpdateQueue(workInProgress, newProps, instance, renderLanes); + newState = workInProgress.memoizedState; + if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidMount === "function") { + var fiberFlags = Update; + workInProgress.flags |= fiberFlags; + } + return false; + } + if (typeof getDerivedStateFromProps === "function") { + applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); + newState = workInProgress.memoizedState; + } + var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext); + if (shouldUpdate) { + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) { + if (typeof instance.componentWillMount === "function") { + instance.componentWillMount(); + } + if (typeof instance.UNSAFE_componentWillMount === "function") { + instance.UNSAFE_componentWillMount(); + } + } + if (typeof instance.componentDidMount === "function") { + var _fiberFlags = Update; + workInProgress.flags |= _fiberFlags; + } + } else { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidMount === "function") { + var _fiberFlags2 = Update; + workInProgress.flags |= _fiberFlags2; + } // If shouldComponentUpdate returned false, we should still update the + // memoized state to indicate that this work can be reused. + + workInProgress.memoizedProps = newProps; + workInProgress.memoizedState = newState; + } // Update the existing instance's state, props, and context pointers even + // if shouldComponentUpdate returns false. + + instance.props = newProps; + instance.state = newState; + instance.context = nextContext; + return shouldUpdate; + } // Invokes the update life-cycles and returns false if it shouldn't rerender. + + function updateClassInstance(current, workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + var unresolvedOldProps = workInProgress.memoizedProps; + var oldProps = workInProgress.type === workInProgress.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress.type, unresolvedOldProps); + instance.props = oldProps; + var unresolvedNewProps = workInProgress.pendingProps; + var oldContext = instance.context; + var contextType = ctor.contextType; + var nextContext = emptyContextObject; + if (typeof contextType === "object" && contextType !== null) { + nextContext = _readContext(contextType); + } else { + var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + nextContext = getMaskedContext(workInProgress, nextUnmaskedContext); + } + var getDerivedStateFromProps = ctor.getDerivedStateFromProps; + var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function"; // Note: During these life-cycles, instance.props/instance.state are what + // ever the previously attempted to render - not the "current". However, + // during componentDidUpdate we pass the "current" props. + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) { + if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) { + callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); + } + } + resetHasForceUpdateBeforeProcessing(); + var oldState = workInProgress.memoizedState; + var newState = instance.state = oldState; + processUpdateQueue(workInProgress, newProps, instance, renderLanes); + newState = workInProgress.memoizedState; + if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing() && !enableLazyContextPropagation) { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidUpdate === "function") { + if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.flags |= Update; + } + } + if (typeof instance.getSnapshotBeforeUpdate === "function") { + if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.flags |= Snapshot; + } + } + return false; + } + if (typeof getDerivedStateFromProps === "function") { + applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); + newState = workInProgress.memoizedState; + } + var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) || + // TODO: In some cases, we'll end up checking if context has changed twice, + // both before and after `shouldComponentUpdate` has been called. Not ideal, + // but I'm loath to refactor this function. This only happens for memoized + // components so it's not that common. + enableLazyContextPropagation; + if (shouldUpdate) { + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === "function" || typeof instance.componentWillUpdate === "function")) { + if (typeof instance.componentWillUpdate === "function") { + instance.componentWillUpdate(newProps, newState, nextContext); + } + if (typeof instance.UNSAFE_componentWillUpdate === "function") { + instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext); + } + } + if (typeof instance.componentDidUpdate === "function") { + workInProgress.flags |= Update; + } + if (typeof instance.getSnapshotBeforeUpdate === "function") { + workInProgress.flags |= Snapshot; + } + } else { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidUpdate === "function") { + if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.flags |= Update; + } + } + if (typeof instance.getSnapshotBeforeUpdate === "function") { + if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.flags |= Snapshot; + } + } // If shouldComponentUpdate returned false, we should still update the + // memoized props/state to indicate that this work can be reused. + + workInProgress.memoizedProps = newProps; + workInProgress.memoizedState = newState; + } // Update the existing instance's state, props, and context pointers even + // if shouldComponentUpdate returns false. + + instance.props = newProps; + instance.state = newState; + instance.context = nextContext; + return shouldUpdate; + } + var didWarnAboutMaps; + var didWarnAboutGenerators; + var didWarnAboutStringRefs; + var ownerHasKeyUseWarning; + var ownerHasFunctionTypeWarning; + var warnForMissingKey = function warnForMissingKey(child, returnFiber) {}; + { + didWarnAboutMaps = false; + didWarnAboutGenerators = false; + didWarnAboutStringRefs = {}; + /** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + ownerHasKeyUseWarning = {}; + ownerHasFunctionTypeWarning = {}; + warnForMissingKey = function warnForMissingKey(child, returnFiber) { + if (child === null || typeof child !== "object") { + return; + } + if (!child._store || child._store.validated || child.key != null) { + return; + } + if (typeof child._store !== "object") { + throw new Error("React Component in warnForMissingKey should have a _store. " + "This error is likely caused by a bug in React. Please file an issue."); + } + child._store.validated = true; + var componentName = getComponentNameFromFiber(returnFiber) || "Component"; + if (ownerHasKeyUseWarning[componentName]) { + return; + } + ownerHasKeyUseWarning[componentName] = true; + error("Each child in a list should have a unique " + '"key" prop. See https://react.dev/link/warning-keys for ' + "more information."); + }; + } + function coerceRef(returnFiber, current, element) { + var mixedRef = element.ref; + if (mixedRef !== null && typeof mixedRef !== "function" && typeof mixedRef !== "object") { + { + // TODO: Clean this up once we turn on the string ref warning for + // everyone, because the strict mode case will no longer be relevant + if ((returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && + // We warn in ReactElement.js if owner and self are equal for string refs + // because these cannot be automatically converted to an arrow function + // using a codemod. Therefore, we don't have to warn about string refs again. + !(element._owner && element._self && element._owner.stateNode !== element._self)) { + var componentName = getComponentNameFromFiber(returnFiber) || "Component"; + if (!didWarnAboutStringRefs[componentName]) { + { + error('A string ref, "%s", has been found within a strict mode tree. ' + "String refs are a source of potential bugs and should be avoided. " + "We recommend using useRef() or createRef() instead. " + "Learn more about using refs safely here: " + "https://react.dev/link/strict-mode-string-ref", mixedRef); + } + didWarnAboutStringRefs[componentName] = true; + } + } + } + if (element._owner) { + var owner = element._owner; + var inst; + if (owner) { + var ownerFiber = owner; + if (ownerFiber.tag !== ClassComponent) { + throw new Error("Function components cannot have string refs. " + "We recommend using useRef() instead. " + "Learn more about using refs safely here: " + "https://react.dev/link/strict-mode-string-ref"); + } + inst = ownerFiber.stateNode; + } + if (!inst) { + throw new Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a " + "bug in React. Please file an issue."); + } // Assigning this to a const so Flow knows it won't change in the closure + + var resolvedInst = inst; + { + checkPropStringCoercion(mixedRef, "ref"); + } + var stringRef = "" + mixedRef; // Check if previous string ref matches new string ref + + if (current !== null && current.ref !== null && typeof current.ref === "function" && current.ref._stringRef === stringRef) { + return current.ref; + } + var ref = function ref(value) { + var refs = resolvedInst.refs; + if (refs === emptyRefsObject) { + // This is a lazy pooled frozen object, so we need to initialize. + refs = resolvedInst.refs = {}; + } + if (value === null) { + delete refs[stringRef]; + } else { + refs[stringRef] = value; + } + }; + ref._stringRef = stringRef; + return ref; + } else { + if (typeof mixedRef !== "string") { + throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null."); + } + if (!element._owner) { + throw new Error("Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of" + " the following reasons:\n" + "1. You may be adding a ref to a function component\n" + "2. You may be adding a ref to a component that was not created inside a component's render method\n" + "3. You have multiple copies of React loaded\n" + "See https://react.dev/link/refs-must-have-owner for more information."); + } + } + } + return mixedRef; + } + function throwOnInvalidObjectType(returnFiber, newChild) { + var childString = Object.prototype.toString.call(newChild); + throw new Error("Objects are not valid as a React child (found: " + (childString === "[object Object]" ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : childString) + "). " + "If you meant to render a collection of children, use an array " + "instead."); + } + function warnOnFunctionType(returnFiber) { + { + var componentName = getComponentNameFromFiber(returnFiber) || "Component"; + if (ownerHasFunctionTypeWarning[componentName]) { + return; + } + ownerHasFunctionTypeWarning[componentName] = true; + error("Functions are not valid as a React child. This may happen if " + "you return a Component instead of from render. " + "Or maybe you meant to call this function rather than return it."); + } + } + function resolveLazy(lazyType) { + var payload = lazyType._payload; + var init = lazyType._init; + return init(payload); + } // This wrapper function exists because I expect to clone the code in each path + // to be able to optimize each path individually by branching early. This needs + // a compiler or we can do it manually. Helpers that don't need this branching + // live outside of this function. + + function ChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (!shouldTrackSideEffects) { + // Noop. + return; + } + var deletions = returnFiber.deletions; + if (deletions === null) { + returnFiber.deletions = [childToDelete]; + returnFiber.flags |= ChildDeletion; + } else { + deletions.push(childToDelete); + } + } + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) { + // Noop. + return null; + } // TODO: For the shouldClone case, this could be micro-optimized a bit by + // assuming that after the first child we've already added everything. + + var childToDelete = currentFirstChild; + while (childToDelete !== null) { + deleteChild(returnFiber, childToDelete); + childToDelete = childToDelete.sibling; + } + return null; + } + function mapRemainingChildren(returnFiber, currentFirstChild) { + // Add the remaining children to a temporary map so that we can find them by + // keys quickly. Implicit (null) keys get added to this set with their index + // instead. + var existingChildren = new Map(); + var existingChild = currentFirstChild; + while (existingChild !== null) { + if (existingChild.key !== null) { + existingChildren.set(existingChild.key, existingChild); + } else { + existingChildren.set(existingChild.index, existingChild); + } + existingChild = existingChild.sibling; + } + return existingChildren; + } + function useFiber(fiber, pendingProps) { + // We currently set sibling to null and index to 0 here because it is easy + // to forget to do before returning it. E.g. for the single child case. + var clone = createWorkInProgress(fiber, pendingProps); + clone.index = 0; + clone.sibling = null; + return clone; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) { + // During hydration, the useId algorithm needs to know which fibers are + // part of a list of children (arrays, iterators). + newFiber.flags |= Forked; + return lastPlacedIndex; + } + var current = newFiber.alternate; + if (current !== null) { + var oldIndex = current.index; + if (oldIndex < lastPlacedIndex) { + // This is a move. + newFiber.flags |= Placement; + return lastPlacedIndex; + } else { + // This item can stay in place. + return oldIndex; + } + } else { + // This is an insertion. + newFiber.flags |= Placement; + return lastPlacedIndex; + } + } + function placeSingleChild(newFiber) { + // This is simpler for the single child case. We only need to do a + // placement for inserting new children. + if (shouldTrackSideEffects && newFiber.alternate === null) { + newFiber.flags |= Placement; + } + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (current === null || current.tag !== HostText) { + // Insert + var created = createFiberFromText(textContent, returnFiber.mode, lanes); + created.return = returnFiber; + return created; + } else { + // Update + var existing = useFiber(current, textContent); + existing.return = returnFiber; + return existing; + } + } + 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 (current !== null) { + if (current.elementType === elementType || + // Keep this check inline so it only runs on the false path: + isCompatibleFamilyForHotReloading(current, element) || + // Lazy types should reconcile their resolved type. + // We need to do this after the Hot Reloading check above, + // because hot reloading has different semantics than prod because + // it doesn't resuspend. So we can't let the call below suspend. + typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current.type) { + // Move based on index + var existing = useFiber(current, element.props); + existing.ref = coerceRef(returnFiber, current, element); + existing.return = returnFiber; + { + existing._debugSource = element._source; + existing._debugOwner = element._owner; + } + return existing; + } + } // Insert + + var created = createFiberFromElement(element, returnFiber.mode, lanes); + created.ref = coerceRef(returnFiber, current, element); + created.return = returnFiber; + return created; + } + function updatePortal(returnFiber, current, portal, lanes) { + if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) { + // Insert + var created = createFiberFromPortal(portal, returnFiber.mode, lanes); + created.return = returnFiber; + return created; + } else { + // Update + var existing = useFiber(current, portal.children || []); + existing.return = returnFiber; + return existing; + } + } + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (current === null || current.tag !== Fragment) { + // Insert + var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key); + created.return = returnFiber; + return created; + } else { + // Update + var existing = useFiber(current, fragment); + existing.return = returnFiber; + return existing; + } + } + function createChild(returnFiber, newChild, lanes) { + if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") { + // Text nodes don't have keys. If the previous node is implicitly keyed + // we can continue to replace it without aborting even if it is not a text + // node. + var created = createFiberFromText("" + newChild, returnFiber.mode, lanes); + created.return = returnFiber; + return created; + } + if (typeof newChild === "object" && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + { + var _created = createFiberFromElement(newChild, returnFiber.mode, lanes); + _created.ref = coerceRef(returnFiber, null, newChild); + _created.return = returnFiber; + return _created; + } + case REACT_PORTAL_TYPE: + { + var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes); + _created2.return = returnFiber; + return _created2; + } + case REACT_LAZY_TYPE: + { + var payload = newChild._payload; + var init = newChild._init; + return createChild(returnFiber, init(payload), lanes); + } + } + if (isArray(newChild) || getIteratorFn(newChild)) { + var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null); + _created3.return = returnFiber; + return _created3; + } + throwOnInvalidObjectType(returnFiber, newChild); + } + { + if (typeof newChild === "function") { + warnOnFunctionType(returnFiber); + } + } + return null; + } + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + // Update the fiber if the keys match, otherwise return null. + var key = oldFiber !== null ? oldFiber.key : null; + if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") { + // Text nodes don't have keys. If the previous node is implicitly keyed + // we can continue to replace it without aborting even if it is not a text + // node. + if (key !== null) { + return null; + } + return updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + } + if (typeof newChild === "object" && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + { + if (newChild.key === key) { + return updateElement(returnFiber, oldFiber, newChild, lanes); + } else { + return null; + } + } + case REACT_PORTAL_TYPE: + { + if (newChild.key === key) { + return updatePortal(returnFiber, oldFiber, newChild, lanes); + } else { + return null; + } + } + case REACT_LAZY_TYPE: + { + var payload = newChild._payload; + var init = newChild._init; + return updateSlot(returnFiber, oldFiber, init(payload), lanes); + } + } + if (isArray(newChild) || getIteratorFn(newChild)) { + if (key !== null) { + return null; + } + return updateFragment(returnFiber, oldFiber, newChild, lanes, null); + } + throwOnInvalidObjectType(returnFiber, newChild); + } + { + if (typeof newChild === "function") { + warnOnFunctionType(returnFiber); + } + } + return null; + } + function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) { + if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") { + // Text nodes don't have keys, so we neither have to check the old nor + // new node for the key. If both are text nodes, they match. + var matchedFiber = existingChildren.get(newIdx) || null; + return updateTextNode(returnFiber, matchedFiber, "" + newChild, lanes); + } + if (typeof newChild === "object" && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + { + var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; + return updateElement(returnFiber, _matchedFiber, newChild, lanes); + } + case REACT_PORTAL_TYPE: + { + var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; + return updatePortal(returnFiber, _matchedFiber2, newChild, lanes); + } + case REACT_LAZY_TYPE: + var payload = newChild._payload; + var init = newChild._init; + return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes); + } + if (isArray(newChild) || getIteratorFn(newChild)) { + var _matchedFiber3 = existingChildren.get(newIdx) || null; + return updateFragment(returnFiber, _matchedFiber3, newChild, lanes, null); + } + throwOnInvalidObjectType(returnFiber, newChild); + } + { + if (typeof newChild === "function") { + warnOnFunctionType(returnFiber); + } + } + return null; + } + /** + * Warns if there is a duplicate or missing key + */ + + function warnOnInvalidKey(child, knownKeys, returnFiber) { + { + if (typeof child !== "object" || child === null) { + return knownKeys; + } + switch (child.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + warnForMissingKey(child, returnFiber); + var key = child.key; + if (typeof key !== "string") { + break; + } + if (knownKeys === null) { + knownKeys = new Set(); + knownKeys.add(key); + break; + } + if (!knownKeys.has(key)) { + knownKeys.add(key); + break; + } + error("Encountered two children with the same key, `%s`. " + "Keys should be unique so that components maintain their identity " + "across updates. Non-unique keys may cause children to be " + "duplicated and/or omitted — the behavior is unsupported and " + "could change in a future version.", key); + break; + case REACT_LAZY_TYPE: + var payload = child._payload; + var init = child._init; + warnOnInvalidKey(init(payload), knownKeys, returnFiber); + break; + } + } + return knownKeys; + } + function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) { + // This algorithm can't optimize by searching from both ends since we + // don't have backpointers on fibers. I'm trying to see how far we can get + // with that model. If it ends up not being worth the tradeoffs, we can + // add it later. + // Even with a two ended optimization, we'd want to optimize for the case + // where there are few changes and brute force the comparison instead of + // going for the Map. It'd like to explore hitting that path first in + // forward-only mode and only go for the Map once we notice that we need + // lots of look ahead. This doesn't handle reversal as well as two ended + // search but that's unusual. Besides, for the two ended optimization to + // work on Iterables, we'd need to copy the whole set. + // In this first iteration, we'll just live with hitting the bad case + // (adding everything to a Map) in for every insert/move. + // If you change this code, also update reconcileChildrenIterator() which + // uses the same algorithm. + { + // First, validate keys. + var knownKeys = null; + for (var i = 0; i < newChildren.length; i++) { + var child = newChildren[i]; + knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber); + } + } + var resultingFirstChild = null; + var previousNewFiber = null; + var oldFiber = currentFirstChild; + var lastPlacedIndex = 0; + var newIdx = 0; + var nextOldFiber = null; + for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) { + if (oldFiber.index > newIdx) { + nextOldFiber = oldFiber; + oldFiber = null; + } else { + nextOldFiber = oldFiber.sibling; + } + var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes); + if (newFiber === null) { + // TODO: This breaks on empty slots like null children. That's + // unfortunate because it triggers the slow path all the time. We need + // a better way to communicate whether this was a miss or null, + // boolean, undefined, etc. + if (oldFiber === null) { + oldFiber = nextOldFiber; + } + break; + } + if (shouldTrackSideEffects) { + if (oldFiber && newFiber.alternate === null) { + // We matched the slot, but we didn't reuse the existing fiber, so we + // need to delete the existing child. + deleteChild(returnFiber, oldFiber); + } + } + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = newFiber; + } else { + // TODO: Defer siblings if we're not at the right index for this slot. + // I.e. if we had null values before, then we want to defer this + // for each null value. However, we also don't want to call updateSlot + // with the previous one. + previousNewFiber.sibling = newFiber; + } + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (newIdx === newChildren.length) { + // We've reached the end of the new children. We can delete the rest. + deleteRemainingChildren(returnFiber, oldFiber); + return resultingFirstChild; + } + if (oldFiber === null) { + // If we don't have any more existing children we can choose a fast path + // since the rest will all be insertions. + for (; newIdx < newChildren.length; newIdx++) { + var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes); + if (_newFiber === null) { + continue; + } + lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = _newFiber; + } else { + previousNewFiber.sibling = _newFiber; + } + previousNewFiber = _newFiber; + } + return resultingFirstChild; + } // Add all children to a key map for quick lookups. + + var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves. + + for (; newIdx < newChildren.length; newIdx++) { + var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes); + if (_newFiber2 !== null) { + if (shouldTrackSideEffects) { + if (_newFiber2.alternate !== null) { + // The new fiber is a work in progress, but if there exists a + // current, that means that we reused the fiber. We need to delete + // it from the child list so that we don't add it to the deletion + // list. + existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key); + } + } + lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + resultingFirstChild = _newFiber2; + } else { + previousNewFiber.sibling = _newFiber2; + } + previousNewFiber = _newFiber2; + } + } + if (shouldTrackSideEffects) { + // Any existing children that weren't consumed above were deleted. We need + // to add them to the deletion list. + existingChildren.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + } + return resultingFirstChild; + } + function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) { + // This is the same implementation as reconcileChildrenArray(), + // but using the iterator instead. + var iteratorFn = getIteratorFn(newChildrenIterable); + if (typeof iteratorFn !== "function") { + throw new Error("An object is not an iterable. This error is likely caused by a bug in " + "React. Please file an issue."); + } + { + // We don't support rendering Generators because it's a mutation. + // See https://github.com/facebook/react/issues/12995 + if (typeof Symbol === "function" && + // $FlowFixMe Flow doesn't know about toStringTag + newChildrenIterable[Symbol.toStringTag] === "Generator") { + if (!didWarnAboutGenerators) { + error("Using Generators as children is unsupported and will likely yield " + "unexpected results because enumerating a generator mutates it. " + "You may convert it to an array with `Array.from()` or the " + "`[...spread]` operator before rendering. Keep in mind " + "you might need to polyfill these features for older browsers."); + } + didWarnAboutGenerators = true; + } // Warn about using Maps as children + + if (newChildrenIterable.entries === iteratorFn) { + if (!didWarnAboutMaps) { + error("Using Maps as children is not supported. " + "Use an array of keyed ReactElements instead."); + } + didWarnAboutMaps = true; + } // First, validate keys. + // We'll get a different iterator later for the main pass. + + var _newChildren = iteratorFn.call(newChildrenIterable); + if (_newChildren) { + var knownKeys = null; + var _step = _newChildren.next(); + for (; !_step.done; _step = _newChildren.next()) { + var child = _step.value; + knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber); + } + } + } + var newChildren = iteratorFn.call(newChildrenIterable); + if (newChildren == null) { + throw new Error("An iterable object provided no iterator."); + } + var resultingFirstChild = null; + var previousNewFiber = null; + var oldFiber = currentFirstChild; + var lastPlacedIndex = 0; + var newIdx = 0; + var nextOldFiber = null; + var step = newChildren.next(); + for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) { + if (oldFiber.index > newIdx) { + nextOldFiber = oldFiber; + oldFiber = null; + } else { + nextOldFiber = oldFiber.sibling; + } + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (newFiber === null) { + // TODO: This breaks on empty slots like null children. That's + // unfortunate because it triggers the slow path all the time. We need + // a better way to communicate whether this was a miss or null, + // boolean, undefined, etc. + if (oldFiber === null) { + oldFiber = nextOldFiber; + } + break; + } + if (shouldTrackSideEffects) { + if (oldFiber && newFiber.alternate === null) { + // We matched the slot, but we didn't reuse the existing fiber, so we + // need to delete the existing child. + deleteChild(returnFiber, oldFiber); + } + } + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = newFiber; + } else { + // TODO: Defer siblings if we're not at the right index for this slot. + // I.e. if we had null values before, then we want to defer this + // for each null value. However, we also don't want to call updateSlot + // with the previous one. + previousNewFiber.sibling = newFiber; + } + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (step.done) { + // We've reached the end of the new children. We can delete the rest. + deleteRemainingChildren(returnFiber, oldFiber); + return resultingFirstChild; + } + if (oldFiber === null) { + // If we don't have any more existing children we can choose a fast path + // since the rest will all be insertions. + for (; !step.done; newIdx++, step = newChildren.next()) { + var _newFiber3 = createChild(returnFiber, step.value, lanes); + if (_newFiber3 === null) { + continue; + } + lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = _newFiber3; + } else { + previousNewFiber.sibling = _newFiber3; + } + previousNewFiber = _newFiber3; + } + return resultingFirstChild; + } // Add all children to a key map for quick lookups. + + var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves. + + for (; !step.done; newIdx++, step = newChildren.next()) { + var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes); + if (_newFiber4 !== null) { + if (shouldTrackSideEffects) { + if (_newFiber4.alternate !== null) { + // The new fiber is a work in progress, but if there exists a + // current, that means that we reused the fiber. We need to delete + // it from the child list so that we don't add it to the deletion + // list. + existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key); + } + } + lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + resultingFirstChild = _newFiber4; + } else { + previousNewFiber.sibling = _newFiber4; + } + previousNewFiber = _newFiber4; + } + } + if (shouldTrackSideEffects) { + // Any existing children that weren't consumed above were deleted. We need + // to add them to the deletion list. + existingChildren.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + } + return resultingFirstChild; + } + function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) { + // There's no need to check for keys on text nodes since we don't have a + // way to define them. + if (currentFirstChild !== null && currentFirstChild.tag === HostText) { + // We already have an existing node so let's just update it and delete + // the rest. + deleteRemainingChildren(returnFiber, currentFirstChild.sibling); + var existing = useFiber(currentFirstChild, textContent); + existing.return = returnFiber; + return existing; + } // The existing first child is not a text node so we need to create one + // and delete the existing ones. + + deleteRemainingChildren(returnFiber, currentFirstChild); + var created = createFiberFromText(textContent, returnFiber.mode, lanes); + created.return = returnFiber; + return created; + } + function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) { + var key = element.key; + var child = currentFirstChild; + while (child !== null) { + // TODO: If key === null and child.key === null, then this only applies to + // the first item in the list. + if (child.key === key) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) { + if (child.tag === Fragment) { + deleteRemainingChildren(returnFiber, child.sibling); + var existing = useFiber(child, element.props.children); + existing.return = returnFiber; + { + existing._debugSource = element._source; + existing._debugOwner = element._owner; + } + return existing; + } + } else { + if (child.elementType === elementType || + // Keep this check inline so it only runs on the false path: + isCompatibleFamilyForHotReloading(child, element) || + // Lazy types should reconcile their resolved type. + // We need to do this after the Hot Reloading check above, + // because hot reloading has different semantics than prod because + // it doesn't resuspend. So we can't let the call below suspend. + typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === child.type) { + deleteRemainingChildren(returnFiber, child.sibling); + var _existing = useFiber(child, element.props); + _existing.ref = coerceRef(returnFiber, child, element); + _existing.return = returnFiber; + { + _existing._debugSource = element._source; + _existing._debugOwner = element._owner; + } + return _existing; + } + } // Didn't match. + + deleteRemainingChildren(returnFiber, child); + break; + } else { + deleteChild(returnFiber, child); + } + child = child.sibling; + } + if (element.type === REACT_FRAGMENT_TYPE) { + var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key); + created.return = returnFiber; + return created; + } else { + var _created4 = createFiberFromElement(element, returnFiber.mode, lanes); + _created4.ref = coerceRef(returnFiber, currentFirstChild, element); + _created4.return = returnFiber; + return _created4; + } + } + function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) { + var key = portal.key; + var child = currentFirstChild; + while (child !== null) { + // TODO: If key === null and child.key === null, then this only applies to + // the first item in the list. + if (child.key === key) { + if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { + deleteRemainingChildren(returnFiber, child.sibling); + var existing = useFiber(child, portal.children || []); + existing.return = returnFiber; + return existing; + } else { + deleteRemainingChildren(returnFiber, child); + break; + } + } else { + deleteChild(returnFiber, child); + } + child = child.sibling; + } + var created = createFiberFromPortal(portal, returnFiber.mode, lanes); + created.return = returnFiber; + return created; + } // This API will tag the children with the side-effect of the reconciliation + // itself. They will be added to the side-effect list as we pass through the + // children and the parent. + + function reconcileChildFibers(returnFiber, currentFirstChild, newChild, lanes) { + // This function is not recursive. + // If the top level item is an array, we treat it as a set of children, + // not as a fragment. Nested arrays on the other hand will be treated as + // fragment nodes. Recursion happens at the normal flow. + // Handle top level unkeyed fragments as if they were arrays. + // This leads to an ambiguity between <>{[...]} and <>.... + // We treat the ambiguous cases above the same. + var isUnkeyedTopLevelFragment = typeof newChild === "object" && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null; + if (isUnkeyedTopLevelFragment) { + newChild = newChild.props.children; + } // Handle object types + + if (typeof newChild === "object" && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes)); + case REACT_PORTAL_TYPE: + return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes)); + case REACT_LAZY_TYPE: + var payload = newChild._payload; + var init = newChild._init; // TODO: This function is supposed to be non-recursive. + + return reconcileChildFibers(returnFiber, currentFirstChild, init(payload), lanes); + } + if (isArray(newChild)) { + return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes); + } + if (getIteratorFn(newChild)) { + return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes); + } + throwOnInvalidObjectType(returnFiber, newChild); + } + if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") { + return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, lanes)); + } + { + if (typeof newChild === "function") { + warnOnFunctionType(returnFiber); + } + } // Remaining cases are all treated as empty. + + return deleteRemainingChildren(returnFiber, currentFirstChild); + } + return reconcileChildFibers; + } + var reconcileChildFibers = ChildReconciler(true); + var mountChildFibers = ChildReconciler(false); + function cloneChildFibers(current, workInProgress) { + if (current !== null && workInProgress.child !== current.child) { + throw new Error("Resuming work not yet implemented."); + } + if (workInProgress.child === null) { + return; + } + var currentChild = workInProgress.child; + var newChild = createWorkInProgress(currentChild, currentChild.pendingProps); + workInProgress.child = newChild; + newChild.return = workInProgress; + while (currentChild.sibling !== null) { + currentChild = currentChild.sibling; + newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps); + newChild.return = workInProgress; + } + newChild.sibling = null; + } // Reset a workInProgress child set to prepare it for a second pass. + + function resetChildFibers(workInProgress, lanes) { + var child = workInProgress.child; + while (child !== null) { + resetWorkInProgress(child, lanes); + child = child.sibling; + } + } + var NO_CONTEXT = {}; + var contextStackCursor$1 = createCursor(NO_CONTEXT); + var contextFiberStackCursor = createCursor(NO_CONTEXT); + var rootInstanceStackCursor = createCursor(NO_CONTEXT); + function requiredContext(c) { + if (c === NO_CONTEXT) { + throw new Error("Expected host context to exist. This error is likely caused by a bug " + "in React. Please file an issue."); + } + return c; + } + function getRootHostContainer() { + var rootInstance = requiredContext(rootInstanceStackCursor.current); + return rootInstance; + } + function pushHostContainer(fiber, nextRootInstance) { + // Push current root instance onto the stack; + // This allows us to reset root when portals are popped. + push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + + push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack. + // However, we can't just call getRootHostContext() and push it because + // we'd have a different number of entries on the stack depending on + // whether getRootHostContext() throws somewhere in renderer code or not. + // So we push an empty value first. This lets us safely unwind on errors. + + push(contextStackCursor$1, NO_CONTEXT, fiber); + var nextRootContext = getRootHostContext(); // Now that we know this function doesn't throw, replace it. + + pop(contextStackCursor$1, fiber); + push(contextStackCursor$1, nextRootContext, fiber); + } + function popHostContainer(fiber) { + pop(contextStackCursor$1, fiber); + pop(contextFiberStackCursor, fiber); + pop(rootInstanceStackCursor, fiber); + } + function getHostContext() { + var context = requiredContext(contextStackCursor$1.current); + return context; + } + function pushHostContext(fiber) { + var rootInstance = requiredContext(rootInstanceStackCursor.current); + var context = requiredContext(contextStackCursor$1.current); + var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique. + + if (context === nextContext) { + return; + } // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor$1, nextContext, fiber); + } + function popHostContext(fiber) { + // Do not pop unless this Fiber provided the current context. + // pushHostContext() only pushes Fibers that provide unique contexts. + if (contextFiberStackCursor.current !== fiber) { + return; + } + pop(contextStackCursor$1, fiber); + pop(contextFiberStackCursor, fiber); + } + var DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is + // inherited deeply down the subtree. The upper bits only affect + // this immediate suspense boundary and gets reset each new + // boundary or suspense list. + + var SubtreeSuspenseContextMask = 1; // Subtree Flags: + // InvisibleParentSuspenseContext indicates that one of our parent Suspense + // boundaries is not currently showing visible main content. + // Either because it is already showing a fallback or is not mounted at all. + // We can use this to determine if it is desirable to trigger a fallback at + // the parent. If not, then we might need to trigger undesirable boundaries + // and/or suspend the commit to avoid hiding the parent content. + + var InvisibleParentSuspenseContext = 1; // Shallow Flags: + // ForceSuspenseFallback can be used by SuspenseList to force newly added + // items into their fallback state during one of the render passes. + + var ForceSuspenseFallback = 2; + var suspenseStackCursor = createCursor(DefaultSuspenseContext); + function hasSuspenseContext(parentContext, flag) { + return (parentContext & flag) !== 0; + } + function setDefaultShallowSuspenseContext(parentContext) { + return parentContext & SubtreeSuspenseContextMask; + } + function setShallowSuspenseContext(parentContext, shallowContext) { + return parentContext & SubtreeSuspenseContextMask | shallowContext; + } + function addSubtreeSuspenseContext(parentContext, subtreeContext) { + return parentContext | subtreeContext; + } + function pushSuspenseContext(fiber, newContext) { + push(suspenseStackCursor, newContext, fiber); + } + function popSuspenseContext(fiber) { + pop(suspenseStackCursor, fiber); + } + function shouldCaptureSuspense(workInProgress, hasInvisibleParent) { + // If it was the primary children that just suspended, capture and render the + // fallback. Otherwise, don't capture and bubble to the next boundary. + var nextState = workInProgress.memoizedState; + if (nextState !== null) { + if (nextState.dehydrated !== null) { + // A dehydrated boundary always captures. + return true; + } + return false; + } + var props = workInProgress.memoizedProps; // Regular boundaries always capture. + + { + return true; + } // If it's a boundary we should avoid, then we prefer to bubble up to the + } + function findFirstSuspended(row) { + var node = row; + while (node !== null) { + if (node.tag === SuspenseComponent) { + var state = node.memoizedState; + if (state !== null) { + var dehydrated = state.dehydrated; + if (dehydrated === null || isSuspenseInstancePending() || isSuspenseInstanceFallback()) { + return node; + } + } + } else if (node.tag === SuspenseListComponent && + // revealOrder undefined can't be trusted because it don't + // keep track of whether it suspended or not. + node.memoizedProps.revealOrder !== undefined) { + var didSuspend = (node.flags & DidCapture) !== NoFlags; + if (didSuspend) { + return node; + } + } else if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) { + return null; + } + while (node.sibling === null) { + if (node.return === null || node.return === row) { + return null; + } + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + return null; + } + var NoFlags$1 = /* */ + 0; // Represents whether effect should fire. + + var HasEffect = /* */ + 1; // Represents the phase in which the effect (not the clean-up) fires. + + var Insertion = /* */ + 2; + var Layout = /* */ + 4; + var Passive$1 = /* */ + 8; + + // and should be reset before starting a new render. + // This tracks which mutable sources need to be reset after a render. + + var workInProgressSources = []; + function resetWorkInProgressVersions() { + for (var i = 0; i < workInProgressSources.length; i++) { + var mutableSource = workInProgressSources[i]; + { + mutableSource._workInProgressVersionSecondary = null; + } + } + workInProgressSources.length = 0; + } + var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, + ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig; + var didWarnAboutMismatchedHooksForComponent; + var didWarnUncachedGetSnapshot; + { + didWarnAboutMismatchedHooksForComponent = new Set(); + } + + // These are set right before calling the component. + var renderLanes = NoLanes; // The work-in-progress fiber. I've named it differently to distinguish it from + // the work-in-progress hook. + + var currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The + // current hook list is the list that belongs to the current fiber. The + // work-in-progress hook list is a new list that will be added to the + // work-in-progress fiber. + + var currentHook = null; + var workInProgressHook = null; // Whether an update was scheduled at any point during the render phase. This + // does not get reset if we do another render pass; only when we're completely + // finished evaluating this component. This is an optimization so we know + // whether we need to clear render phase updates after a throw. + + var didScheduleRenderPhaseUpdate = false; // Where an update was scheduled only during the current render pass. This + // gets reset after each attempt. + // TODO: Maybe there's some way to consolidate this with + // `didScheduleRenderPhaseUpdate`. Or with `numberOfReRenders`. + + var didScheduleRenderPhaseUpdateDuringThisPass = false; // Counts the number of useId hooks in this component. + // hydration). This counter is global, so client ids are not stable across + // render attempts. + + var globalClientIdCounter = 0; + var RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook + + var currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders. + // The list stores the order of hooks used during the initial render (mount). + // Subsequent renders (updates) reference this list. + + var hookTypesDev = null; + var hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore + // the dependencies for Hooks that need them (e.g. useEffect or useMemo). + // When true, such Hooks will always be "remounted". Only used during hot reload. + + var ignorePreviousDependencies = false; + function mountHookTypesDev() { + { + var hookName = currentHookNameInDev; + if (hookTypesDev === null) { + hookTypesDev = [hookName]; + } else { + hookTypesDev.push(hookName); + } + } + } + function updateHookTypesDev() { + { + var hookName = currentHookNameInDev; + if (hookTypesDev !== null) { + hookTypesUpdateIndexDev++; + if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) { + warnOnHookMismatchInDev(hookName); + } + } + } + } + function checkDepsAreArrayDev(deps) { + { + if (deps !== undefined && deps !== null && !isArray(deps)) { + // Verify deps, but only on mount to avoid extra checks. + // It's unlikely their type would change as usually you define them inline. + error("%s received a final argument that is not an array (instead, received `%s`). When " + "specified, the final argument must be an array.", currentHookNameInDev, typeof deps); + } + } + } + function warnOnHookMismatchInDev(currentHookName) { + { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); + if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) { + didWarnAboutMismatchedHooksForComponent.add(componentName); + if (hookTypesDev !== null) { + var table = ""; + var secondColumnStart = 30; + for (var i = 0; i <= hookTypesUpdateIndexDev; i++) { + var oldHookName = hookTypesDev[i]; + var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName; + var row = i + 1 + ". " + oldHookName; // Extra space so second column lines up + // lol @ IE not supporting String#repeat + + while (row.length < secondColumnStart) { + row += " "; + } + row += newHookName + "\n"; + table += row; + } + error("React has detected a change in the order of Hooks called by %s. " + "This will lead to bugs and errors if not fixed. " + "For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n" + " Previous render Next render\n" + " ------------------------------------------------------\n" + "%s" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", componentName, table); + } + } + } + } + function throwInvalidHookError() { + throw new 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:\n" + "1. You might have mismatching versions of React and the renderer (such as React DOM)\n" + "2. You might be breaking the Rules of Hooks\n" + "3. You might have more than one copy of React in the same app\n" + "See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."); + } + function areHookInputsEqual(nextDeps, prevDeps) { + { + if (ignorePreviousDependencies) { + // Only true when this component is being hot reloaded. + return false; + } + } + if (prevDeps === null) { + { + error("%s received a final argument during this render, but not during " + "the previous render. Even though the final argument is optional, " + "its type cannot change between renders.", currentHookNameInDev); + } + return false; + } + { + // Don't bother comparing lengths in prod because these arrays should be + // passed inline. + if (nextDeps.length !== prevDeps.length) { + error("The final argument passed to %s changed size between renders. The " + "order and size of this array must remain constant.\n\n" + "Previous: %s\n" + "Incoming: %s", currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + nextDeps.join(", ") + "]"); + } + } + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) { + if (objectIs(nextDeps[i], prevDeps[i])) { + continue; + } + return false; + } + return true; + } + function renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderLanes) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber$1 = workInProgress; + { + hookTypesDev = current !== null ? current._debugHookTypes : null; + hookTypesUpdateIndexDev = -1; // Used for hot reloading: + + ignorePreviousDependencies = current !== null && current.type !== workInProgress.type; + } + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = NoLanes; // The following should have already been reset + // currentHook = null; + // workInProgressHook = null; + // didScheduleRenderPhaseUpdate = false; + // localIdCounter = 0; + // TODO Warn if no hooks are used at all during mount, then some are used during update. + // Currently we will identify the update render as a mount because memoizedState === null. + // This is tricky because it's valid for certain types of components (e.g. React.lazy) + // Using memoizedState to differentiate between mount/update only works if at least one stateful hook is used. + // Non-stateful hooks (e.g. context) don't get added to memoizedState, + // so memoizedState would be null during updates and mounts. + + { + if (current !== null && current.memoizedState !== null) { + ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV; + } else if (hookTypesDev !== null) { + // This dispatcher handles an edge case where a component is updating, + // but no stateful hooks have been used. + // We want to match the production code behavior (which will use HooksDispatcherOnMount), + // but with the extra DEV validation to ensure hooks ordering hasn't changed. + // This dispatcher does that. + ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV; + } else { + ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV; + } + } + var children = Component(props, secondArg); // Check if there was a render phase update + + if (didScheduleRenderPhaseUpdateDuringThisPass) { + // Keep rendering in a loop for as long as render phase updates continue to + // be scheduled. Use a counter to prevent infinite loops. + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass = false; + if (numberOfReRenders >= RE_RENDER_LIMIT) { + throw new Error("Too many re-renders. React limits the number of renders to prevent " + "an infinite loop."); + } + numberOfReRenders += 1; + { + // Even when hot reloading, allow dependencies to stabilize + // after first render to prevent infinite render phase updates. + ignorePreviousDependencies = false; + } // Start over from the beginning of the list + + currentHook = null; + workInProgressHook = null; + workInProgress.updateQueue = null; + { + // Also validate hook order for cascading updates. + hookTypesUpdateIndexDev = -1; + } + ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV; + children = Component(props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + } // We can assume the previous dispatcher is always this one, since we set it + // at the beginning of the render phase and there's no re-entrance. + + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; + { + workInProgress._debugHookTypes = hookTypesDev; + } // This check uses currentHook so that it works the same in DEV and prod bundles. + // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles. + + var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null; + renderLanes = NoLanes; + currentlyRenderingFiber$1 = null; + currentHook = null; + workInProgressHook = null; + { + currentHookNameInDev = null; + hookTypesDev = null; + hookTypesUpdateIndexDev = -1; // Confirm that a static flag was not added or removed since the last + // render. If this fires, it suggests that we incorrectly reset the static + // flags in some other part of the codebase. This has happened before, for + // example, in the SuspenseList implementation. + + if (current !== null && (current.flags & StaticMask) !== (workInProgress.flags & StaticMask) && + // Disable this warning in legacy mode, because legacy Suspense is weird + // and creates false positives. To make this work in legacy mode, we'd + // need to mark fibers that commit in an incomplete state, somehow. For + // now I'll disable the warning that most of the bugs that would trigger + // it are either exclusive to concurrent mode or exist in both. + (current.mode & ConcurrentMode) !== NoMode) { + error("Internal React error: Expected static flag was missing. Please " + "notify the React team."); + } + } + didScheduleRenderPhaseUpdate = false; // This is reset by checkDidRenderIdHook + // localIdCounter = 0; + + if (didRenderTooFewHooks) { + throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental " + "early return statement."); + } + return children; + } + function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; // TODO: Don't need to reset the flags here, because they're reset in the + // complete phase (bubbleProperties). + + { + workInProgress.flags &= ~(Passive | Update); + } + current.lanes = removeLanes(current.lanes, lanes); + } + function resetHooksAfterThrow() { + // We can assume the previous dispatcher is always this one, since we set it + // at the beginning of the render phase and there's no re-entrance. + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; + if (didScheduleRenderPhaseUpdate) { + // There were render phase updates. These are only valid for this render + // phase, which we are now aborting. Remove the updates from the queues so + // they do not persist to the next render. Do not remove updates from hooks + // that weren't processed. + // + // Only reset the updates from the queue if it has a clone. If it does + // not have a clone, that means it wasn't processed, and the updates were + // scheduled before we entered the render phase. + var hook = currentlyRenderingFiber$1.memoizedState; + while (hook !== null) { + var queue = hook.queue; + if (queue !== null) { + queue.pending = null; + } + hook = hook.next; + } + didScheduleRenderPhaseUpdate = false; + } + renderLanes = NoLanes; + currentlyRenderingFiber$1 = null; + currentHook = null; + workInProgressHook = null; + { + hookTypesDev = null; + hookTypesUpdateIndexDev = -1; + currentHookNameInDev = null; + isUpdatingOpaqueValueInRenderPhase = false; + } + didScheduleRenderPhaseUpdateDuringThisPass = false; + } + function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, + baseQueue: null, + queue: null, + next: null + }; + if (workInProgressHook === null) { + // This is the first hook in the list + currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook; + } else { + // Append to the end of the list + workInProgressHook = workInProgressHook.next = hook; + } + return workInProgressHook; + } + function updateWorkInProgressHook() { + // This function is used both for updates and for re-renders triggered by a + // render phase update. It assumes there is either a current hook we can + // clone, or a work-in-progress hook from a previous render pass that we can + // use as a base. When we reach the end of the base list, we must switch to + // the dispatcher used for mounts. + var nextCurrentHook; + if (currentHook === null) { + var current = currentlyRenderingFiber$1.alternate; + if (current !== null) { + nextCurrentHook = current.memoizedState; + } else { + nextCurrentHook = null; + } + } else { + nextCurrentHook = currentHook.next; + } + var nextWorkInProgressHook; + if (workInProgressHook === null) { + nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState; + } else { + nextWorkInProgressHook = workInProgressHook.next; + } + if (nextWorkInProgressHook !== null) { + // There's already a work-in-progress. Reuse it. + workInProgressHook = nextWorkInProgressHook; + nextWorkInProgressHook = workInProgressHook.next; + currentHook = nextCurrentHook; + } else { + // Clone from the current hook. + if (nextCurrentHook === null) { + throw new Error("Rendered more hooks than during the previous render."); + } + currentHook = nextCurrentHook; + var newHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + if (workInProgressHook === null) { + // This is the first hook in the list. + currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook; + } else { + // Append to the end of the list. + workInProgressHook = workInProgressHook.next = newHook; + } + } + return workInProgressHook; + } + function createFunctionComponentUpdateQueue() { + return { + lastEffect: null, + stores: null + }; + } + function basicStateReducer(state, action) { + // $FlowFixMe: Flow doesn't like mixed types + return typeof action === "function" ? action(state) : action; + } + function mountReducer(reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + var initialState; + if (init !== undefined) { + initialState = init(initialArg); + } else { + initialState = initialArg; + } + hook.memoizedState = hook.baseState = initialState; + var queue = { + pending: null, + interleaved: null, + lanes: NoLanes, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = queue; + var dispatch = queue.dispatch = dispatchReducerAction.bind(null, currentlyRenderingFiber$1, queue); + return [hook.memoizedState, dispatch]; + } + function updateReducer(reducer, initialArg, init) { + var hook = updateWorkInProgressHook(); + var queue = hook.queue; + if (queue === null) { + throw new Error("Should have a queue. This is likely a bug in React. Please file an issue."); + } + queue.lastRenderedReducer = reducer; + var current = currentHook; // The last rebase update that is NOT part of the base state. + + var baseQueue = current.baseQueue; // The last pending update that hasn't been processed yet. + + var pendingQueue = queue.pending; + if (pendingQueue !== null) { + // We have new updates that haven't been processed yet. + // We'll add them to the base queue. + if (baseQueue !== null) { + // Merge the pending queue and the base queue. + var baseFirst = baseQueue.next; + var pendingFirst = pendingQueue.next; + baseQueue.next = pendingFirst; + pendingQueue.next = baseFirst; + } + { + if (current.baseQueue !== baseQueue) { + // Internal invariant that should never happen, but feasibly could in + // the future if we implement resuming, or some form of that. + error("Internal error: Expected work-in-progress queue to be a clone. " + "This is a bug in React."); + } + } + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; + } + if (baseQueue !== null) { + // We have a queue to process. + var first = baseQueue.next; + var newState = current.baseState; + var newBaseState = null; + var newBaseQueueFirst = null; + var newBaseQueueLast = null; + var update = first; + do { + var updateLane = update.lane; + if (!isSubsetOfLanes(renderLanes, updateLane)) { + // Priority is insufficient. Skip this update. If this is the first + // skipped update, the previous update/state is the new base + // update/state. + var clone = { + lane: updateLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }; + if (newBaseQueueLast === null) { + newBaseQueueFirst = newBaseQueueLast = clone; + newBaseState = newState; + } else { + newBaseQueueLast = newBaseQueueLast.next = clone; + } // Update the remaining priority in the queue. + // TODO: Don't need to accumulate this. Instead, we can remove + // renderLanes from the original lanes. + + currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane); + markSkippedUpdateLanes(updateLane); + } else { + // This update does have sufficient priority. + if (newBaseQueueLast !== null) { + var _clone = { + // This update is going to be committed so we never want uncommit + // it. Using NoLane works because 0 is a subset of all bitmasks, so + // this will never be skipped by the check above. + lane: NoLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }; + newBaseQueueLast = newBaseQueueLast.next = _clone; + } // Process this update. + + if (update.hasEagerState) { + // If this update is a state update (not a reducer) and was processed eagerly, + // we can use the eagerly computed state + newState = update.eagerState; + } else { + var action = update.action; + newState = reducer(newState, action); + } + } + update = update.next; + } while (update !== null && update !== first); + if (newBaseQueueLast === null) { + newBaseState = newState; + } else { + newBaseQueueLast.next = newBaseQueueFirst; + } // Mark that the fiber performed work, but only if the new state is + // different from the current state. + + if (!objectIs(newState, hook.memoizedState)) { + markWorkInProgressReceivedUpdate(); + } + hook.memoizedState = newState; + hook.baseState = newBaseState; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = newState; + } // Interleaved updates are stored on a separate queue. We aren't going to + // process them during this render, but we do need to track which lanes + // are remaining. + + var lastInterleaved = queue.interleaved; + if (lastInterleaved !== null) { + var interleaved = lastInterleaved; + do { + var interleavedLane = interleaved.lane; + currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, interleavedLane); + markSkippedUpdateLanes(interleavedLane); + interleaved = interleaved.next; + } while (interleaved !== lastInterleaved); + } else if (baseQueue === null) { + // `queue.lanes` is used for entangling transitions. We can set it back to + // zero once the queue is empty. + queue.lanes = NoLanes; + } + var dispatch = queue.dispatch; + return [hook.memoizedState, dispatch]; + } + function rerenderReducer(reducer, initialArg, init) { + var hook = updateWorkInProgressHook(); + var queue = hook.queue; + if (queue === null) { + throw new Error("Should have a queue. This is likely a bug in React. Please file an issue."); + } + queue.lastRenderedReducer = reducer; // This is a re-render. Apply the new render phase updates to the previous + // work-in-progress hook. + + var dispatch = queue.dispatch; + var lastRenderPhaseUpdate = queue.pending; + var newState = hook.memoizedState; + if (lastRenderPhaseUpdate !== null) { + // The queue doesn't persist past this render pass. + queue.pending = null; + var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next; + var update = firstRenderPhaseUpdate; + do { + // Process this render phase update. We don't have to check the + // priority because it will always be the same as the current + // render's. + var action = update.action; + newState = reducer(newState, action); + update = update.next; + } while (update !== firstRenderPhaseUpdate); // Mark that the fiber performed work, but only if the new state is + // different from the current state. + + if (!objectIs(newState, hook.memoizedState)) { + markWorkInProgressReceivedUpdate(); + } + hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to + // the base state unless the queue is empty. + // TODO: Not sure if this is the desired semantics, but it's what we + // do for gDSFP. I can't remember why. + + if (hook.baseQueue === null) { + hook.baseState = newState; + } + queue.lastRenderedState = newState; + } + return [newState, dispatch]; + } + function mountMutableSource(source, getSnapshot, subscribe) { + { + return undefined; + } + } + function updateMutableSource(source, getSnapshot, subscribe) { + { + return undefined; + } + } + function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber$1; + var hook = mountWorkInProgressHook(); + var nextSnapshot; + { + nextSnapshot = getSnapshot(); + { + if (!didWarnUncachedGetSnapshot) { + var cachedSnapshot = getSnapshot(); + if (!objectIs(nextSnapshot, cachedSnapshot)) { + error("The result of getSnapshot should be cached to avoid an infinite loop"); + didWarnUncachedGetSnapshot = true; + } + } + } // Unless we're rendering a blocking lane, schedule a consistency check. + // Right before committing, we will walk the tree and check if any of the + // stores were mutated. + // + // We won't do this if we're hydrating server-rendered content, because if + // the content is stale, it's already visible anyway. Instead we'll patch + // it up in a passive effect. + + var root = getWorkInProgressRoot(); + if (root === null) { + throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue."); + } + if (!includesBlockingLane(root, renderLanes)) { + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + } + } // Read the current snapshot from the store on every render. This breaks the + // normal rules of React, and only works because store updates are + // always synchronous. + + hook.memoizedState = nextSnapshot; + var inst = { + value: nextSnapshot, + getSnapshot: getSnapshot + }; + hook.queue = inst; // Schedule an effect to subscribe to the store. + + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]); // Schedule an effect to update the mutable instance fields. We will update + // this whenever subscribe, getSnapshot, or value changes. Because there's no + // clean-up function, and we track the deps correctly, we can call pushEffect + // directly, without storing any additional state. For the same reason, we + // don't need to set a static flag, either. + // TODO: We can move this to the passive phase once we add a pre-commit + // consistency check. See the next comment. + + fiber.flags |= Passive; + pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), undefined, null); + return nextSnapshot; + } + function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber$1; + var hook = updateWorkInProgressHook(); // Read the current snapshot from the store on every render. This breaks the + // normal rules of React, and only works because store updates are + // always synchronous. + + var nextSnapshot = getSnapshot(); + { + if (!didWarnUncachedGetSnapshot) { + var cachedSnapshot = getSnapshot(); + if (!objectIs(nextSnapshot, cachedSnapshot)) { + error("The result of getSnapshot should be cached to avoid an infinite loop"); + didWarnUncachedGetSnapshot = true; + } + } + } + var prevSnapshot = hook.memoizedState; + var snapshotChanged = !objectIs(prevSnapshot, nextSnapshot); + if (snapshotChanged) { + hook.memoizedState = nextSnapshot; + markWorkInProgressReceivedUpdate(); + } + var inst = hook.queue; + updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]); // Whenever getSnapshot or subscribe changes, we need to check in the + // commit phase if there was an interleaved mutation. In concurrent mode + // this can happen all the time, but even in synchronous mode, an earlier + // effect may have mutated the store. + + if (inst.getSnapshot !== getSnapshot || snapshotChanged || + // Check if the susbcribe function changed. We can save some memory by + // checking whether we scheduled a subscription effect above. + workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) { + fiber.flags |= Passive; + pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), undefined, null); // Unless we're rendering a blocking lane, schedule a consistency check. + // Right before committing, we will walk the tree and check if any of the + // stores were mutated. + + var root = getWorkInProgressRoot(); + if (root === null) { + throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue."); + } + if (!includesBlockingLane(root, renderLanes)) { + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + } + } + return nextSnapshot; + } + function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= StoreConsistency; + var check = { + getSnapshot: getSnapshot, + value: renderedSnapshot + }; + var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; + if (componentUpdateQueue === null) { + componentUpdateQueue = createFunctionComponentUpdateQueue(); + currentlyRenderingFiber$1.updateQueue = componentUpdateQueue; + componentUpdateQueue.stores = [check]; + } else { + var stores = componentUpdateQueue.stores; + if (stores === null) { + componentUpdateQueue.stores = [check]; + } else { + stores.push(check); + } + } + } + function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + // These are updated in the passive phase + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; // Something may have been mutated in between render and commit. This could + // have been in an event that fired before the passive effects, or it could + // have been in a layout effect. In that case, we would have used the old + // snapsho and getSnapshot values to bail out. We need to check one more time. + + if (checkIfSnapshotChanged(inst)) { + // Force a re-render. + forceStoreRerender(fiber); + } + } + function subscribeToStore(fiber, inst, subscribe) { + var handleStoreChange = function handleStoreChange() { + // The store changed. Check if the snapshot changed since the last time we + // read from the store. + if (checkIfSnapshotChanged(inst)) { + // Force a re-render. + forceStoreRerender(fiber); + } + }; // Subscribe to the store and return a clean-up function. + + return subscribe(handleStoreChange); + } + function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + var prevValue = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(prevValue, nextValue); + } catch (error) { + return true; + } + } + function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + } + function mountState(initialState) { + var hook = mountWorkInProgressHook(); + if (typeof initialState === "function") { + // $FlowFixMe: Flow doesn't like mixed types + initialState = initialState(); + } + hook.memoizedState = hook.baseState = initialState; + var queue = { + pending: null, + interleaved: null, + lanes: NoLanes, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + hook.queue = queue; + var dispatch = queue.dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); + return [hook.memoizedState, dispatch]; + } + function updateState(initialState) { + return updateReducer(basicStateReducer); + } + function rerenderState(initialState) { + return rerenderReducer(basicStateReducer); + } + function pushEffect(tag, create, destroy, deps) { + var effect = { + tag: tag, + create: create, + destroy: destroy, + deps: deps, + // Circular + next: null + }; + var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; + if (componentUpdateQueue === null) { + componentUpdateQueue = createFunctionComponentUpdateQueue(); + currentlyRenderingFiber$1.updateQueue = componentUpdateQueue; + componentUpdateQueue.lastEffect = effect.next = effect; + } else { + var lastEffect = componentUpdateQueue.lastEffect; + if (lastEffect === null) { + componentUpdateQueue.lastEffect = effect.next = effect; + } else { + var firstEffect = lastEffect.next; + lastEffect.next = effect; + effect.next = firstEffect; + componentUpdateQueue.lastEffect = effect; + } + } + return effect; + } + function mountRef(initialValue) { + var hook = mountWorkInProgressHook(); + { + var _ref2 = { + current: initialValue + }; + hook.memoizedState = _ref2; + return _ref2; + } + } + function updateRef(initialValue) { + var hook = updateWorkInProgressHook(); + return hook.memoizedState; + } + function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + currentlyRenderingFiber$1.flags |= fiberFlags; + hook.memoizedState = pushEffect(HasEffect | hookFlags, create, undefined, nextDeps); + } + function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var destroy = undefined; + if (currentHook !== null) { + var prevEffect = currentHook.memoizedState; + destroy = prevEffect.destroy; + if (nextDeps !== null) { + var prevDeps = prevEffect.deps; + if (areHookInputsEqual(nextDeps, prevDeps)) { + hook.memoizedState = pushEffect(hookFlags, create, destroy, nextDeps); + return; + } + } + } + currentlyRenderingFiber$1.flags |= fiberFlags; + hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps); + } + function mountEffect(create, deps) { + { + return mountEffectImpl(Passive | PassiveStatic, Passive$1, create, deps); + } + } + function updateEffect(create, deps) { + return updateEffectImpl(Passive, Passive$1, create, deps); + } + function mountInsertionEffect(create, deps) { + return mountEffectImpl(Update, Insertion, create, deps); + } + function updateInsertionEffect(create, deps) { + return updateEffectImpl(Update, Insertion, create, deps); + } + function mountLayoutEffect(create, deps) { + var fiberFlags = Update; + return mountEffectImpl(fiberFlags, Layout, create, deps); + } + function updateLayoutEffect(create, deps) { + return updateEffectImpl(Update, Layout, create, deps); + } + function imperativeHandleEffect(create, ref) { + if (typeof ref === "function") { + var refCallback = ref; + var _inst = create(); + refCallback(_inst); + return function () { + refCallback(null); + }; + } else if (ref !== null && ref !== undefined) { + var refObject = ref; + { + if (!refObject.hasOwnProperty("current")) { + error("Expected useImperativeHandle() first argument to either be a " + "ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(refObject).join(", ") + "}"); + } + } + var _inst2 = create(); + refObject.current = _inst2; + return function () { + refObject.current = null; + }; + } + } + function mountImperativeHandle(ref, create, deps) { + { + if (typeof create !== "function") { + error("Expected useImperativeHandle() second argument to be a function " + "that creates a handle. Instead received: %s.", create !== null ? typeof create : "null"); + } + } // TODO: If deps are provided, should we skip comparing the ref itself? + + var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; + var fiberFlags = Update; + return mountEffectImpl(fiberFlags, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps); + } + function updateImperativeHandle(ref, create, deps) { + { + if (typeof create !== "function") { + error("Expected useImperativeHandle() second argument to be a function " + "that creates a handle. Instead received: %s.", create !== null ? typeof create : "null"); + } + } // TODO: If deps are provided, should we skip comparing the ref itself? + + var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; + return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps); + } + function mountDebugValue(value, formatterFn) { + // This hook is normally a no-op. + // The react-debug-hooks package injects its own implementation + // so that e.g. DevTools can display custom hook values. + } + var updateDebugValue = mountDebugValue; + function mountCallback(callback, deps) { + var hook = mountWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + hook.memoizedState = [callback, nextDeps]; + return callback; + } + function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var prevState = hook.memoizedState; + if (prevState !== null) { + if (nextDeps !== null) { + var prevDeps = prevState[1]; + if (areHookInputsEqual(nextDeps, prevDeps)) { + return prevState[0]; + } + } + } + hook.memoizedState = [callback, nextDeps]; + return callback; + } + function mountMemo(nextCreate, deps) { + var hook = mountWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var nextValue = nextCreate(); + hook.memoizedState = [nextValue, nextDeps]; + return nextValue; + } + function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var prevState = hook.memoizedState; + if (prevState !== null) { + // Assume these are defined. If they're not, areHookInputsEqual will warn. + if (nextDeps !== null) { + var prevDeps = prevState[1]; + if (areHookInputsEqual(nextDeps, prevDeps)) { + return prevState[0]; + } + } + } + var nextValue = nextCreate(); + hook.memoizedState = [nextValue, nextDeps]; + return nextValue; + } + function mountDeferredValue(value) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = value; + return value; + } + function updateDeferredValue(value) { + var hook = updateWorkInProgressHook(); + var resolvedCurrentHook = currentHook; + var prevValue = resolvedCurrentHook.memoizedState; + return updateDeferredValueImpl(hook, prevValue, value); + } + function rerenderDeferredValue(value) { + var hook = updateWorkInProgressHook(); + if (currentHook === null) { + // This is a rerender during a mount. + hook.memoizedState = value; + return value; + } else { + // This is a rerender during an update. + var prevValue = currentHook.memoizedState; + return updateDeferredValueImpl(hook, prevValue, value); + } + } + function updateDeferredValueImpl(hook, prevValue, value) { + var shouldDeferValue = !includesOnlyNonUrgentLanes(renderLanes); + if (shouldDeferValue) { + // This is an urgent update. If the value has changed, keep using the + // previous value and spawn a deferred render to update it later. + if (!objectIs(value, prevValue)) { + // Schedule a deferred render + var deferredLane = claimNextTransitionLane(); + currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, deferredLane); + markSkippedUpdateLanes(deferredLane); // Set this to true to indicate that the rendered value is inconsistent + // from the latest value. The name "baseState" doesn't really match how we + // use it because we're reusing a state hook field instead of creating a + // new one. + + hook.baseState = true; + } // Reuse the previous value + + return prevValue; + } else { + // This is not an urgent update, so we can use the latest value regardless + // of what it is. No need to defer it. + // However, if we're currently inside a spawned render, then we need to mark + // this as an update to prevent the fiber from bailing out. + // + // `baseState` is true when the current value is different from the rendered + // value. The name doesn't really match how we use it because we're reusing + // a state hook field instead of creating a new one. + if (hook.baseState) { + // Flip this back to false. + hook.baseState = false; + markWorkInProgressReceivedUpdate(); + } + hook.memoizedState = value; + return value; + } + } + function startTransition(setPending, callback, options) { + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(higherEventPriority(previousPriority, ContinuousEventPriority)); + setPending(true); + var prevTransition = ReactCurrentBatchConfig$1.transition; + ReactCurrentBatchConfig$1.transition = {}; + var currentTransition = ReactCurrentBatchConfig$1.transition; + { + ReactCurrentBatchConfig$1.transition._updatedFibers = new Set(); + } + try { + setPending(false); + callback(); + } finally { + setCurrentUpdatePriority(previousPriority); + ReactCurrentBatchConfig$1.transition = prevTransition; + { + if (prevTransition === null && currentTransition._updatedFibers) { + var updatedFibersCount = currentTransition._updatedFibers.size; + if (updatedFibersCount > 10) { + warn("Detected a large number of updates inside startTransition. " + "If this is due to a subscription please re-write it to use React provided hooks. " + "Otherwise concurrent mode guarantees are off the table."); + } + currentTransition._updatedFibers.clear(); + } + } + } + } + function mountTransition() { + var _mountState = mountState(false), + isPending = _mountState[0], + setPending = _mountState[1]; // The `start` method never changes. + + var start = startTransition.bind(null, setPending); + var hook = mountWorkInProgressHook(); + hook.memoizedState = start; + return [isPending, start]; + } + function updateTransition() { + var _updateState = updateState(), + isPending = _updateState[0]; + var hook = updateWorkInProgressHook(); + var start = hook.memoizedState; + return [isPending, start]; + } + function rerenderTransition() { + var _rerenderState = rerenderState(), + isPending = _rerenderState[0]; + var hook = updateWorkInProgressHook(); + var start = hook.memoizedState; + return [isPending, start]; + } + var isUpdatingOpaqueValueInRenderPhase = false; + function getIsUpdatingOpaqueValueInRenderPhaseInDEV() { + { + return isUpdatingOpaqueValueInRenderPhase; + } + } + function mountId() { + var hook = mountWorkInProgressHook(); + var root = getWorkInProgressRoot(); // TODO: In Fizz, id generation is specific to each server config. Maybe we + // should do this in Fiber, too? Deferring this decision for now because + // there's no other place to store the prefix except for an internal field on + // the public createRoot object, which the fiber tree does not currently have + // a reference to. + + var identifierPrefix = root.identifierPrefix; + var id; + { + // Use a lowercase r prefix for client-generated ids. + var globalClientId = globalClientIdCounter++; + id = ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; + } + hook.memoizedState = id; + return id; + } + function updateId() { + var hook = updateWorkInProgressHook(); + var id = hook.memoizedState; + return id; + } + function dispatchReducerAction(fiber, queue, action) { + { + if (typeof arguments[3] === "function") { + error("State updates from the useState() and useReducer() Hooks don't support the " + "second callback argument. To execute a side effect after " + "rendering, declare it in the component body with useEffect()."); + } + } + var lane = requestUpdateLane(fiber); + var update = { + lane: lane, + action: action, + hasEagerState: false, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + enqueueRenderPhaseUpdate(queue, update); + } else { + var root = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (root !== null) { + var eventTime = requestEventTime(); + scheduleUpdateOnFiber(root, fiber, lane, eventTime); + entangleTransitionUpdate(root, queue, lane); + } + } + } + function dispatchSetState(fiber, queue, action) { + { + if (typeof arguments[3] === "function") { + error("State updates from the useState() and useReducer() Hooks don't support the " + "second callback argument. To execute a side effect after " + "rendering, declare it in the component body with useEffect()."); + } + } + var lane = requestUpdateLane(fiber); + var update = { + lane: lane, + action: action, + hasEagerState: false, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + enqueueRenderPhaseUpdate(queue, update); + } else { + var alternate = fiber.alternate; + if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) { + // The queue is currently empty, which means we can eagerly compute the + // next state before entering the render phase. If the new state is the + // same as the current state, we may be able to bail out entirely. + var lastRenderedReducer = queue.lastRenderedReducer; + if (lastRenderedReducer !== null) { + var prevDispatcher; + { + prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + } + try { + var currentState = queue.lastRenderedState; + var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute + // it, on the update object. If the reducer hasn't changed by the + // time we enter the render phase, then the eager state can be used + // without calling the reducer again. + + update.hasEagerState = true; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) { + // Fast path. We can bail out without scheduling React to re-render. + // It's still possible that we'll need to rebase this update later, + // if the component re-renders for a different reason and by that + // time the reducer has changed. + // TODO: Do we still need to entangle transitions in this case? + enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane); + return; + } + } catch (error) { + // Suppress the error. It will throw again in the render phase. + } finally { + { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + } + } + } + var root = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (root !== null) { + var eventTime = requestEventTime(); + scheduleUpdateOnFiber(root, fiber, lane, eventTime); + entangleTransitionUpdate(root, queue, lane); + } + } + } + function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1; + } + function enqueueRenderPhaseUpdate(queue, update) { + // This is a render phase update. Stash it in a lazily-created map of + // queue -> linked list of updates. After this render pass, we'll restart + // and apply the stashed updates on top of the work-in-progress hook. + didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true; + var pending = queue.pending; + if (pending === null) { + // This is the first update. Create a circular list. + update.next = update; + } else { + update.next = pending.next; + pending.next = update; + } + queue.pending = update; + } // TODO: Move to ReactFiberConcurrentUpdates? + + function entangleTransitionUpdate(root, queue, lane) { + if (isTransitionLane(lane)) { + var queueLanes = queue.lanes; // If any entangled lanes are no longer pending on the root, then they + // must have finished. We can remove them from the shared queue, which + // represents a superset of the actually pending lanes. In some cases we + // may entangle more than we need to, but that's OK. In fact it's worse if + // we *don't* entangle when we should. + + queueLanes = intersectLanes(queueLanes, root.pendingLanes); // Entangle the new transition lane with the other transition lanes. + + var newQueueLanes = mergeLanes(queueLanes, lane); + queue.lanes = newQueueLanes; // Even if queue.lanes already include lane, we don't know for certain if + // the lane finished since the last time we entangled it. So we need to + // entangle it again, just to be sure. + + markRootEntangled(root, newQueueLanes); + } + } + var ContextOnlyDispatcher = { + readContext: _readContext, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useMutableSource: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + unstable_isNewReconciler: enableNewReconciler + }; + var HooksDispatcherOnMountInDEV = null; + var HooksDispatcherOnMountWithHookTypesInDEV = null; + var HooksDispatcherOnUpdateInDEV = null; + var HooksDispatcherOnRerenderInDEV = null; + var InvalidNestedHooksDispatcherOnMountInDEV = null; + var InvalidNestedHooksDispatcherOnUpdateInDEV = null; + var InvalidNestedHooksDispatcherOnRerenderInDEV = null; + { + var warnInvalidContextAccess = function warnInvalidContextAccess() { + 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()."); + }; + var warnInvalidHookAccess = function warnInvalidHookAccess() { + error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. " + "You can only call Hooks at the top level of your React function. " + "For more information, see " + "https://react.dev/link/rules-of-hooks"); + }; + HooksDispatcherOnMountInDEV = { + readContext: function readContext(context) { + return _readContext(context); + }, + useCallback: function useCallback(callback, deps) { + currentHookNameInDev = "useCallback"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountCallback(callback, deps); + }, + useContext: function useContext(context) { + currentHookNameInDev = "useContext"; + mountHookTypesDev(); + return _readContext(context); + }, + useEffect: function useEffect(create, deps) { + currentHookNameInDev = "useEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountEffect(create, deps); + }, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + currentHookNameInDev = "useInsertionEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountInsertionEffect(create, deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + currentHookNameInDev = "useLayoutEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountLayoutEffect(create, deps); + }, + useMemo: function useMemo(create, deps) { + currentHookNameInDev = "useMemo"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function useReducer(reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function useRef(initialValue) { + currentHookNameInDev = "useRef"; + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function useState(initialState) { + currentHookNameInDev = "useState"; + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function useDebugValue(value, formatterFn) { + currentHookNameInDev = "useDebugValue"; + mountHookTypesDev(); + return mountDebugValue(); + }, + useDeferredValue: function useDeferredValue(value) { + currentHookNameInDev = "useDeferredValue"; + mountHookTypesDev(); + return mountDeferredValue(value); + }, + useTransition: function useTransition() { + currentHookNameInDev = "useTransition"; + mountHookTypesDev(); + return mountTransition(); + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + currentHookNameInDev = "useMutableSource"; + mountHookTypesDev(); + return mountMutableSource(); + }, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + mountHookTypesDev(); + return mountSyncExternalStore(subscribe, getSnapshot); + }, + useId: function useId() { + currentHookNameInDev = "useId"; + mountHookTypesDev(); + return mountId(); + }, + unstable_isNewReconciler: enableNewReconciler + }; + HooksDispatcherOnMountWithHookTypesInDEV = { + readContext: function readContext(context) { + return _readContext(context); + }, + useCallback: function useCallback(callback, deps) { + currentHookNameInDev = "useCallback"; + updateHookTypesDev(); + return mountCallback(callback, deps); + }, + useContext: function useContext(context) { + currentHookNameInDev = "useContext"; + updateHookTypesDev(); + return _readContext(context); + }, + useEffect: function useEffect(create, deps) { + currentHookNameInDev = "useEffect"; + updateHookTypesDev(); + return mountEffect(create, deps); + }, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + updateHookTypesDev(); + return mountImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + currentHookNameInDev = "useInsertionEffect"; + updateHookTypesDev(); + return mountInsertionEffect(create, deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + currentHookNameInDev = "useLayoutEffect"; + updateHookTypesDev(); + return mountLayoutEffect(create, deps); + }, + useMemo: function useMemo(create, deps) { + currentHookNameInDev = "useMemo"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function useReducer(reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function useRef(initialValue) { + currentHookNameInDev = "useRef"; + updateHookTypesDev(); + return mountRef(initialValue); + }, + useState: function useState(initialState) { + currentHookNameInDev = "useState"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function useDebugValue(value, formatterFn) { + currentHookNameInDev = "useDebugValue"; + updateHookTypesDev(); + return mountDebugValue(); + }, + useDeferredValue: function useDeferredValue(value) { + currentHookNameInDev = "useDeferredValue"; + updateHookTypesDev(); + return mountDeferredValue(value); + }, + useTransition: function useTransition() { + currentHookNameInDev = "useTransition"; + updateHookTypesDev(); + return mountTransition(); + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + currentHookNameInDev = "useMutableSource"; + updateHookTypesDev(); + return mountMutableSource(); + }, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + updateHookTypesDev(); + return mountSyncExternalStore(subscribe, getSnapshot); + }, + useId: function useId() { + currentHookNameInDev = "useId"; + updateHookTypesDev(); + return mountId(); + }, + unstable_isNewReconciler: enableNewReconciler + }; + HooksDispatcherOnUpdateInDEV = { + readContext: function readContext(context) { + return _readContext(context); + }, + useCallback: function useCallback(callback, deps) { + currentHookNameInDev = "useCallback"; + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function useContext(context) { + currentHookNameInDev = "useContext"; + updateHookTypesDev(); + return _readContext(context); + }, + useEffect: function useEffect(create, deps) { + currentHookNameInDev = "useEffect"; + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + currentHookNameInDev = "useInsertionEffect"; + updateHookTypesDev(); + return updateInsertionEffect(create, deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + currentHookNameInDev = "useLayoutEffect"; + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function useMemo(create, deps) { + currentHookNameInDev = "useMemo"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function useReducer(reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function useRef(initialValue) { + currentHookNameInDev = "useRef"; + updateHookTypesDev(); + return updateRef(); + }, + useState: function useState(initialState) { + currentHookNameInDev = "useState"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function useDebugValue(value, formatterFn) { + currentHookNameInDev = "useDebugValue"; + updateHookTypesDev(); + return updateDebugValue(); + }, + useDeferredValue: function useDeferredValue(value) { + currentHookNameInDev = "useDeferredValue"; + updateHookTypesDev(); + return updateDeferredValue(value); + }, + useTransition: function useTransition() { + currentHookNameInDev = "useTransition"; + updateHookTypesDev(); + return updateTransition(); + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + currentHookNameInDev = "useMutableSource"; + updateHookTypesDev(); + return updateMutableSource(); + }, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + updateHookTypesDev(); + return updateSyncExternalStore(subscribe, getSnapshot); + }, + useId: function useId() { + currentHookNameInDev = "useId"; + updateHookTypesDev(); + return updateId(); + }, + unstable_isNewReconciler: enableNewReconciler + }; + HooksDispatcherOnRerenderInDEV = { + readContext: function readContext(context) { + return _readContext(context); + }, + useCallback: function useCallback(callback, deps) { + currentHookNameInDev = "useCallback"; + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function useContext(context) { + currentHookNameInDev = "useContext"; + updateHookTypesDev(); + return _readContext(context); + }, + useEffect: function useEffect(create, deps) { + currentHookNameInDev = "useEffect"; + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + currentHookNameInDev = "useInsertionEffect"; + updateHookTypesDev(); + return updateInsertionEffect(create, deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + currentHookNameInDev = "useLayoutEffect"; + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function useMemo(create, deps) { + currentHookNameInDev = "useMemo"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV; + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function useReducer(reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV; + try { + return rerenderReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function useRef(initialValue) { + currentHookNameInDev = "useRef"; + updateHookTypesDev(); + return updateRef(); + }, + useState: function useState(initialState) { + currentHookNameInDev = "useState"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV; + try { + return rerenderState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function useDebugValue(value, formatterFn) { + currentHookNameInDev = "useDebugValue"; + updateHookTypesDev(); + return updateDebugValue(); + }, + useDeferredValue: function useDeferredValue(value) { + currentHookNameInDev = "useDeferredValue"; + updateHookTypesDev(); + return rerenderDeferredValue(value); + }, + useTransition: function useTransition() { + currentHookNameInDev = "useTransition"; + updateHookTypesDev(); + return rerenderTransition(); + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + currentHookNameInDev = "useMutableSource"; + updateHookTypesDev(); + return updateMutableSource(); + }, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + updateHookTypesDev(); + return updateSyncExternalStore(subscribe, getSnapshot); + }, + useId: function useId() { + currentHookNameInDev = "useId"; + updateHookTypesDev(); + return updateId(); + }, + unstable_isNewReconciler: enableNewReconciler + }; + InvalidNestedHooksDispatcherOnMountInDEV = { + readContext: function readContext(context) { + warnInvalidContextAccess(); + return _readContext(context); + }, + useCallback: function useCallback(callback, deps) { + currentHookNameInDev = "useCallback"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountCallback(callback, deps); + }, + useContext: function useContext(context) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return _readContext(context); + }, + useEffect: function useEffect(create, deps) { + currentHookNameInDev = "useEffect"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountEffect(create, deps); + }, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + currentHookNameInDev = "useInsertionEffect"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountInsertionEffect(create, deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + currentHookNameInDev = "useLayoutEffect"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountLayoutEffect(create, deps); + }, + useMemo: function useMemo(create, deps) { + currentHookNameInDev = "useMemo"; + warnInvalidHookAccess(); + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function useReducer(reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + warnInvalidHookAccess(); + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function useRef(initialValue) { + currentHookNameInDev = "useRef"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function useState(initialState) { + currentHookNameInDev = "useState"; + warnInvalidHookAccess(); + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function useDebugValue(value, formatterFn) { + currentHookNameInDev = "useDebugValue"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountDebugValue(); + }, + useDeferredValue: function useDeferredValue(value) { + currentHookNameInDev = "useDeferredValue"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountDeferredValue(value); + }, + useTransition: function useTransition() { + currentHookNameInDev = "useTransition"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountTransition(); + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + currentHookNameInDev = "useMutableSource"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountMutableSource(); + }, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountSyncExternalStore(subscribe, getSnapshot); + }, + useId: function useId() { + currentHookNameInDev = "useId"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountId(); + }, + unstable_isNewReconciler: enableNewReconciler + }; + InvalidNestedHooksDispatcherOnUpdateInDEV = { + readContext: function readContext(context) { + warnInvalidContextAccess(); + return _readContext(context); + }, + useCallback: function useCallback(callback, deps) { + currentHookNameInDev = "useCallback"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function useContext(context) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return _readContext(context); + }, + useEffect: function useEffect(create, deps) { + currentHookNameInDev = "useEffect"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + currentHookNameInDev = "useInsertionEffect"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateInsertionEffect(create, deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + currentHookNameInDev = "useLayoutEffect"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function useMemo(create, deps) { + currentHookNameInDev = "useMemo"; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function useReducer(reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function useRef(initialValue) { + currentHookNameInDev = "useRef"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateRef(); + }, + useState: function useState(initialState) { + currentHookNameInDev = "useState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function useDebugValue(value, formatterFn) { + currentHookNameInDev = "useDebugValue"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateDebugValue(); + }, + useDeferredValue: function useDeferredValue(value) { + currentHookNameInDev = "useDeferredValue"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateDeferredValue(value); + }, + useTransition: function useTransition() { + currentHookNameInDev = "useTransition"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateTransition(); + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + currentHookNameInDev = "useMutableSource"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateMutableSource(); + }, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateSyncExternalStore(subscribe, getSnapshot); + }, + useId: function useId() { + currentHookNameInDev = "useId"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateId(); + }, + unstable_isNewReconciler: enableNewReconciler + }; + InvalidNestedHooksDispatcherOnRerenderInDEV = { + readContext: function readContext(context) { + warnInvalidContextAccess(); + return _readContext(context); + }, + useCallback: function useCallback(callback, deps) { + currentHookNameInDev = "useCallback"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function useContext(context) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return _readContext(context); + }, + useEffect: function useEffect(create, deps) { + currentHookNameInDev = "useEffect"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + currentHookNameInDev = "useInsertionEffect"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateInsertionEffect(create, deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + currentHookNameInDev = "useLayoutEffect"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function useMemo(create, deps) { + currentHookNameInDev = "useMemo"; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function useReducer(reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return rerenderReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function useRef(initialValue) { + currentHookNameInDev = "useRef"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateRef(); + }, + useState: function useState(initialState) { + currentHookNameInDev = "useState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return rerenderState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function useDebugValue(value, formatterFn) { + currentHookNameInDev = "useDebugValue"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateDebugValue(); + }, + useDeferredValue: function useDeferredValue(value) { + currentHookNameInDev = "useDeferredValue"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderDeferredValue(value); + }, + useTransition: function useTransition() { + currentHookNameInDev = "useTransition"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderTransition(); + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + currentHookNameInDev = "useMutableSource"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateMutableSource(); + }, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateSyncExternalStore(subscribe, getSnapshot); + }, + useId: function useId() { + currentHookNameInDev = "useId"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateId(); + }, + unstable_isNewReconciler: enableNewReconciler + }; + } + var now$1 = Scheduler.unstable_now; + var commitTime = 0; + var layoutEffectStartTime = -1; + var profilerStartTime = -1; + var passiveEffectStartTime = -1; + /** + * Tracks whether the current update was a nested/cascading update (scheduled from a layout effect). + * + * The overall sequence is: + * 1. render + * 2. commit (and call `onRender`, `onCommit`) + * 3. check for nested updates + * 4. flush passive effects (and call `onPostCommit`) + * + * Nested updates are identified in step 3 above, + * but step 4 still applies to the work that was just committed. + * We use two flags to track nested updates then: + * one tracks whether the upcoming update is a nested update, + * and the other tracks whether the current update was a nested update. + * The first value gets synced to the second at the start of the render phase. + */ + + var currentUpdateIsNested = false; + var nestedUpdateScheduled = false; + function isCurrentUpdateNested() { + return currentUpdateIsNested; + } + function markNestedUpdateScheduled() { + { + nestedUpdateScheduled = true; + } + } + function resetNestedUpdateFlag() { + { + currentUpdateIsNested = false; + nestedUpdateScheduled = false; + } + } + function syncNestedUpdateFlag() { + { + currentUpdateIsNested = nestedUpdateScheduled; + nestedUpdateScheduled = false; + } + } + function getCommitTime() { + return commitTime; + } + function recordCommitTime() { + commitTime = now$1(); + } + function startProfilerTimer(fiber) { + profilerStartTime = now$1(); + if (fiber.actualStartTime < 0) { + fiber.actualStartTime = now$1(); + } + } + function stopProfilerTimerIfRunning(fiber) { + profilerStartTime = -1; + } + function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (profilerStartTime >= 0) { + var elapsedTime = now$1() - profilerStartTime; + fiber.actualDuration += elapsedTime; + if (overrideBaseTime) { + fiber.selfBaseDuration = elapsedTime; + } + profilerStartTime = -1; + } + } + function recordLayoutEffectDuration(fiber) { + if (layoutEffectStartTime >= 0) { + var elapsedTime = now$1() - layoutEffectStartTime; + layoutEffectStartTime = -1; // Store duration on the next nearest Profiler ancestor + // Or the root (for the DevTools Profiler to read) + + var parentFiber = fiber.return; + while (parentFiber !== null) { + switch (parentFiber.tag) { + case HostRoot: + var root = parentFiber.stateNode; + root.effectDuration += elapsedTime; + return; + case Profiler: + var parentStateNode = parentFiber.stateNode; + parentStateNode.effectDuration += elapsedTime; + return; + } + parentFiber = parentFiber.return; + } + } + } + function recordPassiveEffectDuration(fiber) { + if (passiveEffectStartTime >= 0) { + var elapsedTime = now$1() - passiveEffectStartTime; + passiveEffectStartTime = -1; // Store duration on the next nearest Profiler ancestor + // Or the root (for the DevTools Profiler to read) + + var parentFiber = fiber.return; + while (parentFiber !== null) { + switch (parentFiber.tag) { + case HostRoot: + var root = parentFiber.stateNode; + if (root !== null) { + root.passiveEffectDuration += elapsedTime; + } + return; + case Profiler: + var parentStateNode = parentFiber.stateNode; + if (parentStateNode !== null) { + // Detached fibers have their state node cleared out. + // In this case, the return pointer is also cleared out, + // so we won't be able to report the time spent in this Profiler's subtree. + parentStateNode.passiveEffectDuration += elapsedTime; + } + return; + } + parentFiber = parentFiber.return; + } + } + } + function startLayoutEffectTimer() { + layoutEffectStartTime = now$1(); + } + function startPassiveEffectTimer() { + passiveEffectStartTime = now$1(); + } + function transferActualDuration(fiber) { + // Transfer time spent rendering these children so we don't lose it + // after we rerender. This is used as a helper in special cases + // where we should count the work of multiple passes. + var child = fiber.child; + while (child) { + fiber.actualDuration += child.actualDuration; + child = child.sibling; + } + } + function createCapturedValueAtFiber(value, source) { + // If the value is an error, call this function immediately after it is thrown + // so the stack is accurate. + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source), + digest: null + }; + } + function createCapturedValue(value, digest, stack) { + return { + value: value, + source: null, + stack: stack != null ? stack : null, + digest: digest != null ? digest : null + }; + } + if (typeof ReactNativePrivateInterface.ReactFiberErrorDialog.showErrorDialog !== "function") { + throw new Error("Expected ReactFiberErrorDialog.showErrorDialog to be a function."); + } + function showErrorDialog(boundary, errorInfo) { + var capturedError = { + componentStack: errorInfo.stack !== null ? errorInfo.stack : "", + error: errorInfo.value, + errorBoundary: boundary !== null && boundary.tag === ClassComponent ? boundary.stateNode : null + }; + return ReactNativePrivateInterface.ReactFiberErrorDialog.showErrorDialog(capturedError); + } + function logCapturedError(boundary, errorInfo) { + try { + var logError = showErrorDialog(boundary, errorInfo); // Allow injected showErrorDialog() to prevent default console.error logging. + // This enables renderers like ReactNative to better manage redbox behavior. + + if (logError === false) { + return; + } + var error = errorInfo.value; + if (true) { + var source = errorInfo.source; + var stack = errorInfo.stack; + var componentStack = stack !== null ? stack : ""; // Browsers support silencing uncaught errors by calling + // `preventDefault()` in window `error` handler. + // We record this information as an expando on the error. + + if (error != null && error._suppressLogging) { + if (boundary.tag === ClassComponent) { + // The error is recoverable and was silenced. + // Ignore it and don't print the stack addendum. + // This is handy for testing error boundaries without noise. + return; + } // The error is fatal. Since the silencing might have + // been accidental, we'll surface it anyway. + // However, the browser would have silenced the original error + // so we'll print it first, and then print the stack addendum. + + console["error"](error); // Don't transform to our wrapper + // For a more detailed description of this block, see: + // https://github.com/facebook/react/pull/13384 + } + var componentName = source ? getComponentNameFromFiber(source) : null; + var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:"; + var errorBoundaryMessage; + if (boundary.tag === HostRoot) { + errorBoundaryMessage = "Consider adding an error boundary to your tree to customize error handling behavior.\n" + "Visit https://react.dev/link/error-boundaries to learn more about error boundaries."; + } else { + var errorBoundaryName = getComponentNameFromFiber(boundary) || "Anonymous"; + errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + "."); + } + var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage); // In development, we provide our own message with just the component stack. + // We don't include the original error message and JS stack because the browser + // has already printed it. Even if the application swallows the error, it is still + // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils. + + console["error"](combinedMessage); // Don't transform to our wrapper + } else { + // In production, we print the error directly. + // This will include the message, the JS stack, and anything the browser wants to show. + // We pass the error object instead of custom message so that the browser displays the error natively. + console["error"](error); // Don't transform to our wrapper + } + } catch (e) { + // This method must not throw, or React internal state will get messed up. + // If console.error is overridden, or logCapturedError() shows a dialog that throws, + // we want to report this error outside of the normal stack as a last resort. + // https://github.com/facebook/react/issues/13188 + setTimeout(function () { + throw e; + }); + } + } + var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map; + function createRootErrorUpdate(fiber, errorInfo, lane) { + var update = createUpdate(NoTimestamp, lane); // Unmount the root by rendering null. + + update.tag = CaptureUpdate; // Caution: React DevTools currently depends on this property + // being called "element". + + update.payload = { + element: null + }; + var error = errorInfo.value; + update.callback = function () { + onUncaughtError(error); + logCapturedError(fiber, errorInfo); + }; + return update; + } + function createClassErrorUpdate(fiber, errorInfo, lane) { + var update = createUpdate(NoTimestamp, lane); + update.tag = CaptureUpdate; + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if (typeof getDerivedStateFromError === "function") { + var error$1 = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error$1); + }; + update.callback = function () { + { + markFailedErrorBoundaryForHotReloading(fiber); + } + logCapturedError(fiber, errorInfo); + }; + } + var inst = fiber.stateNode; + if (inst !== null && typeof inst.componentDidCatch === "function") { + update.callback = function callback() { + { + markFailedErrorBoundaryForHotReloading(fiber); + } + logCapturedError(fiber, errorInfo); + if (typeof getDerivedStateFromError !== "function") { + // To preserve the preexisting retry behavior of error boundaries, + // we keep track of which ones already failed during this batch. + // This gets reset before we yield back to the browser. + // TODO: Warn in strict mode if getDerivedStateFromError is + // not defined. + markLegacyErrorBoundaryAsFailed(this); + } + var error$1 = errorInfo.value; + var stack = errorInfo.stack; + this.componentDidCatch(error$1, { + componentStack: stack !== null ? stack : "" + }); + { + if (typeof getDerivedStateFromError !== "function") { + // If componentDidCatch is the only error boundary method defined, + // then it needs to call setState to recover from errors. + // If no state update is scheduled then the boundary will swallow the error. + if (!includesSomeLane(fiber.lanes, SyncLane)) { + error("%s: Error boundaries should implement getDerivedStateFromError(). " + "In that method, return a state update to display an error message or fallback UI.", getComponentNameFromFiber(fiber) || "Unknown"); + } + } + } + }; + } + return update; + } + function attachPingListener(root, wakeable, lanes) { + // Attach a ping listener + // + // The data might resolve before we have a chance to commit the fallback. Or, + // in the case of a refresh, we'll never commit a fallback. So we need to + // attach a listener now. When it resolves ("pings"), we can decide whether to + // try rendering the tree again. + // + // Only attach a listener if one does not already exist for the lanes + // we're currently rendering (which acts like a "thread ID" here). + // + // We only need to do this in concurrent mode. Legacy Suspense always + // commits fallbacks synchronously, so there are no pings. + var pingCache = root.pingCache; + var threadIDs; + if (pingCache === null) { + pingCache = root.pingCache = new PossiblyWeakMap$1(); + threadIDs = new Set(); + pingCache.set(wakeable, threadIDs); + } else { + threadIDs = pingCache.get(wakeable); + if (threadIDs === undefined) { + threadIDs = new Set(); + pingCache.set(wakeable, threadIDs); + } + } + if (!threadIDs.has(lanes)) { + // Memoize using the thread ID to prevent redundant listeners. + threadIDs.add(lanes); + var ping = pingSuspendedRoot.bind(null, root, wakeable, lanes); + { + if (isDevToolsPresent) { + // If we have pending work still, restore the original updaters + restorePendingUpdaters(root, lanes); + } + } + wakeable.then(ping, ping); + } + } + function attachRetryListener(suspenseBoundary, root, wakeable, lanes) { + // Retry listener + // + // If the fallback does commit, we need to attach a different type of + // listener. This one schedules an update on the Suspense boundary to turn + // the fallback state off. + // + // Stash the wakeable on the boundary fiber so we can access it in the + // commit phase. + // + // When the wakeable resolves, we'll attempt to render the boundary + // again ("retry"). + var wakeables = suspenseBoundary.updateQueue; + if (wakeables === null) { + var updateQueue = new Set(); + updateQueue.add(wakeable); + suspenseBoundary.updateQueue = updateQueue; + } else { + wakeables.add(wakeable); + } + } + function resetSuspendedComponent(sourceFiber, rootRenderLanes) { + // A legacy mode Suspense quirk, only relevant to hook components. + + var tag = sourceFiber.tag; + if ((sourceFiber.mode & ConcurrentMode) === NoMode && (tag === FunctionComponent || tag === ForwardRef || tag === SimpleMemoComponent)) { + var currentSource = sourceFiber.alternate; + if (currentSource) { + sourceFiber.updateQueue = currentSource.updateQueue; + sourceFiber.memoizedState = currentSource.memoizedState; + sourceFiber.lanes = currentSource.lanes; + } else { + sourceFiber.updateQueue = null; + sourceFiber.memoizedState = null; + } + } + } + function getNearestSuspenseBoundaryToCapture(returnFiber) { + var node = returnFiber; + do { + if (node.tag === SuspenseComponent && shouldCaptureSuspense(node)) { + return node; + } // This boundary already captured during this render. Continue to the next + // boundary. + + node = node.return; + } while (node !== null); + return null; + } + function markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes) { + // This marks a Suspense boundary so that when we're unwinding the stack, + // it captures the suspended "exception" and does a second (fallback) pass. + if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) { + // Legacy Mode Suspense + // + // If the boundary is in legacy mode, we should *not* + // suspend the commit. Pretend as if the suspended component rendered + // null and keep rendering. When the Suspense boundary completes, + // we'll do a second pass to render the fallback. + if (suspenseBoundary === returnFiber) { + // Special case where we suspended while reconciling the children of + // a Suspense boundary's inner Offscreen wrapper fiber. This happens + // when a React.lazy component is a direct child of a + // Suspense boundary. + // + // Suspense boundaries are implemented as multiple fibers, but they + // are a single conceptual unit. The legacy mode behavior where we + // pretend the suspended fiber committed as `null` won't work, + // because in this case the "suspended" fiber is the inner + // Offscreen wrapper. + // + // Because the contents of the boundary haven't started rendering + // yet (i.e. nothing in the tree has partially rendered) we can + // switch to the regular, concurrent mode behavior: mark the + // boundary with ShouldCapture and enter the unwind phase. + suspenseBoundary.flags |= ShouldCapture; + } else { + suspenseBoundary.flags |= DidCapture; + sourceFiber.flags |= ForceUpdateForLegacySuspense; // We're going to commit this fiber even though it didn't complete. + // But we shouldn't call any lifecycle methods or callbacks. Remove + // all lifecycle effect tags. + + sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete); + if (sourceFiber.tag === ClassComponent) { + var currentSourceFiber = sourceFiber.alternate; + if (currentSourceFiber === null) { + // This is a new mount. Change the tag so it's not mistaken for a + // completed class component. For example, we should not call + // componentWillUnmount if it is deleted. + sourceFiber.tag = IncompleteClassComponent; + } else { + // When we try rendering again, we should not reuse the current fiber, + // since it's known to be in an inconsistent state. Use a force update to + // prevent a bail out. + var update = createUpdate(NoTimestamp, SyncLane); + update.tag = ForceUpdate; + enqueueUpdate(sourceFiber, update, SyncLane); + } + } // The source fiber did not complete. Mark it with Sync priority to + // indicate that it still has pending work. + + sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane); + } + return suspenseBoundary; + } // Confirmed that the boundary is in a concurrent mode tree. Continue + // with the normal suspend path. + // + // After this we'll use a set of heuristics to determine whether this + // render pass will run to completion or restart or "suspend" the commit. + // The actual logic for this is spread out in different places. + // + // This first principle is that if we're going to suspend when we complete + // a root, then we should also restart if we get an update or ping that + // might unsuspend it, and vice versa. The only reason to suspend is + // because you think you might want to restart before committing. However, + // it doesn't make sense to restart only while in the period we're suspended. + // + // Restarting too aggressively is also not good because it starves out any + // intermediate loading state. So we use heuristics to determine when. + // Suspense Heuristics + // + // If nothing threw a Promise or all the same fallbacks are already showing, + // then don't suspend/restart. + // + // If this is an initial render of a new tree of Suspense boundaries and + // those trigger a fallback, then don't suspend/restart. We want to ensure + // that we can show the initial loading state as quickly as possible. + // + // If we hit a "Delayed" case, such as when we'd switch from content back into + // a fallback, then we should always suspend/restart. Transitions apply + // to this case. If none is defined, JND is used instead. + // + // If we're already showing a fallback and it gets "retried", allowing us to show + // another level, but there's still an inner boundary that would show a fallback, + // then we suspend/restart for 500ms since the last time we showed a fallback + // anywhere in the tree. This effectively throttles progressive loading into a + // consistent train of commits. This also gives us an opportunity to restart to + // get to the completed state slightly earlier. + // + // If there's ambiguity due to batching it's resolved in preference of: + // 1) "delayed", 2) "initial render", 3) "retry". + // + // We want to ensure that a "busy" state doesn't get force committed. We want to + // ensure that new initial loading states can commit as soon as possible. + + suspenseBoundary.flags |= ShouldCapture; // TODO: I think we can remove this, since we now use `DidCapture` in + // the begin phase to prevent an early bailout. + + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; + } + function throwException(root, returnFiber, sourceFiber, value, rootRenderLanes) { + // The source fiber did not complete. + sourceFiber.flags |= Incomplete; + { + if (isDevToolsPresent) { + // If we have pending work still, restore the original updaters + restorePendingUpdaters(root, rootRenderLanes); + } + } + if (value !== null && typeof value === "object" && typeof value.then === "function") { + // This is a wakeable. The component suspended. + var wakeable = value; + resetSuspendedComponent(sourceFiber); + var suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber); + if (suspenseBoundary !== null) { + suspenseBoundary.flags &= ~ForceClientRender; + markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes); // We only attach ping listeners in concurrent mode. Legacy Suspense always + // commits fallbacks synchronously, so there are no pings. + + if (suspenseBoundary.mode & ConcurrentMode) { + attachPingListener(root, wakeable, rootRenderLanes); + } + attachRetryListener(suspenseBoundary, root, wakeable); + return; + } else { + // No boundary was found. Unless this is a sync update, this is OK. + // We can suspend and wait for more data to arrive. + if (!includesSyncLane(rootRenderLanes)) { + // This is not a sync update. Suspend. Since we're not activating a + // Suspense boundary, this will unwind all the way to the root without + // performing a second pass to render a fallback. (This is arguably how + // refresh transitions should work, too, since we're not going to commit + // the fallbacks anyway.) + // + // This case also applies to initial hydration. + attachPingListener(root, wakeable, rootRenderLanes); + renderDidSuspendDelayIfPossible(); + return; + } // This is a sync/discrete update. We treat this case like an error + // because discrete renders are expected to produce a complete tree + // synchronously to maintain consistency with external state. + + var uncaughtSuspenseError = new Error("A component suspended while responding to synchronous input. This " + "will cause the UI to be replaced with a loading indicator. To " + "fix, updates that suspend should be wrapped " + "with startTransition."); // If we're outside a transition, fall through to the regular error path. + // The error will be caught by the nearest suspense boundary. + + value = uncaughtSuspenseError; + } + } + value = createCapturedValueAtFiber(value, sourceFiber); + renderDidError(value); // We didn't find a boundary that could handle this type of exception. Start + // over and traverse parent path again, this time treating the exception + // as an error. + + var workInProgress = returnFiber; + do { + switch (workInProgress.tag) { + case HostRoot: + { + var _errorInfo = value; + workInProgress.flags |= ShouldCapture; + var lane = pickArbitraryLane(rootRenderLanes); + workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); + var update = createRootErrorUpdate(workInProgress, _errorInfo, lane); + enqueueCapturedUpdate(workInProgress, update); + return; + } + case ClassComponent: + // Capture and retry + var errorInfo = value; + var ctor = workInProgress.type; + var instance = workInProgress.stateNode; + if ((workInProgress.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === "function" || instance !== null && typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance))) { + workInProgress.flags |= ShouldCapture; + var _lane = pickArbitraryLane(rootRenderLanes); + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state + + var _update = createClassErrorUpdate(workInProgress, errorInfo, _lane); + enqueueCapturedUpdate(workInProgress, _update); + return; + } + break; + } + workInProgress = workInProgress.return; + } while (workInProgress !== null); + } + function getSuspendedCache() { + { + return null; + } // This function is called when a Suspense boundary suspends. It returns the + } + var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; + var didReceiveUpdate = false; + var didWarnAboutBadClass; + var didWarnAboutModulePatternComponent; + var didWarnAboutContextTypeOnFunctionComponent; + var didWarnAboutGetDerivedStateOnFunctionComponent; + var didWarnAboutFunctionRefs; + var didWarnAboutReassigningProps; + var didWarnAboutRevealOrder; + var didWarnAboutTailOptions; + { + didWarnAboutBadClass = {}; + didWarnAboutModulePatternComponent = {}; + didWarnAboutContextTypeOnFunctionComponent = {}; + didWarnAboutGetDerivedStateOnFunctionComponent = {}; + didWarnAboutFunctionRefs = {}; + didWarnAboutReassigningProps = false; + didWarnAboutRevealOrder = {}; + didWarnAboutTailOptions = {}; + } + function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { + if (current === null) { + // If this is a fresh new component that hasn't been rendered yet, we + // won't update its child set by applying minimal side-effects. Instead, + // we will add them all to the child before it gets rendered. That means + // we can optimize this reconciliation pass by not tracking side-effects. + workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderLanes); + } else { + // If the current child is the same as the work in progress, it means that + // we haven't yet started any work on these children. Therefore, we use + // the clone algorithm to create a copy of all the current children. + // If we had any progressed work already, that is invalid at this point so + // let's throw it out. + workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderLanes); + } + } + function forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes) { + // This function is fork of reconcileChildren. It's used in cases where we + // want to reconcile without matching against the existing set. This has the + // effect of all current children being unmounted; even if the type and key + // are the same, the old child is unmounted and a new child is created. + // + // To do this, we're going to go through the reconcile algorithm twice. In + // the first pass, we schedule a deletion for all the current children by + // passing null. + workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderLanes); // In the second pass, we mount the new children. The trick here is that we + // pass null in place of where we usually pass the current child set. This has + // the effect of remounting all children regardless of whether their + // identities match. + + workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes); + } + function updateForwardRef(current, workInProgress, Component, nextProps, renderLanes) { + // TODO: current can be non-null here even if the component + // hasn't yet mounted. This happens after the first render suspends. + // We'll need to figure out if this is fine or can cause issues. + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var innerPropTypes = Component.propTypes; + if (innerPropTypes) { + checkPropTypes(innerPropTypes, nextProps, + // Resolved props + "prop", getComponentNameFromType(Component)); + } + } + } + var render = Component.render; + var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent + + var nextChildren; + prepareToReadContext(workInProgress, renderLanes); + { + ReactCurrentOwner$1.current = workInProgress; + setIsRendering(true); + nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes); + setIsRendering(false); + } + if (current !== null && !didReceiveUpdate) { + bailoutHooks(current, workInProgress, renderLanes); + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + workInProgress.flags |= PerformedWork; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function updateMemoComponent(current, workInProgress, Component, nextProps, renderLanes) { + if (current === null) { + var type = Component.type; + if (isSimpleFunctionComponent(type) && Component.compare === null && + // SimpleMemoComponent codepath doesn't resolve outer props either. + Component.defaultProps === undefined) { + var resolvedType = type; + { + resolvedType = resolveFunctionForHotReloading(type); + } // If this is a plain function component without default props, + // and with only the default shallow comparison, we upgrade it + // to a SimpleMemoComponent to allow fast path updates. + + workInProgress.tag = SimpleMemoComponent; + workInProgress.type = resolvedType; + { + validateFunctionComponentInDev(workInProgress, type); + } + return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, renderLanes); + } + { + var innerPropTypes = type.propTypes; + if (innerPropTypes) { + // Inner memo component props aren't currently validated in createElement. + // We could move it there, but we'd still need this for lazy code path. + checkPropTypes(innerPropTypes, nextProps, + // Resolved props + "prop", getComponentNameFromType(type)); + } + } + var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress, workInProgress.mode, renderLanes); + child.ref = workInProgress.ref; + child.return = workInProgress; + workInProgress.child = child; + return child; + } + { + var _type = Component.type; + var _innerPropTypes = _type.propTypes; + if (_innerPropTypes) { + // Inner memo component props aren't currently validated in createElement. + // We could move it there, but we'd still need this for lazy code path. + checkPropTypes(_innerPropTypes, nextProps, + // Resolved props + "prop", getComponentNameFromType(_type)); + } + } + var currentChild = current.child; // This is always exactly one child + + var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current, renderLanes); + if (!hasScheduledUpdateOrContext) { + // This will be the props with resolved defaultProps, + // unlike current.memoizedProps which will be the unresolved ones. + var prevProps = currentChild.memoizedProps; // Default to shallow comparison + + var compare = Component.compare; + compare = compare !== null ? compare : shallowEqual; + if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) { + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + } // React DevTools reads this flag. + + workInProgress.flags |= PerformedWork; + var newChild = createWorkInProgress(currentChild, nextProps); + newChild.ref = workInProgress.ref; + newChild.return = workInProgress; + workInProgress.child = newChild; + return newChild; + } + function updateSimpleMemoComponent(current, workInProgress, Component, nextProps, renderLanes) { + // TODO: current can be non-null here even if the component + // hasn't yet mounted. This happens when the inner render suspends. + // We'll need to figure out if this is fine or can cause issues. + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var outerMemoType = workInProgress.elementType; + if (outerMemoType.$$typeof === REACT_LAZY_TYPE) { + // We warn when you define propTypes on lazy() + // so let's just skip over it to find memo() outer wrapper. + // Inner props for memo are validated later. + var lazyComponent = outerMemoType; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + outerMemoType = init(payload); + } catch (x) { + outerMemoType = null; + } // Inner propTypes will be validated in the function component path. + + var outerPropTypes = outerMemoType && outerMemoType.propTypes; + if (outerPropTypes) { + checkPropTypes(outerPropTypes, nextProps, + // Resolved (SimpleMemoComponent has no defaultProps) + "prop", getComponentNameFromType(outerMemoType)); + } + } + } + } + if (current !== null) { + var prevProps = current.memoizedProps; + if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && + // Prevent bailout if the implementation changed due to hot reload. + workInProgress.type === current.type) { + didReceiveUpdate = false; // The props are shallowly equal. Reuse the previous props object, like we + // would during a normal fiber bailout. + // + // We don't have strong guarantees that the props object is referentially + // equal during updates where we can't bail out anyway — like if the props + // are shallowly equal, but there's a local state or context update in the + // same batch. + // + // However, as a principle, we should aim to make the behavior consistent + // across different ways of memoizing a component. For example, React.memo + // has a different internal Fiber layout if you pass a normal function + // component (SimpleMemoComponent) versus if you pass a different type + // like forwardRef (MemoComponent). But this is an implementation detail. + // Wrapping a component in forwardRef (or React.lazy, etc) shouldn't + // affect whether the props object is reused during a bailout. + + workInProgress.pendingProps = nextProps = prevProps; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + // The pending lanes were cleared at the beginning of beginWork. We're + // about to bail out, but there might be other lanes that weren't + // included in the current render. Usually, the priority level of the + // remaining updates is accumulated during the evaluation of the + // component (i.e. when processing the update queue). But since since + // we're bailing out early *without* evaluating the component, we need + // to account for it here, too. Reset to the value of the current fiber. + // NOTE: This only applies to SimpleMemoComponent, not MemoComponent, + // because a MemoComponent fiber does not have hooks or an update queue; + // rather, it wraps around an inner component, which may or may not + // contains hooks. + // TODO: Move the reset at in beginWork out of the common path so that + // this is no longer necessary. + workInProgress.lanes = current.lanes; + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } else if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) { + // This is a special case that only exists for legacy mode. + // See https://github.com/facebook/react/pull/19216. + didReceiveUpdate = true; + } + } + } + return updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes); + } + function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps; + var nextChildren = nextProps.children; + var prevState = current !== null ? current.memoizedState : null; + if (nextProps.mode === "hidden" || enableLegacyHidden) { + // Rendering a hidden tree. + if ((workInProgress.mode & ConcurrentMode) === NoMode) { + // In legacy sync mode, don't defer the subtree. Render it now. + // TODO: Consider how Offscreen should work with transitions in the future + var nextState = { + baseLanes: NoLanes, + cachePool: null, + transitions: null + }; + workInProgress.memoizedState = nextState; + pushRenderLanes(workInProgress, renderLanes); + } else if (!includesSomeLane(renderLanes, OffscreenLane)) { + var spawnedCachePool = null; // We're hidden, and we're not rendering at Offscreen. We will bail out + // and resume this tree later. + + var nextBaseLanes; + if (prevState !== null) { + var prevBaseLanes = prevState.baseLanes; + nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes); + } else { + nextBaseLanes = renderLanes; + } // Schedule this fiber to re-render at offscreen priority. Then bailout. + + workInProgress.lanes = workInProgress.childLanes = laneToLanes(OffscreenLane); + var _nextState = { + baseLanes: nextBaseLanes, + cachePool: spawnedCachePool, + transitions: null + }; + workInProgress.memoizedState = _nextState; + workInProgress.updateQueue = null; + // to avoid a push/pop misalignment. + + pushRenderLanes(workInProgress, nextBaseLanes); + return null; + } else { + // This is the second render. The surrounding visible content has already + // committed. Now we resume rendering the hidden tree. + // Rendering at offscreen, so we can clear the base lanes. + var _nextState2 = { + baseLanes: NoLanes, + cachePool: null, + transitions: null + }; + workInProgress.memoizedState = _nextState2; // Push the lanes that were skipped when we bailed out. + + var subtreeRenderLanes = prevState !== null ? prevState.baseLanes : renderLanes; + pushRenderLanes(workInProgress, subtreeRenderLanes); + } + } else { + // Rendering a visible tree. + var _subtreeRenderLanes; + if (prevState !== null) { + // We're going from hidden -> visible. + _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes); + workInProgress.memoizedState = null; + } else { + // We weren't previously hidden, and we still aren't, so there's nothing + // special to do. Need to push to the stack regardless, though, to avoid + // a push/pop misalignment. + _subtreeRenderLanes = renderLanes; + } + pushRenderLanes(workInProgress, _subtreeRenderLanes); + } + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } // Note: These happen to have identical begin phases, for now. We shouldn't hold + + function updateFragment(current, workInProgress, renderLanes) { + var nextChildren = workInProgress.pendingProps; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function updateMode(current, workInProgress, renderLanes) { + var nextChildren = workInProgress.pendingProps.children; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function updateProfiler(current, workInProgress, renderLanes) { + { + workInProgress.flags |= Update; + { + // Reset effect durations for the next eventual effect phase. + // These are reset during render to allow the DevTools commit hook a chance to read them, + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = 0; + stateNode.passiveEffectDuration = 0; + } + } + var nextProps = workInProgress.pendingProps; + var nextChildren = nextProps.children; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (current === null && ref !== null || current !== null && current.ref !== ref) { + // Schedule a Ref effect + workInProgress.flags |= Ref; + } + } + function updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes) { + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var innerPropTypes = Component.propTypes; + if (innerPropTypes) { + checkPropTypes(innerPropTypes, nextProps, + // Resolved props + "prop", getComponentNameFromType(Component)); + } + } + } + var context; + { + var unmaskedContext = getUnmaskedContext(workInProgress, Component, true); + context = getMaskedContext(workInProgress, unmaskedContext); + } + var nextChildren; + prepareToReadContext(workInProgress, renderLanes); + { + ReactCurrentOwner$1.current = workInProgress; + setIsRendering(true); + nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes); + setIsRendering(false); + } + if (current !== null && !didReceiveUpdate) { + bailoutHooks(current, workInProgress, renderLanes); + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + workInProgress.flags |= PerformedWork; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function updateClassComponent(current, workInProgress, Component, nextProps, renderLanes) { + { + // This is used by DevTools to force a boundary to error. + switch (shouldError(workInProgress)) { + case false: + { + var _instance = workInProgress.stateNode; + var ctor = workInProgress.type; // TODO This way of resetting the error boundary state is a hack. + // Is there a better way to do this? + + var tempInstance = new ctor(workInProgress.memoizedProps, _instance.context); + var state = tempInstance.state; + _instance.updater.enqueueSetState(_instance, state, null); + break; + } + case true: + { + workInProgress.flags |= DidCapture; + workInProgress.flags |= ShouldCapture; // eslint-disable-next-line react-internal/prod-error-codes + + var error$1 = new Error("Simulated error coming from DevTools"); + var lane = pickArbitraryLane(renderLanes); + workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); // Schedule the error boundary to re-render using updated state + + var update = createClassErrorUpdate(workInProgress, createCapturedValueAtFiber(error$1, workInProgress), lane); + enqueueCapturedUpdate(workInProgress, update); + break; + } + } + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var innerPropTypes = Component.propTypes; + if (innerPropTypes) { + checkPropTypes(innerPropTypes, nextProps, + // Resolved props + "prop", getComponentNameFromType(Component)); + } + } + } // Push context providers early to prevent context stack mismatches. + // During mounting we don't know the child context yet as the instance doesn't exist. + // We will invalidate the child context in finishClassComponent() right after rendering. + + var hasContext; + if (isContextProvider(Component)) { + hasContext = true; + pushContextProvider(workInProgress); + } else { + hasContext = false; + } + prepareToReadContext(workInProgress, renderLanes); + var instance = workInProgress.stateNode; + var shouldUpdate; + if (instance === null) { + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); // In the initial pass we might need to construct the instance. + + constructClassInstance(workInProgress, Component, nextProps); + mountClassInstance(workInProgress, Component, nextProps, renderLanes); + shouldUpdate = true; + } else if (current === null) { + // In a resume, we'll already have an instance we can reuse. + shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderLanes); + } else { + shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderLanes); + } + var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes); + { + var inst = workInProgress.stateNode; + if (shouldUpdate && inst.props !== nextProps) { + if (!didWarnAboutReassigningProps) { + error("It looks like %s is reassigning its own `this.props` while rendering. " + "This is not supported and can lead to confusing bugs.", getComponentNameFromFiber(workInProgress) || "a component"); + } + didWarnAboutReassigningProps = true; + } + } + return nextUnitOfWork; + } + function finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes) { + // Refs should update even if shouldComponentUpdate returns false + markRef(current, workInProgress); + var didCaptureError = (workInProgress.flags & DidCapture) !== NoFlags; + if (!shouldUpdate && !didCaptureError) { + // Context providers should defer to sCU for rendering + if (hasContext) { + invalidateContextProvider(workInProgress, Component, false); + } + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + var instance = workInProgress.stateNode; // Rerender + + ReactCurrentOwner$1.current = workInProgress; + var nextChildren; + if (didCaptureError && typeof Component.getDerivedStateFromError !== "function") { + // If we captured an error, but getDerivedStateFromError is not defined, + // unmount all the children. componentDidCatch will schedule an update to + // re-render a fallback. This is temporary until we migrate everyone to + // the new API. + // TODO: Warn in a future release. + nextChildren = null; + { + stopProfilerTimerIfRunning(); + } + } else { + { + setIsRendering(true); + nextChildren = instance.render(); + setIsRendering(false); + } + } // React DevTools reads this flag. + + workInProgress.flags |= PerformedWork; + if (current !== null && didCaptureError) { + // If we're recovering from an error, reconcile without reusing any of + // the existing children. Conceptually, the normal children and the children + // that are shown on error are two different sets, so we shouldn't reuse + // normal children even if their identities match. + forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes); + } else { + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + } // Memoize state using the values we just used to render. + // TODO: Restructure so we never read values from the instance. + + workInProgress.memoizedState = instance.state; // The context might have changed so we need to recalculate it. + + if (hasContext) { + invalidateContextProvider(workInProgress, Component, true); + } + return workInProgress.child; + } + function pushHostRootContext(workInProgress) { + var root = workInProgress.stateNode; + if (root.pendingContext) { + pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context); + } else if (root.context) { + // Should always be set + pushTopLevelContextObject(workInProgress, root.context, false); + } + pushHostContainer(workInProgress, root.containerInfo); + } + function updateHostRoot(current, workInProgress, renderLanes) { + pushHostRootContext(workInProgress); + if (current === null) { + throw new Error("Should have a current fiber. This is a bug in React."); + } + var nextProps = workInProgress.pendingProps; + var prevState = workInProgress.memoizedState; + var prevChildren = prevState.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + var nextState = workInProgress.memoizedState; + var root = workInProgress.stateNode; + // being called "element". + + var nextChildren = nextState.element; + { + if (nextChildren === prevChildren) { + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + } + return workInProgress.child; + } + function updateHostComponent(current, workInProgress, renderLanes) { + pushHostContext(workInProgress); + var type = workInProgress.type; + var nextProps = workInProgress.pendingProps; + var prevProps = current !== null ? current.memoizedProps : null; + var nextChildren = nextProps.children; + if (prevProps !== null && shouldSetTextContent()) { + // If we're switching from a direct text child to a normal child, or to + // empty, we need to schedule the text content to be reset. + workInProgress.flags |= ContentReset; + } + markRef(current, workInProgress); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function updateHostText(current, workInProgress) { + // immediately after. + + return null; + } + function mountLazyComponent(_current, workInProgress, elementType, renderLanes) { + resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); + var props = workInProgress.pendingProps; + var lazyComponent = elementType; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + var Component = init(payload); // Store the unwrapped component in the type. + + workInProgress.type = Component; + var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component); + var resolvedProps = resolveDefaultProps(Component, props); + var child; + switch (resolvedTag) { + case FunctionComponent: + { + { + validateFunctionComponentInDev(workInProgress, Component); + workInProgress.type = Component = resolveFunctionForHotReloading(Component); + } + child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderLanes); + return child; + } + case ClassComponent: + { + { + workInProgress.type = Component = resolveClassForHotReloading(Component); + } + child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderLanes); + return child; + } + case ForwardRef: + { + { + workInProgress.type = Component = resolveForwardRefForHotReloading(Component); + } + child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderLanes); + return child; + } + case MemoComponent: + { + { + if (workInProgress.type !== workInProgress.elementType) { + var outerPropTypes = Component.propTypes; + if (outerPropTypes) { + checkPropTypes(outerPropTypes, resolvedProps, + // Resolved for outer only + "prop", getComponentNameFromType(Component)); + } + } + } + child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), + // The inner type can have defaults too + renderLanes); + return child; + } + } + var hint = ""; + { + if (Component !== null && typeof Component === "object" && Component.$$typeof === REACT_LAZY_TYPE) { + hint = " Did you wrap a component in React.lazy() more than once?"; + } + } // This message intentionally doesn't mention ForwardRef or MemoComponent + // because the fact that it's a separate type of work is an + // implementation detail. + + throw new Error("Element type is invalid. Received a promise that resolves to: " + Component + ". " + ("Lazy element type must resolve to a class or function." + hint)); + } + function mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderLanes) { + resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); // Promote the fiber to a class and try rendering again. + + workInProgress.tag = ClassComponent; // The rest of this function is a fork of `updateClassComponent` + // Push context providers early to prevent context stack mismatches. + // During mounting we don't know the child context yet as the instance doesn't exist. + // We will invalidate the child context in finishClassComponent() right after rendering. + + var hasContext; + if (isContextProvider(Component)) { + hasContext = true; + pushContextProvider(workInProgress); + } else { + hasContext = false; + } + prepareToReadContext(workInProgress, renderLanes); + constructClassInstance(workInProgress, Component, nextProps); + mountClassInstance(workInProgress, Component, nextProps, renderLanes); + return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes); + } + function mountIndeterminateComponent(_current, workInProgress, Component, renderLanes) { + resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); + var props = workInProgress.pendingProps; + var context; + { + var unmaskedContext = getUnmaskedContext(workInProgress, Component, false); + context = getMaskedContext(workInProgress, unmaskedContext); + } + prepareToReadContext(workInProgress, renderLanes); + var value; + { + if (Component.prototype && typeof Component.prototype.render === "function") { + var componentName = getComponentNameFromType(Component) || "Unknown"; + if (!didWarnAboutBadClass[componentName]) { + error("The <%s /> component appears to have a render method, but doesn't extend React.Component. " + "This is likely to cause errors. Change %s to extend React.Component instead.", componentName, componentName); + didWarnAboutBadClass[componentName] = true; + } + } + if (workInProgress.mode & StrictLegacyMode) { + ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null); + } + setIsRendering(true); + ReactCurrentOwner$1.current = workInProgress; + value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes); + setIsRendering(false); + } + workInProgress.flags |= PerformedWork; + { + // Support for module components is deprecated and is removed behind a flag. + // Whether or not it would crash later, we want to show a good message in DEV first. + if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === undefined) { + var _componentName = getComponentNameFromType(Component) || "Unknown"; + if (!didWarnAboutModulePatternComponent[_componentName]) { + error("The <%s /> component appears to be a function component that returns a class instance. " + "Change %s to a class that extends React.Component instead. " + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + "cannot be called with `new` by React.", _componentName, _componentName, _componentName); + didWarnAboutModulePatternComponent[_componentName] = true; + } + } + } + if ( + // Run these checks in production only if the flag is off. + // Eventually we'll delete this branch altogether. + typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === undefined) { + { + var _componentName2 = getComponentNameFromType(Component) || "Unknown"; + if (!didWarnAboutModulePatternComponent[_componentName2]) { + error("The <%s /> component appears to be a function component that returns a class instance. " + "Change %s to a class that extends React.Component instead. " + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + "cannot be called with `new` by React.", _componentName2, _componentName2, _componentName2); + didWarnAboutModulePatternComponent[_componentName2] = true; + } + } // Proceed under the assumption that this is a class instance + + workInProgress.tag = ClassComponent; // Throw out any hooks that were used. + + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; // Push context providers early to prevent context stack mismatches. + // During mounting we don't know the child context yet as the instance doesn't exist. + // We will invalidate the child context in finishClassComponent() right after rendering. + + var hasContext = false; + if (isContextProvider(Component)) { + hasContext = true; + pushContextProvider(workInProgress); + } else { + hasContext = false; + } + workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null; + initializeUpdateQueue(workInProgress); + adoptClassInstance(workInProgress, value); + mountClassInstance(workInProgress, Component, props, renderLanes); + return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes); + } else { + // Proceed under the assumption that this is a function component + workInProgress.tag = FunctionComponent; + reconcileChildren(null, workInProgress, value, renderLanes); + { + validateFunctionComponentInDev(workInProgress, Component); + } + return workInProgress.child; + } + } + function validateFunctionComponentInDev(workInProgress, Component) { + { + if (Component) { + if (Component.childContextTypes) { + error("%s(...): childContextTypes cannot be defined on a function component.", Component.displayName || Component.name || "Component"); + } + } + if (workInProgress.ref !== null) { + var info = ""; + var ownerName = getCurrentFiberOwnerNameInDevOrNull(); + if (ownerName) { + info += "\n\nCheck the render method of `" + ownerName + "`."; + } + var warningKey = ownerName || ""; + var debugSource = workInProgress._debugSource; + if (debugSource) { + warningKey = debugSource.fileName + ":" + debugSource.lineNumber; + } + if (!didWarnAboutFunctionRefs[warningKey]) { + didWarnAboutFunctionRefs[warningKey] = true; + error("Function components cannot be given refs. " + "Attempts to access this ref will fail. " + "Did you mean to use React.forwardRef()?%s", info); + } + } + if (typeof Component.getDerivedStateFromProps === "function") { + var _componentName3 = getComponentNameFromType(Component) || "Unknown"; + if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) { + error("%s: Function components do not support getDerivedStateFromProps.", _componentName3); + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true; + } + } + if (typeof Component.contextType === "object" && Component.contextType !== null) { + var _componentName4 = getComponentNameFromType(Component) || "Unknown"; + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) { + error("%s: Function components do not support contextType.", _componentName4); + didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true; + } + } + } + } + var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: NoLane + }; + function mountSuspenseOffscreenState(renderLanes) { + return { + baseLanes: renderLanes, + cachePool: getSuspendedCache(), + transitions: null + }; + } + function updateSuspenseOffscreenState(prevOffscreenState, renderLanes) { + var cachePool = null; + return { + baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes), + cachePool: cachePool, + transitions: prevOffscreenState.transitions + }; + } // TODO: Probably should inline this back + + function shouldRemainOnFallback(suspenseContext, current, workInProgress, renderLanes) { + // If we're already showing a fallback, there are cases where we need to + // remain on that fallback regardless of whether the content has resolved. + // For example, SuspenseList coordinates when nested content appears. + if (current !== null) { + var suspenseState = current.memoizedState; + if (suspenseState === null) { + // Currently showing content. Don't hide it, even if ForceSuspenseFallback + // is true. More precise name might be "ForceRemainSuspenseFallback". + // Note: This is a factoring smell. Can't remain on a fallback if there's + // no fallback to remain on. + return false; + } + } // Not currently showing content. Consult the Suspense context. + + return hasSuspenseContext(suspenseContext, ForceSuspenseFallback); + } + function getRemainingWorkInPrimaryTree(current, renderLanes) { + // TODO: Should not remove render lanes that were pinged during this render + return removeLanes(current.childLanes, renderLanes); + } + function updateSuspenseComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps; // This is used by DevTools to force a boundary to suspend. + + { + if (shouldSuspend(workInProgress)) { + workInProgress.flags |= DidCapture; + } + } + var suspenseContext = suspenseStackCursor.current; + var showFallback = false; + var didSuspend = (workInProgress.flags & DidCapture) !== NoFlags; + if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) { + // Something in this boundary's subtree already suspended. Switch to + // rendering the fallback children. + showFallback = true; + workInProgress.flags &= ~DidCapture; + } else { + // Attempting the main content + if (current === null || current.memoizedState !== null) { + // This is a new mount or this boundary is already showing a fallback state. + // Mark this subtree context as having at least one invisible parent that could + // handle the fallback state. + // Avoided boundaries are not considered since they cannot handle preferred fallback states. + { + suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext); + } + } + } + suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); + pushSuspenseContext(workInProgress, suspenseContext); // OK, the next part is confusing. We're about to reconcile the Suspense + // boundary's children. This involves some custom reconciliation logic. Two + // main reasons this is so complicated. + // + // First, Legacy Mode has different semantics for backwards compatibility. The + // primary tree will commit in an inconsistent state, so when we do the + // second pass to render the fallback, we do some exceedingly, uh, clever + // hacks to make that not totally break. Like transferring effects and + // deletions from hidden tree. In Concurrent Mode, it's much simpler, + // because we bailout on the primary tree completely and leave it in its old + // state, no effects. Same as what we do for Offscreen (except that + // Offscreen doesn't have the first render pass). + // + // Second is hydration. During hydration, the Suspense fiber has a slightly + // different layout, where the child points to a dehydrated fragment, which + // contains the DOM rendered by the server. + // + // Third, even if you set all that aside, Suspense is like error boundaries in + // that we first we try to render one tree, and if that fails, we render again + // and switch to a different tree. Like a try/catch block. So we have to track + // which branch we're currently rendering. Ideally we would model this using + // a stack. + + if (current === null) { + var suspenseState = workInProgress.memoizedState; + if (suspenseState !== null) { + var dehydrated = suspenseState.dehydrated; + if (dehydrated !== null) { + return mountDehydratedSuspenseComponent(workInProgress); + } + } + var nextPrimaryChildren = nextProps.children; + var nextFallbackChildren = nextProps.fallback; + if (showFallback) { + var fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes); + var primaryChildFragment = workInProgress.child; + primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes); + workInProgress.memoizedState = SUSPENDED_MARKER; + return fallbackFragment; + } else { + return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren); + } + } else { + // This is an update. + // Special path for hydration + var prevState = current.memoizedState; + if (prevState !== null) { + var _dehydrated = prevState.dehydrated; + if (_dehydrated !== null) { + return updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, _dehydrated, prevState, renderLanes); + } + } + if (showFallback) { + var _nextFallbackChildren = nextProps.fallback; + var _nextPrimaryChildren = nextProps.children; + var fallbackChildFragment = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren, _nextFallbackChildren, renderLanes); + var _primaryChildFragment2 = workInProgress.child; + var prevOffscreenState = current.child.memoizedState; + _primaryChildFragment2.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes); + _primaryChildFragment2.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes); + workInProgress.memoizedState = SUSPENDED_MARKER; + return fallbackChildFragment; + } else { + var _nextPrimaryChildren2 = nextProps.children; + var _primaryChildFragment3 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren2, renderLanes); + workInProgress.memoizedState = null; + return _primaryChildFragment3; + } + } + } + function mountSuspensePrimaryChildren(workInProgress, primaryChildren, renderLanes) { + var mode = workInProgress.mode; + var primaryChildProps = { + mode: "visible", + children: primaryChildren + }; + var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode); + primaryChildFragment.return = workInProgress; + workInProgress.child = primaryChildFragment; + return primaryChildFragment; + } + function mountSuspenseFallbackChildren(workInProgress, primaryChildren, fallbackChildren, renderLanes) { + var mode = workInProgress.mode; + var progressedPrimaryFragment = workInProgress.child; + var primaryChildProps = { + mode: "hidden", + children: primaryChildren + }; + var primaryChildFragment; + var fallbackChildFragment; + if ((mode & ConcurrentMode) === NoMode && progressedPrimaryFragment !== null) { + // In legacy mode, we commit the primary tree as if it successfully + // completed, even though it's in an inconsistent state. + primaryChildFragment = progressedPrimaryFragment; + primaryChildFragment.childLanes = NoLanes; + primaryChildFragment.pendingProps = primaryChildProps; + if (workInProgress.mode & ProfileMode) { + // Reset the durations from the first pass so they aren't included in the + // final amounts. This seems counterintuitive, since we're intentionally + // not measuring part of the render phase, but this makes it match what we + // do in Concurrent Mode. + primaryChildFragment.actualDuration = 0; + primaryChildFragment.actualStartTime = -1; + primaryChildFragment.selfBaseDuration = 0; + primaryChildFragment.treeBaseDuration = 0; + } + fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); + } else { + primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode); + fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); + } + primaryChildFragment.return = workInProgress; + fallbackChildFragment.return = workInProgress; + primaryChildFragment.sibling = fallbackChildFragment; + workInProgress.child = primaryChildFragment; + return fallbackChildFragment; + } + function mountWorkInProgressOffscreenFiber(offscreenProps, mode, renderLanes) { + // The props argument to `createFiberFromOffscreen` is `any` typed, so we use + // this wrapper function to constrain it. + return createFiberFromOffscreen(offscreenProps, mode, NoLanes, null); + } + function updateWorkInProgressOffscreenFiber(current, offscreenProps) { + // The props argument to `createWorkInProgress` is `any` typed, so we use this + // wrapper function to constrain it. + return createWorkInProgress(current, offscreenProps); + } + function updateSuspensePrimaryChildren(current, workInProgress, primaryChildren, renderLanes) { + var currentPrimaryChildFragment = current.child; + var currentFallbackChildFragment = currentPrimaryChildFragment.sibling; + var primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, { + mode: "visible", + children: primaryChildren + }); + if ((workInProgress.mode & ConcurrentMode) === NoMode) { + primaryChildFragment.lanes = renderLanes; + } + primaryChildFragment.return = workInProgress; + primaryChildFragment.sibling = null; + if (currentFallbackChildFragment !== null) { + // Delete the fallback child fragment + var deletions = workInProgress.deletions; + if (deletions === null) { + workInProgress.deletions = [currentFallbackChildFragment]; + workInProgress.flags |= ChildDeletion; + } else { + deletions.push(currentFallbackChildFragment); + } + } + workInProgress.child = primaryChildFragment; + return primaryChildFragment; + } + function updateSuspenseFallbackChildren(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) { + var mode = workInProgress.mode; + var currentPrimaryChildFragment = current.child; + var currentFallbackChildFragment = currentPrimaryChildFragment.sibling; + var primaryChildProps = { + mode: "hidden", + children: primaryChildren + }; + var primaryChildFragment; + if ( + // In legacy mode, we commit the primary tree as if it successfully + // completed, even though it's in an inconsistent state. + (mode & ConcurrentMode) === NoMode && + // Make sure we're on the second pass, i.e. the primary child fragment was + // already cloned. In legacy mode, the only case where this isn't true is + // when DevTools forces us to display a fallback; we skip the first render + // pass entirely and go straight to rendering the fallback. (In Concurrent + // Mode, SuspenseList can also trigger this scenario, but this is a legacy- + // only codepath.) + workInProgress.child !== currentPrimaryChildFragment) { + var progressedPrimaryFragment = workInProgress.child; + primaryChildFragment = progressedPrimaryFragment; + primaryChildFragment.childLanes = NoLanes; + primaryChildFragment.pendingProps = primaryChildProps; + if (workInProgress.mode & ProfileMode) { + // Reset the durations from the first pass so they aren't included in the + // final amounts. This seems counterintuitive, since we're intentionally + // not measuring part of the render phase, but this makes it match what we + // do in Concurrent Mode. + primaryChildFragment.actualDuration = 0; + primaryChildFragment.actualStartTime = -1; + primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration; + primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration; + } // The fallback fiber was added as a deletion during the first pass. + // However, since we're going to remain on the fallback, we no longer want + // to delete it. + + workInProgress.deletions = null; + } else { + primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps); // Since we're reusing a current tree, we need to reuse the flags, too. + // (We don't do this in legacy mode, because in legacy mode we don't re-use + // the current tree; see previous branch.) + + primaryChildFragment.subtreeFlags = currentPrimaryChildFragment.subtreeFlags & StaticMask; + } + var fallbackChildFragment; + if (currentFallbackChildFragment !== null) { + fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren); + } else { + fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); // Needs a placement effect because the parent (the Suspense boundary) already + // mounted but this is a new fiber. + + fallbackChildFragment.flags |= Placement; + } + fallbackChildFragment.return = workInProgress; + primaryChildFragment.return = workInProgress; + primaryChildFragment.sibling = fallbackChildFragment; + workInProgress.child = primaryChildFragment; + return fallbackChildFragment; + } + function retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, recoverableError) { + // Falling back to client rendering. Because this has performance + // implications, it's considered a recoverable error, even though the user + // likely won't observe anything wrong with the UI. + // + // The error is passed in as an argument to enforce that every caller provide + // a custom message, or explicitly opt out (currently the only path that opts + // out is legacy mode; every concurrent path provides an error). + if (recoverableError !== null) { + queueHydrationError(recoverableError); + } // This will add the old fiber to the deletion list + + reconcileChildFibers(workInProgress, current.child, null, renderLanes); // We're now not suspended nor dehydrated. + + var nextProps = workInProgress.pendingProps; + var primaryChildren = nextProps.children; + var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress, primaryChildren); // Needs a placement effect because the parent (the Suspense boundary) already + // mounted but this is a new fiber. + + primaryChildFragment.flags |= Placement; + workInProgress.memoizedState = null; + return primaryChildFragment; + } + function mountSuspenseFallbackAfterRetryWithoutHydrating(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) { + var fiberMode = workInProgress.mode; + var primaryChildProps = { + mode: "visible", + children: primaryChildren + }; + var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, fiberMode); + var fallbackChildFragment = createFiberFromFragment(fallbackChildren, fiberMode, renderLanes, null); // Needs a placement effect because the parent (the Suspense + // boundary) already mounted but this is a new fiber. + + fallbackChildFragment.flags |= Placement; + primaryChildFragment.return = workInProgress; + fallbackChildFragment.return = workInProgress; + primaryChildFragment.sibling = fallbackChildFragment; + workInProgress.child = primaryChildFragment; + if ((workInProgress.mode & ConcurrentMode) !== NoMode) { + // We will have dropped the effect list which contains the + // deletion. We need to reconcile to delete the current child. + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + } + return fallbackChildFragment; + } + function mountDehydratedSuspenseComponent(workInProgress, suspenseInstance, renderLanes) { + // During the first pass, we'll bail out and not drill into the children. + // Instead, we'll leave the content in place and try to hydrate it later. + if ((workInProgress.mode & ConcurrentMode) === NoMode) { + { + error("Cannot hydrate Suspense in legacy mode. Switch from " + "ReactDOM.hydrate(element, container) to " + "ReactDOMClient.hydrateRoot(container, )" + ".render(element) or remove the Suspense components from " + "the server rendered components."); + } + workInProgress.lanes = laneToLanes(SyncLane); + } else if (isSuspenseInstanceFallback()) { + // This is a client-only boundary. Since we won't get any content from the server + // for this, we need to schedule that at a higher priority based on when it would + // have timed out. In theory we could render it in this pass but it would have the + // wrong priority associated with it and will prevent hydration of parent path. + // Instead, we'll leave work left on it to render it in a separate commit. + // TODO This time should be the time at which the server rendered response that is + // a parent to this boundary was displayed. However, since we currently don't have + // a protocol to transfer that time, we'll just estimate it by using the current + // time. This will mean that Suspense timeouts are slightly shifted to later than + // they should be. + // Schedule a normal pri update to render this content. + workInProgress.lanes = laneToLanes(DefaultHydrationLane); + } else { + // We'll continue hydrating the rest at offscreen priority since we'll already + // be showing the right content coming from the server, it is no rush. + workInProgress.lanes = laneToLanes(OffscreenLane); + } + return null; + } + function updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, suspenseInstance, suspenseState, renderLanes) { + if (!didSuspend) { + if ((workInProgress.mode & ConcurrentMode) === NoMode) { + return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, + // TODO: When we delete legacy mode, we should make this error argument + // required — every concurrent mode path that causes hydration to + // de-opt to client rendering should have an error message. + null); + } + if (isSuspenseInstanceFallback()) { + // This boundary is in a permanent fallback state. In this case, we'll never + // get an update and we'll never be able to hydrate the final content. Let's just try the + // client side render instead. + var digest, message, stack; + { + var _getSuspenseInstanceF = getSuspenseInstanceFallbackErrorDetails(); + digest = _getSuspenseInstanceF.digest; + message = _getSuspenseInstanceF.message; + stack = _getSuspenseInstanceF.stack; + } + var error; + if (message) { + // eslint-disable-next-line react-internal/prod-error-codes + error = new Error(message); + } else { + error = new Error("The server could not finish this Suspense boundary, likely " + "due to an error during server rendering. Switched to " + "client rendering."); + } + var capturedValue = createCapturedValue(error, digest, stack); + return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, capturedValue); + } + // any context has changed, we need to treat is as if the input might have changed. + + var hasContextChanged = includesSomeLane(renderLanes, current.childLanes); + if (didReceiveUpdate || hasContextChanged) { + // This boundary has changed since the first render. This means that we are now unable to + // hydrate it. We might still be able to hydrate it using a higher priority lane. + var root = getWorkInProgressRoot(); + if (root !== null) { + var attemptHydrationAtLane = getBumpedLaneForHydration(root, renderLanes); + if (attemptHydrationAtLane !== NoLane && attemptHydrationAtLane !== suspenseState.retryLane) { + // Intentionally mutating since this render will get interrupted. This + // is one of the very rare times where we mutate the current tree + // during the render phase. + suspenseState.retryLane = attemptHydrationAtLane; // TODO: Ideally this would inherit the event time of the current render + + var eventTime = NoTimestamp; + enqueueConcurrentRenderForLane(current, attemptHydrationAtLane); + scheduleUpdateOnFiber(root, current, attemptHydrationAtLane, eventTime); + } + } // If we have scheduled higher pri work above, this will probably just abort the render + // since we now have higher priority work, but in case it doesn't, we need to prepare to + // render something, if we time out. Even if that requires us to delete everything and + // skip hydration. + // Delay having to do this as long as the suspense timeout allows us. + + renderDidSuspendDelayIfPossible(); + var _capturedValue = createCapturedValue(new Error("This Suspense boundary received an update before it finished " + "hydrating. This caused the boundary to switch to client rendering. " + "The usual way to fix this is to wrap the original update " + "in startTransition.")); + return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, _capturedValue); + } else if (isSuspenseInstancePending()) { + // This component is still pending more data from the server, so we can't hydrate its + // content. We treat it as if this component suspended itself. It might seem as if + // we could just try to render it client-side instead. However, this will perform a + // lot of unnecessary work and is unlikely to complete since it often will suspend + // on missing data anyway. Additionally, the server might be able to render more + // than we can on the client yet. In that case we'd end up with more fallback states + // on the client than if we just leave it alone. If the server times out or errors + // these should update this boundary to the permanent Fallback state instead. + // Mark it as having captured (i.e. suspended). + workInProgress.flags |= DidCapture; // Leave the child in place. I.e. the dehydrated fragment. + + workInProgress.child = current.child; // Register a callback to retry this boundary once the server has sent the result. + + var retry = retryDehydratedSuspenseBoundary.bind(null, current); + registerSuspenseInstanceRetry(); + return null; + } else { + // This is the first attempt. + reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress, suspenseInstance, suspenseState.treeContext); + var primaryChildren = nextProps.children; + var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress, primaryChildren); // Mark the children as hydrating. This is a fast path to know whether this + // tree is part of a hydrating tree. This is used to determine if a child + // node has fully mounted yet, and for scheduling event replaying. + // Conceptually this is similar to Placement in that a new subtree is + // inserted into the React tree here. It just happens to not need DOM + // mutations because it already exists. + + primaryChildFragment.flags |= Hydrating; + return primaryChildFragment; + } + } else { + // This is the second render pass. We already attempted to hydrated, but + // something either suspended or errored. + if (workInProgress.flags & ForceClientRender) { + // Something errored during hydration. Try again without hydrating. + workInProgress.flags &= ~ForceClientRender; + var _capturedValue2 = createCapturedValue(new Error("There was an error while hydrating this Suspense boundary. " + "Switched to client rendering.")); + return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, _capturedValue2); + } else if (workInProgress.memoizedState !== null) { + // Something suspended and we should still be in dehydrated mode. + // Leave the existing child in place. + workInProgress.child = current.child; // The dehydrated completion pass expects this flag to be there + // but the normal suspense pass doesn't. + + workInProgress.flags |= DidCapture; + return null; + } else { + // Suspended but we should no longer be in dehydrated mode. + // Therefore we now have to render the fallback. + var nextPrimaryChildren = nextProps.children; + var nextFallbackChildren = nextProps.fallback; + var fallbackChildFragment = mountSuspenseFallbackAfterRetryWithoutHydrating(current, workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes); + var _primaryChildFragment4 = workInProgress.child; + _primaryChildFragment4.memoizedState = mountSuspenseOffscreenState(renderLanes); + workInProgress.memoizedState = SUSPENDED_MARKER; + return fallbackChildFragment; + } + } + } + function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes = mergeLanes(fiber.lanes, renderLanes); + var alternate = fiber.alternate; + if (alternate !== null) { + alternate.lanes = mergeLanes(alternate.lanes, renderLanes); + } + scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); + } + function propagateSuspenseContextChange(workInProgress, firstChild, renderLanes) { + // Mark any Suspense boundaries with fallbacks as having work to do. + // If they were previously forced into fallbacks, they may now be able + // to unblock. + var node = firstChild; + while (node !== null) { + if (node.tag === SuspenseComponent) { + var state = node.memoizedState; + if (state !== null) { + scheduleSuspenseWorkOnFiber(node, renderLanes, workInProgress); + } + } else if (node.tag === SuspenseListComponent) { + // If the tail is hidden there might not be an Suspense boundaries + // to schedule work on. In this case we have to schedule it on the + // list itself. + // We don't have to traverse to the children of the list since + // the list will propagate the change when it rerenders. + scheduleSuspenseWorkOnFiber(node, renderLanes, workInProgress); + } else if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } + if (node === workInProgress) { + return; + } + while (node.sibling === null) { + if (node.return === null || node.return === workInProgress) { + return; + } + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + } + function findLastContentRow(firstChild) { + // This is going to find the last row among these children that is already + // showing content on the screen, as opposed to being in fallback state or + // new. If a row has multiple Suspense boundaries, any of them being in the + // fallback state, counts as the whole row being in a fallback state. + // Note that the "rows" will be workInProgress, but any nested children + // will still be current since we haven't rendered them yet. The mounted + // order may not be the same as the new order. We use the new order. + var row = firstChild; + var lastContentRow = null; + while (row !== null) { + var currentRow = row.alternate; // New rows can't be content rows. + + if (currentRow !== null && findFirstSuspended(currentRow) === null) { + lastContentRow = row; + } + row = row.sibling; + } + return lastContentRow; + } + function validateRevealOrder(revealOrder) { + { + if (revealOrder !== undefined && revealOrder !== "forwards" && revealOrder !== "backwards" && revealOrder !== "together" && !didWarnAboutRevealOrder[revealOrder]) { + didWarnAboutRevealOrder[revealOrder] = true; + if (typeof revealOrder === "string") { + switch (revealOrder.toLowerCase()) { + case "together": + case "forwards": + case "backwards": + { + error('"%s" is not a valid value for revealOrder on . ' + 'Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase()); + break; + } + case "forward": + case "backward": + { + error('"%s" is not a valid value for revealOrder on . ' + 'React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase()); + break; + } + default: + error('"%s" is not a supported revealOrder on . ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder); + break; + } + } else { + error("%s is not a supported value for revealOrder on . " + 'Did you mean "together", "forwards" or "backwards"?', revealOrder); + } + } + } + } + function validateTailOptions(tailMode, revealOrder) { + { + if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) { + if (tailMode !== "collapsed" && tailMode !== "hidden") { + didWarnAboutTailOptions[tailMode] = true; + error('"%s" is not a supported value for tail on . ' + 'Did you mean "collapsed" or "hidden"?', tailMode); + } else if (revealOrder !== "forwards" && revealOrder !== "backwards") { + didWarnAboutTailOptions[tailMode] = true; + error(' is only valid if revealOrder is ' + '"forwards" or "backwards". ' + 'Did you mean to specify revealOrder="forwards"?', tailMode); + } + } + } + } + function validateSuspenseListNestedChild(childSlot, index) { + { + var isAnArray = isArray(childSlot); + var isIterable = !isAnArray && typeof getIteratorFn(childSlot) === "function"; + if (isAnArray || isIterable) { + var type = isAnArray ? "array" : "iterable"; + error("A nested %s was passed to row #%s in . Wrap it in " + "an additional SuspenseList to configure its revealOrder: " + " ... " + "{%s} ... " + "", type, index, type); + return false; + } + } + return true; + } + function validateSuspenseListChildren(children, revealOrder) { + { + if ((revealOrder === "forwards" || revealOrder === "backwards") && children !== undefined && children !== null && children !== false) { + if (isArray(children)) { + for (var i = 0; i < children.length; i++) { + if (!validateSuspenseListNestedChild(children[i], i)) { + return; + } + } + } else { + var iteratorFn = getIteratorFn(children); + if (typeof iteratorFn === "function") { + var childrenIterator = iteratorFn.call(children); + if (childrenIterator) { + var step = childrenIterator.next(); + var _i = 0; + for (; !step.done; step = childrenIterator.next()) { + if (!validateSuspenseListNestedChild(step.value, _i)) { + return; + } + _i++; + } + } + } else { + error('A single row was passed to a . ' + "This is not useful since it needs multiple rows. " + "Did you mean to pass multiple children or an array?", revealOrder); + } + } + } + } + } + function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode) { + var renderState = workInProgress.memoizedState; + if (renderState === null) { + workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + }; + } else { + // We can reuse the existing object from previous renders. + renderState.isBackwards = isBackwards; + renderState.rendering = null; + renderState.renderingStartTime = 0; + renderState.last = lastContentRow; + renderState.tail = tail; + renderState.tailMode = tailMode; + } + } // This can end up rendering this component multiple passes. + // The first pass splits the children fibers into two sets. A head and tail. + // We first render the head. If anything is in fallback state, we do another + // pass through beginWork to rerender all children (including the tail) with + // the force suspend context. If the first render didn't have anything in + // in fallback state. Then we render each row in the tail one-by-one. + // That happens in the completeWork phase without going back to beginWork. + + function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps; + var revealOrder = nextProps.revealOrder; + var tailMode = nextProps.tail; + var newChildren = nextProps.children; + validateRevealOrder(revealOrder); + validateTailOptions(tailMode, revealOrder); + validateSuspenseListChildren(newChildren, revealOrder); + reconcileChildren(current, workInProgress, newChildren, renderLanes); + var suspenseContext = suspenseStackCursor.current; + var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback); + if (shouldForceFallback) { + suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback); + workInProgress.flags |= DidCapture; + } else { + var didSuspendBefore = current !== null && (current.flags & DidCapture) !== NoFlags; + if (didSuspendBefore) { + // If we previously forced a fallback, we need to schedule work + // on any nested boundaries to let them know to try to render + // again. This is the same as context updating. + propagateSuspenseContextChange(workInProgress, workInProgress.child, renderLanes); + } + suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); + } + pushSuspenseContext(workInProgress, suspenseContext); + if ((workInProgress.mode & ConcurrentMode) === NoMode) { + // In legacy mode, SuspenseList doesn't work so we just + // use make it a noop by treating it as the default revealOrder. + workInProgress.memoizedState = null; + } else { + switch (revealOrder) { + case "forwards": + { + var lastContentRow = findLastContentRow(workInProgress.child); + var tail; + if (lastContentRow === null) { + // The whole list is part of the tail. + // TODO: We could fast path by just rendering the tail now. + tail = workInProgress.child; + workInProgress.child = null; + } else { + // Disconnect the tail rows after the content row. + // We're going to render them separately later. + tail = lastContentRow.sibling; + lastContentRow.sibling = null; + } + initSuspenseListRenderState(workInProgress, false, + // isBackwards + tail, lastContentRow, tailMode); + break; + } + case "backwards": + { + // We're going to find the first row that has existing content. + // At the same time we're going to reverse the list of everything + // we pass in the meantime. That's going to be our tail in reverse + // order. + var _tail = null; + var row = workInProgress.child; + workInProgress.child = null; + while (row !== null) { + var currentRow = row.alternate; // New rows can't be content rows. + + if (currentRow !== null && findFirstSuspended(currentRow) === null) { + // This is the beginning of the main content. + workInProgress.child = row; + break; + } + var nextRow = row.sibling; + row.sibling = _tail; + _tail = row; + row = nextRow; + } // TODO: If workInProgress.child is null, we can continue on the tail immediately. + + initSuspenseListRenderState(workInProgress, true, + // isBackwards + _tail, null, + // last + tailMode); + break; + } + case "together": + { + initSuspenseListRenderState(workInProgress, false, + // isBackwards + null, + // tail + null, + // last + undefined); + break; + } + default: + { + // The default reveal order is the same as not having + // a boundary. + workInProgress.memoizedState = null; + } + } + } + return workInProgress.child; + } + function updatePortalComponent(current, workInProgress, renderLanes) { + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + var nextChildren = workInProgress.pendingProps; + if (current === null) { + // Portals are special because we don't append the children during mount + // but at commit. Therefore we need to track insertions which the normal + // flow doesn't do during mount. This doesn't happen at the root because + // the root always starts with a "current" with a null child. + // TODO: Consider unifying this with how the root works. + workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes); + } else { + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + } + return workInProgress.child; + } + var hasWarnedAboutUsingNoValuePropOnContextProvider = false; + function updateContextProvider(current, workInProgress, renderLanes) { + var providerType = workInProgress.type; + var context = providerType._context; + var newProps = workInProgress.pendingProps; + var oldProps = workInProgress.memoizedProps; + var newValue = newProps.value; + { + if (!("value" in newProps)) { + if (!hasWarnedAboutUsingNoValuePropOnContextProvider) { + hasWarnedAboutUsingNoValuePropOnContextProvider = true; + error("The `value` prop is required for the ``. Did you misspell it or forget to pass it?"); + } + } + var providerPropTypes = workInProgress.type.propTypes; + if (providerPropTypes) { + checkPropTypes(providerPropTypes, newProps, "prop", "Context.Provider"); + } + } + pushProvider(workInProgress, context, newValue); + { + if (oldProps !== null) { + var oldValue = oldProps.value; + if (objectIs(oldValue, newValue)) { + // No change. Bailout early if children are the same. + if (oldProps.children === newProps.children && !hasContextChanged()) { + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + } else { + // The context value changed. Search for matching consumers and schedule + // them to update. + propagateContextChange(workInProgress, context, renderLanes); + } + } + } + var newChildren = newProps.children; + reconcileChildren(current, workInProgress, newChildren, renderLanes); + return workInProgress.child; + } + var hasWarnedAboutUsingContextAsConsumer = false; + function updateContextConsumer(current, workInProgress, renderLanes) { + var context = workInProgress.type; // The logic below for Context differs depending on PROD or DEV mode. In + // DEV mode, we create a separate object for Context.Consumer that acts + // like a proxy to Context. This proxy object adds unnecessary code in PROD + // so we use the old behaviour (Context.Consumer references Context) to + // reduce size and overhead. The separate object references context via + // a property called "_context", which also gives us the ability to check + // in DEV mode if this property exists or not and warn if it does not. + + { + if (context._context === undefined) { + // This may be because it's a Context (rather than a Consumer). + // Or it may be because it's older React where they're the same thing. + // We only want to warn if we're sure it's a new React. + if (context !== context.Consumer) { + if (!hasWarnedAboutUsingContextAsConsumer) { + hasWarnedAboutUsingContextAsConsumer = true; + error("Rendering directly is not supported and will be removed in " + "a future major release. Did you mean to render instead?"); + } + } + } else { + context = context._context; + } + } + var newProps = workInProgress.pendingProps; + var render = newProps.children; + { + if (typeof render !== "function") { + error("A context consumer was rendered with multiple children, or a child " + "that isn't a function. A context consumer expects a single child " + "that is a function. If you did pass a function, make sure there " + "is no trailing or leading whitespace around it."); + } + } + prepareToReadContext(workInProgress, renderLanes); + var newValue = _readContext(context); + var newChildren; + { + ReactCurrentOwner$1.current = workInProgress; + setIsRendering(true); + newChildren = render(newValue); + setIsRendering(false); + } + workInProgress.flags |= PerformedWork; + reconcileChildren(current, workInProgress, newChildren, renderLanes); + return workInProgress.child; + } + function markWorkInProgressReceivedUpdate() { + didReceiveUpdate = true; + } + function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + if ((workInProgress.mode & ConcurrentMode) === NoMode) { + if (current !== null) { + // A lazy component only mounts if it suspended inside a non- + // concurrent tree, in an inconsistent state. We want to treat it like + // a new mount, even though an empty version of it already committed. + // Disconnect the alternate pointers. + current.alternate = null; + workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect + + workInProgress.flags |= Placement; + } + } + } + function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { + if (current !== null) { + // Reuse previous dependencies + workInProgress.dependencies = current.dependencies; + } + { + // Don't update "base" render times for bailouts. + stopProfilerTimerIfRunning(); + } + markSkippedUpdateLanes(workInProgress.lanes); // Check if the children have any pending work. + + if (!includesSomeLane(renderLanes, workInProgress.childLanes)) { + // The children don't have any work either. We can skip them. + // TODO: Once we add back resuming, we should check if the children are + // a work-in-progress set. If so, we need to transfer their effects. + { + return null; + } + } // This fiber doesn't have work, but its subtree does. Clone the child + // fibers and continue. + + cloneChildFibers(current, workInProgress); + return workInProgress.child; + } + function remountFiber(current, oldWorkInProgress, newWorkInProgress) { + { + var returnFiber = oldWorkInProgress.return; + if (returnFiber === null) { + // eslint-disable-next-line react-internal/prod-error-codes + throw new Error("Cannot swap the root fiber."); + } // Disconnect from the old current. + // It will get deleted. + + current.alternate = null; + oldWorkInProgress.alternate = null; // Connect to the new tree. + + newWorkInProgress.index = oldWorkInProgress.index; + newWorkInProgress.sibling = oldWorkInProgress.sibling; + newWorkInProgress.return = oldWorkInProgress.return; + newWorkInProgress.ref = oldWorkInProgress.ref; // Replace the child/sibling pointers above it. + + if (oldWorkInProgress === returnFiber.child) { + returnFiber.child = newWorkInProgress; + } else { + var prevSibling = returnFiber.child; + if (prevSibling === null) { + // eslint-disable-next-line react-internal/prod-error-codes + throw new Error("Expected parent to have a child."); + } + while (prevSibling.sibling !== oldWorkInProgress) { + prevSibling = prevSibling.sibling; + if (prevSibling === null) { + // eslint-disable-next-line react-internal/prod-error-codes + throw new Error("Expected to find the previous sibling."); + } + } + prevSibling.sibling = newWorkInProgress; + } // Delete the old fiber and place the new one. + // Since the old fiber is disconnected, we have to schedule it manually. + + var deletions = returnFiber.deletions; + if (deletions === null) { + returnFiber.deletions = [current]; + returnFiber.flags |= ChildDeletion; + } else { + deletions.push(current); + } + newWorkInProgress.flags |= Placement; // Restart work from the new fiber. + + return newWorkInProgress; + } + } + function checkScheduledUpdateOrContext(current, renderLanes) { + // Before performing an early bailout, we must check if there are pending + // updates or context. + var updateLanes = current.lanes; + if (includesSomeLane(updateLanes, renderLanes)) { + return true; + } // No pending update, but because context is propagated lazily, we need + + return false; + } + function attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes) { + // This fiber does not have any pending work. Bailout without entering + // the begin phase. There's still some bookkeeping we that needs to be done + // in this optimized path, mostly pushing stuff onto the stack. + switch (workInProgress.tag) { + case HostRoot: + pushHostRootContext(workInProgress); + var root = workInProgress.stateNode; + break; + case HostComponent: + pushHostContext(workInProgress); + break; + case ClassComponent: + { + var Component = workInProgress.type; + if (isContextProvider(Component)) { + pushContextProvider(workInProgress); + } + break; + } + case HostPortal: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + break; + case ContextProvider: + { + var newValue = workInProgress.memoizedProps.value; + var context = workInProgress.type._context; + pushProvider(workInProgress, context, newValue); + break; + } + case Profiler: + { + // Profiler should only call onRender when one of its descendants actually rendered. + var hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes); + if (hasChildWork) { + workInProgress.flags |= Update; + } + { + // Reset effect durations for the next eventual effect phase. + // These are reset during render to allow the DevTools commit hook a chance to read them, + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = 0; + stateNode.passiveEffectDuration = 0; + } + } + break; + case SuspenseComponent: + { + var state = workInProgress.memoizedState; + if (state !== null) { + if (state.dehydrated !== null) { + pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // We know that this component will suspend again because if it has + // been unsuspended it has committed as a resolved Suspense component. + // If it needs to be retried, it should have work scheduled on it. + + workInProgress.flags |= DidCapture; // We should never render the children of a dehydrated boundary until we + // upgrade it. We return null instead of bailoutOnAlreadyFinishedWork. + + return null; + } // If this boundary is currently timed out, we need to decide + // whether to retry the primary children, or to skip over it and + // go straight to the fallback. Check the priority of the primary + // child fragment. + + var primaryChildFragment = workInProgress.child; + var primaryChildLanes = primaryChildFragment.childLanes; + if (includesSomeLane(renderLanes, primaryChildLanes)) { + // The primary children have pending work. Use the normal path + // to attempt to render the primary children again. + return updateSuspenseComponent(current, workInProgress, renderLanes); + } else { + // The primary child fragment does not have pending work marked + // on it + pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // The primary children do not have pending work with sufficient + // priority. Bailout. + + var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + if (child !== null) { + // The fallback children have pending work. Skip over the + // primary children and work on the fallback. + return child.sibling; + } else { + // Note: We can return `null` here because we already checked + // whether there were nested context consumers, via the call to + // `bailoutOnAlreadyFinishedWork` above. + return null; + } + } + } else { + pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); + } + break; + } + case SuspenseListComponent: + { + var didSuspendBefore = (current.flags & DidCapture) !== NoFlags; + var _hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes); + if (didSuspendBefore) { + if (_hasChildWork) { + // If something was in fallback state last time, and we have all the + // same children then we're still in progressive loading state. + // Something might get unblocked by state updates or retries in the + // tree which will affect the tail. So we need to use the normal + // path to compute the correct tail. + return updateSuspenseListComponent(current, workInProgress, renderLanes); + } // If none of the children had any work, that means that none of + // them got retried so they'll still be blocked in the same way + // as before. We can fast bail out. + + workInProgress.flags |= DidCapture; + } // If nothing suspended before and we're rendering the same children, + // then the tail doesn't matter. Anything new that suspends will work + // in the "together" mode, so we can continue from the state we had. + + var renderState = workInProgress.memoizedState; + if (renderState !== null) { + // Reset to the "together" mode in case we've started a different + // update in the past but didn't complete it. + renderState.rendering = null; + renderState.tail = null; + renderState.lastEffect = null; + } + pushSuspenseContext(workInProgress, suspenseStackCursor.current); + if (_hasChildWork) { + break; + } else { + // If none of the children had any work, that means that none of + // them got retried so they'll still be blocked in the same way + // as before. We can fast bail out. + return null; + } + } + case OffscreenComponent: + case LegacyHiddenComponent: + { + // Need to check if the tree still needs to be deferred. This is + // almost identical to the logic used in the normal update path, + // so we'll just enter that. The only difference is we'll bail out + // at the next level instead of this one, because the child props + // have not changed. Which is fine. + // TODO: Probably should refactor `beginWork` to split the bailout + // path from the normal path. I'm tempted to do a labeled break here + // but I won't :) + workInProgress.lanes = NoLanes; + return updateOffscreenComponent(current, workInProgress, renderLanes); + } + } + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + function beginWork(current, workInProgress, renderLanes) { + { + if (workInProgress._debugNeedsRemount && current !== null) { + // This will restart the begin phase with a new fiber. + return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.lanes)); + } + } + if (current !== null) { + var oldProps = current.memoizedProps; + var newProps = workInProgress.pendingProps; + if (oldProps !== newProps || hasContextChanged() || + // Force a re-render if the implementation changed due to hot reload: + workInProgress.type !== current.type) { + // If props or context changed, mark the fiber as having performed work. + // This may be unset if the props are determined to be equal later (memo). + didReceiveUpdate = true; + } else { + // Neither props nor legacy context changes. Check if there's a pending + // update or context change. + var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current, renderLanes); + if (!hasScheduledUpdateOrContext && + // If this is the second pass of an error or suspense boundary, there + // may not be work scheduled on `current`, so we check for this flag. + (workInProgress.flags & DidCapture) === NoFlags) { + // No pending updates or context. Bail out now. + didReceiveUpdate = false; + return attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes); + } + if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) { + // This is a special case that only exists for legacy mode. + // See https://github.com/facebook/react/pull/19216. + didReceiveUpdate = true; + } else { + // An update was scheduled on this fiber, but there are no new props + // nor legacy context. Set this to false. If an update queue or context + // consumer produces a changed value, it will set this to true. Otherwise, + // the component will assume the children have not changed and bail out. + didReceiveUpdate = false; + } + } + } else { + didReceiveUpdate = false; + } // Before entering the begin phase, clear pending update priority. + // TODO: This assumes that we're about to evaluate the component and process + // the update queue. However, there's an exception: SimpleMemoComponent + // sometimes bails out later in the begin phase. This indicates that we should + // move this assignment out of the common path and into each branch. + + workInProgress.lanes = NoLanes; + switch (workInProgress.tag) { + case IndeterminateComponent: + { + return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderLanes); + } + case LazyComponent: + { + var elementType = workInProgress.elementType; + return mountLazyComponent(current, workInProgress, elementType, renderLanes); + } + case FunctionComponent: + { + var Component = workInProgress.type; + var unresolvedProps = workInProgress.pendingProps; + var resolvedProps = workInProgress.elementType === Component ? unresolvedProps : resolveDefaultProps(Component, unresolvedProps); + return updateFunctionComponent(current, workInProgress, Component, resolvedProps, renderLanes); + } + case ClassComponent: + { + var _Component = workInProgress.type; + var _unresolvedProps = workInProgress.pendingProps; + var _resolvedProps = workInProgress.elementType === _Component ? _unresolvedProps : resolveDefaultProps(_Component, _unresolvedProps); + return updateClassComponent(current, workInProgress, _Component, _resolvedProps, renderLanes); + } + case HostRoot: + return updateHostRoot(current, workInProgress, renderLanes); + case HostComponent: + return updateHostComponent(current, workInProgress, renderLanes); + case HostText: + return updateHostText(); + case SuspenseComponent: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case HostPortal: + return updatePortalComponent(current, workInProgress, renderLanes); + case ForwardRef: + { + var type = workInProgress.type; + var _unresolvedProps2 = workInProgress.pendingProps; + var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2); + return updateForwardRef(current, workInProgress, type, _resolvedProps2, renderLanes); + } + case Fragment: + return updateFragment(current, workInProgress, renderLanes); + case Mode: + return updateMode(current, workInProgress, renderLanes); + case Profiler: + return updateProfiler(current, workInProgress, renderLanes); + case ContextProvider: + return updateContextProvider(current, workInProgress, renderLanes); + case ContextConsumer: + return updateContextConsumer(current, workInProgress, renderLanes); + case MemoComponent: + { + var _type2 = workInProgress.type; + var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props. + + var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3); + { + if (workInProgress.type !== workInProgress.elementType) { + var outerPropTypes = _type2.propTypes; + if (outerPropTypes) { + checkPropTypes(outerPropTypes, _resolvedProps3, + // Resolved for outer only + "prop", getComponentNameFromType(_type2)); + } + } + } + _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3); + return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, renderLanes); + } + case SimpleMemoComponent: + { + return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, renderLanes); + } + case IncompleteClassComponent: + { + var _Component2 = workInProgress.type; + var _unresolvedProps4 = workInProgress.pendingProps; + var _resolvedProps4 = workInProgress.elementType === _Component2 ? _unresolvedProps4 : resolveDefaultProps(_Component2, _unresolvedProps4); + return mountIncompleteClassComponent(current, workInProgress, _Component2, _resolvedProps4, renderLanes); + } + case SuspenseListComponent: + { + return updateSuspenseListComponent(current, workInProgress, renderLanes); + } + case ScopeComponent: + { + break; + } + case OffscreenComponent: + { + return updateOffscreenComponent(current, workInProgress, renderLanes); + } + } + throw new Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in " + "React. Please file an issue."); + } + function markUpdate(workInProgress) { + // Tag the fiber with an update effect. This turns a Placement into + // a PlacementAndUpdate. + workInProgress.flags |= Update; + } + function markRef$1(workInProgress) { + workInProgress.flags |= Ref; + } + function hadNoMutationsEffects(current, completedWork) { + var didBailout = current !== null && current.child === completedWork.child; + if (didBailout) { + return true; + } + if ((completedWork.flags & ChildDeletion) !== NoFlags) { + return false; + } // TODO: If we move the `hadNoMutationsEffects` call after `bubbleProperties` + // then we only have to check the `completedWork.subtreeFlags`. + + var child = completedWork.child; + while (child !== null) { + if ((child.flags & MutationMask) !== NoFlags || (child.subtreeFlags & MutationMask) !== NoFlags) { + return false; + } + child = child.sibling; + } + return true; + } + var _appendAllChildren; + var updateHostContainer; + var updateHostComponent$1; + var updateHostText$1; + { + // Persistent host tree mode + _appendAllChildren = function appendAllChildren(parent, workInProgress, needsVisibilityToggle, isHidden) { + // We only have the top Fiber that was created but we need recurse down its + // children to find all the terminal nodes. + var node = workInProgress.child; + while (node !== null) { + // eslint-disable-next-line no-labels + if (node.tag === HostComponent) { + var instance = node.stateNode; + if (needsVisibilityToggle && isHidden) { + // This child is inside a timed out tree. Hide it. + var props = node.memoizedProps; + var type = node.type; + instance = cloneHiddenInstance(instance); + } + appendInitialChild(parent, instance); + } else if (node.tag === HostText) { + var _instance = node.stateNode; + if (needsVisibilityToggle && isHidden) { + // This child is inside a timed out tree. Hide it. + var text = node.memoizedProps; + _instance = cloneHiddenTextInstance(); + } + appendInitialChild(parent, _instance); + } else if (node.tag === HostPortal) ;else if (node.tag === OffscreenComponent && node.memoizedState !== null) { + // The children in this boundary are hidden. Toggle their visibility + // before appending. + var child = node.child; + if (child !== null) { + child.return = node; + } + _appendAllChildren(parent, node, true, true); + } else if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } // $FlowFixMe This is correct but Flow is confused by the labeled break. + + node = node; + if (node === workInProgress) { + return; + } + while (node.sibling === null) { + if (node.return === null || node.return === workInProgress) { + return; + } + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + }; // An unfortunate fork of appendAllChildren because we have two different parent types. + + var _appendAllChildrenToContainer = function appendAllChildrenToContainer(containerChildSet, workInProgress, needsVisibilityToggle, isHidden) { + // We only have the top Fiber that was created but we need recurse down its + // children to find all the terminal nodes. + var node = workInProgress.child; + while (node !== null) { + // eslint-disable-next-line no-labels + if (node.tag === HostComponent) { + var instance = node.stateNode; + if (needsVisibilityToggle && isHidden) { + // This child is inside a timed out tree. Hide it. + var props = node.memoizedProps; + var type = node.type; + instance = cloneHiddenInstance(instance); + } + appendChildToContainerChildSet(containerChildSet, instance); + } else if (node.tag === HostText) { + var _instance2 = node.stateNode; + if (needsVisibilityToggle && isHidden) { + // This child is inside a timed out tree. Hide it. + var text = node.memoizedProps; + _instance2 = cloneHiddenTextInstance(); + } + appendChildToContainerChildSet(containerChildSet, _instance2); + } else if (node.tag === HostPortal) ;else if (node.tag === OffscreenComponent && node.memoizedState !== null) { + // The children in this boundary are hidden. Toggle their visibility + // before appending. + var child = node.child; + if (child !== null) { + child.return = node; + } + _appendAllChildrenToContainer(containerChildSet, node, true, true); + } else if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } // $FlowFixMe This is correct but Flow is confused by the labeled break. + + node = node; + if (node === workInProgress) { + return; + } + while (node.sibling === null) { + if (node.return === null || node.return === workInProgress) { + return; + } + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + }; + updateHostContainer = function updateHostContainer(current, workInProgress) { + var portalOrRoot = workInProgress.stateNode; + var childrenUnchanged = hadNoMutationsEffects(current, workInProgress); + if (childrenUnchanged) ;else { + var container = portalOrRoot.containerInfo; + var newChildSet = createContainerChildSet(container); // If children might have changed, we have to add them all to the set. + + _appendAllChildrenToContainer(newChildSet, workInProgress, false, false); + portalOrRoot.pendingChildren = newChildSet; // Schedule an update on the container to swap out the container. + + markUpdate(workInProgress); + finalizeContainerChildren(container, newChildSet); + } + }; + updateHostComponent$1 = function updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance) { + var currentInstance = current.stateNode; + var oldProps = current.memoizedProps; // If there are no effects associated with this node, then none of our children had any updates. + // This guarantees that we can reuse all of them. + + var childrenUnchanged = hadNoMutationsEffects(current, workInProgress); + if (childrenUnchanged && oldProps === newProps) { + // No changes, just reuse the existing instance. + // Note that this might release a previous clone. + workInProgress.stateNode = currentInstance; + return; + } + var recyclableInstance = workInProgress.stateNode; + var currentHostContext = getHostContext(); + var updatePayload = null; + if (oldProps !== newProps) { + updatePayload = prepareUpdate(recyclableInstance, type, oldProps, newProps); + } + if (childrenUnchanged && updatePayload === null) { + // No changes, just reuse the existing instance. + // Note that this might release a previous clone. + workInProgress.stateNode = currentInstance; + return; + } + var newInstance = cloneInstance(currentInstance, updatePayload, type, oldProps, newProps, workInProgress, childrenUnchanged); + workInProgress.stateNode = newInstance; + if (childrenUnchanged) { + // If there are no other effects in this tree, we need to flag this node as having one. + // Even though we're not going to use it for anything. + // Otherwise parents won't know that there are new children to propagate upwards. + markUpdate(workInProgress); + } else { + // If children might have changed, we have to add them all to the set. + _appendAllChildren(newInstance, workInProgress, false, false); + } + }; + updateHostText$1 = function updateHostText$1(current, workInProgress, oldText, newText) { + if (oldText !== newText) { + // If the text content differs, we'll create a new text instance for it. + var rootContainerInstance = getRootHostContainer(); + var currentHostContext = getHostContext(); + workInProgress.stateNode = createTextInstance(newText, rootContainerInstance, currentHostContext, workInProgress); // We'll have to mark it as having an effect, even though we won't use the effect for anything. + // This lets the parents know that at least one of their children has changed. + + markUpdate(workInProgress); + } else { + workInProgress.stateNode = current.stateNode; + } + }; + } + function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { + switch (renderState.tailMode) { + case "hidden": + { + // Any insertions at the end of the tail list after this point + // should be invisible. If there are already mounted boundaries + // anything before them are not considered for collapsing. + // Therefore we need to go through the whole tail to find if + // there are any. + var tailNode = renderState.tail; + var lastTailNode = null; + while (tailNode !== null) { + if (tailNode.alternate !== null) { + lastTailNode = tailNode; + } + tailNode = tailNode.sibling; + } // Next we're simply going to delete all insertions after the + // last rendered item. + + if (lastTailNode === null) { + // All remaining items in the tail are insertions. + renderState.tail = null; + } else { + // Detach the insertion after the last node that was already + // inserted. + lastTailNode.sibling = null; + } + break; + } + case "collapsed": + { + // Any insertions at the end of the tail list after this point + // should be invisible. If there are already mounted boundaries + // anything before them are not considered for collapsing. + // Therefore we need to go through the whole tail to find if + // there are any. + var _tailNode = renderState.tail; + var _lastTailNode = null; + while (_tailNode !== null) { + if (_tailNode.alternate !== null) { + _lastTailNode = _tailNode; + } + _tailNode = _tailNode.sibling; + } // Next we're simply going to delete all insertions after the + // last rendered item. + + if (_lastTailNode === null) { + // All remaining items in the tail are insertions. + if (!hasRenderedATailFallback && renderState.tail !== null) { + // We suspended during the head. We want to show at least one + // row at the tail. So we'll keep on and cut off the rest. + renderState.tail.sibling = null; + } else { + renderState.tail = null; + } + } else { + // Detach the insertion after the last node that was already + // inserted. + _lastTailNode.sibling = null; + } + break; + } + } + } + function bubbleProperties(completedWork) { + var didBailout = completedWork.alternate !== null && completedWork.alternate.child === completedWork.child; + var newChildLanes = NoLanes; + var subtreeFlags = NoFlags; + if (!didBailout) { + // Bubble up the earliest expiration time. + if ((completedWork.mode & ProfileMode) !== NoMode) { + // In profiling mode, resetChildExpirationTime is also used to reset + // profiler durations. + var actualDuration = completedWork.actualDuration; + var treeBaseDuration = completedWork.selfBaseDuration; + var child = completedWork.child; + while (child !== null) { + newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes)); + subtreeFlags |= child.subtreeFlags; + subtreeFlags |= child.flags; // When a fiber is cloned, its actualDuration is reset to 0. This value will + // only be updated if work is done on the fiber (i.e. it doesn't bailout). + // When work is done, it should bubble to the parent's actualDuration. If + // the fiber has not been cloned though, (meaning no work was done), then + // this value will reflect the amount of time spent working on a previous + // render. In that case it should not bubble. We determine whether it was + // cloned by comparing the child pointer. + + actualDuration += child.actualDuration; + treeBaseDuration += child.treeBaseDuration; + child = child.sibling; + } + completedWork.actualDuration = actualDuration; + completedWork.treeBaseDuration = treeBaseDuration; + } else { + var _child = completedWork.child; + while (_child !== null) { + newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes)); + subtreeFlags |= _child.subtreeFlags; + subtreeFlags |= _child.flags; // Update the return pointer so the tree is consistent. This is a code + // smell because it assumes the commit phase is never concurrent with + // the render phase. Will address during refactor to alternate model. + + _child.return = completedWork; + _child = _child.sibling; + } + } + completedWork.subtreeFlags |= subtreeFlags; + } else { + // Bubble up the earliest expiration time. + if ((completedWork.mode & ProfileMode) !== NoMode) { + // In profiling mode, resetChildExpirationTime is also used to reset + // profiler durations. + var _treeBaseDuration = completedWork.selfBaseDuration; + var _child2 = completedWork.child; + while (_child2 !== null) { + newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child2.lanes, _child2.childLanes)); // "Static" flags share the lifetime of the fiber/hook they belong to, + // so we should bubble those up even during a bailout. All the other + // flags have a lifetime only of a single render + commit, so we should + // ignore them. + + subtreeFlags |= _child2.subtreeFlags & StaticMask; + subtreeFlags |= _child2.flags & StaticMask; + _treeBaseDuration += _child2.treeBaseDuration; + _child2 = _child2.sibling; + } + completedWork.treeBaseDuration = _treeBaseDuration; + } else { + var _child3 = completedWork.child; + while (_child3 !== null) { + newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child3.lanes, _child3.childLanes)); // "Static" flags share the lifetime of the fiber/hook they belong to, + // so we should bubble those up even during a bailout. All the other + // flags have a lifetime only of a single render + commit, so we should + // ignore them. + + subtreeFlags |= _child3.subtreeFlags & StaticMask; + subtreeFlags |= _child3.flags & StaticMask; // Update the return pointer so the tree is consistent. This is a code + // smell because it assumes the commit phase is never concurrent with + // the render phase. Will address during refactor to alternate model. + + _child3.return = completedWork; + _child3 = _child3.sibling; + } + } + completedWork.subtreeFlags |= subtreeFlags; + } + completedWork.childLanes = newChildLanes; + return didBailout; + } + function completeDehydratedSuspenseBoundary(current, workInProgress, nextState) { + var wasHydrated = popHydrationState(); + if (nextState !== null && nextState.dehydrated !== null) { + // We might be inside a hydration state the first time we're picking up this + // Suspense boundary, and also after we've reentered it for further hydration. + if (current === null) { + if (!wasHydrated) { + throw new Error("A dehydrated suspense component was completed without a hydrated node. " + "This is probably a bug in React."); + } + prepareToHydrateHostSuspenseInstance(); + bubbleProperties(workInProgress); + { + if ((workInProgress.mode & ProfileMode) !== NoMode) { + var isTimedOutSuspense = nextState !== null; + if (isTimedOutSuspense) { + // Don't count time spent in a timed out Suspense subtree as part of the base duration. + var primaryChildFragment = workInProgress.child; + if (primaryChildFragment !== null) { + // $FlowFixMe Flow doesn't support type casting in combination with the -= operator + workInProgress.treeBaseDuration -= primaryChildFragment.treeBaseDuration; + } + } + } + } + return false; + } else { + if ((workInProgress.flags & DidCapture) === NoFlags) { + // This boundary did not suspend so it's now hydrated and unsuspended. + workInProgress.memoizedState = null; + } // If nothing suspended, we need to schedule an effect to mark this boundary + // as having hydrated so events know that they're free to be invoked. + // It's also a signal to replay events and the suspense callback. + // If something suspended, schedule an effect to attach retry listeners. + // So we might as well always mark this. + + workInProgress.flags |= Update; + bubbleProperties(workInProgress); + { + if ((workInProgress.mode & ProfileMode) !== NoMode) { + var _isTimedOutSuspense = nextState !== null; + if (_isTimedOutSuspense) { + // Don't count time spent in a timed out Suspense subtree as part of the base duration. + var _primaryChildFragment = workInProgress.child; + if (_primaryChildFragment !== null) { + // $FlowFixMe Flow doesn't support type casting in combination with the -= operator + workInProgress.treeBaseDuration -= _primaryChildFragment.treeBaseDuration; + } + } + } + } + return false; + } + } else { + // Successfully completed this tree. If this was a forced client render, + // there may have been recoverable errors during first hydration + // attempt. If so, add them to a queue so we can log them in the + // commit phase. + upgradeHydrationErrorsToRecoverable(); // Fall through to normal Suspense path + + return true; + } + } + function completeWork(current, workInProgress, renderLanes) { + var newProps = workInProgress.pendingProps; // Note: This intentionally doesn't check if we're hydrating because comparing + // to the current tree provider fiber is just as fast and less error-prone. + // Ideally we would have a special version of the work loop only + // for hydration. + + popTreeContext(workInProgress); + switch (workInProgress.tag) { + case IndeterminateComponent: + case LazyComponent: + case SimpleMemoComponent: + case FunctionComponent: + case ForwardRef: + case Fragment: + case Mode: + case Profiler: + case ContextConsumer: + case MemoComponent: + bubbleProperties(workInProgress); + return null; + case ClassComponent: + { + var Component = workInProgress.type; + if (isContextProvider(Component)) { + popContext(workInProgress); + } + bubbleProperties(workInProgress); + return null; + } + case HostRoot: + { + var fiberRoot = workInProgress.stateNode; + popHostContainer(workInProgress); + popTopLevelContextObject(workInProgress); + resetWorkInProgressVersions(); + if (fiberRoot.pendingContext) { + fiberRoot.context = fiberRoot.pendingContext; + fiberRoot.pendingContext = null; + } + if (current === null || current.child === null) { + // If we hydrated, pop so that we can delete any remaining children + // that weren't hydrated. + var wasHydrated = popHydrationState(); + if (wasHydrated) { + // If we hydrated, then we'll need to schedule an update for + // the commit side-effects on the root. + markUpdate(workInProgress); + } else { + if (current !== null) { + var prevState = current.memoizedState; + if ( + // Check if this is a client root + !prevState.isDehydrated || + // Check if we reverted to client rendering (e.g. due to an error) + (workInProgress.flags & ForceClientRender) !== NoFlags) { + // Schedule an effect to clear this container at the start of the + // next commit. This handles the case of React rendering into a + // container with previous children. It's also safe to do for + // updates too, because current.child would only be null if the + // previous render was null (so the container would already + // be empty). + workInProgress.flags |= Snapshot; // If this was a forced client render, there may have been + // recoverable errors during first hydration attempt. If so, add + // them to a queue so we can log them in the commit phase. + + upgradeHydrationErrorsToRecoverable(); + } + } + } + } + updateHostContainer(current, workInProgress); + bubbleProperties(workInProgress); + return null; + } + case HostComponent: + { + popHostContext(workInProgress); + var rootContainerInstance = getRootHostContainer(); + var type = workInProgress.type; + if (current !== null && workInProgress.stateNode != null) { + updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance); + if (current.ref !== workInProgress.ref) { + markRef$1(workInProgress); + } + } else { + if (!newProps) { + if (workInProgress.stateNode === null) { + throw new Error("We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."); + } // This can happen when we abort work. + + bubbleProperties(workInProgress); + return null; + } + var currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context + // "stack" as the parent. Then append children as we go in beginWork + // or completeWork depending on whether we want to add them top->down or + // bottom->up. Top->down is faster in IE11. + + var _wasHydrated = popHydrationState(); + if (_wasHydrated) { + // TODO: Move this and createInstance step into the beginPhase + // to consolidate. + if (prepareToHydrateHostInstance()) { + // If changes to the hydrated node need to be applied at the + // commit-phase we mark this as such. + markUpdate(workInProgress); + } + } else { + var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress); + _appendAllChildren(instance, workInProgress, false, false); + workInProgress.stateNode = instance; // Certain renderers require commit-time effects for initial mount. + } + if (workInProgress.ref !== null) { + // If there is a ref on a host node we need to schedule a callback + markRef$1(workInProgress); + } + } + bubbleProperties(workInProgress); + return null; + } + case HostText: + { + var newText = newProps; + if (current && workInProgress.stateNode != null) { + var oldText = current.memoizedProps; // If we have an alternate, that means this is an update and we need + // to schedule a side-effect to do the updates. + + updateHostText$1(current, workInProgress, oldText, newText); + } else { + if (typeof newText !== "string") { + if (workInProgress.stateNode === null) { + throw new Error("We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."); + } // This can happen when we abort work. + } + var _rootContainerInstance = getRootHostContainer(); + var _currentHostContext = getHostContext(); + var _wasHydrated2 = popHydrationState(); + if (_wasHydrated2) { + if (prepareToHydrateHostTextInstance()) { + markUpdate(workInProgress); + } + } else { + workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress); + } + } + bubbleProperties(workInProgress); + return null; + } + case SuspenseComponent: + { + popSuspenseContext(workInProgress); + var nextState = workInProgress.memoizedState; // Special path for dehydrated boundaries. We may eventually move this + // to its own fiber type so that we can add other kinds of hydration + // boundaries that aren't associated with a Suspense tree. In anticipation + // of such a refactor, all the hydration logic is contained in + // this branch. + + if (current === null || current.memoizedState !== null && current.memoizedState.dehydrated !== null) { + var fallthroughToNormalSuspensePath = completeDehydratedSuspenseBoundary(current, workInProgress, nextState); + if (!fallthroughToNormalSuspensePath) { + if (workInProgress.flags & ShouldCapture) { + // Special case. There were remaining unhydrated nodes. We treat + // this as a mismatch. Revert to client rendering. + return workInProgress; + } else { + // Did not finish hydrating, either because this is the initial + // render or because something suspended. + return null; + } + } // Continue with the normal Suspense path. + } + if ((workInProgress.flags & DidCapture) !== NoFlags) { + // Something suspended. Re-render with the fallback children. + workInProgress.lanes = renderLanes; // Do not reset the effect list. + + if ((workInProgress.mode & ProfileMode) !== NoMode) { + transferActualDuration(workInProgress); + } // Don't bubble properties in this case. + + return workInProgress; + } + var nextDidTimeout = nextState !== null; + var prevDidTimeout = current !== null && current.memoizedState !== null; + // a passive effect, which is when we process the transitions + + if (nextDidTimeout !== prevDidTimeout) { + // an effect to toggle the subtree's visibility. When we switch from + // fallback -> primary, the inner Offscreen fiber schedules this effect + // as part of its normal complete phase. But when we switch from + // primary -> fallback, the inner Offscreen fiber does not have a complete + // phase. So we need to schedule its effect here. + // + // We also use this flag to connect/disconnect the effects, but the same + // logic applies: when re-connecting, the Offscreen fiber's complete + // phase will handle scheduling the effect. It's only when the fallback + // is active that we have to do anything special. + + if (nextDidTimeout) { + var _offscreenFiber2 = workInProgress.child; + _offscreenFiber2.flags |= Visibility; // TODO: This will still suspend a synchronous tree if anything + // in the concurrent tree already suspended during this render. + // This is a known bug. + + if ((workInProgress.mode & ConcurrentMode) !== NoMode) { + // TODO: Move this back to throwException because this is too late + // if this is a large tree which is common for initial loads. We + // don't know if we should restart a render or not until we get + // this marker, and this is too late. + // If this render already had a ping or lower pri updates, + // and this is the first time we know we're going to suspend we + // should be able to immediately restart from within throwException. + var hasInvisibleChildContext = current === null && (workInProgress.memoizedProps.unstable_avoidThisFallback !== true || !enableSuspenseAvoidThisFallback); + if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) { + // If this was in an invisible tree or a new render, then showing + // this boundary is ok. + renderDidSuspend(); + } else { + // Otherwise, we're going to have to hide content so we should + // suspend for longer if possible. + renderDidSuspendDelayIfPossible(); + } + } + } + } + var wakeables = workInProgress.updateQueue; + if (wakeables !== null) { + // Schedule an effect to attach a retry listener to the promise. + // TODO: Move to passive phase + workInProgress.flags |= Update; + } + bubbleProperties(workInProgress); + { + if ((workInProgress.mode & ProfileMode) !== NoMode) { + if (nextDidTimeout) { + // Don't count time spent in a timed out Suspense subtree as part of the base duration. + var primaryChildFragment = workInProgress.child; + if (primaryChildFragment !== null) { + // $FlowFixMe Flow doesn't support type casting in combination with the -= operator + workInProgress.treeBaseDuration -= primaryChildFragment.treeBaseDuration; + } + } + } + } + return null; + } + case HostPortal: + popHostContainer(workInProgress); + updateHostContainer(current, workInProgress); + if (current === null) { + preparePortalMount(workInProgress.stateNode.containerInfo); + } + bubbleProperties(workInProgress); + return null; + case ContextProvider: + // Pop provider fiber + var context = workInProgress.type._context; + popProvider(context, workInProgress); + bubbleProperties(workInProgress); + return null; + case IncompleteClassComponent: + { + // Same as class component case. I put it down here so that the tags are + // sequential to ensure this switch is compiled to a jump table. + var _Component = workInProgress.type; + if (isContextProvider(_Component)) { + popContext(workInProgress); + } + bubbleProperties(workInProgress); + return null; + } + case SuspenseListComponent: + { + popSuspenseContext(workInProgress); + var renderState = workInProgress.memoizedState; + if (renderState === null) { + // We're running in the default, "independent" mode. + // We don't do anything in this mode. + bubbleProperties(workInProgress); + return null; + } + var didSuspendAlready = (workInProgress.flags & DidCapture) !== NoFlags; + var renderedTail = renderState.rendering; + if (renderedTail === null) { + // We just rendered the head. + if (!didSuspendAlready) { + // This is the first pass. We need to figure out if anything is still + // suspended in the rendered set. + // If new content unsuspended, but there's still some content that + // didn't. Then we need to do a second pass that forces everything + // to keep showing their fallbacks. + // We might be suspended if something in this render pass suspended, or + // something in the previous committed pass suspended. Otherwise, + // there's no chance so we can skip the expensive call to + // findFirstSuspended. + var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.flags & DidCapture) === NoFlags); + if (!cannotBeSuspended) { + var row = workInProgress.child; + while (row !== null) { + var suspended = findFirstSuspended(row); + if (suspended !== null) { + didSuspendAlready = true; + workInProgress.flags |= DidCapture; + cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as + // part of the second pass. In that case nothing will subscribe to + // its thenables. Instead, we'll transfer its thenables to the + // SuspenseList so that it can retry if they resolve. + // There might be multiple of these in the list but since we're + // going to wait for all of them anyway, it doesn't really matter + // which ones gets to ping. In theory we could get clever and keep + // track of how many dependencies remain but it gets tricky because + // in the meantime, we can add/remove/change items and dependencies. + // We might bail out of the loop before finding any but that + // doesn't matter since that means that the other boundaries that + // we did find already has their listeners attached. + + var newThenables = suspended.updateQueue; + if (newThenables !== null) { + workInProgress.updateQueue = newThenables; + workInProgress.flags |= Update; + } // Rerender the whole list, but this time, we'll force fallbacks + // to stay in place. + // Reset the effect flags before doing the second pass since that's now invalid. + // Reset the child fibers to their original state. + + workInProgress.subtreeFlags = NoFlags; + resetChildFibers(workInProgress, renderLanes); // Set up the Suspense Context to force suspense and immediately + // rerender the children. + + pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback)); // Don't bubble properties in this case. + + return workInProgress.child; + } + row = row.sibling; + } + } + if (renderState.tail !== null && now() > getRenderTargetTime()) { + // We have already passed our CPU deadline but we still have rows + // left in the tail. We'll just give up further attempts to render + // the main content and only render fallbacks. + workInProgress.flags |= DidCapture; + didSuspendAlready = true; + cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this + // to get it started back up to attempt the next item. While in terms + // of priority this work has the same priority as this current render, + // it's not part of the same transition once the transition has + // committed. If it's sync, we still want to yield so that it can be + // painted. Conceptually, this is really the same as pinging. + // We can use any RetryLane even if it's the one currently rendering + // since we're leaving it behind on this node. + + workInProgress.lanes = SomeRetryLane; + } + } else { + cutOffTailIfNeeded(renderState, false); + } // Next we're going to render the tail. + } else { + // Append the rendered row to the child list. + if (!didSuspendAlready) { + var _suspended = findFirstSuspended(renderedTail); + if (_suspended !== null) { + workInProgress.flags |= DidCapture; + didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't + // get lost if this row ends up dropped during a second pass. + + var _newThenables = _suspended.updateQueue; + if (_newThenables !== null) { + workInProgress.updateQueue = _newThenables; + workInProgress.flags |= Update; + } + cutOffTailIfNeeded(renderState, true); // This might have been modified. + + if (renderState.tail === null && renderState.tailMode === "hidden" && !renderedTail.alternate && !getIsHydrating() // We don't cut it if we're hydrating. + ) { + // We're done. + bubbleProperties(workInProgress); + return null; + } + } else if ( + // The time it took to render last row is greater than the remaining + // time we have to render. So rendering one more row would likely + // exceed it. + now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes !== OffscreenLane) { + // We have now passed our CPU deadline and we'll just give up further + // attempts to render the main content and only render fallbacks. + // The assumption is that this is usually faster. + workInProgress.flags |= DidCapture; + didSuspendAlready = true; + cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this + // to get it started back up to attempt the next item. While in terms + // of priority this work has the same priority as this current render, + // it's not part of the same transition once the transition has + // committed. If it's sync, we still want to yield so that it can be + // painted. Conceptually, this is really the same as pinging. + // We can use any RetryLane even if it's the one currently rendering + // since we're leaving it behind on this node. + + workInProgress.lanes = SomeRetryLane; + } + } + if (renderState.isBackwards) { + // The effect list of the backwards tail will have been added + // to the end. This breaks the guarantee that life-cycles fire in + // sibling order but that isn't a strong guarantee promised by React. + // Especially since these might also just pop in during future commits. + // Append to the beginning of the list. + renderedTail.sibling = workInProgress.child; + workInProgress.child = renderedTail; + } else { + var previousSibling = renderState.last; + if (previousSibling !== null) { + previousSibling.sibling = renderedTail; + } else { + workInProgress.child = renderedTail; + } + renderState.last = renderedTail; + } + } + if (renderState.tail !== null) { + // We still have tail rows to render. + // Pop a row. + var next = renderState.tail; + renderState.rendering = next; + renderState.tail = next.sibling; + renderState.renderingStartTime = now(); + next.sibling = null; // Restore the context. + // TODO: We can probably just avoid popping it instead and only + // setting it the first time we go from not suspended to suspended. + + var suspenseContext = suspenseStackCursor.current; + if (didSuspendAlready) { + suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback); + } else { + suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); + } + pushSuspenseContext(workInProgress, suspenseContext); // Do a pass over the next row. + // Don't bubble properties in this case. + + return next; + } + bubbleProperties(workInProgress); + return null; + } + case ScopeComponent: + { + break; + } + case OffscreenComponent: + case LegacyHiddenComponent: + { + popRenderLanes(workInProgress); + var _nextState = workInProgress.memoizedState; + var nextIsHidden = _nextState !== null; + if (current !== null) { + var _prevState = current.memoizedState; + var prevIsHidden = _prevState !== null; + if (prevIsHidden !== nextIsHidden && + // LegacyHidden doesn't do any hiding — it only pre-renders. + !enableLegacyHidden) { + workInProgress.flags |= Visibility; + } + } + if (!nextIsHidden || (workInProgress.mode & ConcurrentMode) === NoMode) { + bubbleProperties(workInProgress); + } else { + // Don't bubble properties for hidden children unless we're rendering + // at offscreen priority. + if (includesSomeLane(subtreeRenderLanes, OffscreenLane)) { + bubbleProperties(workInProgress); + } + } + return null; + } + case CacheComponent: + { + return null; + } + case TracingMarkerComponent: + { + return null; + } + } + throw new Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in " + "React. Please file an issue."); + } + function unwindWork(current, workInProgress, renderLanes) { + // Note: This intentionally doesn't check if we're hydrating because comparing + // to the current tree provider fiber is just as fast and less error-prone. + // Ideally we would have a special version of the work loop only + // for hydration. + popTreeContext(workInProgress); + switch (workInProgress.tag) { + case ClassComponent: + { + var Component = workInProgress.type; + if (isContextProvider(Component)) { + popContext(workInProgress); + } + var flags = workInProgress.flags; + if (flags & ShouldCapture) { + workInProgress.flags = flags & ~ShouldCapture | DidCapture; + if ((workInProgress.mode & ProfileMode) !== NoMode) { + transferActualDuration(workInProgress); + } + return workInProgress; + } + return null; + } + case HostRoot: + { + var root = workInProgress.stateNode; + popHostContainer(workInProgress); + popTopLevelContextObject(workInProgress); + resetWorkInProgressVersions(); + var _flags = workInProgress.flags; + if ((_flags & ShouldCapture) !== NoFlags && (_flags & DidCapture) === NoFlags) { + // There was an error during render that wasn't captured by a suspense + // boundary. Do a second pass on the root to unmount the children. + workInProgress.flags = _flags & ~ShouldCapture | DidCapture; + return workInProgress; + } // We unwound to the root without completing it. Exit. + + return null; + } + case HostComponent: + { + // TODO: popHydrationState + popHostContext(workInProgress); + return null; + } + case SuspenseComponent: + { + popSuspenseContext(workInProgress); + var suspenseState = workInProgress.memoizedState; + if (suspenseState !== null && suspenseState.dehydrated !== null) { + if (workInProgress.alternate === null) { + throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in " + "React. Please file an issue."); + } + } + var _flags2 = workInProgress.flags; + if (_flags2 & ShouldCapture) { + workInProgress.flags = _flags2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary. + + if ((workInProgress.mode & ProfileMode) !== NoMode) { + transferActualDuration(workInProgress); + } + return workInProgress; + } + return null; + } + case SuspenseListComponent: + { + popSuspenseContext(workInProgress); // SuspenseList doesn't actually catch anything. It should've been + // caught by a nested boundary. If not, it should bubble through. + + return null; + } + case HostPortal: + popHostContainer(workInProgress); + return null; + case ContextProvider: + var context = workInProgress.type._context; + popProvider(context, workInProgress); + return null; + case OffscreenComponent: + case LegacyHiddenComponent: + popRenderLanes(workInProgress); + return null; + case CacheComponent: + return null; + default: + return null; + } + } + function unwindInterruptedWork(current, interruptedWork, renderLanes) { + // Note: This intentionally doesn't check if we're hydrating because comparing + // to the current tree provider fiber is just as fast and less error-prone. + // Ideally we would have a special version of the work loop only + // for hydration. + popTreeContext(interruptedWork); + switch (interruptedWork.tag) { + case ClassComponent: + { + var childContextTypes = interruptedWork.type.childContextTypes; + if (childContextTypes !== null && childContextTypes !== undefined) { + popContext(interruptedWork); + } + break; + } + case HostRoot: + { + var root = interruptedWork.stateNode; + popHostContainer(interruptedWork); + popTopLevelContextObject(interruptedWork); + resetWorkInProgressVersions(); + break; + } + case HostComponent: + { + popHostContext(interruptedWork); + break; + } + case HostPortal: + popHostContainer(interruptedWork); + break; + case SuspenseComponent: + popSuspenseContext(interruptedWork); + break; + case SuspenseListComponent: + popSuspenseContext(interruptedWork); + break; + case ContextProvider: + var context = interruptedWork.type._context; + popProvider(context, interruptedWork); + break; + case OffscreenComponent: + case LegacyHiddenComponent: + popRenderLanes(interruptedWork); + break; + } + } + var didWarnAboutUndefinedSnapshotBeforeUpdate = null; + { + didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); + } // Used during the commit phase to track the state of the Offscreen component stack. + var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set; + var nextEffect = null; // Used for Profiling builds to track updaters. + + var inProgressLanes = null; + var inProgressRoot = null; + function reportUncaughtErrorInDEV(error) { + // Wrapping each small part of the commit phase into a guarded + // callback is a bit too slow (https://github.com/facebook/react/pull/21666). + // But we rely on it to surface errors to DEV tools like overlays + // (https://github.com/facebook/react/issues/21712). + // As a compromise, rethrow only caught errors in a guard. + { + invokeGuardedCallback(null, function () { + throw error; + }); + clearCaughtError(); + } + } + var callComponentWillUnmountWithTimer = function callComponentWillUnmountWithTimer(current, instance) { + instance.props = current.memoizedProps; + instance.state = current.memoizedState; + if (current.mode & ProfileMode) { + try { + startLayoutEffectTimer(); + instance.componentWillUnmount(); + } finally { + recordLayoutEffectDuration(current); + } + } else { + instance.componentWillUnmount(); + } + }; // Capture errors so they don't interrupt mounting. + + function safelyCallComponentWillUnmount(current, nearestMountedAncestor, instance) { + try { + callComponentWillUnmountWithTimer(current, instance); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } // Capture errors so they don't interrupt mounting. + + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref; + if (ref !== null) { + if (typeof ref === "function") { + var retVal; + try { + if (enableProfilerTimer && enableProfilerCommitHooks && current.mode & ProfileMode) { + try { + startLayoutEffectTimer(); + retVal = ref(null); + } finally { + recordLayoutEffectDuration(current); + } + } else { + retVal = ref(null); + } + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + { + if (typeof retVal === "function") { + error("Unexpected return value from a callback ref in %s. " + "A callback ref should not return a function.", getComponentNameFromFiber(current)); + } + } + } else { + ref.current = null; + } + } + } + function safelyCallDestroy(current, nearestMountedAncestor, destroy) { + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + var focusedInstanceHandle = null; + var shouldFireAfterActiveInstanceBlur = false; + function commitBeforeMutationEffects(root, firstChild) { + focusedInstanceHandle = prepareForCommit(root.containerInfo); + nextEffect = firstChild; + commitBeforeMutationEffects_begin(); // We no longer need to track the active instance fiber + + var shouldFire = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = false; + focusedInstanceHandle = null; + return shouldFire; + } + function commitBeforeMutationEffects_begin() { + while (nextEffect !== null) { + var fiber = nextEffect; // This phase is only used for beforeActiveInstanceBlur. + + var child = fiber.child; + if ((fiber.subtreeFlags & BeforeMutationMask) !== NoFlags && child !== null) { + child.return = fiber; + nextEffect = child; + } else { + commitBeforeMutationEffects_complete(); + } + } + } + function commitBeforeMutationEffects_complete() { + while (nextEffect !== null) { + var fiber = nextEffect; + setCurrentFiber(fiber); + try { + commitBeforeMutationEffectsOnFiber(fiber); + } catch (error) { + captureCommitPhaseError(fiber, fiber.return, error); + } + resetCurrentFiber(); + var sibling = fiber.sibling; + if (sibling !== null) { + sibling.return = fiber.return; + nextEffect = sibling; + return; + } + nextEffect = fiber.return; + } + } + function commitBeforeMutationEffectsOnFiber(finishedWork) { + var current = finishedWork.alternate; + var flags = finishedWork.flags; + if ((flags & Snapshot) !== NoFlags) { + setCurrentFiber(finishedWork); + switch (finishedWork.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + { + break; + } + case ClassComponent: + { + if (current !== null) { + var prevProps = current.memoizedProps; + var prevState = current.memoizedState; + var instance = finishedWork.stateNode; // We could update instance props and state here, + // but instead we rely on them being set during last render. + // TODO: revisit this when we implement resuming. + + { + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + if (instance.props !== finishedWork.memoizedProps) { + error("Expected %s props to match memoized props before " + "getSnapshotBeforeUpdate. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.props`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + if (instance.state !== finishedWork.memoizedState) { + error("Expected %s state to match memoized state before " + "getSnapshotBeforeUpdate. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.state`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + } + } + var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState); + { + var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate; + if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) { + didWarnSet.add(finishedWork.type); + error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) " + "must be returned. You have returned undefined.", getComponentNameFromFiber(finishedWork)); + } + } + instance.__reactInternalSnapshotBeforeUpdate = snapshot; + } + break; + } + case HostRoot: + { + break; + } + case HostComponent: + case HostText: + case HostPortal: + case IncompleteClassComponent: + // Nothing to do for these component types + break; + default: + { + throw new 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."); + } + } + resetCurrentFiber(); + } + } + function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) { + var updateQueue = finishedWork.updateQueue; + var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null; + if (lastEffect !== null) { + var firstEffect = lastEffect.next; + var effect = firstEffect; + do { + if ((effect.tag & flags) === flags) { + // Unmount + var destroy = effect.destroy; + effect.destroy = undefined; + if (destroy !== undefined) { + { + if ((flags & Insertion) !== NoFlags$1) { + setIsRunningInsertionEffect(true); + } + } + safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy); + { + if ((flags & Insertion) !== NoFlags$1) { + setIsRunningInsertionEffect(false); + } + } + } + } + effect = effect.next; + } while (effect !== firstEffect); + } + } + function commitHookEffectListMount(flags, finishedWork) { + var updateQueue = finishedWork.updateQueue; + var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null; + if (lastEffect !== null) { + var firstEffect = lastEffect.next; + var effect = firstEffect; + do { + if ((effect.tag & flags) === flags) { + var create = effect.create; + { + if ((flags & Insertion) !== NoFlags$1) { + setIsRunningInsertionEffect(true); + } + } + effect.destroy = create(); + { + if ((flags & Insertion) !== NoFlags$1) { + setIsRunningInsertionEffect(false); + } + } + { + var destroy = effect.destroy; + if (destroy !== undefined && typeof destroy !== "function") { + var hookName = void 0; + if ((effect.tag & Layout) !== NoFlags) { + hookName = "useLayoutEffect"; + } else if ((effect.tag & Insertion) !== NoFlags) { + hookName = "useInsertionEffect"; + } else { + hookName = "useEffect"; + } + var addendum = void 0; + if (destroy === null) { + addendum = " You returned null. If your effect does not require clean " + "up, return undefined (or nothing)."; + } else if (typeof destroy.then === "function") { + addendum = "\n\nIt looks like you wrote " + hookName + "(async () => ...) or returned a Promise. " + "Instead, write the async function inside your effect " + "and call it immediately:\n\n" + hookName + "(() => {\n" + " async function fetchData() {\n" + " // You can await here\n" + " const response = await MyAPI.getData(someId);\n" + " // ...\n" + " }\n" + " fetchData();\n" + "}, [someId]); // Or [] if effect doesn't need props or state\n\n" + "Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching"; + } else { + addendum = " You returned: " + destroy; + } + error("%s must not return anything besides a function, " + "which is used for clean-up.%s", hookName, addendum); + } + } + } + effect = effect.next; + } while (effect !== firstEffect); + } + } + function commitPassiveEffectDurations(finishedRoot, finishedWork) { + { + // Only Profilers with work in their subtree will have an Update effect scheduled. + if ((finishedWork.flags & Update) !== NoFlags) { + switch (finishedWork.tag) { + case Profiler: + { + var passiveEffectDuration = finishedWork.stateNode.passiveEffectDuration; + var _finishedWork$memoize = finishedWork.memoizedProps, + id = _finishedWork$memoize.id, + onPostCommit = _finishedWork$memoize.onPostCommit; // This value will still reflect the previous commit phase. + // It does not get reset until the start of the next commit phase. + + var commitTime = getCommitTime(); + var phase = finishedWork.alternate === null ? "mount" : "update"; + { + if (isCurrentUpdateNested()) { + phase = "nested-update"; + } + } + if (typeof onPostCommit === "function") { + onPostCommit(id, phase, passiveEffectDuration, commitTime); + } // Bubble times to the next nearest ancestor Profiler. + // After we process that Profiler, we'll bubble further up. + + var parentFiber = finishedWork.return; + outer: while (parentFiber !== null) { + switch (parentFiber.tag) { + case HostRoot: + var root = parentFiber.stateNode; + root.passiveEffectDuration += passiveEffectDuration; + break outer; + case Profiler: + var parentStateNode = parentFiber.stateNode; + parentStateNode.passiveEffectDuration += passiveEffectDuration; + break outer; + } + parentFiber = parentFiber.return; + } + break; + } + } + } + } + } + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork, committedLanes) { + if ((finishedWork.flags & LayoutMask) !== NoFlags) { + switch (finishedWork.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + { + { + // At this point layout effects have already been destroyed (during mutation phase). + // This is done to prevent sibling component effects from interfering with each other, + // e.g. a destroy function in one component should never override a ref set + // by a create function in another component during the same commit. + if (finishedWork.mode & ProfileMode) { + try { + startLayoutEffectTimer(); + commitHookEffectListMount(Layout | HasEffect, finishedWork); + } finally { + recordLayoutEffectDuration(finishedWork); + } + } else { + commitHookEffectListMount(Layout | HasEffect, finishedWork); + } + } + break; + } + case ClassComponent: + { + var instance = finishedWork.stateNode; + if (finishedWork.flags & Update) { + { + if (current === null) { + // We could update instance props and state here, + // but instead we rely on them being set during last render. + // TODO: revisit this when we implement resuming. + { + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + if (instance.props !== finishedWork.memoizedProps) { + error("Expected %s props to match memoized props before " + "componentDidMount. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.props`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + if (instance.state !== finishedWork.memoizedState) { + error("Expected %s state to match memoized state before " + "componentDidMount. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.state`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + } + } + if (finishedWork.mode & ProfileMode) { + try { + startLayoutEffectTimer(); + instance.componentDidMount(); + } finally { + recordLayoutEffectDuration(finishedWork); + } + } else { + instance.componentDidMount(); + } + } else { + var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps); + var prevState = current.memoizedState; // We could update instance props and state here, + // but instead we rely on them being set during last render. + // TODO: revisit this when we implement resuming. + + { + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + if (instance.props !== finishedWork.memoizedProps) { + error("Expected %s props to match memoized props before " + "componentDidUpdate. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.props`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + if (instance.state !== finishedWork.memoizedState) { + error("Expected %s state to match memoized state before " + "componentDidUpdate. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.state`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + } + } + if (finishedWork.mode & ProfileMode) { + try { + startLayoutEffectTimer(); + instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate); + } finally { + recordLayoutEffectDuration(finishedWork); + } + } else { + instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate); + } + } + } + } // TODO: I think this is now always non-null by the time it reaches the + // commit phase. Consider removing the type check. + + var updateQueue = finishedWork.updateQueue; + if (updateQueue !== null) { + { + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + if (instance.props !== finishedWork.memoizedProps) { + error("Expected %s props to match memoized props before " + "processing the update queue. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.props`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + if (instance.state !== finishedWork.memoizedState) { + error("Expected %s state to match memoized state before " + "processing the update queue. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.state`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + } + } // We could update instance props and state here, + // but instead we rely on them being set during last render. + // TODO: revisit this when we implement resuming. + + commitUpdateQueue(finishedWork, updateQueue, instance); + } + break; + } + case HostRoot: + { + // TODO: I think this is now always non-null by the time it reaches the + // commit phase. Consider removing the type check. + var _updateQueue = finishedWork.updateQueue; + if (_updateQueue !== null) { + var _instance = null; + if (finishedWork.child !== null) { + switch (finishedWork.child.tag) { + case HostComponent: + _instance = getPublicInstance(finishedWork.child.stateNode); + break; + case ClassComponent: + _instance = finishedWork.child.stateNode; + break; + } + } + commitUpdateQueue(finishedWork, _updateQueue, _instance); + } + break; + } + case HostComponent: + { + var _instance2 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted + // (eg DOM renderer may schedule auto-focus for inputs and form controls). + // These effects should only be committed when components are first mounted, + // aka when there is no current/alternate. + + if (current === null && finishedWork.flags & Update) { + var type = finishedWork.type; + var props = finishedWork.memoizedProps; + commitMount(); + } + break; + } + case HostText: + { + // We have no life-cycles associated with text. + break; + } + case HostPortal: + { + // We have no life-cycles associated with portals. + break; + } + case Profiler: + { + { + var _finishedWork$memoize2 = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize2.onCommit, + onRender = _finishedWork$memoize2.onRender; + var effectDuration = finishedWork.stateNode.effectDuration; + var commitTime = getCommitTime(); + var phase = current === null ? "mount" : "update"; + { + if (isCurrentUpdateNested()) { + phase = "nested-update"; + } + } + if (typeof onRender === "function") { + onRender(finishedWork.memoizedProps.id, phase, finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime); + } + { + if (typeof onCommit === "function") { + onCommit(finishedWork.memoizedProps.id, phase, effectDuration, commitTime); + } // Schedule a passive effect for this Profiler to call onPostCommit hooks. + // This effect should be scheduled even if there is no onPostCommit callback for this Profiler, + // because the effect is also where times bubble to parent Profilers. + + enqueuePendingPassiveProfilerEffect(finishedWork); // Propagate layout effect durations to the next nearest Profiler ancestor. + // Do not reset these values until the next render so DevTools has a chance to read them first. + + var parentFiber = finishedWork.return; + outer: while (parentFiber !== null) { + switch (parentFiber.tag) { + case HostRoot: + var root = parentFiber.stateNode; + root.effectDuration += effectDuration; + break outer; + case Profiler: + var parentStateNode = parentFiber.stateNode; + parentStateNode.effectDuration += effectDuration; + break outer; + } + parentFiber = parentFiber.return; + } + } + } + break; + } + case SuspenseComponent: + { + break; + } + case SuspenseListComponent: + case IncompleteClassComponent: + case ScopeComponent: + case OffscreenComponent: + case LegacyHiddenComponent: + case TracingMarkerComponent: + { + break; + } + default: + throw new 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 (finishedWork.flags & Ref) { + commitAttachRef(finishedWork); + } + } + } + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (ref !== null) { + var instance = finishedWork.stateNode; + var instanceToUse; + switch (finishedWork.tag) { + case HostComponent: + instanceToUse = getPublicInstance(instance); + break; + default: + instanceToUse = instance; + } // Moved outside to ensure DCE works with this flag + + if (typeof ref === "function") { + var retVal; + if (finishedWork.mode & ProfileMode) { + try { + startLayoutEffectTimer(); + retVal = ref(instanceToUse); + } finally { + recordLayoutEffectDuration(finishedWork); + } + } else { + retVal = ref(instanceToUse); + } + { + if (typeof retVal === "function") { + error("Unexpected return value from a callback ref in %s. " + "A callback ref should not return a function.", getComponentNameFromFiber(finishedWork)); + } + } + } else { + { + if (!ref.hasOwnProperty("current")) { + error("Unexpected ref object provided for %s. " + "Use either a ref-setter function or React.createRef().", getComponentNameFromFiber(finishedWork)); + } + } + ref.current = instanceToUse; + } + } + } + function detachFiberMutation(fiber) { + // Cut off the return pointer to disconnect it from the tree. + // This enables us to detect and warn against state updates on an unmounted component. + // It also prevents events from bubbling from within disconnected components. + // + // Ideally, we should also clear the child pointer of the parent alternate to let this + // get GC:ed but we don't know which for sure which parent is the current + // one so we'll settle for GC:ing the subtree of this child. + // This child itself will be GC:ed when the parent updates the next time. + // + // Note that we can't clear child or sibling pointers yet. + // They're needed for passive effects and for findDOMNode. + // We defer those fields, and all other cleanup, to the passive phase (see detachFiberAfterEffects). + // + // Don't reset the alternate yet, either. We need that so we can detach the + // alternate's fields in the passive phase. Clearing the return pointer is + // sufficient for findDOMNode semantics. + var alternate = fiber.alternate; + if (alternate !== null) { + alternate.return = null; + } + fiber.return = null; + } + function detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + if (alternate !== null) { + fiber.alternate = null; + detachFiberAfterEffects(alternate); + } // Note: Defensively using negation instead of < in case + // `deletedTreeCleanUpLevel` is undefined. + + { + // Clear cyclical Fiber fields. This level alone is designed to roughly + // approximate the planned Fiber refactor. In that world, `setState` will be + // bound to a special "instance" object instead of a Fiber. The Instance + // object will not have any of these fields. It will only be connected to + // the fiber tree via a single link at the root. So if this level alone is + // sufficient to fix memory issues, that bodes well for our plans. + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host + // tree, which has its own pointers to children, parents, and siblings. + // The other host nodes also point back to fibers, so we should detach that + // one, too. + + if (fiber.tag === HostComponent) { + var hostInstance = fiber.stateNode; + } + fiber.stateNode = null; // I'm intentionally not clearing the `return` field in this level. We + // already disconnect the `return` pointer at the root of the deleted + // subtree (in `detachFiberMutation`). Besides, `return` by itself is not + // cyclical — it's only cyclical when combined with `child`, `sibling`, and + // `alternate`. But we'll clear it in the next level anyway, just in case. + + { + fiber._debugOwner = null; + } + { + // Theoretically, nothing in here should be necessary, because we already + // disconnected the fiber from the tree. So even if something leaks this + // particular fiber, it won't leak anything else + // + // The purpose of this branch is to be super aggressive so we can measure + // if there's any difference in memory impact. If there is, that could + // indicate a React leak we don't know about. + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead. + + fiber.updateQueue = null; + } + } + } + function emptyPortalContainer(current) { + var portal = current.stateNode; + var containerInfo = portal.containerInfo; + var emptyChildSet = createContainerChildSet(containerInfo); + } + function commitPlacement(finishedWork) { + { + return; + } // Recursively insert all host nodes into the parent. + } + function commitDeletionEffects(root, returnFiber, deletedFiber) { + { + // Detach refs and call componentWillUnmount() on the whole subtree. + commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); + } + detachFiberMutation(deletedFiber); + } + function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) { + // TODO: Use a static flag to skip trees that don't have unmount effects + var child = parent.child; + while (child !== null) { + commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, child); + child = child.sibling; + } + } + function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) { + onCommitUnmount(deletedFiber); // The cases in this outer switch modify the stack before they traverse + // into their subtree. There are simpler cases in the inner switch + // that don't modify the stack. + + switch (deletedFiber.tag) { + case HostComponent: + { + { + safelyDetachRef(deletedFiber, nearestMountedAncestor); + } // Intentional fallthrough to next branch + } + // eslint-disable-next-line-no-fallthrough + + case HostText: + { + // We only need to remove the nearest host child. Set the host parent + // to `null` on the stack to indicate that nested children don't + // need to be removed. + { + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + } + return; + } + case DehydratedFragment: + { + return; + } + case HostPortal: + { + { + emptyPortalContainer(deletedFiber); + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + } + return; + } + case FunctionComponent: + case ForwardRef: + case MemoComponent: + case SimpleMemoComponent: + { + { + var updateQueue = deletedFiber.updateQueue; + if (updateQueue !== null) { + var lastEffect = updateQueue.lastEffect; + if (lastEffect !== null) { + var firstEffect = lastEffect.next; + var effect = firstEffect; + do { + var _effect = effect, + destroy = _effect.destroy, + tag = _effect.tag; + if (destroy !== undefined) { + if ((tag & Insertion) !== NoFlags$1) { + safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy); + } else if ((tag & Layout) !== NoFlags$1) { + if (deletedFiber.mode & ProfileMode) { + startLayoutEffectTimer(); + safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy); + recordLayoutEffectDuration(deletedFiber); + } else { + safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy); + } + } + } + effect = effect.next; + } while (effect !== firstEffect); + } + } + } + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + return; + } + case ClassComponent: + { + { + safelyDetachRef(deletedFiber, nearestMountedAncestor); + var instance = deletedFiber.stateNode; + if (typeof instance.componentWillUnmount === "function") { + safelyCallComponentWillUnmount(deletedFiber, nearestMountedAncestor, instance); + } + } + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + return; + } + case ScopeComponent: + { + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + return; + } + case OffscreenComponent: + { + { + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + } + break; + } + default: + { + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + return; + } + } + } + function commitSuspenseCallback(finishedWork) { + // TODO: Move this to passive phase + var newState = finishedWork.memoizedState; + } + function attachSuspenseRetryListeners(finishedWork) { + // If this boundary just timed out, then it will have a set of wakeables. + // For each wakeable, attach a listener so that when it resolves, React + // attempts to re-render the boundary in the primary (pre-timeout) state. + var wakeables = finishedWork.updateQueue; + if (wakeables !== null) { + finishedWork.updateQueue = null; + var retryCache = finishedWork.stateNode; + if (retryCache === null) { + retryCache = finishedWork.stateNode = new PossiblyWeakSet(); + } + wakeables.forEach(function (wakeable) { + // Memoize using the boundary fiber to prevent redundant listeners. + var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); + if (!retryCache.has(wakeable)) { + retryCache.add(wakeable); + { + if (isDevToolsPresent) { + if (inProgressLanes !== null && inProgressRoot !== null) { + // If we have pending work still, associate the original updaters with it. + restorePendingUpdaters(inProgressRoot, inProgressLanes); + } else { + throw Error("Expected finished root and lanes to be set. This is a bug in React."); + } + } + } + wakeable.then(retry, retry); + } + }); + } + } // This function detects when a Suspense boundary goes from visible to hidden. + function commitMutationEffects(root, finishedWork, committedLanes) { + inProgressLanes = committedLanes; + inProgressRoot = root; + setCurrentFiber(finishedWork); + commitMutationEffectsOnFiber(finishedWork, root); + setCurrentFiber(finishedWork); + inProgressLanes = null; + inProgressRoot = null; + } + function recursivelyTraverseMutationEffects(root, parentFiber, lanes) { + // Deletions effects can be scheduled on any fiber type. They need to happen + // before the children effects hae fired. + var deletions = parentFiber.deletions; + if (deletions !== null) { + for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i]; + try { + commitDeletionEffects(root, parentFiber, childToDelete); + } catch (error) { + captureCommitPhaseError(childToDelete, parentFiber, error); + } + } + } + var prevDebugFiber = getCurrentFiber(); + if (parentFiber.subtreeFlags & MutationMask) { + var child = parentFiber.child; + while (child !== null) { + setCurrentFiber(child); + commitMutationEffectsOnFiber(child, root); + child = child.sibling; + } + } + setCurrentFiber(prevDebugFiber); + } + function commitMutationEffectsOnFiber(finishedWork, root, lanes) { + var current = finishedWork.alternate; + var flags = finishedWork.flags; // The effect flag should be checked *after* we refine the type of fiber, + // because the fiber tag is more specific. An exception is any flag related + // to reconcilation, because those can be set on all fiber types. + + switch (finishedWork.tag) { + case FunctionComponent: + case ForwardRef: + case MemoComponent: + case SimpleMemoComponent: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & Update) { + try { + commitHookEffectListUnmount(Insertion | HasEffect, finishedWork, finishedWork.return); + commitHookEffectListMount(Insertion | HasEffect, finishedWork); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } // Layout effects are destroyed during the mutation phase so that all + // destroy functions for all fibers are called before any create functions. + // This prevents sibling component effects from interfering with each other, + // e.g. a destroy function in one component should never override a ref set + // by a create function in another component during the same commit. + + if (finishedWork.mode & ProfileMode) { + try { + startLayoutEffectTimer(); + commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + recordLayoutEffectDuration(finishedWork); + } else { + try { + commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + return; + } + case ClassComponent: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & Ref) { + if (current !== null) { + safelyDetachRef(current, current.return); + } + } + return; + } + case HostComponent: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & Ref) { + if (current !== null) { + safelyDetachRef(current, current.return); + } + } + return; + } + case HostText: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + return; + } + case HostRoot: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & Update) { + { + var containerInfo = root.containerInfo; + var pendingChildren = root.pendingChildren; + try { + replaceContainerChildren(containerInfo, pendingChildren); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + return; + } + case HostPortal: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & Update) { + { + var portal = finishedWork.stateNode; + var _containerInfo = portal.containerInfo; + var _pendingChildren = portal.pendingChildren; + try { + replaceContainerChildren(_containerInfo, _pendingChildren); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + return; + } + case SuspenseComponent: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + var offscreenFiber = finishedWork.child; + if (offscreenFiber.flags & Visibility) { + var offscreenInstance = offscreenFiber.stateNode; + var newState = offscreenFiber.memoizedState; + var isHidden = newState !== null; // Track the current state on the Offscreen instance so we can + // read it during an event + + offscreenInstance.isHidden = isHidden; + if (isHidden) { + var wasHidden = offscreenFiber.alternate !== null && offscreenFiber.alternate.memoizedState !== null; + if (!wasHidden) { + // TODO: Move to passive phase + markCommitTimeOfFallback(); + } + } + } + if (flags & Update) { + try { + commitSuspenseCallback(finishedWork); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + attachSuspenseRetryListeners(finishedWork); + } + return; + } + case OffscreenComponent: + { + var _wasHidden = current !== null && current.memoizedState !== null; + { + recursivelyTraverseMutationEffects(root, finishedWork); + } + commitReconciliationEffects(finishedWork); + if (flags & Visibility) { + var _offscreenInstance = finishedWork.stateNode; + var _newState = finishedWork.memoizedState; + var _isHidden = _newState !== null; + // read it during an event + + _offscreenInstance.isHidden = _isHidden; + } + return; + } + case SuspenseListComponent: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & Update) { + attachSuspenseRetryListeners(finishedWork); + } + return; + } + case ScopeComponent: + { + return; + } + default: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + return; + } + } + } + function commitReconciliationEffects(finishedWork) { + // Placement effects (insertions, reorders) can be scheduled on any fiber + // type. They needs to happen after the children effects have fired, but + // before the effects on this fiber have fired. + var flags = finishedWork.flags; + if (flags & Placement) { + try { + commitPlacement(finishedWork); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } // Clear the "placement" from effect tag so that we know that this is + // inserted, before any life-cycles like componentDidMount gets called. + // TODO: findDOMNode doesn't rely on this any more but isMounted does + // and isMounted is deprecated anyway so we should be able to kill this. + + finishedWork.flags &= ~Placement; + } + if (flags & Hydrating) { + finishedWork.flags &= ~Hydrating; + } + } + function commitLayoutEffects(finishedWork, root, committedLanes) { + inProgressLanes = committedLanes; + inProgressRoot = root; + nextEffect = finishedWork; + commitLayoutEffects_begin(finishedWork, root, committedLanes); + inProgressLanes = null; + inProgressRoot = null; + } + function commitLayoutEffects_begin(subtreeRoot, root, committedLanes) { + // Suspense layout effects semantics don't change for legacy roots. + var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode; + while (nextEffect !== null) { + var fiber = nextEffect; + var firstChild = fiber.child; + if ((fiber.subtreeFlags & LayoutMask) !== NoFlags && firstChild !== null) { + firstChild.return = fiber; + nextEffect = firstChild; + } else { + commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes); + } + } + } + function commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes) { + while (nextEffect !== null) { + var fiber = nextEffect; + if ((fiber.flags & LayoutMask) !== NoFlags) { + var current = fiber.alternate; + setCurrentFiber(fiber); + try { + commitLayoutEffectOnFiber(root, current, fiber, committedLanes); + } catch (error) { + captureCommitPhaseError(fiber, fiber.return, error); + } + resetCurrentFiber(); + } + if (fiber === subtreeRoot) { + nextEffect = null; + return; + } + var sibling = fiber.sibling; + if (sibling !== null) { + sibling.return = fiber.return; + nextEffect = sibling; + return; + } + nextEffect = fiber.return; + } + } + function commitPassiveMountEffects(root, finishedWork, committedLanes, committedTransitions) { + nextEffect = finishedWork; + commitPassiveMountEffects_begin(finishedWork, root, committedLanes, committedTransitions); + } + function commitPassiveMountEffects_begin(subtreeRoot, root, committedLanes, committedTransitions) { + while (nextEffect !== null) { + var fiber = nextEffect; + var firstChild = fiber.child; + if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && firstChild !== null) { + firstChild.return = fiber; + nextEffect = firstChild; + } else { + commitPassiveMountEffects_complete(subtreeRoot, root, committedLanes, committedTransitions); + } + } + } + function commitPassiveMountEffects_complete(subtreeRoot, root, committedLanes, committedTransitions) { + while (nextEffect !== null) { + var fiber = nextEffect; + if ((fiber.flags & Passive) !== NoFlags) { + setCurrentFiber(fiber); + try { + commitPassiveMountOnFiber(root, fiber, committedLanes, committedTransitions); + } catch (error) { + captureCommitPhaseError(fiber, fiber.return, error); + } + resetCurrentFiber(); + } + if (fiber === subtreeRoot) { + nextEffect = null; + return; + } + var sibling = fiber.sibling; + if (sibling !== null) { + sibling.return = fiber.return; + nextEffect = sibling; + return; + } + nextEffect = fiber.return; + } + } + function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) { + switch (finishedWork.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + { + if (finishedWork.mode & ProfileMode) { + startPassiveEffectTimer(); + try { + commitHookEffectListMount(Passive$1 | HasEffect, finishedWork); + } finally { + recordPassiveEffectDuration(finishedWork); + } + } else { + commitHookEffectListMount(Passive$1 | HasEffect, finishedWork); + } + break; + } + } + } + function commitPassiveUnmountEffects(firstChild) { + nextEffect = firstChild; + commitPassiveUnmountEffects_begin(); + } + function commitPassiveUnmountEffects_begin() { + while (nextEffect !== null) { + var fiber = nextEffect; + var child = fiber.child; + if ((nextEffect.flags & ChildDeletion) !== NoFlags) { + var deletions = fiber.deletions; + if (deletions !== null) { + for (var i = 0; i < deletions.length; i++) { + var fiberToDelete = deletions[i]; + nextEffect = fiberToDelete; + commitPassiveUnmountEffectsInsideOfDeletedTree_begin(fiberToDelete, fiber); + } + { + // A fiber was deleted from this parent fiber, but it's still part of + // the previous (alternate) parent fiber's list of children. Because + // children are a linked list, an earlier sibling that's still alive + // will be connected to the deleted fiber via its `alternate`: + // + // live fiber + // --alternate--> previous live fiber + // --sibling--> deleted fiber + // + // We can't disconnect `alternate` on nodes that haven't been deleted + // yet, but we can disconnect the `sibling` and `child` pointers. + var previousFiber = fiber.alternate; + if (previousFiber !== null) { + var detachedChild = previousFiber.child; + if (detachedChild !== null) { + previousFiber.child = null; + do { + var detachedSibling = detachedChild.sibling; + detachedChild.sibling = null; + detachedChild = detachedSibling; + } while (detachedChild !== null); + } + } + } + nextEffect = fiber; + } + } + if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) { + child.return = fiber; + nextEffect = child; + } else { + commitPassiveUnmountEffects_complete(); + } + } + } + function commitPassiveUnmountEffects_complete() { + while (nextEffect !== null) { + var fiber = nextEffect; + if ((fiber.flags & Passive) !== NoFlags) { + setCurrentFiber(fiber); + commitPassiveUnmountOnFiber(fiber); + resetCurrentFiber(); + } + var sibling = fiber.sibling; + if (sibling !== null) { + sibling.return = fiber.return; + nextEffect = sibling; + return; + } + nextEffect = fiber.return; + } + } + function commitPassiveUnmountOnFiber(finishedWork) { + switch (finishedWork.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + { + if (finishedWork.mode & ProfileMode) { + startPassiveEffectTimer(); + commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return); + recordPassiveEffectDuration(finishedWork); + } else { + commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return); + } + break; + } + } + } + function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) { + while (nextEffect !== null) { + var fiber = nextEffect; // Deletion effects fire in parent -> child order + // TODO: Check if fiber has a PassiveStatic flag + + setCurrentFiber(fiber); + commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor); + resetCurrentFiber(); + var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag. (But, if we + // do this, still need to handle `deletedTreeCleanUpLevel` correctly.) + + if (child !== null) { + child.return = fiber; + nextEffect = child; + } else { + commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot); + } + } + } + function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot) { + while (nextEffect !== null) { + var fiber = nextEffect; + var sibling = fiber.sibling; + var returnFiber = fiber.return; + { + // Recursively traverse the entire deleted tree and clean up fiber fields. + // This is more aggressive than ideal, and the long term goal is to only + // have to detach the deleted tree at the root. + detachFiberAfterEffects(fiber); + if (fiber === deletedSubtreeRoot) { + nextEffect = null; + return; + } + } + if (sibling !== null) { + sibling.return = returnFiber; + nextEffect = sibling; + return; + } + nextEffect = returnFiber; + } + } + function commitPassiveUnmountInsideDeletedTreeOnFiber(current, nearestMountedAncestor) { + switch (current.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + { + if (current.mode & ProfileMode) { + startPassiveEffectTimer(); + commitHookEffectListUnmount(Passive$1, current, nearestMountedAncestor); + recordPassiveEffectDuration(current); + } else { + commitHookEffectListUnmount(Passive$1, current, nearestMountedAncestor); + } + break; + } + } + } // TODO: Reuse reappearLayoutEffects traversal here? + + var COMPONENT_TYPE = 0; + var HAS_PSEUDO_CLASS_TYPE = 1; + var ROLE_TYPE = 2; + var TEST_NAME_TYPE = 3; + var TEXT_TYPE = 4; + if (typeof Symbol === "function" && Symbol.for) { + var symbolFor = Symbol.for; + COMPONENT_TYPE = symbolFor("selector.component"); + HAS_PSEUDO_CLASS_TYPE = symbolFor("selector.has_pseudo_class"); + ROLE_TYPE = symbolFor("selector.role"); + TEST_NAME_TYPE = symbolFor("selector.test_id"); + TEXT_TYPE = symbolFor("selector.text"); + } + var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue; + function isLegacyActEnvironment(fiber) { + { + // Legacy mode. We preserve the behavior of React 17's act. It assumes an + // act environment whenever `jest` is defined, but you can still turn off + // spurious warnings by setting IS_REACT_ACT_ENVIRONMENT explicitly + // to false. + var isReactActEnvironmentGlobal = + // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global + typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : undefined; // $FlowExpectedError - Flow doesn't know about jest + return warnsIfNotActing; + } + } + function isConcurrentActEnvironment() { + { + var isReactActEnvironmentGlobal = + // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global + typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : undefined; + if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) { + // TODO: Include link to relevant documentation page. + error("The current testing environment is not configured to support " + "act(...)"); + } + return isReactActEnvironmentGlobal; + } + } + var ceil = Math.ceil; + var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, + ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, + ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig, + ReactCurrentActQueue$1 = ReactSharedInternals.ReactCurrentActQueue; + var NoContext = /* */ + 0; + var BatchedContext = /* */ + 1; + var RenderContext = /* */ + 2; + var CommitContext = /* */ + 4; + var RootInProgress = 0; + var RootFatalErrored = 1; + var RootErrored = 2; + var RootSuspended = 3; + var RootSuspendedWithDelay = 4; + var RootCompleted = 5; + var RootDidNotComplete = 6; // Describes where we are in the React execution stack + + var executionContext = NoContext; // The root we're working on + + var workInProgressRoot = null; // The fiber we're working on + + var workInProgress = null; // The lanes we're rendering + + var workInProgressRootRenderLanes = NoLanes; // Stack that allows components to change the render lanes for its subtree + // This is a superset of the lanes we started working on at the root. The only + // case where it's different from `workInProgressRootRenderLanes` is when we + // enter a subtree that is hidden and needs to be unhidden: Suspense and + // Offscreen component. + // + // Most things in the work loop should deal with workInProgressRootRenderLanes. + // Most things in begin/complete phases should deal with subtreeRenderLanes. + + var subtreeRenderLanes = NoLanes; + var subtreeRenderLanesCursor = createCursor(NoLanes); // Whether to root completed, errored, suspended, etc. + + var workInProgressRootExitStatus = RootInProgress; // A fatal error, if one is thrown + + var workInProgressRootFatalError = null; // "Included" lanes refer to lanes that were worked on during this render. It's + // slightly different than `renderLanes` because `renderLanes` can change as you + // enter and exit an Offscreen tree. This value is the combination of all render + // lanes for the entire render phase. + + var workInProgressRootIncludedLanes = NoLanes; // The work left over by components that were visited during this render. Only + // includes unprocessed updates, not work in bailed out children. + + var workInProgressRootSkippedLanes = NoLanes; // Lanes that were updated (in an interleaved event) during this render. + + var workInProgressRootInterleavedUpdatedLanes = NoLanes; // Lanes that were updated during the render phase (*not* an interleaved event). + + var workInProgressRootPingedLanes = NoLanes; // Errors that are thrown during the render phase. + + var workInProgressRootConcurrentErrors = null; // These are errors that we recovered from without surfacing them to the UI. + // We will log them once the tree commits. + + var workInProgressRootRecoverableErrors = null; // The most recent time we committed a fallback. This lets us ensure a train + // model where we don't commit new loading states in too quick succession. + + var globalMostRecentFallbackTime = 0; + var FALLBACK_THROTTLE_MS = 500; // The absolute time for when we should start giving up on rendering + // more and prefer CPU suspense heuristics instead. + + var workInProgressRootRenderTargetTime = Infinity; // How long a render is supposed to take before we start following CPU + // suspense heuristics and opt out of rendering more content. + + var RENDER_TIMEOUT_MS = 500; + var workInProgressTransitions = null; + function resetRenderTimer() { + workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS; + } + function getRenderTargetTime() { + return workInProgressRootRenderTargetTime; + } + var hasUncaughtError = false; + var firstUncaughtError = null; + var legacyErrorBoundariesThatAlreadyFailed = null; // Only used when enableProfilerNestedUpdateScheduledHook is true; + var rootDoesHavePassiveEffects = false; + var rootWithPendingPassiveEffects = null; + var pendingPassiveEffectsLanes = NoLanes; + var pendingPassiveProfilerEffects = []; + var pendingPassiveTransitions = null; // Use these to prevent an infinite loop of nested updates + + var NESTED_UPDATE_LIMIT = 50; + var nestedUpdateCount = 0; + var rootWithNestedUpdates = null; + var isFlushingPassiveEffects = false; + var didScheduleUpdateDuringPassiveEffects = false; + var NESTED_PASSIVE_UPDATE_LIMIT = 50; + var nestedPassiveUpdateCount = 0; + var rootWithPassiveNestedUpdates = null; // If two updates are scheduled within the same event, we should treat their + // event times as simultaneous, even if the actual clock time has advanced + // between the first and second call. + + var currentEventTime = NoTimestamp; + var currentEventTransitionLane = NoLanes; + var isRunningInsertionEffect = false; + function getWorkInProgressRoot() { + return workInProgressRoot; + } + function requestEventTime() { + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { + // We're inside React, so it's fine to read the actual time. + return now(); + } // We're not inside React, so we may be in the middle of a browser event. + + if (currentEventTime !== NoTimestamp) { + // Use the same start time for all updates until we enter React again. + return currentEventTime; + } // This is the first update since React yielded. Compute a new start time. + + currentEventTime = now(); + return currentEventTime; + } + function requestUpdateLane(fiber) { + // Special cases + var mode = fiber.mode; + if ((mode & ConcurrentMode) === NoMode) { + return SyncLane; + } else if ((executionContext & RenderContext) !== NoContext && workInProgressRootRenderLanes !== NoLanes) { + // This is a render phase update. These are not officially supported. The + // old behavior is to give this the same "thread" (lanes) as + // whatever is currently rendering. So if you call `setState` on a component + // that happens later in the same render, it will flush. Ideally, we want to + // remove the special case and treat them as if they came from an + // interleaved event. Regardless, this pattern is not officially supported. + // This behavior is only a fallback. The flag only exists until we can roll + // out the setState warning, since existing code might accidentally rely on + // the current behavior. + return pickArbitraryLane(workInProgressRootRenderLanes); + } + var isTransition = requestCurrentTransition() !== NoTransition; + if (isTransition) { + if (ReactCurrentBatchConfig$2.transition !== null) { + var transition = ReactCurrentBatchConfig$2.transition; + if (!transition._updatedFibers) { + transition._updatedFibers = new Set(); + } + transition._updatedFibers.add(fiber); + } // The algorithm for assigning an update to a lane should be stable for all + // updates at the same priority within the same event. To do this, the + // inputs to the algorithm must be the same. + // + // The trick we use is to cache the first of each of these inputs within an + // event. Then reset the cached values once we can be sure the event is + // over. Our heuristic for that is whenever we enter a concurrent work loop. + + if (currentEventTransitionLane === NoLane) { + // All transitions within the same event are assigned the same lane. + currentEventTransitionLane = claimNextTransitionLane(); + } + return currentEventTransitionLane; + } // Updates originating inside certain React methods, like flushSync, have + // their priority set by tracking it with a context variable. + // + // The opaque type returned by the host config is internally a lane, so we can + // use that directly. + // TODO: Move this type conversion to the event priority module. + + var updateLane = getCurrentUpdatePriority(); + if (updateLane !== NoLane) { + return updateLane; + } // This update originated outside React. Ask the host environment for an + // appropriate priority, based on the type of event. + // + // The opaque type returned by the host config is internally a lane, so we can + // use that directly. + // TODO: Move this type conversion to the event priority module. + + var eventLane = getCurrentEventPriority(); + return eventLane; + } + function requestRetryLane(fiber) { + // This is a fork of `requestUpdateLane` designed specifically for Suspense + // "retries" — a special update that attempts to flip a Suspense boundary + // from its placeholder state to its primary/resolved state. + // Special cases + var mode = fiber.mode; + if ((mode & ConcurrentMode) === NoMode) { + return SyncLane; + } + return claimNextRetryLane(); + } + function scheduleUpdateOnFiber(root, fiber, lane, eventTime) { + checkForNestedUpdates(); + { + if (isRunningInsertionEffect) { + error("useInsertionEffect must not schedule updates."); + } + } + { + if (isFlushingPassiveEffects) { + didScheduleUpdateDuringPassiveEffects = true; + } + } // Mark that the root has a pending update. + + markRootUpdated(root, lane, eventTime); + if ((executionContext & RenderContext) !== NoLanes && root === workInProgressRoot) { + // This update was dispatched during the render phase. This is a mistake + // if the update originates from user space (with the exception of local + // hook updates, which are handled differently and don't reach this + // function), but there are some internal React features that use this as + // an implementation detail, like selective hydration. + warnAboutRenderPhaseUpdatesInDEV(fiber); // Track lanes that were updated during the render phase + } else { + // This is a normal update, scheduled from outside the render phase. For + // example, during an input event. + { + if (isDevToolsPresent) { + addFiberToLanesMap(root, fiber, lane); + } + } + warnIfUpdatesNotWrappedWithActDEV(fiber); + if (root === workInProgressRoot) { + // Received an update to a tree that's in the middle of rendering. Mark + // that there was an interleaved update work on this root. Unless the + // `deferRenderPhaseUpdateToNextBatch` flag is off and this is a render + // phase update. In that case, we don't treat render phase updates as if + // they were interleaved, for backwards compat reasons. + if ((executionContext & RenderContext) === NoContext) { + workInProgressRootInterleavedUpdatedLanes = mergeLanes(workInProgressRootInterleavedUpdatedLanes, lane); + } + if (workInProgressRootExitStatus === RootSuspendedWithDelay) { + // The root already suspended with a delay, which means this render + // definitely won't finish. Since we have a new update, let's mark it as + // suspended now, right before marking the incoming update. This has the + // effect of interrupting the current render and switching to the update. + // TODO: Make sure this doesn't override pings that happen while we've + // already started rendering. + markRootSuspended$1(root, workInProgressRootRenderLanes); + } + } + ensureRootIsScheduled(root, eventTime); + if (lane === SyncLane && executionContext === NoContext && (fiber.mode & ConcurrentMode) === NoMode && + // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode. + !ReactCurrentActQueue$1.isBatchingLegacy) { + // Flush the synchronous work now, unless we're already working or inside + // a batch. This is intentionally inside scheduleUpdateOnFiber instead of + // scheduleCallbackForFiber to preserve the ability to schedule a callback + // without immediately flushing it. We only do this for user-initiated + // updates, to preserve historical behavior of legacy mode. + resetRenderTimer(); + flushSyncCallbacksOnlyInLegacyMode(); + } + } + } + function isUnsafeClassRenderPhaseUpdate(fiber) { + // Check if this is a render phase update. Only called by class components, + // which special (deprecated) behavior for UNSAFE_componentWillReceive props. + return ( + // TODO: Remove outdated deferRenderPhaseUpdateToNextBatch experiment. We + // decided not to enable it. + (executionContext & RenderContext) !== NoContext + ); + } // Use this function to schedule a task for a root. There's only one task per + // root; if a task was already scheduled, we'll check to make sure the priority + // of the existing task is the same as the priority of the next level that the + // root has work on. This function is called on every update, and right before + // exiting a task. + + function ensureRootIsScheduled(root, currentTime) { + var existingCallbackNode = root.callbackNode; // Check if any lanes are being starved by other work. If so, mark them as + // expired so we know to work on those next. + + markStarvedLanesAsExpired(root, currentTime); // Determine the next lanes to work on, and their priority. + + var nextLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes); + if (nextLanes === NoLanes) { + // Special case: There's nothing to work on. + if (existingCallbackNode !== null) { + cancelCallback$1(existingCallbackNode); + } + root.callbackNode = null; + root.callbackPriority = NoLane; + return; + } // We use the highest priority lane to represent the priority of the callback. + + var newCallbackPriority = getHighestPriorityLane(nextLanes); // Check if there's an existing task. We may be able to reuse it. + + var existingCallbackPriority = root.callbackPriority; + if (existingCallbackPriority === newCallbackPriority && + // Special case related to `act`. If the currently scheduled task is a + // Scheduler task, rather than an `act` task, cancel it and re-scheduled + // on the `act` queue. + !(ReactCurrentActQueue$1.current !== null && existingCallbackNode !== fakeActCallbackNode)) { + { + // If we're going to re-use an existing task, it needs to exist. + // Assume that discrete update microtasks are non-cancellable and null. + // TODO: Temporary until we confirm this warning is not fired. + if (existingCallbackNode == null && existingCallbackPriority !== SyncLane) { + error("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue."); + } + } // The priority hasn't changed. We can reuse the existing task. Exit. + + return; + } + if (existingCallbackNode != null) { + // Cancel the existing callback. We'll schedule a new one below. + cancelCallback$1(existingCallbackNode); + } // Schedule a new callback. + + var newCallbackNode; + if (newCallbackPriority === SyncLane) { + // Special case: Sync React callbacks are scheduled on a special + // internal queue + if (root.tag === LegacyRoot) { + if (ReactCurrentActQueue$1.isBatchingLegacy !== null) { + ReactCurrentActQueue$1.didScheduleLegacyUpdate = true; + } + scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root)); + } else { + scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root)); + } + { + // Flush the queue in an Immediate task. + scheduleCallback$1(ImmediatePriority, flushSyncCallbacks); + } + newCallbackNode = null; + } else { + var schedulerPriorityLevel; + switch (lanesToEventPriority(nextLanes)) { + case DiscreteEventPriority: + schedulerPriorityLevel = ImmediatePriority; + break; + case ContinuousEventPriority: + schedulerPriorityLevel = UserBlockingPriority; + break; + case DefaultEventPriority: + schedulerPriorityLevel = NormalPriority; + break; + case IdleEventPriority: + schedulerPriorityLevel = IdlePriority; + break; + default: + schedulerPriorityLevel = NormalPriority; + break; + } + newCallbackNode = scheduleCallback$1(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root)); + } + root.callbackPriority = newCallbackPriority; + root.callbackNode = newCallbackNode; + } // This is the entry point for every concurrent task, i.e. anything that + // goes through Scheduler. + + function performConcurrentWorkOnRoot(root, didTimeout) { + { + resetNestedUpdateFlag(); + } // Since we know we're in a React event, we can clear the current + // event time. The next update will compute a new event time. + + currentEventTime = NoTimestamp; + currentEventTransitionLane = NoLanes; + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { + throw new Error("Should not already be working."); + } // Flush any pending passive effects before deciding which lanes to work on, + // in case they schedule additional work. + + var originalCallbackNode = root.callbackNode; + var didFlushPassiveEffects = flushPassiveEffects(); + if (didFlushPassiveEffects) { + // Something in the passive effect phase may have canceled the current task. + // Check if the task node for this root was changed. + if (root.callbackNode !== originalCallbackNode) { + // The current task was canceled. Exit. We don't need to call + // `ensureRootIsScheduled` because the check above implies either that + // there's a new task, or that there's no remaining work on this root. + return null; + } + } // Determine the next lanes to work on, using the fields stored + // on the root. + + var lanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes); + if (lanes === NoLanes) { + // Defensive coding. This is never expected to happen. + return null; + } // We disable time-slicing in some cases: if the work has been CPU-bound + // for too long ("expired" work, to prevent starvation), or we're in + // sync-updates-by-default mode. + // TODO: We only check `didTimeout` defensively, to account for a Scheduler + // bug we're still investigating. Once the bug in Scheduler is fixed, + // we can remove this, since we track expiration ourselves. + + var shouldTimeSlice = !includesBlockingLane(root, lanes) && !includesExpiredLane(root, lanes) && !didTimeout; + var exitStatus = shouldTimeSlice ? renderRootConcurrent(root, lanes) : renderRootSync(root, lanes); + if (exitStatus !== RootInProgress) { + if (exitStatus === RootErrored) { + // If something threw an error, try rendering one more time. We'll + // render synchronously to block concurrent data mutations, and we'll + // includes all pending updates are included. If it still fails after + // the second attempt, we'll give up and commit the resulting tree. + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); + if (errorRetryLanes !== NoLanes) { + lanes = errorRetryLanes; + exitStatus = recoverFromConcurrentError(root, errorRetryLanes); + } + } + if (exitStatus === RootFatalErrored) { + var fatalError = workInProgressRootFatalError; + prepareFreshStack(root, NoLanes); + markRootSuspended$1(root, lanes); + ensureRootIsScheduled(root, now()); + throw fatalError; + } + if (exitStatus === RootDidNotComplete) { + // The render unwound without completing the tree. This happens in special + // cases where need to exit the current render without producing a + // consistent tree or committing. + // + // This should only happen during a concurrent render, not a discrete or + // synchronous update. We should have already checked for this when we + // unwound the stack. + markRootSuspended$1(root, lanes); + } else { + // The render completed. + // Check if this render may have yielded to a concurrent event, and if so, + // confirm that any newly rendered stores are consistent. + // TODO: It's possible that even a concurrent render may never have yielded + // to the main thread, if it was fast enough, or if it expired. We could + // skip the consistency check in that case, too. + var renderWasConcurrent = !includesBlockingLane(root, lanes); + var finishedWork = root.current.alternate; + if (renderWasConcurrent && !isRenderConsistentWithExternalStores(finishedWork)) { + // A store was mutated in an interleaved event. Render again, + // synchronously, to block further mutations. + exitStatus = renderRootSync(root, lanes); // We need to check again if something threw + + if (exitStatus === RootErrored) { + var _errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); + if (_errorRetryLanes !== NoLanes) { + lanes = _errorRetryLanes; + exitStatus = recoverFromConcurrentError(root, _errorRetryLanes); // We assume the tree is now consistent because we didn't yield to any + // concurrent events. + } + } + if (exitStatus === RootFatalErrored) { + var _fatalError = workInProgressRootFatalError; + prepareFreshStack(root, NoLanes); + markRootSuspended$1(root, lanes); + ensureRootIsScheduled(root, now()); + throw _fatalError; + } + } // We now have a consistent tree. The next step is either to commit it, + // or, if something suspended, wait to commit it after a timeout. + + root.finishedWork = finishedWork; + root.finishedLanes = lanes; + finishConcurrentRender(root, exitStatus, lanes); + } + } + ensureRootIsScheduled(root, now()); + if (root.callbackNode === originalCallbackNode) { + // The task node scheduled for this root is the same one that's + // currently executed. Need to return a continuation. + return performConcurrentWorkOnRoot.bind(null, root); + } + return null; + } + function recoverFromConcurrentError(root, errorRetryLanes) { + // If an error occurred during hydration, discard server response and fall + // back to client side render. + // Before rendering again, save the errors from the previous attempt. + var errorsFromFirstAttempt = workInProgressRootConcurrentErrors; + if (isRootDehydrated(root)) { + // The shell failed to hydrate. Set a flag to force a client rendering + // during the next attempt. To do this, we call prepareFreshStack now + // to create the root work-in-progress fiber. This is a bit weird in terms + // of factoring, because it relies on renderRootSync not calling + // prepareFreshStack again in the call below, which happens because the + // root and lanes haven't changed. + // + // TODO: I think what we should do is set ForceClientRender inside + // throwException, like we do for nested Suspense boundaries. The reason + // it's here instead is so we can switch to the synchronous work loop, too. + // Something to consider for a future refactor. + var rootWorkInProgress = prepareFreshStack(root, errorRetryLanes); + rootWorkInProgress.flags |= ForceClientRender; + { + errorHydratingContainer(root.containerInfo); + } + } + var exitStatus = renderRootSync(root, errorRetryLanes); + if (exitStatus !== RootErrored) { + // Successfully finished rendering on retry + // The errors from the failed first attempt have been recovered. Add + // them to the collection of recoverable errors. We'll log them in the + // commit phase. + var errorsFromSecondAttempt = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = errorsFromFirstAttempt; // The errors from the second attempt should be queued after the errors + // from the first attempt, to preserve the causal sequence. + + if (errorsFromSecondAttempt !== null) { + queueRecoverableErrors(errorsFromSecondAttempt); + } + } + return exitStatus; + } + function queueRecoverableErrors(errors) { + if (workInProgressRootRecoverableErrors === null) { + workInProgressRootRecoverableErrors = errors; + } else { + workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, errors); + } + } + function finishConcurrentRender(root, exitStatus, lanes) { + switch (exitStatus) { + case RootInProgress: + case RootFatalErrored: + { + throw new Error("Root did not complete. This is a bug in React."); + } + // Flow knows about invariant, so it complains if I add a break + // statement, but eslint doesn't know about invariant, so it complains + // if I do. eslint-disable-next-line no-fallthrough + + case RootErrored: + { + // We should have already attempted to retry this tree. If we reached + // this point, it errored again. Commit it. + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + } + case RootSuspended: + { + markRootSuspended$1(root, lanes); // We have an acceptable loading state. We need to figure out if we + // should immediately commit it or wait a bit. + + if (includesOnlyRetries(lanes) && + // do not delay if we're inside an act() scope + !shouldForceFlushFallbacksInDEV()) { + // This render only included retries, no updates. Throttle committing + // retries so that we don't show too many loading states too quickly. + var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); // Don't bother with a very short suspense time. + + if (msUntilTimeout > 10) { + var nextLanes = getNextLanes(root, NoLanes); + if (nextLanes !== NoLanes) { + // There's additional work on this root. + break; + } + var suspendedLanes = root.suspendedLanes; + if (!isSubsetOfLanes(suspendedLanes, lanes)) { + // We should prefer to render the fallback of at the last + // suspended level. Ping the last suspended level to try + // rendering it again. + // FIXME: What if the suspended lanes are Idle? Should not restart. + var eventTime = requestEventTime(); + markRootPinged(root, suspendedLanes); + break; + } // The render is suspended, it hasn't timed out, and there's no + // lower priority work to do. Instead of committing the fallback + // immediately, wait for more data to arrive. + + root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root, workInProgressRootRecoverableErrors, workInProgressTransitions), msUntilTimeout); + break; + } + } // The work expired. Commit immediately. + + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + } + case RootSuspendedWithDelay: + { + markRootSuspended$1(root, lanes); + if (includesOnlyTransitions(lanes)) { + // This is a transition, so we should exit without committing a + // placeholder and without scheduling a timeout. Delay indefinitely + // until we receive more data. + break; + } + if (!shouldForceFlushFallbacksInDEV()) { + // This is not a transition, but we did trigger an avoided state. + // Schedule a placeholder to display after a short delay, using the Just + // Noticeable Difference. + // TODO: Is the JND optimization worth the added complexity? If this is + // the only reason we track the event time, then probably not. + // Consider removing. + var mostRecentEventTime = getMostRecentEventTime(root, lanes); + var eventTimeMs = mostRecentEventTime; + var timeElapsedMs = now() - eventTimeMs; + var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time. + + if (_msUntilTimeout > 10) { + // Instead of committing the fallback immediately, wait for more data + // to arrive. + root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root, workInProgressRootRecoverableErrors, workInProgressTransitions), _msUntilTimeout); + break; + } + } // Commit the placeholder. + + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + } + case RootCompleted: + { + // The work completed. Ready to commit. + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + } + default: + { + throw new Error("Unknown root exit status."); + } + } + } + function isRenderConsistentWithExternalStores(finishedWork) { + // Search the rendered tree for external store reads, and check whether the + // stores were mutated in a concurrent event. Intentionally using an iterative + // loop instead of recursion so we can exit early. + var node = finishedWork; + while (true) { + if (node.flags & StoreConsistency) { + var updateQueue = node.updateQueue; + if (updateQueue !== null) { + var checks = updateQueue.stores; + if (checks !== null) { + for (var i = 0; i < checks.length; i++) { + var check = checks[i]; + var getSnapshot = check.getSnapshot; + var renderedValue = check.value; + try { + if (!objectIs(getSnapshot(), renderedValue)) { + // Found an inconsistent store. + return false; + } + } catch (error) { + // If `getSnapshot` throws, return `false`. This will schedule + // a re-render, and the error will be rethrown during render. + return false; + } + } + } + } + } + var child = node.child; + if (node.subtreeFlags & StoreConsistency && child !== null) { + child.return = node; + node = child; + continue; + } + if (node === finishedWork) { + return true; + } + while (node.sibling === null) { + if (node.return === null || node.return === finishedWork) { + return true; + } + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } // Flow doesn't know this is unreachable, but eslint does + // eslint-disable-next-line no-unreachable + + return true; + } + function markRootSuspended$1(root, suspendedLanes) { + // When suspending, we should always exclude lanes that were pinged or (more + // rarely, since we try to avoid it) updated during the render phase. + // TODO: Lol maybe there's a better way to factor this besides this + // obnoxiously named function :) + suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes); + suspendedLanes = removeLanes(suspendedLanes, workInProgressRootInterleavedUpdatedLanes); + markRootSuspended(root, suspendedLanes); + } // This is the entry point for synchronous tasks that don't go + // through Scheduler + + function performSyncWorkOnRoot(root) { + { + syncNestedUpdateFlag(); + } + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { + throw new Error("Should not already be working."); + } + flushPassiveEffects(); + var lanes = getNextLanes(root, NoLanes); + if (!includesSomeLane(lanes, SyncLane)) { + // There's no remaining sync work left. + ensureRootIsScheduled(root, now()); + return null; + } + var exitStatus = renderRootSync(root, lanes); + if (root.tag !== LegacyRoot && exitStatus === RootErrored) { + // If something threw an error, try rendering one more time. We'll render + // synchronously to block concurrent data mutations, and we'll includes + // all pending updates are included. If it still fails after the second + // attempt, we'll give up and commit the resulting tree. + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); + if (errorRetryLanes !== NoLanes) { + lanes = errorRetryLanes; + exitStatus = recoverFromConcurrentError(root, errorRetryLanes); + } + } + if (exitStatus === RootFatalErrored) { + var fatalError = workInProgressRootFatalError; + prepareFreshStack(root, NoLanes); + markRootSuspended$1(root, lanes); + ensureRootIsScheduled(root, now()); + throw fatalError; + } + if (exitStatus === RootDidNotComplete) { + throw new Error("Root did not complete. This is a bug in React."); + } // We now have a consistent tree. Because this is a sync render, we + // will commit it even if something suspended. + + var finishedWork = root.current.alternate; + root.finishedWork = finishedWork; + root.finishedLanes = lanes; + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); // Before exiting, make sure there's a callback scheduled for the next + // pending level. + + ensureRootIsScheduled(root, now()); + return null; + } + function batchedUpdates$1(fn, a) { + var prevExecutionContext = executionContext; + executionContext |= BatchedContext; + try { + return fn(a); + } finally { + executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer + // most batchedUpdates-like method. + + if (executionContext === NoContext && + // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode. + !ReactCurrentActQueue$1.isBatchingLegacy) { + resetRenderTimer(); + flushSyncCallbacksOnlyInLegacyMode(); + } + } + } + // Warning, this opts-out of checking the function body. + + // eslint-disable-next-line no-redeclare + function flushSync(fn) { + // In legacy mode, we flush pending passive effects at the beginning of the + // next event, not at the end of the previous one. + if (rootWithPendingPassiveEffects !== null && rootWithPendingPassiveEffects.tag === LegacyRoot && (executionContext & (RenderContext | CommitContext)) === NoContext) { + flushPassiveEffects(); + } + var prevExecutionContext = executionContext; + executionContext |= BatchedContext; + var prevTransition = ReactCurrentBatchConfig$2.transition; + var previousPriority = getCurrentUpdatePriority(); + try { + ReactCurrentBatchConfig$2.transition = null; + setCurrentUpdatePriority(DiscreteEventPriority); + if (fn) { + return fn(); + } else { + return undefined; + } + } finally { + setCurrentUpdatePriority(previousPriority); + ReactCurrentBatchConfig$2.transition = prevTransition; + executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch. + // Note that this will happen even if batchedUpdates is higher up + // the stack. + + if ((executionContext & (RenderContext | CommitContext)) === NoContext) { + flushSyncCallbacks(); + } + } + } + function pushRenderLanes(fiber, lanes) { + push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber); + subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes); + workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes); + } + function popRenderLanes(fiber) { + subtreeRenderLanes = subtreeRenderLanesCursor.current; + pop(subtreeRenderLanesCursor, fiber); + } + function prepareFreshStack(root, lanes) { + root.finishedWork = null; + root.finishedLanes = NoLanes; + var timeoutHandle = root.timeoutHandle; + if (timeoutHandle !== noTimeout) { + // The root previous suspended and scheduled a timeout to commit a fallback + // state. Now that we have additional work, cancel the timeout. + root.timeoutHandle = noTimeout; // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above + + cancelTimeout(timeoutHandle); + } + if (workInProgress !== null) { + var interruptedWork = workInProgress.return; + while (interruptedWork !== null) { + var current = interruptedWork.alternate; + unwindInterruptedWork(current, interruptedWork); + interruptedWork = interruptedWork.return; + } + } + workInProgressRoot = root; + var rootWorkInProgress = createWorkInProgress(root.current, null); + workInProgress = rootWorkInProgress; + workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes; + workInProgressRootExitStatus = RootInProgress; + workInProgressRootFatalError = null; + workInProgressRootSkippedLanes = NoLanes; + workInProgressRootInterleavedUpdatedLanes = NoLanes; + workInProgressRootPingedLanes = NoLanes; + workInProgressRootConcurrentErrors = null; + workInProgressRootRecoverableErrors = null; + finishQueueingConcurrentUpdates(); + { + ReactStrictModeWarnings.discardPendingWarnings(); + } + return rootWorkInProgress; + } + function handleError(root, thrownValue) { + do { + var erroredWork = workInProgress; + try { + // Reset module-level state that was set during the render phase. + resetContextDependencies(); + resetHooksAfterThrow(); + resetCurrentFiber(); // TODO: I found and added this missing line while investigating a + // separate issue. Write a regression test using string refs. + + ReactCurrentOwner$2.current = null; + if (erroredWork === null || erroredWork.return === null) { + // Expected to be working on a non-root fiber. This is a fatal error + // because there's no ancestor that can handle it; the root is + // supposed to capture all errors that weren't caught by an error + // boundary. + workInProgressRootExitStatus = RootFatalErrored; + workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next + // sibling, or the parent if there are no siblings. But since the root + // has no siblings nor a parent, we set it to null. Usually this is + // handled by `completeUnitOfWork` or `unwindWork`, but since we're + // intentionally not calling those, we need set it here. + // TODO: Consider calling `unwindWork` to pop the contexts. + + workInProgress = null; + return; + } + if (enableProfilerTimer && erroredWork.mode & ProfileMode) { + // Record the time spent rendering before an error was thrown. This + // avoids inaccurate Profiler durations in the case of a + // suspended render. + stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true); + } + if (enableSchedulingProfiler) { + markComponentRenderStopped(); + if (thrownValue !== null && typeof thrownValue === "object" && typeof thrownValue.then === "function") { + var wakeable = thrownValue; + markComponentSuspended(erroredWork, wakeable, workInProgressRootRenderLanes); + } else { + markComponentErrored(erroredWork, thrownValue, workInProgressRootRenderLanes); + } + } + throwException(root, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes); + completeUnitOfWork(erroredWork); + } catch (yetAnotherThrownValue) { + // Something in the return path also threw. + thrownValue = yetAnotherThrownValue; + if (workInProgress === erroredWork && erroredWork !== null) { + // If this boundary has already errored, then we had trouble processing + // the error. Bubble it to the next boundary. + erroredWork = erroredWork.return; + workInProgress = erroredWork; + } else { + erroredWork = workInProgress; + } + continue; + } // Return to the normal work loop. + + return; + } while (true); + } + function pushDispatcher() { + var prevDispatcher = ReactCurrentDispatcher$2.current; + ReactCurrentDispatcher$2.current = ContextOnlyDispatcher; + if (prevDispatcher === null) { + // The React isomorphic package does not include a default dispatcher. + // Instead the first renderer will lazily attach one, in order to give + // nicer error messages. + return ContextOnlyDispatcher; + } else { + return prevDispatcher; + } + } + function popDispatcher(prevDispatcher) { + ReactCurrentDispatcher$2.current = prevDispatcher; + } + function markCommitTimeOfFallback() { + globalMostRecentFallbackTime = now(); + } + function markSkippedUpdateLanes(lane) { + workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes); + } + function renderDidSuspend() { + if (workInProgressRootExitStatus === RootInProgress) { + workInProgressRootExitStatus = RootSuspended; + } + } + function renderDidSuspendDelayIfPossible() { + if (workInProgressRootExitStatus === RootInProgress || workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootErrored) { + workInProgressRootExitStatus = RootSuspendedWithDelay; + } // Check if there are updates that we skipped tree that might have unblocked + // this render. + + if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes))) { + // Mark the current render as suspended so that we switch to working on + // the updates that were skipped. Usually we only suspend at the end of + // the render phase. + // TODO: We should probably always mark the root as suspended immediately + // (inside this function), since by suspending at the end of the render + // phase introduces a potential mistake where we suspend lanes that were + // pinged or updated while we were rendering. + markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes); + } + } + function renderDidError(error) { + if (workInProgressRootExitStatus !== RootSuspendedWithDelay) { + workInProgressRootExitStatus = RootErrored; + } + if (workInProgressRootConcurrentErrors === null) { + workInProgressRootConcurrentErrors = [error]; + } else { + workInProgressRootConcurrentErrors.push(error); + } + } // Called during render to determine if anything has suspended. + // Returns false if we're not sure. + + function renderHasNotSuspendedYet() { + // If something errored or completed, we can't really be sure, + // so those are false. + return workInProgressRootExitStatus === RootInProgress; + } + function renderRootSync(root, lanes) { + var prevExecutionContext = executionContext; + executionContext |= RenderContext; + var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack + // and prepare a fresh one. Otherwise we'll continue where we left off. + + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { + { + if (isDevToolsPresent) { + var memoizedUpdaters = root.memoizedUpdaters; + if (memoizedUpdaters.size > 0) { + restorePendingUpdaters(root, workInProgressRootRenderLanes); + memoizedUpdaters.clear(); + } // At this point, move Fibers that scheduled the upcoming work from the Map to the Set. + // If we bailout on this work, we'll move them back (like above). + // It's important to move them now in case the work spawns more work at the same priority with different updaters. + // That way we can keep the current update and future updates separate. + + movePendingFibersToMemoized(root, lanes); + } + } + workInProgressTransitions = getTransitionsForLanes(); + prepareFreshStack(root, lanes); + } + do { + try { + workLoopSync(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } + } while (true); + resetContextDependencies(); + executionContext = prevExecutionContext; + popDispatcher(prevDispatcher); + if (workInProgress !== null) { + // This is a sync render, so we should have finished the whole tree. + throw new Error("Cannot commit an incomplete root. This error is likely caused by a " + "bug in React. Please file an issue."); + } + workInProgressRoot = null; + workInProgressRootRenderLanes = NoLanes; + return workInProgressRootExitStatus; + } // The work loop is an extremely hot path. Tell Closure not to inline it. + + /** @noinline */ + + function workLoopSync() { + // Already timed out, so perform work without checking if we need to yield. + while (workInProgress !== null) { + performUnitOfWork(workInProgress); + } + } + function renderRootConcurrent(root, lanes) { + var prevExecutionContext = executionContext; + executionContext |= RenderContext; + var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack + // and prepare a fresh one. Otherwise we'll continue where we left off. + + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { + { + if (isDevToolsPresent) { + var memoizedUpdaters = root.memoizedUpdaters; + if (memoizedUpdaters.size > 0) { + restorePendingUpdaters(root, workInProgressRootRenderLanes); + memoizedUpdaters.clear(); + } // At this point, move Fibers that scheduled the upcoming work from the Map to the Set. + // If we bailout on this work, we'll move them back (like above). + // It's important to move them now in case the work spawns more work at the same priority with different updaters. + // That way we can keep the current update and future updates separate. + + movePendingFibersToMemoized(root, lanes); + } + } + workInProgressTransitions = getTransitionsForLanes(); + resetRenderTimer(); + prepareFreshStack(root, lanes); + } + do { + try { + workLoopConcurrent(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } + } while (true); + resetContextDependencies(); + popDispatcher(prevDispatcher); + executionContext = prevExecutionContext; + if (workInProgress !== null) { + return RootInProgress; + } else { + workInProgressRoot = null; + workInProgressRootRenderLanes = NoLanes; // Return the final exit status. + + return workInProgressRootExitStatus; + } + } + /** @noinline */ + + function workLoopConcurrent() { + // Perform work until Scheduler asks us to yield + while (workInProgress !== null && !shouldYield()) { + performUnitOfWork(workInProgress); + } + } + function performUnitOfWork(unitOfWork) { + // The current, flushed, state of this fiber is the alternate. Ideally + // nothing should rely on this, but relying on it here means that we don't + // need an additional field on the work in progress. + var current = unitOfWork.alternate; + setCurrentFiber(unitOfWork); + var next; + if ((unitOfWork.mode & ProfileMode) !== NoMode) { + startProfilerTimer(unitOfWork); + next = beginWork$1(current, unitOfWork, subtreeRenderLanes); + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true); + } else { + next = beginWork$1(current, unitOfWork, subtreeRenderLanes); + } + resetCurrentFiber(); + unitOfWork.memoizedProps = unitOfWork.pendingProps; + if (next === null) { + // If this doesn't spawn new work, complete the current work. + completeUnitOfWork(unitOfWork); + } else { + workInProgress = next; + } + ReactCurrentOwner$2.current = null; + } + function completeUnitOfWork(unitOfWork) { + // Attempt to complete the current unit of work, then move to the next + // sibling. If there are no more siblings, return to the parent fiber. + var completedWork = unitOfWork; + do { + // The current, flushed, state of this fiber is the alternate. Ideally + // nothing should rely on this, but relying on it here means that we don't + // need an additional field on the work in progress. + var current = completedWork.alternate; + var returnFiber = completedWork.return; // Check if the work completed or if something threw. + + if ((completedWork.flags & Incomplete) === NoFlags) { + setCurrentFiber(completedWork); + var next = void 0; + if ((completedWork.mode & ProfileMode) === NoMode) { + next = completeWork(current, completedWork, subtreeRenderLanes); + } else { + startProfilerTimer(completedWork); + next = completeWork(current, completedWork, subtreeRenderLanes); // Update render duration assuming we didn't error. + + stopProfilerTimerIfRunningAndRecordDelta(completedWork, false); + } + resetCurrentFiber(); + if (next !== null) { + // Completing this fiber spawned new work. Work on that next. + workInProgress = next; + return; + } + } else { + // This fiber did not complete because something threw. Pop values off + // the stack without entering the complete phase. If this is a boundary, + // capture values if possible. + var _next = unwindWork(current, completedWork); // Because this fiber did not complete, don't reset its lanes. + + if (_next !== null) { + // If completing this work spawned new work, do that next. We'll come + // back here again. + // Since we're restarting, remove anything that is not a host effect + // from the effect tag. + _next.flags &= HostEffectMask; + workInProgress = _next; + return; + } + if ((completedWork.mode & ProfileMode) !== NoMode) { + // Record the render duration for the fiber that errored. + stopProfilerTimerIfRunningAndRecordDelta(completedWork, false); // Include the time spent working on failed children before continuing. + + var actualDuration = completedWork.actualDuration; + var child = completedWork.child; + while (child !== null) { + actualDuration += child.actualDuration; + child = child.sibling; + } + completedWork.actualDuration = actualDuration; + } + if (returnFiber !== null) { + // Mark the parent fiber as incomplete and clear its subtree flags. + returnFiber.flags |= Incomplete; + returnFiber.subtreeFlags = NoFlags; + returnFiber.deletions = null; + } else { + // We've unwound all the way to the root. + workInProgressRootExitStatus = RootDidNotComplete; + workInProgress = null; + return; + } + } + var siblingFiber = completedWork.sibling; + if (siblingFiber !== null) { + // If there is more work to do in this returnFiber, do that next. + workInProgress = siblingFiber; + return; + } // Otherwise, return to the parent + + completedWork = returnFiber; // Update the next thing we're working on in case something throws. + + workInProgress = completedWork; + } while (completedWork !== null); // We've reached the root. + + if (workInProgressRootExitStatus === RootInProgress) { + workInProgressRootExitStatus = RootCompleted; + } + } + function commitRoot(root, recoverableErrors, transitions) { + // TODO: This no longer makes any sense. We already wrap the mutation and + // layout phases. Should be able to remove. + var previousUpdateLanePriority = getCurrentUpdatePriority(); + var prevTransition = ReactCurrentBatchConfig$2.transition; + try { + ReactCurrentBatchConfig$2.transition = null; + setCurrentUpdatePriority(DiscreteEventPriority); + commitRootImpl(root, recoverableErrors, transitions, previousUpdateLanePriority); + } finally { + ReactCurrentBatchConfig$2.transition = prevTransition; + setCurrentUpdatePriority(previousUpdateLanePriority); + } + return null; + } + function commitRootImpl(root, recoverableErrors, transitions, renderPriorityLevel) { + do { + // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which + // means `flushPassiveEffects` will sometimes result in additional + // passive effects. So we need to keep flushing in a loop until there are + // no more pending effects. + // TODO: Might be better if `flushPassiveEffects` did not automatically + // flush synchronous work at the end, to avoid factoring hazards like this. + flushPassiveEffects(); + } while (rootWithPendingPassiveEffects !== null); + flushRenderPhaseStrictModeWarningsInDEV(); + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { + throw new Error("Should not already be working."); + } + var finishedWork = root.finishedWork; + var lanes = root.finishedLanes; + if (finishedWork === null) { + return null; + } else { + { + if (lanes === NoLanes) { + error("root.finishedLanes should not be empty during a commit. This is a " + "bug in React."); + } + } + } + root.finishedWork = null; + root.finishedLanes = NoLanes; + if (finishedWork === root.current) { + throw new Error("Cannot commit the same tree as before. This error is likely caused by " + "a bug in React. Please file an issue."); + } // commitRoot never returns a continuation; it always finishes synchronously. + // So we can clear these now to allow a new callback to be scheduled. + + root.callbackNode = null; + root.callbackPriority = NoLane; // Update the first and last pending times on this root. The new first + // pending time is whatever is left on the root fiber. + + var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes); + markRootFinished(root, remainingLanes); + if (root === workInProgressRoot) { + // We can reset these now that they are finished. + workInProgressRoot = null; + workInProgress = null; + workInProgressRootRenderLanes = NoLanes; + } // If there are pending passive effects, schedule a callback to process them. + // Do this as early as possible, so it is queued before anything else that + // might get scheduled in the commit phase. (See #16714.) + // TODO: Delete all other places that schedule the passive effect callback + // They're redundant. + + if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags || (finishedWork.flags & PassiveMask) !== NoFlags) { + if (!rootDoesHavePassiveEffects) { + rootDoesHavePassiveEffects = true; + // to store it in pendingPassiveTransitions until they get processed + // We need to pass this through as an argument to commitRoot + // because workInProgressTransitions might have changed between + // the previous render and commit if we throttle the commit + // with setTimeout + + pendingPassiveTransitions = transitions; + scheduleCallback$1(NormalPriority, function () { + flushPassiveEffects(); // This render triggered passive effects: release the root cache pool + // *after* passive effects fire to avoid freeing a cache pool that may + // be referenced by a node in the tree (HostRoot, Cache boundary etc) + + return null; + }); + } + } // Check if there are any effects in the whole tree. + // TODO: This is left over from the effect list implementation, where we had + // to check for the existence of `firstEffect` to satisfy Flow. I think the + // only other reason this optimization exists is because it affects profiling. + // Reconsider whether this is necessary. + + var subtreeHasEffects = (finishedWork.subtreeFlags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags; + var rootHasEffect = (finishedWork.flags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags; + if (subtreeHasEffects || rootHasEffect) { + var prevTransition = ReactCurrentBatchConfig$2.transition; + ReactCurrentBatchConfig$2.transition = null; + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(DiscreteEventPriority); + var prevExecutionContext = executionContext; + executionContext |= CommitContext; // Reset this to null before calling lifecycles + + ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass + // of the effect list for each phase: all mutation effects come before all + // layout effects, and so on. + // The first phase a "before mutation" phase. We use this phase to read the + // state of the host tree right before we mutate it. This is where + // getSnapshotBeforeUpdate is called. + + var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects(root, finishedWork); + { + // Mark the current commit time to be shared by all Profilers in this + // batch. This enables them to be grouped later. + recordCommitTime(); + } + commitMutationEffects(root, finishedWork, lanes); + resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after + // the mutation phase, so that the previous tree is still current during + // componentWillUnmount, but before the layout phase, so that the finished + // work is current during componentDidMount/Update. + + root.current = finishedWork; // The next phase is the layout phase, where we call effects that read + + commitLayoutEffects(finishedWork, root, lanes); + // opportunity to paint. + + requestPaint(); + executionContext = prevExecutionContext; // Reset the priority to the previous non-sync value. + + setCurrentUpdatePriority(previousPriority); + ReactCurrentBatchConfig$2.transition = prevTransition; + } else { + // No effects. + root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were + // no effects. + // TODO: Maybe there's a better way to report this. + + { + recordCommitTime(); + } + } + if (rootDoesHavePassiveEffects) { + // This commit has passive effects. Stash a reference to them. But don't + // schedule a callback until after flushing layout work. + rootDoesHavePassiveEffects = false; + rootWithPendingPassiveEffects = root; + pendingPassiveEffectsLanes = lanes; + } else { + { + nestedPassiveUpdateCount = 0; + rootWithPassiveNestedUpdates = null; + } + } // Read this again, since an effect might have updated it + + remainingLanes = root.pendingLanes; // Check if there's remaining work on this root + // TODO: This is part of the `componentDidCatch` implementation. Its purpose + // is to detect whether something might have called setState inside + // `componentDidCatch`. The mechanism is known to be flawed because `setState` + // inside `componentDidCatch` is itself flawed — that's why we recommend + // `getDerivedStateFromError` instead. However, it could be improved by + // checking if remainingLanes includes Sync work, instead of whether there's + // any work remaining at all (which would also include stuff like Suspense + // retries or transitions). It's been like this for a while, though, so fixing + // it probably isn't that urgent. + + if (remainingLanes === NoLanes) { + // If there's no remaining work, we can clear the set of already failed + // error boundaries. + legacyErrorBoundariesThatAlreadyFailed = null; + } + onCommitRoot(finishedWork.stateNode, renderPriorityLevel); + { + if (isDevToolsPresent) { + root.memoizedUpdaters.clear(); + } + } + // additional work on this root is scheduled. + + ensureRootIsScheduled(root, now()); + if (recoverableErrors !== null) { + // There were errors during this render, but recovered from them without + // needing to surface it to the UI. We log them here. + var onRecoverableError = root.onRecoverableError; + for (var i = 0; i < recoverableErrors.length; i++) { + var recoverableError = recoverableErrors[i]; + var componentStack = recoverableError.stack; + var digest = recoverableError.digest; + onRecoverableError(recoverableError.value, { + componentStack: componentStack, + digest: digest + }); + } + } + if (hasUncaughtError) { + hasUncaughtError = false; + var error$1 = firstUncaughtError; + firstUncaughtError = null; + throw error$1; + } // If the passive effects are the result of a discrete render, flush them + // synchronously at the end of the current task so that the result is + // immediately observable. Otherwise, we assume that they are not + // order-dependent and do not need to be observed by external systems, so we + // can wait until after paint. + // TODO: We can optimize this by not scheduling the callback earlier. Since we + // currently schedule the callback in multiple places, will wait until those + // are consolidated. + + if (includesSomeLane(pendingPassiveEffectsLanes, SyncLane) && root.tag !== LegacyRoot) { + flushPassiveEffects(); + } // Read this again, since a passive effect might have updated it + + remainingLanes = root.pendingLanes; + if (includesSomeLane(remainingLanes, SyncLane)) { + { + markNestedUpdateScheduled(); + } // Count the number of times the root synchronously re-renders without + // finishing. If there are too many, it indicates an infinite update loop. + + if (root === rootWithNestedUpdates) { + nestedUpdateCount++; + } else { + nestedUpdateCount = 0; + rootWithNestedUpdates = root; + } + } else { + nestedUpdateCount = 0; + } // If layout work was scheduled, flush it now. + + flushSyncCallbacks(); + return null; + } + function flushPassiveEffects() { + // Returns whether passive effects were flushed. + // TODO: Combine this check with the one in flushPassiveEFfectsImpl. We should + // probably just combine the two functions. I believe they were only separate + // in the first place because we used to wrap it with + // `Scheduler.runWithPriority`, which accepts a function. But now we track the + // priority within React itself, so we can mutate the variable directly. + if (rootWithPendingPassiveEffects !== null) { + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); + var priority = lowerEventPriority(DefaultEventPriority, renderPriority); + var prevTransition = ReactCurrentBatchConfig$2.transition; + var previousPriority = getCurrentUpdatePriority(); + try { + ReactCurrentBatchConfig$2.transition = null; + setCurrentUpdatePriority(priority); + return flushPassiveEffectsImpl(); + } finally { + setCurrentUpdatePriority(previousPriority); + ReactCurrentBatchConfig$2.transition = prevTransition; // Once passive effects have run for the tree - giving components a + } + } + return false; + } + function enqueuePendingPassiveProfilerEffect(fiber) { + { + pendingPassiveProfilerEffects.push(fiber); + if (!rootDoesHavePassiveEffects) { + rootDoesHavePassiveEffects = true; + scheduleCallback$1(NormalPriority, function () { + flushPassiveEffects(); + return null; + }); + } + } + } + function flushPassiveEffectsImpl() { + if (rootWithPendingPassiveEffects === null) { + return false; + } // Cache and clear the transitions flag + + var transitions = pendingPassiveTransitions; + pendingPassiveTransitions = null; + var root = rootWithPendingPassiveEffects; + var lanes = pendingPassiveEffectsLanes; + rootWithPendingPassiveEffects = null; // TODO: This is sometimes out of sync with rootWithPendingPassiveEffects. + // Figure out why and fix it. It's not causing any known issues (probably + // because it's only used for profiling), but it's a refactor hazard. + + pendingPassiveEffectsLanes = NoLanes; + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { + throw new Error("Cannot flush passive effects while already rendering."); + } + { + isFlushingPassiveEffects = true; + didScheduleUpdateDuringPassiveEffects = false; + } + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + commitPassiveUnmountEffects(root.current); + commitPassiveMountEffects(root, root.current, lanes, transitions); // TODO: Move to commitPassiveMountEffects + + { + var profilerEffects = pendingPassiveProfilerEffects; + pendingPassiveProfilerEffects = []; + for (var i = 0; i < profilerEffects.length; i++) { + var _fiber = profilerEffects[i]; + commitPassiveEffectDurations(root, _fiber); + } + } + executionContext = prevExecutionContext; + flushSyncCallbacks(); + { + // If additional passive effects were scheduled, increment a counter. If this + // exceeds the limit, we'll fire a warning. + if (didScheduleUpdateDuringPassiveEffects) { + if (root === rootWithPassiveNestedUpdates) { + nestedPassiveUpdateCount++; + } else { + nestedPassiveUpdateCount = 0; + rootWithPassiveNestedUpdates = root; + } + } else { + nestedPassiveUpdateCount = 0; + } + isFlushingPassiveEffects = false; + didScheduleUpdateDuringPassiveEffects = false; + } // TODO: Move to commitPassiveMountEffects + + onPostCommitRoot(root); + { + var stateNode = root.current.stateNode; + stateNode.effectDuration = 0; + stateNode.passiveEffectDuration = 0; + } + return true; + } + function isAlreadyFailedLegacyErrorBoundary(instance) { + return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance); + } + function markLegacyErrorBoundaryAsFailed(instance) { + if (legacyErrorBoundariesThatAlreadyFailed === null) { + legacyErrorBoundariesThatAlreadyFailed = new Set([instance]); + } else { + legacyErrorBoundariesThatAlreadyFailed.add(instance); + } + } + function prepareToThrowUncaughtError(error) { + if (!hasUncaughtError) { + hasUncaughtError = true; + firstUncaughtError = error; + } + } + var onUncaughtError = prepareToThrowUncaughtError; + function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { + var errorInfo = createCapturedValueAtFiber(error, sourceFiber); + var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane); + var root = enqueueUpdate(rootFiber, update, SyncLane); + var eventTime = requestEventTime(); + if (root !== null) { + markRootUpdated(root, SyncLane, eventTime); + ensureRootIsScheduled(root, eventTime); + } + } + function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) { + { + reportUncaughtErrorInDEV(error$1); + setIsRunningInsertionEffect(false); + } + if (sourceFiber.tag === HostRoot) { + // Error was thrown at the root. There is no parent, so the root + // itself should capture it. + captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error$1); + return; + } + var fiber = null; + { + fiber = sourceFiber.return; + } + while (fiber !== null) { + if (fiber.tag === HostRoot) { + captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error$1); + return; + } else if (fiber.tag === ClassComponent) { + var ctor = fiber.type; + var instance = fiber.stateNode; + if (typeof ctor.getDerivedStateFromError === "function" || typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance)) { + var errorInfo = createCapturedValueAtFiber(error$1, sourceFiber); + var update = createClassErrorUpdate(fiber, errorInfo, SyncLane); + var root = enqueueUpdate(fiber, update, SyncLane); + var eventTime = requestEventTime(); + if (root !== null) { + markRootUpdated(root, SyncLane, eventTime); + ensureRootIsScheduled(root, eventTime); + } + return; + } + } + fiber = fiber.return; + } + { + // TODO: Until we re-land skipUnmountedBoundaries (see #20147), this warning + // will fire for errors that are thrown by destroy functions inside deleted + // trees. What it should instead do is propagate the error to the parent of + // the deleted tree. In the meantime, do not add this warning to the + // allowlist; this is only for our internal use. + error("Internal React error: Attempted to capture a commit phase error " + "inside a detached tree. This indicates a bug in React. Likely " + "causes include deleting the same fiber more than once, committing an " + "already-finished tree, or an inconsistent return pointer.\n\n" + "Error message:\n\n%s", error$1); + } + } + function pingSuspendedRoot(root, wakeable, pingedLanes) { + var pingCache = root.pingCache; + if (pingCache !== null) { + // The wakeable resolved, so we no longer need to memoize, because it will + // never be thrown again. + pingCache.delete(wakeable); + } + var eventTime = requestEventTime(); + markRootPinged(root, pingedLanes); + warnIfSuspenseResolutionNotWrappedWithActDEV(root); + if (workInProgressRoot === root && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) { + // Received a ping at the same priority level at which we're currently + // rendering. We might want to restart this render. This should mirror + // the logic of whether or not a root suspends once it completes. + // TODO: If we're rendering sync either due to Sync, Batched or expired, + // we should probably never restart. + // If we're suspended with delay, or if it's a retry, we'll always suspend + // so we can always restart. + if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) { + // Restart from the root. + prepareFreshStack(root, NoLanes); + } else { + // Even though we can't restart right now, we might get an + // opportunity later. So we mark this render as having a ping. + workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes); + } + } + ensureRootIsScheduled(root, eventTime); + } + function retryTimedOutBoundary(boundaryFiber, retryLane) { + // The boundary fiber (a Suspense component or SuspenseList component) + // previously was rendered in its fallback state. One of the promises that + // suspended it has resolved, which means at least part of the tree was + // likely unblocked. Try rendering again, at a new lanes. + if (retryLane === NoLane) { + // TODO: Assign this to `suspenseState.retryLane`? to avoid + // unnecessary entanglement? + retryLane = requestRetryLane(boundaryFiber); + } // TODO: Special case idle priority? + + var eventTime = requestEventTime(); + var root = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); + if (root !== null) { + markRootUpdated(root, retryLane, eventTime); + ensureRootIsScheduled(root, eventTime); + } + } + function retryDehydratedSuspenseBoundary(boundaryFiber) { + var suspenseState = boundaryFiber.memoizedState; + var retryLane = NoLane; + if (suspenseState !== null) { + retryLane = suspenseState.retryLane; + } + retryTimedOutBoundary(boundaryFiber, retryLane); + } + function resolveRetryWakeable(boundaryFiber, wakeable) { + var retryLane = NoLane; // Default + + var retryCache; + switch (boundaryFiber.tag) { + case SuspenseComponent: + retryCache = boundaryFiber.stateNode; + var suspenseState = boundaryFiber.memoizedState; + if (suspenseState !== null) { + retryLane = suspenseState.retryLane; + } + break; + case SuspenseListComponent: + retryCache = boundaryFiber.stateNode; + break; + default: + throw new Error("Pinged unknown suspense boundary type. " + "This is probably a bug in React."); + } + if (retryCache !== null) { + // The wakeable resolved, so we no longer need to memoize, because it will + // never be thrown again. + retryCache.delete(wakeable); + } + retryTimedOutBoundary(boundaryFiber, retryLane); + } // Computes the next Just Noticeable Difference (JND) boundary. + // The theory is that a person can't tell the difference between small differences in time. + // Therefore, if we wait a bit longer than necessary that won't translate to a noticeable + // difference in the experience. However, waiting for longer might mean that we can avoid + // showing an intermediate loading state. The longer we have already waited, the harder it + // is to tell small differences in time. Therefore, the longer we've already waited, + // the longer we can wait additionally. At some point we have to give up though. + // We pick a train model where the next boundary commits at a consistent schedule. + // These particular numbers are vague estimates. We expect to adjust them based on research. + + function jnd(timeElapsed) { + return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960; + } + function checkForNestedUpdates() { + if (nestedUpdateCount > NESTED_UPDATE_LIMIT) { + nestedUpdateCount = 0; + rootWithNestedUpdates = null; + throw new 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."); + } + { + if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) { + nestedPassiveUpdateCount = 0; + rootWithPassiveNestedUpdates = null; + error("Maximum update depth exceeded. This can happen when a component " + "calls setState inside useEffect, but useEffect either doesn't " + "have a dependency array, or one of the dependencies changes on " + "every render."); + } + } + } + function flushRenderPhaseStrictModeWarningsInDEV() { + { + ReactStrictModeWarnings.flushLegacyContextWarning(); + { + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); + } + } + } + var didWarnStateUpdateForNotYetMountedComponent = null; + function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) { + { + if ((executionContext & RenderContext) !== NoContext) { + // We let the other warning about render phase updates deal with this one. + return; + } + if (!(fiber.mode & ConcurrentMode)) { + return; + } + var tag = fiber.tag; + if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) { + // Only warn for user-defined components, not internal ones like Suspense. + return; + } // We show the whole stack but dedupe on the top component's name because + // the problematic code almost always lies inside that component. + + var componentName = getComponentNameFromFiber(fiber) || "ReactComponent"; + if (didWarnStateUpdateForNotYetMountedComponent !== null) { + if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) { + return; + } + didWarnStateUpdateForNotYetMountedComponent.add(componentName); + } else { + didWarnStateUpdateForNotYetMountedComponent = new Set([componentName]); + } + var previousFiber = current; + try { + setCurrentFiber(fiber); + error("Can't perform a React state update on a component that hasn't mounted yet. " + "This indicates that you have a side-effect in your render function that " + "asynchronously later calls tries to update the component. Move this work to " + "useEffect instead."); + } finally { + if (previousFiber) { + setCurrentFiber(fiber); + } else { + resetCurrentFiber(); + } + } + } + } + var beginWork$1; + { + var dummyFiber = null; + beginWork$1 = function beginWork$1(current, unitOfWork, lanes) { + // If a component throws an error, we replay it again in a synchronously + // dispatched event, so that the debugger will treat it as an uncaught + // error See ReactErrorUtils for more information. + // Before entering the begin phase, copy the work-in-progress onto a dummy + // fiber. If beginWork throws, we'll use this to reset the state. + var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork); + try { + return beginWork(current, unitOfWork, lanes); + } catch (originalError) { + if (didSuspendOrErrorWhileHydratingDEV() || originalError !== null && typeof originalError === "object" && typeof originalError.then === "function") { + // Don't replay promises. + // Don't replay errors if we are hydrating and have already suspended or handled an error + throw originalError; + } // Keep this code in sync with handleError; any changes here must have + // corresponding changes there. + + resetContextDependencies(); + resetHooksAfterThrow(); // Don't reset current debug fiber, since we're about to work on the + // same fiber again. + // Unwind the failed stack frame + + unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber. + + assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); + if (unitOfWork.mode & ProfileMode) { + // Reset the profiler timer. + startProfilerTimer(unitOfWork); + } // Run beginWork again. + + invokeGuardedCallback(null, beginWork, null, current, unitOfWork, lanes); + if (hasCaughtError()) { + var replayError = clearCaughtError(); + if (typeof replayError === "object" && replayError !== null && replayError._suppressLogging && typeof originalError === "object" && originalError !== null && !originalError._suppressLogging) { + // If suppressed, let the flag carry over to the original error which is the one we'll rethrow. + originalError._suppressLogging = true; + } + } // We always throw the original error in case the second render pass is not idempotent. + // This can happen if a memoized function or CommonJS module doesn't throw after first invocation. + + throw originalError; + } + }; + } + var didWarnAboutUpdateInRender = false; + var didWarnAboutUpdateInRenderForAnotherComponent; + { + didWarnAboutUpdateInRenderForAnotherComponent = new Set(); + } + function warnAboutRenderPhaseUpdatesInDEV(fiber) { + { + if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) { + switch (fiber.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + { + var renderingComponentName = workInProgress && getComponentNameFromFiber(workInProgress) || "Unknown"; // Dedupe by the rendering component because it's the one that needs to be fixed. + + var dedupeKey = renderingComponentName; + if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) { + didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey); + var setStateComponentName = getComponentNameFromFiber(fiber) || "Unknown"; + error("Cannot update a component (`%s`) while rendering a " + "different component (`%s`). To locate the bad setState() call inside `%s`, " + "follow the stack trace as described in https://react.dev/link/setstate-in-render", setStateComponentName, renderingComponentName, renderingComponentName); + } + break; + } + case ClassComponent: + { + if (!didWarnAboutUpdateInRender) { + error("Cannot update during an existing state transition (such as " + "within `render`). Render methods should be a pure " + "function of props and state."); + didWarnAboutUpdateInRender = true; + } + break; + } + } + } + } + } + function restorePendingUpdaters(root, lanes) { + { + if (isDevToolsPresent) { + var memoizedUpdaters = root.memoizedUpdaters; + memoizedUpdaters.forEach(function (schedulingFiber) { + addFiberToLanesMap(root, schedulingFiber, lanes); + }); // This function intentionally does not clear memoized updaters. + // Those may still be relevant to the current commit + // and a future one (e.g. Suspense). + } + } + } + var fakeActCallbackNode = {}; + function scheduleCallback$1(priorityLevel, callback) { + { + // If we're currently inside an `act` scope, bypass Scheduler and push to + // the `act` queue instead. + var actQueue = ReactCurrentActQueue$1.current; + if (actQueue !== null) { + actQueue.push(callback); + return fakeActCallbackNode; + } else { + return scheduleCallback(priorityLevel, callback); + } + } + } + function cancelCallback$1(callbackNode) { + if (callbackNode === fakeActCallbackNode) { + return; + } // In production, always call Scheduler. This function will be stripped out. + + return cancelCallback(callbackNode); + } + function shouldForceFlushFallbacksInDEV() { + // Never force flush in production. This function should get stripped out. + return ReactCurrentActQueue$1.current !== null; + } + function warnIfUpdatesNotWrappedWithActDEV(fiber) { + { + if (fiber.mode & ConcurrentMode) { + if (!isConcurrentActEnvironment()) { + // Not in an act environment. No need to warn. + return; + } + } else { + // Legacy mode has additional cases where we suppress a warning. + if (!isLegacyActEnvironment()) { + // Not in an act environment. No need to warn. + return; + } + if (executionContext !== NoContext) { + // Legacy mode doesn't warn if the update is batched, i.e. + // batchedUpdates or flushSync. + return; + } + if (fiber.tag !== FunctionComponent && fiber.tag !== ForwardRef && fiber.tag !== SimpleMemoComponent) { + // For backwards compatibility with pre-hooks code, legacy mode only + // warns for updates that originate from a hook. + return; + } + } + if (ReactCurrentActQueue$1.current === null) { + var previousFiber = current; + try { + setCurrentFiber(fiber); + error("An update to %s inside a test was not wrapped in act(...).\n\n" + "When testing, code that causes React state updates should be " + "wrapped into act(...):\n\n" + "act(() => {\n" + " /* fire events that update state */\n" + "});\n" + "/* assert on the output */\n\n" + "This ensures that you're testing the behavior the user would see " + "in the browser." + " Learn more at https://react.dev/link/wrap-tests-with-act", getComponentNameFromFiber(fiber)); + } finally { + if (previousFiber) { + setCurrentFiber(fiber); + } else { + resetCurrentFiber(); + } + } + } + } + } + function warnIfSuspenseResolutionNotWrappedWithActDEV(root) { + { + if (root.tag !== LegacyRoot && isConcurrentActEnvironment() && ReactCurrentActQueue$1.current === null) { + error("A suspended resource finished loading inside a test, but the event " + "was not wrapped in act(...).\n\n" + "When testing, code that resolves suspended data should be wrapped " + "into act(...):\n\n" + "act(() => {\n" + " /* finish loading suspended data */\n" + "});\n" + "/* assert on the output */\n\n" + "This ensures that you're testing the behavior the user would see " + "in the browser." + " Learn more at https://react.dev/link/wrap-tests-with-act"); + } + } + } + function setIsRunningInsertionEffect(isRunning) { + { + isRunningInsertionEffect = isRunning; + } + } + + /* eslint-disable react-internal/prod-error-codes */ + var resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below. + + var failedBoundaries = null; + var setRefreshHandler = function setRefreshHandler(handler) { + { + resolveFamily = handler; + } + }; + function resolveFunctionForHotReloading(type) { + { + if (resolveFamily === null) { + // Hot reloading is disabled. + return type; + } + var family = resolveFamily(type); + if (family === undefined) { + return type; + } // Use the latest known implementation. + + return family.current; + } + } + function resolveClassForHotReloading(type) { + // No implementation differences. + return resolveFunctionForHotReloading(type); + } + function resolveForwardRefForHotReloading(type) { + { + if (resolveFamily === null) { + // Hot reloading is disabled. + return type; + } + var family = resolveFamily(type); + if (family === undefined) { + // Check if we're dealing with a real forwardRef. Don't want to crash early. + if (type !== null && type !== undefined && typeof type.render === "function") { + // ForwardRef is special because its resolved .type is an object, + // but it's possible that we only have its inner render function in the map. + // If that inner render function is different, we'll build a new forwardRef type. + var currentRender = resolveFunctionForHotReloading(type.render); + if (type.render !== currentRender) { + var syntheticType = { + $$typeof: REACT_FORWARD_REF_TYPE, + render: currentRender + }; + if (type.displayName !== undefined) { + syntheticType.displayName = type.displayName; + } + return syntheticType; + } + } + return type; + } // Use the latest known implementation. + + return family.current; + } + } + function isCompatibleFamilyForHotReloading(fiber, element) { + { + if (resolveFamily === null) { + // Hot reloading is disabled. + return false; + } + var prevType = fiber.elementType; + var nextType = element.type; // If we got here, we know types aren't === equal. + + var needsCompareFamilies = false; + var $$typeofNextType = typeof nextType === "object" && nextType !== null ? nextType.$$typeof : null; + switch (fiber.tag) { + case ClassComponent: + { + if (typeof nextType === "function") { + needsCompareFamilies = true; + } + break; + } + case FunctionComponent: + { + if (typeof nextType === "function") { + needsCompareFamilies = true; + } else if ($$typeofNextType === REACT_LAZY_TYPE) { + // We don't know the inner type yet. + // We're going to assume that the lazy inner type is stable, + // and so it is sufficient to avoid reconciling it away. + // We're not going to unwrap or actually use the new lazy type. + needsCompareFamilies = true; + } + break; + } + case ForwardRef: + { + if ($$typeofNextType === REACT_FORWARD_REF_TYPE) { + needsCompareFamilies = true; + } else if ($$typeofNextType === REACT_LAZY_TYPE) { + needsCompareFamilies = true; + } + break; + } + case MemoComponent: + case SimpleMemoComponent: + { + if ($$typeofNextType === REACT_MEMO_TYPE) { + // TODO: if it was but can no longer be simple, + // we shouldn't set this. + needsCompareFamilies = true; + } else if ($$typeofNextType === REACT_LAZY_TYPE) { + needsCompareFamilies = true; + } + break; + } + default: + return false; + } // Check if both types have a family and it's the same one. + + if (needsCompareFamilies) { + // Note: memo() and forwardRef() we'll compare outer rather than inner type. + // This means both of them need to be registered to preserve state. + // If we unwrapped and compared the inner types for wrappers instead, + // then we would risk falsely saying two separate memo(Foo) + // calls are equivalent because they wrap the same Foo function. + var prevFamily = resolveFamily(prevType); + if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) { + return true; + } + } + return false; + } + } + function markFailedErrorBoundaryForHotReloading(fiber) { + { + if (resolveFamily === null) { + // Hot reloading is disabled. + return; + } + if (typeof WeakSet !== "function") { + return; + } + if (failedBoundaries === null) { + failedBoundaries = new WeakSet(); + } + failedBoundaries.add(fiber); + } + } + var scheduleRefresh = function scheduleRefresh(root, update) { + { + if (resolveFamily === null) { + // Hot reloading is disabled. + return; + } + var staleFamilies = update.staleFamilies, + updatedFamilies = update.updatedFamilies; + flushPassiveEffects(); + flushSync(function () { + scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies); + }); + } + }; + var scheduleRoot = function scheduleRoot(root, element) { + { + if (root.context !== emptyContextObject) { + // Super edge case: root has a legacy _renderSubtree context + // but we don't know the parentComponent so we can't pass it. + // Just ignore. We'll delete this with _renderSubtree code path later. + return; + } + flushPassiveEffects(); + flushSync(function () { + updateContainer(element, root, null, null); + }); + } + }; + function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) { + { + var alternate = fiber.alternate, + child = fiber.child, + sibling = fiber.sibling, + tag = fiber.tag, + type = fiber.type; + var candidateType = null; + switch (tag) { + case FunctionComponent: + case SimpleMemoComponent: + case ClassComponent: + candidateType = type; + break; + case ForwardRef: + candidateType = type.render; + break; + } + if (resolveFamily === null) { + throw new Error("Expected resolveFamily to be set during hot reload."); + } + var needsRender = false; + var needsRemount = false; + if (candidateType !== null) { + var family = resolveFamily(candidateType); + if (family !== undefined) { + if (staleFamilies.has(family)) { + needsRemount = true; + } else if (updatedFamilies.has(family)) { + if (tag === ClassComponent) { + needsRemount = true; + } else { + needsRender = true; + } + } + } + } + if (failedBoundaries !== null) { + if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) { + needsRemount = true; + } + } + if (needsRemount) { + fiber._debugNeedsRemount = true; + } + if (needsRemount || needsRender) { + var _root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (_root !== null) { + scheduleUpdateOnFiber(_root, fiber, SyncLane, NoTimestamp); + } + } + if (child !== null && !needsRemount) { + scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies); + } + if (sibling !== null) { + scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies); + } + } + } + var findHostInstancesForRefresh = function findHostInstancesForRefresh(root, families) { + { + var hostInstances = new Set(); + var types = new Set(families.map(function (family) { + return family.current; + })); + findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances); + return hostInstances; + } + }; + function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) { + { + var child = fiber.child, + sibling = fiber.sibling, + tag = fiber.tag, + type = fiber.type; + var candidateType = null; + switch (tag) { + case FunctionComponent: + case SimpleMemoComponent: + case ClassComponent: + candidateType = type; + break; + case ForwardRef: + candidateType = type.render; + break; + } + var didMatch = false; + if (candidateType !== null) { + if (types.has(candidateType)) { + didMatch = true; + } + } + if (didMatch) { + // We have a match. This only drills down to the closest host components. + // There's no need to search deeper because for the purpose of giving + // visual feedback, "flashing" outermost parent rectangles is sufficient. + findHostInstancesForFiberShallowly(fiber, hostInstances); + } else { + // If there's no match, maybe there will be one further down in the child tree. + if (child !== null) { + findHostInstancesForMatchingFibersRecursively(child, types, hostInstances); + } + } + if (sibling !== null) { + findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances); + } + } + } + function findHostInstancesForFiberShallowly(fiber, hostInstances) { + { + var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances); + if (foundHostInstances) { + return; + } // If we didn't find any host children, fallback to closest host parent. + + var node = fiber; + while (true) { + switch (node.tag) { + case HostComponent: + hostInstances.add(node.stateNode); + return; + case HostPortal: + hostInstances.add(node.stateNode.containerInfo); + return; + case HostRoot: + hostInstances.add(node.stateNode.containerInfo); + return; + } + if (node.return === null) { + throw new Error("Expected to reach root first."); + } + node = node.return; + } + } + } + function findChildHostInstancesForFiberShallowly(fiber, hostInstances) { + { + var node = fiber; + var foundHostInstances = false; + while (true) { + if (node.tag === HostComponent) { + // We got a match. + foundHostInstances = true; + hostInstances.add(node.stateNode); // There may still be more, so keep searching. + } else if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } + if (node === fiber) { + return foundHostInstances; + } + while (node.sibling === null) { + if (node.return === null || node.return === fiber) { + return foundHostInstances; + } + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + } + return false; + } + var hasBadMapPolyfill; + { + hasBadMapPolyfill = false; + try { + var nonExtensibleObject = Object.preventExtensions({}); + /* eslint-disable no-new */ + + new Map([[nonExtensibleObject, null]]); + new Set([nonExtensibleObject]); + /* eslint-enable no-new */ + } catch (e) { + // TODO: Consider warning about bad polyfills + hasBadMapPolyfill = true; + } + } + function FiberNode(tag, pendingProps, key, mode) { + // Instance + this.tag = tag; + this.key = key; + this.elementType = null; + this.type = null; + this.stateNode = null; // Fiber + + this.return = null; + this.child = null; + this.sibling = null; + this.index = 0; + this.ref = null; + this.pendingProps = pendingProps; + this.memoizedProps = null; + this.updateQueue = null; + this.memoizedState = null; + this.dependencies = null; + this.mode = mode; // Effects + + this.flags = NoFlags; + this.subtreeFlags = NoFlags; + this.deletions = null; + this.lanes = NoLanes; + this.childLanes = NoLanes; + this.alternate = null; + { + // Note: The following is done to avoid a v8 performance cliff. + // + // Initializing the fields below to smis and later updating them with + // double values will cause Fibers to end up having separate shapes. + // This behavior/bug has something to do with Object.preventExtension(). + // Fortunately this only impacts DEV builds. + // Unfortunately it makes React unusably slow for some applications. + // To work around this, initialize the fields below with doubles. + // + // Learn more about this here: + // https://github.com/facebook/react/issues/14365 + // https://bugs.chromium.org/p/v8/issues/detail?id=8538 + this.actualDuration = Number.NaN; + this.actualStartTime = Number.NaN; + this.selfBaseDuration = Number.NaN; + this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization. + // This won't trigger the performance cliff mentioned above, + // and it simplifies other profiler code (including DevTools). + + this.actualDuration = 0; + this.actualStartTime = -1; + this.selfBaseDuration = 0; + this.treeBaseDuration = 0; + } + { + // This isn't directly used but is handy for debugging internals: + this._debugSource = null; + this._debugOwner = null; + this._debugNeedsRemount = false; + this._debugHookTypes = null; + if (!hasBadMapPolyfill && typeof Object.preventExtensions === "function") { + Object.preventExtensions(this); + } + } + } // This is a constructor function, rather than a POJO constructor, still + // please ensure we do the following: + // 1) Nobody should add any instance methods on this. Instance methods can be + // more difficult to predict when they get optimized and they are almost + // never inlined properly in static compilers. + // 2) Nobody should rely on `instanceof Fiber` for type testing. We should + // always know when it is a fiber. + // 3) We might want to experiment with using numeric keys since they are easier + // to optimize in a non-JIT environment. + // 4) We can easily go from a constructor to a createFiber object literal if that + // is faster. + // 5) It should be easy to port this to a C struct and keep a C implementation + // compatible. + + var createFiber = function createFiber(tag, pendingProps, key, mode) { + // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors + return new FiberNode(tag, pendingProps, key, mode); + }; + function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); + } + function isSimpleFunctionComponent(type) { + return typeof type === "function" && !shouldConstruct(type) && type.defaultProps === undefined; + } + function resolveLazyComponentTag(Component) { + if (typeof Component === "function") { + return shouldConstruct(Component) ? ClassComponent : FunctionComponent; + } else if (Component !== undefined && Component !== null) { + var $$typeof = Component.$$typeof; + if ($$typeof === REACT_FORWARD_REF_TYPE) { + return ForwardRef; + } + if ($$typeof === REACT_MEMO_TYPE) { + return MemoComponent; + } + } + return IndeterminateComponent; + } // This is used to create an alternate fiber to do work on. + + function createWorkInProgress(current, pendingProps) { + var workInProgress = current.alternate; + if (workInProgress === null) { + // We use a double buffering pooling technique because we know that we'll + // only ever need at most two versions of a tree. We pool the "other" unused + // node that we're free to reuse. This is lazily created to avoid allocating + // extra objects for things that are never updated. It also allow us to + // reclaim the extra memory if needed. + workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode); + workInProgress.elementType = current.elementType; + workInProgress.type = current.type; + workInProgress.stateNode = current.stateNode; + { + // DEV-only fields + workInProgress._debugSource = current._debugSource; + workInProgress._debugOwner = current._debugOwner; + workInProgress._debugHookTypes = current._debugHookTypes; + } + workInProgress.alternate = current; + current.alternate = workInProgress; + } else { + workInProgress.pendingProps = pendingProps; // Needed because Blocks store data on type. + + workInProgress.type = current.type; // We already have an alternate. + // Reset the effect tag. + + workInProgress.flags = NoFlags; // The effects are no longer valid. + + workInProgress.subtreeFlags = NoFlags; + workInProgress.deletions = null; + { + // We intentionally reset, rather than copy, actualDuration & actualStartTime. + // This prevents time from endlessly accumulating in new commits. + // This has the downside of resetting values for different priority renders, + // But works for yielding (the common case) and should support resuming. + workInProgress.actualDuration = 0; + workInProgress.actualStartTime = -1; + } + } // Reset all effects except static ones. + // Static effects are not specific to a render. + + workInProgress.flags = current.flags & StaticMask; + workInProgress.childLanes = current.childLanes; + workInProgress.lanes = current.lanes; + workInProgress.child = current.child; + workInProgress.memoizedProps = current.memoizedProps; + workInProgress.memoizedState = current.memoizedState; + workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so + // it cannot be shared with the current fiber. + + var currentDependencies = current.dependencies; + workInProgress.dependencies = currentDependencies === null ? null : { + lanes: currentDependencies.lanes, + firstContext: currentDependencies.firstContext + }; // These will be overridden during the parent's reconciliation + + workInProgress.sibling = current.sibling; + workInProgress.index = current.index; + workInProgress.ref = current.ref; + { + workInProgress.selfBaseDuration = current.selfBaseDuration; + workInProgress.treeBaseDuration = current.treeBaseDuration; + } + { + workInProgress._debugNeedsRemount = current._debugNeedsRemount; + switch (workInProgress.tag) { + case IndeterminateComponent: + case FunctionComponent: + case SimpleMemoComponent: + workInProgress.type = resolveFunctionForHotReloading(current.type); + break; + case ClassComponent: + workInProgress.type = resolveClassForHotReloading(current.type); + break; + case ForwardRef: + workInProgress.type = resolveForwardRefForHotReloading(current.type); + break; + } + } + return workInProgress; + } // Used to reuse a Fiber for a second pass. + + function resetWorkInProgress(workInProgress, renderLanes) { + // This resets the Fiber to what createFiber or createWorkInProgress would + // have set the values to before during the first pass. Ideally this wouldn't + // be necessary but unfortunately many code paths reads from the workInProgress + // when they should be reading from current and writing to workInProgress. + // We assume pendingProps, index, key, ref, return are still untouched to + // avoid doing another reconciliation. + // Reset the effect flags but keep any Placement tags, since that's something + // that child fiber is setting, not the reconciliation. + workInProgress.flags &= StaticMask | Placement; // The effects are no longer valid. + + var current = workInProgress.alternate; + if (current === null) { + // Reset to createFiber's initial values. + workInProgress.childLanes = NoLanes; + workInProgress.lanes = renderLanes; + workInProgress.child = null; + workInProgress.subtreeFlags = NoFlags; + workInProgress.memoizedProps = null; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.dependencies = null; + workInProgress.stateNode = null; + { + // Note: We don't reset the actualTime counts. It's useful to accumulate + // actual time across multiple render passes. + workInProgress.selfBaseDuration = 0; + workInProgress.treeBaseDuration = 0; + } + } else { + // Reset to the cloned values that createWorkInProgress would've. + workInProgress.childLanes = current.childLanes; + workInProgress.lanes = current.lanes; + workInProgress.child = current.child; + workInProgress.subtreeFlags = NoFlags; + workInProgress.deletions = null; + workInProgress.memoizedProps = current.memoizedProps; + workInProgress.memoizedState = current.memoizedState; + workInProgress.updateQueue = current.updateQueue; // Needed because Blocks store data on type. + + workInProgress.type = current.type; // Clone the dependencies object. This is mutated during the render phase, so + // it cannot be shared with the current fiber. + + var currentDependencies = current.dependencies; + workInProgress.dependencies = currentDependencies === null ? null : { + lanes: currentDependencies.lanes, + firstContext: currentDependencies.firstContext + }; + { + // Note: We don't reset the actualTime counts. It's useful to accumulate + // actual time across multiple render passes. + workInProgress.selfBaseDuration = current.selfBaseDuration; + workInProgress.treeBaseDuration = current.treeBaseDuration; + } + } + return workInProgress; + } + function createHostRootFiber(tag, isStrictMode, concurrentUpdatesByDefaultOverride) { + var mode; + if (tag === ConcurrentRoot) { + mode = ConcurrentMode; + if (isStrictMode === true) { + mode |= StrictLegacyMode; + } + } else { + mode = NoMode; + } + if (isDevToolsPresent) { + // Always collect profile timings when DevTools are present. + // This enables DevTools to start capturing timing at any point– + // Without some nodes in the tree having empty base times. + mode |= ProfileMode; + } + return createFiber(HostRoot, null, null, mode); + } + function createFiberFromTypeAndProps(type, + // React$ElementType + key, pendingProps, owner, mode, lanes) { + var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. + + var resolvedType = type; + if (typeof type === "function") { + if (shouldConstruct(type)) { + fiberTag = ClassComponent; + { + resolvedType = resolveClassForHotReloading(resolvedType); + } + } else { + { + resolvedType = resolveFunctionForHotReloading(resolvedType); + } + } + } else if (typeof type === "string") { + fiberTag = HostComponent; + } else { + getTag: switch (type) { + case REACT_FRAGMENT_TYPE: + return createFiberFromFragment(pendingProps.children, mode, lanes, key); + case REACT_STRICT_MODE_TYPE: + fiberTag = Mode; + mode |= StrictLegacyMode; + break; + case REACT_PROFILER_TYPE: + return createFiberFromProfiler(pendingProps, mode, lanes, key); + case REACT_SUSPENSE_TYPE: + return createFiberFromSuspense(pendingProps, mode, lanes, key); + case REACT_SUSPENSE_LIST_TYPE: + return createFiberFromSuspenseList(pendingProps, mode, lanes, key); + case REACT_OFFSCREEN_TYPE: + return createFiberFromOffscreen(pendingProps, mode, lanes, key); + case REACT_LEGACY_HIDDEN_TYPE: + + // eslint-disable-next-line no-fallthrough + + case REACT_SCOPE_TYPE: + + // eslint-disable-next-line no-fallthrough + + case REACT_CACHE_TYPE: + + // eslint-disable-next-line no-fallthrough + + case REACT_TRACING_MARKER_TYPE: + + // eslint-disable-next-line no-fallthrough + + case REACT_DEBUG_TRACING_MODE_TYPE: + + // eslint-disable-next-line no-fallthrough + + default: + { + if (typeof type === "object" && type !== null) { + switch (type.$$typeof) { + case REACT_PROVIDER_TYPE: + fiberTag = ContextProvider; + break getTag; + case REACT_CONTEXT_TYPE: + // This is a consumer + fiberTag = ContextConsumer; + break getTag; + case REACT_FORWARD_REF_TYPE: + fiberTag = ForwardRef; + { + resolvedType = resolveForwardRefForHotReloading(resolvedType); + } + break getTag; + case REACT_MEMO_TYPE: + fiberTag = MemoComponent; + break getTag; + case REACT_LAZY_TYPE: + fiberTag = LazyComponent; + resolvedType = null; + break getTag; + } + } + var info = ""; + { + if (type === undefined || typeof type === "object" && type !== null && Object.keys(type).length === 0) { + info += " You likely forgot to export your component from the file " + "it's defined in, or you might have mixed up default and " + "named imports."; + } + var ownerName = owner ? getComponentNameFromFiber(owner) : null; + if (ownerName) { + info += "\n\nCheck the render method of `" + ownerName + "`."; + } + } + throw new Error("Element type is invalid: expected a string (for built-in " + "components) or a class/function (for composite components) " + ("but got: " + (type == null ? type : typeof type) + "." + info)); + } + } + } + var fiber = createFiber(fiberTag, pendingProps, key, mode); + fiber.elementType = type; + fiber.type = resolvedType; + fiber.lanes = lanes; + { + fiber._debugOwner = owner; + } + return fiber; + } + function createFiberFromElement(element, mode, lanes) { + var owner = null; + { + owner = element._owner; + } + var type = element.type; + var key = element.key; + var pendingProps = element.props; + var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes); + { + fiber._debugSource = element._source; + fiber._debugOwner = element._owner; + } + return fiber; + } + function createFiberFromFragment(elements, mode, lanes, key) { + var fiber = createFiber(Fragment, elements, key, mode); + fiber.lanes = lanes; + return fiber; + } + function createFiberFromProfiler(pendingProps, mode, lanes, key) { + { + if (typeof pendingProps.id !== "string") { + error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof pendingProps.id); + } + } + var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); + fiber.elementType = REACT_PROFILER_TYPE; + fiber.lanes = lanes; + { + fiber.stateNode = { + effectDuration: 0, + passiveEffectDuration: 0 + }; + } + return fiber; + } + function createFiberFromSuspense(pendingProps, mode, lanes, key) { + var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); + fiber.elementType = REACT_SUSPENSE_TYPE; + fiber.lanes = lanes; + return fiber; + } + function createFiberFromSuspenseList(pendingProps, mode, lanes, key) { + var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode); + fiber.elementType = REACT_SUSPENSE_LIST_TYPE; + fiber.lanes = lanes; + return fiber; + } + function createFiberFromOffscreen(pendingProps, mode, lanes, key) { + var fiber = createFiber(OffscreenComponent, pendingProps, key, mode); + fiber.elementType = REACT_OFFSCREEN_TYPE; + fiber.lanes = lanes; + var primaryChildInstance = { + isHidden: false + }; + fiber.stateNode = primaryChildInstance; + return fiber; + } + function createFiberFromText(content, mode, lanes) { + var fiber = createFiber(HostText, content, null, mode); + fiber.lanes = lanes; + return fiber; + } + function createFiberFromPortal(portal, mode, lanes) { + var pendingProps = portal.children !== null ? portal.children : []; + var fiber = createFiber(HostPortal, pendingProps, portal.key, mode); + fiber.lanes = lanes; + fiber.stateNode = { + containerInfo: portal.containerInfo, + pendingChildren: null, + // Used by persistent updates + implementation: portal.implementation + }; + return fiber; + } // Used for stashing WIP properties to replay failed work in DEV. + + function assignFiberPropertiesInDEV(target, source) { + if (target === null) { + // This Fiber's initial properties will always be overwritten. + // We only use a Fiber to ensure the same hidden class so DEV isn't slow. + target = createFiber(IndeterminateComponent, null, null, NoMode); + } // This is intentionally written as a list of all properties. + // We tried to use Object.assign() instead but this is called in + // the hottest path, and Object.assign() was too slow: + // https://github.com/facebook/react/issues/12502 + // This code is DEV-only so size is not a concern. + + target.tag = source.tag; + target.key = source.key; + target.elementType = source.elementType; + target.type = source.type; + target.stateNode = source.stateNode; + target.return = source.return; + target.child = source.child; + target.sibling = source.sibling; + target.index = source.index; + target.ref = source.ref; + target.pendingProps = source.pendingProps; + target.memoizedProps = source.memoizedProps; + target.updateQueue = source.updateQueue; + target.memoizedState = source.memoizedState; + target.dependencies = source.dependencies; + target.mode = source.mode; + target.flags = source.flags; + target.subtreeFlags = source.subtreeFlags; + target.deletions = source.deletions; + target.lanes = source.lanes; + target.childLanes = source.childLanes; + target.alternate = source.alternate; + { + target.actualDuration = source.actualDuration; + target.actualStartTime = source.actualStartTime; + target.selfBaseDuration = source.selfBaseDuration; + target.treeBaseDuration = source.treeBaseDuration; + } + target._debugSource = source._debugSource; + target._debugOwner = source._debugOwner; + target._debugNeedsRemount = source._debugNeedsRemount; + target._debugHookTypes = source._debugHookTypes; + return target; + } + function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onRecoverableError) { + this.tag = tag; + this.containerInfo = containerInfo; + this.pendingChildren = null; + this.current = null; + this.pingCache = null; + this.finishedWork = null; + this.timeoutHandle = noTimeout; + this.context = null; + this.pendingContext = null; + this.callbackNode = null; + this.callbackPriority = NoLane; + this.eventTimes = createLaneMap(NoLanes); + this.expirationTimes = createLaneMap(NoTimestamp); + this.pendingLanes = NoLanes; + this.suspendedLanes = NoLanes; + this.pingedLanes = NoLanes; + this.expiredLanes = NoLanes; + this.mutableReadLanes = NoLanes; + this.finishedLanes = NoLanes; + this.entangledLanes = NoLanes; + this.entanglements = createLaneMap(NoLanes); + this.identifierPrefix = identifierPrefix; + this.onRecoverableError = onRecoverableError; + { + this.effectDuration = 0; + this.passiveEffectDuration = 0; + } + { + this.memoizedUpdaters = new Set(); + var pendingUpdatersLaneMap = this.pendingUpdatersLaneMap = []; + for (var _i = 0; _i < TotalLanes; _i++) { + pendingUpdatersLaneMap.push(new Set()); + } + } + { + switch (tag) { + case ConcurrentRoot: + this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; + break; + case LegacyRoot: + this._debugRootType = hydrate ? "hydrate()" : "render()"; + break; + } + } + } + function createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, + // TODO: We have several of these arguments that are conceptually part of the + // host config, but because they are passed in at runtime, we have to thread + // them through the root constructor. Perhaps we should put them all into a + // single type, like a DynamicHostConfig that is defined by the renderer. + identifierPrefix, onRecoverableError, transitionCallbacks) { + var root = new FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onRecoverableError); + // stateNode is any. + + var uninitializedFiber = createHostRootFiber(tag, isStrictMode); + root.current = uninitializedFiber; + uninitializedFiber.stateNode = root; + { + var _initialState = { + element: initialChildren, + isDehydrated: hydrate, + cache: null, + // not enabled yet + transitions: null, + pendingSuspenseBoundaries: null + }; + uninitializedFiber.memoizedState = _initialState; + } + initializeUpdateQueue(uninitializedFiber); + return root; + } + var ReactVersion = "18.2.0-next-9e3b772b8-20220608"; + function createPortal(children, containerInfo, + // TODO: figure out the API for cross-renderer implementation. + implementation) { + var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; + { + checkKeyStringCoercion(key); + } + return { + // This tag allow us to uniquely identify this as a React Portal + $$typeof: REACT_PORTAL_TYPE, + key: key == null ? null : "" + key, + children: children, + containerInfo: containerInfo, + implementation: implementation + }; + } + var didWarnAboutNestedUpdates; + var didWarnAboutFindNodeInStrictMode; + { + didWarnAboutNestedUpdates = false; + didWarnAboutFindNodeInStrictMode = {}; + } + function getContextForSubtree(parentComponent) { + if (!parentComponent) { + return emptyContextObject; + } + var fiber = get(parentComponent); + var parentContext = findCurrentUnmaskedContext(fiber); + if (fiber.tag === ClassComponent) { + var Component = fiber.type; + if (isContextProvider(Component)) { + return processChildContext(fiber, Component, parentContext); + } + } + return parentContext; + } + function findHostInstanceWithWarning(component, methodName) { + { + var fiber = get(component); + if (fiber === undefined) { + if (typeof component.render === "function") { + throw new Error("Unable to find node on an unmounted component."); + } else { + var keys = Object.keys(component).join(","); + throw new Error("Argument appears to not be a ReactComponent. Keys: " + keys); + } + } + var hostFiber = findCurrentHostFiber(fiber); + if (hostFiber === null) { + return null; + } + if (hostFiber.mode & StrictLegacyMode) { + var componentName = getComponentNameFromFiber(fiber) || "Component"; + if (!didWarnAboutFindNodeInStrictMode[componentName]) { + didWarnAboutFindNodeInStrictMode[componentName] = true; + var previousFiber = current; + try { + setCurrentFiber(hostFiber); + if (fiber.mode & StrictLegacyMode) { + error("%s is deprecated in StrictMode. " + "%s was passed an instance of %s which is inside StrictMode. " + "Instead, add a ref directly to the element you want to reference. " + "Learn more about using refs safely here: " + "https://react.dev/link/strict-mode-find-node", methodName, methodName, componentName); + } else { + error("%s is deprecated in StrictMode. " + "%s was passed an instance of %s which renders StrictMode children. " + "Instead, add a ref directly to the element you want to reference. " + "Learn more about using refs safely here: " + "https://react.dev/link/strict-mode-find-node", methodName, methodName, componentName); + } + } finally { + // Ideally this should reset to previous but this shouldn't be called in + // render and there's another warning for that anyway. + if (previousFiber) { + setCurrentFiber(previousFiber); + } else { + resetCurrentFiber(); + } + } + } + } + return hostFiber.stateNode; + } + } + function createContainer(containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) { + var hydrate = false; + var initialChildren = null; + return createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError); + } + function updateContainer(element, container, parentComponent, callback) { + { + onScheduleRoot(container, element); + } + var current$1 = container.current; + var eventTime = requestEventTime(); + var lane = requestUpdateLane(current$1); + var context = getContextForSubtree(parentComponent); + if (container.context === null) { + container.context = context; + } else { + container.pendingContext = context; + } + { + if (isRendering && current !== null && !didWarnAboutNestedUpdates) { + didWarnAboutNestedUpdates = true; + error("Render methods should be a pure function of props and state; " + "triggering nested component updates from render is not allowed. " + "If necessary, trigger nested updates in componentDidUpdate.\n\n" + "Check the render method of %s.", getComponentNameFromFiber(current) || "Unknown"); + } + } + var update = createUpdate(eventTime, lane); // Caution: React DevTools currently depends on this property + // being called "element". + + update.payload = { + element: element + }; + callback = callback === undefined ? null : callback; + if (callback !== null) { + { + if (typeof callback !== "function") { + error("render(...): Expected the last optional `callback` argument to be a " + "function. Instead received: %s.", callback); + } + } + update.callback = callback; + } + var root = enqueueUpdate(current$1, update, lane); + if (root !== null) { + scheduleUpdateOnFiber(root, current$1, lane, eventTime); + entangleTransitions(root, current$1, lane); + } + return lane; + } + function getPublicRootInstance(container) { + var containerFiber = container.current; + if (!containerFiber.child) { + return null; + } + switch (containerFiber.child.tag) { + case HostComponent: + return getPublicInstance(containerFiber.child.stateNode); + default: + return containerFiber.child.stateNode; + } + } + var shouldErrorImpl = function shouldErrorImpl(fiber) { + return null; + }; + function shouldError(fiber) { + return shouldErrorImpl(fiber); + } + var shouldSuspendImpl = function shouldSuspendImpl(fiber) { + return false; + }; + function shouldSuspend(fiber) { + return shouldSuspendImpl(fiber); + } + var overrideHookState = null; + var overrideHookStateDeletePath = null; + var overrideHookStateRenamePath = null; + var overrideProps = null; + var overridePropsDeletePath = null; + var overridePropsRenamePath = null; + var scheduleUpdate = null; + var setErrorHandler = null; + var setSuspenseHandler = null; + { + var _copyWithDeleteImpl = function copyWithDeleteImpl(obj, path, index) { + var key = path[index]; + var updated = isArray(obj) ? obj.slice() : assign({}, obj); + if (index + 1 === path.length) { + if (isArray(updated)) { + updated.splice(key, 1); + } else { + delete updated[key]; + } + return updated; + } // $FlowFixMe number or string is fine here + + updated[key] = _copyWithDeleteImpl(obj[key], path, index + 1); + return updated; + }; + var copyWithDelete = function copyWithDelete(obj, path) { + return _copyWithDeleteImpl(obj, path, 0); + }; + var _copyWithRenameImpl = function copyWithRenameImpl(obj, oldPath, newPath, index) { + var oldKey = oldPath[index]; + var updated = isArray(obj) ? obj.slice() : assign({}, obj); + if (index + 1 === oldPath.length) { + var newKey = newPath[index]; // $FlowFixMe number or string is fine here + + updated[newKey] = updated[oldKey]; + if (isArray(updated)) { + updated.splice(oldKey, 1); + } else { + delete updated[oldKey]; + } + } else { + // $FlowFixMe number or string is fine here + updated[oldKey] = _copyWithRenameImpl( + // $FlowFixMe number or string is fine here + obj[oldKey], oldPath, newPath, index + 1); + } + return updated; + }; + var copyWithRename = function copyWithRename(obj, oldPath, newPath) { + if (oldPath.length !== newPath.length) { + warn("copyWithRename() expects paths of the same length"); + return; + } else { + for (var i = 0; i < newPath.length - 1; i++) { + if (oldPath[i] !== newPath[i]) { + warn("copyWithRename() expects paths to be the same except for the deepest key"); + return; + } + } + } + return _copyWithRenameImpl(obj, oldPath, newPath, 0); + }; + var _copyWithSetImpl = function copyWithSetImpl(obj, path, index, value) { + if (index >= path.length) { + return value; + } + var key = path[index]; + var updated = isArray(obj) ? obj.slice() : assign({}, obj); // $FlowFixMe number or string is fine here + + updated[key] = _copyWithSetImpl(obj[key], path, index + 1, value); + return updated; + }; + var copyWithSet = function copyWithSet(obj, path, value) { + return _copyWithSetImpl(obj, path, 0, value); + }; + var findHook = function findHook(fiber, id) { + // For now, the "id" of stateful hooks is just the stateful hook index. + // This may change in the future with e.g. nested hooks. + var currentHook = fiber.memoizedState; + while (currentHook !== null && id > 0) { + currentHook = currentHook.next; + id--; + } + return currentHook; + }; // Support DevTools editable values for useState and useReducer. + + overrideHookState = function overrideHookState(fiber, id, path, value) { + var hook = findHook(fiber, id); + if (hook !== null) { + var newState = copyWithSet(hook.memoizedState, path, value); + hook.memoizedState = newState; + hook.baseState = newState; // We aren't actually adding an update to the queue, + // because there is no update we can add for useReducer hooks that won't trigger an error. + // (There's no appropriate action type for DevTools overrides.) + // As a result though, React will see the scheduled update as a noop and bailout. + // Shallow cloning props works as a workaround for now to bypass the bailout check. + + fiber.memoizedProps = assign({}, fiber.memoizedProps); + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + } + }; + overrideHookStateDeletePath = function overrideHookStateDeletePath(fiber, id, path) { + var hook = findHook(fiber, id); + if (hook !== null) { + var newState = copyWithDelete(hook.memoizedState, path); + hook.memoizedState = newState; + hook.baseState = newState; // We aren't actually adding an update to the queue, + // because there is no update we can add for useReducer hooks that won't trigger an error. + // (There's no appropriate action type for DevTools overrides.) + // As a result though, React will see the scheduled update as a noop and bailout. + // Shallow cloning props works as a workaround for now to bypass the bailout check. + + fiber.memoizedProps = assign({}, fiber.memoizedProps); + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + } + }; + overrideHookStateRenamePath = function overrideHookStateRenamePath(fiber, id, oldPath, newPath) { + var hook = findHook(fiber, id); + if (hook !== null) { + var newState = copyWithRename(hook.memoizedState, oldPath, newPath); + hook.memoizedState = newState; + hook.baseState = newState; // We aren't actually adding an update to the queue, + // because there is no update we can add for useReducer hooks that won't trigger an error. + // (There's no appropriate action type for DevTools overrides.) + // As a result though, React will see the scheduled update as a noop and bailout. + // Shallow cloning props works as a workaround for now to bypass the bailout check. + + fiber.memoizedProps = assign({}, fiber.memoizedProps); + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + } + }; // Support DevTools props for function components, forwardRef, memo, host components, etc. + + overrideProps = function overrideProps(fiber, path, value) { + fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value); + if (fiber.alternate) { + fiber.alternate.pendingProps = fiber.pendingProps; + } + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + }; + overridePropsDeletePath = function overridePropsDeletePath(fiber, path) { + fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path); + if (fiber.alternate) { + fiber.alternate.pendingProps = fiber.pendingProps; + } + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + }; + overridePropsRenamePath = function overridePropsRenamePath(fiber, oldPath, newPath) { + fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath); + if (fiber.alternate) { + fiber.alternate.pendingProps = fiber.pendingProps; + } + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + }; + scheduleUpdate = function scheduleUpdate(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + }; + setErrorHandler = function setErrorHandler(newShouldErrorImpl) { + shouldErrorImpl = newShouldErrorImpl; + }; + setSuspenseHandler = function setSuspenseHandler(newShouldSuspendImpl) { + shouldSuspendImpl = newShouldSuspendImpl; + }; + } + function findHostInstanceByFiber(fiber) { + var hostFiber = findCurrentHostFiber(fiber); + if (hostFiber === null) { + return null; + } + return hostFiber.stateNode; + } + function emptyFindFiberByHostInstance(instance) { + return null; + } + function getCurrentFiberForDevTools() { + return current; + } + function injectIntoDevTools(devToolsConfig) { + var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance; + var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; + return injectInternals({ + bundleType: devToolsConfig.bundleType, + version: devToolsConfig.version, + rendererPackageName: devToolsConfig.rendererPackageName, + rendererConfig: devToolsConfig.rendererConfig, + overrideHookState: overrideHookState, + overrideHookStateDeletePath: overrideHookStateDeletePath, + overrideHookStateRenamePath: overrideHookStateRenamePath, + overrideProps: overrideProps, + overridePropsDeletePath: overridePropsDeletePath, + overridePropsRenamePath: overridePropsRenamePath, + setErrorHandler: setErrorHandler, + setSuspenseHandler: setSuspenseHandler, + scheduleUpdate: scheduleUpdate, + currentDispatcherRef: ReactCurrentDispatcher, + findHostInstanceByFiber: findHostInstanceByFiber, + findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance, + // React Refresh + findHostInstancesForRefresh: findHostInstancesForRefresh, + scheduleRefresh: scheduleRefresh, + scheduleRoot: scheduleRoot, + setRefreshHandler: setRefreshHandler, + // Enables DevTools to append owner stacks to error messages in DEV mode. + getCurrentFiber: getCurrentFiberForDevTools, + // Enables DevTools to detect reconciler version rather than renderer version + // which may not match for third party renderers. + reconcilerVersion: ReactVersion + }); + } + var instanceCache = new Map(); + function getInstanceFromTag(tag) { + return instanceCache.get(tag) || null; + } + var emptyObject$1 = {}; + { + Object.freeze(emptyObject$1); + } + var createHierarchy; + var getHostNode; + var getHostProps; + var lastNonHostInstance; + var getOwnerHierarchy; + var _traverseOwnerTreeUp; + { + createHierarchy = function createHierarchy(fiberHierarchy) { + return fiberHierarchy.map(function (fiber) { + return { + name: getComponentNameFromType(fiber.type), + getInspectorData: function getInspectorData(findNodeHandle) { + return { + props: getHostProps(fiber), + source: fiber._debugSource, + measure: function measure(callback) { + // If this is Fabric, we'll find a ShadowNode and use that to measure. + var hostFiber = findCurrentHostFiber(fiber); + var shadowNode = hostFiber != null && hostFiber.stateNode !== null && hostFiber.stateNode.node; + if (shadowNode) { + nativeFabricUIManager.measure(shadowNode, callback); + } else { + return ReactNativePrivateInterface.UIManager.measure(getHostNode(fiber, findNodeHandle), callback); + } + } + }; + } + }; + }); + }; + getHostNode = function getHostNode(fiber, findNodeHandle) { + var hostNode; // look for children first for the hostNode + // as composite fibers do not have a hostNode + + while (fiber) { + if (fiber.stateNode !== null && fiber.tag === HostComponent) { + hostNode = findNodeHandle(fiber.stateNode); + } + if (hostNode) { + return hostNode; + } + fiber = fiber.child; + } + return null; + }; + getHostProps = function getHostProps(fiber) { + var host = findCurrentHostFiber(fiber); + if (host) { + return host.memoizedProps || emptyObject$1; + } + return emptyObject$1; + }; + exports.getInspectorDataForInstance = function (closestInstance) { + // Handle case where user clicks outside of ReactNative + if (!closestInstance) { + return { + hierarchy: [], + props: emptyObject$1, + selectedIndex: null, + source: null + }; + } + var fiber = findCurrentFiberUsingSlowPath(closestInstance); + var fiberHierarchy = getOwnerHierarchy(fiber); + var instance = lastNonHostInstance(fiberHierarchy); + var hierarchy = createHierarchy(fiberHierarchy); + var props = getHostProps(instance); + var source = instance._debugSource; + var selectedIndex = fiberHierarchy.indexOf(instance); + return { + hierarchy: hierarchy, + props: props, + selectedIndex: selectedIndex, + source: source + }; + }; + getOwnerHierarchy = function getOwnerHierarchy(instance) { + var hierarchy = []; + _traverseOwnerTreeUp(hierarchy, instance); + return hierarchy; + }; + lastNonHostInstance = function lastNonHostInstance(hierarchy) { + for (var i = hierarchy.length - 1; i > 1; i--) { + var instance = hierarchy[i]; + if (instance.tag !== HostComponent) { + return instance; + } + } + return hierarchy[0]; + }; + _traverseOwnerTreeUp = function traverseOwnerTreeUp(hierarchy, instance) { + if (instance) { + hierarchy.unshift(instance); + _traverseOwnerTreeUp(hierarchy, instance._debugOwner); + } + }; + } + var getInspectorDataForViewTag; + var getInspectorDataForViewAtPoint; + { + getInspectorDataForViewTag = function getInspectorDataForViewTag(viewTag) { + var closestInstance = getInstanceFromTag(viewTag); // Handle case where user clicks outside of ReactNative + + if (!closestInstance) { + return { + hierarchy: [], + props: emptyObject$1, + selectedIndex: null, + source: null + }; + } + var fiber = findCurrentFiberUsingSlowPath(closestInstance); + var fiberHierarchy = getOwnerHierarchy(fiber); + var instance = lastNonHostInstance(fiberHierarchy); + var hierarchy = createHierarchy(fiberHierarchy); + var props = getHostProps(instance); + var source = instance._debugSource; + var selectedIndex = fiberHierarchy.indexOf(instance); + return { + hierarchy: hierarchy, + props: props, + selectedIndex: selectedIndex, + source: source + }; + }; + getInspectorDataForViewAtPoint = function getInspectorDataForViewAtPoint(findNodeHandle, inspectedView, locationX, locationY, callback) { + var closestInstance = null; + if (inspectedView._internalInstanceHandle != null) { + // For Fabric we can look up the instance handle directly and measure it. + nativeFabricUIManager.findNodeAtPoint(inspectedView._internalInstanceHandle.stateNode.node, locationX, locationY, function (internalInstanceHandle) { + if (internalInstanceHandle == null) { + callback(assign({ + pointerY: locationY, + frame: { + left: 0, + top: 0, + width: 0, + height: 0 + } + }, exports.getInspectorDataForInstance(closestInstance))); + } + closestInstance = internalInstanceHandle.stateNode.canonical._internalInstanceHandle; // Note: this is deprecated and we want to remove it ASAP. Keeping it here for React DevTools compatibility for now. + + var nativeViewTag = internalInstanceHandle.stateNode.canonical._nativeTag; + nativeFabricUIManager.measure(internalInstanceHandle.stateNode.node, function (x, y, width, height, pageX, pageY) { + var inspectorData = exports.getInspectorDataForInstance(closestInstance); + callback(assign({}, inspectorData, { + pointerY: locationY, + frame: { + left: pageX, + top: pageY, + width: width, + height: height + }, + touchedViewTag: nativeViewTag + })); + }); + }); + } else if (inspectedView._internalFiberInstanceHandleDEV != null) { + // For Paper we fall back to the old strategy using the React tag. + ReactNativePrivateInterface.UIManager.findSubviewIn(findNodeHandle(inspectedView), [locationX, locationY], function (nativeViewTag, left, top, width, height) { + var inspectorData = exports.getInspectorDataForInstance(getInstanceFromTag(nativeViewTag)); + callback(assign({}, inspectorData, { + pointerY: locationY, + frame: { + left: left, + top: top, + width: width, + height: height + }, + touchedViewTag: nativeViewTag + })); + }); + } else { + error("getInspectorDataForViewAtPoint expects to receive a host component"); + return; + } + }; + } + var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner; + function findHostInstance_DEPRECATED(componentOrHandle) { + { + var owner = ReactCurrentOwner$3.current; + if (owner !== null && owner.stateNode !== null) { + if (!owner.stateNode._warnedAboutRefsInRender) { + error("%s is accessing findNodeHandle inside its render(). " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", getComponentNameFromType(owner.type) || "A component"); + } + owner.stateNode._warnedAboutRefsInRender = true; + } + } + if (componentOrHandle == null) { + return null; + } // $FlowIssue Flow has hardcoded values for React DOM that don't work with RN + + if (componentOrHandle._nativeTag) { + // $FlowIssue Flow has hardcoded values for React DOM that don't work with RN + return componentOrHandle; + } // $FlowIssue Flow has hardcoded values for React DOM that don't work with RN + + if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag) { + // $FlowIssue Flow has hardcoded values for React DOM that don't work with RN + return componentOrHandle.canonical; + } + var hostInstance; + { + hostInstance = findHostInstanceWithWarning(componentOrHandle, "findHostInstance_DEPRECATED"); + } + if (hostInstance == null) { + return hostInstance; + } + if (hostInstance.canonical) { + // Fabric + return hostInstance.canonical; + } // $FlowFixMe[incompatible-return] + + return hostInstance; + } + function findNodeHandle(componentOrHandle) { + { + var owner = ReactCurrentOwner$3.current; + if (owner !== null && owner.stateNode !== null) { + if (!owner.stateNode._warnedAboutRefsInRender) { + error("%s is accessing findNodeHandle inside its render(). " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", getComponentNameFromType(owner.type) || "A component"); + } + owner.stateNode._warnedAboutRefsInRender = true; + } + } + if (componentOrHandle == null) { + return null; + } + if (typeof componentOrHandle === "number") { + // Already a node handle + return componentOrHandle; + } + if (componentOrHandle._nativeTag) { + return componentOrHandle._nativeTag; + } + if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag) { + return componentOrHandle.canonical._nativeTag; + } + var hostInstance; + { + hostInstance = findHostInstanceWithWarning(componentOrHandle, "findNodeHandle"); + } + if (hostInstance == null) { + return hostInstance; + } // TODO: the code is right but the types here are wrong. + // https://github.com/facebook/react/pull/12863 + + if (hostInstance.canonical) { + // Fabric + return hostInstance.canonical._nativeTag; + } + return hostInstance._nativeTag; + } + function dispatchCommand(handle, command, args) { + if (handle._nativeTag == null) { + { + error("dispatchCommand was called with a ref that isn't a " + "native component. Use React.forwardRef to get access to the underlying native component"); + } + return; + } + if (handle._internalInstanceHandle != null) { + var stateNode = handle._internalInstanceHandle.stateNode; + if (stateNode != null) { + nativeFabricUIManager.dispatchCommand(stateNode.node, command, args); + } + } else { + ReactNativePrivateInterface.UIManager.dispatchViewManagerCommand(handle._nativeTag, command, args); + } + } + function sendAccessibilityEvent(handle, eventType) { + if (handle._nativeTag == null) { + { + error("sendAccessibilityEvent was called with a ref that isn't a " + "native component. Use React.forwardRef to get access to the underlying native component"); + } + return; + } + if (handle._internalInstanceHandle != null) { + var stateNode = handle._internalInstanceHandle.stateNode; + if (stateNode != null) { + nativeFabricUIManager.sendAccessibilityEvent(stateNode.node, eventType); + } + } else { + ReactNativePrivateInterface.legacySendAccessibilityEvent(handle._nativeTag, eventType); + } + } + function onRecoverableError(error$1) { + // TODO: Expose onRecoverableError option to userspace + // eslint-disable-next-line react-internal/no-production-logging, react-internal/warning-args + error(error$1); + } + function render(element, containerTag, callback, concurrentRoot) { + var root = roots.get(containerTag); + if (!root) { + // TODO (bvaughn): If we decide to keep the wrapper component, + // We could create a wrapper for containerTag as well to reduce special casing. + root = createContainer(containerTag, concurrentRoot ? ConcurrentRoot : LegacyRoot, null, false, null, "", onRecoverableError); + roots.set(containerTag, root); + } + updateContainer(element, root, null, callback); // $FlowIssue Flow has hardcoded values for React DOM that don't work with RN + + return getPublicRootInstance(root); + } + function unmountComponentAtNode(containerTag) { + this.stopSurface(containerTag); + } + function stopSurface(containerTag) { + var root = roots.get(containerTag); + if (root) { + // TODO: Is it safe to reset this now or should I wait since this unmount could be deferred? + updateContainer(null, root, null, function () { + roots.delete(containerTag); + }); + } + } + function createPortal$1(children, containerTag) { + var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + return createPortal(children, containerTag, null, key); + } + setBatchingImplementation(batchedUpdates$1); + var roots = new Map(); + injectIntoDevTools({ + findFiberByHostInstance: getInstanceFromInstance, + bundleType: 1, + version: ReactVersion, + rendererPackageName: "react-native-renderer", + rendererConfig: { + getInspectorDataForViewTag: getInspectorDataForViewTag, + getInspectorDataForViewAtPoint: getInspectorDataForViewAtPoint.bind(null, findNodeHandle) + } + }); + exports.createPortal = createPortal$1; + exports.dispatchCommand = dispatchCommand; + exports.findHostInstance_DEPRECATED = findHostInstance_DEPRECATED; + exports.findNodeHandle = findNodeHandle; + exports.render = render; + exports.sendAccessibilityEvent = sendAccessibilityEvent; + exports.stopSurface = stopSurface; + exports.unmountComponentAtNode = unmountComponentAtNode; + + /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === 'function') { + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); + } + })(); + } +},64,[65,68,279,439],"node_modules\\react-native\\Libraries\\Renderer\\implementations\\ReactFabric-dev.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + if (process.env.NODE_ENV === 'production') { + module.exports = _$$_REQUIRE(_dependencyMap[0], "./cjs/react.production.min.js"); + } else { + module.exports = _$$_REQUIRE(_dependencyMap[1], "./cjs/react.development.js"); + } +},65,[66,67],"node_modules\\react\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * @license React + * react.production.min.js + * + * 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. + */ + 'use strict'; + + var l = Symbol.for("react.element"), + n = Symbol.for("react.portal"), + p = Symbol.for("react.fragment"), + q = Symbol.for("react.strict_mode"), + r = Symbol.for("react.profiler"), + t = Symbol.for("react.provider"), + u = Symbol.for("react.context"), + v = Symbol.for("react.forward_ref"), + w = Symbol.for("react.suspense"), + x = Symbol.for("react.memo"), + y = Symbol.for("react.lazy"), + z = Symbol.iterator; + function A(a) { + if (null === a || "object" !== typeof a) return null; + a = z && a[z] || a["@@iterator"]; + return "function" === typeof a ? a : null; + } + var B = { + isMounted: function isMounted() { + return !1; + }, + enqueueForceUpdate: function enqueueForceUpdate() {}, + enqueueReplaceState: function enqueueReplaceState() {}, + enqueueSetState: function enqueueSetState() {} + }, + C = Object.assign, + D = {}; + function E(a, b, e) { + this.props = a; + this.context = b; + this.refs = D; + this.updater = e || B; + } + E.prototype.isReactComponent = {}; + E.prototype.setState = function (a, b) { + if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); + this.updater.enqueueSetState(this, a, b, "setState"); + }; + E.prototype.forceUpdate = function (a) { + this.updater.enqueueForceUpdate(this, a, "forceUpdate"); + }; + function F() {} + F.prototype = E.prototype; + function G(a, b, e) { + this.props = a; + this.context = b; + this.refs = D; + this.updater = e || B; + } + var H = G.prototype = new F(); + H.constructor = G; + C(H, E.prototype); + H.isPureReactComponent = !0; + var I = Array.isArray, + J = Object.prototype.hasOwnProperty, + K = { + current: null + }, + L = { + key: !0, + ref: !0, + __self: !0, + __source: !0 + }; + function M(a, b, e) { + var d, + c = {}, + k = null, + h = null; + if (null != b) for (d in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k = "" + b.key), b) J.call(b, d) && !L.hasOwnProperty(d) && (c[d] = b[d]); + var g = arguments.length - 2; + if (1 === g) c.children = e;else if (1 < g) { + for (var f = Array(g), m = 0; m < g; m++) f[m] = arguments[m + 2]; + c.children = f; + } + if (a && a.defaultProps) for (d in g = a.defaultProps, g) void 0 === c[d] && (c[d] = g[d]); + return { + $$typeof: l, + type: a, + key: k, + ref: h, + props: c, + _owner: K.current + }; + } + function N(a, b) { + return { + $$typeof: l, + type: a.type, + key: b, + ref: a.ref, + props: a.props, + _owner: a._owner + }; + } + function O(a) { + return "object" === typeof a && null !== a && a.$$typeof === l; + } + function escape(a) { + var b = { + "=": "=0", + ":": "=2" + }; + return "$" + a.replace(/[=:]/g, function (a) { + return b[a]; + }); + } + var P = /\/+/g; + function Q(a, b) { + return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b.toString(36); + } + function R(a, b, e, d, c) { + var k = typeof a; + if ("undefined" === k || "boolean" === k) a = null; + var h = !1; + if (null === a) h = !0;else switch (k) { + case "string": + case "number": + h = !0; + break; + case "object": + switch (a.$$typeof) { + case l: + case n: + h = !0; + } + } + if (h) return h = a, c = c(h), a = "" === d ? "." + Q(h, 0) : d, I(c) ? (e = "", null != a && (e = a.replace(P, "$&/") + "/"), R(c, b, e, "", function (a) { + return a; + })) : null != c && (O(c) && (c = N(c, e + (!c.key || h && h.key === c.key ? "" : ("" + c.key).replace(P, "$&/") + "/") + a)), b.push(c)), 1; + h = 0; + d = "" === d ? "." : d + ":"; + if (I(a)) for (var g = 0; g < a.length; g++) { + k = a[g]; + var f = d + Q(k, g); + h += R(k, b, e, f, c); + } else if (f = A(a), "function" === typeof f) for (a = f.call(a), g = 0; !(k = a.next()).done;) k = k.value, f = d + Q(k, g++), h += R(k, b, e, f, c);else if ("object" === k) throw b = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead."); + return h; + } + function S(a, b, e) { + if (null == a) return a; + var d = [], + c = 0; + R(a, d, "", "", function (a) { + return b.call(e, a, c++); + }); + return d; + } + function T(a) { + if (-1 === a._status) { + var b = a._result; + b = b(); + b.then(function (b) { + if (0 === a._status || -1 === a._status) a._status = 1, a._result = b; + }, function (b) { + if (0 === a._status || -1 === a._status) a._status = 2, a._result = b; + }); + -1 === a._status && (a._status = 0, a._result = b); + } + if (1 === a._status) return a._result.default; + throw a._result; + } + var U = { + current: null + }, + V = { + transition: null + }, + W = { + ReactCurrentDispatcher: U, + ReactCurrentBatchConfig: V, + ReactCurrentOwner: K + }; + exports.Children = { + map: S, + forEach: function forEach(a, b, e) { + S(a, function () { + b.apply(this, arguments); + }, e); + }, + count: function count(a) { + var b = 0; + S(a, function () { + b++; + }); + return b; + }, + toArray: function toArray(a) { + return S(a, function (a) { + return a; + }) || []; + }, + only: function only(a) { + if (!O(a)) throw Error("React.Children.only expected to receive a single React element child."); + return a; + } + }; + exports.Component = E; + exports.Fragment = p; + exports.Profiler = r; + exports.PureComponent = G; + exports.StrictMode = q; + exports.Suspense = w; + exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W; + exports.cloneElement = function (a, b, e) { + if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + "."); + var d = C({}, a.props), + c = a.key, + k = a.ref, + h = a._owner; + if (null != b) { + void 0 !== b.ref && (k = b.ref, h = K.current); + void 0 !== b.key && (c = "" + b.key); + if (a.type && a.type.defaultProps) var g = a.type.defaultProps; + for (f in b) J.call(b, f) && !L.hasOwnProperty(f) && (d[f] = void 0 === b[f] && void 0 !== g ? g[f] : b[f]); + } + var f = arguments.length - 2; + if (1 === f) d.children = e;else if (1 < f) { + g = Array(f); + for (var m = 0; m < f; m++) g[m] = arguments[m + 2]; + d.children = g; + } + return { + $$typeof: l, + type: a.type, + key: c, + ref: k, + props: d, + _owner: h + }; + }; + exports.createContext = function (a) { + a = { + $$typeof: u, + _currentValue: a, + _currentValue2: a, + _threadCount: 0, + Provider: null, + Consumer: null, + _defaultValue: null, + _globalName: null + }; + a.Provider = { + $$typeof: t, + _context: a + }; + return a.Consumer = a; + }; + exports.createElement = M; + exports.createFactory = function (a) { + var b = M.bind(null, a); + b.type = a; + return b; + }; + exports.createRef = function () { + return { + current: null + }; + }; + exports.forwardRef = function (a) { + return { + $$typeof: v, + render: a + }; + }; + exports.isValidElement = O; + exports.lazy = function (a) { + return { + $$typeof: y, + _payload: { + _status: -1, + _result: a + }, + _init: T + }; + }; + exports.memo = function (a, b) { + return { + $$typeof: x, + type: a, + compare: void 0 === b ? null : b + }; + }; + exports.startTransition = function (a) { + var b = V.transition; + V.transition = {}; + try { + a(); + } finally { + V.transition = b; + } + }; + exports.unstable_act = function () { + throw Error("act(...) is not supported in production builds of React."); + }; + exports.useCallback = function (a, b) { + return U.current.useCallback(a, b); + }; + exports.useContext = function (a) { + return U.current.useContext(a); + }; + exports.useDebugValue = function () {}; + exports.useDeferredValue = function (a) { + return U.current.useDeferredValue(a); + }; + exports.useEffect = function (a, b) { + return U.current.useEffect(a, b); + }; + exports.useId = function () { + return U.current.useId(); + }; + exports.useImperativeHandle = function (a, b, e) { + return U.current.useImperativeHandle(a, b, e); + }; + exports.useInsertionEffect = function (a, b) { + return U.current.useInsertionEffect(a, b); + }; + exports.useLayoutEffect = function (a, b) { + return U.current.useLayoutEffect(a, b); + }; + exports.useMemo = function (a, b) { + return U.current.useMemo(a, b); + }; + exports.useReducer = function (a, b, e) { + return U.current.useReducer(a, b, e); + }; + exports.useRef = function (a) { + return U.current.useRef(a); + }; + exports.useState = function (a) { + return U.current.useState(a); + }; + exports.useSyncExternalStore = function (a, b, e) { + return U.current.useSyncExternalStore(a, b, e); + }; + exports.useTransition = function () { + return U.current.useTransition(); + }; + exports.version = "18.2.0"; +},66,[],"node_modules\\react\\cjs\\react.production.min.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * @license React + * react.development.js + * + * 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. + */ + + 'use strict'; + + if (process.env.NODE_ENV !== "production") { + (function () { + 'use strict'; + + /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === 'function') { + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); + } + var ReactVersion = '18.2.0'; + + // ATTENTION + // When adding new symbols to this file, + // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' + // The Symbol used to tag the ReactElement-like types. + var REACT_ELEMENT_TYPE = Symbol.for('react.element'); + var REACT_PORTAL_TYPE = Symbol.for('react.portal'); + var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); + var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); + var REACT_PROFILER_TYPE = Symbol.for('react.profiler'); + var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); + var REACT_CONTEXT_TYPE = Symbol.for('react.context'); + var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); + var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); + var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); + var REACT_MEMO_TYPE = Symbol.for('react.memo'); + var REACT_LAZY_TYPE = Symbol.for('react.lazy'); + var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); + var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + return null; + } + + /** + * Keeps track of the current dispatcher. + */ + var ReactCurrentDispatcher = { + /** + * @internal + * @type {ReactComponent} + */ + current: null + }; + + /** + * Keeps track of the current batch's configuration such as how long an update + * should suspend for if it needs to. + */ + var ReactCurrentBatchConfig = { + transition: null + }; + var ReactCurrentActQueue = { + current: null, + // Used to reproduce behavior of `batchedUpdates` in legacy mode. + isBatchingLegacy: false, + didScheduleLegacyUpdate: false + }; + + /** + * Keeps track of the current owner. + * + * The current owner is the component who should own any components that are + * currently being constructed. + */ + var ReactCurrentOwner = { + /** + * @internal + * @type {ReactComponent} + */ + current: null + }; + var ReactDebugCurrentFrame = {}; + var currentExtraStackFrame = null; + function setExtraStackFrame(stack) { + { + currentExtraStackFrame = stack; + } + } + { + ReactDebugCurrentFrame.setExtraStackFrame = function (stack) { + { + currentExtraStackFrame = stack; + } + }; // Stack implementation injected by the current renderer. + + ReactDebugCurrentFrame.getCurrentStack = null; + ReactDebugCurrentFrame.getStackAddendum = function () { + var stack = ''; // Add an extra top frame while an element is being validated + + if (currentExtraStackFrame) { + stack += currentExtraStackFrame; + } // Delegate to the injected renderer-specific implementation + + var impl = ReactDebugCurrentFrame.getCurrentStack; + if (impl) { + stack += impl() || ''; + } + return stack; + }; + } + + // ----------------------------------------------------------------------------- + + var enableScopeAPI = false; // Experimental Create Event Handle API. + var enableCacheElement = false; + var enableTransitionTracing = false; // No known bugs, but needs performance testing + + var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber + // stuff. Intended to enable React core members to more easily debug scheduling + // issues in DEV builds. + + var enableDebugTracing = false; // Track which Fiber(s) schedule render work. + + var ReactSharedInternals = { + ReactCurrentDispatcher: ReactCurrentDispatcher, + ReactCurrentBatchConfig: ReactCurrentBatchConfig, + ReactCurrentOwner: ReactCurrentOwner + }; + { + ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame; + ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue; + } + + // by calls to these methods by a Babel plugin. + // + // In PROD (or in packages without access to React internals), + // they are left as they are instead. + + function warn(format) { + { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + printWarning('warn', format, args); + } + } + } + function error(format) { + { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + printWarning('error', format, args); + } + } + } + function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } // eslint-disable-next-line react-internal/safe-string-coercion + + var argsWithFormat = args.map(function (item) { + return String(item); + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } + } + var didWarnStateUpdateForUnmountedComponent = {}; + function warnNoop(publicInstance, callerName) { + { + var _constructor = publicInstance.constructor; + var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass'; + var warningKey = componentName + "." + callerName; + if (didWarnStateUpdateForUnmountedComponent[warningKey]) { + return; + } + error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName); + didWarnStateUpdateForUnmountedComponent[warningKey] = true; + } + } + /** + * This is the abstract API for an update queue. + */ + + var ReactNoopUpdateQueue = { + /** + * Checks whether or not this composite component is mounted. + * @param {ReactClass} publicInstance The instance we want to test. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function isMounted(publicInstance) { + return false; + }, + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {?function} callback Called after component is updated. + * @param {?string} callerName name of the calling function in the public API. + * @internal + */ + enqueueForceUpdate: function enqueueForceUpdate(publicInstance, callback, callerName) { + warnNoop(publicInstance, 'forceUpdate'); + }, + /** + * Replaces all of the state. Always use this or `setState` to mutate state. + * You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} completeState Next state. + * @param {?function} callback Called after component is updated. + * @param {?string} callerName name of the calling function in the public API. + * @internal + */ + enqueueReplaceState: function enqueueReplaceState(publicInstance, completeState, callback, callerName) { + warnNoop(publicInstance, 'replaceState'); + }, + /** + * Sets a subset of the state. This only exists because _pendingState is + * internal. This provides a merging strategy that is not available to deep + * properties which is confusing. TODO: Expose pendingState or don't use it + * during the merge. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} partialState Next partial state to be merged with state. + * @param {?function} callback Called after component is updated. + * @param {?string} Name of the calling function in the public API. + * @internal + */ + enqueueSetState: function enqueueSetState(publicInstance, partialState, callback, callerName) { + warnNoop(publicInstance, 'setState'); + } + }; + var assign = Object.assign; + var emptyObject = {}; + { + Object.freeze(emptyObject); + } + /** + * Base class helpers for the updating state of a component. + */ + + function Component(props, context, updater) { + this.props = props; + this.context = context; // If a component has string refs, we will assign a different object later. + + this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the + // renderer. + + this.updater = updater || ReactNoopUpdateQueue; + } + Component.prototype.isReactComponent = {}; + /** + * Sets a subset of the state. Always use this to mutate + * state. You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * There is no guarantee that calls to `setState` will run synchronously, + * as they may eventually be batched together. You can provide an optional + * callback that will be executed when the call to setState is actually + * completed. + * + * When a function is provided to setState, it will be called at some point in + * the future (not synchronously). It will be called with the up to date + * component arguments (state, props, context). These values can be different + * from this.* because your function may be called after receiveProps but before + * shouldComponentUpdate, and this new state, props, and context will not yet be + * assigned to this. + * + * @param {object|function} partialState Next partial state or function to + * produce next partial state to be merged with current state. + * @param {?function} callback Called after state is updated. + * @final + * @protected + */ + + Component.prototype.setState = function (partialState, callback) { + if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) { + throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.'); + } + this.updater.enqueueSetState(this, partialState, callback, 'setState'); + }; + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {?function} callback Called after update is complete. + * @final + * @protected + */ + + Component.prototype.forceUpdate = function (callback) { + this.updater.enqueueForceUpdate(this, callback, 'forceUpdate'); + }; + /** + * Deprecated APIs. These APIs used to exist on classic React classes but since + * we would like to deprecate them, we're not going to move them over to this + * modern base class. Instead, we define a getter that warns if it's accessed. + */ + + { + var deprecatedAPIs = { + isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], + replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] + }; + var defineDeprecationWarning = function defineDeprecationWarning(methodName, info) { + Object.defineProperty(Component.prototype, methodName, { + get: function get() { + warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); + return undefined; + } + }); + }; + for (var fnName in deprecatedAPIs) { + if (deprecatedAPIs.hasOwnProperty(fnName)) { + defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); + } + } + } + function ComponentDummy() {} + ComponentDummy.prototype = Component.prototype; + /** + * Convenience component with default shallow equality check for sCU. + */ + + function PureComponent(props, context, updater) { + this.props = props; + this.context = context; // If a component has string refs, we will assign a different object later. + + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + } + var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); + pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods. + + assign(pureComponentPrototype, Component.prototype); + pureComponentPrototype.isPureReactComponent = true; + + // an immutable object with a single mutable value + function createRef() { + var refObject = { + current: null + }; + { + Object.seal(refObject); + } + return refObject; + } + var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare + + function isArray(a) { + return isArrayImpl(a); + } + + /* + * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol + * and Temporal.* types. See https://github.com/facebook/react/pull/22064. + * + * The functions in this module will throw an easier-to-understand, + * easier-to-debug exception with a clear errors message message explaining the + * problem. (Instead of a confusing exception thrown inside the implementation + * of the `value` object). + */ + // $FlowFixMe only called in DEV, so void return is not possible. + function typeName(value) { + { + // toStringTag is needed for namespaced types like Temporal.Instant + var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag; + var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; + return type; + } + } // $FlowFixMe only called in DEV, so void return is not possible. + + function willCoercionThrow(value) { + { + try { + testStringCoercion(value); + return false; + } catch (e) { + return true; + } + } + } + function testStringCoercion(value) { + // If you ended up here by following an exception call stack, here's what's + // happened: you supplied an object or symbol value to React (as a prop, key, + // DOM attribute, CSS property, string ref, etc.) and when React tried to + // coerce it to a string using `'' + value`, an exception was thrown. + // + // The most common types that will cause this exception are `Symbol` instances + // and Temporal objects like `Temporal.Instant`. But any object that has a + // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this + // exception. (Library authors do this to prevent users from using built-in + // numeric operators like `+` or comparison operators like `>=` because custom + // methods are needed to perform accurate arithmetic or comparison.) + // + // To fix the problem, coerce this object or symbol value to a string before + // passing it to React. The most reliable way is usually `String(value)`. + // + // To find which value is throwing, check the browser or debugger console. + // Before this exception was thrown, there should be `console.error` output + // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the + // problem and how that type was used: key, atrribute, input value prop, etc. + // In most cases, this console output also shows the component and its + // ancestor components where the exception happened. + // + // eslint-disable-next-line react-internal/safe-string-coercion + return '' + value; + } + function checkKeyStringCoercion(value) { + { + if (willCoercionThrow(value)) { + error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + function getWrappedName(outerType, innerType, wrapperName) { + var displayName = outerType.displayName; + if (displayName) { + return displayName; + } + var functionName = innerType.displayName || innerType.name || ''; + return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName; + } // Keep in sync with react-reconciler/getComponentNameFromFiber + + function getContextName(type) { + return type.displayName || 'Context'; + } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. + + function getComponentNameFromType(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + if (typeof type === 'string') { + 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'; + } + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + var context = type; + return getContextName(context) + '.Consumer'; + case REACT_PROVIDER_TYPE: + var provider = type; + return getContextName(provider._context) + '.Provider'; + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + case REACT_MEMO_TYPE: + var outerName = type.displayName || null; + if (outerName !== null) { + return outerName; + } + return getComponentNameFromType(type.type) || 'Memo'; + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + return getComponentNameFromType(init(payload)); + } catch (x) { + return null; + } + } + + // eslint-disable-next-line no-fallthrough + } + } + return null; + } + var hasOwnProperty = Object.prototype.hasOwnProperty; + var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true + }; + var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs; + { + didWarnAboutStringRefs = {}; + } + function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + if (getter && getter.isReactWarning) { + return false; + } + } + } + return config.ref !== undefined; + } + function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + if (getter && getter.isReactWarning) { + return false; + } + } + } + return config.key !== undefined; + } + function defineKeyPropWarningGetter(props, displayName) { + var warnAboutAccessingKey = function warnAboutAccessingKey() { + { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + } + }; + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } + function defineRefPropWarningGetter(props, displayName) { + var warnAboutAccessingRef = function warnAboutAccessingRef() { + { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + } + }; + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } + function warnIfStringRefCannotBeAutoConverted(config) { + { + if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { + var componentName = getComponentNameFromType(ReactCurrentOwner.current.type); + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref); + didWarnAboutStringRefs[componentName] = true; + } + } + } + } + /** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + var ReactElement = function ReactElement(type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + return element; + }; + /** + * Create and return a new ReactElement of the given type. + * See https://reactjs.org/docs/react-api.html#createelement + */ + + function createElement(type, config, children) { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; + var self = null; + var source = null; + if (config != null) { + if (hasValidRef(config)) { + ref = config.ref; + { + warnIfStringRefCannotBeAutoConverted(config); + } + } + if (hasValidKey(config)) { + { + checkKeyStringCoercion(config.key); + } + key = '' + config.key; + } + self = config.__self === undefined ? null : config.__self; + source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } + } // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + { + if (Object.freeze) { + Object.freeze(childArray); + } + } + props.children = childArray; + } // Resolve default props + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + { + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + } + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } + function cloneAndReplaceKey(oldElement, newKey) { + var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); + return newElement; + } + /** + * Clone and return a new ReactElement using element as the starting point. + * See https://reactjs.org/docs/react-api.html#cloneelement + */ + + function cloneElement(element, config, children) { + if (element === null || element === undefined) { + throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + "."); + } + var propName; // Original props are copied + + var props = assign({}, element.props); // Reserved names are extracted + + var key = element.key; + var ref = element.ref; // Self is preserved since the owner is preserved. + + var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a + // transpiler, and the original source is probably a better indicator of the + // true owner. + + var source = element._source; // Owner will be preserved, unless ref is overridden + + var owner = element._owner; + if (config != null) { + if (hasValidRef(config)) { + // Silently steal the ref from the parent. + ref = config.ref; + owner = ReactCurrentOwner.current; + } + if (hasValidKey(config)) { + { + checkKeyStringCoercion(config.key); + } + key = '' + config.key; + } // Remaining properties override existing props + + var defaultProps; + if (element.type && element.type.defaultProps) { + defaultProps = element.type.defaultProps; + } + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + if (config[propName] === undefined && defaultProps !== undefined) { + // Resolve default props + props[propName] = defaultProps[propName]; + } else { + props[propName] = config[propName]; + } + } + } + } // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + props.children = childArray; + } + return ReactElement(element.type, key, ref, self, source, owner, props); + } + /** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + + function isValidElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } + var SEPARATOR = '.'; + var SUBSEPARATOR = ':'; + /** + * Escape and wrap key so it is safe to use as a reactid + * + * @param {string} key to be escaped. + * @return {string} the escaped key. + */ + + function escape(key) { + var escapeRegex = /[=:]/g; + var escaperLookup = { + '=': '=0', + ':': '=2' + }; + var escapedString = key.replace(escapeRegex, function (match) { + return escaperLookup[match]; + }); + return '$' + escapedString; + } + /** + * TODO: Test that a single child and an array with one item have the same key + * pattern. + */ + + var didWarnAboutMaps = false; + var userProvidedKeyEscapeRegex = /\/+/g; + function escapeUserProvidedKey(text) { + return text.replace(userProvidedKeyEscapeRegex, '$&/'); + } + /** + * Generate a key string that identifies a element within a set. + * + * @param {*} element A element that could contain a manual key. + * @param {number} index Index that is used if a manual key is not provided. + * @return {string} + */ + + function getElementKey(element, index) { + // Do some typechecking here since we call this blindly. We want to ensure + // that we don't block potential future ES APIs. + if (typeof element === 'object' && element !== null && element.key != null) { + // Explicit key + { + checkKeyStringCoercion(element.key); + } + return escape('' + element.key); + } // Implicit key determined by the index in the set + + return index.toString(36); + } + function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { + var type = typeof children; + if (type === 'undefined' || type === 'boolean') { + // All of the above are perceived as null. + children = null; + } + var invokeCallback = false; + if (children === null) { + invokeCallback = true; + } else { + switch (type) { + case 'string': + case 'number': + invokeCallback = true; + break; + case 'object': + switch (children.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + invokeCallback = true; + } + } + } + if (invokeCallback) { + var _child = children; + var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array + // so that it's consistent if the number of children grows: + + var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar; + if (isArray(mappedChild)) { + var escapedChildKey = ''; + if (childKey != null) { + escapedChildKey = escapeUserProvidedKey(childKey) + '/'; + } + mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) { + return c; + }); + } else if (mappedChild != null) { + if (isValidElement(mappedChild)) { + { + // The `if` statement here prevents auto-disabling of the safe + // coercion ESLint rule, so we must manually disable it below. + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key + if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) { + checkKeyStringCoercion(mappedChild.key); + } + } + mappedChild = cloneAndReplaceKey(mappedChild, + // Keep both the (mapped) and old keys if they differ, just as + // traverseAllChildren used to do for objects as children + escapedPrefix + ( + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key + mappedChild.key && (!_child || _child.key !== mappedChild.key) ? + // $FlowFixMe Flow incorrectly thinks existing element's key can be a number + // eslint-disable-next-line react-internal/safe-string-coercion + escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey); + } + array.push(mappedChild); + } + return 1; + } + var child; + var nextName; + var subtreeCount = 0; // Count of children found in the current subtree. + + var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; + if (isArray(children)) { + for (var i = 0; i < children.length; i++) { + child = children[i]; + nextName = nextNamePrefix + getElementKey(child, i); + subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); + } + } else { + var iteratorFn = getIteratorFn(children); + if (typeof iteratorFn === 'function') { + var iterableChildren = children; + { + // Warn about using Maps as children + if (iteratorFn === iterableChildren.entries) { + if (!didWarnAboutMaps) { + warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.'); + } + didWarnAboutMaps = true; + } + } + var iterator = iteratorFn.call(iterableChildren); + var step; + var ii = 0; + while (!(step = iterator.next()).done) { + child = step.value; + nextName = nextNamePrefix + getElementKey(child, ii++); + subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); + } + } else if (type === 'object') { + // eslint-disable-next-line react-internal/safe-string-coercion + var childrenString = String(children); + throw new Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). " + 'If you meant to render a collection of children, use an array ' + 'instead.'); + } + } + return subtreeCount; + } + + /** + * Maps children that are typically specified as `props.children`. + * + * See https://reactjs.org/docs/react-api.html#reactchildrenmap + * + * The provided mapFunction(child, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} func The map function. + * @param {*} context Context for mapFunction. + * @return {object} Object containing the ordered map of results. + */ + function mapChildren(children, func, context) { + if (children == null) { + return children; + } + var result = []; + var count = 0; + mapIntoArray(children, result, '', '', function (child) { + return func.call(context, child, count++); + }); + return result; + } + /** + * Count the number of children that are typically specified as + * `props.children`. + * + * See https://reactjs.org/docs/react-api.html#reactchildrencount + * + * @param {?*} children Children tree container. + * @return {number} The number of children. + */ + + function countChildren(children) { + var n = 0; + mapChildren(children, function () { + n++; // Don't return anything + }); + return n; + } + + /** + * Iterates through children that are typically specified as `props.children`. + * + * See https://reactjs.org/docs/react-api.html#reactchildrenforeach + * + * The provided forEachFunc(child, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} forEachFunc + * @param {*} forEachContext Context for forEachContext. + */ + function forEachChildren(children, forEachFunc, forEachContext) { + mapChildren(children, function () { + forEachFunc.apply(this, arguments); // Don't return anything. + }, forEachContext); + } + /** + * Flatten a children object (typically specified as `props.children`) and + * return an array with appropriately re-keyed children. + * + * See https://reactjs.org/docs/react-api.html#reactchildrentoarray + */ + + function toArray(children) { + return mapChildren(children, function (child) { + return child; + }) || []; + } + /** + * Returns the first child in a collection of children and verifies that there + * is only one child in the collection. + * + * See https://reactjs.org/docs/react-api.html#reactchildrenonly + * + * The current implementation of this function assumes that a single child gets + * passed without a wrapper, but the purpose of this helper function is to + * abstract away the particular structure of children. + * + * @param {?object} children Child collection structure. + * @return {ReactElement} The first and only `ReactElement` contained in the + * structure. + */ + + function onlyChild(children) { + if (!isValidElement(children)) { + throw new Error('React.Children.only expected to receive a single React element child.'); + } + return children; + } + function createContext(defaultValue) { + // TODO: Second argument used to be an optional `calculateChangedBits` + // function. Warn to reserve for future use? + var context = { + $$typeof: REACT_CONTEXT_TYPE, + // As a workaround to support multiple concurrent renderers, we categorize + // some renderers as primary and others as secondary. We only expect + // there to be two concurrent renderers at most: React Native (primary) and + // Fabric (secondary); React DOM (primary) and React ART (secondary). + // Secondary renderers store their context values on separate fields. + _currentValue: defaultValue, + _currentValue2: defaultValue, + // Used to track how many concurrent renderers this context currently + // supports within in a single renderer. Such as parallel server rendering. + _threadCount: 0, + // These are circular + Provider: null, + Consumer: null, + // Add these to use same hidden class in VM as ServerContext + _defaultValue: null, + _globalName: null + }; + context.Provider = { + $$typeof: REACT_PROVIDER_TYPE, + _context: context + }; + var hasWarnedAboutUsingNestedContextConsumers = false; + var hasWarnedAboutUsingConsumerProvider = false; + var hasWarnedAboutDisplayNameOnConsumer = false; + { + // A separate object, but proxies back to the original context object for + // backwards compatibility. It has a different $$typeof, so we can properly + // warn for the incorrect usage of Context as a Consumer. + var Consumer = { + $$typeof: REACT_CONTEXT_TYPE, + _context: context + }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here + + Object.defineProperties(Consumer, { + Provider: { + get: function get() { + if (!hasWarnedAboutUsingConsumerProvider) { + hasWarnedAboutUsingConsumerProvider = true; + error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + } + return context.Provider; + }, + set: function set(_Provider) { + context.Provider = _Provider; + } + }, + _currentValue: { + get: function get() { + return context._currentValue; + }, + set: function set(_currentValue) { + context._currentValue = _currentValue; + } + }, + _currentValue2: { + get: function get() { + return context._currentValue2; + }, + set: function set(_currentValue2) { + context._currentValue2 = _currentValue2; + } + }, + _threadCount: { + get: function get() { + return context._threadCount; + }, + set: function set(_threadCount) { + context._threadCount = _threadCount; + } + }, + Consumer: { + get: function get() { + if (!hasWarnedAboutUsingNestedContextConsumers) { + hasWarnedAboutUsingNestedContextConsumers = true; + error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + } + return context.Consumer; + } + }, + displayName: { + get: function get() { + return context.displayName; + }, + set: function set(displayName) { + if (!hasWarnedAboutDisplayNameOnConsumer) { + warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName); + hasWarnedAboutDisplayNameOnConsumer = true; + } + } + } + }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty + + context.Consumer = Consumer; + } + { + context._currentRenderer = null; + context._currentRenderer2 = null; + } + return context; + } + var Uninitialized = -1; + var Pending = 0; + var Resolved = 1; + var Rejected = 2; + function lazyInitializer(payload) { + if (payload._status === Uninitialized) { + var ctor = payload._result; + var thenable = ctor(); // Transition to the next state. + // This might throw either because it's missing or throws. If so, we treat it + // as still uninitialized and try again next time. Which is the same as what + // happens if the ctor or any wrappers processing the ctor throws. This might + // end up fixing it if the resolution was a concurrency bug. + + thenable.then(function (moduleObject) { + if (payload._status === Pending || payload._status === Uninitialized) { + // Transition to the next state. + var resolved = payload; + resolved._status = Resolved; + resolved._result = moduleObject; + } + }, function (error) { + if (payload._status === Pending || payload._status === Uninitialized) { + // Transition to the next state. + var rejected = payload; + rejected._status = Rejected; + rejected._result = error; + } + }); + if (payload._status === Uninitialized) { + // In case, we're still uninitialized, then we're waiting for the thenable + // to resolve. Set it as pending in the meantime. + var pending = payload; + pending._status = Pending; + pending._result = thenable; + } + } + if (payload._status === Resolved) { + var moduleObject = payload._result; + { + if (moduleObject === undefined) { + error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + + // Break up imports to avoid accidentally parsing them as dependencies. + 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject); + } + } + { + if (!('default' in moduleObject)) { + error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + + // Break up imports to avoid accidentally parsing them as dependencies. + 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject); + } + } + return moduleObject.default; + } else { + throw payload._result; + } + } + function lazy(ctor) { + var payload = { + // We use these fields to store the result. + _status: Uninitialized, + _result: ctor + }; + var lazyType = { + $$typeof: REACT_LAZY_TYPE, + _payload: payload, + _init: lazyInitializer + }; + { + // In production, this would just set it on the object. + var defaultProps; + var propTypes; // $FlowFixMe + + Object.defineProperties(lazyType, { + defaultProps: { + configurable: true, + get: function get() { + return defaultProps; + }, + set: function set(newDefaultProps) { + error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); + defaultProps = newDefaultProps; // Match production behavior more closely: + // $FlowFixMe + + Object.defineProperty(lazyType, 'defaultProps', { + enumerable: true + }); + } + }, + propTypes: { + configurable: true, + get: function get() { + return propTypes; + }, + set: function set(newPropTypes) { + error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); + propTypes = newPropTypes; // Match production behavior more closely: + // $FlowFixMe + + Object.defineProperty(lazyType, 'propTypes', { + enumerable: true + }); + } + } + }); + } + return lazyType; + } + function forwardRef(render) { + { + if (render != null && render.$$typeof === REACT_MEMO_TYPE) { + error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).'); + } else if (typeof render !== 'function') { + error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); + } else { + if (render.length !== 0 && render.length !== 2) { + error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.'); + } + } + if (render != null) { + if (render.defaultProps != null || render.propTypes != null) { + error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?'); + } + } + } + var elementType = { + $$typeof: REACT_FORWARD_REF_TYPE, + render: render + }; + { + var ownName; + Object.defineProperty(elementType, 'displayName', { + enumerable: false, + configurable: true, + get: function get() { + return ownName; + }, + set: function set(name) { + ownName = name; // The inner component shouldn't inherit this display name in most cases, + // because the component may be used elsewhere. + // But it's nice for anonymous functions to inherit the name, + // so that our component-stack generation logic will display their frames. + // An anonymous function generally suggests a pattern like: + // React.forwardRef((props, ref) => {...}); + // This kind of inner function is not used elsewhere so the side effect is okay. + + if (!render.name && !render.displayName) { + render.displayName = name; + } + } + }); + } + return elementType; + } + var REACT_MODULE_REFERENCE; + { + REACT_MODULE_REFERENCE = Symbol.for('react.module.reference'); + } + function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) { + return true; + } + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || + // This needs to include all possible module reference object + // types supported by any Flight configuration anywhere since + // we don't know which Flight build this will end up being used + // with. + type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { + return true; + } + } + return false; + } + function memo(type, compare) { + { + if (!isValidElementType(type)) { + error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type); + } + } + var elementType = { + $$typeof: REACT_MEMO_TYPE, + type: type, + compare: compare === undefined ? null : compare + }; + { + var ownName; + Object.defineProperty(elementType, 'displayName', { + enumerable: false, + configurable: true, + get: function get() { + return ownName; + }, + set: function set(name) { + ownName = name; // The inner component shouldn't inherit this display name in most cases, + // because the component may be used elsewhere. + // But it's nice for anonymous functions to inherit the name, + // so that our component-stack generation logic will display their frames. + // An anonymous function generally suggests a pattern like: + // React.memo((props) => {...}); + // This kind of inner function is not used elsewhere so the side effect is okay. + + if (!type.name && !type.displayName) { + type.displayName = name; + } + } + }); + } + return elementType; + } + function resolveDispatcher() { + var dispatcher = ReactCurrentDispatcher.current; + { + if (dispatcher === null) { + 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:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.'); + } + } // Will result in a null access error if accessed outside render phase. We + // intentionally don't throw our own error because this is in a hot path. + // Also helps ensure this is inlined. + + return dispatcher; + } + function useContext(Context) { + var dispatcher = resolveDispatcher(); + { + // TODO: add a more generic warning for invalid values. + if (Context._context !== undefined) { + var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs + // and nobody should be using this in existing code. + + if (realContext.Consumer === Context) { + error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?'); + } else if (realContext.Provider === Context) { + error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?'); + } + } + } + return dispatcher.useContext(Context); + } + function useState(initialState) { + var dispatcher = resolveDispatcher(); + return dispatcher.useState(initialState); + } + function useReducer(reducer, initialArg, init) { + var dispatcher = resolveDispatcher(); + return dispatcher.useReducer(reducer, initialArg, init); + } + function useRef(initialValue) { + var dispatcher = resolveDispatcher(); + return dispatcher.useRef(initialValue); + } + function useEffect(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useEffect(create, deps); + } + function useInsertionEffect(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useInsertionEffect(create, deps); + } + function useLayoutEffect(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useLayoutEffect(create, deps); + } + function useCallback(callback, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useCallback(callback, deps); + } + function useMemo(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useMemo(create, deps); + } + function useImperativeHandle(ref, create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useImperativeHandle(ref, create, deps); + } + function useDebugValue(value, formatterFn) { + { + var dispatcher = resolveDispatcher(); + return dispatcher.useDebugValue(value, formatterFn); + } + } + function useTransition() { + var dispatcher = resolveDispatcher(); + return dispatcher.useTransition(); + } + function useDeferredValue(value) { + var dispatcher = resolveDispatcher(); + return dispatcher.useDeferredValue(value); + } + function useId() { + var dispatcher = resolveDispatcher(); + return dispatcher.useId(); + } + function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var dispatcher = resolveDispatcher(); + return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); + } + + // Helpers to patch console.logs to avoid logging during side-effect free + // replaying on render function. This currently only patches the object + // lazily which won't cover if the log function was extracted eagerly. + // We could also eagerly patch the method. + var disabledDepth = 0; + var prevLog; + var prevInfo; + var prevWarn; + var prevError; + var prevGroup; + var prevGroupCollapsed; + var prevGroupEnd; + function disabledLog() {} + disabledLog.__reactDisabledLog = true; + function disableLogs() { + { + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 + + var props = { + configurable: true, + enumerable: true, + value: disabledLog, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + /* eslint-enable react-internal/no-production-logging */ + } + disabledDepth++; + } + } + function reenableLogs() { + { + disabledDepth--; + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + var props = { + configurable: true, + enumerable: true, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + log: assign({}, props, { + value: prevLog + }), + info: assign({}, props, { + value: prevInfo + }), + warn: assign({}, props, { + value: prevWarn + }), + error: assign({}, props, { + value: prevError + }), + group: assign({}, props, { + value: prevGroup + }), + groupCollapsed: assign({}, props, { + value: prevGroupCollapsed + }), + groupEnd: assign({}, props, { + value: prevGroupEnd + }) + }); + /* eslint-enable react-internal/no-production-logging */ + } + if (disabledDepth < 0) { + error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); + } + } + } + var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; + var prefix; + function describeBuiltInComponentFrame(name, source, ownerFn) { + { + if (prefix === undefined) { + // Extract the VM specific prefix used by each line. + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = match && match[1] || ''; + } + } // We use the prefix to ensure our stacks line up with native stack frames. + + return '\n' + prefix + name; + } + } + var reentry = false; + var componentFrameCache; + { + var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap(); + } + function describeNativeComponentFrame(fn, construct) { + // If something asked for a stack inside a fake render, it should get ignored. + if (!fn || reentry) { + return ''; + } + { + var frame = componentFrameCache.get(fn); + if (frame !== undefined) { + return frame; + } + } + var control; + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. + + Error.prepareStackTrace = undefined; + var previousDispatcher; + { + previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function + // for warnings. + + ReactCurrentDispatcher$1.current = null; + disableLogs(); + } + try { + // This should throw. + if (construct) { + // Something should be setting the props in the constructor. + var Fake = function Fake() { + throw Error(); + }; // $FlowFixMe + + Object.defineProperty(Fake.prototype, 'props', { + set: function set() { + // We use a throwing setter instead of frozen or non-writable props + // because that won't throw in a non-strict mode function. + throw Error(); + } + }); + if (typeof Reflect === 'object' && Reflect.construct) { + // We construct a different control for this case to include any extra + // frames added by the construct call. + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } + fn(); + } + } catch (sample) { + // This is inlined manually because closure doesn't do it for us. + if (sample && control && typeof sample.stack === 'string') { + // This extracts the first frame from the sample that isn't also in the control. + // Skipping one frame that we assume is the frame that calls the two. + var sampleLines = sample.stack.split('\n'); + var controlLines = control.stack.split('\n'); + var s = sampleLines.length - 1; + var c = controlLines.length - 1; + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + // We expect at least one stack frame to be shared. + // Typically this will be the root most one. However, stack frames may be + // cut off due to maximum stack limits. In this case, one maybe cut off + // earlier than the other. We assume that the sample is longer or the same + // and there for cut off earlier. So we should find the root most frame in + // the sample somewhere in the control. + c--; + } + for (; s >= 1 && c >= 0; s--, c--) { + // Next we find the first one that isn't the same which should be the + // frame that called our sample function and the control. + if (sampleLines[s] !== controlLines[c]) { + // In V8, the first line is describing the message but other VMs don't. + // If we're about to return the first line, and the control is also on the same + // line, that's a pretty good indicator that our sample threw at same line as + // the control. I.e. before we entered the sample frame. So we ignore this result. + // This can happen if you passed a class to function component, or non-function. + if (s !== 1 || c !== 1) { + do { + s--; + c--; // We may still have similar intermediate frames from the construct call. + // The next one that isn't the same should be our match though. + + if (c < 0 || sampleLines[s] !== controlLines[c]) { + // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. + var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "" + // but we have a user-provided "displayName" + // splice it in to make the stack more readable. + + if (fn.displayName && _frame.includes('')) { + _frame = _frame.replace('', fn.displayName); + } + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, _frame); + } + } // Return the line we found. + + return _frame; + } + } while (s >= 1 && c >= 0); + } + break; + } + } + } + } finally { + reentry = false; + { + ReactCurrentDispatcher$1.current = previousDispatcher; + reenableLogs(); + } + Error.prepareStackTrace = previousPrepareStackTrace; + } // Fallback to just using the name if we couldn't make it throw. + + var name = fn ? fn.displayName || fn.name : ''; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, syntheticFrame); + } + } + return syntheticFrame; + } + function describeFunctionComponentFrame(fn, source, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } + } + function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); + } + function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { + if (type == null) { + return ''; + } + if (typeof type === 'function') { + { + return describeNativeComponentFrame(type, shouldConstruct(type)); + } + } + if (typeof type === 'string') { + return describeBuiltInComponentFrame(type); + } + switch (type) { + case REACT_SUSPENSE_TYPE: + return describeBuiltInComponentFrame('Suspense'); + case REACT_SUSPENSE_LIST_TYPE: + return describeBuiltInComponentFrame('SuspenseList'); + } + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_FORWARD_REF_TYPE: + return describeFunctionComponentFrame(type.render); + case REACT_MEMO_TYPE: + // Memo may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + // Lazy may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); + } catch (x) {} + } + } + } + return ''; + } + var loggedTypeFailures = {}; + var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + function setCurrentlyValidatingElement(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame$1.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame$1.setExtraStackFrame(null); + } + } + } + function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(hasOwnProperty); + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + // eslint-disable-next-line react-internal/prod-error-codes + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; + } + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); + } catch (ex) { + error$1 = ex; + } + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); + setCurrentlyValidatingElement(null); + } + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + error('Failed %s type: %s', location, error$1.message); + setCurrentlyValidatingElement(null); + } + } + } + } + } + function setCurrentlyValidatingElement$1(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + setExtraStackFrame(stack); + } else { + setExtraStackFrame(null); + } + } + } + var propTypesMisspellWarningShown; + { + propTypesMisspellWarningShown = false; + } + function getDeclarationErrorAddendum() { + if (ReactCurrentOwner.current) { + var name = getComponentNameFromType(ReactCurrentOwner.current.type); + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + return ''; + } + function getSourceInfoErrorAddendum(source) { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + return ''; + } + function getSourceInfoErrorAddendumForProps(elementProps) { + if (elementProps !== null && elementProps !== undefined) { + return getSourceInfoErrorAddendum(elementProps.__source); + } + return ''; + } + /** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + var ownerHasKeyUseWarning = {}; + function getCurrentComponentErrorInfo(parentType) { + var info = getDeclarationErrorAddendum(); + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + return info; + } + /** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + function validateExplicitKey(element, parentType) { + if (!element._store || element._store.validated || element.key != null) { + return; + } + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + if (element && element._owner && element._owner !== ReactCurrentOwner.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + "."; + } + { + setCurrentlyValidatingElement$1(element); + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + setCurrentlyValidatingElement$1(null); + } + } + /** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + function validateChildKeys(node, parentType) { + if (typeof node !== 'object') { + return; + } + if (isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } + /** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + function validatePropTypes(element) { + { + var type = element.type; + if (type === null || type === undefined || typeof type === 'string') { + return; + } + var propTypes; + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || + // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + if (propTypes) { + // Intentionally inside to avoid triggering lazy initializers: + var name = getComponentNameFromType(type); + checkPropTypes(propTypes, element.props, 'prop', name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: + + var _name = getComponentNameFromType(type); + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); + } + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } + } + /** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (key !== 'children' && key !== 'key') { + setCurrentlyValidatingElement$1(fragment); + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + setCurrentlyValidatingElement$1(null); + break; + } + } + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + setCurrentlyValidatingElement$1(null); + } + } + } + function createElementWithValidation(type, props, children) { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + var sourceInfo = getSourceInfoErrorAddendumForProps(props); + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + var typeString; + if (type === null) { + typeString = 'null'; + } else if (isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + { + error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + } + var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + if (validType) { + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], type); + } + } + if (type === REACT_FRAGMENT_TYPE) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + return element; + } + var didWarnAboutDeprecatedCreateFactory = false; + function createFactoryWithValidation(type) { + var validatedFactory = createElementWithValidation.bind(null, type); + validatedFactory.type = type; + { + if (!didWarnAboutDeprecatedCreateFactory) { + didWarnAboutDeprecatedCreateFactory = true; + warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.'); + } // Legacy hook: remove it + + Object.defineProperty(validatedFactory, 'type', { + enumerable: false, + get: function get() { + warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); + Object.defineProperty(this, 'type', { + value: type + }); + return type; + } + }); + } + return validatedFactory; + } + function cloneElementWithValidation(element, props, children) { + var newElement = cloneElement.apply(this, arguments); + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], newElement.type); + } + validatePropTypes(newElement); + return newElement; + } + function startTransition(scope, options) { + var prevTransition = ReactCurrentBatchConfig.transition; + ReactCurrentBatchConfig.transition = {}; + var currentTransition = ReactCurrentBatchConfig.transition; + { + ReactCurrentBatchConfig.transition._updatedFibers = new Set(); + } + try { + scope(); + } finally { + ReactCurrentBatchConfig.transition = prevTransition; + { + if (prevTransition === null && currentTransition._updatedFibers) { + var updatedFibersCount = currentTransition._updatedFibers.size; + if (updatedFibersCount > 10) { + warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); + } + currentTransition._updatedFibers.clear(); + } + } + } + } + var didWarnAboutMessageChannel = false; + var enqueueTaskImpl = null; + function enqueueTask(task) { + if (enqueueTaskImpl === null) { + try { + // read require off the module object to get around the bundlers. + // we don't want them to detect a require and bundle a Node polyfill. + var requireString = ('require' + Math.random()).slice(0, 7); + var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's + // version of setImmediate, bypassing fake timers if any. + + enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate; + } catch (_err) { + // we're in a browser + // we can't use regular timers because they may still be faked + // so we try MessageChannel+postMessage instead + enqueueTaskImpl = function enqueueTaskImpl(callback) { + { + if (didWarnAboutMessageChannel === false) { + didWarnAboutMessageChannel = true; + if (typeof MessageChannel === 'undefined') { + error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.'); + } + } + } + var channel = new MessageChannel(); + channel.port1.onmessage = callback; + channel.port2.postMessage(undefined); + }; + } + } + return enqueueTaskImpl(task); + } + var actScopeDepth = 0; + var didWarnNoAwaitAct = false; + function act(callback) { + { + // `act` calls can be nested, so we track the depth. This represents the + // number of `act` scopes on the stack. + var prevActScopeDepth = actScopeDepth; + actScopeDepth++; + if (ReactCurrentActQueue.current === null) { + // This is the outermost `act` scope. Initialize the queue. The reconciler + // will detect the queue and use it instead of Scheduler. + ReactCurrentActQueue.current = []; + } + var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy; + var result; + try { + // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only + // set to `true` while the given callback is executed, not for updates + // triggered during an async event, because this is how the legacy + // implementation of `act` behaved. + ReactCurrentActQueue.isBatchingLegacy = true; + result = callback(); // Replicate behavior of original `act` implementation in legacy mode, + // which flushed updates immediately after the scope function exits, even + // if it's an async function. + + if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) { + var queue = ReactCurrentActQueue.current; + if (queue !== null) { + ReactCurrentActQueue.didScheduleLegacyUpdate = false; + flushActQueue(queue); + } + } + } catch (error) { + popActScope(prevActScopeDepth); + throw error; + } finally { + ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy; + } + if (result !== null && typeof result === 'object' && typeof result.then === 'function') { + var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait + // for it to resolve before exiting the current scope. + + var wasAwaited = false; + var thenable = { + then: function then(resolve, reject) { + wasAwaited = true; + thenableResult.then(function (returnValue) { + popActScope(prevActScopeDepth); + if (actScopeDepth === 0) { + // We've exited the outermost act scope. Recursively flush the + // queue until there's no remaining work. + recursivelyFlushAsyncActWork(returnValue, resolve, reject); + } else { + resolve(returnValue); + } + }, function (error) { + // The callback threw an error. + popActScope(prevActScopeDepth); + reject(error); + }); + } + }; + { + if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') { + // eslint-disable-next-line no-undef + Promise.resolve().then(function () {}).then(function () { + if (!wasAwaited) { + didWarnNoAwaitAct = true; + error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);'); + } + }); + } + } + return thenable; + } else { + var returnValue = result; // The callback is not an async function. Exit the current scope + // immediately, without awaiting. + + popActScope(prevActScopeDepth); + if (actScopeDepth === 0) { + // Exiting the outermost act scope. Flush the queue. + var _queue = ReactCurrentActQueue.current; + if (_queue !== null) { + flushActQueue(_queue); + ReactCurrentActQueue.current = null; + } // Return a thenable. If the user awaits it, we'll flush again in + // case additional work was scheduled by a microtask. + + var _thenable = { + then: function then(resolve, reject) { + // Confirm we haven't re-entered another `act` scope, in case + // the user does something weird like await the thenable + // multiple times. + if (ReactCurrentActQueue.current === null) { + // Recursively flush the queue until there's no remaining work. + ReactCurrentActQueue.current = []; + recursivelyFlushAsyncActWork(returnValue, resolve, reject); + } else { + resolve(returnValue); + } + } + }; + return _thenable; + } else { + // Since we're inside a nested `act` scope, the returned thenable + // immediately resolves. The outer scope will flush the queue. + var _thenable2 = { + then: function then(resolve, reject) { + resolve(returnValue); + } + }; + return _thenable2; + } + } + } + } + function popActScope(prevActScopeDepth) { + { + if (prevActScopeDepth !== actScopeDepth - 1) { + error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. '); + } + actScopeDepth = prevActScopeDepth; + } + } + function recursivelyFlushAsyncActWork(returnValue, resolve, reject) { + { + var queue = ReactCurrentActQueue.current; + if (queue !== null) { + try { + flushActQueue(queue); + enqueueTask(function () { + if (queue.length === 0) { + // No additional work was scheduled. Finish. + ReactCurrentActQueue.current = null; + resolve(returnValue); + } else { + // Keep flushing work until there's none left. + recursivelyFlushAsyncActWork(returnValue, resolve, reject); + } + }); + } catch (error) { + reject(error); + } + } else { + resolve(returnValue); + } + } + } + var isFlushing = false; + function flushActQueue(queue) { + { + if (!isFlushing) { + // Prevent re-entrance. + isFlushing = true; + var i = 0; + try { + for (; i < queue.length; i++) { + var callback = queue[i]; + do { + callback = callback(true); + } while (callback !== null); + } + queue.length = 0; + } catch (error) { + // If something throws, leave the remaining callbacks on the queue. + queue = queue.slice(i + 1); + throw error; + } finally { + isFlushing = false; + } + } + } + } + var createElement$1 = createElementWithValidation; + var cloneElement$1 = cloneElementWithValidation; + var createFactory = createFactoryWithValidation; + var Children = { + map: mapChildren, + forEach: forEachChildren, + count: countChildren, + toArray: toArray, + only: onlyChild + }; + exports.Children = Children; + exports.Component = Component; + exports.Fragment = REACT_FRAGMENT_TYPE; + exports.Profiler = REACT_PROFILER_TYPE; + exports.PureComponent = PureComponent; + exports.StrictMode = REACT_STRICT_MODE_TYPE; + exports.Suspense = REACT_SUSPENSE_TYPE; + exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; + exports.cloneElement = cloneElement$1; + exports.createContext = createContext; + exports.createElement = createElement$1; + exports.createFactory = createFactory; + exports.createRef = createRef; + exports.forwardRef = forwardRef; + exports.isValidElement = isValidElement; + exports.lazy = lazy; + exports.memo = memo; + exports.startTransition = startTransition; + exports.unstable_act = act; + exports.useCallback = useCallback; + exports.useContext = useContext; + exports.useDebugValue = useDebugValue; + exports.useDeferredValue = useDeferredValue; + exports.useEffect = useEffect; + exports.useId = useId; + exports.useImperativeHandle = useImperativeHandle; + exports.useInsertionEffect = useInsertionEffect; + exports.useLayoutEffect = useLayoutEffect; + exports.useMemo = useMemo; + exports.useReducer = useReducer; + exports.useRef = useRef; + exports.useState = useState; + exports.useSyncExternalStore = useSyncExternalStore; + exports.useTransition = useTransition; + exports.version = ReactVersion; + /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === 'function') { + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); + } + })(); + } +},67,[],"node_modules\\react\\cjs\\react.development.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + _$$_REQUIRE(_dependencyMap[0], "../Core/InitializeCore"); +},68,[69],"node_modules\\react-native\\Libraries\\ReactPrivate\\ReactNativePrivateInitializeCore.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + /** + * Sets up global variables typical in most JavaScript environments. + * + * 1. Global timers (via `setTimeout` etc). + * 2. Global console object. + * 3. Hooks for printing stack traces with source maps. + * + * Leaves enough room in the environment for implementing your own: + * + * 1. Require system. + * 2. Bridged modules. + * + */ + + 'use strict'; + + var start = Date.now(); + _$$_REQUIRE(_dependencyMap[0], "./setUpGlobals"); + _$$_REQUIRE(_dependencyMap[1], "./setUpDOM"); + _$$_REQUIRE(_dependencyMap[2], "./setUpPerformance"); + _$$_REQUIRE(_dependencyMap[3], "./setUpErrorHandling"); + _$$_REQUIRE(_dependencyMap[4], "./polyfillPromise"); + _$$_REQUIRE(_dependencyMap[5], "./setUpRegeneratorRuntime"); + _$$_REQUIRE(_dependencyMap[6], "./setUpTimers"); + _$$_REQUIRE(_dependencyMap[7], "./setUpXHR"); + _$$_REQUIRE(_dependencyMap[8], "./setUpAlert"); + _$$_REQUIRE(_dependencyMap[9], "./setUpNavigator"); + _$$_REQUIRE(_dependencyMap[10], "./setUpBatchedBridge"); + _$$_REQUIRE(_dependencyMap[11], "./setUpSegmentFetcher"); + if (__DEV__) { + _$$_REQUIRE(_dependencyMap[12], "./checkNativeVersion"); + _$$_REQUIRE(_dependencyMap[13], "./setUpDeveloperTools"); + _$$_REQUIRE(_dependencyMap[14], "../LogBox/LogBox").default.install(); + } + _$$_REQUIRE(_dependencyMap[15], "../ReactNative/AppRegistry"); + // We could just call GlobalPerformanceLogger.markPoint at the top of the file, + // but then we'd be excluding the time it took to require the logger. + // Instead, we just use Date.now and backdate the timestamp. + _$$_REQUIRE(_dependencyMap[16], "../Utilities/GlobalPerformanceLogger").markPoint('initializeCore_start', _$$_REQUIRE(_dependencyMap[16], "../Utilities/GlobalPerformanceLogger").currentTimestamp() - (Date.now() - start)); + _$$_REQUIRE(_dependencyMap[16], "../Utilities/GlobalPerformanceLogger").markPoint('initializeCore_end'); +},69,[70,71,74,86,113,140,143,148,175,179,180,202,204,207,95,231,155],"node_modules\\react-native\\Libraries\\Core\\InitializeCore.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + /** + * Sets up global variables for React Native. + * You can use this module directly, or just require InitializeCore. + */ + if (global.window === undefined) { + // $FlowExpectedError[cannot-write] The global isn't writable anywhere but here, where we define it. + global.window = global; + } + if (global.self === undefined) { + // $FlowExpectedError[cannot-write] The global isn't writable anywhere but here, where we define it. + global.self = global; + } + + // Set up process + // $FlowExpectedError[cannot-write] The global isn't writable anywhere but here, where we define it. + global.process = global.process || {}; + // $FlowExpectedError[cannot-write] The global isn't writable anywhere but here, where we define it. + global.process.env = global.process.env || {}; + if (!global.process.env.NODE_ENV) { + // $FlowExpectedError[cannot-write] The global isn't writable anywhere but here, where we define it. + global.process.env.NODE_ENV = __DEV__ ? 'development' : 'production'; + } +},70,[],"node_modules\\react-native\\Libraries\\Core\\setUpGlobals.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _DOMRect = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../DOM/Geometry/DOMRect")); + var _DOMRectReadOnly = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../DOM/Geometry/DOMRectReadOnly")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + // $FlowExpectedError[cannot-write] The global isn't writable anywhere but here, where we define it + global.DOMRect = _DOMRect.default; + + // $FlowExpectedError[cannot-write] The global isn't writable anywhere but here, where we define it + global.DOMRectReadOnly = _DOMRectReadOnly.default; +},71,[6,72,73],"node_modules\\react-native\\Libraries\\Core\\setUpDOM.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _DOMRectReadOnly2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./DOMRectReadOnly")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ /** + * The JSDoc comments in this file have been extracted from [DOMRect](https://developer.mozilla.org/en-US/docs/Web/API/DOMRect). + * Content by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMRect/contributors.txt), + * licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + */ + // flowlint unsafe-getters-setters:off + /** + * A `DOMRect` describes the size and position of a rectangle. + * The type of box represented by the `DOMRect` is specified by the method or property that returned it. + * + * This is a (mostly) spec-compliant version of `DOMRect` (https://developer.mozilla.org/en-US/docs/Web/API/DOMRect). + */ + var DOMRect = exports.default = /*#__PURE__*/function (_DOMRectReadOnly) { + function DOMRect() { + (0, _classCallCheck2.default)(this, DOMRect); + return _callSuper(this, DOMRect, arguments); + } + (0, _inherits2.default)(DOMRect, _DOMRectReadOnly); + return (0, _createClass2.default)(DOMRect, [{ + key: "x", + get: + /** + * The x coordinate of the `DOMRect`'s origin. + */ + function get() { + return this.__getInternalX(); + }, + set: function set(x) { + this.__setInternalX(x); + } + + /** + * The y coordinate of the `DOMRect`'s origin. + */ + }, { + key: "y", + get: function get() { + return this.__getInternalY(); + }, + set: function set(y) { + this.__setInternalY(y); + } + + /** + * The width of the `DOMRect`. + */ + }, { + key: "width", + get: function get() { + return this.__getInternalWidth(); + }, + set: function set(width) { + this.__setInternalWidth(width); + } + + /** + * The height of the `DOMRect`. + */ + }, { + key: "height", + get: function get() { + return this.__getInternalHeight(); + }, + set: function set(height) { + this.__setInternalHeight(height); + } + + /** + * Creates a new `DOMRect` object with a given location and dimensions. + */ + }], [{ + key: "fromRect", + value: function fromRect(rect) { + if (!rect) { + return new DOMRect(); + } + return new DOMRect(rect.x, rect.y, rect.width, rect.height); + } + }]); + }(_DOMRectReadOnly2.default); +},72,[6,18,19,23,25,28,73],"node_modules\\react-native\\Libraries\\DOM\\Geometry\\DOMRect.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /** + * The JSDoc comments in this file have been extracted from [DOMRectReadOnly](https://developer.mozilla.org/en-US/docs/Web/API/DOMRectReadOnly). + * Content by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMRectReadOnly/contributors.txt), + * licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + */ + + // flowlint sketchy-null:off, unsafe-getters-setters:off + + function castToNumber(value) { + return value ? Number(value) : 0; + } + + /** + * The `DOMRectReadOnly` interface specifies the standard properties used by `DOMRect` to define a rectangle whose properties are immutable. + * + * This is a (mostly) spec-compliant version of `DOMRectReadOnly` (https://developer.mozilla.org/en-US/docs/Web/API/DOMRectReadOnly). + */ + var DOMRectReadOnly = exports.default = /*#__PURE__*/function () { + function DOMRectReadOnly(x, y, width, height) { + (0, _classCallCheck2.default)(this, DOMRectReadOnly); + this.__setInternalX(x); + this.__setInternalY(y); + this.__setInternalWidth(width); + this.__setInternalHeight(height); + } + + /** + * The x coordinate of the `DOMRectReadOnly`'s origin. + */ + return (0, _createClass2.default)(DOMRectReadOnly, [{ + key: "x", + get: function get() { + return this._x; + } + + /** + * The y coordinate of the `DOMRectReadOnly`'s origin. + */ + }, { + key: "y", + get: function get() { + return this._y; + } + + /** + * The width of the `DOMRectReadOnly`. + */ + }, { + key: "width", + get: function get() { + return this._width; + } + + /** + * The height of the `DOMRectReadOnly`. + */ + }, { + key: "height", + get: function get() { + return this._height; + } + + /** + * Returns the top coordinate value of the `DOMRect` (has the same value as `y`, or `y + height` if `height` is negative). + */ + }, { + key: "top", + get: function get() { + var height = this._height; + var y = this._y; + if (height < 0) { + return y + height; + } + return y; + } + + /** + * Returns the right coordinate value of the `DOMRect` (has the same value as ``x + width`, or `x` if `width` is negative). + */ + }, { + key: "right", + get: function get() { + var width = this._width; + var x = this._x; + if (width < 0) { + return x; + } + return x + width; + } + + /** + * Returns the bottom coordinate value of the `DOMRect` (has the same value as `y + height`, or `y` if `height` is negative). + */ + }, { + key: "bottom", + get: function get() { + var height = this._height; + var y = this._y; + if (height < 0) { + return y; + } + return y + height; + } + + /** + * Returns the left coordinate value of the `DOMRect` (has the same value as `x`, or `x + width` if `width` is negative). + */ + }, { + key: "left", + get: function get() { + var width = this._width; + var x = this._x; + if (width < 0) { + return x + width; + } + return x; + } + }, { + key: "toJSON", + value: function toJSON() { + var x = this.x, + y = this.y, + width = this.width, + height = this.height, + top = this.top, + left = this.left, + bottom = this.bottom, + right = this.right; + return { + x: x, + y: y, + width: width, + height: height, + top: top, + left: left, + bottom: bottom, + right: right + }; + } + + /** + * Creates a new `DOMRectReadOnly` object with a given location and dimensions. + */ + }, { + key: "__getInternalX", + value: function __getInternalX() { + return this._x; + } + }, { + key: "__getInternalY", + value: function __getInternalY() { + return this._y; + } + }, { + key: "__getInternalWidth", + value: function __getInternalWidth() { + return this._width; + } + }, { + key: "__getInternalHeight", + value: function __getInternalHeight() { + return this._height; + } + }, { + key: "__setInternalX", + value: function __setInternalX(x) { + this._x = castToNumber(x); + } + }, { + key: "__setInternalY", + value: function __setInternalY(y) { + this._y = castToNumber(y); + } + }, { + key: "__setInternalWidth", + value: function __setInternalWidth(width) { + this._width = castToNumber(width); + } + }, { + key: "__setInternalHeight", + value: function __setInternalHeight(height) { + this._height = castToNumber(height); + } + }], [{ + key: "fromRect", + value: function fromRect(rect) { + if (!rect) { + return new DOMRectReadOnly(); + } + return new DOMRectReadOnly(rect.x, rect.y, rect.width, rect.height); + } + }]); + }(); +},73,[6,18,19],"node_modules\\react-native\\Libraries\\DOM\\Geometry\\DOMRectReadOnly.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _NativePerformance = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../WebPerformance/NativePerformance")); + var _Performance = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../WebPerformance/Performance")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + // In case if the native implementation of the Performance API is available, use it, + // otherwise fall back to the legacy/default one, which only defines 'Performance.now()' + if (_NativePerformance.default) { + // $FlowExpectedError[cannot-write] + global.performance = new _Performance.default(); + } else { + if (!global.performance) { + // $FlowExpectedError[cannot-write] + global.performance = { + now: function now() { + var performanceNow = global.nativePerformanceNow || Date.now; + return performanceNow(); + } + }; + } + } +},74,[6,75,76],"node_modules\\react-native\\Libraries\\Core\\setUpPerformance.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('NativePerformanceCxx'); +},75,[36],"node_modules\\react-native\\Libraries\\WebPerformance\\NativePerformance.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.PerformanceMeasure = exports.PerformanceMark = void 0; + var _readOnlyError2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/readOnlyError")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/classCallCheck")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _warnOnce = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../Utilities/warnOnce")); + var _EventCounts = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./EventCounts")); + var _MemoryInfo = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./MemoryInfo")); + var _NativePerformance = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "./NativePerformance")); + var _NativePerformanceObserver = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[11], "./NativePerformanceObserver")); + var _ReactNativeStartupTiming = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[12], "./ReactNativeStartupTiming")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ // flowlint unsafe-getters-setters:off + var getCurrentTimeStamp = global.nativePerformanceNow ? global.nativePerformanceNow : function () { + return Date.now(); + }; + + // We want some of the performance entry types to be always logged, + // even if they are not currently observed - this is either to be able to + // retrieve them at any time via Performance.getEntries* or to refer by other entries + // (such as when measures may refer to marks, even if the latter are not observed) + if (_NativePerformanceObserver.default != null && _NativePerformanceObserver.default.setIsBuffered) { + _NativePerformanceObserver.default == null ? void 0 : _NativePerformanceObserver.default.setIsBuffered(_$$_REQUIRE(_dependencyMap[13], "./PerformanceEntry").ALWAYS_LOGGED_ENTRY_TYPES.map(_$$_REQUIRE(_dependencyMap[14], "./RawPerformanceEntry").performanceEntryTypeToRaw), true); + } + var PerformanceMark = exports.PerformanceMark = /*#__PURE__*/function (_PerformanceEntry) { + function PerformanceMark(markName, markOptions) { + var _markOptions$startTim; + var _this; + (0, _classCallCheck2.default)(this, PerformanceMark); + _this = _callSuper(this, PerformanceMark, [{ + name: markName, + entryType: 'mark', + startTime: (_markOptions$startTim = markOptions == null ? void 0 : markOptions.startTime) != null ? _markOptions$startTim : getCurrentTimeStamp(), + duration: 0 + }]); + if (markOptions) { + _this.detail = markOptions.detail; + } + return _this; + } + (0, _inherits2.default)(PerformanceMark, _PerformanceEntry); + return (0, _createClass2.default)(PerformanceMark); + }(_$$_REQUIRE(_dependencyMap[13], "./PerformanceEntry").PerformanceEntry); + var PerformanceMeasure = exports.PerformanceMeasure = /*#__PURE__*/function (_PerformanceEntry2) { + function PerformanceMeasure(measureName, measureOptions) { + var _measureOptions$durat; + var _this2; + (0, _classCallCheck2.default)(this, PerformanceMeasure); + _this2 = _callSuper(this, PerformanceMeasure, [{ + name: measureName, + entryType: 'measure', + startTime: 0, + duration: (_measureOptions$durat = measureOptions == null ? void 0 : measureOptions.duration) != null ? _measureOptions$durat : 0 + }]); + if (measureOptions) { + _this2.detail = measureOptions.detail; + } + return _this2; + } + (0, _inherits2.default)(PerformanceMeasure, _PerformanceEntry2); + return (0, _createClass2.default)(PerformanceMeasure); + }(_$$_REQUIRE(_dependencyMap[13], "./PerformanceEntry").PerformanceEntry); + function warnNoNativePerformance() { + (0, _warnOnce.default)('missing-native-performance', 'Missing native implementation of Performance'); + } + + /** + * Partial implementation of the Performance interface for RN, + * corresponding to the standard in + * https://www.w3.org/TR/user-timing/#extensions-performance-interface + */ + var Performance = exports.default = /*#__PURE__*/function () { + function Performance() { + (0, _classCallCheck2.default)(this, Performance); + this.eventCounts = new _EventCounts.default(); + } + return (0, _createClass2.default)(Performance, [{ + key: "memory", + get: + // Get the current JS memory information. + function get() { + if (_NativePerformance.default != null && _NativePerformance.default.getSimpleMemoryInfo) { + // JSI API implementations may have different variants of names for the JS + // heap information we need here. We will parse the result based on our + // guess of the implementation for now. + var memoryInfo = _NativePerformance.default.getSimpleMemoryInfo(); + if (memoryInfo.hasOwnProperty('hermes_heapSize')) { + // We got memory information from Hermes + var totalJSHeapSize = memoryInfo.hermes_heapSize, + usedJSHeapSize = memoryInfo.hermes_allocatedBytes; + return new _MemoryInfo.default({ + jsHeapSizeLimit: null, + // We don't know the heap size limit from Hermes. + totalJSHeapSize: totalJSHeapSize, + usedJSHeapSize: usedJSHeapSize + }); + } else { + // JSC and V8 has no native implementations for memory information in JSI::Instrumentation + return new _MemoryInfo.default(); + } + } + return new _MemoryInfo.default(); + } + + // Startup metrics is not used in web, but only in React Native. + }, { + key: "reactNativeStartupTiming", + get: function get() { + if (_NativePerformance.default != null && _NativePerformance.default.getReactNativeStartupTiming) { + var _NativePerformance$ge = _NativePerformance.default.getReactNativeStartupTiming(), + startTime = _NativePerformance$ge.startTime, + endTime = _NativePerformance$ge.endTime, + initializeRuntimeStart = _NativePerformance$ge.initializeRuntimeStart, + initializeRuntimeEnd = _NativePerformance$ge.initializeRuntimeEnd, + executeJavaScriptBundleEntryPointStart = _NativePerformance$ge.executeJavaScriptBundleEntryPointStart, + executeJavaScriptBundleEntryPointEnd = _NativePerformance$ge.executeJavaScriptBundleEntryPointEnd; + return new _ReactNativeStartupTiming.default({ + startTime: startTime, + endTime: endTime, + initializeRuntimeStart: initializeRuntimeStart, + initializeRuntimeEnd: initializeRuntimeEnd, + executeJavaScriptBundleEntryPointStart: executeJavaScriptBundleEntryPointStart, + executeJavaScriptBundleEntryPointEnd: executeJavaScriptBundleEntryPointEnd + }); + } + return new _ReactNativeStartupTiming.default(); + } + }, { + key: "mark", + value: function mark(markName, markOptions) { + var mark = new PerformanceMark(markName, markOptions); + if (_NativePerformance.default != null && _NativePerformance.default.mark) { + _NativePerformance.default.mark(markName, mark.startTime); + } else { + warnNoNativePerformance(); + } + return mark; + } + }, { + key: "clearMarks", + value: function clearMarks(markName) { + if (!(_NativePerformanceObserver.default != null && _NativePerformanceObserver.default.clearEntries)) { + (0, _$$_REQUIRE(_dependencyMap[15], "./PerformanceObserver").warnNoNativePerformanceObserver)(); + return; + } + _NativePerformanceObserver.default == null ? void 0 : _NativePerformanceObserver.default.clearEntries(_$$_REQUIRE(_dependencyMap[14], "./RawPerformanceEntry").RawPerformanceEntryTypeValues.MARK, markName); + } + }, { + key: "measure", + value: function measure(measureName, startMarkOrOptions, endMark) { + var options; + var startMarkName, + endMarkName = endMark, + duration, + startTime = 0, + endTime = 0; + if (typeof startMarkOrOptions === 'string') { + startMarkName = startMarkOrOptions; + } else if (startMarkOrOptions !== undefined) { + var _options$duration; + options = startMarkOrOptions; + if (endMark !== undefined) { + throw new TypeError("Performance.measure: Can't have both options and endMark"); + } + if (options.start === undefined && options.end === undefined) { + throw new TypeError('Performance.measure: Must have at least one of start/end specified in options'); + } + if (options.start !== undefined && options.end !== undefined && options.duration !== undefined) { + throw new TypeError("Performance.measure: Can't have both start/end and duration explicitly in options"); + } + if (typeof options.start === 'number') { + startTime = options.start; + } else { + startMarkName = options.start; + } + if (typeof options.end === 'number') { + endTime = options.end; + } else { + endMarkName = options.end; + } + duration = (_options$duration = options.duration) != null ? _options$duration : duration; + } + var measure = new PerformanceMeasure(measureName, options); + if (_NativePerformance.default != null && _NativePerformance.default.measure) { + _NativePerformance.default.measure(measureName, startTime, endTime, duration, startMarkName, endMarkName); + } else { + warnNoNativePerformance(); + } + return measure; + } + }, { + key: "clearMeasures", + value: function clearMeasures(measureName) { + if (!(_NativePerformanceObserver.default != null && _NativePerformanceObserver.default.clearEntries)) { + (0, _$$_REQUIRE(_dependencyMap[15], "./PerformanceObserver").warnNoNativePerformanceObserver)(); + return; + } + _NativePerformanceObserver.default == null ? void 0 : _NativePerformanceObserver.default.clearEntries(_$$_REQUIRE(_dependencyMap[14], "./RawPerformanceEntry").RawPerformanceEntryTypeValues.MEASURE, measureName); + } + + /** + * Returns a double, measured in milliseconds. + * https://developer.mozilla.org/en-US/docs/Web/API/Performance/now + */ + }, { + key: "now", + value: function now() { + return getCurrentTimeStamp(); + } + + /** + * An extension that allows to get back to JS all currently logged marks/measures + * (in our case, be it from JS or native), see + * https://www.w3.org/TR/performance-timeline/#extensions-to-the-performance-interface + */ + }, { + key: "getEntries", + value: function getEntries() { + if (!(_NativePerformanceObserver.default != null && _NativePerformanceObserver.default.getEntries)) { + (0, _$$_REQUIRE(_dependencyMap[15], "./PerformanceObserver").warnNoNativePerformanceObserver)(); + return []; + } + return _NativePerformanceObserver.default.getEntries().map(_$$_REQUIRE(_dependencyMap[14], "./RawPerformanceEntry").rawToPerformanceEntry); + } + }, { + key: "getEntriesByType", + value: function getEntriesByType(entryType) { + if (!_$$_REQUIRE(_dependencyMap[13], "./PerformanceEntry").ALWAYS_LOGGED_ENTRY_TYPES.includes(entryType)) { + console.warn(`Performance.getEntriesByType: Only valid for ${JSON.stringify(_$$_REQUIRE(_dependencyMap[13], "./PerformanceEntry").ALWAYS_LOGGED_ENTRY_TYPES)} entry types, got ${entryType}`); + return []; + } + if (!(_NativePerformanceObserver.default != null && _NativePerformanceObserver.default.getEntries)) { + (0, _$$_REQUIRE(_dependencyMap[15], "./PerformanceObserver").warnNoNativePerformanceObserver)(); + return []; + } + return _NativePerformanceObserver.default.getEntries((0, _$$_REQUIRE(_dependencyMap[14], "./RawPerformanceEntry").performanceEntryTypeToRaw)(entryType)).map(_$$_REQUIRE(_dependencyMap[14], "./RawPerformanceEntry").rawToPerformanceEntry); + } + }, { + key: "getEntriesByName", + value: function getEntriesByName(entryName, entryType) { + if (entryType !== undefined && !_$$_REQUIRE(_dependencyMap[13], "./PerformanceEntry").ALWAYS_LOGGED_ENTRY_TYPES.includes(entryType)) { + console.warn(`Performance.getEntriesByName: Only valid for ${JSON.stringify(_$$_REQUIRE(_dependencyMap[13], "./PerformanceEntry").ALWAYS_LOGGED_ENTRY_TYPES)} entry types, got ${entryType}`); + return []; + } + if (!(_NativePerformanceObserver.default != null && _NativePerformanceObserver.default.getEntries)) { + (0, _$$_REQUIRE(_dependencyMap[15], "./PerformanceObserver").warnNoNativePerformanceObserver)(); + return []; + } + return _NativePerformanceObserver.default.getEntries(entryType != null ? (0, _$$_REQUIRE(_dependencyMap[14], "./RawPerformanceEntry").performanceEntryTypeToRaw)(entryType) : undefined, entryName).map(_$$_REQUIRE(_dependencyMap[14], "./RawPerformanceEntry").rawToPerformanceEntry); + } + }]); + }(); +},76,[6,77,19,18,23,25,28,45,78,84,75,79,85,83,81,80],"node_modules\\react-native\\Libraries\\WebPerformance\\Performance.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _readOnlyError(r) { + throw new TypeError('"' + r + '" is read-only'); + } + module.exports = _readOnlyError, module.exports.__esModule = true, module.exports["default"] = module.exports; +},77,[],"node_modules\\@babel\\runtime\\helpers\\readOnlyError.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _NativePerformanceObserver = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "./NativePerformanceObserver")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var cachedEventCounts; + function getCachedEventCounts() { + var _cachedEventCounts; + if (cachedEventCounts) { + return cachedEventCounts; + } + if (!_NativePerformanceObserver.default) { + (0, _$$_REQUIRE(_dependencyMap[4], "./PerformanceObserver").warnNoNativePerformanceObserver)(); + return new Map(); + } + cachedEventCounts = new Map(_NativePerformanceObserver.default.getEventCounts()); + // $FlowFixMe[incompatible-call] + global.queueMicrotask(function () { + // To be consistent with the calls to the API from the same task, + // but also not to refetch the data from native too often, + // schedule to invalidate the cache later, + // after the current task is guaranteed to have finished. + cachedEventCounts = null; + }); + return (_cachedEventCounts = cachedEventCounts) != null ? _cachedEventCounts : new Map(); + } + /** + * Implementation of the EventCounts Web Performance API + * corresponding to the standard in + * https://www.w3.org/TR/event-timing/#eventcounts + */ + var EventCounts = exports.default = /*#__PURE__*/function () { + function EventCounts() { + (0, _classCallCheck2.default)(this, EventCounts); + } + return (0, _createClass2.default)(EventCounts, [{ + key: "size", + get: + // flowlint unsafe-getters-setters:off + function get() { + return getCachedEventCounts().size; + } + }, { + key: "entries", + value: function entries() { + return getCachedEventCounts().entries(); + } + }, { + key: "forEach", + value: function forEach(callback) { + return getCachedEventCounts().forEach(callback); + } + }, { + key: "get", + value: function get(key) { + return getCachedEventCounts().get(key); + } + }, { + key: "has", + value: function has(key) { + return getCachedEventCounts().has(key); + } + }, { + key: "keys", + value: function keys() { + return getCachedEventCounts().keys(); + } + }, { + key: "values", + value: function values() { + return getCachedEventCounts().values(); + } + }]); + }(); +},78,[6,18,19,79,80],"node_modules\\react-native\\Libraries\\WebPerformance\\EventCounts.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('NativePerformanceObserverCxx'); +},79,[36],"node_modules\\react-native\\Libraries\\WebPerformance\\NativePerformanceObserver.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.PerformanceObserverEntryList = void 0; + exports.warnNoNativePerformanceObserver = warnNoNativePerformanceObserver; + var _toConsumableArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/toConsumableArray")); + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/slicedToArray")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/createClass")); + var _warnOnce = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../Utilities/warnOnce")); + var _NativePerformanceObserver = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./NativePerformanceObserver")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + var PerformanceObserverEntryList = exports.PerformanceObserverEntryList = /*#__PURE__*/function () { + function PerformanceObserverEntryList(entries) { + (0, _classCallCheck2.default)(this, PerformanceObserverEntryList); + this._entries = entries; + } + return (0, _createClass2.default)(PerformanceObserverEntryList, [{ + key: "getEntries", + value: function getEntries() { + return this._entries; + } + }, { + key: "getEntriesByType", + value: function getEntriesByType(type) { + return this._entries.filter(function (entry) { + return entry.entryType === type; + }); + } + }, { + key: "getEntriesByName", + value: function getEntriesByName(name, type) { + if (type === undefined) { + return this._entries.filter(function (entry) { + return entry.name === name; + }); + } else { + return this._entries.filter(function (entry) { + return entry.name === name && entry.entryType === type; + }); + } + } + }]); + }(); + var observerCountPerEntryType = new Map(); + var registeredObservers = new Map(); + var isOnPerformanceEntryCallbackSet = false; + + // This is a callback that gets scheduled and periodically called from the native side + var onPerformanceEntry = function onPerformanceEntry() { + var _entryResult$entries; + if (!_NativePerformanceObserver.default) { + return; + } + var entryResult = _NativePerformanceObserver.default.popPendingEntries(); + var rawEntries = (_entryResult$entries = entryResult == null ? void 0 : entryResult.entries) != null ? _entryResult$entries : []; + var droppedEntriesCount = entryResult == null ? void 0 : entryResult.droppedEntriesCount; + if (rawEntries.length === 0) { + return; + } + var entries = rawEntries.map(_$$_REQUIRE(_dependencyMap[7], "./RawPerformanceEntry").rawToPerformanceEntry); + var _loop = function _loop(observerConfig) { + var entriesForObserver = entries.filter(function (entry) { + if (!observerConfig.entryTypes.has(entry.entryType)) { + return false; + } + var durationThreshold = observerConfig.entryTypes.get(entry.entryType); + return entry.duration >= (durationThreshold != null ? durationThreshold : 0); + }); + observerConfig.callback(new PerformanceObserverEntryList(entriesForObserver), _observer, droppedEntriesCount); + }; + for (var _ref of registeredObservers.entries()) { + var _ref2 = (0, _slicedToArray2.default)(_ref, 2); + var _observer = _ref2[0]; + var observerConfig = _ref2[1]; + _loop(observerConfig); + } + }; + function warnNoNativePerformanceObserver() { + (0, _warnOnce.default)('missing-native-performance-observer', 'Missing native implementation of PerformanceObserver'); + } + function applyDurationThresholds() { + var durationThresholds = Array.from(registeredObservers.values()).map(function (config) { + return config.entryTypes; + }).reduce(function (accumulator, currentValue) { + return union(accumulator, currentValue); + }, new Map()); + for (var _ref3 of durationThresholds) { + var _ref4 = (0, _slicedToArray2.default)(_ref3, 2); + var entryType = _ref4[0]; + var durationThreshold = _ref4[1]; + _NativePerformanceObserver.default == null ? void 0 : _NativePerformanceObserver.default.setDurationThreshold((0, _$$_REQUIRE(_dependencyMap[7], "./RawPerformanceEntry").performanceEntryTypeToRaw)(entryType), durationThreshold != null ? durationThreshold : 0); + } + } + + /** + * Implementation of the PerformanceObserver interface for RN, + * corresponding to the standard in https://www.w3.org/TR/performance-timeline/ + * + * @example + * const observer = new PerformanceObserver((list, _observer) => { + * const entries = list.getEntries(); + * entries.forEach(entry => { + * reportEvent({ + * eventName: entry.name, + * startTime: entry.startTime, + * endTime: entry.startTime + entry.duration, + * processingStart: entry.processingStart, + * processingEnd: entry.processingEnd, + * interactionId: entry.interactionId, + * }); + * }); + * }); + * observer.observe({ type: "event" }); + */ + var PerformanceObserver = exports.default = /*#__PURE__*/function () { + function PerformanceObserver(callback) { + (0, _classCallCheck2.default)(this, PerformanceObserver); + this._callback = callback; + } + return (0, _createClass2.default)(PerformanceObserver, [{ + key: "observe", + value: function observe(options) { + var _registeredObservers$; + if (!_NativePerformanceObserver.default) { + warnNoNativePerformanceObserver(); + return; + } + this._validateObserveOptions(options); + var requestedEntryTypes; + if (options.entryTypes) { + this._type = 'multiple'; + requestedEntryTypes = new Map(options.entryTypes.map(function (t) { + return [t, undefined]; + })); + } else { + this._type = 'single'; + requestedEntryTypes = new Map([[options.type, options.durationThreshold]]); + } + + // The same observer may receive multiple calls to "observe", so we need + // to check what is new on this call vs. previous ones. + var currentEntryTypes = (_registeredObservers$ = registeredObservers.get(this)) == null ? void 0 : _registeredObservers$.entryTypes; + var nextEntryTypes = currentEntryTypes ? union(requestedEntryTypes, currentEntryTypes) : requestedEntryTypes; + + // This `observe` call is a no-op because there are no new things to observe. + if (currentEntryTypes && currentEntryTypes.size === nextEntryTypes.size) { + return; + } + registeredObservers.set(this, { + callback: this._callback, + entryTypes: nextEntryTypes + }); + if (!isOnPerformanceEntryCallbackSet) { + _NativePerformanceObserver.default.setOnPerformanceEntryCallback(onPerformanceEntry); + isOnPerformanceEntryCallbackSet = true; + } + + // We only need to start listenening to new entry types being observed in + // this observer. + var newEntryTypes = currentEntryTypes ? difference(new Set(requestedEntryTypes.keys()), new Set(currentEntryTypes.keys())) : new Set(requestedEntryTypes.keys()); + for (var type of newEntryTypes) { + var _observerCountPerEntr; + if (!observerCountPerEntryType.has(type)) { + var rawType = (0, _$$_REQUIRE(_dependencyMap[7], "./RawPerformanceEntry").performanceEntryTypeToRaw)(type); + _NativePerformanceObserver.default.startReporting(rawType); + } + observerCountPerEntryType.set(type, ((_observerCountPerEntr = observerCountPerEntryType.get(type)) != null ? _observerCountPerEntr : 0) + 1); + } + applyDurationThresholds(); + } + }, { + key: "disconnect", + value: function disconnect() { + if (!_NativePerformanceObserver.default) { + warnNoNativePerformanceObserver(); + return; + } + var observerConfig = registeredObservers.get(this); + if (!observerConfig) { + return; + } + + // Disconnect this observer + for (var type of observerConfig.entryTypes.keys()) { + var _observerCountPerEntr2; + var numberOfObserversForThisType = (_observerCountPerEntr2 = observerCountPerEntryType.get(type)) != null ? _observerCountPerEntr2 : 0; + if (numberOfObserversForThisType === 1) { + observerCountPerEntryType.delete(type); + _NativePerformanceObserver.default.stopReporting((0, _$$_REQUIRE(_dependencyMap[7], "./RawPerformanceEntry").performanceEntryTypeToRaw)(type)); + } else if (numberOfObserversForThisType !== 0) { + observerCountPerEntryType.set(type, numberOfObserversForThisType - 1); + } + } + + // Disconnect all observers if this was the last one + registeredObservers.delete(this); + if (registeredObservers.size === 0) { + _NativePerformanceObserver.default.setOnPerformanceEntryCallback(undefined); + isOnPerformanceEntryCallbackSet = false; + } + applyDurationThresholds(); + } + }, { + key: "_validateObserveOptions", + value: function _validateObserveOptions(options) { + var type = options.type, + entryTypes = options.entryTypes, + durationThreshold = options.durationThreshold; + if (!type && !entryTypes) { + throw new TypeError("Failed to execute 'observe' on 'PerformanceObserver': An observe() call must not include both entryTypes and type arguments."); + } + if (entryTypes && type) { + throw new TypeError("Failed to execute 'observe' on 'PerformanceObserver': An observe() call must include either entryTypes or type arguments."); + } + if (this._type === 'multiple' && type) { + throw new Error("Failed to execute 'observe' on 'PerformanceObserver': This observer has performed observe({entryTypes:...}, therefore it cannot perform observe({type:...})"); + } + if (this._type === 'single' && entryTypes) { + throw new Error("Failed to execute 'observe' on 'PerformanceObserver': This PerformanceObserver has performed observe({type:...}, therefore it cannot perform observe({entryTypes:...})"); + } + if (entryTypes && durationThreshold !== undefined) { + throw new TypeError("Failed to execute 'observe' on 'PerformanceObserver': An observe() call must not include both entryTypes and durationThreshold arguments."); + } + } + }]); + }(); // As a Set union, except if value exists in both, we take minimum + PerformanceObserver.supportedEntryTypes = Object.freeze(['mark', 'measure', 'event']); + function union(a, b) { + var res = new Map(); + for (var _ref5 of a) { + var _ref6 = (0, _slicedToArray2.default)(_ref5, 2); + var k = _ref6[0]; + var v = _ref6[1]; + if (!b.has(k)) { + res.set(k, v); + } else { + var _b$get; + res.set(k, Math.min(v != null ? v : 0, (_b$get = b.get(k)) != null ? _b$get : 0)); + } + } + return res; + } + function difference(a, b) { + return new Set((0, _toConsumableArray2.default)(a).filter(function (x) { + return !b.has(x); + })); + } +},80,[6,41,7,18,19,45,79,81],"node_modules\\react-native\\Libraries\\WebPerformance\\PerformanceObserver.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.RawPerformanceEntryTypeValues = void 0; + exports.performanceEntryTypeToRaw = performanceEntryTypeToRaw; + exports.rawToPerformanceEntry = rawToPerformanceEntry; + exports.rawToPerformanceEntryType = rawToPerformanceEntryType; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var RawPerformanceEntryTypeValues = exports.RawPerformanceEntryTypeValues = { + UNDEFINED: 0, + MARK: 1, + MEASURE: 2, + EVENT: 3 + }; + function rawToPerformanceEntry(entry) { + if (entry.entryType === RawPerformanceEntryTypeValues.EVENT) { + return new (_$$_REQUIRE(_dependencyMap[0], "./PerformanceEventTiming").PerformanceEventTiming)({ + name: entry.name, + startTime: entry.startTime, + duration: entry.duration, + processingStart: entry.processingStart, + processingEnd: entry.processingEnd, + interactionId: entry.interactionId + }); + } else { + return new (_$$_REQUIRE(_dependencyMap[1], "./PerformanceEntry").PerformanceEntry)({ + name: entry.name, + entryType: rawToPerformanceEntryType(entry.entryType), + startTime: entry.startTime, + duration: entry.duration + }); + } + } + function rawToPerformanceEntryType(type) { + switch (type) { + case RawPerformanceEntryTypeValues.MARK: + return 'mark'; + case RawPerformanceEntryTypeValues.MEASURE: + return 'measure'; + case RawPerformanceEntryTypeValues.EVENT: + return 'event'; + case RawPerformanceEntryTypeValues.UNDEFINED: + throw new TypeError("rawToPerformanceEntryType: UNDEFINED can't be cast to PerformanceEntryType"); + default: + throw new TypeError(`rawToPerformanceEntryType: unexpected performance entry type received: ${type}`); + } + } + function performanceEntryTypeToRaw(type) { + switch (type) { + case 'mark': + return RawPerformanceEntryTypeValues.MARK; + case 'measure': + return RawPerformanceEntryTypeValues.MEASURE; + case 'event': + return RawPerformanceEntryTypeValues.EVENT; + default: + // Verify exhaustive check with Flow + type; + throw new TypeError(`performanceEntryTypeToRaw: unexpected performance entry type received: ${type}`); + } + } +},81,[82,83],"node_modules\\react-native\\Libraries\\WebPerformance\\RawPerformanceEntry.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.PerformanceEventTiming = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + var PerformanceEventTiming = exports.PerformanceEventTiming = /*#__PURE__*/function (_PerformanceEntry) { + function PerformanceEventTiming(init) { + var _init$startTime, _init$duration, _init$processingStart, _init$processingEnd, _init$interactionId; + var _this; + (0, _classCallCheck2.default)(this, PerformanceEventTiming); + _this = _callSuper(this, PerformanceEventTiming, [{ + name: init.name, + entryType: 'event', + startTime: (_init$startTime = init.startTime) != null ? _init$startTime : 0, + duration: (_init$duration = init.duration) != null ? _init$duration : 0 + }]); + _this.processingStart = (_init$processingStart = init.processingStart) != null ? _init$processingStart : 0; + _this.processingEnd = (_init$processingEnd = init.processingEnd) != null ? _init$processingEnd : 0; + _this.interactionId = (_init$interactionId = init.interactionId) != null ? _init$interactionId : 0; + return _this; + } + (0, _inherits2.default)(PerformanceEventTiming, _PerformanceEntry); + return (0, _createClass2.default)(PerformanceEventTiming, [{ + key: "toJSON", + value: function toJSON() { + return Object.assign({}, _superPropGet(PerformanceEventTiming, "toJSON", this, 3)([]), { + processingStart: this.processingStart, + processingEnd: this.processingEnd, + interactionId: this.interactionId + }); + } + }]); + }(_$$_REQUIRE(_dependencyMap[7], "./PerformanceEntry").PerformanceEntry); +},82,[6,18,19,23,25,26,28,83],"node_modules\\react-native\\Libraries\\WebPerformance\\PerformanceEventTiming.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.PerformanceEntry = exports.ALWAYS_LOGGED_ENTRY_TYPES = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var ALWAYS_LOGGED_ENTRY_TYPES = exports.ALWAYS_LOGGED_ENTRY_TYPES = ['mark', 'measure']; + var PerformanceEntry = exports.PerformanceEntry = /*#__PURE__*/function () { + function PerformanceEntry(init) { + (0, _classCallCheck2.default)(this, PerformanceEntry); + this.name = init.name; + this.entryType = init.entryType; + this.startTime = init.startTime; + this.duration = init.duration; + } + return (0, _createClass2.default)(PerformanceEntry, [{ + key: "toJSON", + value: function toJSON() { + return { + name: this.name, + entryType: this.entryType, + startTime: this.startTime, + duration: this.duration + }; + } + }]); + }(); +},83,[6,18,19],"node_modules\\react-native\\Libraries\\WebPerformance\\PerformanceEntry.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + * @oncall react_native + */ + // flowlint unsafe-getters-setters:off + // Read-only object with JS memory information. This is returned by the performance.memory API. + var MemoryInfo = exports.default = /*#__PURE__*/function () { + function MemoryInfo(memoryInfo) { + (0, _classCallCheck2.default)(this, MemoryInfo); + if (memoryInfo != null) { + this._jsHeapSizeLimit = memoryInfo.jsHeapSizeLimit; + this._totalJSHeapSize = memoryInfo.totalJSHeapSize; + this._usedJSHeapSize = memoryInfo.usedJSHeapSize; + } + } + + /** + * The maximum size of the heap, in bytes, that is available to the context + */ + return (0, _createClass2.default)(MemoryInfo, [{ + key: "jsHeapSizeLimit", + get: function get() { + return this._jsHeapSizeLimit; + } + + /** + * The total allocated heap size, in bytes + */ + }, { + key: "totalJSHeapSize", + get: function get() { + return this._totalJSHeapSize; + } + + /** + * The currently active segment of JS heap, in bytes. + */ + }, { + key: "usedJSHeapSize", + get: function get() { + return this._usedJSHeapSize; + } + }]); + }(); +},84,[6,18,19],"node_modules\\react-native\\Libraries\\WebPerformance\\MemoryInfo.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + * @oncall react_native + */ + // flowlint unsafe-getters-setters:off + // Read-only object with RN startup timing information. + // This is returned by the performance.reactNativeStartup API. + var ReactNativeStartupTiming = exports.default = /*#__PURE__*/function () { + // All time information here are in ms. The values may be null if not provided. + // We do NOT match web spect here for two reasons: + // 1. The `ReactNativeStartupTiming` is non-standard API + // 2. The timing information is relative to the time origin, which means `0` has valid meaning + + function ReactNativeStartupTiming(startUpTiming) { + (0, _classCallCheck2.default)(this, ReactNativeStartupTiming); + if (startUpTiming != null) { + this._startTime = startUpTiming.startTime; + this._endTime = startUpTiming.endTime; + this._initializeRuntimeStart = startUpTiming.initializeRuntimeStart; + this._initializeRuntimeEnd = startUpTiming.initializeRuntimeEnd; + this._executeJavaScriptBundleEntryPointStart = startUpTiming.executeJavaScriptBundleEntryPointStart; + this._executeJavaScriptBundleEntryPointEnd = startUpTiming.executeJavaScriptBundleEntryPointEnd; + } + } + + /** + * Start time of the RN app startup process. This is provided by the platform by implementing the `ReactMarker.setAppStartTime` API in the native platform code. + */ + return (0, _createClass2.default)(ReactNativeStartupTiming, [{ + key: "startTime", + get: function get() { + return this._startTime; + } + + /** + * End time of the RN app startup process. This is equal to `executeJavaScriptBundleEntryPointEnd`. + */ + }, { + key: "endTime", + get: function get() { + return this._endTime; + } + + /** + * Start time when RN runtime get initialized. This is when RN infra first kicks in app startup process. + */ + }, { + key: "initializeRuntimeStart", + get: function get() { + return this._initializeRuntimeStart; + } + + /** + * End time when RN runtime get initialized. This is the last marker before ends of the app startup process. + */ + }, { + key: "initializeRuntimeEnd", + get: function get() { + return this._initializeRuntimeEnd; + } + + /** + * Start time of JS bundle being executed. This indicates the RN JS bundle is loaded and start to be evaluated. + */ + }, { + key: "executeJavaScriptBundleEntryPointStart", + get: function get() { + return this._executeJavaScriptBundleEntryPointStart; + } + + /** + * End time of JS bundle being executed. This indicates all the synchronous entry point jobs are finished. + */ + }, { + key: "executeJavaScriptBundleEntryPointEnd", + get: function get() { + return this._executeJavaScriptBundleEntryPointEnd; + } + }]); + }(); +},85,[6,18,19],"node_modules\\react-native\\Libraries\\WebPerformance\\ReactNativeStartupTiming.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + /** + * Sets up the console and exception handling (redbox) for React Native. + * You can use this module directly, or just require InitializeCore. + */ + _$$_REQUIRE(_dependencyMap[0], "./ExceptionsManager").installConsoleErrorReporter(); + + // Set up error handler + if (!global.__fbDisableExceptionsManager) { + var handleError = function handleError(e, isFatal) { + try { + _$$_REQUIRE(_dependencyMap[0], "./ExceptionsManager").handleException(e, isFatal); + } catch (ee) { + console.log('Failed to print error: ', ee.message); + throw e; + } + }; + var ErrorUtils = _$$_REQUIRE(_dependencyMap[1], "../vendor/core/ErrorUtils"); + ErrorUtils.setGlobalHandler(handleError); + } +},86,[87,48],"node_modules\\react-native\\Libraries\\Core\\setUpErrorHandling.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _createClass = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/createClass"); + var _classCallCheck = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck"); + var _possibleConstructorReturn = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/possibleConstructorReturn"); + var _getPrototypeOf = _$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/getPrototypeOf"); + var _inherits = _$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/inherits"); + var _wrapNativeSuper = _$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/wrapNativeSuper"); + function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + var SyntheticError = /*#__PURE__*/function (_Error) { + function SyntheticError() { + var _this; + _classCallCheck(this, SyntheticError); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, SyntheticError, [].concat(args)); + _this.name = ''; + return _this; + } + _inherits(SyntheticError, _Error); + return _createClass(SyntheticError); + }(/*#__PURE__*/_wrapNativeSuper(Error)); + var userExceptionDecorator; + var inUserExceptionDecorator = false; + + // This Symbol is used to decorate an ExtendedError with extra data in select usecases. + // Note that data passed using this method should be strictly contained, + // as data that's not serializable/too large may cause issues with passing the error to the native code. + var decoratedExtraDataKey = Symbol('decoratedExtraDataKey'); + + /** + * Allows the app to add information to the exception report before it is sent + * to native. This API is not final. + */ + + function unstable_setExceptionDecorator(exceptionDecorator) { + userExceptionDecorator = exceptionDecorator; + } + function preprocessException(data) { + if (userExceptionDecorator && !inUserExceptionDecorator) { + inUserExceptionDecorator = true; + try { + return userExceptionDecorator(data); + } catch (_unused) { + // Fall through + } finally { + inUserExceptionDecorator = false; + } + } + return data; + } + + /** + * Handles the developer-visible aspect of errors and exceptions + */ + var exceptionID = 0; + function reportException(e, isFatal, reportToConsole // only true when coming from handleException; the error has not yet been logged + ) { + var parseErrorStack = _$$_REQUIRE(_dependencyMap[6], "./Devtools/parseErrorStack"); + var stack = parseErrorStack(e == null ? void 0 : e.stack); + var currentExceptionID = ++exceptionID; + var originalMessage = e.message || ''; + var message = originalMessage; + if (e.componentStack != null) { + message += `\n\nThis error is located at:${e.componentStack}`; + } + var namePrefix = e.name == null || e.name === '' ? '' : `${e.name}: `; + if (!message.startsWith(namePrefix)) { + message = namePrefix + message; + } + message = e.jsEngine == null ? message : `${message}, js engine: ${e.jsEngine}`; + + // $FlowFixMe[unclear-type] + var extraData = Object.assign({}, e[decoratedExtraDataKey], { + jsEngine: e.jsEngine, + rawStack: e.stack + }); + if (e.cause != null && typeof e.cause === 'object') { + extraData.stackSymbols = e.cause.stackSymbols; + extraData.stackReturnAddresses = e.cause.stackReturnAddresses; + extraData.stackElements = e.cause.stackElements; + } + var data = preprocessException({ + message: message, + originalMessage: message === originalMessage ? null : originalMessage, + name: e.name == null || e.name === '' ? null : e.name, + componentStack: typeof e.componentStack === 'string' ? e.componentStack : null, + stack: stack, + id: currentExceptionID, + isFatal: isFatal, + extraData: extraData + }); + if (reportToConsole) { + // we feed back into console.error, to make sure any methods that are + // monkey patched on top of console.error are called when coming from + // handleException + console.error(data.message); + } + if (__DEV__) { + var LogBox = _$$_REQUIRE(_dependencyMap[7], "../LogBox/LogBox").default; + LogBox.addException(Object.assign({}, data, { + isComponentError: !!e.isComponentError + })); + } else if (isFatal || e.type !== 'warn') { + var NativeExceptionsManager = _$$_REQUIRE(_dependencyMap[8], "./NativeExceptionsManager").default; + if (NativeExceptionsManager) { + NativeExceptionsManager.reportException(data); + } + } + } + // If we trigger console.error _from_ handleException, + // we do want to make sure that console.error doesn't trigger error reporting again + var inExceptionHandler = false; + + /** + * Logs exceptions to the (native) console and displays them + */ + function handleException(e, isFatal) { + var error; + if (e instanceof Error) { + error = e; + } else { + // Workaround for reporting errors caused by `throw 'some string'` + // Unfortunately there is no way to figure out the stacktrace in this + // case, so if you ended up here trying to trace an error, look for + // `throw ''` somewhere in your codebase. + error = new SyntheticError(e); + } + try { + inExceptionHandler = true; + /* $FlowFixMe[class-object-subtyping] added when improving typing for this + * parameters */ + reportException(error, isFatal, /*reportToConsole*/true); + } finally { + inExceptionHandler = false; + } + } + + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ + function reactConsoleErrorHandler() { + var _console; + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + // bubble up to any original handlers + (_console = console)._errorOriginal.apply(_console, args); + if (!console.reportErrorsAsExceptions) { + return; + } + if (inExceptionHandler) { + // The fundamental trick here is that are multiple entry point to logging errors: + // (see D19743075 for more background) + // + // 1. An uncaught exception being caught by the global handler + // 2. An error being logged throw console.error + // + // However, console.error is monkey patched multiple times: by this module, and by the + // DevTools setup that sends messages to Metro. + // The patching order cannot be relied upon. + // + // So, some scenarios that are handled by this flag: + // + // Logging an error: + // 1. console.error called from user code + // 2. (possibly) arrives _first_ at DevTool handler, send to Metro + // 3. Bubbles to here + // 4. goes into report Exception. + // 5. should not trigger console.error again, to avoid looping / logging twice + // 6. should still bubble up to original console + // (which might either be console.log, or the DevTools handler in case it patched _earlier_ and (2) didn't happen) + // + // Throwing an uncaught exception: + // 1. exception thrown + // 2. picked up by handleException + // 3. should be sent to console.error (not console._errorOriginal, as DevTools might have patched _later_ and it needs to send it to Metro) + // 4. that _might_ bubble again to the `reactConsoleErrorHandle` defined here + // -> should not handle exception _again_, to avoid looping / showing twice (this code branch) + // 5. should still bubble up to original console (which might either be console.log, or the DevTools handler in case that one patched _earlier_) + return; + } + var error; + var firstArg = args[0]; + if (firstArg != null && firstArg.stack) { + // reportException will console.error this with high enough fidelity. + error = firstArg; + } else { + var stringifySafe = _$$_REQUIRE(_dependencyMap[9], "../Utilities/stringifySafe").default; + if (typeof firstArg === 'string' && firstArg.startsWith('Warning: ')) { + // React warnings use console.error so that a stack trace is shown, but + // we don't (currently) want these to show a redbox + // (Note: Logic duplicated in polyfills/console.js.) + return; + } + var message = args.map(function (arg) { + return typeof arg === 'string' ? arg : stringifySafe(arg); + }).join(' '); + error = new SyntheticError(message); + error.name = 'console.error'; + } + reportException( + /* $FlowFixMe[class-object-subtyping] added when improving typing for this + * parameters */ + error, false, + // isFatal + false // reportToConsole + ); + } + + /** + * Shows a redbox with stacktrace for all console.error messages. Disable by + * setting `console.reportErrorsAsExceptions = false;` in your app. + */ + function installConsoleErrorReporter() { + // Enable reportErrorsAsExceptions + if (console._errorOriginal) { + return; // already installed + } + // Flow doesn't like it when you set arbitrary values on a global object + console._errorOriginal = console.error.bind(console); + console.error = reactConsoleErrorHandler; + if (console.reportErrorsAsExceptions === undefined) { + // Individual apps can disable this + // Flow doesn't like it when you set arbitrary values on a global object + console.reportErrorsAsExceptions = true; + } + } + module.exports = { + decoratedExtraDataKey: decoratedExtraDataKey, + handleException: handleException, + installConsoleErrorReporter: installConsoleErrorReporter, + SyntheticError: SyntheticError, + unstable_setExceptionDecorator: unstable_setExceptionDecorator + }; +},87,[19,18,23,25,28,88,92,95,112,46],"node_modules\\react-native\\Libraries\\Core\\ExceptionsManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _wrapNativeSuper(t) { + var r = "function" == typeof Map ? new Map() : void 0; + return module.exports = _wrapNativeSuper = function _wrapNativeSuper(t) { + if (null === t || !_$$_REQUIRE(_dependencyMap[0], "./isNativeFunction.js")(t)) return t; + if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); + if (void 0 !== r) { + if (r.has(t)) return r.get(t); + r.set(t, Wrapper); + } + function Wrapper() { + return _$$_REQUIRE(_dependencyMap[1], "./construct.js")(t, arguments, _$$_REQUIRE(_dependencyMap[2], "./getPrototypeOf.js")(this).constructor); + } + return Wrapper.prototype = Object.create(t.prototype, { + constructor: { + value: Wrapper, + enumerable: !1, + writable: !0, + configurable: !0 + } + }), _$$_REQUIRE(_dependencyMap[3], "./setPrototypeOf.js")(Wrapper, t); + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _wrapNativeSuper(t); + } + module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports; +},88,[89,90,25,29],"node_modules\\@babel\\runtime\\helpers\\wrapNativeSuper.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _isNativeFunction(t) { + try { + return -1 !== Function.toString.call(t).indexOf("[native code]"); + } catch (n) { + return "function" == typeof t; + } + } + module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports; +},89,[],"node_modules\\@babel\\runtime\\helpers\\isNativeFunction.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _construct(t, e, r) { + if (_$$_REQUIRE(_dependencyMap[0], "./isNativeReflectConstruct.js")()) return Reflect.construct.apply(null, arguments); + var o = [null]; + o.push.apply(o, e); + var p = new (t.bind.apply(t, o))(); + return r && _$$_REQUIRE(_dependencyMap[1], "./setPrototypeOf.js")(p, r.prototype), p; + } + module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports; +},90,[91,29],"node_modules\\@babel\\runtime\\helpers\\construct.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _isNativeReflectConstruct() { + try { + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + } catch (t) {} + return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() { + return !!t; + }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); + } + module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports; +},91,[],"node_modules\\@babel\\runtime\\helpers\\isNativeReflectConstruct.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + function convertHermesStack(stack) { + var frames = []; + for (var entry of stack.entries) { + if (entry.type !== 'FRAME') { + continue; + } + var location = entry.location, + functionName = entry.functionName; + if (location.type === 'NATIVE' || location.type === 'INTERNAL_BYTECODE') { + continue; + } + frames.push({ + methodName: functionName, + file: location.sourceUrl, + lineNumber: location.line1Based, + column: location.type === 'SOURCE' ? location.column1Based - 1 : location.virtualOffset0Based + }); + } + return frames; + } + function parseErrorStack(errorStack) { + if (errorStack == null) { + return []; + } + var stacktraceParser = _$$_REQUIRE(_dependencyMap[0], "stacktrace-parser"); + var parsedStack = Array.isArray(errorStack) ? errorStack : global.HermesInternal ? convertHermesStack(_$$_REQUIRE(_dependencyMap[1], "./parseHermesStack")(errorStack)) : stacktraceParser.parse(errorStack).map(function (frame) { + return Object.assign({}, frame, { + column: frame.column != null ? frame.column - 1 : null + }); + }); + return parsedStack; + } + module.exports = parseErrorStack; +},92,[93,94],"node_modules\\react-native\\Libraries\\Core\\Devtools\\parseErrorStack.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + var UNKNOWN_FUNCTION = ''; + /** + * This parses the different stack traces and puts them into one format + * This borrows heavily from TraceKit (https://github.com/csnover/TraceKit) + */ + + function parse(stackString) { + var lines = stackString.split('\n'); + return lines.reduce(function (stack, line) { + var parseResult = parseChrome(line) || parseWinjs(line) || parseGecko(line) || parseNode(line) || parseJSC(line); + if (parseResult) { + stack.push(parseResult); + } + return stack; + }, []); + } + var chromeRe = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; + var chromeEvalRe = /\((\S*)(?::(\d+))(?::(\d+))\)/; + function parseChrome(line) { + var parts = chromeRe.exec(line); + if (!parts) { + return null; + } + var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line + + var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line + + var submatch = chromeEvalRe.exec(parts[2]); + if (isEval && submatch != null) { + // throw out eval line/column and use top-most line/column number + parts[2] = submatch[1]; // url + + parts[3] = submatch[2]; // line + + parts[4] = submatch[3]; // column + } + return { + file: !isNative ? parts[2] : null, + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: isNative ? [parts[2]] : [], + lineNumber: parts[3] ? +parts[3] : null, + column: parts[4] ? +parts[4] : null + }; + } + var winjsRe = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i; + function parseWinjs(line) { + var parts = winjsRe.exec(line); + if (!parts) { + return null; + } + return { + file: parts[2], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: [], + lineNumber: +parts[3], + column: parts[4] ? +parts[4] : null + }; + } + var geckoRe = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i; + var geckoEvalRe = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; + function parseGecko(line) { + var parts = geckoRe.exec(line); + if (!parts) { + return null; + } + var isEval = parts[3] && parts[3].indexOf(' > eval') > -1; + var submatch = geckoEvalRe.exec(parts[3]); + if (isEval && submatch != null) { + // throw out eval line/column and use top-most line number + parts[3] = submatch[1]; + parts[4] = submatch[2]; + parts[5] = null; // no column when eval + } + return { + file: parts[3], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: parts[2] ? parts[2].split(',') : [], + lineNumber: parts[4] ? +parts[4] : null, + column: parts[5] ? +parts[5] : null + }; + } + var javaScriptCoreRe = /^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i; + function parseJSC(line) { + var parts = javaScriptCoreRe.exec(line); + if (!parts) { + return null; + } + return { + file: parts[3], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: [], + lineNumber: +parts[4], + column: parts[5] ? +parts[5] : null + }; + } + var nodeRe = /^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i; + function parseNode(line) { + var parts = nodeRe.exec(line); + if (!parts) { + return null; + } + return { + file: parts[2], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: [], + lineNumber: +parts[3], + column: parts[4] ? +parts[4] : null + }; + } + exports.parse = parse; +},93,[],"node_modules\\stacktrace-parser\\dist\\stack-trace-parser.cjs.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + // Capturing groups: + // 1. function name + // 2. is this a native stack frame? + // 3. is this a bytecode address or a source location? + // 4. source URL (filename) + // 5. line number (1 based) + // 6. column number (1 based) or virtual offset (0 based) + var RE_FRAME = /^ {4}at (.+?)(?: \((native)\)?| \((address at )?(.*?):(\d+):(\d+)\))$/; + + // Capturing groups: + // 1. count of skipped frames + var RE_SKIPPED = /^ {4}... skipping (\d+) frames$/; + function isInternalBytecodeSourceUrl(sourceUrl) { + // See https://github.com/facebook/hermes/blob/3332fa020cae0bab751f648db7c94e1d687eeec7/lib/VM/Runtime.cpp#L1100 + return sourceUrl === 'InternalBytecode.js'; + } + function parseLine(line) { + var asFrame = line.match(RE_FRAME); + if (asFrame) { + return { + type: 'FRAME', + functionName: asFrame[1], + location: asFrame[2] === 'native' ? { + type: 'NATIVE' + } : asFrame[3] === 'address at ' ? isInternalBytecodeSourceUrl(asFrame[4]) ? { + type: 'INTERNAL_BYTECODE', + sourceUrl: asFrame[4], + line1Based: Number.parseInt(asFrame[5], 10), + virtualOffset0Based: Number.parseInt(asFrame[6], 10) + } : { + type: 'BYTECODE', + sourceUrl: asFrame[4], + line1Based: Number.parseInt(asFrame[5], 10), + virtualOffset0Based: Number.parseInt(asFrame[6], 10) + } : { + type: 'SOURCE', + sourceUrl: asFrame[4], + line1Based: Number.parseInt(asFrame[5], 10), + column1Based: Number.parseInt(asFrame[6], 10) + } + }; + } + var asSkipped = line.match(RE_SKIPPED); + if (asSkipped) { + return { + type: 'SKIPPED', + count: Number.parseInt(asSkipped[1], 10) + }; + } + } + module.exports = function parseHermesStack(stack) { + var lines = stack.split(/\n/); + var entries = []; + var lastMessageLine = -1; + for (var i = 0; i < lines.length; ++i) { + var line = lines[i]; + if (!line) { + continue; + } + var entry = parseLine(line); + if (entry) { + entries.push(entry); + continue; + } + // No match - we're still in the message + lastMessageLine = i; + entries = []; + } + var message = lines.slice(0, lastMessageLine + 1).join('\n'); + return { + message: message, + entries: entries + }; + }; +},94,[],"node_modules\\react-native\\Libraries\\Core\\Devtools\\parseHermesStack.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../Utilities/Platform")); + var _RCTLog = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../Utilities/RCTLog")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var LogBox; + /** + * LogBox displays logs in the app. + */ + if (__DEV__) { + var LogBoxData = _$$_REQUIRE(_dependencyMap[3], "./Data/LogBoxData"); + var _require = _$$_REQUIRE(_dependencyMap[4], "./Data/parseLogBoxLog"), + parseLogBoxLog = _require.parseLogBoxLog, + parseInterpolation = _require.parseInterpolation; + var originalConsoleError; + var originalConsoleWarn; + var consoleErrorImpl; + var consoleWarnImpl; + var isLogBoxInstalled = false; + LogBox = { + install: function install() { + if (isLogBoxInstalled) { + return; + } + isLogBoxInstalled = true; + + // Trigger lazy initialization of module. + _$$_REQUIRE(_dependencyMap[5], "../NativeModules/specs/NativeLogBox"); + + // IMPORTANT: we only overwrite `console.error` and `console.warn` once. + // When we uninstall we keep the same reference and only change its + // internal implementation + var isFirstInstall = originalConsoleError == null; + if (isFirstInstall) { + originalConsoleError = console.error.bind(console); + originalConsoleWarn = console.warn.bind(console); + + // $FlowExpectedError[cannot-write] + console.error = function () { + consoleErrorImpl.apply(void 0, arguments); + }; + // $FlowExpectedError[cannot-write] + console.warn = function () { + consoleWarnImpl.apply(void 0, arguments); + }; + } + consoleErrorImpl = registerError; + consoleWarnImpl = registerWarning; + if (_Platform.default.isTesting) { + LogBoxData.setDisabled(true); + } + _RCTLog.default.setWarningHandler(function () { + registerWarning.apply(void 0, arguments); + }); + }, + uninstall: function uninstall() { + if (!isLogBoxInstalled) { + return; + } + isLogBoxInstalled = false; + + // IMPORTANT: we don't re-assign to `console` in case the method has been + // decorated again after installing LogBox. E.g.: + // Before uninstalling: original > LogBox > OtherErrorHandler + // After uninstalling: original > LogBox (noop) > OtherErrorHandler + consoleErrorImpl = originalConsoleError; + consoleWarnImpl = originalConsoleWarn; + }, + isInstalled: function isInstalled() { + return isLogBoxInstalled; + }, + ignoreLogs: function ignoreLogs(patterns) { + LogBoxData.addIgnorePatterns(patterns); + }, + ignoreAllLogs: function ignoreAllLogs(value) { + LogBoxData.setDisabled(value == null ? true : value); + }, + clearAllLogs: function clearAllLogs() { + LogBoxData.clear(); + }, + addLog: function addLog(log) { + if (isLogBoxInstalled) { + LogBoxData.addLog(log); + } + }, + addException: function addException(error) { + if (isLogBoxInstalled) { + LogBoxData.addException(error); + } + } + }; + var isRCTLogAdviceWarning = function isRCTLogAdviceWarning() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + // RCTLogAdvice is a native logging function designed to show users + // a message in the console, but not show it to them in Logbox. + return typeof args[0] === 'string' && args[0].startsWith('(ADVICE)'); + }; + var isWarningModuleWarning = function isWarningModuleWarning() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + return typeof args[0] === 'string' && args[0].startsWith('Warning: '); + }; + var registerWarning = function registerWarning() { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + // Let warnings within LogBox itself fall through. + if (LogBoxData.isLogBoxErrorMessage(String(args[0]))) { + originalConsoleError.apply(void 0, args); + return; + } else { + // Be sure to pass LogBox warnings through. + originalConsoleWarn.apply(void 0, args); + } + try { + if (!isRCTLogAdviceWarning.apply(void 0, args)) { + var _parseLogBoxLog = parseLogBoxLog(args), + category = _parseLogBoxLog.category, + message = _parseLogBoxLog.message, + componentStack = _parseLogBoxLog.componentStack; + if (!LogBoxData.isMessageIgnored(message.content)) { + LogBoxData.addLog({ + level: 'warn', + category: category, + message: message, + componentStack: componentStack + }); + } + } + } catch (err) { + LogBoxData.reportLogBoxError(err); + } + }; + + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ + var registerError = function registerError() { + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + // Let errors within LogBox itself fall through. + if (LogBoxData.isLogBoxErrorMessage(args[0])) { + originalConsoleError.apply(void 0, args); + return; + } + try { + if (!isWarningModuleWarning.apply(void 0, args)) { + // Only show LogBox for the 'warning' module, otherwise pass through. + // By passing through, this will get picked up by the React console override, + // potentially adding the component stack. React then passes it back to the + // React Native ExceptionsManager, which reports it to LogBox as an error. + // + // The 'warning' module needs to be handled here because React internally calls + // `console.error('Warning: ')` with the component stack already included. + originalConsoleError.apply(void 0, args); + return; + } + var format = args[0].replace('Warning: ', ''); + var filterResult = LogBoxData.checkWarningFilter(format); + if (filterResult.suppressCompletely) { + return; + } + var level = 'error'; + if (filterResult.suppressDialog_LEGACY === true) { + level = 'warn'; + } else if (filterResult.forceDialogImmediately === true) { + level = 'fatal'; // Do not downgrade. These are real bugs with same severity as throws. + } + + // Unfortunately, we need to add the Warning: prefix back for downstream dependencies. + args[0] = `Warning: ${filterResult.finalFormat}`; + var _parseLogBoxLog2 = parseLogBoxLog(args), + category = _parseLogBoxLog2.category, + message = _parseLogBoxLog2.message, + componentStack = _parseLogBoxLog2.componentStack; + + // Interpolate the message so they are formatted for adb and other CLIs. + // This is different than the message.content above because it includes component stacks. + var interpolated = parseInterpolation(args); + originalConsoleError(interpolated.message.content); + if (!LogBoxData.isMessageIgnored(message.content)) { + LogBoxData.addLog({ + level: level, + category: category, + message: message, + componentStack: componentStack + }); + } + } catch (err) { + LogBoxData.reportLogBoxError(err); + } + }; + } else { + LogBox = { + install: function install() { + // Do nothing. + }, + uninstall: function uninstall() { + // Do nothing. + }, + isInstalled: function isInstalled() { + return false; + }, + ignoreLogs: function ignoreLogs(patterns) { + // Do nothing. + }, + ignoreAllLogs: function ignoreAllLogs(value) { + // Do nothing. + }, + clearAllLogs: function clearAllLogs() { + // Do nothing. + }, + addLog: function addLog(log) { + // Do nothing. + }, + addException: function addException(error) { + // Do nothing. + } + }; + } + var _default = exports.default = LogBox; +},95,[6,34,96,97,109,98],"node_modules\\react-native\\Libraries\\LogBox\\LogBox.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var levelsMap = { + log: 'log', + info: 'info', + warn: 'warn', + error: 'error', + fatal: 'error' + }; + var warningHandler = null; + var RCTLog = { + // level one of log, info, warn, error, mustfix + logIfNoNativeHook: function logIfNoNativeHook(level) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + // We already printed in the native console, so only log here if using a js debugger + if (typeof global.nativeLoggingHook === 'undefined') { + RCTLog.logToConsole.apply(RCTLog, [level].concat(args)); + } else { + // Report native warnings to LogBox + if (warningHandler && level === 'warn') { + warningHandler.apply(void 0, args); + } + } + }, + // Log to console regardless of nativeLoggingHook + logToConsole: function logToConsole(level) { + var _console; + var logFn = levelsMap[level]; + _$$_REQUIRE(_dependencyMap[0], "invariant")(logFn, 'Level "' + level + '" not one of ' + Object.keys(levelsMap).toString()); + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + (_console = console)[logFn].apply(_console, args); + }, + setWarningHandler: function setWarningHandler(handler) { + warningHandler = handler; + } + }; + module.exports = RCTLog; +},96,[37],"node_modules\\react-native\\Libraries\\Utilities\\RCTLog.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.addException = addException; + exports.addIgnorePatterns = addIgnorePatterns; + exports.addLog = addLog; + exports.checkWarningFilter = checkWarningFilter; + exports.clear = clear; + exports.clearErrors = clearErrors; + exports.clearWarnings = clearWarnings; + exports.dismiss = dismiss; + exports.getAppInfo = getAppInfo; + exports.getIgnorePatterns = getIgnorePatterns; + exports.isDisabled = isDisabled; + exports.isLogBoxErrorMessage = isLogBoxErrorMessage; + exports.isMessageIgnored = isMessageIgnored; + exports.observe = observe; + exports.reportLogBoxError = reportLogBoxError; + exports.retrySymbolicateLogNow = retrySymbolicateLogNow; + exports.setAppInfo = setAppInfo; + exports.setDisabled = setDisabled; + exports.setSelectedLog = setSelectedLog; + exports.setWarningFilter = setWarningFilter; + exports.symbolicateLogLazy = symbolicateLogLazy; + exports.symbolicateLogNow = symbolicateLogNow; + exports.withSubscription = withSubscription; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _parseErrorStack = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../../Core/Devtools/parseErrorStack")); + var _NativeLogBox = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../../NativeModules/specs/NativeLogBox")); + var _LogBoxLog = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./LogBoxLog")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[10], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\Data\\LogBoxData.js"; + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + var observers = new Set(); + var ignorePatterns = new Set(); + var appInfo = null; + var logs = new Set(); + var updateTimeout = null; + var _isDisabled = false; + var _selectedIndex = -1; + var warningFilter = function warningFilter(format) { + return { + finalFormat: format, + forceDialogImmediately: false, + suppressDialog_LEGACY: true, + suppressCompletely: false, + monitorEvent: 'unknown', + monitorListVersion: 0, + monitorSampleRate: 1 + }; + }; + var LOGBOX_ERROR_MESSAGE = 'An error was thrown when attempting to render log messages via LogBox.'; + function getNextState() { + return { + logs: logs, + isDisabled: _isDisabled, + selectedLogIndex: _selectedIndex + }; + } + function reportLogBoxError(error, componentStack) { + var ExceptionsManager = _$$_REQUIRE(_dependencyMap[11], "../../Core/ExceptionsManager"); + error.message = `${LOGBOX_ERROR_MESSAGE}\n\n${error.message}`; + if (componentStack != null) { + error.componentStack = componentStack; + } + ExceptionsManager.handleException(error, /* isFatal */true); + } + function isLogBoxErrorMessage(message) { + return typeof message === 'string' && message.includes(LOGBOX_ERROR_MESSAGE); + } + function isMessageIgnored(message) { + for (var pattern of ignorePatterns) { + if (pattern instanceof RegExp && pattern.test(message) || typeof pattern === 'string' && message.includes(pattern)) { + return true; + } + } + return false; + } + function handleUpdate() { + if (updateTimeout == null) { + updateTimeout = setImmediate(function () { + updateTimeout = null; + var nextState = getNextState(); + observers.forEach(function (_ref) { + var observer = _ref.observer; + return observer(nextState); + }); + }); + } + } + function appendNewLog(newLog) { + // Don't want store these logs because they trigger a + // state update when we add them to the store. + if (isMessageIgnored(newLog.message.content)) { + return; + } + + // If the next log has the same category as the previous one + // then roll it up into the last log in the list by incrementing + // the count (similar to how Chrome does it). + var lastLog = Array.from(logs).pop(); + if (lastLog && lastLog.category === newLog.category) { + lastLog.incrementCount(); + handleUpdate(); + return; + } + if (newLog.level === 'fatal') { + // If possible, to avoid jank, we don't want to open the error before + // it's symbolicated. To do that, we optimistically wait for + // symbolication for up to a second before adding the log. + var OPTIMISTIC_WAIT_TIME = 1000; + var _addPendingLog = function addPendingLog() { + logs.add(newLog); + if (_selectedIndex < 0) { + setSelectedLog(logs.size - 1); + } else { + handleUpdate(); + } + _addPendingLog = null; + }; + var optimisticTimeout = setTimeout(function () { + if (_addPendingLog) { + _addPendingLog(); + } + }, OPTIMISTIC_WAIT_TIME); + newLog.symbolicate(function (status) { + if (_addPendingLog && status !== 'PENDING') { + _addPendingLog(); + clearTimeout(optimisticTimeout); + } else if (status !== 'PENDING') { + // The log has already been added but we need to trigger a render. + handleUpdate(); + } + }); + } else if (newLog.level === 'syntax') { + logs.add(newLog); + setSelectedLog(logs.size - 1); + } else { + logs.add(newLog); + handleUpdate(); + } + } + function addLog(log) { + var errorForStackTrace = new Error(); + + // Parsing logs are expensive so we schedule this + // otherwise spammy logs would pause rendering. + setImmediate(function () { + try { + var _log$stack; + var stack = (0, _parseErrorStack.default)((_log$stack = log.stack) != null ? _log$stack : errorForStackTrace == null ? void 0 : errorForStackTrace.stack); + appendNewLog(new _LogBoxLog.default({ + level: log.level, + message: log.message, + isComponentError: false, + stack: stack, + category: log.category, + componentStack: log.componentStack + })); + } catch (error) { + reportLogBoxError(error); + } + }); + } + function addException(error) { + // Parsing logs are expensive so we schedule this + // otherwise spammy logs would pause rendering. + setImmediate(function () { + try { + appendNewLog(new _LogBoxLog.default((0, _$$_REQUIRE(_dependencyMap[12], "./parseLogBoxLog").parseLogBoxException)(error))); + } catch (loggingError) { + reportLogBoxError(loggingError); + } + }); + } + function symbolicateLogNow(log) { + log.symbolicate(function () { + handleUpdate(); + }); + } + function retrySymbolicateLogNow(log) { + log.retrySymbolicate(function () { + handleUpdate(); + }); + } + function symbolicateLogLazy(log) { + log.symbolicate(); + } + function clear() { + if (logs.size > 0) { + logs = new Set(); + setSelectedLog(-1); + } + } + function setSelectedLog(proposedNewIndex) { + var oldIndex = _selectedIndex; + var newIndex = proposedNewIndex; + var logArray = Array.from(logs); + var index = logArray.length - 1; + while (index >= 0) { + // The latest syntax error is selected and displayed before all other logs. + if (logArray[index].level === 'syntax') { + newIndex = index; + break; + } + index -= 1; + } + _selectedIndex = newIndex; + handleUpdate(); + if (_NativeLogBox.default) { + setTimeout(function () { + if (oldIndex < 0 && newIndex >= 0) { + _NativeLogBox.default.show(); + } else if (oldIndex >= 0 && newIndex < 0) { + _NativeLogBox.default.hide(); + } + }, 0); + } + } + function clearWarnings() { + var newLogs = Array.from(logs).filter(function (log) { + return log.level !== 'warn'; + }); + if (newLogs.length !== logs.size) { + logs = new Set(newLogs); + setSelectedLog(-1); + handleUpdate(); + } + } + function clearErrors() { + var newLogs = Array.from(logs).filter(function (log) { + return log.level !== 'error' && log.level !== 'fatal'; + }); + if (newLogs.length !== logs.size) { + logs = new Set(newLogs); + setSelectedLog(-1); + } + } + function dismiss(log) { + if (logs.has(log)) { + logs.delete(log); + handleUpdate(); + } + } + function setWarningFilter(filter) { + warningFilter = filter; + } + function setAppInfo(info) { + appInfo = info; + } + function getAppInfo() { + return appInfo != null ? appInfo() : null; + } + function checkWarningFilter(format) { + return warningFilter(format); + } + function getIgnorePatterns() { + return Array.from(ignorePatterns); + } + function addIgnorePatterns(patterns) { + var existingSize = ignorePatterns.size; + // The same pattern may be added multiple times, but adding a new pattern + // can be expensive so let's find only the ones that are new. + patterns.forEach(function (pattern) { + if (pattern instanceof RegExp) { + for (var existingPattern of ignorePatterns) { + if (existingPattern instanceof RegExp && existingPattern.toString() === pattern.toString()) { + return; + } + } + ignorePatterns.add(pattern); + } + ignorePatterns.add(pattern); + }); + if (ignorePatterns.size === existingSize) { + return; + } + // We need to recheck all of the existing logs. + // This allows adding an ignore pattern anywhere in the codebase. + // Without this, if you ignore a pattern after the a log is created, + // then we would keep showing the log. + logs = new Set(Array.from(logs).filter(function (log) { + return !isMessageIgnored(log.message.content); + })); + handleUpdate(); + } + function setDisabled(value) { + if (value === _isDisabled) { + return; + } + _isDisabled = value; + handleUpdate(); + } + function isDisabled() { + return _isDisabled; + } + function observe(observer) { + var subscription = { + observer: observer + }; + observers.add(subscription); + observer(getNextState()); + return { + unsubscribe: function unsubscribe() { + observers.delete(subscription); + } + }; + } + function withSubscription(WrappedComponent) { + var LogBoxStateSubscription = /*#__PURE__*/function (_React$Component) { + function LogBoxStateSubscription() { + var _this; + (0, _classCallCheck2.default)(this, LogBoxStateSubscription); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, LogBoxStateSubscription, [].concat(args)); + _this.state = { + logs: new Set(), + isDisabled: false, + hasError: false, + selectedLogIndex: -1 + }; + _this._handleDismiss = function () { + // Here we handle the cases when the log is dismissed and it + // was either the last log, or when the current index + // is now outside the bounds of the log array. + var _this$state = _this.state, + selectedLogIndex = _this$state.selectedLogIndex, + stateLogs = _this$state.logs; + var logsArray = Array.from(stateLogs); + if (selectedLogIndex != null) { + if (logsArray.length - 1 <= 0) { + setSelectedLog(-1); + } else if (selectedLogIndex >= logsArray.length - 1) { + setSelectedLog(selectedLogIndex - 1); + } + dismiss(logsArray[selectedLogIndex]); + } + }; + _this._handleMinimize = function () { + setSelectedLog(-1); + }; + _this._handleSetSelectedLog = function (index) { + setSelectedLog(index); + }; + return _this; + } + (0, _inherits2.default)(LogBoxStateSubscription, _React$Component); + return (0, _createClass2.default)(LogBoxStateSubscription, [{ + key: "componentDidCatch", + value: function componentDidCatch(err, errorInfo) { + /* $FlowFixMe[class-object-subtyping] added when improving typing for + * this parameters */ + reportLogBoxError(err, errorInfo.componentStack); + } + }, { + key: "render", + value: function render() { + if (this.state.hasError) { + // This happens when the component failed to render, in which case we delegate to the native redbox. + // We can't show anyback fallback UI here, because the error may be with or . + return null; + } + return /*#__PURE__*/(0, _jsxRuntime.jsx)(WrappedComponent, { + logs: Array.from(this.state.logs), + isDisabled: this.state.isDisabled, + selectedLogIndex: this.state.selectedLogIndex + }); + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + this._subscription = observe(function (data) { + _this2.setState(data); + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this._subscription != null) { + this._subscription.unsubscribe(); + } + } + }], [{ + key: "getDerivedStateFromError", + value: function getDerivedStateFromError() { + return { + hasError: true + }; + } + }]); + }(React.Component); + return LogBoxStateSubscription; + } +},97,[6,18,19,23,25,28,92,98,99,65,106,87,109],"node_modules\\react-native\\Libraries\\LogBox\\Data\\LogBoxData.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('LogBox'); +},98,[36],"node_modules\\react-native\\Libraries\\NativeModules\\specs\\NativeLogBox.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var LogBoxSymbolication = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3], "./LogBoxSymbolication")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var LogBoxLog = /*#__PURE__*/function () { + function LogBoxLog(data) { + (0, _classCallCheck2.default)(this, LogBoxLog); + this.symbolicated = { + error: null, + stack: null, + status: 'NONE' + }; + this.level = data.level; + this.type = data.type; + this.message = data.message; + this.stack = data.stack; + this.category = data.category; + this.componentStack = data.componentStack; + this.codeFrame = data.codeFrame; + this.isComponentError = data.isComponentError; + this.extraData = data.extraData; + this.count = 1; + } + return (0, _createClass2.default)(LogBoxLog, [{ + key: "incrementCount", + value: function incrementCount() { + this.count += 1; + } + }, { + key: "getAvailableStack", + value: function getAvailableStack() { + return this.symbolicated.status === 'COMPLETE' ? this.symbolicated.stack : this.stack; + } + }, { + key: "retrySymbolicate", + value: function retrySymbolicate(callback) { + if (this.symbolicated.status !== 'COMPLETE') { + LogBoxSymbolication.deleteStack(this.stack); + this.handleSymbolicate(callback); + } + } + }, { + key: "symbolicate", + value: function symbolicate(callback) { + if (this.symbolicated.status === 'NONE') { + this.handleSymbolicate(callback); + } + } + }, { + key: "handleSymbolicate", + value: function handleSymbolicate(callback) { + var _this = this; + if (this.symbolicated.status !== 'PENDING') { + this.updateStatus(null, null, null, callback); + LogBoxSymbolication.symbolicate(this.stack, this.extraData).then(function (data) { + _this.updateStatus(null, data == null ? void 0 : data.stack, data == null ? void 0 : data.codeFrame, callback); + }, function (error) { + _this.updateStatus(error, null, null, callback); + }); + } + } + }, { + key: "updateStatus", + value: function updateStatus(error, stack, codeFrame, callback) { + var lastStatus = this.symbolicated.status; + if (error != null) { + this.symbolicated = { + error: error, + stack: null, + status: 'FAILED' + }; + } else if (stack != null) { + if (codeFrame) { + this.codeFrame = codeFrame; + } + this.symbolicated = { + error: null, + stack: stack, + status: 'COMPLETE' + }; + } else { + this.symbolicated = { + error: null, + stack: null, + status: 'PENDING' + }; + } + if (callback && lastStatus !== this.symbolicated.status) { + callback(this.symbolicated.status); + } + } + }]); + }(); + var _default = exports.default = LogBoxLog; +},99,[6,18,19,100],"node_modules\\react-native\\Libraries\\LogBox\\Data\\LogBoxLog.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.deleteStack = deleteStack; + exports.symbolicate = symbolicate; + var _symbolicateStackTrace = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Core/Devtools/symbolicateStackTrace")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var cache = new Map(); + + /** + * Sanitize because sometimes, `symbolicateStackTrace` gives us invalid values. + */ + var sanitize = function sanitize(_ref) { + var maybeStack = _ref.stack, + codeFrame = _ref.codeFrame; + if (!Array.isArray(maybeStack)) { + throw new Error('Expected stack to be an array.'); + } + var stack = []; + for (var maybeFrame of maybeStack) { + var collapse = false; + if ('collapse' in maybeFrame) { + if (typeof maybeFrame.collapse !== 'boolean') { + throw new Error('Expected stack frame `collapse` to be a boolean.'); + } + collapse = maybeFrame.collapse; + } + stack.push({ + column: maybeFrame.column, + file: maybeFrame.file, + lineNumber: maybeFrame.lineNumber, + methodName: maybeFrame.methodName, + collapse: collapse + }); + } + return { + stack: stack, + codeFrame: codeFrame + }; + }; + function deleteStack(stack) { + cache.delete(stack); + } + function symbolicate(stack, extraData) { + var promise = cache.get(stack); + if (promise == null) { + promise = (0, _symbolicateStackTrace.default)(stack, extraData).then(sanitize); + cache.set(stack, promise); + } + return promise; + } +},100,[6,101],"node_modules\\react-native\\Libraries\\LogBox\\Data\\LogBoxSymbolication.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _asyncToGenerator = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/asyncToGenerator"); + function symbolicateStackTrace(_x, _x2) { + return _symbolicateStackTrace.apply(this, arguments); + } + function _symbolicateStackTrace() { + _symbolicateStackTrace = _asyncToGenerator(function* (stack, extraData) { + var _global$fetch; + var devServer = _$$_REQUIRE(_dependencyMap[1], "./getDevServer")(); + if (!devServer.bundleLoadedFromServer) { + throw new Error('Bundle was not loaded from Metro.'); + } + + // Lazy-load `fetch` until the first symbolication call to avoid circular requires. + var fetch = (_global$fetch = global.fetch) != null ? _global$fetch : _$$_REQUIRE(_dependencyMap[2], "../../Network/fetch"); + var response = yield fetch(devServer.url + 'symbolicate', { + method: 'POST', + body: JSON.stringify({ + stack: stack, + extraData: extraData + }) + }); + return yield response.json(); + }); + return _symbolicateStackTrace.apply(this, arguments); + } + module.exports = symbolicateStackTrace; +},101,[13,102,104],"node_modules\\react-native\\Libraries\\Core\\Devtools\\symbolicateStackTrace.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _NativeSourceCode = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../NativeModules/specs/NativeSourceCode")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var _cachedDevServerURL; + var _cachedFullBundleURL; + var FALLBACK = 'http://localhost:8081/'; + /** + * Many RN development tools rely on the development server (packager) running + * @return URL to packager with trailing slash + */ + function getDevServer() { + var _cachedDevServerURL2; + if (_cachedDevServerURL === undefined) { + var scriptUrl = _NativeSourceCode.default.getConstants().scriptURL; + var match = scriptUrl.match(/^https?:\/\/.*?\//); + _cachedDevServerURL = match ? match[0] : null; + _cachedFullBundleURL = match ? scriptUrl : null; + } + return { + url: (_cachedDevServerURL2 = _cachedDevServerURL) != null ? _cachedDevServerURL2 : FALLBACK, + fullBundleUrl: _cachedFullBundleURL, + bundleLoadedFromServer: _cachedDevServerURL !== null + }; + } + module.exports = getDevServer; +},102,[6,103],"node_modules\\react-native\\Libraries\\Core\\Devtools\\getDevServer.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var NativeModule = TurboModuleRegistry.getEnforcing('SourceCode'); + var constants = null; + var NativeSourceCode = { + getConstants: function getConstants() { + if (constants == null) { + constants = NativeModule.getConstants(); + } + return constants; + } + }; + var _default = exports.default = NativeSourceCode; +},103,[36],"node_modules\\react-native\\Libraries\\NativeModules\\specs\\NativeSourceCode.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /* globals Headers, Request, Response */ + + 'use strict'; + + // side-effectful require() to put fetch, + // Headers, Request, Response in global scope + _$$_REQUIRE(_dependencyMap[0], "whatwg-fetch"); + module.exports = { + fetch: fetch, + Headers: Headers, + Request: Request, + Response: Response + }; +},104,[105],"node_modules\\react-native\\Libraries\\Network\\fetch.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : factory(global.WHATWGFetch = {}); + })(this, function (exports) { + 'use strict'; + + /* eslint-disable no-prototype-builtins */ + var g = typeof globalThis !== 'undefined' && globalThis || typeof self !== 'undefined' && self || + // eslint-disable-next-line no-undef + typeof global !== 'undefined' && global || {}; + var support = { + searchParams: 'URLSearchParams' in g, + iterable: 'Symbol' in g && 'iterator' in Symbol, + blob: 'FileReader' in g && 'Blob' in g && function () { + try { + new Blob(); + return true; + } catch (e) { + return false; + } + }(), + formData: 'FormData' in g, + arrayBuffer: 'ArrayBuffer' in g + }; + function isDataView(obj) { + return obj && DataView.prototype.isPrototypeOf(obj); + } + if (support.arrayBuffer) { + var viewClasses = ['[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]']; + var isArrayBufferView = ArrayBuffer.isView || function (obj) { + return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1; + }; + } + function normalizeName(name) { + if (typeof name !== 'string') { + name = String(name); + } + if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') { + throw new TypeError('Invalid character in header field name: "' + name + '"'); + } + return name.toLowerCase(); + } + function normalizeValue(value) { + if (typeof value !== 'string') { + value = String(value); + } + return value; + } + + // Build a destructive iterator for the value list + function iteratorFor(items) { + var iterator = { + next: function next() { + var value = items.shift(); + return { + done: value === undefined, + value: value + }; + } + }; + if (support.iterable) { + iterator[Symbol.iterator] = function () { + return iterator; + }; + } + return iterator; + } + function Headers(headers) { + this.map = {}; + if (headers instanceof Headers) { + headers.forEach(function (value, name) { + this.append(name, value); + }, this); + } else if (Array.isArray(headers)) { + headers.forEach(function (header) { + if (header.length != 2) { + throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length); + } + this.append(header[0], header[1]); + }, this); + } else if (headers) { + Object.getOwnPropertyNames(headers).forEach(function (name) { + this.append(name, headers[name]); + }, this); + } + } + Headers.prototype.append = function (name, value) { + name = normalizeName(name); + value = normalizeValue(value); + var oldValue = this.map[name]; + this.map[name] = oldValue ? oldValue + ', ' + value : value; + }; + Headers.prototype['delete'] = function (name) { + delete this.map[normalizeName(name)]; + }; + Headers.prototype.get = function (name) { + name = normalizeName(name); + return this.has(name) ? this.map[name] : null; + }; + Headers.prototype.has = function (name) { + return this.map.hasOwnProperty(normalizeName(name)); + }; + Headers.prototype.set = function (name, value) { + this.map[normalizeName(name)] = normalizeValue(value); + }; + Headers.prototype.forEach = function (callback, thisArg) { + for (var name in this.map) { + if (this.map.hasOwnProperty(name)) { + callback.call(thisArg, this.map[name], name, this); + } + } + }; + Headers.prototype.keys = function () { + var items = []; + this.forEach(function (value, name) { + items.push(name); + }); + return iteratorFor(items); + }; + Headers.prototype.values = function () { + var items = []; + this.forEach(function (value) { + items.push(value); + }); + return iteratorFor(items); + }; + Headers.prototype.entries = function () { + var items = []; + this.forEach(function (value, name) { + items.push([name, value]); + }); + return iteratorFor(items); + }; + if (support.iterable) { + Headers.prototype[Symbol.iterator] = Headers.prototype.entries; + } + function consumed(body) { + if (body._noBody) return; + if (body.bodyUsed) { + return Promise.reject(new TypeError('Already read')); + } + body.bodyUsed = true; + } + function fileReaderReady(reader) { + return new Promise(function (resolve, reject) { + reader.onload = function () { + resolve(reader.result); + }; + reader.onerror = function () { + reject(reader.error); + }; + }); + } + function readBlobAsArrayBuffer(blob) { + var reader = new FileReader(); + var promise = fileReaderReady(reader); + reader.readAsArrayBuffer(blob); + return promise; + } + function readBlobAsText(blob) { + var reader = new FileReader(); + var promise = fileReaderReady(reader); + var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type); + var encoding = match ? match[1] : 'utf-8'; + reader.readAsText(blob, encoding); + return promise; + } + function readArrayBufferAsText(buf) { + var view = new Uint8Array(buf); + var chars = new Array(view.length); + for (var i = 0; i < view.length; i++) { + chars[i] = String.fromCharCode(view[i]); + } + return chars.join(''); + } + function bufferClone(buf) { + if (buf.slice) { + return buf.slice(0); + } else { + var view = new Uint8Array(buf.byteLength); + view.set(new Uint8Array(buf)); + return view.buffer; + } + } + function Body() { + this.bodyUsed = false; + this._initBody = function (body) { + /* + fetch-mock wraps the Response object in an ES6 Proxy to + provide useful test harness features such as flush. However, on + ES5 browsers without fetch or Proxy support pollyfills must be used; + the proxy-pollyfill is unable to proxy an attribute unless it exists + on the object before the Proxy is created. This change ensures + Response.bodyUsed exists on the instance, while maintaining the + semantic of setting Request.bodyUsed in the constructor before + _initBody is called. + */ + // eslint-disable-next-line no-self-assign + this.bodyUsed = this.bodyUsed; + this._bodyInit = body; + if (!body) { + this._noBody = true; + this._bodyText = ''; + } else if (typeof body === 'string') { + this._bodyText = body; + } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { + this._bodyBlob = body; + } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { + this._bodyFormData = body; + } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { + this._bodyText = body.toString(); + } else if (support.arrayBuffer && support.blob && isDataView(body)) { + this._bodyArrayBuffer = bufferClone(body.buffer); + // IE 10-11 can't handle a DataView body. + this._bodyInit = new Blob([this._bodyArrayBuffer]); + } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { + this._bodyArrayBuffer = bufferClone(body); + } else { + this._bodyText = body = Object.prototype.toString.call(body); + } + if (!this.headers.get('content-type')) { + if (typeof body === 'string') { + this.headers.set('content-type', 'text/plain;charset=UTF-8'); + } else if (this._bodyBlob && this._bodyBlob.type) { + this.headers.set('content-type', this._bodyBlob.type); + } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { + this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); + } + } + }; + if (support.blob) { + this.blob = function () { + var rejected = consumed(this); + if (rejected) { + return rejected; + } + if (this._bodyBlob) { + return Promise.resolve(this._bodyBlob); + } else if (this._bodyArrayBuffer) { + return Promise.resolve(new Blob([this._bodyArrayBuffer])); + } else if (this._bodyFormData) { + throw new Error('could not read FormData body as blob'); + } else { + return Promise.resolve(new Blob([this._bodyText])); + } + }; + } + this.arrayBuffer = function () { + if (this._bodyArrayBuffer) { + var isConsumed = consumed(this); + if (isConsumed) { + return isConsumed; + } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) { + return Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength)); + } else { + return Promise.resolve(this._bodyArrayBuffer); + } + } else if (support.blob) { + return this.blob().then(readBlobAsArrayBuffer); + } else { + throw new Error('could not read as ArrayBuffer'); + } + }; + this.text = function () { + var rejected = consumed(this); + if (rejected) { + return rejected; + } + if (this._bodyBlob) { + return readBlobAsText(this._bodyBlob); + } else if (this._bodyArrayBuffer) { + return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)); + } else if (this._bodyFormData) { + throw new Error('could not read FormData body as text'); + } else { + return Promise.resolve(this._bodyText); + } + }; + if (support.formData) { + this.formData = function () { + return this.text().then(decode); + }; + } + this.json = function () { + return this.text().then(JSON.parse); + }; + return this; + } + + // HTTP methods whose capitalization should be normalized + var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE']; + function normalizeMethod(method) { + var upcased = method.toUpperCase(); + return methods.indexOf(upcased) > -1 ? upcased : method; + } + function Request(input, options) { + if (!(this instanceof Request)) { + throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); + } + options = options || {}; + var body = options.body; + if (input instanceof Request) { + if (input.bodyUsed) { + throw new TypeError('Already read'); + } + this.url = input.url; + this.credentials = input.credentials; + if (!options.headers) { + this.headers = new Headers(input.headers); + } + this.method = input.method; + this.mode = input.mode; + this.signal = input.signal; + if (!body && input._bodyInit != null) { + body = input._bodyInit; + input.bodyUsed = true; + } + } else { + this.url = String(input); + } + this.credentials = options.credentials || this.credentials || 'same-origin'; + if (options.headers || !this.headers) { + this.headers = new Headers(options.headers); + } + this.method = normalizeMethod(options.method || this.method || 'GET'); + this.mode = options.mode || this.mode || null; + this.signal = options.signal || this.signal || function () { + if ('AbortController' in g) { + var ctrl = new AbortController(); + return ctrl.signal; + } + }(); + this.referrer = null; + if ((this.method === 'GET' || this.method === 'HEAD') && body) { + throw new TypeError('Body not allowed for GET or HEAD requests'); + } + this._initBody(body); + if (this.method === 'GET' || this.method === 'HEAD') { + if (options.cache === 'no-store' || options.cache === 'no-cache') { + // Search for a '_' parameter in the query string + var reParamSearch = /([?&])_=[^&]*/; + if (reParamSearch.test(this.url)) { + // If it already exists then set the value with the current time + this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime()); + } else { + // Otherwise add a new '_' parameter to the end with the current time + var reQueryString = /\?/; + this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime(); + } + } + } + } + Request.prototype.clone = function () { + return new Request(this, { + body: this._bodyInit + }); + }; + function decode(body) { + var form = new FormData(); + body.trim().split('&').forEach(function (bytes) { + if (bytes) { + var split = bytes.split('='); + var name = split.shift().replace(/\+/g, ' '); + var value = split.join('=').replace(/\+/g, ' '); + form.append(decodeURIComponent(name), decodeURIComponent(value)); + } + }); + return form; + } + function parseHeaders(rawHeaders) { + var headers = new Headers(); + // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space + // https://tools.ietf.org/html/rfc7230#section-3.2 + var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); + // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill + // https://github.com/github/fetch/issues/748 + // https://github.com/zloirock/core-js/issues/751 + preProcessedHeaders.split('\r').map(function (header) { + return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header; + }).forEach(function (line) { + var parts = line.split(':'); + var key = parts.shift().trim(); + if (key) { + var value = parts.join(':').trim(); + try { + headers.append(key, value); + } catch (error) { + console.warn('Response ' + error.message); + } + } + }); + return headers; + } + Body.call(Request.prototype); + function Response(bodyInit, options) { + if (!(this instanceof Response)) { + throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); + } + if (!options) { + options = {}; + } + this.type = 'default'; + this.status = options.status === undefined ? 200 : options.status; + if (this.status < 200 || this.status > 599) { + throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599]."); + } + this.ok = this.status >= 200 && this.status < 300; + this.statusText = options.statusText === undefined ? '' : '' + options.statusText; + this.headers = new Headers(options.headers); + this.url = options.url || ''; + this._initBody(bodyInit); + } + Body.call(Response.prototype); + Response.prototype.clone = function () { + return new Response(this._bodyInit, { + status: this.status, + statusText: this.statusText, + headers: new Headers(this.headers), + url: this.url + }); + }; + Response.error = function () { + var response = new Response(null, { + status: 200, + statusText: '' + }); + response.ok = false; + response.status = 0; + response.type = 'error'; + return response; + }; + var redirectStatuses = [301, 302, 303, 307, 308]; + Response.redirect = function (url, status) { + if (redirectStatuses.indexOf(status) === -1) { + throw new RangeError('Invalid status code'); + } + return new Response(null, { + status: status, + headers: { + location: url + } + }); + }; + exports.DOMException = g.DOMException; + try { + new exports.DOMException(); + } catch (err) { + exports.DOMException = function (message, name) { + this.message = message; + this.name = name; + var error = Error(message); + this.stack = error.stack; + }; + exports.DOMException.prototype = Object.create(Error.prototype); + exports.DOMException.prototype.constructor = exports.DOMException; + } + function fetch(input, init) { + return new Promise(function (resolve, reject) { + var request = new Request(input, init); + if (request.signal && request.signal.aborted) { + return reject(new exports.DOMException('Aborted', 'AbortError')); + } + var xhr = new XMLHttpRequest(); + function abortXhr() { + xhr.abort(); + } + xhr.onload = function () { + var options = { + statusText: xhr.statusText, + headers: parseHeaders(xhr.getAllResponseHeaders() || '') + }; + // This check if specifically for when a user fetches a file locally from the file system + // Only if the status is out of a normal range + if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) { + options.status = 200; + } else { + options.status = xhr.status; + } + options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); + var body = 'response' in xhr ? xhr.response : xhr.responseText; + setTimeout(function () { + resolve(new Response(body, options)); + }, 0); + }; + xhr.onerror = function () { + setTimeout(function () { + reject(new TypeError('Network request failed')); + }, 0); + }; + xhr.ontimeout = function () { + setTimeout(function () { + reject(new TypeError('Network request timed out')); + }, 0); + }; + xhr.onabort = function () { + setTimeout(function () { + reject(new exports.DOMException('Aborted', 'AbortError')); + }, 0); + }; + function fixUrl(url) { + try { + return url === '' && g.location.href ? g.location.href : url; + } catch (e) { + return url; + } + } + xhr.open(request.method, fixUrl(request.url), true); + if (request.credentials === 'include') { + xhr.withCredentials = true; + } else if (request.credentials === 'omit') { + xhr.withCredentials = false; + } + if ('responseType' in xhr) { + if (support.blob) { + xhr.responseType = 'blob'; + } else if (support.arrayBuffer) { + xhr.responseType = 'arraybuffer'; + } + } + if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || g.Headers && init.headers instanceof g.Headers)) { + var names = []; + Object.getOwnPropertyNames(init.headers).forEach(function (name) { + names.push(normalizeName(name)); + xhr.setRequestHeader(name, normalizeValue(init.headers[name])); + }); + request.headers.forEach(function (value, name) { + if (names.indexOf(name) === -1) { + xhr.setRequestHeader(name, value); + } + }); + } else { + request.headers.forEach(function (value, name) { + xhr.setRequestHeader(name, value); + }); + } + if (request.signal) { + request.signal.addEventListener('abort', abortXhr); + xhr.onreadystatechange = function () { + // DONE (success or failure) + if (xhr.readyState === 4) { + request.signal.removeEventListener('abort', abortXhr); + } + }; + } + xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); + }); + } + fetch.polyfill = true; + if (!g.fetch) { + g.fetch = fetch; + g.Headers = Headers; + g.Request = Request; + g.Response = Response; + } + exports.Headers = Headers; + exports.Request = Request; + exports.Response = Response; + exports.fetch = fetch; + Object.defineProperty(exports, '__esModule', { + value: true + }); + }); +},105,[],"node_modules\\whatwg-fetch\\dist\\fetch.umd.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + if (process.env.NODE_ENV === 'production') { + module.exports = _$$_REQUIRE(_dependencyMap[0], "./cjs/react-jsx-runtime.production.min.js"); + } else { + module.exports = _$$_REQUIRE(_dependencyMap[1], "./cjs/react-jsx-runtime.development.js"); + } +},106,[107,108],"node_modules\\react\\jsx-runtime.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * @license React + * react-jsx-runtime.production.min.js + * + * 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. + */ + 'use strict'; + + var f = _$$_REQUIRE(_dependencyMap[0], "react"), + k = Symbol.for("react.element"), + l = Symbol.for("react.fragment"), + m = Object.prototype.hasOwnProperty, + n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, + p = { + key: !0, + ref: !0, + __self: !0, + __source: !0 + }; + function q(c, a, g) { + var b, + d = {}, + e = null, + h = null; + void 0 !== g && (e = "" + g); + void 0 !== a.key && (e = "" + a.key); + void 0 !== a.ref && (h = a.ref); + for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]); + if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]); + return { + $$typeof: k, + type: c, + key: e, + ref: h, + props: d, + _owner: n.current + }; + } + exports.Fragment = l; + exports.jsx = q; + exports.jsxs = q; +},107,[65],"node_modules\\react\\cjs\\react-jsx-runtime.production.min.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * @license React + * react-jsx-runtime.development.js + * + * 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. + */ + + 'use strict'; + + if (process.env.NODE_ENV !== "production") { + (function () { + 'use strict'; + + var React = _$$_REQUIRE(_dependencyMap[0], "react"); + + // ATTENTION + // When adding new symbols to this file, + // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' + // The Symbol used to tag the ReactElement-like types. + var REACT_ELEMENT_TYPE = Symbol.for('react.element'); + var REACT_PORTAL_TYPE = Symbol.for('react.portal'); + var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); + var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); + var REACT_PROFILER_TYPE = Symbol.for('react.profiler'); + var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); + var REACT_CONTEXT_TYPE = Symbol.for('react.context'); + var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); + var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); + var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); + var REACT_MEMO_TYPE = Symbol.for('react.memo'); + var REACT_LAZY_TYPE = Symbol.for('react.lazy'); + var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); + var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + return null; + } + var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + function error(format) { + { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + printWarning('error', format, args); + } + } + } + function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } // eslint-disable-next-line react-internal/safe-string-coercion + + var argsWithFormat = args.map(function (item) { + return String(item); + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } + } + + // ----------------------------------------------------------------------------- + + var enableScopeAPI = false; // Experimental Create Event Handle API. + var enableCacheElement = false; + var enableTransitionTracing = false; // No known bugs, but needs performance testing + + var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber + // stuff. Intended to enable React core members to more easily debug scheduling + // issues in DEV builds. + + var enableDebugTracing = false; // Track which Fiber(s) schedule render work. + + var REACT_MODULE_REFERENCE; + { + REACT_MODULE_REFERENCE = Symbol.for('react.module.reference'); + } + function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) { + return true; + } + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || + // This needs to include all possible module reference object + // types supported by any Flight configuration anywhere since + // we don't know which Flight build this will end up being used + // with. + type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { + return true; + } + } + return false; + } + function getWrappedName(outerType, innerType, wrapperName) { + var displayName = outerType.displayName; + if (displayName) { + return displayName; + } + var functionName = innerType.displayName || innerType.name || ''; + return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName; + } // Keep in sync with react-reconciler/getComponentNameFromFiber + + function getContextName(type) { + return type.displayName || 'Context'; + } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. + + function getComponentNameFromType(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + if (typeof type === 'string') { + 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'; + } + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + var context = type; + return getContextName(context) + '.Consumer'; + case REACT_PROVIDER_TYPE: + var provider = type; + return getContextName(provider._context) + '.Provider'; + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + case REACT_MEMO_TYPE: + var outerName = type.displayName || null; + if (outerName !== null) { + return outerName; + } + return getComponentNameFromType(type.type) || 'Memo'; + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + return getComponentNameFromType(init(payload)); + } catch (x) { + return null; + } + } + + // eslint-disable-next-line no-fallthrough + } + } + return null; + } + var assign = Object.assign; + + // Helpers to patch console.logs to avoid logging during side-effect free + // replaying on render function. This currently only patches the object + // lazily which won't cover if the log function was extracted eagerly. + // We could also eagerly patch the method. + var disabledDepth = 0; + var prevLog; + var prevInfo; + var prevWarn; + var prevError; + var prevGroup; + var prevGroupCollapsed; + var prevGroupEnd; + function disabledLog() {} + disabledLog.__reactDisabledLog = true; + function disableLogs() { + { + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 + + var props = { + configurable: true, + enumerable: true, + value: disabledLog, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + /* eslint-enable react-internal/no-production-logging */ + } + disabledDepth++; + } + } + function reenableLogs() { + { + disabledDepth--; + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + var props = { + configurable: true, + enumerable: true, + writable: true + }; // $FlowFixMe Flow thinks console is immutable. + + Object.defineProperties(console, { + log: assign({}, props, { + value: prevLog + }), + info: assign({}, props, { + value: prevInfo + }), + warn: assign({}, props, { + value: prevWarn + }), + error: assign({}, props, { + value: prevError + }), + group: assign({}, props, { + value: prevGroup + }), + groupCollapsed: assign({}, props, { + value: prevGroupCollapsed + }), + groupEnd: assign({}, props, { + value: prevGroupEnd + }) + }); + /* eslint-enable react-internal/no-production-logging */ + } + if (disabledDepth < 0) { + error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); + } + } + } + var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; + var prefix; + function describeBuiltInComponentFrame(name, source, ownerFn) { + { + if (prefix === undefined) { + // Extract the VM specific prefix used by each line. + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = match && match[1] || ''; + } + } // We use the prefix to ensure our stacks line up with native stack frames. + + return '\n' + prefix + name; + } + } + var reentry = false; + var componentFrameCache; + { + var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap(); + } + function describeNativeComponentFrame(fn, construct) { + // If something asked for a stack inside a fake render, it should get ignored. + if (!fn || reentry) { + return ''; + } + { + var frame = componentFrameCache.get(fn); + if (frame !== undefined) { + return frame; + } + } + var control; + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. + + Error.prepareStackTrace = undefined; + var previousDispatcher; + { + previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function + // for warnings. + + ReactCurrentDispatcher.current = null; + disableLogs(); + } + try { + // This should throw. + if (construct) { + // Something should be setting the props in the constructor. + var Fake = function Fake() { + throw Error(); + }; // $FlowFixMe + + Object.defineProperty(Fake.prototype, 'props', { + set: function set() { + // We use a throwing setter instead of frozen or non-writable props + // because that won't throw in a non-strict mode function. + throw Error(); + } + }); + if (typeof Reflect === 'object' && Reflect.construct) { + // We construct a different control for this case to include any extra + // frames added by the construct call. + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } + fn(); + } + } catch (sample) { + // This is inlined manually because closure doesn't do it for us. + if (sample && control && typeof sample.stack === 'string') { + // This extracts the first frame from the sample that isn't also in the control. + // Skipping one frame that we assume is the frame that calls the two. + var sampleLines = sample.stack.split('\n'); + var controlLines = control.stack.split('\n'); + var s = sampleLines.length - 1; + var c = controlLines.length - 1; + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + // We expect at least one stack frame to be shared. + // Typically this will be the root most one. However, stack frames may be + // cut off due to maximum stack limits. In this case, one maybe cut off + // earlier than the other. We assume that the sample is longer or the same + // and there for cut off earlier. So we should find the root most frame in + // the sample somewhere in the control. + c--; + } + for (; s >= 1 && c >= 0; s--, c--) { + // Next we find the first one that isn't the same which should be the + // frame that called our sample function and the control. + if (sampleLines[s] !== controlLines[c]) { + // In V8, the first line is describing the message but other VMs don't. + // If we're about to return the first line, and the control is also on the same + // line, that's a pretty good indicator that our sample threw at same line as + // the control. I.e. before we entered the sample frame. So we ignore this result. + // This can happen if you passed a class to function component, or non-function. + if (s !== 1 || c !== 1) { + do { + s--; + c--; // We may still have similar intermediate frames from the construct call. + // The next one that isn't the same should be our match though. + + if (c < 0 || sampleLines[s] !== controlLines[c]) { + // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. + var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "" + // but we have a user-provided "displayName" + // splice it in to make the stack more readable. + + if (fn.displayName && _frame.includes('')) { + _frame = _frame.replace('', fn.displayName); + } + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, _frame); + } + } // Return the line we found. + + return _frame; + } + } while (s >= 1 && c >= 0); + } + break; + } + } + } + } finally { + reentry = false; + { + ReactCurrentDispatcher.current = previousDispatcher; + reenableLogs(); + } + Error.prepareStackTrace = previousPrepareStackTrace; + } // Fallback to just using the name if we couldn't make it throw. + + var name = fn ? fn.displayName || fn.name : ''; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; + { + if (typeof fn === 'function') { + componentFrameCache.set(fn, syntheticFrame); + } + } + return syntheticFrame; + } + function describeFunctionComponentFrame(fn, source, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } + } + function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); + } + function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { + if (type == null) { + return ''; + } + if (typeof type === 'function') { + { + return describeNativeComponentFrame(type, shouldConstruct(type)); + } + } + if (typeof type === 'string') { + return describeBuiltInComponentFrame(type); + } + switch (type) { + case REACT_SUSPENSE_TYPE: + return describeBuiltInComponentFrame('Suspense'); + case REACT_SUSPENSE_LIST_TYPE: + return describeBuiltInComponentFrame('SuspenseList'); + } + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_FORWARD_REF_TYPE: + return describeFunctionComponentFrame(type.render); + case REACT_MEMO_TYPE: + // Memo may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + // Lazy may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); + } catch (x) {} + } + } + } + return ''; + } + var hasOwnProperty = Object.prototype.hasOwnProperty; + var loggedTypeFailures = {}; + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + function setCurrentlyValidatingElement(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame.setExtraStackFrame(null); + } + } + } + function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(hasOwnProperty); + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + // eslint-disable-next-line react-internal/prod-error-codes + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; + } + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); + } catch (ex) { + error$1 = ex; + } + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); + setCurrentlyValidatingElement(null); + } + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + error('Failed %s type: %s', location, error$1.message); + setCurrentlyValidatingElement(null); + } + } + } + } + } + var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare + + function isArray(a) { + return isArrayImpl(a); + } + + /* + * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol + * and Temporal.* types. See https://github.com/facebook/react/pull/22064. + * + * The functions in this module will throw an easier-to-understand, + * easier-to-debug exception with a clear errors message message explaining the + * problem. (Instead of a confusing exception thrown inside the implementation + * of the `value` object). + */ + // $FlowFixMe only called in DEV, so void return is not possible. + function typeName(value) { + { + // toStringTag is needed for namespaced types like Temporal.Instant + var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag; + var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; + return type; + } + } // $FlowFixMe only called in DEV, so void return is not possible. + + function willCoercionThrow(value) { + { + try { + testStringCoercion(value); + return false; + } catch (e) { + return true; + } + } + } + function testStringCoercion(value) { + // If you ended up here by following an exception call stack, here's what's + // happened: you supplied an object or symbol value to React (as a prop, key, + // DOM attribute, CSS property, string ref, etc.) and when React tried to + // coerce it to a string using `'' + value`, an exception was thrown. + // + // The most common types that will cause this exception are `Symbol` instances + // and Temporal objects like `Temporal.Instant`. But any object that has a + // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this + // exception. (Library authors do this to prevent users from using built-in + // numeric operators like `+` or comparison operators like `>=` because custom + // methods are needed to perform accurate arithmetic or comparison.) + // + // To fix the problem, coerce this object or symbol value to a string before + // passing it to React. The most reliable way is usually `String(value)`. + // + // To find which value is throwing, check the browser or debugger console. + // Before this exception was thrown, there should be `console.error` output + // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the + // problem and how that type was used: key, atrribute, input value prop, etc. + // In most cases, this console output also shows the component and its + // ancestor components where the exception happened. + // + // eslint-disable-next-line react-internal/safe-string-coercion + return '' + value; + } + function checkKeyStringCoercion(value) { + { + if (willCoercionThrow(value)) { + error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; + var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true + }; + var specialPropKeyWarningShown; + var specialPropRefWarningShown; + var didWarnAboutStringRefs; + { + didWarnAboutStringRefs = {}; + } + function hasValidRef(config) { + { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + if (getter && getter.isReactWarning) { + return false; + } + } + } + return config.ref !== undefined; + } + function hasValidKey(config) { + { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + if (getter && getter.isReactWarning) { + return false; + } + } + } + return config.key !== undefined; + } + function warnIfStringRefCannotBeAutoConverted(config, self) { + { + if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { + var componentName = getComponentNameFromType(ReactCurrentOwner.current.type); + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref); + didWarnAboutStringRefs[componentName] = true; + } + } + } + } + function defineKeyPropWarningGetter(props, displayName) { + { + var warnAboutAccessingKey = function warnAboutAccessingKey() { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } + } + function defineRefPropWarningGetter(props, displayName) { + { + var warnAboutAccessingRef = function warnAboutAccessingRef() { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); + } + }; + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } + } + /** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */ + + var ReactElement = function ReactElement(type, key, ref, self, source, owner, props) { + var element = { + // This tag allows us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + // Record the component responsible for creating this element. + _owner: owner + }; + { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); // self and source are DEV only properties. + + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + return element; + }; + /** + * https://github.com/reactjs/rfcs/pull/107 + * @param {*} type + * @param {object} props + * @param {string} key + */ + + function jsxDEV(type, config, maybeKey, source, self) { + { + var propName; // Reserved names are extracted + + var props = {}; + var key = null; + var ref = null; // Currently, key can be spread in as a prop. This causes a potential + // issue if key is also explicitly declared (ie.
+ // or
). We want to deprecate key spread, + // but as an intermediary step, we will use jsxDEV for everything except + //
, because we aren't currently able to tell if + // key is explicitly declared to be undefined or not. + + if (maybeKey !== undefined) { + { + checkKeyStringCoercion(maybeKey); + } + key = '' + maybeKey; + } + if (hasValidKey(config)) { + { + checkKeyStringCoercion(config.key); + } + key = '' + config.key; + } + if (hasValidRef(config)) { + ref = config.ref; + warnIfStringRefCannotBeAutoConverted(config, self); + } // Remaining properties are added to a new props object + + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } // Resolve default props + + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + if (key || ref) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } + } + var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; + var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + function setCurrentlyValidatingElement$1(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame$1.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame$1.setExtraStackFrame(null); + } + } + } + var propTypesMisspellWarningShown; + { + propTypesMisspellWarningShown = false; + } + /** + * Verifies the object is a ReactElement. + * See https://reactjs.org/docs/react-api.html#isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a ReactElement. + * @final + */ + + function isValidElement(object) { + { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } + } + function getDeclarationErrorAddendum() { + { + if (ReactCurrentOwner$1.current) { + var name = getComponentNameFromType(ReactCurrentOwner$1.current.type); + if (name) { + return '\n\nCheck the render method of `' + name + '`.'; + } + } + return ''; + } + } + function getSourceInfoErrorAddendum(source) { + { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + return ''; + } + } + /** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + var ownerHasKeyUseWarning = {}; + function getCurrentComponentErrorInfo(parentType) { + { + var info = getDeclarationErrorAddendum(); + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + return info; + } + } + /** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ + + function validateExplicitKey(element, parentType) { + { + if (!element._store || element._store.validated || element.key != null) { + return; + } + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + + var childOwner = ''; + if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { + // Give the component that originally created this child. + childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + "."; + } + setCurrentlyValidatingElement$1(element); + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + setCurrentlyValidatingElement$1(null); + } + } + /** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ + + function validateChildKeys(node, parentType) { + { + if (typeof node !== 'object') { + return; + } + if (isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + if (typeof iteratorFn === 'function') { + // Entry iterators used to provide implicit keys, + // but now we print a separate warning for them later. + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } + } + /** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ + + function validatePropTypes(element) { + { + var type = element.type; + if (type === null || type === undefined || typeof type === 'string') { + return; + } + var propTypes; + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || + // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + if (propTypes) { + // Intentionally inside to avoid triggering lazy initializers: + var name = getComponentNameFromType(type); + checkPropTypes(propTypes, element.props, 'prop', name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: + + var _name = getComponentNameFromType(type); + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); + } + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } + } + /** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ + + function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (key !== 'children' && key !== 'key') { + setCurrentlyValidatingElement$1(fragment); + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + setCurrentlyValidatingElement$1(null); + break; + } + } + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + setCurrentlyValidatingElement$1(null); + } + } + } + function jsxWithValidation(type, props, key, isStaticChildren, source, self) { + { + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + + if (!validType) { + var info = ''; + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; + } + var sourceInfo = getSourceInfoErrorAddendum(source); + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + var typeString; + if (type === null) { + typeString = 'null'; + } else if (isArray(type)) { + typeString = 'array'; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />"; + info = ' Did you accidentally export a JSX literal instead of a component?'; + } else { + typeString = typeof type; + } + error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } + var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + + if (element == null) { + return element; + } // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + + if (validType) { + var children = props.children; + if (children !== undefined) { + if (isStaticChildren) { + if (isArray(children)) { + for (var i = 0; i < children.length; i++) { + validateChildKeys(children[i], type); + } + if (Object.freeze) { + Object.freeze(children); + } + } else { + error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); + } + } else { + validateChildKeys(children, type); + } + } + } + if (type === REACT_FRAGMENT_TYPE) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + return element; + } + } // These two functions exist to still get child warnings in dev + // even with the prod transform. This means that jsxDEV is purely + // opt-in behavior for better messages but that we won't stop + // giving you warnings if you use production apis. + + function jsxWithValidationStatic(type, props, key) { + { + return jsxWithValidation(type, props, key, true); + } + } + function jsxWithValidationDynamic(type, props, key) { + { + return jsxWithValidation(type, props, key, false); + } + } + var jsx = jsxWithValidationDynamic; // we may want to special case jsxs internally to take advantage of static children. + // for now we can ship identical prod functions + + var jsxs = jsxWithValidationStatic; + exports.Fragment = REACT_FRAGMENT_TYPE; + exports.jsx = jsx; + exports.jsxs = jsxs; + })(); + } +},108,[65],"node_modules\\react\\cjs\\react-jsx-runtime.development.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.parseComponentStack = parseComponentStack; + exports.parseInterpolation = parseInterpolation; + exports.parseLogBoxException = parseLogBoxException; + exports.parseLogBoxLog = parseLogBoxLog; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _toConsumableArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/toConsumableArray")); + var _parseErrorStack = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Core/Devtools/parseErrorStack")); + var _UTFSequence = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../UTFSequence")); + var _stringifySafe = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../../Utilities/stringifySafe")); + var _ansiRegex = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "ansi-regex")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var ANSI_REGEX = (0, _ansiRegex.default)().source; + var BABEL_TRANSFORM_ERROR_FORMAT = /^(?:TransformError )?(?:SyntaxError: |ReferenceError: )(.*): (.*) \((\d+):(\d+)\)\n\n([\s\S]+)/; + + // https://github.com/babel/babel/blob/33dbb85e9e9fe36915273080ecc42aee62ed0ade/packages/babel-code-frame/src/index.ts#L183-L184 + var BABEL_CODE_FRAME_MARKER_PATTERN = new RegExp([ + // Beginning of a line (per 'm' flag) + '^', + // Optional ANSI escapes for colors + `(?:${ANSI_REGEX})*`, + // Marker + '>', + // Optional ANSI escapes for colors + `(?:${ANSI_REGEX})*`, + // Left padding for line number + ' +', + // Line number + '[0-9]+', + // Gutter + ' \\|'].join(''), 'm'); + var BABEL_CODE_FRAME_ERROR_FORMAT = + // eslint-disable-next-line no-control-regex + /^(?:TransformError )?(?:(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*):? (?:(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)(\/(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*): ((?:[\0-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+?)\n([ >]{2}[\t-\r 0-9\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+ \|(?:[\0-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+|\x1B(?:[\0-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+)/; + var METRO_ERROR_FORMAT = /^(?:InternalError Metro has encountered an error:) ((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*): ((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*) \(([0-9]+):([0-9]+)\)\n\n((?:[\0-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+)/; + var SUBSTITUTION = _UTFSequence.default.BOM + '%s'; + function parseInterpolation(args) { + var categoryParts = []; + var contentParts = []; + var substitutionOffsets = []; + var remaining = (0, _toConsumableArray2.default)(args); + if (typeof remaining[0] === 'string') { + var formatString = String(remaining.shift()); + var formatStringParts = formatString.split('%s'); + var substitutionCount = formatStringParts.length - 1; + var substitutions = remaining.splice(0, substitutionCount); + var categoryString = ''; + var contentString = ''; + var substitutionIndex = 0; + for (var formatStringPart of formatStringParts) { + categoryString += formatStringPart; + contentString += formatStringPart; + if (substitutionIndex < substitutionCount) { + if (substitutionIndex < substitutions.length) { + // Don't stringify a string type. + // It adds quotation mark wrappers around the string, + // which causes the LogBox to look odd. + var substitution = typeof substitutions[substitutionIndex] === 'string' ? substitutions[substitutionIndex] : (0, _stringifySafe.default)(substitutions[substitutionIndex]); + substitutionOffsets.push({ + length: substitution.length, + offset: contentString.length + }); + categoryString += SUBSTITUTION; + contentString += substitution; + } else { + substitutionOffsets.push({ + length: 2, + offset: contentString.length + }); + categoryString += '%s'; + contentString += '%s'; + } + substitutionIndex++; + } + } + categoryParts.push(categoryString); + contentParts.push(contentString); + } + var remainingArgs = remaining.map(function (arg) { + // Don't stringify a string type. + // It adds quotation mark wrappers around the string, + // which causes the LogBox to look odd. + return typeof arg === 'string' ? arg : (0, _stringifySafe.default)(arg); + }); + categoryParts.push.apply(categoryParts, (0, _toConsumableArray2.default)(remainingArgs)); + contentParts.push.apply(contentParts, (0, _toConsumableArray2.default)(remainingArgs)); + return { + category: categoryParts.join(' '), + message: { + content: contentParts.join(' '), + substitutions: substitutionOffsets + } + }; + } + function isComponentStack(consoleArgument) { + var isOldComponentStackFormat = / {4}in/.test(consoleArgument); + var isNewComponentStackFormat = / {4}at/.test(consoleArgument); + var isNewJSCComponentStackFormat = /@.*\n/.test(consoleArgument); + return isOldComponentStackFormat || isNewComponentStackFormat || isNewJSCComponentStackFormat; + } + function parseComponentStack(message) { + // In newer versions of React, the component stack is formatted as a call stack frame. + // First try to parse the component stack as a call stack frame, and if that doesn't + // work then we'll fallback to the old custom component stack format parsing. + var stack = (0, _parseErrorStack.default)(message); + if (stack && stack.length > 0) { + return stack.map(function (frame) { + return { + content: frame.methodName, + collapse: frame.collapse || false, + fileName: frame.file == null ? 'unknown' : frame.file, + location: { + column: frame.column == null ? -1 : frame.column, + row: frame.lineNumber == null ? -1 : frame.lineNumber + } + }; + }); + } + return message.split(/\n {4}in /g).map(function (s) { + if (!s) { + return null; + } + var match = s.match(/(.*) \(at (.*\.(?:js|jsx|ts|tsx)):([\d]+)\)/); + if (!match) { + return null; + } + var _match$slice = match.slice(1), + _match$slice2 = (0, _slicedToArray2.default)(_match$slice, 3), + content = _match$slice2[0], + fileName = _match$slice2[1], + row = _match$slice2[2]; + return { + content: content, + fileName: fileName, + location: { + column: -1, + row: parseInt(row, 10) + } + }; + }).filter(Boolean); + } + function parseLogBoxException(error) { + var message = error.originalMessage != null ? error.originalMessage : 'Unknown'; + var metroInternalError = message.match(METRO_ERROR_FORMAT); + if (metroInternalError) { + var _metroInternalError$s = metroInternalError.slice(1), + _metroInternalError$s2 = (0, _slicedToArray2.default)(_metroInternalError$s, 5), + content = _metroInternalError$s2[0], + fileName = _metroInternalError$s2[1], + row = _metroInternalError$s2[2], + column = _metroInternalError$s2[3], + codeFrame = _metroInternalError$s2[4]; + return { + level: 'fatal', + type: 'Metro Error', + stack: [], + isComponentError: false, + componentStack: [], + codeFrame: { + fileName: fileName, + location: { + row: parseInt(row, 10), + column: parseInt(column, 10) + }, + content: codeFrame + }, + message: { + content: content, + substitutions: [] + }, + category: `${fileName}-${row}-${column}`, + extraData: error.extraData + }; + } + var babelTransformError = message.match(BABEL_TRANSFORM_ERROR_FORMAT); + if (babelTransformError) { + // Transform errors are thrown from inside the Babel transformer. + var _babelTransformError$ = babelTransformError.slice(1), + _babelTransformError$2 = (0, _slicedToArray2.default)(_babelTransformError$, 5), + _fileName = _babelTransformError$2[0], + _content = _babelTransformError$2[1], + _row = _babelTransformError$2[2], + _column = _babelTransformError$2[3], + _codeFrame = _babelTransformError$2[4]; + return { + level: 'syntax', + stack: [], + isComponentError: false, + componentStack: [], + codeFrame: { + fileName: _fileName, + location: { + row: parseInt(_row, 10), + column: parseInt(_column, 10) + }, + content: _codeFrame + }, + message: { + content: _content, + substitutions: [] + }, + category: `${_fileName}-${_row}-${_column}`, + extraData: error.extraData + }; + } + + // Perform a cheap match first before trying to parse the full message, which + // can get expensive for arbitrary input. + if (BABEL_CODE_FRAME_MARKER_PATTERN.test(message)) { + var babelCodeFrameError = message.match(BABEL_CODE_FRAME_ERROR_FORMAT); + if (babelCodeFrameError) { + // Codeframe errors are thrown from any use of buildCodeFrameError. + var _babelCodeFrameError$ = babelCodeFrameError.slice(1), + _babelCodeFrameError$2 = (0, _slicedToArray2.default)(_babelCodeFrameError$, 3), + _fileName2 = _babelCodeFrameError$2[0], + _content2 = _babelCodeFrameError$2[1], + _codeFrame2 = _babelCodeFrameError$2[2]; + return { + level: 'syntax', + stack: [], + isComponentError: false, + componentStack: [], + codeFrame: { + fileName: _fileName2, + location: null, + // We are not given the location. + content: _codeFrame2 + }, + message: { + content: _content2, + substitutions: [] + }, + category: `${_fileName2}-${1}-${1}`, + extraData: error.extraData + }; + } + } + if (message.match(/^TransformError /)) { + return { + level: 'syntax', + stack: error.stack, + isComponentError: error.isComponentError, + componentStack: [], + message: { + content: message, + substitutions: [] + }, + category: message, + extraData: error.extraData + }; + } + var componentStack = error.componentStack; + if (error.isFatal || error.isComponentError) { + return Object.assign({ + level: 'fatal', + stack: error.stack, + isComponentError: error.isComponentError, + componentStack: componentStack != null ? parseComponentStack(componentStack) : [], + extraData: error.extraData + }, parseInterpolation([message])); + } + if (componentStack != null) { + // It is possible that console errors have a componentStack. + return Object.assign({ + level: 'error', + stack: error.stack, + isComponentError: error.isComponentError, + componentStack: parseComponentStack(componentStack), + extraData: error.extraData + }, parseInterpolation([message])); + } + + // Most `console.error` calls won't have a componentStack. We parse them like + // regular logs which have the component stack buried in the message. + return Object.assign({ + level: 'error', + stack: error.stack, + isComponentError: error.isComponentError, + extraData: error.extraData + }, parseLogBoxLog([message])); + } + function parseLogBoxLog(args) { + var message = args[0]; + var argsWithoutComponentStack = []; + var componentStack = []; + + // Extract component stack from warnings like "Some warning%s". + if (typeof message === 'string' && message.slice(-2) === '%s' && args.length > 0) { + var lastArg = args[args.length - 1]; + if (typeof lastArg === 'string' && isComponentStack(lastArg)) { + argsWithoutComponentStack = args.slice(0, -1); + argsWithoutComponentStack[0] = message.slice(0, -2); + componentStack = parseComponentStack(lastArg); + } + } + if (componentStack.length === 0) { + // Try finding the component stack elsewhere. + for (var arg of args) { + if (typeof arg === 'string' && isComponentStack(arg)) { + // Strip out any messages before the component stack. + var messageEndIndex = arg.search(/\n {4}(in|at) /); + if (messageEndIndex < 0) { + // Handle JSC component stacks. + messageEndIndex = arg.search(/\n/); + } + if (messageEndIndex > 0) { + argsWithoutComponentStack.push(arg.slice(0, messageEndIndex)); + } + componentStack = parseComponentStack(arg); + } else { + argsWithoutComponentStack.push(arg); + } + } + } + return Object.assign({}, parseInterpolation(argsWithoutComponentStack), { + componentStack: componentStack + }); + } +},109,[6,7,41,92,110,46,111],"node_modules\\react-native\\Libraries\\LogBox\\Data\\parseLogBoxLog.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + /** + * A collection of Unicode sequences for various characters and emoji. + * + * - More explicit than using the sequences directly in code. + * - Source code should be limited to ASCII. + * - Less chance of typos. + */ + var UTFSequence = _$$_REQUIRE(_dependencyMap[0], "./Utilities/deepFreezeAndThrowOnMutationInDev")({ + BOM: "\uFEFF", + // byte order mark + BULLET: "\u2022", + // bullet: • + BULLET_SP: "\xA0\u2022\xA0", + //  •  + MIDDOT: "\xB7", + // normal middle dot: · + MIDDOT_SP: "\xA0\xB7\xA0", + //  ·  + MIDDOT_KATAKANA: "\u30FB", + // katakana middle dot + MDASH: "\u2014", + // em dash: — + MDASH_SP: "\xA0\u2014\xA0", + //  —  + NDASH: "\u2013", + // en dash: – + NDASH_SP: "\xA0\u2013\xA0", + //  –  + NEWLINE: "\n", + NBSP: "\xA0", + // non-breaking space:   + PIZZA: "\uD83C\uDF55", + TRIANGLE_LEFT: "\u25C0", + // black left-pointing triangle + TRIANGLE_RIGHT: "\u25B6" // black right-pointing triangle + }); + var _default = exports.default = UTFSequence; +},110,[47],"node_modules\\react-native\\Libraries\\UTFSequence.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = function () { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref$onlyFirst = _ref.onlyFirst, + onlyFirst = _ref$onlyFirst === void 0 ? false : _ref$onlyFirst; + var pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'].join('|'); + return new RegExp(pattern, onlyFirst ? undefined : 'g'); + }; +},111,[],"node_modules\\ansi-regex\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var NativeModule = TurboModuleRegistry.getEnforcing('ExceptionsManager'); + var ExceptionsManager = { + reportFatalException: function reportFatalException(message, stack, exceptionId) { + NativeModule.reportFatalException(message, stack, exceptionId); + }, + reportSoftException: function reportSoftException(message, stack, exceptionId) { + NativeModule.reportSoftException(message, stack, exceptionId); + }, + updateExceptionMessage: function updateExceptionMessage(message, stack, exceptionId) { + NativeModule.updateExceptionMessage(message, stack, exceptionId); + }, + dismissRedbox: function dismissRedbox() { + if ("android" !== 'ios' && NativeModule.dismissRedbox) { + // TODO(T53311281): This is a noop on iOS now. Implement it. + NativeModule.dismissRedbox(); + } + }, + reportException: function reportException(data) { + if (NativeModule.reportException) { + NativeModule.reportException(data); + return; + } + if (data.isFatal) { + ExceptionsManager.reportFatalException(data.message, data.stack, data.id); + } else { + ExceptionsManager.reportSoftException(data.message, data.stack, data.id); + } + } + }; + var _default = exports.default = ExceptionsManager; +},112,[36],"node_modules\\react-native\\Libraries\\Core\\NativeExceptionsManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _global, _global$HermesInterna; + /** + * Set up Promise. The native Promise implementation throws the following error: + * ERROR: Event loop not supported. + * + * If you don't need these polyfills, don't use InitializeCore; just directly + * require the modules you need from InitializeCore for setup. + */ + + // If global.Promise is provided by Hermes, we are confident that it can provide + // all the methods needed by React Native, so we can directly use it. + if ((_global = global) != null && (_global$HermesInterna = _global.HermesInternal) != null && _global$HermesInterna.hasPromise != null && _global$HermesInterna.hasPromise()) { + var HermesPromise = global.Promise; + if (__DEV__) { + var _global$HermesInterna2; + if (typeof HermesPromise !== 'function') { + console.error('HermesPromise does not exist'); + } + (_global$HermesInterna2 = global.HermesInternal) == null ? void 0 : _global$HermesInterna2.enablePromiseRejectionTracker == null ? void 0 : _global$HermesInterna2.enablePromiseRejectionTracker(_$$_REQUIRE(_dependencyMap[0], "../promiseRejectionTrackingOptions").default); + } + } else { + _$$_REQUIRE(_dependencyMap[1], "../Utilities/PolyfillFunctions").polyfillGlobal('Promise', function () { + return _$$_REQUIRE(_dependencyMap[2], "../Promise"); + }); + } +},113,[114,134,135],"node_modules\\react-native\\Libraries\\Core\\polyfillPromise.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _LogBox = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./LogBox/LogBox")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var rejectionTrackingOptions = { + allRejections: true, + onUnhandled: function onUnhandled(id) { + var _message; + var rejection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var message; + var stack; + + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + var stringValue = Object.prototype.toString.call(rejection); + if (stringValue === '[object Error]') { + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + message = Error.prototype.toString.call(rejection); + var error = rejection; + stack = error.stack; + } else { + try { + message = _$$_REQUIRE(_dependencyMap[2], "pretty-format")(rejection); + } catch (_unused) { + message = typeof rejection === 'string' ? rejection : JSON.stringify(rejection); + } + // It could although this object is not a standard error, it still has stack information to unwind + // $FlowFixMe ignore types just check if stack is there + if (rejection.stack && typeof rejection.stack === 'string') { + stack = rejection.stack; + } + } + var warning = `Possible unhandled promise rejection (id: ${id}):\n${(_message = message) != null ? _message : ''}`; + if (__DEV__) { + _LogBox.default.addLog({ + level: 'warn', + message: { + content: warning, + substitutions: [] + }, + componentStack: [], + stack: stack, + category: 'possible_unhandled_promise_rejection' + }); + } else { + console.warn(warning); + } + }, + onHandled: function onHandled(id) { + var warning = `Promise rejection handled (id: ${id})\n` + 'This means you can ignore any previous messages of the form ' + `"Possible unhandled promise rejection (id: ${id}):"`; + console.warn(warning); + } + }; + var _default = exports.default = rejectionTrackingOptions; +},114,[6,95,115],"node_modules\\react-native\\Libraries\\promiseRejectionTrackingOptions.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _createClass = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/createClass"); + var _classCallCheck = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck"); + var _possibleConstructorReturn = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/possibleConstructorReturn"); + var _getPrototypeOf = _$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/getPrototypeOf"); + var _inherits = _$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/inherits"); + var _wrapNativeSuper = _$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/wrapNativeSuper"); + function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + var _ansiStyles = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "ansi-styles")); + var _AsymmetricMatcher = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./plugins/AsymmetricMatcher")); + var _ConvertAnsi = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./plugins/ConvertAnsi")); + var _DOMCollection = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./plugins/DOMCollection")); + var _DOMElement = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "./plugins/DOMElement")); + var _Immutable = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[11], "./plugins/Immutable")); + var _ReactElement = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[12], "./plugins/ReactElement")); + var _ReactTestComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[13], "./plugins/ReactTestComponent")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + + /** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + /* eslint-disable local/ban-types-eventually */ + var toString = Object.prototype.toString; + var toISOString = Date.prototype.toISOString; + var errorToString = Error.prototype.toString; + var regExpToString = RegExp.prototype.toString; + /** + * Explicitly comparing typeof constructor to function avoids undefined as name + * when mock identity-obj-proxy returns the key as the value for any key. + */ + + var getConstructorName = function getConstructorName(val) { + return typeof val.constructor === 'function' && val.constructor.name || 'Object'; + }; + /* global window */ + + /** Is val is equal to global window object? Works even if it does not exist :) */ + + var isWindow = function isWindow(val) { + return typeof window !== 'undefined' && val === window; + }; + var SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/; + var NEWLINE_REGEXP = /\n/gi; + var PrettyFormatPluginError = /*#__PURE__*/function (_Error) { + function PrettyFormatPluginError(message, stack) { + var _this; + _classCallCheck(this, PrettyFormatPluginError); + _this = _callSuper(this, PrettyFormatPluginError, [message]); + _this.stack = stack; + _this.name = _this.constructor.name; + return _this; + } + _inherits(PrettyFormatPluginError, _Error); + return _createClass(PrettyFormatPluginError); + }(/*#__PURE__*/_wrapNativeSuper(Error)); + function isToStringedArrayType(toStringed) { + return toStringed === '[object Array]' || toStringed === '[object ArrayBuffer]' || toStringed === '[object DataView]' || toStringed === '[object Float32Array]' || toStringed === '[object Float64Array]' || toStringed === '[object Int8Array]' || toStringed === '[object Int16Array]' || toStringed === '[object Int32Array]' || toStringed === '[object Uint8Array]' || toStringed === '[object Uint8ClampedArray]' || toStringed === '[object Uint16Array]' || toStringed === '[object Uint32Array]'; + } + function printNumber(val) { + return Object.is(val, -0) ? '-0' : String(val); + } + function printBigInt(val) { + return String(`${val}n`); + } + function printFunction(val, printFunctionName) { + if (!printFunctionName) { + return '[Function]'; + } + return '[Function ' + (val.name || 'anonymous') + ']'; + } + function printSymbol(val) { + return String(val).replace(SYMBOL_REGEXP, 'Symbol($1)'); + } + function printError(val) { + return '[' + errorToString.call(val) + ']'; + } + /** + * The first port of call for printing an object, handles most of the + * data-types in JS. + */ + + function printBasicValue(val, printFunctionName, escapeRegex, escapeString) { + if (val === true || val === false) { + return '' + val; + } + if (val === undefined) { + return 'undefined'; + } + if (val === null) { + return 'null'; + } + var typeOf = typeof val; + if (typeOf === 'number') { + return printNumber(val); + } + if (typeOf === 'bigint') { + return printBigInt(val); + } + if (typeOf === 'string') { + if (escapeString) { + return '"' + val.replace(/"|\\/g, '\\$&') + '"'; + } + return '"' + val + '"'; + } + if (typeOf === 'function') { + return printFunction(val, printFunctionName); + } + if (typeOf === 'symbol') { + return printSymbol(val); + } + var toStringed = toString.call(val); + if (toStringed === '[object WeakMap]') { + return 'WeakMap {}'; + } + if (toStringed === '[object WeakSet]') { + return 'WeakSet {}'; + } + if (toStringed === '[object Function]' || toStringed === '[object GeneratorFunction]') { + return printFunction(val, printFunctionName); + } + if (toStringed === '[object Symbol]') { + return printSymbol(val); + } + if (toStringed === '[object Date]') { + return isNaN(+val) ? 'Date { NaN }' : toISOString.call(val); + } + if (toStringed === '[object Error]') { + return printError(val); + } + if (toStringed === '[object RegExp]') { + if (escapeRegex) { + // https://github.com/benjamingr/RegExp.escape/blob/master/polyfill.js + return regExpToString.call(val).replace(/[\\^$*+?.()|[\]{}]/g, '\\$&'); + } + return regExpToString.call(val); + } + if (val instanceof Error) { + return printError(val); + } + return null; + } + /** + * Handles more complex objects ( such as objects with circular references. + * maps and sets etc ) + */ + + function printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON) { + if (refs.indexOf(val) !== -1) { + return '[Circular]'; + } + refs = refs.slice(); + refs.push(val); + var hitMaxDepth = ++depth > config.maxDepth; + var min = config.min; + if (config.callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON === 'function' && !hasCalledToJSON) { + return printer(val.toJSON(), config, indentation, depth, refs, true); + } + var toStringed = toString.call(val); + if (toStringed === '[object Arguments]') { + return hitMaxDepth ? '[Arguments]' : (min ? '' : 'Arguments ') + '[' + (0, _$$_REQUIRE(_dependencyMap[14], "./collections").printListItems)(val, config, indentation, depth, refs, printer) + ']'; + } + if (isToStringedArrayType(toStringed)) { + return hitMaxDepth ? '[' + val.constructor.name + ']' : (min ? '' : val.constructor.name + ' ') + '[' + (0, _$$_REQUIRE(_dependencyMap[14], "./collections").printListItems)(val, config, indentation, depth, refs, printer) + ']'; + } + if (toStringed === '[object Map]') { + return hitMaxDepth ? '[Map]' : 'Map {' + (0, _$$_REQUIRE(_dependencyMap[14], "./collections").printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer, ' => ') + '}'; + } + if (toStringed === '[object Set]') { + return hitMaxDepth ? '[Set]' : 'Set {' + (0, _$$_REQUIRE(_dependencyMap[14], "./collections").printIteratorValues)(val.values(), config, indentation, depth, refs, printer) + '}'; + } // Avoid failure to serialize global window object in jsdom test environment. + // For example, not even relevant if window is prop of React element. + + return hitMaxDepth || isWindow(val) ? '[' + getConstructorName(val) + ']' : (min ? '' : getConstructorName(val) + ' ') + '{' + (0, _$$_REQUIRE(_dependencyMap[14], "./collections").printObjectProperties)(val, config, indentation, depth, refs, printer) + '}'; + } + function isNewPlugin(plugin) { + return plugin.serialize != null; + } + function printPlugin(plugin, val, config, indentation, depth, refs) { + var printed; + try { + printed = isNewPlugin(plugin) ? plugin.serialize(val, config, indentation, depth, refs, printer) : plugin.print(val, function (valChild) { + return printer(valChild, config, indentation, depth, refs); + }, function (str) { + var indentationNext = indentation + config.indent; + return indentationNext + str.replace(NEWLINE_REGEXP, '\n' + indentationNext); + }, { + edgeSpacing: config.spacingOuter, + min: config.min, + spacing: config.spacingInner + }, config.colors); + } catch (error) { + throw new PrettyFormatPluginError(error.message, error.stack); + } + if (typeof printed !== 'string') { + throw new Error(`pretty-format: Plugin must return type "string" but instead returned "${typeof printed}".`); + } + return printed; + } + function findPlugin(plugins, val) { + for (var p = 0; p < plugins.length; p++) { + try { + if (plugins[p].test(val)) { + return plugins[p]; + } + } catch (error) { + throw new PrettyFormatPluginError(error.message, error.stack); + } + } + return null; + } + function printer(val, config, indentation, depth, refs, hasCalledToJSON) { + var plugin = findPlugin(config.plugins, val); + if (plugin !== null) { + return printPlugin(plugin, val, config, indentation, depth, refs); + } + var basicResult = printBasicValue(val, config.printFunctionName, config.escapeRegex, config.escapeString); + if (basicResult !== null) { + return basicResult; + } + return printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON); + } + var DEFAULT_THEME = { + comment: 'gray', + content: 'reset', + prop: 'yellow', + tag: 'cyan', + value: 'green' + }; + var DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME); + var DEFAULT_OPTIONS = { + callToJSON: true, + escapeRegex: false, + escapeString: true, + highlight: false, + indent: 2, + maxDepth: Infinity, + min: false, + plugins: [], + printFunctionName: true, + theme: DEFAULT_THEME + }; + function validateOptions(options) { + Object.keys(options).forEach(function (key) { + if (!DEFAULT_OPTIONS.hasOwnProperty(key)) { + throw new Error(`pretty-format: Unknown option "${key}".`); + } + }); + if (options.min && options.indent !== undefined && options.indent !== 0) { + throw new Error('pretty-format: Options "min" and "indent" cannot be used together.'); + } + if (options.theme !== undefined) { + if (options.theme === null) { + throw new Error(`pretty-format: Option "theme" must not be null.`); + } + if (typeof options.theme !== 'object') { + throw new Error(`pretty-format: Option "theme" must be of type "object" but instead received "${typeof options.theme}".`); + } + } + } + var getColorsHighlight = function getColorsHighlight(options) { + return DEFAULT_THEME_KEYS.reduce(function (colors, key) { + var value = options.theme && options.theme[key] !== undefined ? options.theme[key] : DEFAULT_THEME[key]; + var color = value && _ansiStyles.default[value]; + if (color && typeof color.close === 'string' && typeof color.open === 'string') { + colors[key] = color; + } else { + throw new Error(`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`); + } + return colors; + }, Object.create(null)); + }; + var getColorsEmpty = function getColorsEmpty() { + return DEFAULT_THEME_KEYS.reduce(function (colors, key) { + colors[key] = { + close: '', + open: '' + }; + return colors; + }, Object.create(null)); + }; + var getPrintFunctionName = function getPrintFunctionName(options) { + return options && options.printFunctionName !== undefined ? options.printFunctionName : DEFAULT_OPTIONS.printFunctionName; + }; + var getEscapeRegex = function getEscapeRegex(options) { + return options && options.escapeRegex !== undefined ? options.escapeRegex : DEFAULT_OPTIONS.escapeRegex; + }; + var getEscapeString = function getEscapeString(options) { + return options && options.escapeString !== undefined ? options.escapeString : DEFAULT_OPTIONS.escapeString; + }; + var getConfig = function getConfig(options) { + return { + callToJSON: options && options.callToJSON !== undefined ? options.callToJSON : DEFAULT_OPTIONS.callToJSON, + colors: options && options.highlight ? getColorsHighlight(options) : getColorsEmpty(), + escapeRegex: getEscapeRegex(options), + escapeString: getEscapeString(options), + indent: options && options.min ? '' : createIndent(options && options.indent !== undefined ? options.indent : DEFAULT_OPTIONS.indent), + maxDepth: options && options.maxDepth !== undefined ? options.maxDepth : DEFAULT_OPTIONS.maxDepth, + min: options && options.min !== undefined ? options.min : DEFAULT_OPTIONS.min, + plugins: options && options.plugins !== undefined ? options.plugins : DEFAULT_OPTIONS.plugins, + printFunctionName: getPrintFunctionName(options), + spacingInner: options && options.min ? ' ' : '\n', + spacingOuter: options && options.min ? '' : '\n' + }; + }; + function createIndent(indent) { + return new Array(indent + 1).join(' '); + } + /** + * Returns a presentation string of your `val` object + * @param val any potential JavaScript object + * @param options Custom settings + */ + + function prettyFormat(val, options) { + if (options) { + validateOptions(options); + if (options.plugins) { + var plugin = findPlugin(options.plugins, val); + if (plugin !== null) { + return printPlugin(plugin, val, getConfig(options), '', 0, []); + } + } + } + var basicResult = printBasicValue(val, getPrintFunctionName(options), getEscapeRegex(options), getEscapeString(options)); + if (basicResult !== null) { + return basicResult; + } + return printComplexValue(val, getConfig(options), '', 0, []); + } + prettyFormat.plugins = { + AsymmetricMatcher: _AsymmetricMatcher.default, + ConvertAnsi: _ConvertAnsi.default, + DOMCollection: _DOMCollection.default, + DOMElement: _DOMElement.default, + Immutable: _Immutable.default, + ReactElement: _ReactElement.default, + ReactTestComponent: _ReactTestComponent.default + }; + module.exports = prettyFormat; +},115,[19,18,23,25,28,88,116,121,123,124,125,128,129,133,122],"node_modules\\react-native\\node_modules\\pretty-format\\build\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _slicedToArray = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/slicedToArray"); + var wrapAnsi16 = function wrapAnsi16(fn, offset) { + return function () { + var code = fn.apply(void 0, arguments); + return `\u001B[${code + offset}m`; + }; + }; + var wrapAnsi256 = function wrapAnsi256(fn, offset) { + return function () { + var code = fn.apply(void 0, arguments); + return `\u001B[${38 + offset};5;${code}m`; + }; + }; + var wrapAnsi16m = function wrapAnsi16m(fn, offset) { + return function () { + var rgb = fn.apply(void 0, arguments); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; + }; + }; + var ansi2ansi = function ansi2ansi(n) { + return n; + }; + var rgb2rgb = function rgb2rgb(r, g, b) { + return [r, g, b]; + }; + var setLazyProperty = function setLazyProperty(object, property, _get) { + Object.defineProperty(object, property, { + get: function get() { + var value = _get(); + Object.defineProperty(object, property, { + value: value, + enumerable: true, + configurable: true + }); + return value; + }, + enumerable: true, + configurable: true + }); + }; + + /** @type {typeof import('color-convert')} */ + var colorConvert; + var makeDynamicStyles = function makeDynamicStyles(wrap, targetSpace, identity, isBackground) { + if (colorConvert === undefined) { + colorConvert = _$$_REQUIRE(_dependencyMap[1], "color-convert"); + } + var offset = isBackground ? 10 : 0; + var styles = {}; + for (var _ref of Object.entries(colorConvert)) { + var _ref2 = _slicedToArray(_ref, 2); + var sourceSpace = _ref2[0]; + var suite = _ref2[1]; + var name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } + return styles; + }; + function assembleStyles() { + var codes = new Map(); + var styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + // Bright color + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + for (var _ref3 of Object.entries(styles)) { + var _ref4 = _slicedToArray(_ref3, 2); + var groupName = _ref4[0]; + var group = _ref4[1]; + for (var _ref5 of Object.entries(group)) { + var _ref6 = _slicedToArray(_ref5, 2); + var styleName = _ref6[0]; + var style = _ref6[1]; + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + group[styleName] = styles[styleName]; + codes.set(style[0], style[1]); + } + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + styles.color.close = "\x1B[39m"; + styles.bgColor.close = "\x1B[49m"; + setLazyProperty(styles.color, 'ansi', function () { + return makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false); + }); + setLazyProperty(styles.color, 'ansi256', function () { + return makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false); + }); + setLazyProperty(styles.color, 'ansi16m', function () { + return makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false); + }); + setLazyProperty(styles.bgColor, 'ansi', function () { + return makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true); + }); + setLazyProperty(styles.bgColor, 'ansi256', function () { + return makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true); + }); + setLazyProperty(styles.bgColor, 'ansi16m', function () { + return makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true); + }); + return styles; + } + + // Make the export immutable + Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles + }); +},116,[7,117],"node_modules\\ansi-styles\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var convert = {}; + var models = Object.keys(_$$_REQUIRE(_dependencyMap[0], "./conversions")); + function wrapRaw(fn) { + var wrappedFn = function wrappedFn() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + var arg0 = args[0]; + if (arg0 === undefined || arg0 === null) { + return arg0; + } + if (arg0.length > 1) { + args = arg0; + } + return fn(args); + }; + + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } + return wrappedFn; + } + function wrapRounded(fn) { + var wrappedFn = function wrappedFn() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + var arg0 = args[0]; + if (arg0 === undefined || arg0 === null) { + return arg0; + } + if (arg0.length > 1) { + args = arg0; + } + var result = fn(args); + + // We're assuming the result is an array here. + // see notice in conversions.js; don't use box types + // in conversion functions. + if (typeof result === 'object') { + for (var len = result.length, i = 0; i < len; i++) { + result[i] = Math.round(result[i]); + } + } + return result; + }; + + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } + return wrappedFn; + } + models.forEach(function (fromModel) { + convert[fromModel] = {}; + Object.defineProperty(convert[fromModel], 'channels', { + value: _$$_REQUIRE(_dependencyMap[0], "./conversions")[fromModel].channels + }); + Object.defineProperty(convert[fromModel], 'labels', { + value: _$$_REQUIRE(_dependencyMap[0], "./conversions")[fromModel].labels + }); + var routes = _$$_REQUIRE(_dependencyMap[1], "./route")(fromModel); + var routeModels = Object.keys(routes); + routeModels.forEach(function (toModel) { + var fn = routes[toModel]; + convert[fromModel][toModel] = wrapRounded(fn); + convert[fromModel][toModel].raw = wrapRaw(fn); + }); + }); + module.exports = convert; +},117,[118,120],"node_modules\\color-convert\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _slicedToArray = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/slicedToArray"); + /* MIT license */ + /* eslint-disable no-mixed-operators */ + // NOTE: conversions should only return primitive values (i.e. arrays, or + // values that give correct `typeof` results). + // do not use box values types (i.e. Number(), String(), etc.) + + var reverseKeywords = {}; + for (var key of Object.keys(_$$_REQUIRE(_dependencyMap[1], "color-name"))) { + reverseKeywords[_$$_REQUIRE(_dependencyMap[1], "color-name")[key]] = key; + } + var convert = { + rgb: { + channels: 3, + labels: 'rgb' + }, + hsl: { + channels: 3, + labels: 'hsl' + }, + hsv: { + channels: 3, + labels: 'hsv' + }, + hwb: { + channels: 3, + labels: 'hwb' + }, + cmyk: { + channels: 4, + labels: 'cmyk' + }, + xyz: { + channels: 3, + labels: 'xyz' + }, + lab: { + channels: 3, + labels: 'lab' + }, + lch: { + channels: 3, + labels: 'lch' + }, + hex: { + channels: 1, + labels: ['hex'] + }, + keyword: { + channels: 1, + labels: ['keyword'] + }, + ansi16: { + channels: 1, + labels: ['ansi16'] + }, + ansi256: { + channels: 1, + labels: ['ansi256'] + }, + hcg: { + channels: 3, + labels: ['h', 'c', 'g'] + }, + apple: { + channels: 3, + labels: ['r16', 'g16', 'b16'] + }, + gray: { + channels: 1, + labels: ['gray'] + } + }; + module.exports = convert; + + // Hide .channels and .labels properties + for (var model of Object.keys(convert)) { + if (!('channels' in convert[model])) { + throw new Error('missing channels property: ' + model); + } + if (!('labels' in convert[model])) { + throw new Error('missing channel labels property: ' + model); + } + if (convert[model].labels.length !== convert[model].channels) { + throw new Error('channel and label counts mismatch: ' + model); + } + var _convert$model = convert[model], + channels = _convert$model.channels, + labels = _convert$model.labels; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], 'channels', { + value: channels + }); + Object.defineProperty(convert[model], 'labels', { + value: labels + }); + } + convert.rgb.hsl = function (rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var min = Math.min(r, g, b); + var max = Math.max(r, g, b); + var delta = max - min; + var h; + var s; + if (max === min) { + h = 0; + } else if (r === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r) / delta; + } else if (b === max) { + h = 4 + (r - g) / delta; + } + h = Math.min(h * 60, 360); + if (h < 0) { + h += 360; + } + var l = (min + max) / 2; + if (max === min) { + s = 0; + } else if (l <= 0.5) { + s = delta / (max + min); + } else { + s = delta / (2 - max - min); + } + return [h, s * 100, l * 100]; + }; + convert.rgb.hsv = function (rgb) { + var rdif; + var gdif; + var bdif; + var h; + var s; + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var v = Math.max(r, g, b); + var diff = v - Math.min(r, g, b); + var diffc = function diffc(c) { + return (v - c) / 6 / diff + 1 / 2; + }; + if (diff === 0) { + h = 0; + s = 0; + } else { + s = diff / v; + rdif = diffc(r); + gdif = diffc(g); + bdif = diffc(b); + if (r === v) { + h = bdif - gdif; + } else if (g === v) { + h = 1 / 3 + rdif - bdif; + } else if (b === v) { + h = 2 / 3 + gdif - rdif; + } + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + } + return [h * 360, s * 100, v * 100]; + }; + convert.rgb.hwb = function (rgb) { + var r = rgb[0]; + var g = rgb[1]; + var b = rgb[2]; + var h = convert.rgb.hsl(rgb)[0]; + var w = 1 / 255 * Math.min(r, Math.min(g, b)); + b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); + return [h, w * 100, b * 100]; + }; + convert.rgb.cmyk = function (rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var k = Math.min(1 - r, 1 - g, 1 - b); + var c = (1 - r - k) / (1 - k) || 0; + var m = (1 - g - k) / (1 - k) || 0; + var y = (1 - b - k) / (1 - k) || 0; + return [c * 100, m * 100, y * 100, k * 100]; + }; + function comparativeDistance(x, y) { + /* + See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance + */ + return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2; + } + convert.rgb.keyword = function (rgb) { + var reversed = reverseKeywords[rgb]; + if (reversed) { + return reversed; + } + var currentClosestDistance = Infinity; + var currentClosestKeyword; + for (var keyword of Object.keys(_$$_REQUIRE(_dependencyMap[1], "color-name"))) { + var value = _$$_REQUIRE(_dependencyMap[1], "color-name")[keyword]; + + // Compute comparative distance + var distance = comparativeDistance(rgb, value); + + // Check if its less, if so set as closest + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; + } + } + return currentClosestKeyword; + }; + convert.keyword.rgb = function (keyword) { + return _$$_REQUIRE(_dependencyMap[1], "color-name")[keyword]; + }; + convert.rgb.xyz = function (rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + + // Assume sRGB + r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92; + g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92; + b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92; + var x = r * 0.4124 + g * 0.3576 + b * 0.1805; + var y = r * 0.2126 + g * 0.7152 + b * 0.0722; + var z = r * 0.0193 + g * 0.1192 + b * 0.9505; + return [x * 100, y * 100, z * 100]; + }; + convert.rgb.lab = function (rgb) { + var xyz = convert.rgb.xyz(rgb); + var x = xyz[0]; + var y = xyz[1]; + var z = xyz[2]; + x /= 95.047; + y /= 100; + z /= 108.883; + x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116; + y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116; + z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116; + var l = 116 * y - 16; + var a = 500 * (x - y); + var b = 200 * (y - z); + return [l, a, b]; + }; + convert.hsl.rgb = function (hsl) { + var h = hsl[0] / 360; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var t2; + var t3; + var val; + if (s === 0) { + val = l * 255; + return [val, val, val]; + } + if (l < 0.5) { + t2 = l * (1 + s); + } else { + t2 = l + s - l * s; + } + var t1 = 2 * l - t2; + var rgb = [0, 0, 0]; + for (var i = 0; i < 3; i++) { + t3 = h + 1 / 3 * -(i - 1); + if (t3 < 0) { + t3++; + } + if (t3 > 1) { + t3--; + } + if (6 * t3 < 1) { + val = t1 + (t2 - t1) * 6 * t3; + } else if (2 * t3 < 1) { + val = t2; + } else if (3 * t3 < 2) { + val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; + } else { + val = t1; + } + rgb[i] = val * 255; + } + return rgb; + }; + convert.hsl.hsv = function (hsl) { + var h = hsl[0]; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var smin = s; + var lmin = Math.max(l, 0.01); + l *= 2; + s *= l <= 1 ? l : 2 - l; + smin *= lmin <= 1 ? lmin : 2 - lmin; + var v = (l + s) / 2; + var sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s); + return [h, sv * 100, v * 100]; + }; + convert.hsv.rgb = function (hsv) { + var h = hsv[0] / 60; + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var hi = Math.floor(h) % 6; + var f = h - Math.floor(h); + var p = 255 * v * (1 - s); + var q = 255 * v * (1 - s * f); + var t = 255 * v * (1 - s * (1 - f)); + v *= 255; + switch (hi) { + case 0: + return [v, t, p]; + case 1: + return [q, v, p]; + case 2: + return [p, v, t]; + case 3: + return [p, q, v]; + case 4: + return [t, p, v]; + case 5: + return [v, p, q]; + } + }; + convert.hsv.hsl = function (hsv) { + var h = hsv[0]; + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var vmin = Math.max(v, 0.01); + var sl; + var l; + l = (2 - s) * v; + var lmin = (2 - s) * vmin; + sl = s * vmin; + sl /= lmin <= 1 ? lmin : 2 - lmin; + sl = sl || 0; + l /= 2; + return [h, sl * 100, l * 100]; + }; + + // http://dev.w3.org/csswg/css-color/#hwb-to-rgb + convert.hwb.rgb = function (hwb) { + var h = hwb[0] / 360; + var wh = hwb[1] / 100; + var bl = hwb[2] / 100; + var ratio = wh + bl; + var f; + + // Wh + bl cant be > 1 + if (ratio > 1) { + wh /= ratio; + bl /= ratio; + } + var i = Math.floor(6 * h); + var v = 1 - bl; + f = 6 * h - i; + if ((i & 0x01) !== 0) { + f = 1 - f; + } + var n = wh + f * (v - wh); // Linear interpolation + + var r; + var g; + var b; + /* eslint-disable max-statements-per-line,no-multi-spaces */ + switch (i) { + default: + case 6: + case 0: + r = v; + g = n; + b = wh; + break; + case 1: + r = n; + g = v; + b = wh; + break; + case 2: + r = wh; + g = v; + b = n; + break; + case 3: + r = wh; + g = n; + b = v; + break; + case 4: + r = n; + g = wh; + b = v; + break; + case 5: + r = v; + g = wh; + b = n; + break; + } + /* eslint-enable max-statements-per-line,no-multi-spaces */ + + return [r * 255, g * 255, b * 255]; + }; + convert.cmyk.rgb = function (cmyk) { + var c = cmyk[0] / 100; + var m = cmyk[1] / 100; + var y = cmyk[2] / 100; + var k = cmyk[3] / 100; + var r = 1 - Math.min(1, c * (1 - k) + k); + var g = 1 - Math.min(1, m * (1 - k) + k); + var b = 1 - Math.min(1, y * (1 - k) + k); + return [r * 255, g * 255, b * 255]; + }; + convert.xyz.rgb = function (xyz) { + var x = xyz[0] / 100; + var y = xyz[1] / 100; + var z = xyz[2] / 100; + var r; + var g; + var b; + r = x * 3.2406 + y * -1.5372 + z * -0.4986; + g = x * -0.9689 + y * 1.8758 + z * 0.0415; + b = x * 0.0557 + y * -0.2040 + z * 1.0570; + + // Assume sRGB + r = r > 0.0031308 ? 1.055 * r ** (1.0 / 2.4) - 0.055 : r * 12.92; + g = g > 0.0031308 ? 1.055 * g ** (1.0 / 2.4) - 0.055 : g * 12.92; + b = b > 0.0031308 ? 1.055 * b ** (1.0 / 2.4) - 0.055 : b * 12.92; + r = Math.min(Math.max(0, r), 1); + g = Math.min(Math.max(0, g), 1); + b = Math.min(Math.max(0, b), 1); + return [r * 255, g * 255, b * 255]; + }; + convert.xyz.lab = function (xyz) { + var x = xyz[0]; + var y = xyz[1]; + var z = xyz[2]; + x /= 95.047; + y /= 100; + z /= 108.883; + x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116; + y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116; + z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116; + var l = 116 * y - 16; + var a = 500 * (x - y); + var b = 200 * (y - z); + return [l, a, b]; + }; + convert.lab.xyz = function (lab) { + var l = lab[0]; + var a = lab[1]; + var b = lab[2]; + var x; + var y; + var z; + y = (l + 16) / 116; + x = a / 500 + y; + z = y - b / 200; + var y2 = y ** 3; + var x2 = x ** 3; + var z2 = z ** 3; + y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; + x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; + z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; + x *= 95.047; + y *= 100; + z *= 108.883; + return [x, y, z]; + }; + convert.lab.lch = function (lab) { + var l = lab[0]; + var a = lab[1]; + var b = lab[2]; + var h; + var hr = Math.atan2(b, a); + h = hr * 360 / 2 / Math.PI; + if (h < 0) { + h += 360; + } + var c = Math.sqrt(a * a + b * b); + return [l, c, h]; + }; + convert.lch.lab = function (lch) { + var l = lch[0]; + var c = lch[1]; + var h = lch[2]; + var hr = h / 360 * 2 * Math.PI; + var a = c * Math.cos(hr); + var b = c * Math.sin(hr); + return [l, a, b]; + }; + convert.rgb.ansi16 = function (args) { + var saturation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + var _args = _slicedToArray(args, 3), + r = _args[0], + g = _args[1], + b = _args[2]; + var value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization + + value = Math.round(value / 50); + if (value === 0) { + return 30; + } + var ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255)); + if (value === 2) { + ansi += 60; + } + return ansi; + }; + convert.hsv.ansi16 = function (args) { + // Optimization here; we already know the value and don't need to get + // it converted for us. + return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); + }; + convert.rgb.ansi256 = function (args) { + var r = args[0]; + var g = args[1]; + var b = args[2]; + + // We use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (r === g && g === b) { + if (r < 8) { + return 16; + } + if (r > 248) { + return 231; + } + return Math.round((r - 8) / 247 * 24) + 232; + } + var ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5); + return ansi; + }; + convert.ansi16.rgb = function (args) { + var color = args % 10; + + // Handle greyscale + if (color === 0 || color === 7) { + if (args > 50) { + color += 3.5; + } + color = color / 10.5 * 255; + return [color, color, color]; + } + var mult = (~~(args > 50) + 1) * 0.5; + var r = (color & 1) * mult * 255; + var g = (color >> 1 & 1) * mult * 255; + var b = (color >> 2 & 1) * mult * 255; + return [r, g, b]; + }; + convert.ansi256.rgb = function (args) { + // Handle greyscale + if (args >= 232) { + var c = (args - 232) * 10 + 8; + return [c, c, c]; + } + args -= 16; + var rem; + var r = Math.floor(args / 36) / 5 * 255; + var g = Math.floor((rem = args % 36) / 6) / 5 * 255; + var b = rem % 6 / 5 * 255; + return [r, g, b]; + }; + convert.rgb.hex = function (args) { + var integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF); + var string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; + }; + convert.hex.rgb = function (args) { + var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match) { + return [0, 0, 0]; + } + var colorString = match[0]; + if (match[0].length === 3) { + colorString = colorString.split('').map(function (char) { + return char + char; + }).join(''); + } + var integer = parseInt(colorString, 16); + var r = integer >> 16 & 0xFF; + var g = integer >> 8 & 0xFF; + var b = integer & 0xFF; + return [r, g, b]; + }; + convert.rgb.hcg = function (rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var max = Math.max(Math.max(r, g), b); + var min = Math.min(Math.min(r, g), b); + var chroma = max - min; + var grayscale; + var hue; + if (chroma < 1) { + grayscale = min / (1 - chroma); + } else { + grayscale = 0; + } + if (chroma <= 0) { + hue = 0; + } else if (max === r) { + hue = (g - b) / chroma % 6; + } else if (max === g) { + hue = 2 + (b - r) / chroma; + } else { + hue = 4 + (r - g) / chroma; + } + hue /= 6; + hue %= 1; + return [hue * 360, chroma * 100, grayscale * 100]; + }; + convert.hsl.hcg = function (hsl) { + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var c = l < 0.5 ? 2.0 * s * l : 2.0 * s * (1.0 - l); + var f = 0; + if (c < 1.0) { + f = (l - 0.5 * c) / (1.0 - c); + } + return [hsl[0], c * 100, f * 100]; + }; + convert.hsv.hcg = function (hsv) { + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var c = s * v; + var f = 0; + if (c < 1.0) { + f = (v - c) / (1 - c); + } + return [hsv[0], c * 100, f * 100]; + }; + convert.hcg.rgb = function (hcg) { + var h = hcg[0] / 360; + var c = hcg[1] / 100; + var g = hcg[2] / 100; + if (c === 0.0) { + return [g * 255, g * 255, g * 255]; + } + var pure = [0, 0, 0]; + var hi = h % 1 * 6; + var v = hi % 1; + var w = 1 - v; + var mg = 0; + + /* eslint-disable max-statements-per-line */ + switch (Math.floor(hi)) { + case 0: + pure[0] = 1; + pure[1] = v; + pure[2] = 0; + break; + case 1: + pure[0] = w; + pure[1] = 1; + pure[2] = 0; + break; + case 2: + pure[0] = 0; + pure[1] = 1; + pure[2] = v; + break; + case 3: + pure[0] = 0; + pure[1] = w; + pure[2] = 1; + break; + case 4: + pure[0] = v; + pure[1] = 0; + pure[2] = 1; + break; + default: + pure[0] = 1; + pure[1] = 0; + pure[2] = w; + } + /* eslint-enable max-statements-per-line */ + + mg = (1.0 - c) * g; + return [(c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255]; + }; + convert.hcg.hsv = function (hcg) { + var c = hcg[1] / 100; + var g = hcg[2] / 100; + var v = c + g * (1.0 - c); + var f = 0; + if (v > 0.0) { + f = c / v; + } + return [hcg[0], f * 100, v * 100]; + }; + convert.hcg.hsl = function (hcg) { + var c = hcg[1] / 100; + var g = hcg[2] / 100; + var l = g * (1.0 - c) + 0.5 * c; + var s = 0; + if (l > 0.0 && l < 0.5) { + s = c / (2 * l); + } else if (l >= 0.5 && l < 1.0) { + s = c / (2 * (1 - l)); + } + return [hcg[0], s * 100, l * 100]; + }; + convert.hcg.hwb = function (hcg) { + var c = hcg[1] / 100; + var g = hcg[2] / 100; + var v = c + g * (1.0 - c); + return [hcg[0], (v - c) * 100, (1 - v) * 100]; + }; + convert.hwb.hcg = function (hwb) { + var w = hwb[1] / 100; + var b = hwb[2] / 100; + var v = 1 - b; + var c = v - w; + var g = 0; + if (c < 1) { + g = (v - c) / (1 - c); + } + return [hwb[0], c * 100, g * 100]; + }; + convert.apple.rgb = function (apple) { + return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255]; + }; + convert.rgb.apple = function (rgb) { + return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535]; + }; + convert.gray.rgb = function (args) { + return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; + }; + convert.gray.hsl = function (args) { + return [0, 0, args[0]]; + }; + convert.gray.hsv = convert.gray.hsl; + convert.gray.hwb = function (gray) { + return [0, 100, gray[0]]; + }; + convert.gray.cmyk = function (gray) { + return [0, 0, 0, gray[0]]; + }; + convert.gray.lab = function (gray) { + return [gray[0], 0, 0]; + }; + convert.gray.hex = function (gray) { + var val = Math.round(gray[0] / 100 * 255) & 0xFF; + var integer = (val << 16) + (val << 8) + val; + var string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; + }; + convert.rgb.gray = function (rgb) { + var val = (rgb[0] + rgb[1] + rgb[2]) / 3; + return [val / 255 * 100]; + }; +},118,[7,119],"node_modules\\color-convert\\conversions.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] + }; +},119,[],"node_modules\\color-name\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /* + This function routes a model to all other models. + + all functions that are routed have a property `.conversion` attached + to the returned synthetic function. This property is an array + of strings, each with the steps in between the 'from' and 'to' + color models (inclusive). + + conversions that are not possible simply are not included. + */ + + function buildGraph() { + var graph = {}; + // https://jsperf.com/object-keys-vs-for-in-with-closure/3 + var models = Object.keys(_$$_REQUIRE(_dependencyMap[0], "./conversions")); + for (var len = models.length, i = 0; i < len; i++) { + graph[models[i]] = { + // http://jsperf.com/1-vs-infinity + // micro-opt, but this is simple. + distance: -1, + parent: null + }; + } + return graph; + } + + // https://en.wikipedia.org/wiki/Breadth-first_search + function deriveBFS(fromModel) { + var graph = buildGraph(); + var queue = [fromModel]; // Unshift -> queue -> pop + + graph[fromModel].distance = 0; + while (queue.length) { + var current = queue.pop(); + var adjacents = Object.keys(_$$_REQUIRE(_dependencyMap[0], "./conversions")[current]); + for (var len = adjacents.length, i = 0; i < len; i++) { + var adjacent = adjacents[i]; + var node = graph[adjacent]; + if (node.distance === -1) { + node.distance = graph[current].distance + 1; + node.parent = current; + queue.unshift(adjacent); + } + } + } + return graph; + } + function link(from, to) { + return function (args) { + return to(from(args)); + }; + } + function wrapConversion(toModel, graph) { + var path = [graph[toModel].parent, toModel]; + var fn = _$$_REQUIRE(_dependencyMap[0], "./conversions")[graph[toModel].parent][toModel]; + var cur = graph[toModel].parent; + while (graph[cur].parent) { + path.unshift(graph[cur].parent); + fn = link(_$$_REQUIRE(_dependencyMap[0], "./conversions")[graph[cur].parent][cur], fn); + cur = graph[cur].parent; + } + fn.conversion = path; + return fn; + } + module.exports = function (fromModel) { + var graph = deriveBFS(fromModel); + var conversion = {}; + var models = Object.keys(graph); + for (var len = models.length, i = 0; i < len; i++) { + var toModel = models[i]; + var node = graph[toModel]; + if (node.parent === null) { + // No possible conversion, or this node is the source model. + continue; + } + conversion[toModel] = wrapConversion(toModel, graph); + } + return conversion; + }; +},120,[118],"node_modules\\color-convert\\route.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = exports.test = exports.serialize = void 0; + var Symbol = global['jest-symbol-do-not-touch'] || global.Symbol; + var asymmetricMatcher = typeof Symbol === 'function' && Symbol.for ? Symbol.for('jest.asymmetricMatcher') : 0x1357a5; + var SPACE = ' '; + var serialize = function serialize(val, config, indentation, depth, refs, printer) { + var stringedValue = val.toString(); + if (stringedValue === 'ArrayContaining' || stringedValue === 'ArrayNotContaining') { + if (++depth > config.maxDepth) { + return '[' + stringedValue + ']'; + } + return stringedValue + SPACE + '[' + (0, _$$_REQUIRE(_dependencyMap[0], "../collections").printListItems)(val.sample, config, indentation, depth, refs, printer) + ']'; + } + if (stringedValue === 'ObjectContaining' || stringedValue === 'ObjectNotContaining') { + if (++depth > config.maxDepth) { + return '[' + stringedValue + ']'; + } + return stringedValue + SPACE + '{' + (0, _$$_REQUIRE(_dependencyMap[0], "../collections").printObjectProperties)(val.sample, config, indentation, depth, refs, printer) + '}'; + } + if (stringedValue === 'StringMatching' || stringedValue === 'StringNotMatching') { + return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs); + } + if (stringedValue === 'StringContaining' || stringedValue === 'StringNotContaining') { + return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs); + } + return val.toAsymmetricMatcher(); + }; + exports.serialize = serialize; + var test = function test(val) { + return val && val.$$typeof === asymmetricMatcher; + }; + exports.test = test; + var plugin = { + serialize: serialize, + test: test + }; + var _default = plugin; + exports.default = _default; +},121,[122],"node_modules\\react-native\\node_modules\\pretty-format\\build\\plugins\\AsymmetricMatcher.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.printIteratorEntries = printIteratorEntries; + exports.printIteratorValues = printIteratorValues; + exports.printListItems = printListItems; + exports.printObjectProperties = printObjectProperties; + + /** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + var getKeysOfEnumerableProperties = function getKeysOfEnumerableProperties(object) { + var keys = Object.keys(object).sort(); + if (Object.getOwnPropertySymbols) { + Object.getOwnPropertySymbols(object).forEach(function (symbol) { + if (Object.getOwnPropertyDescriptor(object, symbol).enumerable) { + keys.push(symbol); + } + }); + } + return keys; + }; + /** + * Return entries (for example, of a map) + * with spacing, indentation, and comma + * without surrounding punctuation (for example, braces) + */ + + function printIteratorEntries(iterator, config, indentation, depth, refs, printer) { + var separator = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : ': '; + var result = ''; + var current = iterator.next(); + if (!current.done) { + result += config.spacingOuter; + var indentationNext = indentation + config.indent; + while (!current.done) { + var name = printer(current.value[0], config, indentationNext, depth, refs); + var value = printer(current.value[1], config, indentationNext, depth, refs); + result += indentationNext + name + separator + value; + current = iterator.next(); + if (!current.done) { + result += ',' + config.spacingInner; + } else if (!config.min) { + result += ','; + } + } + result += config.spacingOuter + indentation; + } + return result; + } + /** + * Return values (for example, of a set) + * with spacing, indentation, and comma + * without surrounding punctuation (braces or brackets) + */ + + function printIteratorValues(iterator, config, indentation, depth, refs, printer) { + var result = ''; + var current = iterator.next(); + if (!current.done) { + result += config.spacingOuter; + var indentationNext = indentation + config.indent; + while (!current.done) { + result += indentationNext + printer(current.value, config, indentationNext, depth, refs); + current = iterator.next(); + if (!current.done) { + result += ',' + config.spacingInner; + } else if (!config.min) { + result += ','; + } + } + result += config.spacingOuter + indentation; + } + return result; + } + /** + * Return items (for example, of an array) + * with spacing, indentation, and comma + * without surrounding punctuation (for example, brackets) + **/ + + function printListItems(list, config, indentation, depth, refs, printer) { + var result = ''; + if (list.length) { + result += config.spacingOuter; + var indentationNext = indentation + config.indent; + for (var i = 0; i < list.length; i++) { + result += indentationNext + printer(list[i], config, indentationNext, depth, refs); + if (i < list.length - 1) { + result += ',' + config.spacingInner; + } else if (!config.min) { + result += ','; + } + } + result += config.spacingOuter + indentation; + } + return result; + } + /** + * Return properties of an object + * with spacing, indentation, and comma + * without surrounding punctuation (for example, braces) + */ + + function printObjectProperties(val, config, indentation, depth, refs, printer) { + var result = ''; + var keys = getKeysOfEnumerableProperties(val); + if (keys.length) { + result += config.spacingOuter; + var indentationNext = indentation + config.indent; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var name = printer(key, config, indentationNext, depth, refs); + var value = printer(val[key], config, indentationNext, depth, refs); + result += indentationNext + name + ': ' + value; + if (i < keys.length - 1) { + result += ',' + config.spacingInner; + } else if (!config.min) { + result += ','; + } + } + result += config.spacingOuter + indentation; + } + return result; + } +},122,[],"node_modules\\react-native\\node_modules\\pretty-format\\build\\collections.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = exports.serialize = exports.test = void 0; + var _ansiRegex = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[0], "ansi-regex")); + var _ansiStyles = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "ansi-styles")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + + /** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + var toHumanReadableAnsi = function toHumanReadableAnsi(text) { + return text.replace((0, _ansiRegex.default)(), function (match) { + switch (match) { + case _ansiStyles.default.red.close: + case _ansiStyles.default.green.close: + case _ansiStyles.default.cyan.close: + case _ansiStyles.default.gray.close: + case _ansiStyles.default.white.close: + case _ansiStyles.default.yellow.close: + case _ansiStyles.default.bgRed.close: + case _ansiStyles.default.bgGreen.close: + case _ansiStyles.default.bgYellow.close: + case _ansiStyles.default.inverse.close: + case _ansiStyles.default.dim.close: + case _ansiStyles.default.bold.close: + case _ansiStyles.default.reset.open: + case _ansiStyles.default.reset.close: + return ''; + case _ansiStyles.default.red.open: + return ''; + case _ansiStyles.default.green.open: + return ''; + case _ansiStyles.default.cyan.open: + return ''; + case _ansiStyles.default.gray.open: + return ''; + case _ansiStyles.default.white.open: + return ''; + case _ansiStyles.default.yellow.open: + return ''; + case _ansiStyles.default.bgRed.open: + return ''; + case _ansiStyles.default.bgGreen.open: + return ''; + case _ansiStyles.default.bgYellow.open: + return ''; + case _ansiStyles.default.inverse.open: + return ''; + case _ansiStyles.default.dim.open: + return ''; + case _ansiStyles.default.bold.open: + return ''; + default: + return ''; + } + }); + }; + var test = function test(val) { + return typeof val === 'string' && !!val.match((0, _ansiRegex.default)()); + }; + exports.test = test; + var serialize = function serialize(val, config, indentation, depth, refs, printer) { + return printer(toHumanReadableAnsi(val), config, indentation, depth, refs); + }; + exports.serialize = serialize; + var plugin = { + serialize: serialize, + test: test + }; + var _default = plugin; + exports.default = _default; +},123,[111,116],"node_modules\\react-native\\node_modules\\pretty-format\\build\\plugins\\ConvertAnsi.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = exports.serialize = exports.test = void 0; + /** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + /* eslint-disable local/ban-types-eventually */ + var SPACE = ' '; + var OBJECT_NAMES = ['DOMStringMap', 'NamedNodeMap']; + var ARRAY_REGEXP = /^(HTML\w*Collection|NodeList)$/; + var testName = function testName(name) { + return OBJECT_NAMES.indexOf(name) !== -1 || ARRAY_REGEXP.test(name); + }; + var test = function test(val) { + return val && val.constructor && !!val.constructor.name && testName(val.constructor.name); + }; + exports.test = test; + var isNamedNodeMap = function isNamedNodeMap(collection) { + return collection.constructor.name === 'NamedNodeMap'; + }; + var serialize = function serialize(collection, config, indentation, depth, refs, printer) { + var name = collection.constructor.name; + if (++depth > config.maxDepth) { + return '[' + name + ']'; + } + return (config.min ? '' : name + SPACE) + (OBJECT_NAMES.indexOf(name) !== -1 ? '{' + (0, _$$_REQUIRE(_dependencyMap[0], "../collections").printObjectProperties)(isNamedNodeMap(collection) ? Array.from(collection).reduce(function (props, attribute) { + props[attribute.name] = attribute.value; + return props; + }, {}) : Object.assign({}, collection), config, indentation, depth, refs, printer) + '}' : '[' + (0, _$$_REQUIRE(_dependencyMap[0], "../collections").printListItems)(Array.from(collection), config, indentation, depth, refs, printer) + ']'); + }; + exports.serialize = serialize; + var plugin = { + serialize: serialize, + test: test + }; + var _default = plugin; + exports.default = _default; +},124,[122],"node_modules\\react-native\\node_modules\\pretty-format\\build\\plugins\\DOMCollection.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = exports.serialize = exports.test = void 0; + /** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + var ELEMENT_NODE = 1; + var TEXT_NODE = 3; + var COMMENT_NODE = 8; + var FRAGMENT_NODE = 11; + var ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/; + var testNode = function testNode(val) { + var _val$hasAttribute; + var constructorName = val.constructor.name; + var nodeType = val.nodeType, + tagName = val.tagName; + var isCustomElement = typeof tagName === 'string' && tagName.includes('-') || ((_val$hasAttribute = val.hasAttribute) === null || _val$hasAttribute === void 0 ? void 0 : _val$hasAttribute.call(val, 'is')); + return nodeType === ELEMENT_NODE && (ELEMENT_REGEXP.test(constructorName) || isCustomElement) || nodeType === TEXT_NODE && constructorName === 'Text' || nodeType === COMMENT_NODE && constructorName === 'Comment' || nodeType === FRAGMENT_NODE && constructorName === 'DocumentFragment'; + }; + var test = function test(val) { + var _val$constructor; + return (val === null || val === void 0 ? void 0 : (_val$constructor = val.constructor) === null || _val$constructor === void 0 ? void 0 : _val$constructor.name) && testNode(val); + }; + exports.test = test; + function nodeIsText(node) { + return node.nodeType === TEXT_NODE; + } + function nodeIsComment(node) { + return node.nodeType === COMMENT_NODE; + } + function nodeIsFragment(node) { + return node.nodeType === FRAGMENT_NODE; + } + var serialize = function serialize(node, config, indentation, depth, refs, printer) { + if (nodeIsText(node)) { + return (0, _$$_REQUIRE(_dependencyMap[0], "./lib/markup").printText)(node.data, config); + } + if (nodeIsComment(node)) { + return (0, _$$_REQUIRE(_dependencyMap[0], "./lib/markup").printComment)(node.data, config); + } + var type = nodeIsFragment(node) ? `DocumentFragment` : node.tagName.toLowerCase(); + if (++depth > config.maxDepth) { + return (0, _$$_REQUIRE(_dependencyMap[0], "./lib/markup").printElementAsLeaf)(type, config); + } + return (0, _$$_REQUIRE(_dependencyMap[0], "./lib/markup").printElement)(type, (0, _$$_REQUIRE(_dependencyMap[0], "./lib/markup").printProps)(nodeIsFragment(node) ? [] : Array.from(node.attributes).map(function (attr) { + return attr.name; + }).sort(), nodeIsFragment(node) ? {} : Array.from(node.attributes).reduce(function (props, attribute) { + props[attribute.name] = attribute.value; + return props; + }, {}), config, indentation + config.indent, depth, refs, printer), (0, _$$_REQUIRE(_dependencyMap[0], "./lib/markup").printChildren)(Array.prototype.slice.call(node.childNodes || node.children), config, indentation + config.indent, depth, refs, printer), config, indentation); + }; + exports.serialize = serialize; + var plugin = { + serialize: serialize, + test: test + }; + var _default = plugin; + exports.default = _default; +},125,[126],"node_modules\\react-native\\node_modules\\pretty-format\\build\\plugins\\DOMElement.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.printElementAsLeaf = exports.printElement = exports.printComment = exports.printText = exports.printChildren = exports.printProps = void 0; + var _escapeHTML = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[0], "./escapeHTML")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + + /** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + // Return empty string if keys is empty. + var printProps = function printProps(keys, props, config, indentation, depth, refs, printer) { + var indentationNext = indentation + config.indent; + var colors = config.colors; + return keys.map(function (key) { + var value = props[key]; + var printed = printer(value, config, indentationNext, depth, refs); + if (typeof value !== 'string') { + if (printed.indexOf('\n') !== -1) { + printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation; + } + printed = '{' + printed + '}'; + } + return config.spacingInner + indentation + colors.prop.open + key + colors.prop.close + '=' + colors.value.open + printed + colors.value.close; + }).join(''); + }; // Return empty string if children is empty. + + exports.printProps = printProps; + var printChildren = function printChildren(children, config, indentation, depth, refs, printer) { + return children.map(function (child) { + return config.spacingOuter + indentation + (typeof child === 'string' ? printText(child, config) : printer(child, config, indentation, depth, refs)); + }).join(''); + }; + exports.printChildren = printChildren; + var printText = function printText(text, config) { + var contentColor = config.colors.content; + return contentColor.open + (0, _escapeHTML.default)(text) + contentColor.close; + }; + exports.printText = printText; + var printComment = function printComment(comment, config) { + var commentColor = config.colors.comment; + return commentColor.open + '' + commentColor.close; + }; // Separate the functions to format props, children, and element, + // so a plugin could override a particular function, if needed. + // Too bad, so sad: the traditional (but unnecessary) space + // in a self-closing tagColor requires a second test of printedProps. + + exports.printComment = printComment; + var printElement = function printElement(type, printedProps, printedChildren, config, indentation) { + var tagColor = config.colors.tag; + return tagColor.open + '<' + type + (printedProps && tagColor.close + printedProps + config.spacingOuter + indentation + tagColor.open) + (printedChildren ? '>' + tagColor.close + printedChildren + config.spacingOuter + indentation + tagColor.open + '' + tagColor.close; + }; + exports.printElement = printElement; + var printElementAsLeaf = function printElementAsLeaf(type, config) { + var tagColor = config.colors.tag; + return tagColor.open + '<' + type + tagColor.close + ' …' + tagColor.open + ' />' + tagColor.close; + }; + exports.printElementAsLeaf = printElementAsLeaf; +},126,[127],"node_modules\\react-native\\node_modules\\pretty-format\\build\\plugins\\lib\\markup.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = escapeHTML; + + /** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + function escapeHTML(str) { + return str.replace(//g, '>'); + } +},127,[],"node_modules\\react-native\\node_modules\\pretty-format\\build\\plugins\\lib\\escapeHTML.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = exports.test = exports.serialize = void 0; + /** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + // SENTINEL constants are from https://github.com/facebook/immutable-js + var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; + var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@'; + var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; + var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@'; + var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; + var IS_RECORD_SENTINEL = '@@__IMMUTABLE_RECORD__@@'; // immutable v4 + + var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@'; + var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@'; + var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@'; + var getImmutableName = function getImmutableName(name) { + return 'Immutable.' + name; + }; + var printAsLeaf = function printAsLeaf(name) { + return '[' + name + ']'; + }; + var SPACE = ' '; + var LAZY = '…'; // Seq is lazy if it calls a method like filter + + var printImmutableEntries = function printImmutableEntries(val, config, indentation, depth, refs, printer, type) { + return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + SPACE + '{' + (0, _$$_REQUIRE(_dependencyMap[0], "../collections").printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer) + '}'; + }; // Record has an entries method because it is a collection in immutable v3. + // Return an iterator for Immutable Record from version v3 or v4. + + function getRecordEntries(val) { + var i = 0; + return { + next: function next() { + if (i < val._keys.length) { + var key = val._keys[i++]; + return { + done: false, + value: [key, val.get(key)] + }; + } + return { + done: true, + value: undefined + }; + } + }; + } + var printImmutableRecord = function printImmutableRecord(val, config, indentation, depth, refs, printer) { + // _name property is defined only for an Immutable Record instance + // which was constructed with a second optional descriptive name arg + var name = getImmutableName(val._name || 'Record'); + return ++depth > config.maxDepth ? printAsLeaf(name) : name + SPACE + '{' + (0, _$$_REQUIRE(_dependencyMap[0], "../collections").printIteratorEntries)(getRecordEntries(val), config, indentation, depth, refs, printer) + '}'; + }; + var printImmutableSeq = function printImmutableSeq(val, config, indentation, depth, refs, printer) { + var name = getImmutableName('Seq'); + if (++depth > config.maxDepth) { + return printAsLeaf(name); + } + if (val[IS_KEYED_SENTINEL]) { + return name + SPACE + '{' + ( + // from Immutable collection of entries or from ECMAScript object + val._iter || val._object ? (0, _$$_REQUIRE(_dependencyMap[0], "../collections").printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer) : LAZY) + '}'; + } + return name + SPACE + '[' + (val._iter || + // from Immutable collection of values + val._array || + // from ECMAScript array + val._collection || + // from ECMAScript collection in immutable v4 + val._iterable // from ECMAScript collection in immutable v3 + ? (0, _$$_REQUIRE(_dependencyMap[0], "../collections").printIteratorValues)(val.values(), config, indentation, depth, refs, printer) : LAZY) + ']'; + }; + var printImmutableValues = function printImmutableValues(val, config, indentation, depth, refs, printer, type) { + return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + SPACE + '[' + (0, _$$_REQUIRE(_dependencyMap[0], "../collections").printIteratorValues)(val.values(), config, indentation, depth, refs, printer) + ']'; + }; + var serialize = function serialize(val, config, indentation, depth, refs, printer) { + if (val[IS_MAP_SENTINEL]) { + return printImmutableEntries(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? 'OrderedMap' : 'Map'); + } + if (val[IS_LIST_SENTINEL]) { + return printImmutableValues(val, config, indentation, depth, refs, printer, 'List'); + } + if (val[IS_SET_SENTINEL]) { + return printImmutableValues(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? 'OrderedSet' : 'Set'); + } + if (val[IS_STACK_SENTINEL]) { + return printImmutableValues(val, config, indentation, depth, refs, printer, 'Stack'); + } + if (val[IS_SEQ_SENTINEL]) { + return printImmutableSeq(val, config, indentation, depth, refs, printer); + } // For compatibility with immutable v3 and v4, let record be the default. + + return printImmutableRecord(val, config, indentation, depth, refs, printer); + }; // Explicitly comparing sentinel properties to true avoids false positive + // when mock identity-obj-proxy returns the key as the value for any key. + + exports.serialize = serialize; + var test = function test(val) { + return val && (val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true); + }; + exports.test = test; + var plugin = { + serialize: serialize, + test: test + }; + var _default = plugin; + exports.default = _default; +},128,[122],"node_modules\\react-native\\node_modules\\pretty-format\\build\\plugins\\Immutable.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = exports.test = exports.serialize = void 0; + var ReactIs = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "react-is")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || typeof obj !== 'object' && typeof obj !== 'function') { + return { + default: obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + + /** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + // Given element.props.children, or subtree during recursive traversal, + // return flattened array of children. + var _getChildren = function getChildren(arg) { + var children = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + if (Array.isArray(arg)) { + arg.forEach(function (item) { + _getChildren(item, children); + }); + } else if (arg != null && arg !== false) { + children.push(arg); + } + return children; + }; + var getType = function getType(element) { + var type = element.type; + if (typeof type === 'string') { + return type; + } + if (typeof type === 'function') { + return type.displayName || type.name || 'Unknown'; + } + if (ReactIs.isFragment(element)) { + return 'React.Fragment'; + } + if (ReactIs.isSuspense(element)) { + return 'React.Suspense'; + } + if (typeof type === 'object' && type !== null) { + if (ReactIs.isContextProvider(element)) { + return 'Context.Provider'; + } + if (ReactIs.isContextConsumer(element)) { + return 'Context.Consumer'; + } + if (ReactIs.isForwardRef(element)) { + if (type.displayName) { + return type.displayName; + } + var functionName = type.render.displayName || type.render.name || ''; + return functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef'; + } + if (ReactIs.isMemo(element)) { + var _functionName = type.displayName || type.type.displayName || type.type.name || ''; + return _functionName !== '' ? 'Memo(' + _functionName + ')' : 'Memo'; + } + } + return 'UNDEFINED'; + }; + var getPropKeys = function getPropKeys(element) { + var props = element.props; + return Object.keys(props).filter(function (key) { + return key !== 'children' && props[key] !== undefined; + }).sort(); + }; + var serialize = function serialize(element, config, indentation, depth, refs, printer) { + return ++depth > config.maxDepth ? (0, _$$_REQUIRE(_dependencyMap[1], "./lib/markup").printElementAsLeaf)(getType(element), config) : (0, _$$_REQUIRE(_dependencyMap[1], "./lib/markup").printElement)(getType(element), (0, _$$_REQUIRE(_dependencyMap[1], "./lib/markup").printProps)(getPropKeys(element), element.props, config, indentation + config.indent, depth, refs, printer), (0, _$$_REQUIRE(_dependencyMap[1], "./lib/markup").printChildren)(_getChildren(element.props.children), config, indentation + config.indent, depth, refs, printer), config, indentation); + }; + exports.serialize = serialize; + var test = function test(val) { + return val && ReactIs.isElement(val); + }; + exports.test = test; + var plugin = { + serialize: serialize, + test: test + }; + var _default = plugin; + exports.default = _default; +},129,[130,126],"node_modules\\react-native\\node_modules\\pretty-format\\build\\plugins\\ReactElement.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + if (process.env.NODE_ENV === 'production') { + module.exports = _$$_REQUIRE(_dependencyMap[0], "./cjs/react-is.production.min.js"); + } else { + module.exports = _$$_REQUIRE(_dependencyMap[1], "./cjs/react-is.development.js"); + } +},130,[131,132],"node_modules\\react-native\\node_modules\\react-is\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** @license React v17.0.2 + * react-is.production.min.js + * + * 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. + */ + 'use strict'; + + var b = 60103, + c = 60106, + d = 60107, + e = 60108, + f = 60114, + g = 60109, + h = 60110, + k = 60112, + l = 60113, + m = 60120, + n = 60115, + p = 60116, + q = 60121, + r = 60122, + u = 60117, + v = 60129, + w = 60131; + if ("function" === typeof Symbol && Symbol.for) { + var x = Symbol.for; + b = x("react.element"); + c = x("react.portal"); + d = x("react.fragment"); + e = x("react.strict_mode"); + f = x("react.profiler"); + g = x("react.provider"); + h = x("react.context"); + k = x("react.forward_ref"); + l = x("react.suspense"); + m = x("react.suspense_list"); + n = x("react.memo"); + p = x("react.lazy"); + q = x("react.block"); + r = x("react.server.block"); + u = x("react.fundamental"); + v = x("react.debug_trace_mode"); + w = x("react.legacy_hidden"); + } + function y(a) { + if ("object" === typeof a && null !== a) { + var t = a.$$typeof; + switch (t) { + case b: + switch (a = a.type, a) { + case d: + case f: + case e: + case l: + case m: + return a; + default: + switch (a = a && a.$$typeof, a) { + case h: + case k: + case p: + case n: + case g: + return a; + default: + return t; + } + } + case c: + return t; + } + } + } + var z = g, + A = b, + B = k, + C = d, + D = p, + E = n, + F = c, + G = f, + H = e, + I = l; + exports.ContextConsumer = h; + exports.ContextProvider = z; + exports.Element = A; + exports.ForwardRef = B; + exports.Fragment = C; + exports.Lazy = D; + exports.Memo = E; + exports.Portal = F; + exports.Profiler = G; + exports.StrictMode = H; + exports.Suspense = I; + exports.isAsyncMode = function () { + return !1; + }; + exports.isConcurrentMode = function () { + return !1; + }; + exports.isContextConsumer = function (a) { + return y(a) === h; + }; + exports.isContextProvider = function (a) { + return y(a) === g; + }; + exports.isElement = function (a) { + return "object" === typeof a && null !== a && a.$$typeof === b; + }; + exports.isForwardRef = function (a) { + return y(a) === k; + }; + exports.isFragment = function (a) { + return y(a) === d; + }; + exports.isLazy = function (a) { + return y(a) === p; + }; + exports.isMemo = function (a) { + return y(a) === n; + }; + exports.isPortal = function (a) { + return y(a) === c; + }; + exports.isProfiler = function (a) { + return y(a) === f; + }; + exports.isStrictMode = function (a) { + return y(a) === e; + }; + exports.isSuspense = function (a) { + return y(a) === l; + }; + exports.isValidElementType = function (a) { + return "string" === typeof a || "function" === typeof a || a === d || a === f || a === v || a === e || a === l || a === m || a === w || "object" === typeof a && null !== a && (a.$$typeof === p || a.$$typeof === n || a.$$typeof === g || a.$$typeof === h || a.$$typeof === k || a.$$typeof === u || a.$$typeof === q || a[0] === r) ? !0 : !1; + }; + exports.typeOf = y; +},131,[],"node_modules\\react-native\\node_modules\\react-is\\cjs\\react-is.production.min.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** @license React v17.0.2 + * react-is.development.js + * + * 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. + */ + + 'use strict'; + + if (process.env.NODE_ENV !== "production") { + (function () { + 'use strict'; + + // ATTENTION + // When adding new symbols to this file, + // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' + // The Symbol used to tag the ReactElement-like types. If there is no native Symbol + // nor polyfill, then a plain number is used for performance. + var REACT_ELEMENT_TYPE = 0xeac7; + var REACT_PORTAL_TYPE = 0xeaca; + var REACT_FRAGMENT_TYPE = 0xeacb; + var REACT_STRICT_MODE_TYPE = 0xeacc; + var REACT_PROFILER_TYPE = 0xead2; + var REACT_PROVIDER_TYPE = 0xeacd; + var REACT_CONTEXT_TYPE = 0xeace; + var REACT_FORWARD_REF_TYPE = 0xead0; + var REACT_SUSPENSE_TYPE = 0xead1; + var REACT_SUSPENSE_LIST_TYPE = 0xead8; + var REACT_MEMO_TYPE = 0xead3; + var REACT_LAZY_TYPE = 0xead4; + var REACT_BLOCK_TYPE = 0xead9; + var REACT_SERVER_BLOCK_TYPE = 0xeada; + var REACT_FUNDAMENTAL_TYPE = 0xead5; + var REACT_SCOPE_TYPE = 0xead7; + var REACT_OPAQUE_ID_TYPE = 0xeae0; + var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; + var REACT_OFFSCREEN_TYPE = 0xeae2; + var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; + if (typeof Symbol === 'function' && 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'); + REACT_BLOCK_TYPE = symbolFor('react.block'); + REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); + REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); + REACT_SCOPE_TYPE = symbolFor('react.scope'); + REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); + REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); + REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); + } + + // Filter certain DOM attributes (e.g. src, href) if their values are empty strings. + + var enableScopeAPI = false; // Experimental Create Event Handle API. + + function isValidElementType(type) { + if (typeof type === 'string' || typeof type === 'function') { + return true; + } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). + + if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI) { + return true; + } + if (typeof type === 'object' && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { + return true; + } + } + return false; + } + function typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + switch (type) { + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + case REACT_SUSPENSE_LIST_TYPE: + return type; + default: + var $$typeofType = type && type.$$typeof; + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + default: + return $$typeof; + } + } + case REACT_PORTAL_TYPE: + return $$typeof; + } + } + return undefined; + } + var ContextConsumer = REACT_CONTEXT_TYPE; + var ContextProvider = REACT_PROVIDER_TYPE; + var Element = REACT_ELEMENT_TYPE; + var ForwardRef = REACT_FORWARD_REF_TYPE; + var Fragment = REACT_FRAGMENT_TYPE; + var Lazy = REACT_LAZY_TYPE; + var Memo = REACT_MEMO_TYPE; + var Portal = REACT_PORTAL_TYPE; + var Profiler = REACT_PROFILER_TYPE; + var StrictMode = REACT_STRICT_MODE_TYPE; + var Suspense = REACT_SUSPENSE_TYPE; + var hasWarnedAboutDeprecatedIsAsyncMode = false; + var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated + + function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint + + console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.'); + } + } + return false; + } + function isConcurrentMode(object) { + { + if (!hasWarnedAboutDeprecatedIsConcurrentMode) { + hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint + + console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.'); + } + } + return false; + } + function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; + } + function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; + } + function isElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } + function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; + } + function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; + } + function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; + } + function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; + } + function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; + } + function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; + } + function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; + } + function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; + } + exports.ContextConsumer = ContextConsumer; + exports.ContextProvider = ContextProvider; + exports.Element = Element; + exports.ForwardRef = ForwardRef; + exports.Fragment = Fragment; + exports.Lazy = Lazy; + exports.Memo = Memo; + exports.Portal = Portal; + exports.Profiler = Profiler; + exports.StrictMode = StrictMode; + exports.Suspense = Suspense; + exports.isAsyncMode = isAsyncMode; + exports.isConcurrentMode = isConcurrentMode; + exports.isContextConsumer = isContextConsumer; + exports.isContextProvider = isContextProvider; + exports.isElement = isElement; + exports.isForwardRef = isForwardRef; + exports.isFragment = isFragment; + exports.isLazy = isLazy; + exports.isMemo = isMemo; + exports.isPortal = isPortal; + exports.isProfiler = isProfiler; + exports.isStrictMode = isStrictMode; + exports.isSuspense = isSuspense; + exports.isValidElementType = isValidElementType; + exports.typeOf = typeOf; + })(); + } +},132,[],"node_modules\\react-native\\node_modules\\react-is\\cjs\\react-is.development.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = exports.test = exports.serialize = void 0; + var Symbol = global['jest-symbol-do-not-touch'] || global.Symbol; + var testSymbol = typeof Symbol === 'function' && Symbol.for ? Symbol.for('react.test.json') : 0xea71357; + var getPropKeys = function getPropKeys(object) { + var props = object.props; + return props ? Object.keys(props).filter(function (key) { + return props[key] !== undefined; + }).sort() : []; + }; + var serialize = function serialize(object, config, indentation, depth, refs, printer) { + return ++depth > config.maxDepth ? (0, _$$_REQUIRE(_dependencyMap[0], "./lib/markup").printElementAsLeaf)(object.type, config) : (0, _$$_REQUIRE(_dependencyMap[0], "./lib/markup").printElement)(object.type, object.props ? (0, _$$_REQUIRE(_dependencyMap[0], "./lib/markup").printProps)(getPropKeys(object), object.props, config, indentation + config.indent, depth, refs, printer) : '', object.children ? (0, _$$_REQUIRE(_dependencyMap[0], "./lib/markup").printChildren)(object.children, config, indentation + config.indent, depth, refs, printer) : '', config, indentation); + }; + exports.serialize = serialize; + var test = function test(val) { + return val && val.$$typeof === testSymbol; + }; + exports.test = test; + var plugin = { + serialize: serialize, + test: test + }; + var _default = plugin; + exports.default = _default; +},133,[126],"node_modules\\react-native\\node_modules\\pretty-format\\build\\plugins\\ReactTestComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + /** + * Sets an object's property. If a property with the same name exists, this will + * replace it but maintain its descriptor configuration. The property will be + * replaced with a lazy getter. + * + * In DEV mode the original property value will be preserved as `original[PropertyName]` + * so that, if necessary, it can be restored. For example, if you want to route + * network requests through DevTools (to trace them): + * + * global.XMLHttpRequest = global.originalXMLHttpRequest; + * + * @see https://github.com/facebook/react-native/issues/934 + */ + function polyfillObjectProperty(object, name, getValue) { + var descriptor = Object.getOwnPropertyDescriptor(object, name); + if (__DEV__ && descriptor) { + var backupName = `original${name[0].toUpperCase()}${name.slice(1)}`; + Object.defineProperty(object, backupName, descriptor); + } + var _ref = descriptor || {}, + enumerable = _ref.enumerable, + writable = _ref.writable, + _ref$configurable = _ref.configurable, + configurable = _ref$configurable === void 0 ? false : _ref$configurable; + if (descriptor && !configurable) { + console.error('Failed to set polyfill. ' + name + ' is not configurable.'); + return; + } + _$$_REQUIRE(_dependencyMap[0], "./defineLazyObjectProperty")(object, name, { + get: getValue, + enumerable: enumerable !== false, + writable: writable !== false + }); + } + function polyfillGlobal(name, getValue) { + polyfillObjectProperty(global, name, getValue); + } + module.exports = { + polyfillObjectProperty: polyfillObjectProperty, + polyfillGlobal: polyfillGlobal + }; +},134,[49],"node_modules\\react-native\\Libraries\\Utilities\\PolyfillFunctions.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + _$$_REQUIRE(_dependencyMap[0], "promise/setimmediate/finally"); + if (__DEV__) { + _$$_REQUIRE(_dependencyMap[1], "promise/setimmediate/rejection-tracking").enable(_$$_REQUIRE(_dependencyMap[2], "./promiseRejectionTrackingOptions").default); + } + module.exports = _$$_REQUIRE(_dependencyMap[3], "promise/setimmediate/es6-extensions"); +},135,[136,138,114,139],"node_modules\\react-native\\Libraries\\Promise.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = _$$_REQUIRE(_dependencyMap[0], "./core.js"); + _$$_REQUIRE(_dependencyMap[0], "./core.js").prototype.finally = function (f) { + return this.then(function (value) { + return _$$_REQUIRE(_dependencyMap[0], "./core.js").resolve(f()).then(function () { + return value; + }); + }, function (err) { + return _$$_REQUIRE(_dependencyMap[0], "./core.js").resolve(f()).then(function () { + throw err; + }); + }); + }; +},136,[137],"node_modules\\promise\\setimmediate\\finally.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function noop() {} + + // States: + // + // 0 - pending + // 1 - fulfilled with _value + // 2 - rejected with _value + // 3 - adopted the state of another promise, _value + // + // once the state is no longer pending (0) it is immutable + + // All `_` prefixed properties will be reduced to `_{random number}` + // at build time to obfuscate them and discourage their use. + // We don't use symbols or Object.defineProperty to fully hide them + // because the performance isn't good enough. + + // to avoid using try/catch inside critical functions, we + // extract them to here. + var LAST_ERROR = null; + var IS_ERROR = {}; + function getThen(obj) { + try { + return obj.then; + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } + } + function tryCallOne(fn, a) { + try { + return fn(a); + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } + } + function tryCallTwo(fn, a, b) { + try { + fn(a, b); + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } + } + module.exports = Promise; + function Promise(fn) { + if (typeof this !== 'object') { + throw new TypeError('Promises must be constructed via new'); + } + if (typeof fn !== 'function') { + throw new TypeError('Promise constructor\'s argument is not a function'); + } + this._x = 0; + this._y = 0; + this._z = null; + this._A = null; + if (fn === noop) return; + doResolve(fn, this); + } + Promise._B = null; + Promise._C = null; + Promise._D = noop; + Promise.prototype.then = function (onFulfilled, onRejected) { + if (this.constructor !== Promise) { + return safeThen(this, onFulfilled, onRejected); + } + var res = new Promise(noop); + handle(this, new Handler(onFulfilled, onRejected, res)); + return res; + }; + function safeThen(self, onFulfilled, onRejected) { + return new self.constructor(function (resolve, reject) { + var res = new Promise(noop); + res.then(resolve, reject); + handle(self, new Handler(onFulfilled, onRejected, res)); + }); + } + function handle(self, deferred) { + while (self._y === 3) { + self = self._z; + } + if (Promise._B) { + Promise._B(self); + } + if (self._y === 0) { + if (self._x === 0) { + self._x = 1; + self._A = deferred; + return; + } + if (self._x === 1) { + self._x = 2; + self._A = [self._A, deferred]; + return; + } + self._A.push(deferred); + return; + } + handleResolved(self, deferred); + } + function handleResolved(self, deferred) { + setImmediate(function () { + var cb = self._y === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + if (self._y === 1) { + resolve(deferred.promise, self._z); + } else { + reject(deferred.promise, self._z); + } + return; + } + var ret = tryCallOne(cb, self._z); + if (ret === IS_ERROR) { + reject(deferred.promise, LAST_ERROR); + } else { + resolve(deferred.promise, ret); + } + }); + } + function resolve(self, newValue) { + // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure + if (newValue === self) { + return reject(self, new TypeError('A promise cannot be resolved with itself.')); + } + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = getThen(newValue); + if (then === IS_ERROR) { + return reject(self, LAST_ERROR); + } + if (then === self.then && newValue instanceof Promise) { + self._y = 3; + self._z = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(then.bind(newValue), self); + return; + } + } + self._y = 1; + self._z = newValue; + finale(self); + } + function reject(self, newValue) { + self._y = 2; + self._z = newValue; + if (Promise._C) { + Promise._C(self, newValue); + } + finale(self); + } + function finale(self) { + if (self._x === 1) { + handle(self, self._A); + self._A = null; + } + if (self._x === 2) { + for (var i = 0; i < self._A.length; i++) { + handle(self, self._A[i]); + } + self._A = null; + } + } + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + + /** + * Take a potentially misbehaving resolver function and make sure + * onFulfilled and onRejected are only called once. + * + * Makes no guarantees about asynchrony. + */ + function doResolve(fn, promise) { + var done = false; + var res = tryCallTwo(fn, function (value) { + if (done) return; + done = true; + resolve(promise, value); + }, function (reason) { + if (done) return; + done = true; + reject(promise, reason); + }); + if (!done && res === IS_ERROR) { + done = true; + reject(promise, LAST_ERROR); + } + } +},137,[],"node_modules\\promise\\setimmediate\\core.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var DEFAULT_WHITELIST = [ReferenceError, TypeError, RangeError]; + var enabled = false; + exports.disable = disable; + function disable() { + enabled = false; + _$$_REQUIRE(_dependencyMap[0], "./core")._B = null; + _$$_REQUIRE(_dependencyMap[0], "./core")._C = null; + } + exports.enable = enable; + function enable(options) { + options = options || {}; + if (enabled) disable(); + enabled = true; + var id = 0; + var displayId = 0; + var rejections = {}; + _$$_REQUIRE(_dependencyMap[0], "./core")._B = function (promise) { + if (promise._y === 2 && + // IS REJECTED + rejections[promise._E]) { + if (rejections[promise._E].logged) { + onHandled(promise._E); + } else { + clearTimeout(rejections[promise._E].timeout); + } + delete rejections[promise._E]; + } + }; + _$$_REQUIRE(_dependencyMap[0], "./core")._C = function (promise, err) { + if (promise._x === 0) { + // not yet handled + promise._E = id++; + rejections[promise._E] = { + displayId: null, + error: err, + timeout: setTimeout(onUnhandled.bind(null, promise._E), + // For reference errors and type errors, this almost always + // means the programmer made a mistake, so log them after just + // 100ms + // otherwise, wait 2 seconds to see if they get handled + matchWhitelist(err, DEFAULT_WHITELIST) ? 100 : 2000), + logged: false + }; + } + }; + function onUnhandled(id) { + if (options.allRejections || matchWhitelist(rejections[id].error, options.whitelist || DEFAULT_WHITELIST)) { + rejections[id].displayId = displayId++; + if (options.onUnhandled) { + rejections[id].logged = true; + options.onUnhandled(rejections[id].displayId, rejections[id].error); + } else { + rejections[id].logged = true; + logError(rejections[id].displayId, rejections[id].error); + } + } + } + function onHandled(id) { + if (rejections[id].logged) { + if (options.onHandled) { + options.onHandled(rejections[id].displayId, rejections[id].error); + } else if (!rejections[id].onUnhandled) { + console.warn('Promise Rejection Handled (id: ' + rejections[id].displayId + '):'); + console.warn(' This means you can ignore any previous messages of the form "Possible Unhandled Promise Rejection" with id ' + rejections[id].displayId + '.'); + } + } + } + } + function logError(id, error) { + console.warn('Possible Unhandled Promise Rejection (id: ' + id + '):'); + var errStr = (error && (error.stack || error)) + ''; + errStr.split('\n').forEach(function (line) { + console.warn(' ' + line); + }); + } + function matchWhitelist(error, list) { + return list.some(function (cls) { + return error instanceof cls; + }); + } +},138,[137],"node_modules\\promise\\setimmediate\\rejection-tracking.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + //This file contains the ES6 extensions to the core Promises/A+ API + module.exports = _$$_REQUIRE(_dependencyMap[0], "./core.js"); + + /* Static Functions */ + + var TRUE = valuePromise(true); + var FALSE = valuePromise(false); + var NULL = valuePromise(null); + var UNDEFINED = valuePromise(undefined); + var ZERO = valuePromise(0); + var EMPTYSTRING = valuePromise(''); + function valuePromise(value) { + var p = new (_$$_REQUIRE(_dependencyMap[0], "./core.js"))(_$$_REQUIRE(_dependencyMap[0], "./core.js")._D); + p._y = 1; + p._z = value; + return p; + } + _$$_REQUIRE(_dependencyMap[0], "./core.js").resolve = function (value) { + if (value instanceof _$$_REQUIRE(_dependencyMap[0], "./core.js")) return value; + if (value === null) return NULL; + if (value === undefined) return UNDEFINED; + if (value === true) return TRUE; + if (value === false) return FALSE; + if (value === 0) return ZERO; + if (value === '') return EMPTYSTRING; + if (typeof value === 'object' || typeof value === 'function') { + try { + var then = value.then; + if (typeof then === 'function') { + return new (_$$_REQUIRE(_dependencyMap[0], "./core.js"))(then.bind(value)); + } + } catch (ex) { + return new (_$$_REQUIRE(_dependencyMap[0], "./core.js"))(function (resolve, reject) { + reject(ex); + }); + } + } + return valuePromise(value); + }; + var _iterableToArray = function iterableToArray(iterable) { + if (typeof Array.from === 'function') { + // ES2015+, iterables exist + _iterableToArray = Array.from; + return Array.from(iterable); + } + + // ES5, only arrays and array-likes exist + _iterableToArray = function iterableToArray(x) { + return Array.prototype.slice.call(x); + }; + return Array.prototype.slice.call(iterable); + }; + _$$_REQUIRE(_dependencyMap[0], "./core.js").all = function (arr) { + var args = _iterableToArray(arr); + return new (_$$_REQUIRE(_dependencyMap[0], "./core.js"))(function (resolve, reject) { + if (args.length === 0) return resolve([]); + var remaining = args.length; + function res(i, val) { + if (val && (typeof val === 'object' || typeof val === 'function')) { + if (val instanceof _$$_REQUIRE(_dependencyMap[0], "./core.js") && val.then === _$$_REQUIRE(_dependencyMap[0], "./core.js").prototype.then) { + while (val._y === 3) { + val = val._z; + } + if (val._y === 1) return res(i, val._z); + if (val._y === 2) reject(val._z); + val.then(function (val) { + res(i, val); + }, reject); + return; + } else { + var then = val.then; + if (typeof then === 'function') { + var p = new (_$$_REQUIRE(_dependencyMap[0], "./core.js"))(then.bind(val)); + p.then(function (val) { + res(i, val); + }, reject); + return; + } + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + function onSettledFulfill(value) { + return { + status: 'fulfilled', + value: value + }; + } + function onSettledReject(reason) { + return { + status: 'rejected', + reason: reason + }; + } + function mapAllSettled(item) { + if (item && (typeof item === 'object' || typeof item === 'function')) { + if (item instanceof _$$_REQUIRE(_dependencyMap[0], "./core.js") && item.then === _$$_REQUIRE(_dependencyMap[0], "./core.js").prototype.then) { + return item.then(onSettledFulfill, onSettledReject); + } + var then = item.then; + if (typeof then === 'function') { + return new (_$$_REQUIRE(_dependencyMap[0], "./core.js"))(then.bind(item)).then(onSettledFulfill, onSettledReject); + } + } + return onSettledFulfill(item); + } + _$$_REQUIRE(_dependencyMap[0], "./core.js").allSettled = function (iterable) { + return _$$_REQUIRE(_dependencyMap[0], "./core.js").all(_iterableToArray(iterable).map(mapAllSettled)); + }; + _$$_REQUIRE(_dependencyMap[0], "./core.js").reject = function (value) { + return new (_$$_REQUIRE(_dependencyMap[0], "./core.js"))(function (resolve, reject) { + reject(value); + }); + }; + _$$_REQUIRE(_dependencyMap[0], "./core.js").race = function (values) { + return new (_$$_REQUIRE(_dependencyMap[0], "./core.js"))(function (resolve, reject) { + _iterableToArray(values).forEach(function (value) { + _$$_REQUIRE(_dependencyMap[0], "./core.js").resolve(value).then(resolve, reject); + }); + }); + }; + + /* Prototype Methods */ + + _$$_REQUIRE(_dependencyMap[0], "./core.js").prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + function getAggregateError(errors) { + if (typeof AggregateError === 'function') { + return new AggregateError(errors, 'All promises were rejected'); + } + var error = new Error('All promises were rejected'); + error.name = 'AggregateError'; + error.errors = errors; + return error; + } + _$$_REQUIRE(_dependencyMap[0], "./core.js").any = function promiseAny(values) { + return new (_$$_REQUIRE(_dependencyMap[0], "./core.js"))(function (resolve, reject) { + var promises = _iterableToArray(values); + var hasResolved = false; + var rejectionReasons = []; + function resolveOnce(value) { + if (!hasResolved) { + hasResolved = true; + resolve(value); + } + } + function rejectionCheck(reason) { + rejectionReasons.push(reason); + if (rejectionReasons.length === promises.length) { + reject(getAggregateError(rejectionReasons)); + } + } + if (promises.length === 0) { + reject(getAggregateError(rejectionReasons)); + } else { + promises.forEach(function (value) { + _$$_REQUIRE(_dependencyMap[0], "./core.js").resolve(value).then(resolveOnce, rejectionCheck); + }); + } + }); + }; +},139,[137],"node_modules\\promise\\setimmediate\\es6-extensions.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + /** + * Set up regenerator. + * You can use this module directly, or just require InitializeCore. + */ + + var hasNativeGenerator; + try { + // If this function was lowered by regenerator-transform, it will try to + // access `global.regeneratorRuntime` which doesn't exist yet and will throw. + hasNativeGenerator = _$$_REQUIRE(_dependencyMap[0], "../Utilities/FeatureDetection").hasNativeConstructor(function* () {}, 'GeneratorFunction'); + } catch (_unused) { + // In this case, we know generators are not provided natively. + hasNativeGenerator = false; + } + + // If generators are provided natively, which suggests that there was no + // regenerator-transform, then there is no need to set up the runtime. + if (!hasNativeGenerator) { + _$$_REQUIRE(_dependencyMap[1], "../Utilities/PolyfillFunctions").polyfillGlobal('regeneratorRuntime', function () { + // The require just sets up the global, so make sure when we first + // invoke it the global does not exist + delete global.regeneratorRuntime; + + // regenerator-runtime/runtime exports the regeneratorRuntime object, so we + // can return it safely. + return _$$_REQUIRE(_dependencyMap[2], "regenerator-runtime/runtime"); // flowlint-line untyped-import:off + }); + } +},140,[141,134,142],"node_modules\\react-native\\Libraries\\Core\\setUpRegeneratorRuntime.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /** + * @return whether or not a @param {function} f is provided natively by calling + * `toString` and check if the result includes `[native code]` in it. + * + * Note that a polyfill can technically fake this behavior but few does it. + * Therefore, this is usually good enough for our purpose. + */ + function isNativeFunction(f) { + return typeof f === 'function' && f.toString().indexOf('[native code]') > -1; + } + + /** + * @return whether or not the constructor of @param {object} o is an native + * function named with @param {string} expectedName. + */ + function hasNativeConstructor(o, expectedName) { + var con = Object.getPrototypeOf(o).constructor; + return con.name === expectedName && isNativeFunction(con); + } + module.exports = { + isNativeFunction: isNativeFunction, + hasNativeConstructor: hasNativeConstructor + }; +},141,[],"node_modules\\react-native\\Libraries\\Utilities\\FeatureDetection.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + var runtime = function (exports) { + "use strict"; + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var defineProperty = Object.defineProperty || function (obj, key, desc) { + obj[key] = desc.value; + }; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + function define(obj, key, value) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + return obj[key]; + } + try { + // IE 8 has a broken Object.defineProperty that only works on DOM objects. + define({}, ""); + } catch (err) { + define = function define(obj, key, value) { + return obj[key] = value; + }; + } + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + defineProperty(generator, "_invoke", { + value: makeInvokeMethod(innerFn, self, context) + }); + return generator; + } + exports.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { + type: "normal", + arg: fn.call(obj, arg) + }; + } catch (err) { + return { + type: "throw", + arg: err + }; + } + } + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + define(IteratorPrototype, iteratorSymbol, function () { + return this; + }); + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = GeneratorFunctionPrototype; + defineProperty(Gp, "constructor", { + value: GeneratorFunctionPrototype, + configurable: true + }); + defineProperty(GeneratorFunctionPrototype, "constructor", { + value: GeneratorFunction, + configurable: true + }); + GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function (method) { + define(prototype, method, function (arg) { + return this._invoke(method, arg); + }); + }); + } + exports.isGeneratorFunction = function (genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" : false; + }; + exports.mark = function (genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + define(genFun, toStringTagSymbol, "GeneratorFunction"); + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + exports.awrap = function (arg) { + return { + __await: arg + }; + }; + function AsyncIterator(generator, PromiseImpl) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && typeof value === "object" && hasOwn.call(value, "__await")) { + return PromiseImpl.resolve(value.__await).then(function (value) { + invoke("next", value, resolve, reject); + }, function (err) { + invoke("throw", err, resolve, reject); + }); + } + return PromiseImpl.resolve(value).then(function (unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. + result.value = unwrapped; + resolve(result); + }, function (error) { + // If a rejected Promise was yielded, throw the rejection back + // into the async generator function so it can be handled there. + return invoke("throw", error, resolve, reject); + }); + } + } + var previousPromise; + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new PromiseImpl(function (resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + defineProperty(this, "_invoke", { + value: enqueue + }); + } + defineIteratorMethods(AsyncIterator.prototype); + define(AsyncIterator.prototype, asyncIteratorSymbol, function () { + return this; + }); + exports.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { + if (PromiseImpl === void 0) PromiseImpl = Promise; + var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); + return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function (result) { + return result.done ? result.value : iter.next(); + }); + }; + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + context.method = method; + context.arg = arg; + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + context.dispatchException(context.arg); + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + state = GenStateExecuting; + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done ? GenStateCompleted : GenStateSuspendedYield; + if (record.arg === ContinueSentinel) { + continue; + } + return { + value: record.arg, + done: context.done + }; + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var methodName = context.method; + var method = delegate.iterator[methodName]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method, or a missing .next mehtod, always terminate the + // yield* loop. + context.delegate = null; + + // Note: ["return"] must be used for ES3 parsing compatibility. + if (methodName === "throw" && delegate.iterator["return"]) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + if (methodName !== "return") { + context.method = "throw"; + context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method"); + } + return ContinueSentinel; + } + var record = tryCatch(method, delegate.iterator, context.arg); + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + var info = record.arg; + if (!info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } + } else { + // Re-yield the result returned by the delegate method. + return info; + } + + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + define(Gp, toStringTagSymbol, "Generator"); + + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + define(Gp, iteratorSymbol, function () { + return this; + }); + define(Gp, "toString", function () { + return "[object Generator]"; + }); + function pushTryEntry(locs) { + var entry = { + tryLoc: locs[0] + }; + if (1 in locs) { + entry.catchLoc = locs[1]; + } + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + this.tryEntries.push(entry); + } + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ + tryLoc: "root" + }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + exports.keys = function (val) { + var object = Object(val); + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + if (typeof iterable.next === "function") { + return iterable; + } + if (!isNaN(iterable.length)) { + var i = -1, + next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + next.value = undefined; + next.done = true; + return next; + }; + return next.next = next; + } + } + + // Return an iterator with no values. + return { + next: doneResult + }; + } + exports.values = values; + function doneResult() { + return { + value: undefined, + done: true + }; + } + Context.prototype = { + constructor: Context, + reset: function reset(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + this.method = "next"; + this.arg = undefined; + this.tryEntries.forEach(resetTryEntry); + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + stop: function stop() { + this.done = true; + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + return this.rval; + }, + dispatchException: function dispatchException(exception) { + if (this.done) { + throw exception; + } + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } + return !!caught; + } + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + abrupt: function abrupt(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + return this.complete(record); + }, + complete: function complete(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + if (record.type === "break" || record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + return ContinueSentinel; + }, + finish: function finish(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + "catch": function _catch(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + delegateYield: function delegateYield(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + return ContinueSentinel; + } + }; + + // Regardless of whether this script is executing as a CommonJS module + // or not, return the runtime object so that we can declare the variable + // regeneratorRuntime in the outer scope, which allows this module to be + // injected easily by `bin/regenerator --include-runtime script.js`. + return exports; + }( + // If this script is executing as a CommonJS module, use module.exports + // as the regeneratorRuntime namespace. Otherwise create a new empty + // object. Either way, the resulting object will be used to initialize + // the regeneratorRuntime variable at the top of this file. + typeof module === "object" ? module.exports : {}); + try { + regeneratorRuntime = runtime; + } catch (accidentalStrictMode) { + // This module should not be running in strict mode, so the above + // assignment should always work unless something is misconfigured. Just + // in case runtime.js accidentally runs in strict mode, in modern engines + // we can explicitly access globalThis. In older engines we can escape + // strict mode using a global Function call. This could conceivably fail + // if a Content Security Policy forbids using Function, but in that case + // the proper solution is to fix the accidental strict mode problem. If + // you've misconfigured your bundler to force strict mode and applied a + // CSP to forbid Function, and you're not willing to fix either of those + // problems, please detail your unique predicament in a GitHub issue. + if (typeof globalThis === "object") { + globalThis.regeneratorRuntime = runtime; + } else { + Function("r", "regeneratorRuntime = r")(runtime); + } + } +},142,[],"node_modules\\react-native\\node_modules\\regenerator-runtime\\runtime.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _global$HermesInterna, _global$HermesInterna2; + if (__DEV__) { + if (typeof global.Promise !== 'function') { + console.error('Promise should exist before setting up timers.'); + } + } + + // Currently, Hermes `Promise` is implemented via Internal Bytecode. + var hasHermesPromiseQueuedToJSVM = ((_global$HermesInterna = global.HermesInternal) == null ? void 0 : _global$HermesInterna.hasPromise == null ? void 0 : _global$HermesInterna.hasPromise()) === true && ((_global$HermesInterna2 = global.HermesInternal) == null ? void 0 : _global$HermesInterna2.useEngineQueue == null ? void 0 : _global$HermesInterna2.useEngineQueue()) === true; + var hasNativePromise = _$$_REQUIRE(_dependencyMap[0], "../Utilities/FeatureDetection").isNativeFunction(Promise); + var hasPromiseQueuedToJSVM = hasNativePromise || hasHermesPromiseQueuedToJSVM; + + // In bridgeless mode, timers are host functions installed from cpp. + if (global.RN$Bridgeless !== true) { + /** + * Set up timers. + * You can use this module directly, or just require InitializeCore. + */ + var defineLazyTimer = function defineLazyTimer(name) { + _$$_REQUIRE(_dependencyMap[1], "../Utilities/PolyfillFunctions").polyfillGlobal(name, function () { + return _$$_REQUIRE(_dependencyMap[2], "./Timers/JSTimers")[name]; + }); + }; + defineLazyTimer('setTimeout'); + defineLazyTimer('clearTimeout'); + defineLazyTimer('setInterval'); + defineLazyTimer('clearInterval'); + defineLazyTimer('requestAnimationFrame'); + defineLazyTimer('cancelAnimationFrame'); + defineLazyTimer('requestIdleCallback'); + defineLazyTimer('cancelIdleCallback'); + } + + /** + * Set up immediate APIs, which is required to use the same microtask queue + * as the Promise. + */ + if (hasPromiseQueuedToJSVM) { + // When promise queues to the JSVM microtasks queue, we shim the immediate + // APIs via `queueMicrotask` to maintain the backward compatibility. + _$$_REQUIRE(_dependencyMap[1], "../Utilities/PolyfillFunctions").polyfillGlobal('setImmediate', function () { + return _$$_REQUIRE(_dependencyMap[3], "./Timers/immediateShim").setImmediate; + }); + _$$_REQUIRE(_dependencyMap[1], "../Utilities/PolyfillFunctions").polyfillGlobal('clearImmediate', function () { + return _$$_REQUIRE(_dependencyMap[3], "./Timers/immediateShim").clearImmediate; + }); + } else { + // When promise was polyfilled hence is queued to the RN microtask queue, + // we polyfill the immediate APIs as aliases to the ReactNativeMicrotask APIs. + // Note that in bridgeless mode, immediate APIs are installed from cpp. + if (global.RN$Bridgeless !== true) { + _$$_REQUIRE(_dependencyMap[1], "../Utilities/PolyfillFunctions").polyfillGlobal('setImmediate', function () { + return _$$_REQUIRE(_dependencyMap[2], "./Timers/JSTimers").queueReactNativeMicrotask; + }); + _$$_REQUIRE(_dependencyMap[1], "../Utilities/PolyfillFunctions").polyfillGlobal('clearImmediate', function () { + return _$$_REQUIRE(_dependencyMap[2], "./Timers/JSTimers").clearReactNativeMicrotask; + }); + } + } + + /** + * Set up the microtask queueing API, which is required to use the same + * microtask queue as the Promise. + */ + if (hasHermesPromiseQueuedToJSVM) { + // Fast path for Hermes. + _$$_REQUIRE(_dependencyMap[1], "../Utilities/PolyfillFunctions").polyfillGlobal('queueMicrotask', function () { + var _global$HermesInterna3; + return (_global$HermesInterna3 = global.HermesInternal) == null ? void 0 : _global$HermesInterna3.enqueueJob; + }); + } else { + // Polyfill it with promise (regardless it's polyfilled or native) otherwise. + _$$_REQUIRE(_dependencyMap[1], "../Utilities/PolyfillFunctions").polyfillGlobal('queueMicrotask', function () { + return _$$_REQUIRE(_dependencyMap[4], "./Timers/queueMicrotask.js").default; + }); + } +},143,[141,134,144,146,147],"node_modules\\react-native\\Libraries\\Core\\setUpTimers.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _NativeTiming = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./NativeTiming")); /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + /** + * JS implementation of timer functions. Must be completely driven by an + * external clock signal, all that's stored here is timerID, timer type, and + * callback. + */ + + // These timing constants should be kept in sync with the ones in native ios and + // android `RCTTiming` module. + var FRAME_DURATION = 1000 / 60; + var IDLE_CALLBACK_FRAME_DEADLINE = 1; + + // Parallel arrays + var callbacks = []; + var types = []; + var timerIDs = []; + var reactNativeMicrotasks = []; + var requestIdleCallbacks = []; + var requestIdleCallbackTimeouts = {}; + var GUID = 1; + var errors = []; + var hasEmittedTimeDriftWarning = false; + + // Returns a free index if one is available, and the next consecutive index otherwise. + function _getFreeIndex() { + var freeIndex = timerIDs.indexOf(null); + if (freeIndex === -1) { + freeIndex = timerIDs.length; + } + return freeIndex; + } + function _allocateCallback(func, type) { + var id = GUID++; + var freeIndex = _getFreeIndex(); + timerIDs[freeIndex] = id; + callbacks[freeIndex] = func; + types[freeIndex] = type; + return id; + } + + /** + * Calls the callback associated with the ID. Also unregister that callback + * if it was a one time timer (setTimeout), and not unregister it if it was + * recurring (setInterval). + */ + function _callTimer(timerID, frameTime, didTimeout) { + if (timerID > GUID) { + console.warn('Tried to call timer with ID %s but no such timer exists.', timerID); + } + + // timerIndex of -1 means that no timer with that ID exists. There are + // two situations when this happens, when a garbage timer ID was given + // and when a previously existing timer was deleted before this callback + // fired. In both cases we want to ignore the timer id, but in the former + // case we warn as well. + var timerIndex = timerIDs.indexOf(timerID); + if (timerIndex === -1) { + return; + } + var type = types[timerIndex]; + var callback = callbacks[timerIndex]; + if (!callback || !type) { + console.error('No callback found for timerID ' + timerID); + return; + } + if (__DEV__) { + _$$_REQUIRE(_dependencyMap[2], "../../Performance/Systrace").beginEvent(type + ' [invoke]'); + } + + // Clear the metadata + if (type !== 'setInterval') { + _clearIndex(timerIndex); + } + try { + if (type === 'setTimeout' || type === 'setInterval' || type === 'queueReactNativeMicrotask') { + callback(); + } else if (type === 'requestAnimationFrame') { + callback(global.performance.now()); + } else if (type === 'requestIdleCallback') { + callback({ + timeRemaining: function timeRemaining() { + // TODO: Optimisation: allow running for longer than one frame if + // there are no pending JS calls on the bridge from native. This + // would require a way to check the bridge queue synchronously. + return Math.max(0, FRAME_DURATION - (global.performance.now() - frameTime)); + }, + didTimeout: !!didTimeout + }); + } else { + console.error('Tried to call a callback with invalid type: ' + type); + } + } catch (e) { + // Don't rethrow so that we can run all timers. + errors.push(e); + } + if (__DEV__) { + _$$_REQUIRE(_dependencyMap[2], "../../Performance/Systrace").endEvent(); + } + } + + /** + * Performs a single pass over the enqueued reactNativeMicrotasks. Returns whether + * more reactNativeMicrotasks are queued up (can be used as a condition a while loop). + */ + function _callReactNativeMicrotasksPass() { + if (reactNativeMicrotasks.length === 0) { + return false; + } + if (__DEV__) { + _$$_REQUIRE(_dependencyMap[2], "../../Performance/Systrace").beginEvent('callReactNativeMicrotasksPass()'); + } + + // The main reason to extract a single pass is so that we can track + // in the system trace + var passReactNativeMicrotasks = reactNativeMicrotasks; + reactNativeMicrotasks = []; + + // Use for loop rather than forEach as per @vjeux's advice + // https://github.com/facebook/react-native/commit/c8fd9f7588ad02d2293cac7224715f4af7b0f352#commitcomment-14570051 + for (var i = 0; i < passReactNativeMicrotasks.length; ++i) { + _callTimer(passReactNativeMicrotasks[i], 0); + } + if (__DEV__) { + _$$_REQUIRE(_dependencyMap[2], "../../Performance/Systrace").endEvent(); + } + return reactNativeMicrotasks.length > 0; + } + function _clearIndex(i) { + timerIDs[i] = null; + callbacks[i] = null; + types[i] = null; + } + function _freeCallback(timerID) { + // timerIDs contains nulls after timers have been removed; + // ignore nulls upfront so indexOf doesn't find them + if (timerID == null) { + return; + } + var index = timerIDs.indexOf(timerID); + // See corresponding comment in `callTimers` for reasoning behind this + if (index !== -1) { + var type = types[index]; + _clearIndex(index); + if (type !== 'queueReactNativeMicrotask' && type !== 'requestIdleCallback') { + deleteTimer(timerID); + } + } + } + + /** + * JS implementation of timer functions. Must be completely driven by an + * external clock signal, all that's stored here is timerID, timer type, and + * callback. + */ + var JSTimers = { + /** + * @param {function} func Callback to be invoked after `duration` ms. + * @param {number} duration Number of milliseconds. + */ + setTimeout: function setTimeout(func, duration) { + for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + var id = _allocateCallback(function () { + return func.apply(undefined, args); + }, 'setTimeout'); + createTimer(id, duration || 0, Date.now(), /* recurring */false); + return id; + }, + /** + * @param {function} func Callback to be invoked every `duration` ms. + * @param {number} duration Number of milliseconds. + */ + setInterval: function setInterval(func, duration) { + for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + var id = _allocateCallback(function () { + return func.apply(undefined, args); + }, 'setInterval'); + createTimer(id, duration || 0, Date.now(), /* recurring */true); + return id; + }, + /** + * The React Native microtask mechanism is used to back public APIs e.g. + * `queueMicrotask`, `clearImmediate`, and `setImmediate` (which is used by + * the Promise polyfill) when the JSVM microtask mechanism is not used. + * + * @param {function} func Callback to be invoked before the end of the + * current JavaScript execution loop. + */ + queueReactNativeMicrotask: function queueReactNativeMicrotask(func) { + for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + args[_key3 - 1] = arguments[_key3]; + } + var id = _allocateCallback(function () { + return func.apply(undefined, args); + }, 'queueReactNativeMicrotask'); + reactNativeMicrotasks.push(id); + return id; + }, + /** + * @param {function} func Callback to be invoked every frame. + */ + requestAnimationFrame: function requestAnimationFrame(func) { + var id = _allocateCallback(func, 'requestAnimationFrame'); + createTimer(id, 1, Date.now(), /* recurring */false); + return id; + }, + /** + * @param {function} func Callback to be invoked every frame and provided + * with time remaining in frame. + * @param {?object} options + */ + requestIdleCallback: function requestIdleCallback(func, options) { + if (requestIdleCallbacks.length === 0) { + setSendIdleEvents(true); + } + var timeout = options && options.timeout; + var id = _allocateCallback(timeout != null ? function (deadline) { + var timeoutId = requestIdleCallbackTimeouts[id]; + if (timeoutId) { + JSTimers.clearTimeout(timeoutId); + delete requestIdleCallbackTimeouts[id]; + } + return func(deadline); + } : func, 'requestIdleCallback'); + requestIdleCallbacks.push(id); + if (timeout != null) { + var timeoutId = JSTimers.setTimeout(function () { + var index = requestIdleCallbacks.indexOf(id); + if (index > -1) { + requestIdleCallbacks.splice(index, 1); + _callTimer(id, global.performance.now(), true); + } + delete requestIdleCallbackTimeouts[id]; + if (requestIdleCallbacks.length === 0) { + setSendIdleEvents(false); + } + }, timeout); + requestIdleCallbackTimeouts[id] = timeoutId; + } + return id; + }, + cancelIdleCallback: function cancelIdleCallback(timerID) { + _freeCallback(timerID); + var index = requestIdleCallbacks.indexOf(timerID); + if (index !== -1) { + requestIdleCallbacks.splice(index, 1); + } + var timeoutId = requestIdleCallbackTimeouts[timerID]; + if (timeoutId) { + JSTimers.clearTimeout(timeoutId); + delete requestIdleCallbackTimeouts[timerID]; + } + if (requestIdleCallbacks.length === 0) { + setSendIdleEvents(false); + } + }, + clearTimeout: function clearTimeout(timerID) { + _freeCallback(timerID); + }, + clearInterval: function clearInterval(timerID) { + _freeCallback(timerID); + }, + clearReactNativeMicrotask: function clearReactNativeMicrotask(timerID) { + _freeCallback(timerID); + var index = reactNativeMicrotasks.indexOf(timerID); + if (index !== -1) { + reactNativeMicrotasks.splice(index, 1); + } + }, + cancelAnimationFrame: function cancelAnimationFrame(timerID) { + _freeCallback(timerID); + }, + /** + * This is called from the native side. We are passed an array of timerIDs, + * and + */ + callTimers: function callTimers(timersToCall) { + _$$_REQUIRE(_dependencyMap[3], "invariant")(timersToCall.length !== 0, 'Cannot call `callTimers` with an empty list of IDs.'); + errors.length = 0; + for (var i = 0; i < timersToCall.length; i++) { + _callTimer(timersToCall[i], 0); + } + var errorCount = errors.length; + if (errorCount > 0) { + if (errorCount > 1) { + // Throw all the other errors in a setTimeout, which will throw each + // error one at a time + for (var ii = 1; ii < errorCount; ii++) { + JSTimers.setTimeout(function (error) { + throw error; + }.bind(null, errors[ii]), 0); + } + } + throw errors[0]; + } + }, + callIdleCallbacks: function callIdleCallbacks(frameTime) { + if (FRAME_DURATION - (Date.now() - frameTime) < IDLE_CALLBACK_FRAME_DEADLINE) { + return; + } + errors.length = 0; + if (requestIdleCallbacks.length > 0) { + var passIdleCallbacks = requestIdleCallbacks; + requestIdleCallbacks = []; + for (var i = 0; i < passIdleCallbacks.length; ++i) { + _callTimer(passIdleCallbacks[i], frameTime); + } + } + if (requestIdleCallbacks.length === 0) { + setSendIdleEvents(false); + } + errors.forEach(function (error) { + return JSTimers.setTimeout(function () { + throw error; + }, 0); + }); + }, + /** + * This is called after we execute any command we receive from native but + * before we hand control back to native. + */ + callReactNativeMicrotasks: function callReactNativeMicrotasks() { + errors.length = 0; + while (_callReactNativeMicrotasksPass()) {} + errors.forEach(function (error) { + return JSTimers.setTimeout(function () { + throw error; + }, 0); + }); + }, + /** + * Called from native (in development) when environment times are out-of-sync. + */ + emitTimeDriftWarning: function emitTimeDriftWarning(warningMessage) { + if (hasEmittedTimeDriftWarning) { + return; + } + hasEmittedTimeDriftWarning = true; + console.warn(warningMessage); + } + }; + function createTimer(callbackID, duration, jsSchedulingTime, repeats) { + _$$_REQUIRE(_dependencyMap[3], "invariant")(_NativeTiming.default, 'NativeTiming is available'); + _NativeTiming.default.createTimer(callbackID, duration, jsSchedulingTime, repeats); + } + function deleteTimer(timerID) { + _$$_REQUIRE(_dependencyMap[3], "invariant")(_NativeTiming.default, 'NativeTiming is available'); + _NativeTiming.default.deleteTimer(timerID); + } + function setSendIdleEvents(sendIdleEvents) { + _$$_REQUIRE(_dependencyMap[3], "invariant")(_NativeTiming.default, 'NativeTiming is available'); + _NativeTiming.default.setSendIdleEvents(sendIdleEvents); + } + var ExportedJSTimers; + if (!_NativeTiming.default) { + console.warn("Timing native module is not available, can't set timers."); + // $FlowFixMe[prop-missing] : we can assume timers are generally available + ExportedJSTimers = { + callReactNativeMicrotasks: JSTimers.callReactNativeMicrotasks, + queueReactNativeMicrotask: JSTimers.queueReactNativeMicrotask + }; + } else { + ExportedJSTimers = JSTimers; + } + _$$_REQUIRE(_dependencyMap[4], "../../BatchedBridge/BatchedBridge").setReactNativeMicrotasksCallback(JSTimers.callReactNativeMicrotasks); + module.exports = ExportedJSTimers; +},144,[6,145,33,37,39],"node_modules\\react-native\\Libraries\\Core\\Timers\\JSTimers.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('Timing'); +},145,[36],"node_modules\\react-native\\Libraries\\Core\\Timers\\NativeTiming.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + // Globally Unique Immediate ID. + var GUIID = 1; + + // A global set of the currently cleared immediates. + var clearedImmediates = new Set(); + + /** + * Shim the setImmediate API on top of queueMicrotask. + * @param {function} func Callback to be invoked before the end of the + * current JavaScript execution loop. + */ + function setImmediate(callback) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + if (arguments.length < 1) { + throw new TypeError('setImmediate must be called with at least one argument (a function to call)'); + } + if (typeof callback !== 'function') { + throw new TypeError('The first argument to setImmediate must be a function.'); + } + var id = GUIID++; + // This is an edgey case in which the sequentially assigned ID has been + // "guessed" and "cleared" ahead of time, so we need to clear it up first. + if (clearedImmediates.has(id)) { + clearedImmediates.delete(id); + } + + // $FlowFixMe[incompatible-call] + global.queueMicrotask(function () { + if (!clearedImmediates.has(id)) { + callback.apply(undefined, args); + } else { + // Free up the Set entry. + clearedImmediates.delete(id); + } + }); + return id; + } + + /** + * @param {number} immediateID The ID of the immediate to be clearred. + */ + function clearImmediate(immediateID) { + clearedImmediates.add(immediateID); + } + var immediateShim = { + setImmediate: setImmediate, + clearImmediate: clearImmediate + }; + module.exports = immediateShim; +},146,[],"node_modules\\react-native\\Libraries\\Core\\Timers\\immediateShim.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = queueMicrotask; + var resolvedPromise; + + /** + * Polyfill for the microtask queueing API defined by WHATWG HTML spec. + * https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask + * + * The method must queue a microtask to invoke @param {function} callback, and + * if the callback throws an exception, report the exception. + */ + function queueMicrotask(callback) { + if (arguments.length < 1) { + throw new TypeError('queueMicrotask must be called with at least one argument (a function to call)'); + } + if (typeof callback !== 'function') { + throw new TypeError('The argument to queueMicrotask must be a function.'); + } + + // Try to reuse a lazily allocated resolved promise from closure. + (resolvedPromise || (resolvedPromise = Promise.resolve())).then(callback).catch(function (error) { + return ( + // Report the exception until the next tick. + setTimeout(function () { + throw error; + }, 0) + ); + }); + } +},147,[],"node_modules\\react-native\\Libraries\\Core\\Timers\\queueMicrotask.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + /** + * Set up XMLHttpRequest. The native XMLHttpRequest in Chrome dev tools is CORS + * aware and won't let you fetch anything from the internet. + * + * You can use this module directly, or just require InitializeCore. + */ + _$$_REQUIRE(_dependencyMap[0], "../Utilities/PolyfillFunctions").polyfillGlobal('XMLHttpRequest', function () { + return _$$_REQUIRE(_dependencyMap[1], "../Network/XMLHttpRequest"); + }); + _$$_REQUIRE(_dependencyMap[0], "../Utilities/PolyfillFunctions").polyfillGlobal('FormData', function () { + return _$$_REQUIRE(_dependencyMap[2], "../Network/FormData"); + }); + _$$_REQUIRE(_dependencyMap[0], "../Utilities/PolyfillFunctions").polyfillGlobal('fetch', function () { + return _$$_REQUIRE(_dependencyMap[3], "../Network/fetch").fetch; + }); + _$$_REQUIRE(_dependencyMap[0], "../Utilities/PolyfillFunctions").polyfillGlobal('Headers', function () { + return _$$_REQUIRE(_dependencyMap[3], "../Network/fetch").Headers; + }); + _$$_REQUIRE(_dependencyMap[0], "../Utilities/PolyfillFunctions").polyfillGlobal('Request', function () { + return _$$_REQUIRE(_dependencyMap[3], "../Network/fetch").Request; + }); + _$$_REQUIRE(_dependencyMap[0], "../Utilities/PolyfillFunctions").polyfillGlobal('Response', function () { + return _$$_REQUIRE(_dependencyMap[3], "../Network/fetch").Response; + }); + _$$_REQUIRE(_dependencyMap[0], "../Utilities/PolyfillFunctions").polyfillGlobal('WebSocket', function () { + return _$$_REQUIRE(_dependencyMap[4], "../WebSocket/WebSocket"); + }); + _$$_REQUIRE(_dependencyMap[0], "../Utilities/PolyfillFunctions").polyfillGlobal('Blob', function () { + return _$$_REQUIRE(_dependencyMap[5], "../Blob/Blob"); + }); + _$$_REQUIRE(_dependencyMap[0], "../Utilities/PolyfillFunctions").polyfillGlobal('File', function () { + return _$$_REQUIRE(_dependencyMap[6], "../Blob/File"); + }); + _$$_REQUIRE(_dependencyMap[0], "../Utilities/PolyfillFunctions").polyfillGlobal('FileReader', function () { + return _$$_REQUIRE(_dependencyMap[7], "../Blob/FileReader"); + }); + _$$_REQUIRE(_dependencyMap[0], "../Utilities/PolyfillFunctions").polyfillGlobal('URL', function () { + return _$$_REQUIRE(_dependencyMap[8], "../Blob/URL").URL; + }); // flowlint-line untyped-import:off + _$$_REQUIRE(_dependencyMap[0], "../Utilities/PolyfillFunctions").polyfillGlobal('URLSearchParams', function () { + return _$$_REQUIRE(_dependencyMap[8], "../Blob/URL").URLSearchParams; + }); // flowlint-line untyped-import:off + _$$_REQUIRE(_dependencyMap[0], "../Utilities/PolyfillFunctions").polyfillGlobal('AbortController', function () { + return _$$_REQUIRE(_dependencyMap[9], "abort-controller/dist/abort-controller").AbortController; + } // flowlint-line untyped-import:off + ); + _$$_REQUIRE(_dependencyMap[0], "../Utilities/PolyfillFunctions").polyfillGlobal('AbortSignal', function () { + return _$$_REQUIRE(_dependencyMap[9], "abort-controller/dist/abort-controller").AbortSignal; + } // flowlint-line untyped-import:off + ); +},148,[134,149,162,104,165,153,170,171,173,174],"node_modules\\react-native\\Libraries\\Core\\setUpXHR.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _toConsumableArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/toConsumableArray")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/get")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/createClass")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/classCallCheck")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "@babel/runtime/helpers/inherits")); + var _eventTargetShim = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "event-target-shim")); + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + var DEBUG_NETWORK_SEND_DELAY = false; // Set to a number of milliseconds when debugging + + // The native blob module is optional so inject it here if available. + if (_$$_REQUIRE(_dependencyMap[9], "../Blob/BlobManager").isAvailable) { + _$$_REQUIRE(_dependencyMap[9], "../Blob/BlobManager").addNetworkingHandler(); + } + var UNSENT = 0; + var OPENED = 1; + var HEADERS_RECEIVED = 2; + var LOADING = 3; + var DONE = 4; + var SUPPORTED_RESPONSE_TYPES = { + arraybuffer: typeof global.ArrayBuffer === 'function', + blob: typeof global.Blob === 'function', + document: false, + json: true, + text: true, + '': true + }; + var REQUEST_EVENTS = ['abort', 'error', 'load', 'loadstart', 'progress', 'timeout', 'loadend']; + var XHR_EVENTS = REQUEST_EVENTS.concat('readystatechange'); + var XMLHttpRequestEventTarget = /*#__PURE__*/function (_ref) { + function XMLHttpRequestEventTarget() { + (0, _classCallCheck2.default)(this, XMLHttpRequestEventTarget); + return _callSuper(this, XMLHttpRequestEventTarget, arguments); + } + (0, _inherits2.default)(XMLHttpRequestEventTarget, _ref); + return (0, _createClass2.default)(XMLHttpRequestEventTarget); + }(_eventTargetShim.default.apply(void 0, REQUEST_EVENTS)); + /** + * Shared base for platform-specific XMLHttpRequest implementations. + */ + var XMLHttpRequest = /*#__PURE__*/function (_ref2) { + function XMLHttpRequest() { + var _this; + (0, _classCallCheck2.default)(this, XMLHttpRequest); + _this = _callSuper(this, XMLHttpRequest); + _this.UNSENT = UNSENT; + _this.OPENED = OPENED; + _this.HEADERS_RECEIVED = HEADERS_RECEIVED; + _this.LOADING = LOADING; + _this.DONE = DONE; + _this.readyState = UNSENT; + _this.status = 0; + _this.timeout = 0; + _this.withCredentials = true; + _this.upload = new XMLHttpRequestEventTarget(); + _this._aborted = false; + _this._hasError = false; + _this._method = null; + _this._perfKey = null; + _this._response = ''; + _this._url = null; + _this._timedOut = false; + _this._trackingName = 'unknown'; + _this._incrementalEvents = false; + _this._performanceLogger = _$$_REQUIRE(_dependencyMap[10], "../Utilities/GlobalPerformanceLogger"); + _this._reset(); + return _this; + } + (0, _inherits2.default)(XMLHttpRequest, _ref2); + return (0, _createClass2.default)(XMLHttpRequest, [{ + key: "_reset", + value: function _reset() { + this.readyState = this.UNSENT; + this.responseHeaders = undefined; + this.status = 0; + delete this.responseURL; + this._requestId = null; + this._cachedResponse = undefined; + this._hasError = false; + this._headers = {}; + this._response = ''; + this._responseType = ''; + this._sent = false; + this._lowerCaseResponseHeaders = {}; + this._clearSubscriptions(); + this._timedOut = false; + } + }, { + key: "responseType", + get: function get() { + return this._responseType; + }, + set: function set(responseType) { + if (this._sent) { + throw new Error("Failed to set the 'responseType' property on 'XMLHttpRequest': The " + 'response type cannot be set after the request has been sent.'); + } + if (!SUPPORTED_RESPONSE_TYPES.hasOwnProperty(responseType)) { + console.warn(`The provided value '${responseType}' is not a valid 'responseType'.`); + return; + } + + // redboxes early, e.g. for 'arraybuffer' on ios 7 + _$$_REQUIRE(_dependencyMap[11], "invariant")(SUPPORTED_RESPONSE_TYPES[responseType] || responseType === 'document', `The provided value '${responseType}' is unsupported in this environment.`); + if (responseType === 'blob') { + _$$_REQUIRE(_dependencyMap[11], "invariant")(_$$_REQUIRE(_dependencyMap[9], "../Blob/BlobManager").isAvailable, 'Native module BlobModule is required for blob support'); + } + this._responseType = responseType; + } + }, { + key: "responseText", + get: function get() { + if (this._responseType !== '' && this._responseType !== 'text') { + throw new Error("The 'responseText' property is only available if 'responseType' " + `is set to '' or 'text', but it is '${this._responseType}'.`); + } + if (this.readyState < LOADING) { + return ''; + } + return this._response; + } + }, { + key: "response", + get: function get() { + var responseType = this.responseType; + if (responseType === '' || responseType === 'text') { + return this.readyState < LOADING || this._hasError ? '' : this._response; + } + if (this.readyState !== DONE) { + return null; + } + if (this._cachedResponse !== undefined) { + return this._cachedResponse; + } + switch (responseType) { + case 'document': + this._cachedResponse = null; + break; + case 'arraybuffer': + this._cachedResponse = _$$_REQUIRE(_dependencyMap[12], "base64-js").toByteArray(this._response).buffer; + break; + case 'blob': + if (typeof this._response === 'object' && this._response) { + this._cachedResponse = _$$_REQUIRE(_dependencyMap[9], "../Blob/BlobManager").createFromOptions(this._response); + } else if (this._response === '') { + this._cachedResponse = _$$_REQUIRE(_dependencyMap[9], "../Blob/BlobManager").createFromParts([]); + } else { + throw new Error(`Invalid response for blob: ${this._response}`); + } + break; + case 'json': + try { + this._cachedResponse = JSON.parse(this._response); + } catch (_) { + this._cachedResponse = null; + } + break; + default: + this._cachedResponse = null; + } + return this._cachedResponse; + } + + // exposed for testing + }, { + key: "__didCreateRequest", + value: function __didCreateRequest(requestId) { + this._requestId = requestId; + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.requestSent(requestId, this._url || '', this._method || 'GET', this._headers); + } + + // exposed for testing + }, { + key: "__didUploadProgress", + value: function __didUploadProgress(requestId, progress, total) { + if (requestId === this._requestId) { + this.upload.dispatchEvent({ + type: 'progress', + lengthComputable: true, + loaded: progress, + total: total + }); + } + } + }, { + key: "__didReceiveResponse", + value: function __didReceiveResponse(requestId, status, responseHeaders, responseURL) { + if (requestId === this._requestId) { + this._perfKey != null && this._performanceLogger.stopTimespan(this._perfKey); + this.status = status; + this.setResponseHeaders(responseHeaders); + this.setReadyState(this.HEADERS_RECEIVED); + if (responseURL || responseURL === '') { + this.responseURL = responseURL; + } else { + delete this.responseURL; + } + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.responseReceived(requestId, responseURL || this._url || '', status, responseHeaders || {}); + } + } + }, { + key: "__didReceiveData", + value: function __didReceiveData(requestId, response) { + if (requestId !== this._requestId) { + return; + } + this._response = response; + this._cachedResponse = undefined; // force lazy recomputation + this.setReadyState(this.LOADING); + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.dataReceived(requestId, response); + } + }, { + key: "__didReceiveIncrementalData", + value: function __didReceiveIncrementalData(requestId, responseText, progress, total) { + if (requestId !== this._requestId) { + return; + } + if (!this._response) { + this._response = responseText; + } else { + this._response += responseText; + } + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.dataReceived(requestId, responseText); + this.setReadyState(this.LOADING); + this.__didReceiveDataProgress(requestId, progress, total); + } + }, { + key: "__didReceiveDataProgress", + value: function __didReceiveDataProgress(requestId, loaded, total) { + if (requestId !== this._requestId) { + return; + } + this.dispatchEvent({ + type: 'progress', + lengthComputable: total >= 0, + loaded: loaded, + total: total + }); + } + + // exposed for testing + }, { + key: "__didCompleteResponse", + value: function __didCompleteResponse(requestId, error, timeOutError) { + if (requestId === this._requestId) { + if (error) { + if (this._responseType === '' || this._responseType === 'text') { + this._response = error; + } + this._hasError = true; + if (timeOutError) { + this._timedOut = true; + } + } + this._clearSubscriptions(); + this._requestId = null; + this.setReadyState(this.DONE); + if (error) { + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.loadingFailed(requestId, error); + } else { + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.loadingFinished(requestId, this._response.length); + } + } + } + }, { + key: "_clearSubscriptions", + value: function _clearSubscriptions() { + (this._subscriptions || []).forEach(function (sub) { + if (sub) { + sub.remove(); + } + }); + this._subscriptions = []; + } + }, { + key: "getAllResponseHeaders", + value: function getAllResponseHeaders() { + if (!this.responseHeaders) { + // according to the spec, return null if no response has been received + return null; + } + + // Assign to non-nullable local variable. + var responseHeaders = this.responseHeaders; + var unsortedHeaders = new Map(); + for (var rawHeaderName of Object.keys(responseHeaders)) { + var headerValue = responseHeaders[rawHeaderName]; + var lowerHeaderName = rawHeaderName.toLowerCase(); + var header = unsortedHeaders.get(lowerHeaderName); + if (header) { + header.headerValue += ', ' + headerValue; + unsortedHeaders.set(lowerHeaderName, header); + } else { + unsortedHeaders.set(lowerHeaderName, { + lowerHeaderName: lowerHeaderName, + upperHeaderName: rawHeaderName.toUpperCase(), + headerValue: headerValue + }); + } + } + + // Sort in ascending order, with a being less than b if a's name is legacy-uppercased-byte less than b's name. + var sortedHeaders = (0, _toConsumableArray2.default)(unsortedHeaders.values()).sort(function (a, b) { + if (a.upperHeaderName < b.upperHeaderName) { + return -1; + } + if (a.upperHeaderName > b.upperHeaderName) { + return 1; + } + return 0; + }); + + // Combine into single text response. + return sortedHeaders.map(function (header) { + return header.lowerHeaderName + ': ' + header.headerValue; + }).join('\r\n') + '\r\n'; + } + }, { + key: "getResponseHeader", + value: function getResponseHeader(header) { + var value = this._lowerCaseResponseHeaders[header.toLowerCase()]; + return value !== undefined ? value : null; + } + }, { + key: "setRequestHeader", + value: function setRequestHeader(header, value) { + if (this.readyState !== this.OPENED) { + throw new Error('Request has not been opened'); + } + this._headers[header.toLowerCase()] = String(value); + } + + /** + * Custom extension for tracking origins of request. + */ + }, { + key: "setTrackingName", + value: function setTrackingName(trackingName) { + this._trackingName = trackingName; + return this; + } + + /** + * Custom extension for setting a custom performance logger + */ + }, { + key: "setPerformanceLogger", + value: function setPerformanceLogger(performanceLogger) { + this._performanceLogger = performanceLogger; + return this; + } + }, { + key: "open", + value: function open(method, url, async) { + /* Other optional arguments are not supported yet */ + if (this.readyState !== this.UNSENT) { + throw new Error('Cannot open, already sending'); + } + if (async !== undefined && !async) { + // async is default + throw new Error('Synchronous http requests are not supported'); + } + if (!url) { + throw new Error('Cannot load an empty url'); + } + this._method = method.toUpperCase(); + this._url = url; + this._aborted = false; + this.setReadyState(this.OPENED); + } + }, { + key: "send", + value: function send(data) { + var _this2 = this; + if (this.readyState !== this.OPENED) { + throw new Error('Request has not been opened'); + } + if (this._sent) { + throw new Error('Request has already been sent'); + } + this._sent = true; + var incrementalEvents = this._incrementalEvents || !!this.onreadystatechange || !!this.onprogress; + this._subscriptions.push(_$$_REQUIRE(_dependencyMap[13], "./RCTNetworking").default.addListener('didSendNetworkData', function (args) { + return _this2.__didUploadProgress.apply(_this2, (0, _toConsumableArray2.default)(args)); + })); + this._subscriptions.push(_$$_REQUIRE(_dependencyMap[13], "./RCTNetworking").default.addListener('didReceiveNetworkResponse', function (args) { + return _this2.__didReceiveResponse.apply(_this2, (0, _toConsumableArray2.default)(args)); + })); + this._subscriptions.push(_$$_REQUIRE(_dependencyMap[13], "./RCTNetworking").default.addListener('didReceiveNetworkData', function (args) { + return _this2.__didReceiveData.apply(_this2, (0, _toConsumableArray2.default)(args)); + })); + this._subscriptions.push(_$$_REQUIRE(_dependencyMap[13], "./RCTNetworking").default.addListener('didReceiveNetworkIncrementalData', function (args) { + return _this2.__didReceiveIncrementalData.apply(_this2, (0, _toConsumableArray2.default)(args)); + })); + this._subscriptions.push(_$$_REQUIRE(_dependencyMap[13], "./RCTNetworking").default.addListener('didReceiveNetworkDataProgress', function (args) { + return _this2.__didReceiveDataProgress.apply(_this2, (0, _toConsumableArray2.default)(args)); + })); + this._subscriptions.push(_$$_REQUIRE(_dependencyMap[13], "./RCTNetworking").default.addListener('didCompleteNetworkResponse', function (args) { + return _this2.__didCompleteResponse.apply(_this2, (0, _toConsumableArray2.default)(args)); + })); + var nativeResponseType = 'text'; + if (this._responseType === 'arraybuffer') { + nativeResponseType = 'base64'; + } + if (this._responseType === 'blob') { + nativeResponseType = 'blob'; + } + var doSend = function doSend() { + var friendlyName = _this2._trackingName !== 'unknown' ? _this2._trackingName : _this2._url; + _this2._perfKey = 'network_XMLHttpRequest_' + String(friendlyName); + _this2._performanceLogger.startTimespan(_this2._perfKey); + _$$_REQUIRE(_dependencyMap[11], "invariant")(_this2._method, 'XMLHttpRequest method needs to be defined (%s).', friendlyName); + _$$_REQUIRE(_dependencyMap[11], "invariant")(_this2._url, 'XMLHttpRequest URL needs to be defined (%s).', friendlyName); + _$$_REQUIRE(_dependencyMap[13], "./RCTNetworking").default.sendRequest(_this2._method, _this2._trackingName, _this2._url, _this2._headers, data, + /* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found + * when making Flow check .android.js files. */ + nativeResponseType, incrementalEvents, _this2.timeout, + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + _this2.__didCreateRequest.bind(_this2), _this2.withCredentials); + }; + if (DEBUG_NETWORK_SEND_DELAY) { + setTimeout(doSend, DEBUG_NETWORK_SEND_DELAY); + } else { + doSend(); + } + } + }, { + key: "abort", + value: function abort() { + this._aborted = true; + if (this._requestId) { + _$$_REQUIRE(_dependencyMap[13], "./RCTNetworking").default.abortRequest(this._requestId); + } + // only call onreadystatechange if there is something to abort, + // below logic is per spec + if (!(this.readyState === this.UNSENT || this.readyState === this.OPENED && !this._sent || this.readyState === this.DONE)) { + this._reset(); + this.setReadyState(this.DONE); + } + // Reset again after, in case modified in handler + this._reset(); + } + }, { + key: "setResponseHeaders", + value: function setResponseHeaders(responseHeaders) { + this.responseHeaders = responseHeaders || null; + var headers = responseHeaders || {}; + this._lowerCaseResponseHeaders = Object.keys(headers).reduce(function (lcaseHeaders, headerName) { + lcaseHeaders[headerName.toLowerCase()] = headers[headerName]; + return lcaseHeaders; + }, {}); + } + }, { + key: "setReadyState", + value: function setReadyState(newState) { + this.readyState = newState; + this.dispatchEvent({ + type: 'readystatechange' + }); + if (newState === this.DONE) { + if (this._aborted) { + this.dispatchEvent({ + type: 'abort' + }); + } else if (this._hasError) { + if (this._timedOut) { + this.dispatchEvent({ + type: 'timeout' + }); + } else { + this.dispatchEvent({ + type: 'error' + }); + } + } else { + this.dispatchEvent({ + type: 'load' + }); + } + this.dispatchEvent({ + type: 'loadend' + }); + } + } + + /* global EventListener */ + }, { + key: "addEventListener", + value: function addEventListener(type, listener) { + // If we dont' have a 'readystatechange' event handler, we don't + // have to send repeated LOADING events with incremental updates + // to responseText, which will avoid a bunch of native -> JS + // bridge traffic. + if (type === 'readystatechange' || type === 'progress') { + this._incrementalEvents = true; + } + _superPropGet(XMLHttpRequest, "addEventListener", this, 3)([type, listener]); + } + }], [{ + key: "setInterceptor", + value: function setInterceptor(interceptor) { + XMLHttpRequest._interceptor = interceptor; + } + }]); + }(_eventTargetShim.default.apply(void 0, (0, _toConsumableArray2.default)(XHR_EVENTS))); + XMLHttpRequest.UNSENT = UNSENT; + XMLHttpRequest.OPENED = OPENED; + XMLHttpRequest.HEADERS_RECEIVED = HEADERS_RECEIVED; + XMLHttpRequest.LOADING = LOADING; + XMLHttpRequest.DONE = DONE; + XMLHttpRequest._interceptor = null; + module.exports = XMLHttpRequest; +},149,[6,41,26,19,18,23,25,28,150,151,155,37,3,159],"node_modules\\react-native\\Libraries\\Network\\XMLHttpRequest.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + /** + * @typedef {object} PrivateData + * @property {EventTarget} eventTarget The event target. + * @property {{type:string}} event The original event object. + * @property {number} eventPhase The current event phase. + * @property {EventTarget|null} currentTarget The current event target. + * @property {boolean} canceled The flag to prevent default. + * @property {boolean} stopped The flag to stop propagation. + * @property {boolean} immediateStopped The flag to stop propagation immediately. + * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null. + * @property {number} timeStamp The unix time. + * @private + */ + + /** + * Private data for event wrappers. + * @type {WeakMap} + * @private + */ + var privateData = new WeakMap(); + + /** + * Cache for wrapper classes. + * @type {WeakMap} + * @private + */ + var wrappers = new WeakMap(); + + /** + * Get private data. + * @param {Event} event The event object to get private data. + * @returns {PrivateData} The private data of the event. + * @private + */ + function pd(event) { + var retv = privateData.get(event); + console.assert(retv != null, "'this' is expected an Event object, but got", event); + return retv; + } + + /** + * https://dom.spec.whatwg.org/#set-the-canceled-flag + * @param data {PrivateData} private data. + */ + function setCancelFlag(data) { + if (data.passiveListener != null) { + if (typeof console !== "undefined" && typeof console.error === "function") { + console.error("Unable to preventDefault inside passive event listener invocation.", data.passiveListener); + } + return; + } + if (!data.event.cancelable) { + return; + } + data.canceled = true; + if (typeof data.event.preventDefault === "function") { + data.event.preventDefault(); + } + } + + /** + * @see https://dom.spec.whatwg.org/#interface-event + * @private + */ + /** + * The event wrapper. + * @constructor + * @param {EventTarget} eventTarget The event target of this dispatching. + * @param {Event|{type:string}} event The original event to wrap. + */ + function Event(eventTarget, event) { + privateData.set(this, { + eventTarget: eventTarget, + event: event, + eventPhase: 2, + currentTarget: eventTarget, + canceled: false, + stopped: false, + immediateStopped: false, + passiveListener: null, + timeStamp: event.timeStamp || Date.now() + }); + + // https://heycam.github.io/webidl/#Unforgeable + Object.defineProperty(this, "isTrusted", { + value: false, + enumerable: true + }); + + // Define accessors + var keys = Object.keys(event); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!(key in this)) { + Object.defineProperty(this, key, defineRedirectDescriptor(key)); + } + } + } + + // Should be enumerable, but class methods are not enumerable. + Event.prototype = { + /** + * The type of this event. + * @type {string} + */ + get type() { + return pd(this).event.type; + }, + /** + * The target of this event. + * @type {EventTarget} + */ + get target() { + return pd(this).eventTarget; + }, + /** + * The target of this event. + * @type {EventTarget} + */ + get currentTarget() { + return pd(this).currentTarget; + }, + /** + * @returns {EventTarget[]} The composed path of this event. + */ + composedPath: function composedPath() { + var currentTarget = pd(this).currentTarget; + if (currentTarget == null) { + return []; + } + return [currentTarget]; + }, + /** + * Constant of NONE. + * @type {number} + */ + get NONE() { + return 0; + }, + /** + * Constant of CAPTURING_PHASE. + * @type {number} + */ + get CAPTURING_PHASE() { + return 1; + }, + /** + * Constant of AT_TARGET. + * @type {number} + */ + get AT_TARGET() { + return 2; + }, + /** + * Constant of BUBBLING_PHASE. + * @type {number} + */ + get BUBBLING_PHASE() { + return 3; + }, + /** + * The target of this event. + * @type {number} + */ + get eventPhase() { + return pd(this).eventPhase; + }, + /** + * Stop event bubbling. + * @returns {void} + */ + stopPropagation: function stopPropagation() { + var data = pd(this); + data.stopped = true; + if (typeof data.event.stopPropagation === "function") { + data.event.stopPropagation(); + } + }, + /** + * Stop event bubbling. + * @returns {void} + */ + stopImmediatePropagation: function stopImmediatePropagation() { + var data = pd(this); + data.stopped = true; + data.immediateStopped = true; + if (typeof data.event.stopImmediatePropagation === "function") { + data.event.stopImmediatePropagation(); + } + }, + /** + * The flag to be bubbling. + * @type {boolean} + */ + get bubbles() { + return Boolean(pd(this).event.bubbles); + }, + /** + * The flag to be cancelable. + * @type {boolean} + */ + get cancelable() { + return Boolean(pd(this).event.cancelable); + }, + /** + * Cancel this event. + * @returns {void} + */ + preventDefault: function preventDefault() { + setCancelFlag(pd(this)); + }, + /** + * The flag to indicate cancellation state. + * @type {boolean} + */ + get defaultPrevented() { + return pd(this).canceled; + }, + /** + * The flag to be composed. + * @type {boolean} + */ + get composed() { + return Boolean(pd(this).event.composed); + }, + /** + * The unix time of this event. + * @type {number} + */ + get timeStamp() { + return pd(this).timeStamp; + }, + /** + * The target of this event. + * @type {EventTarget} + * @deprecated + */ + get srcElement() { + return pd(this).eventTarget; + }, + /** + * The flag to stop event bubbling. + * @type {boolean} + * @deprecated + */ + get cancelBubble() { + return pd(this).stopped; + }, + set cancelBubble(value) { + if (!value) { + return; + } + var data = pd(this); + data.stopped = true; + if (typeof data.event.cancelBubble === "boolean") { + data.event.cancelBubble = true; + } + }, + /** + * The flag to indicate cancellation state. + * @type {boolean} + * @deprecated + */ + get returnValue() { + return !pd(this).canceled; + }, + set returnValue(value) { + if (!value) { + setCancelFlag(pd(this)); + } + }, + /** + * Initialize this event object. But do nothing under event dispatching. + * @param {string} type The event type. + * @param {boolean} [bubbles=false] The flag to be possible to bubble up. + * @param {boolean} [cancelable=false] The flag to be possible to cancel. + * @deprecated + */ + initEvent: function initEvent() { + // Do nothing. + } + }; + + // `constructor` is not enumerable. + Object.defineProperty(Event.prototype, "constructor", { + value: Event, + configurable: true, + writable: true + }); + + // Ensure `event instanceof window.Event` is `true`. + if (typeof window !== "undefined" && typeof window.Event !== "undefined") { + Object.setPrototypeOf(Event.prototype, window.Event.prototype); + + // Make association for wrappers. + wrappers.set(window.Event.prototype, Event); + } + + /** + * Get the property descriptor to redirect a given property. + * @param {string} key Property name to define property descriptor. + * @returns {PropertyDescriptor} The property descriptor to redirect the property. + * @private + */ + function defineRedirectDescriptor(key) { + return { + get: function get() { + return pd(this).event[key]; + }, + set: function set(value) { + pd(this).event[key] = value; + }, + configurable: true, + enumerable: true + }; + } + + /** + * Get the property descriptor to call a given method property. + * @param {string} key Property name to define property descriptor. + * @returns {PropertyDescriptor} The property descriptor to call the method property. + * @private + */ + function defineCallDescriptor(key) { + return { + value: function value() { + var event = pd(this).event; + return event[key].apply(event, arguments); + }, + configurable: true, + enumerable: true + }; + } + + /** + * Define new wrapper class. + * @param {Function} BaseEvent The base wrapper class. + * @param {Object} proto The prototype of the original event. + * @returns {Function} The defined wrapper class. + * @private + */ + function defineWrapper(BaseEvent, proto) { + var keys = Object.keys(proto); + if (keys.length === 0) { + return BaseEvent; + } + + /** CustomEvent */ + function CustomEvent(eventTarget, event) { + BaseEvent.call(this, eventTarget, event); + } + CustomEvent.prototype = Object.create(BaseEvent.prototype, { + constructor: { + value: CustomEvent, + configurable: true, + writable: true + } + }); + + // Define accessors. + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!(key in BaseEvent.prototype)) { + var descriptor = Object.getOwnPropertyDescriptor(proto, key); + var isFunc = typeof descriptor.value === "function"; + Object.defineProperty(CustomEvent.prototype, key, isFunc ? defineCallDescriptor(key) : defineRedirectDescriptor(key)); + } + } + return CustomEvent; + } + + /** + * Get the wrapper class of a given prototype. + * @param {Object} proto The prototype of the original event to get its wrapper. + * @returns {Function} The wrapper class. + * @private + */ + function getWrapper(proto) { + if (proto == null || proto === Object.prototype) { + return Event; + } + var wrapper = wrappers.get(proto); + if (wrapper == null) { + wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto); + wrappers.set(proto, wrapper); + } + return wrapper; + } + + /** + * Wrap a given event to management a dispatching. + * @param {EventTarget} eventTarget The event target of this dispatching. + * @param {Object} event The event to wrap. + * @returns {Event} The wrapper instance. + * @private + */ + function wrapEvent(eventTarget, event) { + var Wrapper = getWrapper(Object.getPrototypeOf(event)); + return new Wrapper(eventTarget, event); + } + + /** + * Get the immediateStopped flag of a given event. + * @param {Event} event The event to get. + * @returns {boolean} The flag to stop propagation immediately. + * @private + */ + function isStopped(event) { + return pd(event).immediateStopped; + } + + /** + * Set the current event phase of a given event. + * @param {Event} event The event to set current target. + * @param {number} eventPhase New event phase. + * @returns {void} + * @private + */ + function setEventPhase(event, eventPhase) { + pd(event).eventPhase = eventPhase; + } + + /** + * Set the current target of a given event. + * @param {Event} event The event to set current target. + * @param {EventTarget|null} currentTarget New current target. + * @returns {void} + * @private + */ + function setCurrentTarget(event, currentTarget) { + pd(event).currentTarget = currentTarget; + } + + /** + * Set a passive listener of a given event. + * @param {Event} event The event to set current target. + * @param {Function|null} passiveListener New passive listener. + * @returns {void} + * @private + */ + function setPassiveListener(event, passiveListener) { + pd(event).passiveListener = passiveListener; + } + + /** + * @typedef {object} ListenerNode + * @property {Function} listener + * @property {1|2|3} listenerType + * @property {boolean} passive + * @property {boolean} once + * @property {ListenerNode|null} next + * @private + */ + + /** + * @type {WeakMap>} + * @private + */ + var listenersMap = new WeakMap(); + + // Listener types + var CAPTURE = 1; + var BUBBLE = 2; + var ATTRIBUTE = 3; + + /** + * Check whether a given value is an object or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is an object. + */ + function isObject(x) { + return x !== null && typeof x === "object"; //eslint-disable-line no-restricted-syntax + } + + /** + * Get listeners. + * @param {EventTarget} eventTarget The event target to get. + * @returns {Map} The listeners. + * @private + */ + function getListeners(eventTarget) { + var listeners = listenersMap.get(eventTarget); + if (listeners == null) { + throw new TypeError("'this' is expected an EventTarget object, but got another value."); + } + return listeners; + } + + /** + * Get the property descriptor for the event attribute of a given event. + * @param {string} eventName The event name to get property descriptor. + * @returns {PropertyDescriptor} The property descriptor. + * @private + */ + function defineEventAttributeDescriptor(eventName) { + return { + get: function get() { + var listeners = getListeners(this); + var node = listeners.get(eventName); + while (node != null) { + if (node.listenerType === ATTRIBUTE) { + return node.listener; + } + node = node.next; + } + return null; + }, + set: function set(listener) { + if (typeof listener !== "function" && !isObject(listener)) { + listener = null; // eslint-disable-line no-param-reassign + } + var listeners = getListeners(this); + + // Traverse to the tail while removing old value. + var prev = null; + var node = listeners.get(eventName); + while (node != null) { + if (node.listenerType === ATTRIBUTE) { + // Remove old value. + if (prev !== null) { + prev.next = node.next; + } else if (node.next !== null) { + listeners.set(eventName, node.next); + } else { + listeners.delete(eventName); + } + } else { + prev = node; + } + node = node.next; + } + + // Add new value. + if (listener !== null) { + var newNode = { + listener: listener, + listenerType: ATTRIBUTE, + passive: false, + once: false, + next: null + }; + if (prev === null) { + listeners.set(eventName, newNode); + } else { + prev.next = newNode; + } + } + }, + configurable: true, + enumerable: true + }; + } + + /** + * Define an event attribute (e.g. `eventTarget.onclick`). + * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite. + * @param {string} eventName The event name to define. + * @returns {void} + */ + function defineEventAttribute(eventTargetPrototype, eventName) { + Object.defineProperty(eventTargetPrototype, `on${eventName}`, defineEventAttributeDescriptor(eventName)); + } + + /** + * Define a custom EventTarget with event attributes. + * @param {string[]} eventNames Event names for event attributes. + * @returns {EventTarget} The custom EventTarget. + * @private + */ + function defineCustomEventTarget(eventNames) { + /** CustomEventTarget */ + function CustomEventTarget() { + EventTarget.call(this); + } + CustomEventTarget.prototype = Object.create(EventTarget.prototype, { + constructor: { + value: CustomEventTarget, + configurable: true, + writable: true + } + }); + for (var i = 0; i < eventNames.length; ++i) { + defineEventAttribute(CustomEventTarget.prototype, eventNames[i]); + } + return CustomEventTarget; + } + + /** + * EventTarget. + * + * - This is constructor if no arguments. + * - This is a function which returns a CustomEventTarget constructor if there are arguments. + * + * For example: + * + * class A extends EventTarget {} + * class B extends EventTarget("message") {} + * class C extends EventTarget("message", "error") {} + * class D extends EventTarget(["message", "error"]) {} + */ + function EventTarget() { + /*eslint-disable consistent-return */ + if (this instanceof EventTarget) { + listenersMap.set(this, new Map()); + return; + } + if (arguments.length === 1 && Array.isArray(arguments[0])) { + return defineCustomEventTarget(arguments[0]); + } + if (arguments.length > 0) { + var types = new Array(arguments.length); + for (var i = 0; i < arguments.length; ++i) { + types[i] = arguments[i]; + } + return defineCustomEventTarget(types); + } + throw new TypeError("Cannot call a class as a function"); + /*eslint-enable consistent-return */ + } + + // Should be enumerable, but class methods are not enumerable. + EventTarget.prototype = { + /** + * Add a given listener to this event target. + * @param {string} eventName The event name to add. + * @param {Function} listener The listener to add. + * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener. + * @returns {void} + */ + addEventListener: function addEventListener(eventName, listener, options) { + if (listener == null) { + return; + } + if (typeof listener !== "function" && !isObject(listener)) { + throw new TypeError("'listener' should be a function or an object."); + } + var listeners = getListeners(this); + var optionsIsObj = isObject(options); + var capture = optionsIsObj ? Boolean(options.capture) : Boolean(options); + var listenerType = capture ? CAPTURE : BUBBLE; + var newNode = { + listener: listener, + listenerType: listenerType, + passive: optionsIsObj && Boolean(options.passive), + once: optionsIsObj && Boolean(options.once), + next: null + }; + + // Set it as the first node if the first node is null. + var node = listeners.get(eventName); + if (node === undefined) { + listeners.set(eventName, newNode); + return; + } + + // Traverse to the tail while checking duplication.. + var prev = null; + while (node != null) { + if (node.listener === listener && node.listenerType === listenerType) { + // Should ignore duplication. + return; + } + prev = node; + node = node.next; + } + + // Add it. + prev.next = newNode; + }, + /** + * Remove a given listener from this event target. + * @param {string} eventName The event name to remove. + * @param {Function} listener The listener to remove. + * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener. + * @returns {void} + */ + removeEventListener: function removeEventListener(eventName, listener, options) { + if (listener == null) { + return; + } + var listeners = getListeners(this); + var capture = isObject(options) ? Boolean(options.capture) : Boolean(options); + var listenerType = capture ? CAPTURE : BUBBLE; + var prev = null; + var node = listeners.get(eventName); + while (node != null) { + if (node.listener === listener && node.listenerType === listenerType) { + if (prev !== null) { + prev.next = node.next; + } else if (node.next !== null) { + listeners.set(eventName, node.next); + } else { + listeners.delete(eventName); + } + return; + } + prev = node; + node = node.next; + } + }, + /** + * Dispatch a given event. + * @param {Event|{type:string}} event The event to dispatch. + * @returns {boolean} `false` if canceled. + */ + dispatchEvent: function dispatchEvent(event) { + if (event == null || typeof event.type !== "string") { + throw new TypeError('"event.type" should be a string.'); + } + + // If listeners aren't registered, terminate. + var listeners = getListeners(this); + var eventName = event.type; + var node = listeners.get(eventName); + if (node == null) { + return true; + } + + // Since we cannot rewrite several properties, so wrap object. + var wrappedEvent = wrapEvent(this, event); + + // This doesn't process capturing phase and bubbling phase. + // This isn't participating in a tree. + var prev = null; + while (node != null) { + // Remove this listener if it's once + if (node.once) { + if (prev !== null) { + prev.next = node.next; + } else if (node.next !== null) { + listeners.set(eventName, node.next); + } else { + listeners.delete(eventName); + } + } else { + prev = node; + } + + // Call this listener + setPassiveListener(wrappedEvent, node.passive ? node.listener : null); + if (typeof node.listener === "function") { + try { + node.listener.call(this, wrappedEvent); + } catch (err) { + if (typeof console !== "undefined" && typeof console.error === "function") { + console.error(err); + } + } + } else if (node.listenerType !== ATTRIBUTE && typeof node.listener.handleEvent === "function") { + node.listener.handleEvent(wrappedEvent); + } + + // Break if `event.stopImmediatePropagation` was called. + if (isStopped(wrappedEvent)) { + break; + } + node = node.next; + } + setPassiveListener(wrappedEvent, null); + setEventPhase(wrappedEvent, 0); + setCurrentTarget(wrappedEvent, null); + return !wrappedEvent.defaultPrevented; + } + }; + + // `constructor` is not enumerable. + Object.defineProperty(EventTarget.prototype, "constructor", { + value: EventTarget, + configurable: true, + writable: true + }); + + // Ensure `eventTarget instanceof window.EventTarget` is `true`. + if (typeof window !== "undefined" && typeof window.EventTarget !== "undefined") { + Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype); + } + exports.defineEventAttribute = defineEventAttribute; + exports.EventTarget = EventTarget; + exports.default = EventTarget; + module.exports = EventTarget; + module.exports.EventTarget = module.exports["default"] = EventTarget; + module.exports.defineEventAttribute = defineEventAttribute; +},150,[],"node_modules\\event-target-shim\\dist\\event-target-shim.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _NativeBlobModule = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "./NativeBlobModule")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "invariant")); /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /*eslint-disable no-bitwise */ + /*eslint-disable eqeqeq */ + + /** + * Based on the rfc4122-compliant solution posted at + * http://stackoverflow.com/questions/105034 + */ + function uuidv4() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r = Math.random() * 16 | 0, + v = c == 'x' ? r : r & 0x3 | 0x8; + return v.toString(16); + }); + } + + // **Temporary workaround** + // TODO(#24654): Use turbomodules for the Blob module. + // Blob collector is a jsi::HostObject that is used by native to know + // when the a Blob instance is deallocated. This allows to free the + // underlying native resources. This is a hack to workaround the fact + // that the current bridge infra doesn't allow to track js objects + // deallocation. Ideally the whole Blob object should be a jsi::HostObject. + function createBlobCollector(blobId) { + if (global.__blobCollectorProvider == null) { + return null; + } else { + return global.__blobCollectorProvider(blobId); + } + } + + /** + * Module to manage blobs. Wrapper around the native blob module. + */ + var BlobManager = /*#__PURE__*/function () { + function BlobManager() { + (0, _classCallCheck2.default)(this, BlobManager); + } + return (0, _createClass2.default)(BlobManager, null, [{ + key: "createFromParts", + value: + /** + * Create blob from existing array of blobs. + */ + function createFromParts(parts, options) { + (0, _invariant.default)(_NativeBlobModule.default, 'NativeBlobModule is available.'); + var blobId = uuidv4(); + var items = parts.map(function (part) { + if (part instanceof ArrayBuffer || ArrayBuffer.isView(part)) { + return { + // $FlowFixMe[incompatible-cast] + data: (0, _$$_REQUIRE(_dependencyMap[5], "base64-js").fromByteArray)(new Uint8Array(part)), + type: 'string' + }; + } else if (part instanceof _$$_REQUIRE(_dependencyMap[6], "./Blob")) { + return { + data: part.data, + type: 'blob' + }; + } else { + return { + data: String(part), + type: 'string' + }; + } + }); + var size = items.reduce(function (acc, curr) { + if (curr.type === 'string') { + return acc + global.unescape(encodeURI(curr.data)).length; + } else { + return acc + curr.data.size; + } + }, 0); + _NativeBlobModule.default.createFromParts(items, blobId); + return BlobManager.createFromOptions({ + blobId: blobId, + offset: 0, + size: size, + type: options ? options.type : '', + lastModified: options ? options.lastModified : Date.now() + }); + } + + /** + * Create blob instance from blob data from native. + * Used internally by modules like XHR, WebSocket, etc. + */ + }, { + key: "createFromOptions", + value: function createFromOptions(options) { + _$$_REQUIRE(_dependencyMap[7], "./BlobRegistry").register(options.blobId); + // $FlowFixMe[prop-missing] + return Object.assign(Object.create(_$$_REQUIRE(_dependencyMap[6], "./Blob").prototype), { + data: + // Reuse the collector instance when creating from an existing blob. + // This will make sure that the underlying resource is only deallocated + // when all blobs that refer to it are deallocated. + options.__collector == null ? Object.assign({}, options, { + __collector: createBlobCollector(options.blobId) + }) : options + }); + } + + /** + * Deallocate resources for a blob. + */ + }, { + key: "release", + value: function release(blobId) { + (0, _invariant.default)(_NativeBlobModule.default, 'NativeBlobModule is available.'); + _$$_REQUIRE(_dependencyMap[7], "./BlobRegistry").unregister(blobId); + if (_$$_REQUIRE(_dependencyMap[7], "./BlobRegistry").has(blobId)) { + return; + } + _NativeBlobModule.default.release(blobId); + } + + /** + * Inject the blob content handler in the networking module to support blob + * requests and responses. + */ + }, { + key: "addNetworkingHandler", + value: function addNetworkingHandler() { + (0, _invariant.default)(_NativeBlobModule.default, 'NativeBlobModule is available.'); + _NativeBlobModule.default.addNetworkingHandler(); + } + + /** + * Indicate the websocket should return a blob for incoming binary + * messages. + */ + }, { + key: "addWebSocketHandler", + value: function addWebSocketHandler(socketId) { + (0, _invariant.default)(_NativeBlobModule.default, 'NativeBlobModule is available.'); + _NativeBlobModule.default.addWebSocketHandler(socketId); + } + + /** + * Indicate the websocket should no longer return a blob for incoming + * binary messages. + */ + }, { + key: "removeWebSocketHandler", + value: function removeWebSocketHandler(socketId) { + (0, _invariant.default)(_NativeBlobModule.default, 'NativeBlobModule is available.'); + _NativeBlobModule.default.removeWebSocketHandler(socketId); + } + + /** + * Send a blob message to a websocket. + */ + }, { + key: "sendOverSocket", + value: function sendOverSocket(blob, socketId) { + (0, _invariant.default)(_NativeBlobModule.default, 'NativeBlobModule is available.'); + _NativeBlobModule.default.sendOverSocket(blob.data, socketId); + } + }]); + }(); + /** + * If the native blob module is available. + */ + BlobManager.isAvailable = !!_NativeBlobModule.default; + module.exports = BlobManager; +},151,[6,18,19,152,37,3,153,154],"node_modules\\react-native\\Libraries\\Blob\\BlobManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var NativeModule = TurboModuleRegistry.get('BlobModule'); + var constants = null; + var NativeBlobModule = null; + if (NativeModule != null) { + NativeBlobModule = { + getConstants: function getConstants() { + if (constants == null) { + constants = NativeModule.getConstants(); + } + return constants; + }, + addNetworkingHandler: function addNetworkingHandler() { + NativeModule.addNetworkingHandler(); + }, + addWebSocketHandler: function addWebSocketHandler(id) { + NativeModule.addWebSocketHandler(id); + }, + removeWebSocketHandler: function removeWebSocketHandler(id) { + NativeModule.removeWebSocketHandler(id); + }, + sendOverSocket: function sendOverSocket(blob, socketID) { + NativeModule.sendOverSocket(blob, socketID); + }, + createFromParts: function createFromParts(parts, withId) { + NativeModule.createFromParts(parts, withId); + }, + release: function release(blobId) { + NativeModule.release(blobId); + } + }; + } + var _default = exports.default = NativeBlobModule; +},152,[36],"node_modules\\react-native\\Libraries\\Blob\\NativeBlobModule.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _classCallCheck = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/createClass"); + /** + * Opaque JS representation of some binary data in native. + * + * The API is modeled after the W3C Blob API, with one caveat + * regarding explicit deallocation. Refer to the `close()` + * method for further details. + * + * Example usage in a React component: + * + * class WebSocketImage extends React.Component { + * state = {blob: null}; + * componentDidMount() { + * let ws = this.ws = new WebSocket(...); + * ws.binaryType = 'blob'; + * ws.onmessage = (event) => { + * if (this.state.blob) { + * this.state.blob.close(); + * } + * this.setState({blob: event.data}); + * }; + * } + * componentUnmount() { + * if (this.state.blob) { + * this.state.blob.close(); + * } + * this.ws.close(); + * } + * render() { + * if (!this.state.blob) { + * return ; + * } + * return ; + * } + * } + * + * Reference: https://developer.mozilla.org/en-US/docs/Web/API/Blob + */ + var Blob = /*#__PURE__*/function () { + /** + * Constructor for JS consumers. + * Currently we only support creating Blobs from other Blobs. + * Reference: https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob + */ + function Blob() { + var parts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var options = arguments.length > 1 ? arguments[1] : undefined; + _classCallCheck(this, Blob); + var BlobManager = _$$_REQUIRE(_dependencyMap[2], "./BlobManager"); + this.data = BlobManager.createFromParts(parts, options).data; + } + + /* + * This method is used to create a new Blob object containing + * the data in the specified range of bytes of the source Blob. + * Reference: https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice + */ + // $FlowFixMe[unsafe-getters-setters] + return _createClass(Blob, [{ + key: "data", + get: + // $FlowFixMe[unsafe-getters-setters] + function get() { + if (!this._data) { + throw new Error('Blob has been closed and is no longer available'); + } + return this._data; + }, + set: function set(data) { + this._data = data; + } + }, { + key: "slice", + value: function slice(start, end) { + var contentType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + var BlobManager = _$$_REQUIRE(_dependencyMap[2], "./BlobManager"); + var _this$data = this.data, + offset = _this$data.offset, + size = _this$data.size; + if (typeof start === 'number') { + if (start > size) { + // $FlowFixMe[reassign-const] + start = size; + } + offset += start; + size -= start; + if (typeof end === 'number') { + if (end < 0) { + // $FlowFixMe[reassign-const] + end = this.size + end; + } + if (end > this.size) { + // $FlowFixMe[reassign-const] + end = this.size; + } + size = end - start; + } + } + return BlobManager.createFromOptions({ + blobId: this.data.blobId, + offset: offset, + size: size, + type: contentType, + /* Since `blob.slice()` creates a new view onto the same binary + * data as the original blob, we should re-use the same collector + * object so that the underlying resource gets deallocated when + * the last view into the data is released, not the first. + */ + __collector: this.data.__collector + }); + } + + /** + * This method is in the standard, but not actually implemented by + * any browsers at this point. It's important for how Blobs work in + * React Native, however, since we cannot de-allocate resources automatically, + * so consumers need to explicitly de-allocate them. + * + * Note that the semantics around Blobs created via `blob.slice()` + * and `new Blob([blob])` are different. `blob.slice()` creates a + * new *view* onto the same binary data, so calling `close()` on any + * of those views is enough to deallocate the data, whereas + * `new Blob([blob, ...])` actually copies the data in memory. + */ + }, { + key: "close", + value: function close() { + var BlobManager = _$$_REQUIRE(_dependencyMap[2], "./BlobManager"); + BlobManager.release(this.data.blobId); + this.data = null; + } + + /** + * Size of the data contained in the Blob object, in bytes. + */ + // $FlowFixMe[unsafe-getters-setters] + }, { + key: "size", + get: function get() { + return this.data.size; + } + + /* + * String indicating the MIME type of the data contained in the Blob. + * If the type is unknown, this string is empty. + */ + // $FlowFixMe[unsafe-getters-setters] + }, { + key: "type", + get: function get() { + return this.data.type || ''; + } + }]); + }(); + module.exports = Blob; +},153,[18,19,151],"node_modules\\react-native\\Libraries\\Blob\\Blob.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var registry = new Map(); + var register = function register(id) { + var used = registry.get(id); + if (used != null) { + registry.set(id, used + 1); + } else { + registry.set(id, 1); + } + }; + var unregister = function unregister(id) { + var used = registry.get(id); + if (used != null) { + if (used <= 1) { + registry.delete(id); + } else { + registry.set(id, used - 1); + } + } + }; + var has = function has(id) { + return registry.get(id) || false; + }; + module.exports = { + register: register, + unregister: unregister, + has: has + }; +},154,[],"node_modules\\react-native\\Libraries\\Blob\\BlobRegistry.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _createPerformanceLogger = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./createPerformanceLogger")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /** + * This is a global shared instance of IPerformanceLogger that is created with + * createPerformanceLogger(). + * This logger should be used only for global performance metrics like the ones + * that are logged during loading bundle. If you want to log something from your + * React component you should use PerformanceLoggerContext instead. + */ + var GlobalPerformanceLogger = (0, _createPerformanceLogger.default)(true); + module.exports = GlobalPerformanceLogger; +},155,[6,156],"node_modules\\react-native\\Libraries\\Utilities\\GlobalPerformanceLogger.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = createPerformanceLogger; + exports.getCurrentTimestamp = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var Systrace = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3], "../Performance/Systrace")); + var _ReactNativeFeatureFlags = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../ReactNative/ReactNativeFeatureFlags")); + var _NativePerformance = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../WebPerformance/NativePerformance")); + var _infoLog = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./infoLog")); + var _global$nativeQPLTime; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + var _cookies = {}; + var PRINT_TO_CONSOLE = false; // Type as false to prevent accidentally committing `true`; + + // This is the prefix for optional logging points/timespans as marks/measures via Performance API, + // used to separate these internally from other marks/measures + var WEB_PERFORMANCE_PREFIX = 'global_perf_'; + var getCurrentTimestamp = exports.getCurrentTimestamp = (_global$nativeQPLTime = global.nativeQPLTimestamp) != null ? _global$nativeQPLTime : function () { + return global.performance.now(); + }; + var PerformanceLogger = /*#__PURE__*/function () { + function PerformanceLogger(isGlobalLogger) { + (0, _classCallCheck2.default)(this, PerformanceLogger); + this._timespans = {}; + this._extras = {}; + this._points = {}; + this._pointExtras = {}; + this._closed = false; + this._isGlobalLogger = false; + this._isGlobalLogger = isGlobalLogger === true; + } + return (0, _createClass2.default)(PerformanceLogger, [{ + key: "_isLoggingForWebPerformance", + value: function _isLoggingForWebPerformance() { + if (!this._isGlobalLogger || _NativePerformance.default == null) { + return false; + } + if (this._isGlobalWebPerformanceLoggerEnabled == null) { + this._isGlobalWebPerformanceLoggerEnabled = _ReactNativeFeatureFlags.default.isGlobalWebPerformanceLoggerEnabled(); + } + return this._isGlobalWebPerformanceLoggerEnabled === true; + } + + // NOTE: The Performance.mark/measure calls are wrapped here to ensure that + // we are safe from the cases when the global 'peformance' object is still not yet defined. + // It is only necessary in this file because of potential race conditions in the initialization + // order between 'createPerformanceLogger' and 'setUpPerformance'. + // + // In most of the other cases this kind of check for `performance` being defined + // wouldn't be necessary. + }, { + key: "_performanceMark", + value: function _performanceMark(key, startTime) { + if (this._isLoggingForWebPerformance()) { + var _global$performance; + (_global$performance = global.performance) == null ? void 0 : _global$performance.mark == null ? void 0 : _global$performance.mark(key, { + startTime: startTime + }); + } + } + }, { + key: "_performanceMeasure", + value: function _performanceMeasure(key, start, end) { + if (this._isLoggingForWebPerformance()) { + var _global$performance2; + (_global$performance2 = global.performance) == null ? void 0 : _global$performance2.measure == null ? void 0 : _global$performance2.measure(key, { + start: start, + end: end + }); + } + } + }, { + key: "addTimespan", + value: function addTimespan(key, startTime, endTime, startExtras, endExtras) { + if (this._closed) { + if (PRINT_TO_CONSOLE && __DEV__) { + (0, _infoLog.default)('PerformanceLogger: addTimespan - has closed ignoring: ', key); + } + return; + } + if (this._timespans[key]) { + if (PRINT_TO_CONSOLE && __DEV__) { + (0, _infoLog.default)('PerformanceLogger: Attempting to add a timespan that already exists ', key); + } + return; + } + this._timespans[key] = { + startTime: startTime, + endTime: endTime, + totalTime: endTime - (startTime || 0), + startExtras: startExtras, + endExtras: endExtras + }; + this._performanceMeasure(`${WEB_PERFORMANCE_PREFIX}_${key}`, startTime, endTime); + } + }, { + key: "append", + value: function append(performanceLogger) { + this._timespans = Object.assign({}, performanceLogger.getTimespans(), this._timespans); + this._extras = Object.assign({}, performanceLogger.getExtras(), this._extras); + this._points = Object.assign({}, performanceLogger.getPoints(), this._points); + this._pointExtras = Object.assign({}, performanceLogger.getPointExtras(), this._pointExtras); + } + }, { + key: "clear", + value: function clear() { + this._timespans = {}; + this._extras = {}; + this._points = {}; + if (PRINT_TO_CONSOLE) { + (0, _infoLog.default)('PerformanceLogger.js', 'clear'); + } + } + }, { + key: "clearCompleted", + value: function clearCompleted() { + for (var _key in this._timespans) { + var _this$_timespans$_key; + if (((_this$_timespans$_key = this._timespans[_key]) == null ? void 0 : _this$_timespans$_key.totalTime) != null) { + delete this._timespans[_key]; + } + } + this._extras = {}; + this._points = {}; + if (PRINT_TO_CONSOLE) { + (0, _infoLog.default)('PerformanceLogger.js', 'clearCompleted'); + } + } + }, { + key: "close", + value: function close() { + this._closed = true; + } + }, { + key: "currentTimestamp", + value: function currentTimestamp() { + return getCurrentTimestamp(); + } + }, { + key: "getExtras", + value: function getExtras() { + return this._extras; + } + }, { + key: "getPoints", + value: function getPoints() { + return this._points; + } + }, { + key: "getPointExtras", + value: function getPointExtras() { + return this._pointExtras; + } + }, { + key: "getTimespans", + value: function getTimespans() { + return this._timespans; + } + }, { + key: "hasTimespan", + value: function hasTimespan(key) { + return !!this._timespans[key]; + } + }, { + key: "isClosed", + value: function isClosed() { + return this._closed; + } + }, { + key: "logEverything", + value: function logEverything() { + if (PRINT_TO_CONSOLE) { + // log timespans + for (var _key2 in this._timespans) { + var _this$_timespans$_key2; + if (((_this$_timespans$_key2 = this._timespans[_key2]) == null ? void 0 : _this$_timespans$_key2.totalTime) != null) { + (0, _infoLog.default)(_key2 + ': ' + this._timespans[_key2].totalTime + 'ms'); + } + } + + // log extras + (0, _infoLog.default)(this._extras); + + // log points + for (var _key3 in this._points) { + if (this._points[_key3] != null) { + (0, _infoLog.default)(_key3 + ': ' + this._points[_key3] + 'ms'); + } + } + } + } + }, { + key: "markPoint", + value: function markPoint(key) { + var timestamp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentTimestamp(); + var extras = arguments.length > 2 ? arguments[2] : undefined; + if (this._closed) { + if (PRINT_TO_CONSOLE && __DEV__) { + (0, _infoLog.default)('PerformanceLogger: markPoint - has closed ignoring: ', key); + } + return; + } + if (this._points[key] != null) { + if (PRINT_TO_CONSOLE && __DEV__) { + (0, _infoLog.default)('PerformanceLogger: Attempting to mark a point that has been already logged ', key); + } + return; + } + this._points[key] = timestamp; + if (extras) { + this._pointExtras[key] = extras; + } + this._performanceMark(`${WEB_PERFORMANCE_PREFIX}_${key}`, timestamp); + } + }, { + key: "removeExtra", + value: function removeExtra(key) { + var value = this._extras[key]; + delete this._extras[key]; + return value; + } + }, { + key: "setExtra", + value: function setExtra(key, value) { + if (this._closed) { + if (PRINT_TO_CONSOLE && __DEV__) { + (0, _infoLog.default)('PerformanceLogger: setExtra - has closed ignoring: ', key); + } + return; + } + if (this._extras.hasOwnProperty(key)) { + if (PRINT_TO_CONSOLE && __DEV__) { + (0, _infoLog.default)('PerformanceLogger: Attempting to set an extra that already exists ', { + key: key, + currentValue: this._extras[key], + attemptedValue: value + }); + } + return; + } + this._extras[key] = value; + } + }, { + key: "startTimespan", + value: function startTimespan(key) { + var timestamp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentTimestamp(); + var extras = arguments.length > 2 ? arguments[2] : undefined; + if (this._closed) { + if (PRINT_TO_CONSOLE && __DEV__) { + (0, _infoLog.default)('PerformanceLogger: startTimespan - has closed ignoring: ', key); + } + return; + } + if (this._timespans[key]) { + if (PRINT_TO_CONSOLE && __DEV__) { + (0, _infoLog.default)('PerformanceLogger: Attempting to start a timespan that already exists ', key); + } + return; + } + this._timespans[key] = { + startTime: timestamp, + startExtras: extras + }; + _cookies[key] = Systrace.beginAsyncEvent(key); + if (PRINT_TO_CONSOLE) { + (0, _infoLog.default)('PerformanceLogger.js', 'start: ' + key); + } + this._performanceMark(`${WEB_PERFORMANCE_PREFIX}_timespan_start_${key}`, timestamp); + } + }, { + key: "stopTimespan", + value: function stopTimespan(key) { + var timestamp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentTimestamp(); + var extras = arguments.length > 2 ? arguments[2] : undefined; + if (this._closed) { + if (PRINT_TO_CONSOLE && __DEV__) { + (0, _infoLog.default)('PerformanceLogger: stopTimespan - has closed ignoring: ', key); + } + return; + } + var timespan = this._timespans[key]; + if (!timespan || timespan.startTime == null) { + if (PRINT_TO_CONSOLE && __DEV__) { + (0, _infoLog.default)('PerformanceLogger: Attempting to end a timespan that has not started ', key); + } + return; + } + if (timespan.endTime != null) { + if (PRINT_TO_CONSOLE && __DEV__) { + (0, _infoLog.default)('PerformanceLogger: Attempting to end a timespan that has already ended ', key); + } + return; + } + timespan.endExtras = extras; + timespan.endTime = timestamp; + timespan.totalTime = timespan.endTime - (timespan.startTime || 0); + if (PRINT_TO_CONSOLE) { + (0, _infoLog.default)('PerformanceLogger.js', 'end: ' + key); + } + if (_cookies[key] != null) { + Systrace.endAsyncEvent(key, _cookies[key]); + delete _cookies[key]; + } + this._performanceMeasure(`${WEB_PERFORMANCE_PREFIX}_${key}`, `${WEB_PERFORMANCE_PREFIX}_timespan_start_${key}`, timestamp); + } + }]); + }(); // Re-exporting for backwards compatibility with all the clients that + // may still import it from this module. + /** + * This function creates performance loggers that can be used to collect and log + * various performance data such as timespans, points and extras. + * The loggers need to have minimal overhead since they're used in production. + */ + function createPerformanceLogger(isGlobalLogger) { + return new PerformanceLogger(isGlobalLogger); + } +},156,[6,18,19,33,157,75,158],"node_modules\\react-native\\Libraries\\Utilities\\createPerformanceLogger.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var ReactNativeFeatureFlags = { + isLayoutAnimationEnabled: function isLayoutAnimationEnabled() { + return true; + }, + shouldEmitW3CPointerEvents: function shouldEmitW3CPointerEvents() { + return false; + }, + shouldPressibilityUseW3CPointerEventsForHover: function shouldPressibilityUseW3CPointerEventsForHover() { + return false; + }, + animatedShouldDebounceQueueFlush: function animatedShouldDebounceQueueFlush() { + return false; + }, + animatedShouldUseSingleOp: function animatedShouldUseSingleOp() { + return false; + }, + isGlobalWebPerformanceLoggerEnabled: function isGlobalWebPerformanceLoggerEnabled() { + return undefined; + }, + enableAccessToHostTreeInFabric: function enableAccessToHostTreeInFabric() { + return false; + }, + shouldUseAnimatedObjectForTransform: function shouldUseAnimatedObjectForTransform() { + return false; + }, + shouldUseSetNativePropsInFabric: function shouldUseSetNativePropsInFabric() { + return false; + }, + shouldForceUnflattenForElevation: function shouldForceUnflattenForElevation() { + return false; + } + }; + module.exports = ReactNativeFeatureFlags; +},157,[],"node_modules\\react-native\\Libraries\\ReactNative\\ReactNativeFeatureFlags.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * Intentional info-level logging for clear separation from ad-hoc console debug logging. + */ + function infoLog() { + var _console; + return (_console = console).log.apply(_console, arguments); + } + module.exports = infoLog; +},158,[],"node_modules\\react-native\\Libraries\\Utilities\\infoLog.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _NativeEventEmitter2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../EventEmitter/NativeEventEmitter")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../Utilities/Platform")); + var _convertRequestBody = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./convertRequestBody")); + var _NativeNetworkingAndroid = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./NativeNetworkingAndroid")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ // Do not require the native RCTNetworking module directly! Use this wrapper module instead. + // It will add the necessary requestId, so that you don't have to generate it yourself. + // Convert FormData headers to arrays, which are easier to consume in + // native on Android. + function convertHeadersMapToArray(headers) { + var headerArray = []; + for (var name in headers) { + headerArray.push([name, headers[name]]); + } + return headerArray; + } + var _requestId = 1; + function generateRequestId() { + return _requestId++; + } + + /** + * This class is a wrapper around the native RCTNetworking module. It adds a necessary unique + * requestId to each network request that can be used to abort that request later on. + */ + // FIXME: use typed events + var RCTNetworking = /*#__PURE__*/function (_NativeEventEmitter) { + function RCTNetworking() { + (0, _classCallCheck2.default)(this, RCTNetworking); + return _callSuper(this, RCTNetworking, [ + // T88715063: NativeEventEmitter only used this parameter on iOS. Now it uses it on all platforms, so this code was modified automatically to preserve its behavior + // If you want to use the native module on other platforms, please remove this condition and test its behavior + _Platform.default.OS !== 'ios' ? null : _NativeNetworkingAndroid.default]); + } + (0, _inherits2.default)(RCTNetworking, _NativeEventEmitter); + return (0, _createClass2.default)(RCTNetworking, [{ + key: "sendRequest", + value: function sendRequest(method, trackingName, url, headers, data, responseType, incrementalUpdates, timeout, callback, withCredentials) { + var body = (0, _convertRequestBody.default)(data); + if (body && body.formData) { + body.formData = body.formData.map(function (part) { + return Object.assign({}, part, { + headers: convertHeadersMapToArray(part.headers) + }); + }); + } + var requestId = generateRequestId(); + _NativeNetworkingAndroid.default.sendRequest(method, url, requestId, convertHeadersMapToArray(headers), Object.assign({}, body, { + trackingName: trackingName + }), responseType, incrementalUpdates, timeout, withCredentials); + callback(requestId); + } + }, { + key: "abortRequest", + value: function abortRequest(requestId) { + _NativeNetworkingAndroid.default.abortRequest(requestId); + } + }, { + key: "clearCookies", + value: function clearCookies(callback) { + _NativeNetworkingAndroid.default.clearCookies(callback); + } + }]); + }(_NativeEventEmitter2.default); + var _default = exports.default = new RCTNetworking(); +},159,[6,18,19,23,25,28,160,34,161,164],"node_modules\\react-native\\Libraries\\Network\\RCTNetworking.android.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../Utilities/Platform")); + var _RCTDeviceEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "./RCTDeviceEventEmitter")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "invariant")); + /** + * `NativeEventEmitter` is intended for use by Native Modules to emit events to + * JavaScript listeners. If a `NativeModule` is supplied to the constructor, it + * will be notified (via `addListener` and `removeListeners`) when the listener + * count changes to manage "native memory". + * + * Currently, all native events are fired via a global `RCTDeviceEventEmitter`. + * This means event names must be globally unique, and it means that call sites + * can theoretically listen to `RCTDeviceEventEmitter` (although discouraged). + */ + var NativeEventEmitter = exports.default = /*#__PURE__*/function () { + function NativeEventEmitter(nativeModule) { + (0, _classCallCheck2.default)(this, NativeEventEmitter); + if (_Platform.default.OS === 'ios') { + (0, _invariant.default)(nativeModule != null, '`new NativeEventEmitter()` requires a non-null argument.'); + } + var hasAddListener = + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + !!nativeModule && typeof nativeModule.addListener === 'function'; + var hasRemoveListeners = + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + !!nativeModule && typeof nativeModule.removeListeners === 'function'; + if (nativeModule && hasAddListener && hasRemoveListeners) { + this._nativeModule = nativeModule; + } else if (nativeModule != null) { + if (!hasAddListener) { + console.warn('`new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.'); + } + if (!hasRemoveListeners) { + console.warn('`new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.'); + } + } + } + return (0, _createClass2.default)(NativeEventEmitter, [{ + key: "addListener", + value: function addListener(eventType, listener, context) { + var _this$_nativeModule, + _this = this; + (_this$_nativeModule = this._nativeModule) == null ? void 0 : _this$_nativeModule.addListener(eventType); + var subscription = _RCTDeviceEventEmitter.default.addListener(eventType, listener, context); + return { + remove: function remove() { + if (subscription != null) { + var _this$_nativeModule2; + (_this$_nativeModule2 = _this._nativeModule) == null ? void 0 : _this$_nativeModule2.removeListeners(1); + // $FlowFixMe[incompatible-use] + subscription.remove(); + subscription = null; + } + } + }; + } + }, { + key: "emit", + value: function emit(eventType) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + // Generally, `RCTDeviceEventEmitter` is directly invoked. But this is + // included for completeness. + _RCTDeviceEventEmitter.default.emit.apply(_RCTDeviceEventEmitter.default, [eventType].concat(args)); + } + }, { + key: "removeAllListeners", + value: function removeAllListeners(eventType) { + var _this$_nativeModule3; + (0, _invariant.default)(eventType != null, '`NativeEventEmitter.removeAllListener()` requires a non-null argument.'); + (_this$_nativeModule3 = this._nativeModule) == null ? void 0 : _this$_nativeModule3.removeListeners(this.listenerCount(eventType)); + _RCTDeviceEventEmitter.default.removeAllListeners(eventType); + } + }, { + key: "listenerCount", + value: function listenerCount(eventType) { + return _RCTDeviceEventEmitter.default.listenerCount(eventType); + } + }]); + }(); +},160,[6,18,19,34,17,37],"node_modules\\react-native\\Libraries\\EventEmitter\\NativeEventEmitter.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + function convertRequestBody(body) { + if (typeof body === 'string') { + return { + string: body + }; + } + if (body instanceof _$$_REQUIRE(_dependencyMap[0], "../Blob/Blob")) { + return { + blob: body.data + }; + } + if (body instanceof _$$_REQUIRE(_dependencyMap[1], "./FormData")) { + return { + formData: body.getParts() + }; + } + if (body instanceof ArrayBuffer || ArrayBuffer.isView(body)) { + /* $FlowFixMe[incompatible-call] : no way to assert that 'body' is indeed + * an ArrayBufferView */ + return { + base64: _$$_REQUIRE(_dependencyMap[2], "../Utilities/binaryToBase64")(body) + }; + } + return body; + } + module.exports = convertRequestBody; +},161,[153,162,163],"node_modules\\react-native\\Libraries\\Network\\convertRequestBody.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _slicedToArray = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/slicedToArray"); + var _classCallCheck = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass"); + /** + * Polyfill for XMLHttpRequest2 FormData API, allowing multipart POST requests + * with mixed data (string, native files) to be submitted via XMLHttpRequest. + * + * Example: + * + * var photo = { + * uri: uriFromCameraRoll, + * type: 'image/jpeg', + * name: 'photo.jpg', + * }; + * + * var body = new FormData(); + * body.append('authToken', 'secret'); + * body.append('photo', photo); + * body.append('title', 'A beautiful photo!'); + * + * xhr.open('POST', serverURL); + * xhr.send(body); + */ + var FormData = /*#__PURE__*/function () { + function FormData() { + _classCallCheck(this, FormData); + this._parts = []; + } + return _createClass(FormData, [{ + key: "append", + value: function append(key, value) { + // The XMLHttpRequest spec doesn't specify if duplicate keys are allowed. + // MDN says that any new values should be appended to existing values. + // In any case, major browsers allow duplicate keys, so that's what we'll do + // too. They'll simply get appended as additional form data parts in the + // request body, leaving the server to deal with them. + this._parts.push([key, value]); + } + }, { + key: "getAll", + value: function getAll(key) { + return this._parts.filter(function (_ref) { + var _ref2 = _slicedToArray(_ref, 1), + name = _ref2[0]; + return name === key; + }).map(function (_ref3) { + var _ref4 = _slicedToArray(_ref3, 2), + value = _ref4[1]; + return value; + }); + } + }, { + key: "getParts", + value: function getParts() { + return this._parts.map(function (_ref5) { + var _ref6 = _slicedToArray(_ref5, 2), + name = _ref6[0], + value = _ref6[1]; + var contentDisposition = 'form-data; name="' + name + '"'; + var headers = { + 'content-disposition': contentDisposition + }; + + // The body part is a "blob", which in React Native just means + // an object with a `uri` attribute. Optionally, it can also + // have a `name` and `type` attribute to specify filename and + // content type (cf. web Blob interface.) + if (typeof value === 'object' && !Array.isArray(value) && value) { + if (typeof value.name === 'string') { + headers['content-disposition'] += '; filename="' + value.name + '"'; + } + if (typeof value.type === 'string') { + headers['content-type'] = value.type; + } + return Object.assign({}, value, { + headers: headers, + fieldName: name + }); + } + // Convert non-object values to strings as per FormData.append() spec + return { + string: String(value), + headers: headers, + fieldName: name + }; + }); + } + }]); + }(); + module.exports = FormData; +},162,[7,18,19],"node_modules\\react-native\\Libraries\\Network\\FormData.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + function binaryToBase64(data) { + if (data instanceof ArrayBuffer) { + // $FlowFixMe[reassign-const] + data = new Uint8Array(data); + } + if (data instanceof Uint8Array) { + return _$$_REQUIRE(_dependencyMap[0], "base64-js").fromByteArray(data); + } + if (!ArrayBuffer.isView(data)) { + throw new Error('data must be ArrayBuffer or typed array'); + } + // Already checked that `data` is `DataView` in `ArrayBuffer.isView(data)` + var _ref = data, + buffer = _ref.buffer, + byteOffset = _ref.byteOffset, + byteLength = _ref.byteLength; + return _$$_REQUIRE(_dependencyMap[0], "base64-js").fromByteArray(new Uint8Array(buffer, byteOffset, byteLength)); + } + module.exports = binaryToBase64; +},163,[3],"node_modules\\react-native\\Libraries\\Utilities\\binaryToBase64.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.getEnforcing('Networking'); +},164,[36],"node_modules\\react-native\\Libraries\\Network\\NativeNetworkingAndroid.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _objectWithoutProperties2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/objectWithoutProperties")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _Blob = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../Blob/Blob")); + var _BlobManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "../Blob/BlobManager")); + var _NativeEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "../EventEmitter/NativeEventEmitter")); + var _binaryToBase = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "../Utilities/binaryToBase64")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[11], "../Utilities/Platform")); + var _NativeWebSocketModule = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[12], "./NativeWebSocketModule")); + var _WebSocketEvent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[13], "./WebSocketEvent")); + var _base64Js = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[14], "base64-js")); + var _eventTargetShim = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[15], "event-target-shim")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[16], "invariant")); + var _excluded = ["headers"]; + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + var CONNECTING = 0; + var OPEN = 1; + var CLOSING = 2; + var CLOSED = 3; + var CLOSE_NORMAL = 1000; + + // Abnormal closure where no code is provided in a control frame + // https://www.rfc-editor.org/rfc/rfc6455.html#section-7.1.5 + var CLOSE_ABNORMAL = 1006; + var WEBSOCKET_EVENTS = ['close', 'error', 'message', 'open']; + var nextWebSocketId = 0; + /** + * Browser-compatible WebSockets implementation. + * + * See https://developer.mozilla.org/en-US/docs/Web/API/WebSocket + * See https://github.com/websockets/ws + */ + var WebSocket = /*#__PURE__*/function (_ref) { + function WebSocket(url, protocols, options) { + var _this; + (0, _classCallCheck2.default)(this, WebSocket); + _this = _callSuper(this, WebSocket); + _this.CONNECTING = CONNECTING; + _this.OPEN = OPEN; + _this.CLOSING = CLOSING; + _this.CLOSED = CLOSED; + _this.readyState = CONNECTING; + _this.url = url; + if (typeof protocols === 'string') { + protocols = [protocols]; + } + var _ref2 = options || {}, + _ref2$headers = _ref2.headers, + headers = _ref2$headers === void 0 ? {} : _ref2$headers, + unrecognized = (0, _objectWithoutProperties2.default)(_ref2, _excluded); + + // Preserve deprecated backwards compatibility for the 'origin' option + // $FlowFixMe[prop-missing] + if (unrecognized && typeof unrecognized.origin === 'string') { + console.warn('Specifying `origin` as a WebSocket connection option is deprecated. Include it under `headers` instead.'); + /* $FlowFixMe[prop-missing] (>=0.54.0 site=react_native_fb,react_native_ + * oss) This comment suppresses an error found when Flow v0.54 was + * deployed. To see the error delete this comment and run Flow. */ + headers.origin = unrecognized.origin; + /* $FlowFixMe[prop-missing] (>=0.54.0 site=react_native_fb,react_native_ + * oss) This comment suppresses an error found when Flow v0.54 was + * deployed. To see the error delete this comment and run Flow. */ + delete unrecognized.origin; + } + + // Warn about and discard anything else + if (Object.keys(unrecognized).length > 0) { + console.warn('Unrecognized WebSocket connection option(s) `' + Object.keys(unrecognized).join('`, `') + '`. ' + 'Did you mean to put these under `headers`?'); + } + if (!Array.isArray(protocols)) { + protocols = null; + } + _this._eventEmitter = new _NativeEventEmitter.default( + // T88715063: NativeEventEmitter only used this parameter on iOS. Now it uses it on all platforms, so this code was modified automatically to preserve its behavior + // If you want to use the native module on other platforms, please remove this condition and test its behavior + _Platform.default.OS !== 'ios' ? null : _NativeWebSocketModule.default); + _this._socketId = nextWebSocketId++; + _this._registerEvents(); + _NativeWebSocketModule.default.connect(url, protocols, { + headers: headers + }, _this._socketId); + return _this; + } + (0, _inherits2.default)(WebSocket, _ref); + return (0, _createClass2.default)(WebSocket, [{ + key: "binaryType", + get: function get() { + return this._binaryType; + }, + set: function set(binaryType) { + if (binaryType !== 'blob' && binaryType !== 'arraybuffer') { + throw new Error("binaryType must be either 'blob' or 'arraybuffer'"); + } + if (this._binaryType === 'blob' || binaryType === 'blob') { + (0, _invariant.default)(_BlobManager.default.isAvailable, 'Native module BlobModule is required for blob support'); + if (binaryType === 'blob') { + _BlobManager.default.addWebSocketHandler(this._socketId); + } else { + _BlobManager.default.removeWebSocketHandler(this._socketId); + } + } + this._binaryType = binaryType; + } + }, { + key: "close", + value: function close(code, reason) { + if (this.readyState === this.CLOSING || this.readyState === this.CLOSED) { + return; + } + this.readyState = this.CLOSING; + this._close(code, reason); + } + }, { + key: "send", + value: function send(data) { + if (this.readyState === this.CONNECTING) { + throw new Error('INVALID_STATE_ERR'); + } + if (data instanceof _Blob.default) { + (0, _invariant.default)(_BlobManager.default.isAvailable, 'Native module BlobModule is required for blob support'); + _BlobManager.default.sendOverSocket(data, this._socketId); + return; + } + if (typeof data === 'string') { + _NativeWebSocketModule.default.send(data, this._socketId); + return; + } + if (data instanceof ArrayBuffer || ArrayBuffer.isView(data)) { + _NativeWebSocketModule.default.sendBinary((0, _binaryToBase.default)(data), this._socketId); + return; + } + throw new Error('Unsupported data type'); + } + }, { + key: "ping", + value: function ping() { + if (this.readyState === this.CONNECTING) { + throw new Error('INVALID_STATE_ERR'); + } + _NativeWebSocketModule.default.ping(this._socketId); + } + }, { + key: "_close", + value: function _close(code, reason) { + // See https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent + var statusCode = typeof code === 'number' ? code : CLOSE_NORMAL; + var closeReason = typeof reason === 'string' ? reason : ''; + _NativeWebSocketModule.default.close(statusCode, closeReason, this._socketId); + if (_BlobManager.default.isAvailable && this._binaryType === 'blob') { + _BlobManager.default.removeWebSocketHandler(this._socketId); + } + } + }, { + key: "_unregisterEvents", + value: function _unregisterEvents() { + this._subscriptions.forEach(function (e) { + return e.remove(); + }); + this._subscriptions = []; + } + }, { + key: "_registerEvents", + value: function _registerEvents() { + var _this2 = this; + this._subscriptions = [this._eventEmitter.addListener('websocketMessage', function (ev) { + if (ev.id !== _this2._socketId) { + return; + } + var data = ev.data; + switch (ev.type) { + case 'binary': + data = _base64Js.default.toByteArray(ev.data).buffer; + break; + case 'blob': + data = _BlobManager.default.createFromOptions(ev.data); + break; + } + _this2.dispatchEvent(new _WebSocketEvent.default('message', { + data: data + })); + }), this._eventEmitter.addListener('websocketOpen', function (ev) { + if (ev.id !== _this2._socketId) { + return; + } + _this2.readyState = _this2.OPEN; + _this2.protocol = ev.protocol; + _this2.dispatchEvent(new _WebSocketEvent.default('open')); + }), this._eventEmitter.addListener('websocketClosed', function (ev) { + if (ev.id !== _this2._socketId) { + return; + } + _this2.readyState = _this2.CLOSED; + _this2.dispatchEvent(new _WebSocketEvent.default('close', { + code: ev.code, + reason: ev.reason + // TODO: missing `wasClean` (exposed on iOS as `clean` but missing on Android) + })); + _this2._unregisterEvents(); + _this2.close(); + }), this._eventEmitter.addListener('websocketFailed', function (ev) { + if (ev.id !== _this2._socketId) { + return; + } + _this2.readyState = _this2.CLOSED; + _this2.dispatchEvent(new _WebSocketEvent.default('error', { + message: ev.message + })); + _this2.dispatchEvent(new _WebSocketEvent.default('close', { + code: CLOSE_ABNORMAL, + reason: ev.message + // TODO: Expose `wasClean` + })); + _this2._unregisterEvents(); + _this2.close(); + })]; + } + }]); + }(_eventTargetShim.default.apply(void 0, WEBSOCKET_EVENTS)); + WebSocket.CONNECTING = CONNECTING; + WebSocket.OPEN = OPEN; + WebSocket.CLOSING = CLOSING; + WebSocket.CLOSED = CLOSED; + module.exports = WebSocket; +},165,[6,166,18,19,23,25,28,153,151,160,163,34,168,169,3,150,37],"node_modules\\react-native\\Libraries\\WebSocket\\WebSocket.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _objectWithoutProperties(e, t) { + if (null == e) return {}; + var o, + r, + i = _$$_REQUIRE(_dependencyMap[0], "./objectWithoutPropertiesLoose.js")(e, t); + if (Object.getOwnPropertySymbols) { + var s = Object.getOwnPropertySymbols(e); + for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); + } + return i; + } + module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports; +},166,[167],"node_modules\\@babel\\runtime\\helpers\\objectWithoutProperties.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _objectWithoutPropertiesLoose(r, e) { + if (null == r) return {}; + var t = {}; + for (var n in r) if ({}.hasOwnProperty.call(r, n)) { + if (e.includes(n)) continue; + t[n] = r[n]; + } + return t; + } + module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports; +},167,[],"node_modules\\@babel\\runtime\\helpers\\objectWithoutPropertiesLoose.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.getEnforcing('WebSocketModule'); +},168,[36],"node_modules\\react-native\\Libraries\\WebSocket\\NativeWebSocketModule.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + + 'use strict'; + + /** + * Event object passed to the `onopen`, `onclose`, `onmessage`, `onerror` + * callbacks of `WebSocket`. + * + * The `type` property is "open", "close", "message", "error" respectively. + * + * In case of "message", the `data` property contains the incoming data. + */ + var _createClass = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/createClass"); + var _classCallCheck = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck"); + var WebSocketEvent = /*#__PURE__*/_createClass(function WebSocketEvent(type, eventInitDict) { + _classCallCheck(this, WebSocketEvent); + this.type = type.toString(); + Object.assign(this, eventInitDict); + }); + module.exports = WebSocketEvent; +},169,[19,18],"node_modules\\react-native\\Libraries\\WebSocket\\WebSocketEvent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _classCallCheck = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/createClass"); + var _possibleConstructorReturn = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/possibleConstructorReturn"); + var _getPrototypeOf = _$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/getPrototypeOf"); + var _inherits = _$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/inherits"); + function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + /** + * The File interface provides information about files. + */ + var File = /*#__PURE__*/function (_Blob) { + /** + * Constructor for JS consumers. + */ + function File(parts, name, options) { + var _this; + _classCallCheck(this, File); + _$$_REQUIRE(_dependencyMap[5], "invariant")(parts != null && name != null, 'Failed to construct `File`: Must pass both `parts` and `name` arguments.'); + _this = _callSuper(this, File, [parts, options]); + _this.data.name = name; + return _this; + } + + /** + * Name of the file. + */ + _inherits(File, _Blob); + return _createClass(File, [{ + key: "name", + get: function get() { + _$$_REQUIRE(_dependencyMap[5], "invariant")(this.data.name != null, 'Files must have a name set.'); + return this.data.name; + } + + /* + * Last modified time of the file. + */ + }, { + key: "lastModified", + get: function get() { + return this.data.lastModified || 0; + } + }]); + }(_$$_REQUIRE(_dependencyMap[6], "./Blob")); + module.exports = File; +},170,[18,19,23,25,28,37,153],"node_modules\\react-native\\Libraries\\Blob\\File.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _NativeFileReaderModule = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./NativeFileReaderModule")); + var _eventTargetShim = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "event-target-shim")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + // DONE + + var READER_EVENTS = ['abort', 'error', 'load', 'loadstart', 'loadend', 'progress']; + var EMPTY = 0; + var LOADING = 1; + var DONE = 2; + var FileReader = /*#__PURE__*/function (_ref) { + function FileReader() { + var _this; + (0, _classCallCheck2.default)(this, FileReader); + _this = _callSuper(this, FileReader); + _this.EMPTY = EMPTY; + _this.LOADING = LOADING; + _this.DONE = DONE; + _this._aborted = false; + _this._reset(); + return _this; + } + (0, _inherits2.default)(FileReader, _ref); + return (0, _createClass2.default)(FileReader, [{ + key: "_reset", + value: function _reset() { + this._readyState = EMPTY; + this._error = null; + this._result = null; + } + }, { + key: "_setReadyState", + value: function _setReadyState(newState) { + this._readyState = newState; + this.dispatchEvent({ + type: 'readystatechange' + }); + if (newState === DONE) { + if (this._aborted) { + this.dispatchEvent({ + type: 'abort' + }); + } else if (this._error) { + this.dispatchEvent({ + type: 'error' + }); + } else { + this.dispatchEvent({ + type: 'load' + }); + } + this.dispatchEvent({ + type: 'loadend' + }); + } + } + }, { + key: "readAsArrayBuffer", + value: function readAsArrayBuffer(blob) { + var _this2 = this; + this._aborted = false; + if (blob == null) { + throw new TypeError("Failed to execute 'readAsArrayBuffer' on 'FileReader': parameter 1 is not of type 'Blob'"); + } + _NativeFileReaderModule.default.readAsDataURL(blob.data).then(function (text) { + if (_this2._aborted) { + return; + } + var base64 = text.split(',')[1]; + var typedArray = (0, _$$_REQUIRE(_dependencyMap[8], "base64-js").toByteArray)(base64); + _this2._result = typedArray.buffer; + _this2._setReadyState(DONE); + }, function (error) { + if (_this2._aborted) { + return; + } + _this2._error = error; + _this2._setReadyState(DONE); + }); + } + }, { + key: "readAsDataURL", + value: function readAsDataURL(blob) { + var _this3 = this; + this._aborted = false; + if (blob == null) { + throw new TypeError("Failed to execute 'readAsDataURL' on 'FileReader': parameter 1 is not of type 'Blob'"); + } + _NativeFileReaderModule.default.readAsDataURL(blob.data).then(function (text) { + if (_this3._aborted) { + return; + } + _this3._result = text; + _this3._setReadyState(DONE); + }, function (error) { + if (_this3._aborted) { + return; + } + _this3._error = error; + _this3._setReadyState(DONE); + }); + } + }, { + key: "readAsText", + value: function readAsText(blob) { + var _this4 = this; + var encoding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'UTF-8'; + this._aborted = false; + if (blob == null) { + throw new TypeError("Failed to execute 'readAsText' on 'FileReader': parameter 1 is not of type 'Blob'"); + } + _NativeFileReaderModule.default.readAsText(blob.data, encoding).then(function (text) { + if (_this4._aborted) { + return; + } + _this4._result = text; + _this4._setReadyState(DONE); + }, function (error) { + if (_this4._aborted) { + return; + } + _this4._error = error; + _this4._setReadyState(DONE); + }); + } + }, { + key: "abort", + value: function abort() { + this._aborted = true; + // only call onreadystatechange if there is something to abort, as per spec + if (this._readyState !== EMPTY && this._readyState !== DONE) { + this._reset(); + this._setReadyState(DONE); + } + // Reset again after, in case modified in handler + this._reset(); + } + }, { + key: "readyState", + get: function get() { + return this._readyState; + } + }, { + key: "error", + get: function get() { + return this._error; + } + }, { + key: "result", + get: function get() { + return this._result; + } + }]); + }(_eventTargetShim.default.apply(void 0, READER_EVENTS)); + FileReader.EMPTY = EMPTY; + FileReader.LOADING = LOADING; + FileReader.DONE = DONE; + module.exports = FileReader; +},171,[6,18,19,23,25,28,172,150,3],"node_modules\\react-native\\Libraries\\Blob\\FileReader.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.getEnforcing('FileReaderModule'); +},172,[36],"node_modules\\react-native\\Libraries\\Blob\\NativeFileReaderModule.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.URLSearchParams = exports.URL = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _NativeBlobModule = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "./NativeBlobModule")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var BLOB_URL_PREFIX = null; + if (_NativeBlobModule.default && typeof _NativeBlobModule.default.getConstants().BLOB_URI_SCHEME === 'string') { + var constants = _NativeBlobModule.default.getConstants(); + // $FlowFixMe[incompatible-type] asserted above + // $FlowFixMe[unsafe-addition] + BLOB_URL_PREFIX = constants.BLOB_URI_SCHEME + ':'; + if (typeof constants.BLOB_URI_HOST === 'string') { + BLOB_URL_PREFIX += `//${constants.BLOB_URI_HOST}/`; + } + } + + /** + * To allow Blobs be accessed via `content://` URIs, + * you need to register `BlobProvider` as a ContentProvider in your app's `AndroidManifest.xml`: + * + * ```xml + * + * + * + * + * + * ``` + * And then define the `blob_provider_authority` string in `res/values/strings.xml`. + * Use a dotted name that's entirely unique to your app: + * + * ```xml + * + * your.app.package.blobs + * + * ``` + */ + + // Small subset from whatwg-url: https://github.com/jsdom/whatwg-url/tree/master/src + // The reference code bloat comes from Unicode issues with URLs, so those won't work here. + var URLSearchParams = exports.URLSearchParams = /*#__PURE__*/function () { + function URLSearchParams(params) { + var _this = this; + (0, _classCallCheck2.default)(this, URLSearchParams); + this._searchParams = []; + if (typeof params === 'object') { + Object.keys(params).forEach(function (key) { + return _this.append(key, params[key]); + }); + } + } + return (0, _createClass2.default)(URLSearchParams, [{ + key: "append", + value: function append(key, value) { + this._searchParams.push([key, value]); + } + }, { + key: "delete", + value: function _delete(name) { + throw new Error('URLSearchParams.delete is not implemented'); + } + }, { + key: "get", + value: function get(name) { + throw new Error('URLSearchParams.get is not implemented'); + } + }, { + key: "getAll", + value: function getAll(name) { + throw new Error('URLSearchParams.getAll is not implemented'); + } + }, { + key: "has", + value: function has(name) { + throw new Error('URLSearchParams.has is not implemented'); + } + }, { + key: "set", + value: function set(name, value) { + throw new Error('URLSearchParams.set is not implemented'); + } + }, { + key: "sort", + value: function sort() { + throw new Error('URLSearchParams.sort is not implemented'); + } + + // $FlowFixMe[unsupported-syntax] + // $FlowFixMe[missing-local-annot] + }, { + key: Symbol.iterator, + value: function value() { + return this._searchParams[Symbol.iterator](); + } + }, { + key: "toString", + value: function toString() { + if (this._searchParams.length === 0) { + return ''; + } + var last = this._searchParams.length - 1; + return this._searchParams.reduce(function (acc, curr, index) { + return acc + encodeURIComponent(curr[0]) + '=' + encodeURIComponent(curr[1]) + (index === last ? '' : '&'); + }, ''); + } + }]); + }(); + function validateBaseUrl(url) { + // from this MIT-licensed gist: https://gist.github.com/dperini/729294 + return /^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)*(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/.test(url); + } + var URL = exports.URL = /*#__PURE__*/function () { + // $FlowFixMe[missing-local-annot] + function URL(url, base) { + (0, _classCallCheck2.default)(this, URL); + this._searchParamsInstance = null; + var baseUrl = null; + if (!base || validateBaseUrl(url)) { + this._url = url; + if (!this._url.endsWith('/')) { + this._url += '/'; + } + } else { + if (typeof base === 'string') { + baseUrl = base; + if (!validateBaseUrl(baseUrl)) { + throw new TypeError(`Invalid base URL: ${baseUrl}`); + } + } else { + baseUrl = base.toString(); + } + if (baseUrl.endsWith('/')) { + baseUrl = baseUrl.slice(0, baseUrl.length - 1); + } + if (!url.startsWith('/')) { + url = `/${url}`; + } + if (baseUrl.endsWith(url)) { + url = ''; + } + this._url = `${baseUrl}${url}`; + } + } + return (0, _createClass2.default)(URL, [{ + key: "hash", + get: function get() { + throw new Error('URL.hash is not implemented'); + } + }, { + key: "host", + get: function get() { + throw new Error('URL.host is not implemented'); + } + }, { + key: "hostname", + get: function get() { + throw new Error('URL.hostname is not implemented'); + } + }, { + key: "href", + get: function get() { + return this.toString(); + } + }, { + key: "origin", + get: function get() { + throw new Error('URL.origin is not implemented'); + } + }, { + key: "password", + get: function get() { + throw new Error('URL.password is not implemented'); + } + }, { + key: "pathname", + get: function get() { + throw new Error('URL.pathname not implemented'); + } + }, { + key: "port", + get: function get() { + throw new Error('URL.port is not implemented'); + } + }, { + key: "protocol", + get: function get() { + throw new Error('URL.protocol is not implemented'); + } + }, { + key: "search", + get: function get() { + throw new Error('URL.search is not implemented'); + } + }, { + key: "searchParams", + get: function get() { + if (this._searchParamsInstance == null) { + this._searchParamsInstance = new URLSearchParams(); + } + return this._searchParamsInstance; + } + }, { + key: "toJSON", + value: function toJSON() { + return this.toString(); + } + }, { + key: "toString", + value: function toString() { + if (this._searchParamsInstance === null) { + return this._url; + } + // $FlowFixMe[incompatible-use] + var instanceString = this._searchParamsInstance.toString(); + var separator = this._url.indexOf('?') > -1 ? '&' : '?'; + return this._url + separator + instanceString; + } + }, { + key: "username", + get: function get() { + throw new Error('URL.username is not implemented'); + } + }], [{ + key: "createObjectURL", + value: function createObjectURL(blob) { + if (BLOB_URL_PREFIX === null) { + throw new Error('Cannot create URL for blob!'); + } + return `${BLOB_URL_PREFIX}${blob.data.blobId}?offset=${blob.data.offset}&size=${blob.size}`; + } + }, { + key: "revokeObjectURL", + value: function revokeObjectURL(url) { + // Do nothing. + } + }]); + }(); +},173,[6,18,19,152],"node_modules\\react-native\\Libraries\\Blob\\URL.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * @author Toru Nagashima + * See LICENSE file in root directory for full license. + */ + 'use strict'; + + var _classCallCheck = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/createClass"); + var _possibleConstructorReturn = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/possibleConstructorReturn"); + var _getPrototypeOf = _$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/getPrototypeOf"); + var _inherits = _$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/inherits"); + function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + Object.defineProperty(exports, '__esModule', { + value: true + }); + /** + * The signal class. + * @see https://dom.spec.whatwg.org/#abortsignal + */ + var AbortSignal = /*#__PURE__*/function (_eventTargetShim$Even) { + /** + * AbortSignal cannot be constructed directly. + */ + function AbortSignal() { + var _this; + _classCallCheck(this, AbortSignal); + _this = _callSuper(this, AbortSignal); + throw new TypeError("AbortSignal cannot be constructed directly"); + return _this; + } + /** + * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise. + */ + _inherits(AbortSignal, _eventTargetShim$Even); + return _createClass(AbortSignal, [{ + key: "aborted", + get: function get() { + var aborted = abortedFlags.get(this); + if (typeof aborted !== "boolean") { + throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`); + } + return aborted; + } + }]); + }(_$$_REQUIRE(_dependencyMap[5], "event-target-shim").EventTarget); + _$$_REQUIRE(_dependencyMap[5], "event-target-shim").defineEventAttribute(AbortSignal.prototype, "abort"); + /** + * Create an AbortSignal object. + */ + function createAbortSignal() { + var signal = Object.create(AbortSignal.prototype); + _$$_REQUIRE(_dependencyMap[5], "event-target-shim").EventTarget.call(signal); + abortedFlags.set(signal, false); + return signal; + } + /** + * Abort a given signal. + */ + function abortSignal(signal) { + if (abortedFlags.get(signal) !== false) { + return; + } + abortedFlags.set(signal, true); + signal.dispatchEvent({ + type: "abort" + }); + } + /** + * Aborted flag for each instances. + */ + var abortedFlags = new WeakMap(); + // Properties should be enumerable. + Object.defineProperties(AbortSignal.prototype, { + aborted: { + enumerable: true + } + }); + // `toString()` should return `"[object AbortSignal]"` + if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { + Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, { + configurable: true, + value: "AbortSignal" + }); + } + + /** + * The AbortController. + * @see https://dom.spec.whatwg.org/#abortcontroller + */ + var AbortController = /*#__PURE__*/function () { + /** + * Initialize this controller. + */ + function AbortController() { + _classCallCheck(this, AbortController); + signals.set(this, createAbortSignal()); + } + /** + * Returns the `AbortSignal` object associated with this object. + */ + return _createClass(AbortController, [{ + key: "signal", + get: function get() { + return getSignal(this); + } + /** + * Abort and signal to any observers that the associated activity is to be aborted. + */ + }, { + key: "abort", + value: function abort() { + abortSignal(getSignal(this)); + } + }]); + }(); + /** + * Associated signals. + */ + var signals = new WeakMap(); + /** + * Get the associated signal of a given controller. + */ + function getSignal(controller) { + var signal = signals.get(controller); + if (signal == null) { + throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? "null" : typeof controller}`); + } + return signal; + } + // Properties should be enumerable. + Object.defineProperties(AbortController.prototype, { + signal: { + enumerable: true + }, + abort: { + enumerable: true + } + }); + if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { + Object.defineProperty(AbortController.prototype, Symbol.toStringTag, { + configurable: true, + value: "AbortController" + }); + } + exports.AbortController = AbortController; + exports.AbortSignal = AbortSignal; + exports.default = AbortController; + module.exports = AbortController; + module.exports.AbortController = module.exports["default"] = AbortController; + module.exports.AbortSignal = AbortSignal; +},174,[18,19,23,25,28,150],"node_modules\\abort-controller\\dist\\abort-controller.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + /** + * Set up alert(). + * You can use this module directly, or just require InitializeCore. + */ + if (!global.alert) { + global.alert = function (text) { + // Require Alert on demand. Requiring it too early can lead to issues + // with things like Platform not being fully initialized. + _$$_REQUIRE(_dependencyMap[0], "../Alert/Alert").alert('Alert', '' + text); + }; + } +},175,[176],"node_modules\\react-native\\Libraries\\Core\\setUpAlert.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../Utilities/Platform")); + var _RCTAlertManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "./RCTAlertManager")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + /** + * Launches an alert dialog with the specified title and message. + * + * See https://reactnative.dev/docs/alert + */ + var Alert = /*#__PURE__*/function () { + function Alert() { + (0, _classCallCheck2.default)(this, Alert); + } + return (0, _createClass2.default)(Alert, null, [{ + key: "alert", + value: function alert(title, message, buttons, options) { + if (_Platform.default.OS === 'ios') { + Alert.prompt(title, message, buttons, 'default', undefined, undefined, options); + } else if (_Platform.default.OS === 'android') { + var NativeDialogManagerAndroid = _$$_REQUIRE(_dependencyMap[5], "../NativeModules/specs/NativeDialogManagerAndroid").default; + if (!NativeDialogManagerAndroid) { + return; + } + var constants = NativeDialogManagerAndroid.getConstants(); + var config = { + title: title || '', + message: message || '', + cancelable: false + }; + if (options && options.cancelable) { + config.cancelable = options.cancelable; + } + // At most three buttons (neutral, negative, positive). Ignore rest. + // The text 'OK' should be probably localized. iOS Alert does that in native. + var defaultPositiveText = 'OK'; + var validButtons = buttons ? buttons.slice(0, 3) : [{ + text: defaultPositiveText + }]; + var buttonPositive = validButtons.pop(); + var buttonNegative = validButtons.pop(); + var buttonNeutral = validButtons.pop(); + if (buttonNeutral) { + config.buttonNeutral = buttonNeutral.text || ''; + } + if (buttonNegative) { + config.buttonNegative = buttonNegative.text || ''; + } + if (buttonPositive) { + config.buttonPositive = buttonPositive.text || defaultPositiveText; + } + + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by + * Flow's LTI update could not be added via codemod */ + var onAction = function onAction(action, buttonKey) { + if (action === constants.buttonClicked) { + if (buttonKey === constants.buttonNeutral) { + buttonNeutral.onPress && buttonNeutral.onPress(); + } else if (buttonKey === constants.buttonNegative) { + buttonNegative.onPress && buttonNegative.onPress(); + } else if (buttonKey === constants.buttonPositive) { + buttonPositive.onPress && buttonPositive.onPress(); + } + } else if (action === constants.dismissed) { + options && options.onDismiss && options.onDismiss(); + } + }; + var onError = function onError(errorMessage) { + return console.warn(errorMessage); + }; + NativeDialogManagerAndroid.showAlert(config, onError, onAction); + } + } + }, { + key: "prompt", + value: function prompt(title, message, callbackOrButtons) { + var type = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'plain-text'; + var defaultValue = arguments.length > 4 ? arguments[4] : undefined; + var keyboardType = arguments.length > 5 ? arguments[5] : undefined; + var options = arguments.length > 6 ? arguments[6] : undefined; + if (_Platform.default.OS === 'ios') { + var callbacks = []; + var buttons = []; + var cancelButtonKey; + var destructiveButtonKey; + var preferredButtonKey; + if (typeof callbackOrButtons === 'function') { + callbacks = [callbackOrButtons]; + } else if (Array.isArray(callbackOrButtons)) { + callbackOrButtons.forEach(function (btn, index) { + callbacks[index] = btn.onPress; + if (btn.style === 'cancel') { + cancelButtonKey = String(index); + } else if (btn.style === 'destructive') { + destructiveButtonKey = String(index); + } + if (btn.isPreferred) { + preferredButtonKey = String(index); + } + if (btn.text || index < (callbackOrButtons || []).length - 1) { + var btnDef = {}; + btnDef[index] = btn.text || ''; + buttons.push(btnDef); + } + }); + } + _RCTAlertManager.default.alertWithArgs({ + title: title || '', + message: message || undefined, + buttons: buttons, + type: type || undefined, + defaultValue: defaultValue, + cancelButtonKey: cancelButtonKey, + destructiveButtonKey: destructiveButtonKey, + preferredButtonKey: preferredButtonKey, + keyboardType: keyboardType, + userInterfaceStyle: (options == null ? void 0 : options.userInterfaceStyle) || undefined + }, function (id, value) { + var cb = callbacks[id]; + cb && cb(value); + }); + } + } + }]); + }(); + module.exports = Alert; +},176,[6,18,19,34,177,178],"node_modules\\react-native\\Libraries\\Alert\\Alert.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _NativeDialogManagerAndroid = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../NativeModules/specs/NativeDialogManagerAndroid")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + + function emptyCallback() {} + module.exports = { + alertWithArgs: function alertWithArgs(args, callback) { + // TODO(5998984): Polyfill it correctly with DialogManagerAndroid + if (!_NativeDialogManagerAndroid.default) { + return; + } + _NativeDialogManagerAndroid.default.showAlert(args, emptyCallback, callback || emptyCallback); + } + }; +},177,[6,178],"node_modules\\react-native\\Libraries\\Alert\\RCTAlertManager.android.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + /* 'buttonClicked' | 'dismissed' */ + /* + buttonPositive = -1, + buttonNegative = -2, + buttonNeutral = -3 + */ + var _default = exports.default = TurboModuleRegistry.get('DialogManagerAndroid'); +},178,[36],"node_modules\\react-native\\Libraries\\NativeModules\\specs\\NativeDialogManagerAndroid.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var navigator = global.navigator; + if (navigator === undefined) { + // $FlowExpectedError[cannot-write] The global isn't writable anywhere but here, where we define it. + global.navigator = { + product: 'ReactNative' + }; + } else { + // see https://github.com/facebook/react-native/issues/10881 + _$$_REQUIRE(_dependencyMap[0], "../Utilities/PolyfillFunctions").polyfillObjectProperty(navigator, 'product', function () { + return 'ReactNative'; + }); + } +},179,[134],"node_modules\\react-native\\Libraries\\Core\\setUpNavigator.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var registerModule; + if (global.RN$Bridgeless === true && global.RN$registerCallableModule) { + registerModule = global.RN$registerCallableModule; + } else { + var BatchedBridge = _$$_REQUIRE(_dependencyMap[0], "../BatchedBridge/BatchedBridge"); + registerModule = function registerModule(moduleName, + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by + * Flow's LTI update could not be added via codemod */ + factory) { + return BatchedBridge.registerLazyCallableModule(moduleName, factory); + }; + } + registerModule('Systrace', function () { + return _$$_REQUIRE(_dependencyMap[1], "../Performance/Systrace"); + }); + if (!(global.RN$Bridgeless === true)) { + registerModule('JSTimers', function () { + return _$$_REQUIRE(_dependencyMap[2], "./Timers/JSTimers"); + }); + } + registerModule('HeapCapture', function () { + return _$$_REQUIRE(_dependencyMap[3], "../HeapCapture/HeapCapture"); + }); + registerModule('SamplingProfiler', function () { + return _$$_REQUIRE(_dependencyMap[4], "../Performance/SamplingProfiler"); + }); + registerModule('RCTLog', function () { + return _$$_REQUIRE(_dependencyMap[5], "../Utilities/RCTLog"); + }); + registerModule('RCTDeviceEventEmitter', function () { + return _$$_REQUIRE(_dependencyMap[6], "../EventEmitter/RCTDeviceEventEmitter").default; + }); + registerModule('RCTNativeAppEventEmitter', function () { + return _$$_REQUIRE(_dependencyMap[7], "../EventEmitter/RCTNativeAppEventEmitter"); + }); + registerModule('GlobalPerformanceLogger', function () { + return _$$_REQUIRE(_dependencyMap[8], "../Utilities/GlobalPerformanceLogger"); + }); + if (__DEV__) { + registerModule('HMRClient', function () { + return _$$_REQUIRE(_dependencyMap[9], "../Utilities/HMRClient"); + }); + } else { + registerModule('HMRClient', function () { + return _$$_REQUIRE(_dependencyMap[10], "../Utilities/HMRClientProdShim"); + }); + } +},180,[39,33,144,181,183,96,17,185,155,186,201],"node_modules\\react-native\\Libraries\\Core\\setUpBatchedBridge.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _NativeJSCHeapCapture = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./NativeJSCHeapCapture")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var HeapCapture = { + captureHeap: function captureHeap(path) { + var error = null; + try { + global.nativeCaptureHeap(path); + console.log('HeapCapture.captureHeap succeeded: ' + path); + } catch (e) { + console.log('HeapCapture.captureHeap error: ' + e.toString()); + error = e.toString(); + } + if (_NativeJSCHeapCapture.default) { + _NativeJSCHeapCapture.default.captureComplete(path, error); + } + } + }; + module.exports = HeapCapture; +},181,[6,182],"node_modules\\react-native\\Libraries\\HeapCapture\\HeapCapture.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('JSCHeapCapture'); +},182,[36],"node_modules\\react-native\\Libraries\\HeapCapture\\NativeJSCHeapCapture.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var SamplingProfiler = { + poke: function poke(token) { + var error = null; + var result = null; + try { + result = global.pokeSamplingProfiler(); + if (result === null) { + console.log('The JSC Sampling Profiler has started'); + } else { + console.log('The JSC Sampling Profiler has stopped'); + } + } catch (e) { + console.log('Error occurred when restarting Sampling Profiler: ' + e.toString()); + error = e.toString(); + } + var NativeJSCSamplingProfiler = _$$_REQUIRE(_dependencyMap[0], "./NativeJSCSamplingProfiler").default; + if (NativeJSCSamplingProfiler) { + NativeJSCSamplingProfiler.operationComplete(token, result, error); + } + } + }; + module.exports = SamplingProfiler; +},183,[184],"node_modules\\react-native\\Libraries\\Performance\\SamplingProfiler.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('JSCSamplingProfiler'); +},184,[36],"node_modules\\react-native\\Libraries\\Performance\\NativeJSCSamplingProfiler.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _RCTDeviceEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./RCTDeviceEventEmitter")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + /** + * Deprecated - subclass NativeEventEmitter to create granular event modules instead of + * adding all event listeners directly to RCTNativeAppEventEmitter. + */ + var RCTNativeAppEventEmitter = _RCTDeviceEventEmitter.default; + module.exports = RCTNativeAppEventEmitter; +},185,[6,17],"node_modules\\react-native\\Libraries\\EventEmitter\\RCTNativeAppEventEmitter.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _getDevServer2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../Core/Devtools/getDevServer")); + var _LogBox = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../LogBox/LogBox")); + var _NativeRedBox = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../NativeModules/specs/NativeRedBox")); /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var pendingEntryPoints = []; + var hmrClient = null; + var hmrUnavailableReason = null; + var currentCompileErrorMessage = null; + var didConnect = false; + var pendingLogs = []; + /** + * HMR Client that receives from the server HMR updates and propagates them + * runtime to reflects those changes. + */ + var HMRClient = { + enable: function enable() { + if (hmrUnavailableReason !== null) { + // If HMR became unavailable while you weren't using it, + // explain why when you try to turn it on. + // This is an error (and not a warning) because it is shown + // in response to a direct user action. + throw new Error(hmrUnavailableReason); + } + _$$_REQUIRE(_dependencyMap[5], "invariant")(hmrClient, 'Expected HMRClient.setup() call at startup.'); + var LoadingView = _$$_REQUIRE(_dependencyMap[6], "./LoadingView"); + + // We use this for internal logging only. + // It doesn't affect the logic. + hmrClient.send(JSON.stringify({ + type: 'log-opt-in' + })); + + // When toggling Fast Refresh on, we might already have some stashed updates. + // Since they'll get applied now, we'll show a banner. + var hasUpdates = hmrClient.hasPendingUpdates(); + if (hasUpdates) { + LoadingView.showMessage('Refreshing...', 'refresh'); + } + try { + hmrClient.enable(); + } finally { + if (hasUpdates) { + LoadingView.hide(); + } + } + + // There could be a compile error while Fast Refresh was off, + // but we ignored it at the time. Show it now. + showCompileError(); + }, + disable: function disable() { + _$$_REQUIRE(_dependencyMap[5], "invariant")(hmrClient, 'Expected HMRClient.setup() call at startup.'); + hmrClient.disable(); + }, + registerBundle: function registerBundle(requestUrl) { + _$$_REQUIRE(_dependencyMap[5], "invariant")(hmrClient, 'Expected HMRClient.setup() call at startup.'); + pendingEntryPoints.push(requestUrl); + registerBundleEntryPoints(hmrClient); + }, + log: function log(level, data) { + if (!hmrClient) { + // Catch a reasonable number of early logs + // in case hmrClient gets initialized later. + pendingLogs.push([level, data]); + if (pendingLogs.length > 100) { + pendingLogs.shift(); + } + return; + } + try { + hmrClient.send(JSON.stringify({ + type: 'log', + level: level, + mode: global.RN$Bridgeless === true ? 'NOBRIDGE' : 'BRIDGE', + data: data.map(function (item) { + return typeof item === 'string' ? item : _$$_REQUIRE(_dependencyMap[7], "pretty-format")(item, { + escapeString: true, + highlight: true, + maxDepth: 3, + min: true, + plugins: [_$$_REQUIRE(_dependencyMap[7], "pretty-format").plugins.ReactElement] + }); + }) + })); + } catch (error) { + // If sending logs causes any failures we want to silently ignore them + // to ensure we do not cause infinite-logging loops. + } + }, + // Called once by the bridge on startup, even if Fast Refresh is off. + // It creates the HMR client but doesn't actually set up the socket yet. + setup: function setup(platform, bundleEntry, host, port, isEnabled) { + var scheme = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'http'; + _$$_REQUIRE(_dependencyMap[5], "invariant")(platform, 'Missing required parameter `platform`'); + _$$_REQUIRE(_dependencyMap[5], "invariant")(bundleEntry, 'Missing required parameter `bundleEntry`'); + _$$_REQUIRE(_dependencyMap[5], "invariant")(host, 'Missing required parameter `host`'); + _$$_REQUIRE(_dependencyMap[5], "invariant")(!hmrClient, 'Cannot initialize hmrClient twice'); + + // Moving to top gives errors due to NativeModules not being initialized + var LoadingView = _$$_REQUIRE(_dependencyMap[6], "./LoadingView"); + var serverHost = port !== null && port !== '' ? `${host}:${port}` : host; + var serverScheme = scheme; + var client = new (_$$_REQUIRE(_dependencyMap[8], "metro-runtime/src/modules/HMRClient"))(`${serverScheme}://${serverHost}/hot`); + hmrClient = client; + var _getDevServer = (0, _getDevServer2.default)(), + fullBundleUrl = _getDevServer.fullBundleUrl; + pendingEntryPoints.push(// HMRServer understands regular bundle URLs, so prefer that in case + // there are any important URL parameters we can't reconstruct from + // `setup()`'s arguments. + fullBundleUrl != null ? fullBundleUrl : `${serverScheme}://${serverHost}/hot?bundleEntry=${bundleEntry}&platform=${platform}`); + client.on('connection-error', function (e) { + var error = `Cannot connect to Metro. + +Try the following to fix the issue: +- Ensure that Metro is running and available on the same network`; + if ("android" === 'ios') { + error += ` +- Ensure that the Metro URL is correctly set in AppDelegate`; + } else { + error += ` +- Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices +- If you're on a physical device connected to the same machine, run 'adb reverse tcp:8081 tcp:8081' to forward requests from your device +- If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to your machine's IP address and the port of the local dev server - e.g. 10.0.1.1:8081`; + } + error += ` + +URL: ${host}:${port} + +Error: ${e.message}`; + setHMRUnavailableReason(error); + }); + client.on('update-start', function (_ref) { + var isInitialUpdate = _ref.isInitialUpdate; + currentCompileErrorMessage = null; + didConnect = true; + if (client.isEnabled() && !isInitialUpdate) { + LoadingView.showMessage('Refreshing...', 'refresh'); + } + }); + client.on('update', function (_ref2) { + var isInitialUpdate = _ref2.isInitialUpdate; + if (client.isEnabled() && !isInitialUpdate) { + dismissRedbox(); + _LogBox.default.clearAllLogs(); + } + }); + client.on('update-done', function () { + LoadingView.hide(); + }); + client.on('error', function (data) { + LoadingView.hide(); + if (data.type === 'GraphNotFoundError') { + client.close(); + setHMRUnavailableReason('Metro has restarted since the last edit. Reload to reconnect.'); + } else if (data.type === 'RevisionNotFoundError') { + client.close(); + setHMRUnavailableReason('Metro and the client are out of sync. Reload to reconnect.'); + } else { + currentCompileErrorMessage = `${data.type} ${data.message}`; + if (client.isEnabled()) { + showCompileError(); + } + } + }); + client.on('close', function (closeEvent) { + LoadingView.hide(); + + // https://www.rfc-editor.org/rfc/rfc6455.html#section-7.4.1 + // https://www.rfc-editor.org/rfc/rfc6455.html#section-7.1.5 + var isNormalOrUnsetCloseReason = closeEvent == null || closeEvent.code === 1000 || closeEvent.code === 1005 || closeEvent.code == null; + setHMRUnavailableReason(`${isNormalOrUnsetCloseReason ? 'Disconnected from Metro.' : `Disconnected from Metro (${closeEvent.code}: "${closeEvent.reason}").`} + +To reconnect: +- Ensure that Metro is running and available on the same network +- Reload this app (will trigger further help if Metro cannot be connected to) + `); + }); + if (isEnabled) { + HMRClient.enable(); + } else { + HMRClient.disable(); + } + registerBundleEntryPoints(hmrClient); + flushEarlyLogs(hmrClient); + } + }; + function setHMRUnavailableReason(reason) { + _$$_REQUIRE(_dependencyMap[5], "invariant")(hmrClient, 'Expected HMRClient.setup() call at startup.'); + if (hmrUnavailableReason !== null) { + // Don't show more than one warning. + return; + } + hmrUnavailableReason = reason; + + // We only want to show a warning if Fast Refresh is on *and* if we ever + // previously managed to connect successfully. We don't want to show + // the warning to native engineers who use cached bundles without Metro. + if (hmrClient.isEnabled() && didConnect) { + console.warn(reason); + // (Not using the `warning` module to prevent a Buck cycle.) + } + } + function registerBundleEntryPoints(client) { + if (hmrUnavailableReason != null) { + _$$_REQUIRE(_dependencyMap[9], "./DevSettings").reload('Bundle Splitting – Metro disconnected'); + return; + } + if (pendingEntryPoints.length > 0) { + client.send(JSON.stringify({ + type: 'register-entrypoints', + entryPoints: pendingEntryPoints + })); + pendingEntryPoints.length = 0; + } + } + function flushEarlyLogs(client) { + try { + pendingLogs.forEach(function (_ref3) { + var _ref4 = (0, _slicedToArray2.default)(_ref3, 2), + level = _ref4[0], + data = _ref4[1]; + HMRClient.log(level, data); + }); + } finally { + pendingLogs.length = 0; + } + } + function dismissRedbox() { + if ("android" === 'ios' && _NativeRedBox.default != null && _NativeRedBox.default.dismiss != null) { + _NativeRedBox.default.dismiss(); + } else { + var NativeExceptionsManager = _$$_REQUIRE(_dependencyMap[10], "../Core/NativeExceptionsManager").default; + NativeExceptionsManager && NativeExceptionsManager.dismissRedbox && NativeExceptionsManager.dismissRedbox(); + } + } + function showCompileError() { + if (currentCompileErrorMessage === null) { + return; + } + + // Even if there is already a redbox, syntax errors are more important. + // Otherwise you risk seeing a stale runtime error while a syntax error is more recent. + dismissRedbox(); + var message = currentCompileErrorMessage; + currentCompileErrorMessage = null; + + /* $FlowFixMe[class-object-subtyping] added when improving typing for this + * parameters */ + var error = new Error(message); + // Symbolicating compile errors is wasted effort + // because the stack trace is meaningless: + error.preventSymbolication = true; + throw error; + } + module.exports = HMRClient; +},186,[6,7,102,95,187,37,188,115,197,199,112],"node_modules\\react-native\\Libraries\\Utilities\\HMRClient.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('RedBox'); +},187,[36],"node_modules\\react-native\\Libraries\\NativeModules\\specs\\NativeRedBox.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _processColor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../StyleSheet/processColor")); + var _Appearance = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "./Appearance")); + var _NativeDevLoadingView = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "./NativeDevLoadingView")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + module.exports = { + showMessage: function showMessage(message, type) { + if (_NativeDevLoadingView.default) { + var backgroundColor; + var textColor; + if (type === 'refresh') { + backgroundColor = (0, _processColor.default)('#2584e8'); + textColor = (0, _processColor.default)('#ffffff'); + } else if (type === 'load') { + if (_Appearance.default.getColorScheme() === 'dark') { + backgroundColor = (0, _processColor.default)('#fafafa'); + textColor = (0, _processColor.default)('#242526'); + } else { + backgroundColor = (0, _processColor.default)('#404040'); + textColor = (0, _processColor.default)('#ffffff'); + } + } + _NativeDevLoadingView.default.showMessage(message, typeof textColor === 'number' ? textColor : null, typeof backgroundColor === 'number' ? backgroundColor : null); + } + }, + hide: function hide() { + _NativeDevLoadingView.default && _NativeDevLoadingView.default.hide(); + } + }; +},188,[6,189,193,196],"node_modules\\react-native\\Libraries\\Utilities\\LoadingView.android.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + /* eslint no-bitwise: 0 */ + function processColor(color) { + if (color === undefined || color === null) { + return color; + } + var normalizedColor = _$$_REQUIRE(_dependencyMap[0], "./normalizeColor")(color); + if (normalizedColor === null || normalizedColor === undefined) { + return undefined; + } + if (typeof normalizedColor === 'object') { + var processColorObject = _$$_REQUIRE(_dependencyMap[1], "./PlatformColorValueTypes").processColorObject; + var processedColorObj = processColorObject(normalizedColor); + if (processedColorObj != null) { + return processedColorObj; + } + } + if (typeof normalizedColor !== 'number') { + return null; + } + + // Converts 0xrrggbbaa into 0xaarrggbb + normalizedColor = (normalizedColor << 24 | normalizedColor >>> 8) >>> 0; + if ("android" === 'android') { + // Android use 32 bit *signed* integer to represent the color + // We utilize the fact that bitwise operations in JS also operates on + // signed 32 bit integers, so that we can use those to convert from + // *unsigned* to *signed* 32bit int that way. + normalizedColor = normalizedColor | 0x0; + } + return normalizedColor; + } + var _default = exports.default = processColor; +},189,[190,192],"node_modules\\react-native\\Libraries\\StyleSheet\\processColor.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _normalizeColors = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@react-native/normalize-colors")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + /* eslint no-bitwise: 0 */ + + function normalizeColor(color) { + if (typeof color === 'object' && color != null) { + var _require = _$$_REQUIRE(_dependencyMap[2], "./PlatformColorValueTypes"), + normalizeColorObject = _require.normalizeColorObject; + var normalizedColor = normalizeColorObject(color); + if (normalizedColor != null) { + return normalizedColor; + } + } + if (typeof color === 'string' || typeof color === 'number') { + return (0, _normalizeColors.default)(color); + } + } + module.exports = normalizeColor; +},190,[6,191,192],"node_modules\\react-native\\Libraries\\StyleSheet\\normalizeColor.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + /* eslint no-bitwise: 0 */ + + 'use strict'; + + function normalizeColor(color) { + if (typeof color === 'number') { + if (color >>> 0 === color && color >= 0 && color <= 0xffffffff) { + return color; + } + return null; + } + if (typeof color !== 'string') { + return null; + } + var matchers = getMatchers(); + var match; + + // Ordered based on occurrences on Facebook codebase + if (match = matchers.hex6.exec(color)) { + return parseInt(match[1] + 'ff', 16) >>> 0; + } + var colorFromKeyword = normalizeKeyword(color); + if (colorFromKeyword != null) { + return colorFromKeyword; + } + if (match = matchers.rgb.exec(color)) { + return (parse255(match[1]) << 24 | + // r + parse255(match[2]) << 16 | + // g + parse255(match[3]) << 8 | + // b + 0x000000ff) >>> + // a + 0; + } + if (match = matchers.rgba.exec(color)) { + // rgba(R G B / A) notation + if (match[6] !== undefined) { + return (parse255(match[6]) << 24 | + // r + parse255(match[7]) << 16 | + // g + parse255(match[8]) << 8 | + // b + parse1(match[9])) >>> + // a + 0; + } + + // rgba(R, G, B, A) notation + return (parse255(match[2]) << 24 | + // r + parse255(match[3]) << 16 | + // g + parse255(match[4]) << 8 | + // b + parse1(match[5])) >>> + // a + 0; + } + if (match = matchers.hex3.exec(color)) { + return parseInt(match[1] + match[1] + + // r + match[2] + match[2] + + // g + match[3] + match[3] + + // b + 'ff', + // a + 16) >>> 0; + } + + // https://drafts.csswg.org/css-color-4/#hex-notation + if (match = matchers.hex8.exec(color)) { + return parseInt(match[1], 16) >>> 0; + } + if (match = matchers.hex4.exec(color)) { + return parseInt(match[1] + match[1] + + // r + match[2] + match[2] + + // g + match[3] + match[3] + + // b + match[4] + match[4], + // a + 16) >>> 0; + } + if (match = matchers.hsl.exec(color)) { + return (hslToRgb(parse360(match[1]), + // h + parsePercentage(match[2]), + // s + parsePercentage(match[3]) // l + ) | 0x000000ff) >>> + // a + 0; + } + if (match = matchers.hsla.exec(color)) { + // hsla(H S L / A) notation + if (match[6] !== undefined) { + return (hslToRgb(parse360(match[6]), + // h + parsePercentage(match[7]), + // s + parsePercentage(match[8]) // l + ) | parse1(match[9])) >>> + // a + 0; + } + + // hsla(H, S, L, A) notation + return (hslToRgb(parse360(match[2]), + // h + parsePercentage(match[3]), + // s + parsePercentage(match[4]) // l + ) | parse1(match[5])) >>> + // a + 0; + } + if (match = matchers.hwb.exec(color)) { + return (hwbToRgb(parse360(match[1]), + // h + parsePercentage(match[2]), + // w + parsePercentage(match[3]) // b + ) | 0x000000ff) >>> + // a + 0; + } + return null; + } + function hue2rgb(p, q, t) { + if (t < 0) { + t += 1; + } + if (t > 1) { + t -= 1; + } + if (t < 1 / 6) { + return p + (q - p) * 6 * t; + } + if (t < 1 / 2) { + return q; + } + if (t < 2 / 3) { + return p + (q - p) * (2 / 3 - t) * 6; + } + return p; + } + function hslToRgb(h, s, l) { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + var r = hue2rgb(p, q, h + 1 / 3); + var g = hue2rgb(p, q, h); + var b = hue2rgb(p, q, h - 1 / 3); + return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8; + } + function hwbToRgb(h, w, b) { + if (w + b >= 1) { + var gray = Math.round(w * 255 / (w + b)); + return gray << 24 | gray << 16 | gray << 8; + } + var red = hue2rgb(0, 1, h + 1 / 3) * (1 - w - b) + w; + var green = hue2rgb(0, 1, h) * (1 - w - b) + w; + var blue = hue2rgb(0, 1, h - 1 / 3) * (1 - w - b) + w; + return Math.round(red * 255) << 24 | Math.round(green * 255) << 16 | Math.round(blue * 255) << 8; + } + var NUMBER = '[-+]?\\d*\\.?\\d+'; + var PERCENTAGE = NUMBER + '%'; + function call() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return '\\(\\s*(' + args.join(')\\s*,?\\s*(') + ')\\s*\\)'; + } + function callWithSlashSeparator() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + return '\\(\\s*(' + args.slice(0, args.length - 1).join(')\\s*,?\\s*(') + ')\\s*/\\s*(' + args[args.length - 1] + ')\\s*\\)'; + } + function commaSeparatedCall() { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + return '\\(\\s*(' + args.join(')\\s*,\\s*(') + ')\\s*\\)'; + } + var cachedMatchers; + function getMatchers() { + if (cachedMatchers === undefined) { + cachedMatchers = { + rgb: new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER)), + rgba: new RegExp('rgba(' + commaSeparatedCall(NUMBER, NUMBER, NUMBER, NUMBER) + '|' + callWithSlashSeparator(NUMBER, NUMBER, NUMBER, NUMBER) + ')'), + hsl: new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE)), + hsla: new RegExp('hsla(' + commaSeparatedCall(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER) + '|' + callWithSlashSeparator(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER) + ')'), + hwb: new RegExp('hwb' + call(NUMBER, PERCENTAGE, PERCENTAGE)), + hex3: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, + hex4: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, + hex6: /^#([0-9a-fA-F]{6})$/, + hex8: /^#([0-9a-fA-F]{8})$/ + }; + } + return cachedMatchers; + } + function parse255(str) { + var int = parseInt(str, 10); + if (int < 0) { + return 0; + } + if (int > 255) { + return 255; + } + return int; + } + function parse360(str) { + var int = parseFloat(str); + return (int % 360 + 360) % 360 / 360; + } + function parse1(str) { + var num = parseFloat(str); + if (num < 0) { + return 0; + } + if (num > 1) { + return 255; + } + return Math.round(num * 255); + } + function parsePercentage(str) { + // parseFloat conveniently ignores the final % + var int = parseFloat(str); + if (int < 0) { + return 0; + } + if (int > 100) { + return 1; + } + return int / 100; + } + function normalizeKeyword(name) { + // prettier-ignore + switch (name) { + case 'transparent': + return 0x00000000; + // http://www.w3.org/TR/css3-color/#svg-color + case 'aliceblue': + return 0xf0f8ffff; + case 'antiquewhite': + return 0xfaebd7ff; + case 'aqua': + return 0x00ffffff; + case 'aquamarine': + return 0x7fffd4ff; + case 'azure': + return 0xf0ffffff; + case 'beige': + return 0xf5f5dcff; + case 'bisque': + return 0xffe4c4ff; + case 'black': + return 0x000000ff; + case 'blanchedalmond': + return 0xffebcdff; + case 'blue': + return 0x0000ffff; + case 'blueviolet': + return 0x8a2be2ff; + case 'brown': + return 0xa52a2aff; + case 'burlywood': + return 0xdeb887ff; + case 'burntsienna': + return 0xea7e5dff; + case 'cadetblue': + return 0x5f9ea0ff; + case 'chartreuse': + return 0x7fff00ff; + case 'chocolate': + return 0xd2691eff; + case 'coral': + return 0xff7f50ff; + case 'cornflowerblue': + return 0x6495edff; + case 'cornsilk': + return 0xfff8dcff; + case 'crimson': + return 0xdc143cff; + case 'cyan': + return 0x00ffffff; + case 'darkblue': + return 0x00008bff; + case 'darkcyan': + return 0x008b8bff; + case 'darkgoldenrod': + return 0xb8860bff; + case 'darkgray': + return 0xa9a9a9ff; + case 'darkgreen': + return 0x006400ff; + case 'darkgrey': + return 0xa9a9a9ff; + case 'darkkhaki': + return 0xbdb76bff; + case 'darkmagenta': + return 0x8b008bff; + case 'darkolivegreen': + return 0x556b2fff; + case 'darkorange': + return 0xff8c00ff; + case 'darkorchid': + return 0x9932ccff; + case 'darkred': + return 0x8b0000ff; + case 'darksalmon': + return 0xe9967aff; + case 'darkseagreen': + return 0x8fbc8fff; + case 'darkslateblue': + return 0x483d8bff; + case 'darkslategray': + return 0x2f4f4fff; + case 'darkslategrey': + return 0x2f4f4fff; + case 'darkturquoise': + return 0x00ced1ff; + case 'darkviolet': + return 0x9400d3ff; + case 'deeppink': + return 0xff1493ff; + case 'deepskyblue': + return 0x00bfffff; + case 'dimgray': + return 0x696969ff; + case 'dimgrey': + return 0x696969ff; + case 'dodgerblue': + return 0x1e90ffff; + case 'firebrick': + return 0xb22222ff; + case 'floralwhite': + return 0xfffaf0ff; + case 'forestgreen': + return 0x228b22ff; + case 'fuchsia': + return 0xff00ffff; + case 'gainsboro': + return 0xdcdcdcff; + case 'ghostwhite': + return 0xf8f8ffff; + case 'gold': + return 0xffd700ff; + case 'goldenrod': + return 0xdaa520ff; + case 'gray': + return 0x808080ff; + case 'green': + return 0x008000ff; + case 'greenyellow': + return 0xadff2fff; + case 'grey': + return 0x808080ff; + case 'honeydew': + return 0xf0fff0ff; + case 'hotpink': + return 0xff69b4ff; + case 'indianred': + return 0xcd5c5cff; + case 'indigo': + return 0x4b0082ff; + case 'ivory': + return 0xfffff0ff; + case 'khaki': + return 0xf0e68cff; + case 'lavender': + return 0xe6e6faff; + case 'lavenderblush': + return 0xfff0f5ff; + case 'lawngreen': + return 0x7cfc00ff; + case 'lemonchiffon': + return 0xfffacdff; + case 'lightblue': + return 0xadd8e6ff; + case 'lightcoral': + return 0xf08080ff; + case 'lightcyan': + return 0xe0ffffff; + case 'lightgoldenrodyellow': + return 0xfafad2ff; + case 'lightgray': + return 0xd3d3d3ff; + case 'lightgreen': + return 0x90ee90ff; + case 'lightgrey': + return 0xd3d3d3ff; + case 'lightpink': + return 0xffb6c1ff; + case 'lightsalmon': + return 0xffa07aff; + case 'lightseagreen': + return 0x20b2aaff; + case 'lightskyblue': + return 0x87cefaff; + case 'lightslategray': + return 0x778899ff; + case 'lightslategrey': + return 0x778899ff; + case 'lightsteelblue': + return 0xb0c4deff; + case 'lightyellow': + return 0xffffe0ff; + case 'lime': + return 0x00ff00ff; + case 'limegreen': + return 0x32cd32ff; + case 'linen': + return 0xfaf0e6ff; + case 'magenta': + return 0xff00ffff; + case 'maroon': + return 0x800000ff; + case 'mediumaquamarine': + return 0x66cdaaff; + case 'mediumblue': + return 0x0000cdff; + case 'mediumorchid': + return 0xba55d3ff; + case 'mediumpurple': + return 0x9370dbff; + case 'mediumseagreen': + return 0x3cb371ff; + case 'mediumslateblue': + return 0x7b68eeff; + case 'mediumspringgreen': + return 0x00fa9aff; + case 'mediumturquoise': + return 0x48d1ccff; + case 'mediumvioletred': + return 0xc71585ff; + case 'midnightblue': + return 0x191970ff; + case 'mintcream': + return 0xf5fffaff; + case 'mistyrose': + return 0xffe4e1ff; + case 'moccasin': + return 0xffe4b5ff; + case 'navajowhite': + return 0xffdeadff; + case 'navy': + return 0x000080ff; + case 'oldlace': + return 0xfdf5e6ff; + case 'olive': + return 0x808000ff; + case 'olivedrab': + return 0x6b8e23ff; + case 'orange': + return 0xffa500ff; + case 'orangered': + return 0xff4500ff; + case 'orchid': + return 0xda70d6ff; + case 'palegoldenrod': + return 0xeee8aaff; + case 'palegreen': + return 0x98fb98ff; + case 'paleturquoise': + return 0xafeeeeff; + case 'palevioletred': + return 0xdb7093ff; + case 'papayawhip': + return 0xffefd5ff; + case 'peachpuff': + return 0xffdab9ff; + case 'peru': + return 0xcd853fff; + case 'pink': + return 0xffc0cbff; + case 'plum': + return 0xdda0ddff; + case 'powderblue': + return 0xb0e0e6ff; + case 'purple': + return 0x800080ff; + case 'rebeccapurple': + return 0x663399ff; + case 'red': + return 0xff0000ff; + case 'rosybrown': + return 0xbc8f8fff; + case 'royalblue': + return 0x4169e1ff; + case 'saddlebrown': + return 0x8b4513ff; + case 'salmon': + return 0xfa8072ff; + case 'sandybrown': + return 0xf4a460ff; + case 'seagreen': + return 0x2e8b57ff; + case 'seashell': + return 0xfff5eeff; + case 'sienna': + return 0xa0522dff; + case 'silver': + return 0xc0c0c0ff; + case 'skyblue': + return 0x87ceebff; + case 'slateblue': + return 0x6a5acdff; + case 'slategray': + return 0x708090ff; + case 'slategrey': + return 0x708090ff; + case 'snow': + return 0xfffafaff; + case 'springgreen': + return 0x00ff7fff; + case 'steelblue': + return 0x4682b4ff; + case 'tan': + return 0xd2b48cff; + case 'teal': + return 0x008080ff; + case 'thistle': + return 0xd8bfd8ff; + case 'tomato': + return 0xff6347ff; + case 'turquoise': + return 0x40e0d0ff; + case 'violet': + return 0xee82eeff; + case 'wheat': + return 0xf5deb3ff; + case 'white': + return 0xffffffff; + case 'whitesmoke': + return 0xf5f5f5ff; + case 'yellow': + return 0xffff00ff; + case 'yellowgreen': + return 0x9acd32ff; + } + return null; + } + module.exports = normalizeColor; +},191,[],"node_modules\\@react-native\\normalize-colors\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.processColorObject = exports.normalizeColorObject = exports.PlatformColor = void 0; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + /** The actual type of the opaque NativeColorValue on Android platform */ + + var PlatformColor = exports.PlatformColor = function PlatformColor() { + for (var _len = arguments.length, names = new Array(_len), _key = 0; _key < _len; _key++) { + names[_key] = arguments[_key]; + } + /* $FlowExpectedError[incompatible-return] + * LocalNativeColorValue is the actual type of the opaque NativeColorValue on Android platform */ + return { + resource_paths: names + }; + }; + var normalizeColorObject = exports.normalizeColorObject = function normalizeColorObject(color) { + /* $FlowExpectedError[incompatible-cast] + * LocalNativeColorValue is the actual type of the opaque NativeColorValue on Android platform */ + if ('resource_paths' in color) { + return color; + } + return null; + }; + var processColorObject = exports.processColorObject = function processColorObject(color) { + return color; + }; +},192,[],"node_modules\\react-native\\Libraries\\StyleSheet\\PlatformColorValueTypes.android.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _NativeEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../EventEmitter/NativeEventEmitter")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../Utilities/Platform")); + var _EventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../vendor/emitter/EventEmitter")); + var _NativeAppearance = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "./NativeAppearance")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "invariant")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var eventEmitter = new _EventEmitter.default(); + if (_NativeAppearance.default) { + var nativeEventEmitter = new _NativeEventEmitter.default( + // T88715063: NativeEventEmitter only used this parameter on iOS. Now it uses it on all platforms, so this code was modified automatically to preserve its behavior + // If you want to use the native module on other platforms, please remove this condition and test its behavior + _Platform.default.OS !== 'ios' ? null : _NativeAppearance.default); + nativeEventEmitter.addListener('appearanceChanged', function (newAppearance) { + var colorScheme = newAppearance.colorScheme; + (0, _invariant.default)(colorScheme === 'dark' || colorScheme === 'light' || colorScheme == null, "Unrecognized color scheme. Did you mean 'dark' or 'light'?"); + eventEmitter.emit('change', { + colorScheme: colorScheme + }); + }); + } + module.exports = { + /** + * Note: Although color scheme is available immediately, it may change at any + * time. Any rendering logic or styles that depend on this should try to call + * this function on every render, rather than caching the value (for example, + * using inline styles rather than setting a value in a `StyleSheet`). + * + * Example: `const colorScheme = Appearance.getColorScheme();` + * + * @returns {?ColorSchemeName} Value for the color scheme preference. + */ + getColorScheme: function getColorScheme() { + if (__DEV__) { + if (_$$_REQUIRE(_dependencyMap[6], "./DebugEnvironment").isAsyncDebugging) { + // Hard code light theme when using the async debugger as + // sync calls aren't supported + return 'light'; + } + } + + // TODO: (hramos) T52919652 Use ?ColorSchemeName once codegen supports union + var nativeColorScheme = _NativeAppearance.default == null ? null : _NativeAppearance.default.getColorScheme() || null; + (0, _invariant.default)(nativeColorScheme === 'dark' || nativeColorScheme === 'light' || nativeColorScheme == null, "Unrecognized color scheme. Did you mean 'dark' or 'light'?"); + return nativeColorScheme; + }, + setColorScheme: function setColorScheme(colorScheme) { + var nativeColorScheme = colorScheme == null ? 'unspecified' : colorScheme; + (0, _invariant.default)(colorScheme === 'dark' || colorScheme === 'light' || colorScheme == null, "Unrecognized color scheme. Did you mean 'dark', 'light' or null?"); + if (_NativeAppearance.default != null && _NativeAppearance.default.setColorScheme != null) { + _NativeAppearance.default.setColorScheme(nativeColorScheme); + } + }, + /** + * Add an event handler that is fired when appearance preferences change. + */ + addChangeListener: function addChangeListener(listener) { + return eventEmitter.addListener('change', listener); + } + }; +},193,[6,160,34,30,194,37,195],"node_modules\\react-native\\Libraries\\Utilities\\Appearance.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('Appearance'); +},194,[36],"node_modules\\react-native\\Libraries\\Utilities\\NativeAppearance.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.isAsyncDebugging = void 0; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var isAsyncDebugging = exports.isAsyncDebugging = false; + if (__DEV__) { + // These native interfaces don't exist in asynchronous debugging environments. + exports.isAsyncDebugging = isAsyncDebugging = !global.nativeExtensions && !global.nativeCallSyncHook && !global.RN$Bridgeless; + } +},195,[],"node_modules\\react-native\\Libraries\\Utilities\\DebugEnvironment.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('DevLoadingView'); +},196,[36],"node_modules\\react-native\\Libraries\\Utilities\\NativeDevLoadingView.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + var _classCallCheck = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/createClass"); + var _possibleConstructorReturn = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/possibleConstructorReturn"); + var _getPrototypeOf = _$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/getPrototypeOf"); + var _inherits = _$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/inherits"); + var _slicedToArray = _$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/slicedToArray"); + function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + var inject = function inject(_ref) { + var _ref$module = _slicedToArray(_ref.module, 2), + id = _ref$module[0], + code = _ref$module[1], + sourceURL = _ref.sourceURL; + if (global.globalEvalWithSourceUrl) { + global.globalEvalWithSourceUrl(code, sourceURL); + } else { + eval(code); + } + }; + var injectUpdate = function injectUpdate(update) { + update.added.forEach(inject); + update.modified.forEach(inject); + }; + var HMRClient = /*#__PURE__*/function (_EventEmitter) { + function HMRClient(url) { + var _this; + _classCallCheck(this, HMRClient); + _this = _callSuper(this, HMRClient); + _this._isEnabled = false; + _this._pendingUpdate = null; + _this._queue = []; + _this._state = "opening"; + _this._ws = new global.WebSocket(url); + _this._ws.onopen = function () { + _this._state = "open"; + _this.emit("open"); + _this._flushQueue(); + }; + _this._ws.onerror = function (error) { + _this.emit("connection-error", error); + }; + _this._ws.onclose = function (closeEvent) { + _this._state = "closed"; + _this.emit("close", closeEvent); + }; + _this._ws.onmessage = function (message) { + var data = JSON.parse(String(message.data)); + switch (data.type) { + case "bundle-registered": + _this.emit("bundle-registered"); + break; + case "update-start": + _this.emit("update-start", data.body); + break; + case "update": + _this.emit("update", data.body); + break; + case "update-done": + _this.emit("update-done"); + break; + case "error": + _this.emit("error", data.body); + break; + default: + _this.emit("error", { + type: "unknown-message", + message: data + }); + } + }; + _this.on("update", function (update) { + if (_this._isEnabled) { + injectUpdate(update); + } else if (_this._pendingUpdate == null) { + _this._pendingUpdate = update; + } else { + _this._pendingUpdate = mergeUpdates(_this._pendingUpdate, update); + } + }); + return _this; + } + _inherits(HMRClient, _EventEmitter); + return _createClass(HMRClient, [{ + key: "close", + value: function close() { + this._ws.close(); + } + }, { + key: "send", + value: function send(message) { + switch (this._state) { + case "opening": + this._queue.push(message); + break; + case "open": + this._ws.send(message); + break; + case "closed": + break; + default: + throw new Error("[WebSocketHMRClient] Unknown state: " + this._state); + } + } + }, { + key: "_flushQueue", + value: function _flushQueue() { + var _this2 = this; + this._queue.forEach(function (message) { + return _this2.send(message); + }); + this._queue.length = 0; + } + }, { + key: "enable", + value: function enable() { + this._isEnabled = true; + var update = this._pendingUpdate; + this._pendingUpdate = null; + if (update != null) { + injectUpdate(update); + } + } + }, { + key: "disable", + value: function disable() { + this._isEnabled = false; + } + }, { + key: "isEnabled", + value: function isEnabled() { + return this._isEnabled; + } + }, { + key: "hasPendingUpdates", + value: function hasPendingUpdates() { + return this._pendingUpdate != null; + } + }]); + }(_$$_REQUIRE(_dependencyMap[6], "./vendor/eventemitter3")); + function mergeUpdates(base, next) { + var addedIDs = new Set(); + var deletedIDs = new Set(); + var moduleMap = new Map(); + applyUpdateLocally(base); + applyUpdateLocally(next); + function applyUpdateLocally(update) { + update.deleted.forEach(function (id) { + if (addedIDs.has(id)) { + addedIDs.delete(id); + } else { + deletedIDs.add(id); + } + moduleMap.delete(id); + }); + update.added.forEach(function (item) { + var id = item.module[0]; + if (deletedIDs.has(id)) { + deletedIDs.delete(id); + } else { + addedIDs.add(id); + } + moduleMap.set(id, item); + }); + update.modified.forEach(function (item) { + var id = item.module[0]; + moduleMap.set(id, item); + }); + } + var result = { + isInitialUpdate: next.isInitialUpdate, + revisionId: next.revisionId, + added: [], + modified: [], + deleted: [] + }; + deletedIDs.forEach(function (id) { + result.deleted.push(id); + }); + moduleMap.forEach(function (item, id) { + if (deletedIDs.has(id)) { + return; + } + if (addedIDs.has(id)) { + result.added.push(item); + } else { + result.modified.push(item); + } + }); + return result; + } + module.exports = HMRClient; +},197,[18,19,23,25,28,7,198],"node_modules\\metro-runtime\\src\\modules\\HMRClient.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + var has = Object.prototype.hasOwnProperty, + prefix = "~"; + function Events() {} + if (Object.create) { + Events.prototype = Object.create(null); + if (!new Events().__proto__) prefix = false; + } + function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; + } + function addListener(emitter, event, fn, context, once) { + if (typeof fn !== "function") { + throw new TypeError("The listener must be a function"); + } + var listener = new EE(fn, context || emitter, once), + evt = prefix ? prefix + event : event; + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);else emitter._events[evt] = [emitter._events[evt], listener]; + return emitter; + } + function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events();else delete emitter._events[evt]; + } + function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; + } + EventEmitter.prototype.eventNames = function eventNames() { + var names = [], + events, + name; + if (this._eventsCount === 0) return names; + for (name in events = this._events) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + return names; + }; + EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event, + handlers = this._events[evt]; + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + return ee; + }; + EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event, + listeners = this._events[evt]; + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; + }; + EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + if (!this._events[evt]) return false; + var listeners = this._events[evt], + len = arguments.length, + args, + i; + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + switch (len) { + case 1: + return listeners.fn.call(listeners.context), true; + case 2: + return listeners.fn.call(listeners.context, a1), true; + case 3: + return listeners.fn.call(listeners.context, a1, a2), true; + case 4: + return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: + return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: + return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + for (i = 1, args = new Array(len - 1); i < len; i++) { + args[i - 1] = arguments[i]; + } + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length, + j; + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + switch (len) { + case 1: + listeners[i].fn.call(listeners[i].context); + break; + case 2: + listeners[i].fn.call(listeners[i].context, a1); + break; + case 3: + listeners[i].fn.call(listeners[i].context, a1, a2); + break; + case 4: + listeners[i].fn.call(listeners[i].context, a1, a2, a3); + break; + default: + if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) { + args[j - 1] = arguments[j]; + } + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + return true; + }; + EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); + }; + EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); + }; + EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + var listeners = this._events[evt]; + if (listeners.fn) { + if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) { + events.push(listeners[i]); + } + } + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;else clearEvent(this, evt); + } + return this; + }; + EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + return this; + }; + EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + EventEmitter.prototype.addListener = EventEmitter.prototype.on; + EventEmitter.prefixed = prefix; + EventEmitter.EventEmitter = EventEmitter; + if ("undefined" !== typeof module) { + module.exports = EventEmitter; + } +},198,[],"node_modules\\metro-runtime\\src\\modules\\vendor\\eventemitter3.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _NativeEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../EventEmitter/NativeEventEmitter")); + var _NativeDevSettings = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../NativeModules/specs/NativeDevSettings")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../Utilities/Platform")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var DevSettings = { + addMenuItem: function addMenuItem(title, handler) {}, + reload: function reload(reason) {}, + onFastRefresh: function onFastRefresh() {} + }; + if (__DEV__) { + var emitter = new _NativeEventEmitter.default( + // T88715063: NativeEventEmitter only used this parameter on iOS. Now it uses it on all platforms, so this code was modified automatically to preserve its behavior + // If you want to use the native module on other platforms, please remove this condition and test its behavior + _Platform.default.OS !== 'ios' ? null : _NativeDevSettings.default); + var subscriptions = new Map(); + DevSettings = { + addMenuItem: function addMenuItem(title, handler) { + // Make sure items are not added multiple times. This can + // happen when hot reloading the module that registers the + // menu items. The title is used as the id which means we + // don't support multiple items with the same name. + var subscription = subscriptions.get(title); + if (subscription != null) { + subscription.remove(); + } else { + _NativeDevSettings.default.addMenuItem(title); + } + subscription = emitter.addListener('didPressMenuItem', function (event) { + if (event.title === title) { + handler(); + } + }); + subscriptions.set(title, subscription); + }, + reload: function reload(reason) { + if (_NativeDevSettings.default.reloadWithReason != null) { + _NativeDevSettings.default.reloadWithReason(reason != null ? reason : 'Uncategorized from JS'); + } else { + _NativeDevSettings.default.reload(); + } + }, + onFastRefresh: function onFastRefresh() { + _NativeDevSettings.default.onFastRefresh == null ? void 0 : _NativeDevSettings.default.onFastRefresh(); + } + }; + } + module.exports = DevSettings; +},199,[6,160,200,34],"node_modules\\react-native\\Libraries\\Utilities\\DevSettings.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.getEnforcing('DevSettings'); +},200,[36],"node_modules\\react-native\\Libraries\\NativeModules\\specs\\NativeDevSettings.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + // This shim ensures DEV binary builds don't crash in JS + // when they're combined with a PROD JavaScript build. + var HMRClientProdShim = { + setup: function setup() {}, + enable: function enable() { + console.error('Fast Refresh is disabled in JavaScript bundles built in production mode. ' + 'Did you forget to run Metro?'); + }, + disable: function disable() {}, + registerBundle: function registerBundle() {}, + log: function log() {} + }; + module.exports = HMRClientProdShim; +},201,[],"node_modules\\react-native\\Libraries\\Utilities\\HMRClientProdShim.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + /** + * Set up SegmentFetcher. + * You can use this module directly, or just require InitializeCore. + */ + + function __fetchSegment(segmentId, options, callback) { + var SegmentFetcher = _$$_REQUIRE(_dependencyMap[0], "./SegmentFetcher/NativeSegmentFetcher").default; + SegmentFetcher.fetchSegment(segmentId, options, function (errorObject) { + if (errorObject) { + var error = new Error(errorObject.message); + error.code = errorObject.code; // flowlint-line unclear-type: off + callback(error); + } + callback(null); + }); + } + global.__fetchSegment = __fetchSegment; +},202,[203],"node_modules\\react-native\\Libraries\\Core\\setUpSegmentFetcher.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.getEnforcing('SegmentFetcher'); +},203,[36],"node_modules\\react-native\\Libraries\\Core\\SegmentFetcher\\NativeSegmentFetcher.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + /** + * Check for compatibility between the JS and native code. + * You can use this module directly, or just require InitializeCore. + */ + _$$_REQUIRE(_dependencyMap[0], "./ReactNativeVersionCheck").checkVersions(); +},204,[205],"node_modules\\react-native\\Libraries\\Core\\checkNativeVersion.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../Utilities/Platform")); /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /** + * Checks that the version of this React Native JS is compatible with the native + * code, throwing an error if it isn't. + * + * The existence of this module is part of the public interface of React Native + * even though it is used only internally within React Native. React Native + * implementations for other platforms (ex: Windows) may override this module + * and rely on its existence as a separate module. + */ + exports.checkVersions = function checkVersions() { + var nativeVersion = _Platform.default.constants.reactNativeVersion; + if (_$$_REQUIRE(_dependencyMap[2], "./ReactNativeVersion").version.major !== nativeVersion.major || _$$_REQUIRE(_dependencyMap[2], "./ReactNativeVersion").version.minor !== nativeVersion.minor) { + console.error(`React Native version mismatch.\n\nJavaScript version: ${_formatVersion(_$$_REQUIRE(_dependencyMap[2], "./ReactNativeVersion").version)}\n` + `Native version: ${_formatVersion(nativeVersion)}\n\n` + 'Make sure that you have rebuilt the native code. If the problem ' + 'persists try clearing the Watchman and packager caches with ' + '`watchman watch-del-all && react-native start --reset-cache`.'); + } + }; + function _formatVersion(version) { + return `${version.major}.${version.minor}.${version.patch}` + ( + // eslint-disable-next-line eqeqeq + version.prerelease != undefined ? `-${version.prerelease}` : ''); + } +},205,[6,34,206],"node_modules\\react-native\\Libraries\\Core\\ReactNativeVersionCheck.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * @generated by scripts/set-rn-version.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + exports.version = { + major: 0, + minor: 73, + patch: 11, + prerelease: null + }; +},206,[],"node_modules\\react-native\\Libraries\\Core\\ReactNativeVersion.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../Utilities/Platform")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /** + * Sets up developer tools for React Native. + * You can use this module directly, or just require InitializeCore. + */ + if (__DEV__) { + var _global$__METRO_GLOBA; + _$$_REQUIRE(_dependencyMap[2], "./setUpReactDevTools"); + + // Set up inspector + var JSInspector = _$$_REQUIRE(_dependencyMap[3], "../JSInspector/JSInspector"); + JSInspector.registerAgent(_$$_REQUIRE(_dependencyMap[4], "../JSInspector/NetworkAgent")); + + // Note we can't check if console is "native" because it would appear "native" in JSC and Hermes. + // We also can't check any properties that don't exist in the Chrome worker environment. + // So we check a navigator property that's set to a particular value ("Netscape") in all real browsers. + var isLikelyARealBrowser = global.navigator != null && + /* _ + * | | + * _ __ ___| |_ ___ ___ __ _ _ __ ___ + * | '_ \ / _ \ __/ __|/ __/ _` | '_ \ / _ \ + * | | | | __/ |_\__ \ (_| (_| | |_) | __/ + * |_| |_|\___|\__|___/\___\__,_| .__/ \___| + * | | + * |_| + */ + global.navigator.appName === 'Netscape'; // Any real browser + + if (!_Platform.default.isTesting) { + var HMRClient = _$$_REQUIRE(_dependencyMap[5], "../Utilities/HMRClient"); + if (console._isPolyfilled) { + // We assume full control over the console and send JavaScript logs to Metro. + ['trace', 'info', 'warn', 'error', 'log', 'group', 'groupCollapsed', 'groupEnd', 'debug'].forEach(function (level) { + var originalFunction = console[level]; + console[level] = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + HMRClient.log(level, args); + originalFunction.apply(console, args); + }; + }); + } else { + // We assume the environment has a real rich console (like Chrome), and don't hijack it to log to Metro. + // It's likely the developer is using rich console to debug anyway, and hijacking it would + // lose the filenames in console.log calls: https://github.com/facebook/react-native/issues/26788. + HMRClient.log('log', [`JavaScript logs will appear in your ${isLikelyARealBrowser ? 'browser' : 'environment'} console`]); + } + } + _$$_REQUIRE(_dependencyMap[6], "./setUpReactRefresh"); + global[`${(_global$__METRO_GLOBA = global.__METRO_GLOBAL_PREFIX__) != null ? _global$__METRO_GLOBA : ''}__loadBundleAsync`] = _$$_REQUIRE(_dependencyMap[7], "./Devtools/loadBundleFromServer"); + } +},207,[6,34,208,223,224,186,226,230],"node_modules\\react-native\\Libraries\\Core\\setUpDeveloperTools.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + if (__DEV__) { + var isWebSocketOpen = false; + var ws = null; + var reactDevTools = _$$_REQUIRE(_dependencyMap[0], "react-devtools-core"); + var connectToDevTools = function connectToDevTools() { + if (ws !== null && isWebSocketOpen) { + // If the DevTools backend is already connected, don't recreate the WebSocket. + // This would break the connection. + // If there isn't an active connection, a backend may be waiting to connect, + // in which case it's okay to make a new one. + return; + } + + // not when debugging in chrome + // TODO(t12832058) This check is broken + if (!window.document) { + var AppState = _$$_REQUIRE(_dependencyMap[1], "../AppState/AppState"); + var getDevServer = _$$_REQUIRE(_dependencyMap[2], "./Devtools/getDevServer"); + + // Don't steal the DevTools from currently active app. + // Note: if you add any AppState subscriptions to this file, + // you will also need to guard against `AppState.isAvailable`, + // or the code will throw for bundles that don't have it. + var isAppActive = function isAppActive() { + return AppState.currentState !== 'background'; + }; + + // Get hostname from development server (packager) + var devServer = getDevServer(); + var host = devServer.bundleLoadedFromServer ? devServer.url.replace(/https?:\/\//, '').replace(/\/$/, '').split(':')[0] : 'localhost'; + + // Read the optional global variable for backward compatibility. + // It was added in https://github.com/facebook/react-native/commit/bf2b435322e89d0aeee8792b1c6e04656c2719a0. + var port = window.__REACT_DEVTOOLS_PORT__ != null ? window.__REACT_DEVTOOLS_PORT__ : 8097; + var WebSocket = _$$_REQUIRE(_dependencyMap[3], "../WebSocket/WebSocket"); + ws = new WebSocket('ws://' + host + ':' + port); + ws.addEventListener('close', function (event) { + isWebSocketOpen = false; + }); + ws.addEventListener('open', function (event) { + isWebSocketOpen = true; + }); + var ReactNativeStyleAttributes = _$$_REQUIRE(_dependencyMap[4], "../Components/View/ReactNativeStyleAttributes"); + var devToolsSettingsManager = _$$_REQUIRE(_dependencyMap[5], "../DevToolsSettings/DevToolsSettingsManager"); + reactDevTools.connectToDevTools({ + isAppActive: isAppActive, + resolveRNStyle: _$$_REQUIRE(_dependencyMap[6], "../StyleSheet/flattenStyle"), + nativeStyleEditorValidAttributes: Object.keys(ReactNativeStyleAttributes), + websocket: ws, + devToolsSettingsManager: devToolsSettingsManager + }); + } + }; + var RCTNativeAppEventEmitter = _$$_REQUIRE(_dependencyMap[7], "../EventEmitter/RCTNativeAppEventEmitter"); + RCTNativeAppEventEmitter.addListener('RCTDevMenuShown', connectToDevTools); + connectToDevTools(); // Try connecting once on load + } +},208,[209,210,102,165,213,220,222,185],"node_modules\\react-native\\Libraries\\Core\\setUpReactDevTools.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + (function webpackUniversalModuleDefinition(root, factory) { + if (typeof exports === 'object' && typeof module === 'object') module.exports = factory();else if (typeof define === 'function' && define.amd) define([], factory);else if (typeof exports === 'object') exports["ReactDevToolsBackend"] = factory();else root["ReactDevToolsBackend"] = factory(); + })(self, function () { + return /******/function () { + // webpackBootstrap + /******/ + var __webpack_modules__ = { + /***/602: (/***/function _(__unused_webpack_module, exports, __webpack_require__) { + "use strict"; + + var __webpack_unused_export__; + /** + * @license React + * react-debug-tools.production.min.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return _typeof(obj); + } + var k = __webpack_require__(206), + p = __webpack_require__(189), + q = Object.assign, + w = p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, + x = [], + y = null; + function z() { + if (null === y) { + var a = new Map(); + try { + A.useContext({ + _currentValue: null + }), A.useState(null), A.useReducer(function (c) { + return c; + }, null), A.useRef(null), "function" === typeof A.useCacheRefresh && A.useCacheRefresh(), A.useLayoutEffect(function () {}), A.useInsertionEffect(function () {}), A.useEffect(function () {}), A.useImperativeHandle(void 0, function () { + return null; + }), A.useDebugValue(null), A.useCallback(function () {}), A.useMemo(function () { + return null; + }), "function" === typeof A.useMemoCache && A.useMemoCache(0); + } finally { + var b = x; + x = []; + } + for (var e = 0; e < b.length; e++) { + var g = b[e]; + a.set(g.primitive, k.parse(g.stackError)); + } + y = a; + } + return y; + } + var B = null; + function C() { + var a = B; + null !== a && (B = a.next); + return a; + } + var A = { + use: function use() { + throw Error("Support for `use` not yet implemented in react-debug-tools."); + }, + readContext: function readContext(a) { + return a._currentValue; + }, + useCacheRefresh: function useCacheRefresh() { + var a = C(); + x.push({ + primitive: "CacheRefresh", + stackError: Error(), + value: null !== a ? a.memoizedState : function () {} + }); + return function () {}; + }, + useCallback: function useCallback(a) { + var b = C(); + x.push({ + primitive: "Callback", + stackError: Error(), + value: null !== b ? b.memoizedState[0] : a + }); + return a; + }, + useContext: function useContext(a) { + x.push({ + primitive: "Context", + stackError: Error(), + value: a._currentValue + }); + return a._currentValue; + }, + useEffect: function useEffect(a) { + C(); + x.push({ + primitive: "Effect", + stackError: Error(), + value: a + }); + }, + useImperativeHandle: function useImperativeHandle(a) { + C(); + var b = void 0; + null !== a && "object" === _typeof(a) && (b = a.current); + x.push({ + primitive: "ImperativeHandle", + stackError: Error(), + value: b + }); + }, + useDebugValue: function useDebugValue(a, b) { + x.push({ + primitive: "DebugValue", + stackError: Error(), + value: "function" === typeof b ? b(a) : a + }); + }, + useLayoutEffect: function useLayoutEffect(a) { + C(); + x.push({ + primitive: "LayoutEffect", + stackError: Error(), + value: a + }); + }, + useInsertionEffect: function useInsertionEffect(a) { + C(); + x.push({ + primitive: "InsertionEffect", + stackError: Error(), + value: a + }); + }, + useMemo: function useMemo(a) { + var b = C(); + a = null !== b ? b.memoizedState[0] : a(); + x.push({ + primitive: "Memo", + stackError: Error(), + value: a + }); + return a; + }, + useMemoCache: function useMemoCache() { + return []; + }, + useReducer: function useReducer(a, b, e) { + a = C(); + b = null !== a ? a.memoizedState : void 0 !== e ? e(b) : b; + x.push({ + primitive: "Reducer", + stackError: Error(), + value: b + }); + return [b, function () {}]; + }, + useRef: function useRef(a) { + var b = C(); + a = null !== b ? b.memoizedState : { + current: a + }; + x.push({ + primitive: "Ref", + stackError: Error(), + value: a.current + }); + return a; + }, + useState: function useState(a) { + var b = C(); + a = null !== b ? b.memoizedState : "function" === typeof a ? a() : a; + x.push({ + primitive: "State", + stackError: Error(), + value: a + }); + return [a, function () {}]; + }, + useTransition: function useTransition() { + C(); + C(); + x.push({ + primitive: "Transition", + stackError: Error(), + value: void 0 + }); + return [!1, function () {}]; + }, + useSyncExternalStore: function useSyncExternalStore(a, b) { + C(); + C(); + a = b(); + x.push({ + primitive: "SyncExternalStore", + stackError: Error(), + value: a + }); + return a; + }, + useDeferredValue: function useDeferredValue(a) { + var b = C(); + x.push({ + primitive: "DeferredValue", + stackError: Error(), + value: null !== b ? b.memoizedState : a + }); + return a; + }, + useId: function useId() { + var a = C(); + a = null !== a ? a.memoizedState : ""; + x.push({ + primitive: "Id", + stackError: Error(), + value: a + }); + return a; + } + }, + D = { + get: function get(a, b) { + if (a.hasOwnProperty(b)) return a[b]; + a = Error("Missing method in Dispatcher: " + b); + a.name = "ReactDebugToolsUnsupportedHookError"; + throw a; + } + }, + E = "undefined" === typeof Proxy ? A : new Proxy(A, D), + F = 0; + function G(a, b, e) { + var g = b[e].source, + c = 0; + a: for (; c < a.length; c++) { + if (a[c].source === g) { + for (var h = e + 1, r = c + 1; h < b.length && r < a.length; h++, r++) { + if (a[r].source !== b[h].source) continue a; + } + return c; + } + } + return -1; + } + function H(a, b) { + if (!a) return !1; + b = "use" + b; + return a.length < b.length ? !1 : a.lastIndexOf(b) === a.length - b.length; + } + function I(a, b, e) { + for (var g = [], c = null, h = g, r = 0, t = [], v = 0; v < b.length; v++) { + var u = b[v]; + var d = a; + var l = k.parse(u.stackError); + b: { + var m = l, + n = G(m, d, F); + if (-1 !== n) d = n;else { + for (var f = 0; f < d.length && 5 > f; f++) { + if (n = G(m, d, f), -1 !== n) { + F = f; + d = n; + break b; + } + } + d = -1; + } + } + b: { + m = l; + n = z().get(u.primitive); + if (void 0 !== n) for (f = 0; f < n.length && f < m.length; f++) { + if (n[f].source !== m[f].source) { + f < m.length - 1 && H(m[f].functionName, u.primitive) && f++; + f < m.length - 1 && H(m[f].functionName, u.primitive) && f++; + m = f; + break b; + } + } + m = -1; + } + l = -1 === d || -1 === m || 2 > d - m ? null : l.slice(m, d - 1); + if (null !== l) { + d = 0; + if (null !== c) { + for (; d < l.length && d < c.length && l[l.length - d - 1].source === c[c.length - d - 1].source;) { + d++; + } + for (c = c.length - 1; c > d; c--) { + h = t.pop(); + } + } + for (c = l.length - d - 1; 1 <= c; c--) { + d = [], m = l[c], (n = l[c - 1].functionName) ? (f = n.lastIndexOf("."), -1 === f && (f = 0), "use" === n.slice(f, f + 3) && (f += 3), n = n.slice(f)) : n = "", n = { + id: null, + isStateEditable: !1, + name: n, + value: void 0, + subHooks: d + }, e && (n.hookSource = { + lineNumber: m.lineNumber, + columnNumber: m.columnNumber, + functionName: m.functionName, + fileName: m.fileName + }), h.push(n), t.push(h), h = d; + } + c = l; + } + d = u.primitive; + u = { + id: "Context" === d || "DebugValue" === d ? null : r++, + isStateEditable: "Reducer" === d || "State" === d, + name: d, + value: u.value, + subHooks: [] + }; + e && (d = { + lineNumber: null, + functionName: null, + fileName: null, + columnNumber: null + }, l && 1 <= l.length && (l = l[0], d.lineNumber = l.lineNumber, d.functionName = l.functionName, d.fileName = l.fileName, d.columnNumber = l.columnNumber), u.hookSource = d); + h.push(u); + } + J(g, null); + return g; + } + function J(a, b) { + for (var e = [], g = 0; g < a.length; g++) { + var c = a[g]; + "DebugValue" === c.name && 0 === c.subHooks.length ? (a.splice(g, 1), g--, e.push(c)) : J(c.subHooks, c); + } + null !== b && (1 === e.length ? b.value = e[0].value : 1 < e.length && (b.value = e.map(function (h) { + return h.value; + }))); + } + function K(a) { + if (a instanceof Error && "ReactDebugToolsUnsupportedHookError" === a.name) throw a; + var b = Error("Error rendering inspected component", { + cause: a + }); + b.name = "ReactDebugToolsRenderError"; + b.cause = a; + throw b; + } + function L(a, b, e) { + var g = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : !1; + null == e && (e = w.ReactCurrentDispatcher); + var c = e.current; + e.current = E; + try { + var h = Error(); + a(b); + } catch (t) { + K(t); + } finally { + var r = x; + x = []; + e.current = c; + } + c = k.parse(h); + return I(c, r, g); + } + function M(a) { + a.forEach(function (b, e) { + return e._currentValue = b; + }); + } + __webpack_unused_export__ = L; + exports.inspectHooksOfFiber = function (a, b) { + var e = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : !1; + null == b && (b = w.ReactCurrentDispatcher); + if (0 !== a.tag && 15 !== a.tag && 11 !== a.tag) throw Error("Unknown Fiber. Needs to be a function component to inspect hooks."); + z(); + var g = a.type, + c = a.memoizedProps; + if (g !== a.elementType && g && g.defaultProps) { + c = q({}, c); + var h = g.defaultProps; + for (r in h) { + void 0 === c[r] && (c[r] = h[r]); + } + } + B = a.memoizedState; + var r = new Map(); + try { + for (h = a; h;) { + if (10 === h.tag) { + var t = h.type._context; + r.has(t) || (r.set(t, t._currentValue), t._currentValue = h.memoizedProps.value); + } + h = h.return; + } + if (11 === a.tag) { + var v = g.render; + g = c; + var u = a.ref; + t = b; + var d = t.current; + t.current = E; + try { + var l = Error(); + v(g, u); + } catch (f) { + K(f); + } finally { + var m = x; + x = []; + t.current = d; + } + var n = k.parse(l); + return I(n, m, e); + } + return L(g, c, b, e); + } finally { + B = null, M(r); + } + }; + + /***/ + }), + /***/987: (/***/function _(module, __unused_webpack_exports, __webpack_require__) { + "use strict"; + + if (true) { + module.exports = __webpack_require__(602); + } else {} + + /***/ + }), + /***/9: (/***/function _(__unused_webpack_module, exports) { + "use strict"; + + var __webpack_unused_export__; + /** + * @license React + * react-is.production.min.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return _typeof(obj); + } + var b = Symbol.for("react.element"), + c = Symbol.for("react.portal"), + d = Symbol.for("react.fragment"), + e = Symbol.for("react.strict_mode"), + f = Symbol.for("react.profiler"), + g = Symbol.for("react.provider"), + h = Symbol.for("react.context"), + k = Symbol.for("react.server_context"), + l = Symbol.for("react.forward_ref"), + m = Symbol.for("react.suspense"), + n = Symbol.for("react.suspense_list"), + p = Symbol.for("react.memo"), + q = Symbol.for("react.lazy"), + t = Symbol.for("react.offscreen"), + u = Symbol.for("react.cache"), + v = Symbol.for("react.client.reference"); + function w(a) { + if ("object" === _typeof(a) && null !== a) { + var r = a.$$typeof; + switch (r) { + case b: + switch (a = a.type, a) { + case d: + case f: + case e: + case m: + case n: + return a; + default: + switch (a = a && a.$$typeof, a) { + case k: + case h: + case l: + case q: + case p: + case g: + return a; + default: + return r; + } + } + case c: + return r; + } + } + } + exports.ContextConsumer = h; + exports.ContextProvider = g; + __webpack_unused_export__ = b; + exports.ForwardRef = l; + exports.Fragment = d; + exports.Lazy = q; + exports.Memo = p; + exports.Portal = c; + exports.Profiler = f; + exports.StrictMode = e; + exports.Suspense = m; + __webpack_unused_export__ = n; + __webpack_unused_export__ = function __webpack_unused_export__() { + return !1; + }; + __webpack_unused_export__ = function __webpack_unused_export__() { + return !1; + }; + __webpack_unused_export__ = function __webpack_unused_export__(a) { + return w(a) === h; + }; + __webpack_unused_export__ = function __webpack_unused_export__(a) { + return w(a) === g; + }; + exports.isElement = function (a) { + return "object" === _typeof(a) && null !== a && a.$$typeof === b; + }; + __webpack_unused_export__ = function __webpack_unused_export__(a) { + return w(a) === l; + }; + __webpack_unused_export__ = function __webpack_unused_export__(a) { + return w(a) === d; + }; + __webpack_unused_export__ = function __webpack_unused_export__(a) { + return w(a) === q; + }; + __webpack_unused_export__ = function __webpack_unused_export__(a) { + return w(a) === p; + }; + __webpack_unused_export__ = function __webpack_unused_export__(a) { + return w(a) === c; + }; + __webpack_unused_export__ = function __webpack_unused_export__(a) { + return w(a) === f; + }; + __webpack_unused_export__ = function __webpack_unused_export__(a) { + return w(a) === e; + }; + __webpack_unused_export__ = function __webpack_unused_export__(a) { + return w(a) === m; + }; + __webpack_unused_export__ = function __webpack_unused_export__(a) { + return w(a) === n; + }; + __webpack_unused_export__ = function __webpack_unused_export__(a) { + return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || a === u || "object" === _typeof(a) && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === v || void 0 !== a.getModuleId) ? !0 : !1; + }; + exports.typeOf = w; + + /***/ + }), + /***/550: (/***/function _(module, __unused_webpack_exports, __webpack_require__) { + "use strict"; + + if (true) { + module.exports = __webpack_require__(9); + } else {} + + /***/ + }), + /***/978: (/***/function _(__unused_webpack_module, exports) { + "use strict"; + + /** + * @license React + * react.production.min.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return _typeof(obj); + } + var l = Symbol.for("react.element"), + n = Symbol.for("react.portal"), + p = Symbol.for("react.fragment"), + q = Symbol.for("react.strict_mode"), + r = Symbol.for("react.profiler"), + t = Symbol.for("react.provider"), + u = Symbol.for("react.context"), + v = Symbol.for("react.server_context"), + w = Symbol.for("react.forward_ref"), + x = Symbol.for("react.suspense"), + y = Symbol.for("react.suspense_list"), + z = Symbol.for("react.memo"), + A = Symbol.for("react.lazy"), + aa = Symbol.for("react.debug_trace_mode"), + ba = Symbol.for("react.offscreen"), + ca = Symbol.for("react.cache"), + B = Symbol.for("react.default_value"), + da = Symbol.for("react.postpone"), + C = Symbol.iterator; + function ea(a) { + if (null === a || "object" !== _typeof(a)) return null; + a = C && a[C] || a["@@iterator"]; + return "function" === typeof a ? a : null; + } + var D = { + isMounted: function isMounted() { + return !1; + }, + enqueueForceUpdate: function enqueueForceUpdate() {}, + enqueueReplaceState: function enqueueReplaceState() {}, + enqueueSetState: function enqueueSetState() {} + }, + E = Object.assign, + F = {}; + function G(a, b, c) { + this.props = a; + this.context = b; + this.refs = F; + this.updater = c || D; + } + G.prototype.isReactComponent = {}; + G.prototype.setState = function (a, b) { + if ("object" !== _typeof(a) && "function" !== typeof a && null != a) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); + this.updater.enqueueSetState(this, a, b, "setState"); + }; + G.prototype.forceUpdate = function (a) { + this.updater.enqueueForceUpdate(this, a, "forceUpdate"); + }; + function H() {} + H.prototype = G.prototype; + function I(a, b, c) { + this.props = a; + this.context = b; + this.refs = F; + this.updater = c || D; + } + var J = I.prototype = new H(); + J.constructor = I; + E(J, G.prototype); + J.isPureReactComponent = !0; + var K = Array.isArray, + L = Object.prototype.hasOwnProperty, + M = { + current: null + }, + N = { + key: !0, + ref: !0, + __self: !0, + __source: !0 + }; + function O(a, b, c) { + var d, + e = {}, + f = null, + g = null; + if (null != b) for (d in void 0 !== b.ref && (g = b.ref), void 0 !== b.key && (f = "" + b.key), b) { + L.call(b, d) && !N.hasOwnProperty(d) && (e[d] = b[d]); + } + var h = arguments.length - 2; + if (1 === h) e.children = c;else if (1 < h) { + for (var k = Array(h), m = 0; m < h; m++) { + k[m] = arguments[m + 2]; + } + e.children = k; + } + if (a && a.defaultProps) for (d in h = a.defaultProps, h) { + void 0 === e[d] && (e[d] = h[d]); + } + return { + $$typeof: l, + type: a, + key: f, + ref: g, + props: e, + _owner: M.current + }; + } + function fa(a, b) { + return { + $$typeof: l, + type: a.type, + key: b, + ref: a.ref, + props: a.props, + _owner: a._owner + }; + } + function P(a) { + return "object" === _typeof(a) && null !== a && a.$$typeof === l; + } + function escape(a) { + var b = { + "=": "=0", + ":": "=2" + }; + return "$" + a.replace(/[=:]/g, function (c) { + return b[c]; + }); + } + var Q = /\/+/g; + function R(a, b) { + return "object" === _typeof(a) && null !== a && null != a.key ? escape("" + a.key) : b.toString(36); + } + function S(a, b, c, d, e) { + var f = _typeof(a); + if ("undefined" === f || "boolean" === f) a = null; + var g = !1; + if (null === a) g = !0;else switch (f) { + case "string": + case "number": + g = !0; + break; + case "object": + switch (a.$$typeof) { + case l: + case n: + g = !0; + } + } + if (g) return g = a, e = e(g), a = "" === d ? "." + R(g, 0) : d, K(e) ? (c = "", null != a && (c = a.replace(Q, "$&/") + "/"), S(e, b, c, "", function (m) { + return m; + })) : null != e && (P(e) && (e = fa(e, c + (!e.key || g && g.key === e.key ? "" : ("" + e.key).replace(Q, "$&/") + "/") + a)), b.push(e)), 1; + g = 0; + d = "" === d ? "." : d + ":"; + if (K(a)) for (var h = 0; h < a.length; h++) { + f = a[h]; + var k = d + R(f, h); + g += S(f, b, c, k, e); + } else if (k = ea(a), "function" === typeof k) for (a = k.call(a), h = 0; !(f = a.next()).done;) { + f = f.value, k = d + R(f, h++), g += S(f, b, c, k, e); + } else if ("object" === f) throw b = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead."); + return g; + } + function T(a, b, c) { + if (null == a) return a; + var d = [], + e = 0; + S(a, d, "", "", function (f) { + return b.call(c, f, e++); + }); + return d; + } + function ha(a) { + if (-1 === a._status) { + var b = a._result; + b = b(); + b.then(function (c) { + if (0 === a._status || -1 === a._status) a._status = 1, a._result = c; + }, function (c) { + if (0 === a._status || -1 === a._status) a._status = 2, a._result = c; + }); + -1 === a._status && (a._status = 0, a._result = b); + } + if (1 === a._status) return a._result.default; + throw a._result; + } + var U = { + current: null + }; + function ia() { + return new WeakMap(); + } + function V() { + return { + s: 0, + v: void 0, + o: null, + p: null + }; + } + var W = { + current: null + }; + function X(a, b) { + return W.current.useOptimistic(a, b); + } + var Y = { + transition: null + }, + Z = {}, + ja = { + ReactCurrentDispatcher: W, + ReactCurrentCache: U, + ReactCurrentBatchConfig: Y, + ReactCurrentOwner: M, + ContextRegistry: Z + }; + exports.Children = { + map: T, + forEach: function forEach(a, b, c) { + T(a, function () { + b.apply(this, arguments); + }, c); + }, + count: function count(a) { + var b = 0; + T(a, function () { + b++; + }); + return b; + }, + toArray: function toArray(a) { + return T(a, function (b) { + return b; + }) || []; + }, + only: function only(a) { + if (!P(a)) throw Error("React.Children.only expected to receive a single React element child."); + return a; + } + }; + exports.Component = G; + exports.Fragment = p; + exports.Profiler = r; + exports.PureComponent = I; + exports.StrictMode = q; + exports.Suspense = x; + exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ja; + exports.cache = function (a) { + return function () { + var b = U.current; + if (!b) return a.apply(null, arguments); + var c = b.getCacheForType(ia); + b = c.get(a); + void 0 === b && (b = V(), c.set(a, b)); + c = 0; + for (var d = arguments.length; c < d; c++) { + var e = arguments[c]; + if ("function" === typeof e || "object" === _typeof(e) && null !== e) { + var f = b.o; + null === f && (b.o = f = new WeakMap()); + b = f.get(e); + void 0 === b && (b = V(), f.set(e, b)); + } else f = b.p, null === f && (b.p = f = new Map()), b = f.get(e), void 0 === b && (b = V(), f.set(e, b)); + } + if (1 === b.s) return b.v; + if (2 === b.s) throw b.v; + try { + var g = a.apply(null, arguments); + c = b; + c.s = 1; + return c.v = g; + } catch (h) { + throw g = b, g.s = 2, g.v = h, h; + } + }; + }; + exports.cloneElement = function (a, b, c) { + if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + "."); + var d = E({}, a.props), + e = a.key, + f = a.ref, + g = a._owner; + if (null != b) { + void 0 !== b.ref && (f = b.ref, g = M.current); + void 0 !== b.key && (e = "" + b.key); + if (a.type && a.type.defaultProps) var h = a.type.defaultProps; + for (k in b) { + L.call(b, k) && !N.hasOwnProperty(k) && (d[k] = void 0 === b[k] && void 0 !== h ? h[k] : b[k]); + } + } + var k = arguments.length - 2; + if (1 === k) d.children = c;else if (1 < k) { + h = Array(k); + for (var m = 0; m < k; m++) { + h[m] = arguments[m + 2]; + } + d.children = h; + } + return { + $$typeof: l, + type: a.type, + key: e, + ref: f, + props: d, + _owner: g + }; + }; + exports.createContext = function (a) { + a = { + $$typeof: u, + _currentValue: a, + _currentValue2: a, + _threadCount: 0, + Provider: null, + Consumer: null, + _defaultValue: null, + _globalName: null + }; + a.Provider = { + $$typeof: t, + _context: a + }; + return a.Consumer = a; + }; + exports.createElement = O; + exports.createFactory = function (a) { + var b = O.bind(null, a); + b.type = a; + return b; + }; + exports.createRef = function () { + return { + current: null + }; + }; + exports.createServerContext = function (a, b) { + var c = !0; + if (!Z[a]) { + c = !1; + var d = { + $$typeof: v, + _currentValue: b, + _currentValue2: b, + _defaultValue: b, + _threadCount: 0, + Provider: null, + Consumer: null, + _globalName: a + }; + d.Provider = { + $$typeof: t, + _context: d + }; + Z[a] = d; + } + d = Z[a]; + if (d._defaultValue === B) d._defaultValue = b, d._currentValue === B && (d._currentValue = b), d._currentValue2 === B && (d._currentValue2 = b);else if (c) throw Error("ServerContext: " + a + " already defined"); + return d; + }; + exports.experimental_useEffectEvent = function (a) { + return W.current.useEffectEvent(a); + }; + exports.experimental_useOptimistic = function (a, b) { + return X(a, b); + }; + exports.forwardRef = function (a) { + return { + $$typeof: w, + render: a + }; + }; + exports.isValidElement = P; + exports.lazy = function (a) { + return { + $$typeof: A, + _payload: { + _status: -1, + _result: a + }, + _init: ha + }; + }; + exports.memo = function (a, b) { + return { + $$typeof: z, + type: a, + compare: void 0 === b ? null : b + }; + }; + exports.startTransition = function (a) { + var b = Y.transition; + Y.transition = {}; + try { + a(); + } finally { + Y.transition = b; + } + }; + exports.unstable_Cache = ca; + exports.unstable_DebugTracingMode = aa; + exports.unstable_Offscreen = ba; + exports.unstable_SuspenseList = y; + exports.unstable_act = function () { + throw Error("act(...) is not supported in production builds of React."); + }; + exports.unstable_getCacheForType = function (a) { + var b = U.current; + return b ? b.getCacheForType(a) : a(); + }; + exports.unstable_getCacheSignal = function () { + var a = U.current; + return a ? a.getCacheSignal() : (a = new AbortController(), a.abort(Error("This CacheSignal was requested outside React which means that it is immediately aborted.")), a.signal); + }; + exports.unstable_postpone = function (a) { + a = Error(a); + a.$$typeof = da; + throw a; + }; + exports.unstable_useCacheRefresh = function () { + return W.current.useCacheRefresh(); + }; + exports.unstable_useMemoCache = function (a) { + return W.current.useMemoCache(a); + }; + exports.use = function (a) { + return W.current.use(a); + }; + exports.useCallback = function (a, b) { + return W.current.useCallback(a, b); + }; + exports.useContext = function (a) { + return W.current.useContext(a); + }; + exports.useDebugValue = function () {}; + exports.useDeferredValue = function (a, b) { + return W.current.useDeferredValue(a, b); + }; + exports.useEffect = function (a, b) { + return W.current.useEffect(a, b); + }; + exports.useId = function () { + return W.current.useId(); + }; + exports.useImperativeHandle = function (a, b, c) { + return W.current.useImperativeHandle(a, b, c); + }; + exports.useInsertionEffect = function (a, b) { + return W.current.useInsertionEffect(a, b); + }; + exports.useLayoutEffect = function (a, b) { + return W.current.useLayoutEffect(a, b); + }; + exports.useMemo = function (a, b) { + return W.current.useMemo(a, b); + }; + exports.useOptimistic = X; + exports.useReducer = function (a, b, c) { + return W.current.useReducer(a, b, c); + }; + exports.useRef = function (a) { + return W.current.useRef(a); + }; + exports.useState = function (a) { + return W.current.useState(a); + }; + exports.useSyncExternalStore = function (a, b, c) { + return W.current.useSyncExternalStore(a, b, c); + }; + exports.useTransition = function () { + return W.current.useTransition(); + }; + exports.version = "18.3.0-experimental-51ffd3564-20231025"; + + /***/ + }), + /***/189: (/***/function _(module, __unused_webpack_exports, __webpack_require__) { + "use strict"; + + if (true) { + module.exports = __webpack_require__(978); + } else {} + + /***/ + }), + /***/206: (/***/function _(module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return _typeof(obj); + } + (function (root, factory) { + 'use strict'; + + // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers. + + /* istanbul ignore next */ + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(430)], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + })(this, function ErrorStackParser(StackFrame) { + 'use strict'; + + var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/; + var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m; + var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/; + return { + /** + * Given an Error object, extract the most information from it. + * + * @param {Error} error object + * @return {Array} of StackFrames + */ + parse: function ErrorStackParser$$parse(error) { + if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') { + return this.parseOpera(error); + } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) { + return this.parseV8OrIE(error); + } else if (error.stack) { + return this.parseFFOrSafari(error); + } else { + throw new Error('Cannot parse given Error object'); + } + }, + // Separate line and column numbers from a string of the form: (URI:Line:Column) + extractLocation: function ErrorStackParser$$extractLocation(urlLike) { + // Fail-fast but return locations like "(native)" + if (urlLike.indexOf(':') === -1) { + return [urlLike]; + } + var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/; + var parts = regExp.exec(urlLike.replace(/[()]/g, '')); + return [parts[1], parts[2] || undefined, parts[3] || undefined]; + }, + parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) { + var filtered = error.stack.split('\n').filter(function (line) { + return !!line.match(CHROME_IE_STACK_REGEXP); + }, this); + return filtered.map(function (line) { + if (line.indexOf('(eval ') > -1) { + // Throw away eval information until we implement stacktrace.js/stackframe#8 + line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, ''); + } + var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '('); // capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in + // case it has spaces in it, as the string is split on \s+ later on + + var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/); // remove the parenthesized location from the line, if it was matched + + sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine; + var tokens = sanitizedLine.split(/\s+/).slice(1); // if a location was matched, pass it to extractLocation() otherwise pop the last token + + var locationParts = this.extractLocation(location ? location[1] : tokens.pop()); + var functionName = tokens.join(' ') || undefined; + var fileName = ['eval', ''].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0]; + return new StackFrame({ + functionName: functionName, + fileName: fileName, + lineNumber: locationParts[1], + columnNumber: locationParts[2], + source: line + }); + }, this); + }, + parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) { + var filtered = error.stack.split('\n').filter(function (line) { + return !line.match(SAFARI_NATIVE_CODE_REGEXP); + }, this); + return filtered.map(function (line) { + // Throw away eval information until we implement stacktrace.js/stackframe#8 + if (line.indexOf(' > eval') > -1) { + line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1'); + } + if (line.indexOf('@') === -1 && line.indexOf(':') === -1) { + // Safari eval frames only have function names and nothing else + return new StackFrame({ + functionName: line + }); + } else { + var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/; + var matches = line.match(functionNameRegex); + var functionName = matches && matches[1] ? matches[1] : undefined; + var locationParts = this.extractLocation(line.replace(functionNameRegex, '')); + return new StackFrame({ + functionName: functionName, + fileName: locationParts[0], + lineNumber: locationParts[1], + columnNumber: locationParts[2], + source: line + }); + } + }, this); + }, + parseOpera: function ErrorStackParser$$parseOpera(e) { + if (!e.stacktrace || e.message.indexOf('\n') > -1 && e.message.split('\n').length > e.stacktrace.split('\n').length) { + return this.parseOpera9(e); + } else if (!e.stack) { + return this.parseOpera10(e); + } else { + return this.parseOpera11(e); + } + }, + parseOpera9: function ErrorStackParser$$parseOpera9(e) { + var lineRE = /Line (\d+).*script (?:in )?(\S+)/i; + var lines = e.message.split('\n'); + var result = []; + for (var i = 2, len = lines.length; i < len; i += 2) { + var match = lineRE.exec(lines[i]); + if (match) { + result.push(new StackFrame({ + fileName: match[2], + lineNumber: match[1], + source: lines[i] + })); + } + } + return result; + }, + parseOpera10: function ErrorStackParser$$parseOpera10(e) { + var lineRE = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i; + var lines = e.stacktrace.split('\n'); + var result = []; + for (var i = 0, len = lines.length; i < len; i += 2) { + var match = lineRE.exec(lines[i]); + if (match) { + result.push(new StackFrame({ + functionName: match[3] || undefined, + fileName: match[2], + lineNumber: match[1], + source: lines[i] + })); + } + } + return result; + }, + // Opera 10.65+ Error.stack very similar to FF/Safari + parseOpera11: function ErrorStackParser$$parseOpera11(error) { + var filtered = error.stack.split('\n').filter(function (line) { + return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/); + }, this); + return filtered.map(function (line) { + var tokens = line.split('@'); + var locationParts = this.extractLocation(tokens.pop()); + var functionCall = tokens.shift() || ''; + var functionName = functionCall.replace(//, '$2').replace(/\([^)]*\)/g, '') || undefined; + var argsRaw; + if (functionCall.match(/\(([^)]*)\)/)) { + argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, '$1'); + } + var args = argsRaw === undefined || argsRaw === '[arguments not available]' ? undefined : argsRaw.split(','); + return new StackFrame({ + functionName: functionName, + args: args, + fileName: locationParts[0], + lineNumber: locationParts[1], + columnNumber: locationParts[2], + source: line + }); + }, this); + } + }; + }); + + /***/ + }), + /***/172: (/***/function _(module) { + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return _typeof(obj); + } + + /** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + + /** Used as the `TypeError` message for "Functions" methods. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + /** Used as references for various `Number` constants. */ + + var NAN = 0 / 0; + /** `Object#toString` result references. */ + + var symbolTag = '[object Symbol]'; + /** Used to match leading and trailing whitespace. */ + + var reTrim = /^\s+|\s+$/g; + /** Used to detect bad signed hexadecimal string values. */ + + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + /** Used to detect binary string values. */ + + var reIsBinary = /^0b[01]+$/i; + /** Used to detect octal string values. */ + + var reIsOctal = /^0o[0-7]+$/i; + /** Built-in method references without a dependency on `root`. */ + + var freeParseInt = parseInt; + /** Detect free variable `global` from Node.js. */ + + var freeGlobal = (typeof global === "undefined" ? "undefined" : _typeof(global)) == 'object' && global && global.Object === Object && global; + /** Detect free variable `self`. */ + + var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self; + /** Used as a reference to the global object. */ + + var root = freeGlobal || freeSelf || Function('return this')(); + /** Used for built-in method references. */ + + var objectProto = Object.prototype; + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + + var objectToString = objectProto.toString; + /* Built-in method references for those with the same name as other `lodash` methods. */ + + var nativeMax = Math.max, + nativeMin = Math.min; + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + + var now = function now() { + return root.Date.now(); + }; + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; // Start the timer for the trailing edge. + + timerId = setTimeout(timerExpired, wait); // Invoke the leading edge. + + return leading ? invokeFunc(time) : result; + } + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; + return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; + } + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + + return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; + } + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } // Restart the timer. + + timerId = setTimeout(timerExpired, remainingWait(time)); + } + function trailingEdge(time) { + timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + + function throttle(func, wait, options) { + var leading = true, + trailing = true; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + + function isObject(value) { + var type = _typeof(value); + return !!value && (type == 'object' || type == 'function'); + } + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + + function isObjectLike(value) { + return !!value && _typeof(value) == 'object'; + } + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + + function isSymbol(value) { + return _typeof(value) == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag; + } + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? other + '' : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; + } + module.exports = throttle; + + /***/ + }), + /***/730: (/***/function _(module, __unused_webpack_exports, __webpack_require__) { + "use strict"; + + /* provided dependency */ + var process = __webpack_require__(169); + module.exports = LRUCache; // This will be a proper iterable 'Map' in engines that support it, + // or a fakey-fake PseudoMap in older versions. + + var Map = __webpack_require__(307); + var util = __webpack_require__(82); // A linked list to keep track of recently-used-ness + + var Yallist = __webpack_require__(695); // use symbols if possible, otherwise just _props + + var hasSymbol = typeof Symbol === 'function' && process.env._nodeLRUCacheForceNoSymbol !== '1'; + var makeSymbol; + if (hasSymbol) { + makeSymbol = function makeSymbol(key) { + return Symbol(key); + }; + } else { + makeSymbol = function makeSymbol(key) { + return '_' + key; + }; + } + var MAX = makeSymbol('max'); + var LENGTH = makeSymbol('length'); + var LENGTH_CALCULATOR = makeSymbol('lengthCalculator'); + var ALLOW_STALE = makeSymbol('allowStale'); + var MAX_AGE = makeSymbol('maxAge'); + var DISPOSE = makeSymbol('dispose'); + var NO_DISPOSE_ON_SET = makeSymbol('noDisposeOnSet'); + var LRU_LIST = makeSymbol('lruList'); + var CACHE = makeSymbol('cache'); + function naiveLength() { + return 1; + } // lruList is a yallist where the head is the youngest + // item, and the tail is the oldest. the list contains the Hit + // objects as the entries. + // Each Hit object has a reference to its Yallist.Node. This + // never changes. + // + // cache is a Map (or PseudoMap) that matches the keys to + // the Yallist.Node object. + + function LRUCache(options) { + if (!(this instanceof LRUCache)) { + return new LRUCache(options); + } + if (typeof options === 'number') { + options = { + max: options + }; + } + if (!options) { + options = {}; + } + var max = this[MAX] = options.max; // Kind of weird to have a default max of Infinity, but oh well. + + if (!max || !(typeof max === 'number') || max <= 0) { + this[MAX] = Infinity; + } + var lc = options.length || naiveLength; + if (typeof lc !== 'function') { + lc = naiveLength; + } + this[LENGTH_CALCULATOR] = lc; + this[ALLOW_STALE] = options.stale || false; + this[MAX_AGE] = options.maxAge || 0; + this[DISPOSE] = options.dispose; + this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false; + this.reset(); + } // resize the cache when the max changes. + + Object.defineProperty(LRUCache.prototype, 'max', { + set: function set(mL) { + if (!mL || !(typeof mL === 'number') || mL <= 0) { + mL = Infinity; + } + this[MAX] = mL; + trim(this); + }, + get: function get() { + return this[MAX]; + }, + enumerable: true + }); + Object.defineProperty(LRUCache.prototype, 'allowStale', { + set: function set(allowStale) { + this[ALLOW_STALE] = !!allowStale; + }, + get: function get() { + return this[ALLOW_STALE]; + }, + enumerable: true + }); + Object.defineProperty(LRUCache.prototype, 'maxAge', { + set: function set(mA) { + if (!mA || !(typeof mA === 'number') || mA < 0) { + mA = 0; + } + this[MAX_AGE] = mA; + trim(this); + }, + get: function get() { + return this[MAX_AGE]; + }, + enumerable: true + }); // resize the cache when the lengthCalculator changes. + + Object.defineProperty(LRUCache.prototype, 'lengthCalculator', { + set: function set(lC) { + if (typeof lC !== 'function') { + lC = naiveLength; + } + if (lC !== this[LENGTH_CALCULATOR]) { + this[LENGTH_CALCULATOR] = lC; + this[LENGTH] = 0; + this[LRU_LIST].forEach(function (hit) { + hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key); + this[LENGTH] += hit.length; + }, this); + } + trim(this); + }, + get: function get() { + return this[LENGTH_CALCULATOR]; + }, + enumerable: true + }); + Object.defineProperty(LRUCache.prototype, 'length', { + get: function get() { + return this[LENGTH]; + }, + enumerable: true + }); + Object.defineProperty(LRUCache.prototype, 'itemCount', { + get: function get() { + return this[LRU_LIST].length; + }, + enumerable: true + }); + LRUCache.prototype.rforEach = function (fn, thisp) { + thisp = thisp || this; + for (var walker = this[LRU_LIST].tail; walker !== null;) { + var prev = walker.prev; + forEachStep(this, fn, walker, thisp); + walker = prev; + } + }; + function forEachStep(self, fn, node, thisp) { + var hit = node.value; + if (isStale(self, hit)) { + del(self, node); + if (!self[ALLOW_STALE]) { + hit = undefined; + } + } + if (hit) { + fn.call(thisp, hit.value, hit.key, self); + } + } + LRUCache.prototype.forEach = function (fn, thisp) { + thisp = thisp || this; + for (var walker = this[LRU_LIST].head; walker !== null;) { + var next = walker.next; + forEachStep(this, fn, walker, thisp); + walker = next; + } + }; + LRUCache.prototype.keys = function () { + return this[LRU_LIST].toArray().map(function (k) { + return k.key; + }, this); + }; + LRUCache.prototype.values = function () { + return this[LRU_LIST].toArray().map(function (k) { + return k.value; + }, this); + }; + LRUCache.prototype.reset = function () { + if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) { + this[LRU_LIST].forEach(function (hit) { + this[DISPOSE](hit.key, hit.value); + }, this); + } + this[CACHE] = new Map(); // hash of items by key + + this[LRU_LIST] = new Yallist(); // list of items in order of use recency + + this[LENGTH] = 0; // length of items in the list + }; + LRUCache.prototype.dump = function () { + return this[LRU_LIST].map(function (hit) { + if (!isStale(this, hit)) { + return { + k: hit.key, + v: hit.value, + e: hit.now + (hit.maxAge || 0) + }; + } + }, this).toArray().filter(function (h) { + return h; + }); + }; + LRUCache.prototype.dumpLru = function () { + return this[LRU_LIST]; + }; + /* istanbul ignore next */ + + LRUCache.prototype.inspect = function (n, opts) { + var str = 'LRUCache {'; + var extras = false; + var as = this[ALLOW_STALE]; + if (as) { + str += '\n allowStale: true'; + extras = true; + } + var max = this[MAX]; + if (max && max !== Infinity) { + if (extras) { + str += ','; + } + str += '\n max: ' + util.inspect(max, opts); + extras = true; + } + var maxAge = this[MAX_AGE]; + if (maxAge) { + if (extras) { + str += ','; + } + str += '\n maxAge: ' + util.inspect(maxAge, opts); + extras = true; + } + var lc = this[LENGTH_CALCULATOR]; + if (lc && lc !== naiveLength) { + if (extras) { + str += ','; + } + str += '\n length: ' + util.inspect(this[LENGTH], opts); + extras = true; + } + var didFirst = false; + this[LRU_LIST].forEach(function (item) { + if (didFirst) { + str += ',\n '; + } else { + if (extras) { + str += ',\n'; + } + didFirst = true; + str += '\n '; + } + var key = util.inspect(item.key).split('\n').join('\n '); + var val = { + value: item.value + }; + if (item.maxAge !== maxAge) { + val.maxAge = item.maxAge; + } + if (lc !== naiveLength) { + val.length = item.length; + } + if (isStale(this, item)) { + val.stale = true; + } + val = util.inspect(val, opts).split('\n').join('\n '); + str += key + ' => ' + val; + }); + if (didFirst || extras) { + str += '\n'; + } + str += '}'; + return str; + }; + LRUCache.prototype.set = function (key, value, maxAge) { + maxAge = maxAge || this[MAX_AGE]; + var now = maxAge ? Date.now() : 0; + var len = this[LENGTH_CALCULATOR](value, key); + if (this[CACHE].has(key)) { + if (len > this[MAX]) { + del(this, this[CACHE].get(key)); + return false; + } + var node = this[CACHE].get(key); + var item = node.value; // dispose of the old one before overwriting + // split out into 2 ifs for better coverage tracking + + if (this[DISPOSE]) { + if (!this[NO_DISPOSE_ON_SET]) { + this[DISPOSE](key, item.value); + } + } + item.now = now; + item.maxAge = maxAge; + item.value = value; + this[LENGTH] += len - item.length; + item.length = len; + this.get(key); + trim(this); + return true; + } + var hit = new Entry(key, value, len, now, maxAge); // oversized objects fall out of cache automatically. + + if (hit.length > this[MAX]) { + if (this[DISPOSE]) { + this[DISPOSE](key, value); + } + return false; + } + this[LENGTH] += hit.length; + this[LRU_LIST].unshift(hit); + this[CACHE].set(key, this[LRU_LIST].head); + trim(this); + return true; + }; + LRUCache.prototype.has = function (key) { + if (!this[CACHE].has(key)) return false; + var hit = this[CACHE].get(key).value; + if (isStale(this, hit)) { + return false; + } + return true; + }; + LRUCache.prototype.get = function (key) { + return get(this, key, true); + }; + LRUCache.prototype.peek = function (key) { + return get(this, key, false); + }; + LRUCache.prototype.pop = function () { + var node = this[LRU_LIST].tail; + if (!node) return null; + del(this, node); + return node.value; + }; + LRUCache.prototype.del = function (key) { + del(this, this[CACHE].get(key)); + }; + LRUCache.prototype.load = function (arr) { + // reset the cache + this.reset(); + var now = Date.now(); // A previous serialized cache has the most recent items first + + for (var l = arr.length - 1; l >= 0; l--) { + var hit = arr[l]; + var expiresAt = hit.e || 0; + if (expiresAt === 0) { + // the item was created without expiration in a non aged cache + this.set(hit.k, hit.v); + } else { + var maxAge = expiresAt - now; // dont add already expired items + + if (maxAge > 0) { + this.set(hit.k, hit.v, maxAge); + } + } + } + }; + LRUCache.prototype.prune = function () { + var self = this; + this[CACHE].forEach(function (value, key) { + get(self, key, false); + }); + }; + function get(self, key, doUse) { + var node = self[CACHE].get(key); + if (node) { + var hit = node.value; + if (isStale(self, hit)) { + del(self, node); + if (!self[ALLOW_STALE]) hit = undefined; + } else { + if (doUse) { + self[LRU_LIST].unshiftNode(node); + } + } + if (hit) hit = hit.value; + } + return hit; + } + function isStale(self, hit) { + if (!hit || !hit.maxAge && !self[MAX_AGE]) { + return false; + } + var stale = false; + var diff = Date.now() - hit.now; + if (hit.maxAge) { + stale = diff > hit.maxAge; + } else { + stale = self[MAX_AGE] && diff > self[MAX_AGE]; + } + return stale; + } + function trim(self) { + if (self[LENGTH] > self[MAX]) { + for (var walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null;) { + // We know that we're about to delete this one, and also + // what the next least recently used key will be, so just + // go ahead and set it now. + var prev = walker.prev; + del(self, walker); + walker = prev; + } + } + } + function del(self, node) { + if (node) { + var hit = node.value; + if (self[DISPOSE]) { + self[DISPOSE](hit.key, hit.value); + } + self[LENGTH] -= hit.length; + self[CACHE].delete(hit.key); + self[LRU_LIST].removeNode(node); + } + } // classy, since V8 prefers predictable objects. + + function Entry(key, value, length, now, maxAge) { + this.key = key; + this.value = value; + this.length = length; + this.now = now; + this.maxAge = maxAge || 0; + } + + /***/ + }), + /***/169: (/***/function _(module) { + // shim for using process in browser + var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it + // don't break things. But we need to wrap it in a try catch in case it is + // wrapped in strict mode code which doesn't define any globals. It's inside a + // function because try/catches deoptimize in certain engines. + + var cachedSetTimeout; + var cachedClearTimeout; + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + function defaultClearTimeout() { + throw new Error('clearTimeout has not been defined'); + } + (function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + })(); + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } // if setTimeout wasn't available but was latter defined + + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } // if clearTimeout wasn't available but was latter defined + + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + } + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + var len = queue.length; + while (len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; // v8 likes predictible objects + + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; // empty string to avoid regexp issues + + process.versions = {}; + function noop() {} + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + process.listeners = function (name) { + return []; + }; + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + process.cwd = function () { + return '/'; + }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function () { + return 0; + }; + + /***/ + }), + /***/307: (/***/function _(module, __unused_webpack_exports, __webpack_require__) { + /* provided dependency */var process = __webpack_require__(169); + if (process.env.npm_package_name === 'pseudomap' && process.env.npm_lifecycle_script === 'test') process.env.TEST_PSEUDOMAP = 'true'; + if (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) { + module.exports = Map; + } else { + module.exports = __webpack_require__(761); + } + + /***/ + }), + /***/761: (/***/function _(module) { + var hasOwnProperty = Object.prototype.hasOwnProperty; + module.exports = PseudoMap; + function PseudoMap(set) { + if (!(this instanceof PseudoMap)) + // whyyyyyyy + throw new TypeError("Constructor PseudoMap requires 'new'"); + this.clear(); + if (set) { + if (set instanceof PseudoMap || typeof Map === 'function' && set instanceof Map) set.forEach(function (value, key) { + this.set(key, value); + }, this);else if (Array.isArray(set)) set.forEach(function (kv) { + this.set(kv[0], kv[1]); + }, this);else throw new TypeError('invalid argument'); + } + } + PseudoMap.prototype.forEach = function (fn, thisp) { + thisp = thisp || this; + Object.keys(this._data).forEach(function (k) { + if (k !== 'size') fn.call(thisp, this._data[k].value, this._data[k].key); + }, this); + }; + PseudoMap.prototype.has = function (k) { + return !!find(this._data, k); + }; + PseudoMap.prototype.get = function (k) { + var res = find(this._data, k); + return res && res.value; + }; + PseudoMap.prototype.set = function (k, v) { + set(this._data, k, v); + }; + PseudoMap.prototype.delete = function (k) { + var res = find(this._data, k); + if (res) { + delete this._data[res._index]; + this._data.size--; + } + }; + PseudoMap.prototype.clear = function () { + var data = Object.create(null); + data.size = 0; + Object.defineProperty(this, '_data', { + value: data, + enumerable: false, + configurable: true, + writable: false + }); + }; + Object.defineProperty(PseudoMap.prototype, 'size', { + get: function get() { + return this._data.size; + }, + set: function set(n) {}, + enumerable: true, + configurable: true + }); + PseudoMap.prototype.values = PseudoMap.prototype.keys = PseudoMap.prototype.entries = function () { + throw new Error('iterators are not implemented in this version'); + }; // Either identical, or both NaN + + function same(a, b) { + return a === b || a !== a && b !== b; + } + function Entry(k, v, i) { + this.key = k; + this.value = v; + this._index = i; + } + function find(data, k) { + for (var i = 0, s = '_' + k, key = s; hasOwnProperty.call(data, key); key = s + i++) { + if (same(data[key].key, k)) return data[key]; + } + } + function set(data, k, v) { + for (var i = 0, s = '_' + k, key = s; hasOwnProperty.call(data, key); key = s + i++) { + if (same(data[key].key, k)) { + data[key].value = v; + return; + } + } + data.size++; + data[key] = new Entry(k, v, key); + } + + /***/ + }), + /***/430: (/***/function _(module, exports) { + var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return _typeof(obj); + } + (function (root, factory) { + 'use strict'; + + // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers. + + /* istanbul ignore next */ + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + })(this, function () { + 'use strict'; + + function _isNumber(n) { + return !isNaN(parseFloat(n)) && isFinite(n); + } + function _capitalize(str) { + return str.charAt(0).toUpperCase() + str.substring(1); + } + function _getter(p) { + return function () { + return this[p]; + }; + } + var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel']; + var numericProps = ['columnNumber', 'lineNumber']; + var stringProps = ['fileName', 'functionName', 'source']; + var arrayProps = ['args']; + var props = booleanProps.concat(numericProps, stringProps, arrayProps); + function StackFrame(obj) { + if (!obj) return; + for (var i = 0; i < props.length; i++) { + if (obj[props[i]] !== undefined) { + this['set' + _capitalize(props[i])](obj[props[i]]); + } + } + } + StackFrame.prototype = { + getArgs: function getArgs() { + return this.args; + }, + setArgs: function setArgs(v) { + if (Object.prototype.toString.call(v) !== '[object Array]') { + throw new TypeError('Args must be an Array'); + } + this.args = v; + }, + getEvalOrigin: function getEvalOrigin() { + return this.evalOrigin; + }, + setEvalOrigin: function setEvalOrigin(v) { + if (v instanceof StackFrame) { + this.evalOrigin = v; + } else if (v instanceof Object) { + this.evalOrigin = new StackFrame(v); + } else { + throw new TypeError('Eval Origin must be an Object or StackFrame'); + } + }, + toString: function toString() { + var fileName = this.getFileName() || ''; + var lineNumber = this.getLineNumber() || ''; + var columnNumber = this.getColumnNumber() || ''; + var functionName = this.getFunctionName() || ''; + if (this.getIsEval()) { + if (fileName) { + return '[eval] (' + fileName + ':' + lineNumber + ':' + columnNumber + ')'; + } + return '[eval]:' + lineNumber + ':' + columnNumber; + } + if (functionName) { + return functionName + ' (' + fileName + ':' + lineNumber + ':' + columnNumber + ')'; + } + return fileName + ':' + lineNumber + ':' + columnNumber; + } + }; + StackFrame.fromString = function StackFrame$$fromString(str) { + var argsStartIndex = str.indexOf('('); + var argsEndIndex = str.lastIndexOf(')'); + var functionName = str.substring(0, argsStartIndex); + var args = str.substring(argsStartIndex + 1, argsEndIndex).split(','); + var locationString = str.substring(argsEndIndex + 1); + if (locationString.indexOf('@') === 0) { + var parts = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(locationString, ''); + var fileName = parts[1]; + var lineNumber = parts[2]; + var columnNumber = parts[3]; + } + return new StackFrame({ + functionName: functionName, + args: args || undefined, + fileName: fileName, + lineNumber: lineNumber || undefined, + columnNumber: columnNumber || undefined + }); + }; + for (var i = 0; i < booleanProps.length; i++) { + StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]); + StackFrame.prototype['set' + _capitalize(booleanProps[i])] = function (p) { + return function (v) { + this[p] = Boolean(v); + }; + }(booleanProps[i]); + } + for (var j = 0; j < numericProps.length; j++) { + StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]); + StackFrame.prototype['set' + _capitalize(numericProps[j])] = function (p) { + return function (v) { + if (!_isNumber(v)) { + throw new TypeError(p + ' must be a Number'); + } + this[p] = Number(v); + }; + }(numericProps[j]); + } + for (var k = 0; k < stringProps.length; k++) { + StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]); + StackFrame.prototype['set' + _capitalize(stringProps[k])] = function (p) { + return function (v) { + this[p] = String(v); + }; + }(stringProps[k]); + } + return StackFrame; + }); + + /***/ + }), + /***/718: (/***/function _(module) { + if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; + } else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function TempCtor() {}; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + }; + } + + /***/ + }), + /***/715: (/***/function _(module) { + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return _typeof(obj); + } + module.exports = function isBuffer(arg) { + return arg && _typeof(arg) === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; + }; + + /***/ + }), + /***/82: (/***/function _(__unused_webpack_module, exports, __webpack_require__) { + /* provided dependency */var process = __webpack_require__(169); + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return _typeof(obj); + } + + // Copyright Joyent, Inc. and other Node contributors. + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the + // "Software"), to deal in the Software without restriction, including + // without limitation the rights to use, copy, modify, merge, publish, + // distribute, sublicense, and/or sell copies of the Software, and to permit + // persons to whom the Software is furnished to do so, subject to the + // following conditions: + // + // The above copyright notice and this permission notice shall be included + // in all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + var formatRegExp = /%[sdj%]/g; + exports.format = function (f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function (x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': + return String(args[i++]); + case '%d': + return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; + }; // Mark that a method should not be used. + // Returns a modified function which warns once by default. + // If --no-deprecation is set, then it is a no-op. + + exports.deprecate = function (fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function () { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + if (process.noDeprecation === true) { + return fn; + } + var warned = false; + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + return deprecated; + }; + var debugs = {}; + var debugEnviron; + exports.debuglog = function (set) { + if (isUndefined(debugEnviron)) debugEnviron = process.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function () { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function () {}; + } + } + return debugs[set]; + }; + /** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ + + /* legacy: obj, showHidden, depth, colors*/ + + function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; // legacy... + + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } // set default options + + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); + } + exports.inspect = inspect; // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics + + inspect.colors = { + 'bold': [1, 22], + 'italic': [3, 23], + 'underline': [4, 24], + 'inverse': [7, 27], + 'white': [37, 39], + 'grey': [90, 39], + 'black': [30, 39], + 'blue': [34, 39], + 'cyan': [36, 39], + 'green': [32, 39], + 'magenta': [35, 39], + 'red': [31, 39], + 'yellow': [33, 39] + }; // Don't use 'blue' not visible on cmd.exe + + inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' + }; + function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + if (style) { + return "\x1B[" + inspect.colors[style][0] + 'm' + str + "\x1B[" + inspect.colors[style][1] + 'm'; + } else { + return str; + } + } + function stylizeNoColor(str, styleType) { + return str; + } + function arrayToHash(array) { + var hash = {}; + array.forEach(function (val, idx) { + hash[val] = true; + }); + return hash; + } + function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && value && isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } // Primitive types cannot have properties + + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } // Look up the keys of the object. + + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + + if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } // Some type of object without properties can be shortcutted. + + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + var base = '', + array = false, + braces = ['{', '}']; // Make Array say that they are Array + + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } // Make functions say that they are functions + + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } // Make RegExps say that they are RegExps + + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } // Make dates with properties first say the date + + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } // Make error with message first say the error + + if (isError(value)) { + base = ' ' + formatError(value); + } + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + ctx.seen.push(value); + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function (key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + ctx.seen.pop(); + return reduceToSingleString(output, base, braces); + } + function formatPrimitive(ctx, value) { + if (isUndefined(value)) return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); // For some reason typeof null is "object", so special case here. + + if (isNull(value)) return ctx.stylize('null', 'null'); + } + function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; + } + function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function (key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); + } + }); + return output; + } + function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { + value: value[key] + }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function (line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function (line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + return name + ': ' + str; + } + function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function (prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + if (length > 60) { + return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1]; + } + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; + } // NOTE: These type checking functions intentionally don't use `instanceof` + // because it is fragile and can be easily faked with `Object.create()`. + + function isArray(ar) { + return Array.isArray(ar); + } + exports.isArray = isArray; + function isBoolean(arg) { + return typeof arg === 'boolean'; + } + exports.isBoolean = isBoolean; + function isNull(arg) { + return arg === null; + } + exports.isNull = isNull; + function isNullOrUndefined(arg) { + return arg == null; + } + exports.isNullOrUndefined = isNullOrUndefined; + function isNumber(arg) { + return typeof arg === 'number'; + } + exports.isNumber = isNumber; + function isString(arg) { + return typeof arg === 'string'; + } + exports.isString = isString; + function isSymbol(arg) { + return _typeof(arg) === 'symbol'; + } + exports.isSymbol = isSymbol; + function isUndefined(arg) { + return arg === void 0; + } + exports.isUndefined = isUndefined; + function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; + } + exports.isRegExp = isRegExp; + function isObject(arg) { + return _typeof(arg) === 'object' && arg !== null; + } + exports.isObject = isObject; + function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; + } + exports.isDate = isDate; + function isError(e) { + return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error); + } + exports.isError = isError; + function isFunction(arg) { + return typeof arg === 'function'; + } + exports.isFunction = isFunction; + function isPrimitive(arg) { + return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || _typeof(arg) === 'symbol' || + // ES6 symbol + typeof arg === 'undefined'; + } + exports.isPrimitive = isPrimitive; + exports.isBuffer = __webpack_require__(715); + function objectToString(o) { + return Object.prototype.toString.call(o); + } + function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); + } + var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; // 26 Feb 16:19:34 + + function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); + } // log is just a thin wrapper to console.log that prepends a timestamp + + exports.log = function () { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); + }; + /** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ + + exports.inherits = __webpack_require__(718); + exports._extend = function (origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; + }; + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + /***/ + }), + /***/695: (/***/function _(module) { + module.exports = Yallist; + Yallist.Node = Node; + Yallist.create = Yallist; + function Yallist(list) { + var self = this; + if (!(self instanceof Yallist)) { + self = new Yallist(); + } + self.tail = null; + self.head = null; + self.length = 0; + if (list && typeof list.forEach === 'function') { + list.forEach(function (item) { + self.push(item); + }); + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]); + } + } + return self; + } + Yallist.prototype.removeNode = function (node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list'); + } + var next = node.next; + var prev = node.prev; + if (next) { + next.prev = prev; + } + if (prev) { + prev.next = next; + } + if (node === this.head) { + this.head = next; + } + if (node === this.tail) { + this.tail = prev; + } + node.list.length--; + node.next = null; + node.prev = null; + node.list = null; + }; + Yallist.prototype.unshiftNode = function (node) { + if (node === this.head) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + var head = this.head; + node.list = this; + node.next = head; + if (head) { + head.prev = node; + } + this.head = node; + if (!this.tail) { + this.tail = node; + } + this.length++; + }; + Yallist.prototype.pushNode = function (node) { + if (node === this.tail) { + return; + } + if (node.list) { + node.list.removeNode(node); + } + var tail = this.tail; + node.list = this; + node.prev = tail; + if (tail) { + tail.next = node; + } + this.tail = node; + if (!this.head) { + this.head = node; + } + this.length++; + }; + Yallist.prototype.push = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]); + } + return this.length; + }; + Yallist.prototype.unshift = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]); + } + return this.length; + }; + Yallist.prototype.pop = function () { + if (!this.tail) { + return undefined; + } + var res = this.tail.value; + this.tail = this.tail.prev; + if (this.tail) { + this.tail.next = null; + } else { + this.head = null; + } + this.length--; + return res; + }; + Yallist.prototype.shift = function () { + if (!this.head) { + return undefined; + } + var res = this.head.value; + this.head = this.head.next; + if (this.head) { + this.head.prev = null; + } else { + this.tail = null; + } + this.length--; + return res; + }; + Yallist.prototype.forEach = function (fn, thisp) { + thisp = thisp || this; + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this); + walker = walker.next; + } + }; + Yallist.prototype.forEachReverse = function (fn, thisp) { + thisp = thisp || this; + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this); + walker = walker.prev; + } + }; + Yallist.prototype.get = function (n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.next; + } + if (i === n && walker !== null) { + return walker.value; + } + }; + Yallist.prototype.getReverse = function (n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev; + } + if (i === n && walker !== null) { + return walker.value; + } + }; + Yallist.prototype.map = function (fn, thisp) { + thisp = thisp || this; + var res = new Yallist(); + for (var walker = this.head; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.next; + } + return res; + }; + Yallist.prototype.mapReverse = function (fn, thisp) { + thisp = thisp || this; + var res = new Yallist(); + for (var walker = this.tail; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)); + walker = walker.prev; + } + return res; + }; + Yallist.prototype.reduce = function (fn, initial) { + var acc; + var walker = this.head; + if (arguments.length > 1) { + acc = initial; + } else if (this.head) { + walker = this.head.next; + acc = this.head.value; + } else { + throw new TypeError('Reduce of empty list with no initial value'); + } + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i); + walker = walker.next; + } + return acc; + }; + Yallist.prototype.reduceReverse = function (fn, initial) { + var acc; + var walker = this.tail; + if (arguments.length > 1) { + acc = initial; + } else if (this.tail) { + walker = this.tail.prev; + acc = this.tail.value; + } else { + throw new TypeError('Reduce of empty list with no initial value'); + } + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i); + walker = walker.prev; + } + return acc; + }; + Yallist.prototype.toArray = function () { + var arr = new Array(this.length); + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value; + walker = walker.next; + } + return arr; + }; + Yallist.prototype.toArrayReverse = function () { + var arr = new Array(this.length); + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value; + walker = walker.prev; + } + return arr; + }; + Yallist.prototype.slice = function (from, to) { + to = to || this.length; + if (to < 0) { + to += this.length; + } + from = from || 0; + if (from < 0) { + from += this.length; + } + var ret = new Yallist(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next; + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value); + } + return ret; + }; + Yallist.prototype.sliceReverse = function (from, to) { + to = to || this.length; + if (to < 0) { + to += this.length; + } + from = from || 0; + if (from < 0) { + from += this.length; + } + var ret = new Yallist(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev; + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value); + } + return ret; + }; + Yallist.prototype.reverse = function () { + var head = this.head; + var tail = this.tail; + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev; + walker.prev = walker.next; + walker.next = p; + } + this.head = tail; + this.tail = head; + return this; + }; + function push(self, item) { + self.tail = new Node(item, self.tail, null, self); + if (!self.head) { + self.head = self.tail; + } + self.length++; + } + function unshift(self, item) { + self.head = new Node(item, null, self.head, self); + if (!self.tail) { + self.tail = self.head; + } + self.length++; + } + function Node(value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list); + } + this.list = list; + this.value = value; + if (prev) { + prev.next = this; + this.prev = prev; + } else { + this.prev = null; + } + if (next) { + next.prev = this; + this.next = next; + } else { + this.next = null; + } + } + + /***/ + }) + + /******/ + }; + /************************************************************************/ + /******/ // The module cache + /******/ + var __webpack_module_cache__ = {}; + /******/ + /******/ // The require function + /******/ + function __webpack_require__(moduleId) { + /******/ // Check if module is in cache + /******/var cachedModule = __webpack_module_cache__[moduleId]; + /******/ + if (cachedModule !== undefined) { + /******/return cachedModule.exports; + /******/ + } + /******/ // Create a new module (and put it into the cache) + /******/ + var module = __webpack_module_cache__[moduleId] = { + /******/ // no module.id needed + /******/ // no module.loaded needed + /******/exports: {} + /******/ + }; + /******/ + /******/ // Execute the module function + /******/ + __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); + /******/ + /******/ // Return the exports of the module + /******/ + return module.exports; + /******/ + } + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ + (function () { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/__webpack_require__.n = function (module) { + /******/var getter = module && module.__esModule ? /******/function () { + return module['default']; + } : /******/function () { + return module; + }; + /******/ + __webpack_require__.d(getter, { + a: getter + }); + /******/ + return getter; + /******/ + }; + /******/ + })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ + (function () { + /******/ // define getter functions for harmony exports + /******/__webpack_require__.d = function (exports, definition) { + /******/for (var key in definition) { + /******/if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { + /******/Object.defineProperty(exports, key, { + enumerable: true, + get: definition[key] + }); + /******/ + } + /******/ + } + /******/ + }; + /******/ + })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ + (function () { + /******/__webpack_require__.o = function (obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + }; + /******/ + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ + (function () { + /******/ // define __esModule on exports + /******/__webpack_require__.r = function (exports) { + /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) { + /******/Object.defineProperty(exports, Symbol.toStringTag, { + value: 'Module' + }); + /******/ + } + /******/ + Object.defineProperty(exports, '__esModule', { + value: true + }); + /******/ + }; + /******/ + })(); + /******/ + /************************************************************************/ + var __webpack_exports__ = {}; + // This entry need to be wrapped in an IIFE because it need to be in strict mode. + (function () { + "use strict"; + + // ESM COMPAT FLAG + __webpack_require__.r(__webpack_exports__); + + // EXPORTS + __webpack_require__.d(__webpack_exports__, { + "connectToDevTools": function connectToDevTools() { + return /* binding */_connectToDevTools; + } + }); + ; // CONCATENATED MODULE: ../react-devtools-shared/src/events.js + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + var EventEmitter = /*#__PURE__*/function () { + function EventEmitter() { + _classCallCheck(this, EventEmitter); + _defineProperty(this, "listenersMap", new Map()); + } + _createClass(EventEmitter, [{ + key: "addListener", + value: function addListener(event, listener) { + var listeners = this.listenersMap.get(event); + if (listeners === undefined) { + this.listenersMap.set(event, [listener]); + } else { + var index = listeners.indexOf(listener); + if (index < 0) { + listeners.push(listener); + } + } + } + }, { + key: "emit", + value: function emit(event) { + var listeners = this.listenersMap.get(event); + if (listeners !== undefined) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + if (listeners.length === 1) { + // No need to clone or try/catch + var listener = listeners[0]; + listener.apply(null, args); + } else { + var didThrow = false; + var caughtError = null; + var clonedListeners = Array.from(listeners); + for (var i = 0; i < clonedListeners.length; i++) { + var _listener = clonedListeners[i]; + try { + _listener.apply(null, args); + } catch (error) { + if (caughtError === null) { + didThrow = true; + caughtError = error; + } + } + } + if (didThrow) { + throw caughtError; + } + } + } + } + }, { + key: "removeAllListeners", + value: function removeAllListeners() { + this.listenersMap.clear(); + } + }, { + key: "removeListener", + value: function removeListener(event, listener) { + var listeners = this.listenersMap.get(event); + if (listeners !== undefined) { + var index = listeners.indexOf(listener); + if (index >= 0) { + listeners.splice(index, 1); + } + } + } + }]); + return EventEmitter; + }(); + + // EXTERNAL MODULE: ../../node_modules/lodash.throttle/index.js + var lodash_throttle = __webpack_require__(172); + var lodash_throttle_default = /*#__PURE__*/__webpack_require__.n(lodash_throttle); + ; // CONCATENATED MODULE: ../react-devtools-shared/src/constants.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + var CHROME_WEBSTORE_EXTENSION_ID = 'fmkadmapgofadopljbjfkapdkoienihi'; + var INTERNAL_EXTENSION_ID = 'dnjnjgbfilfphmojnmhliehogmojhclc'; + var LOCAL_EXTENSION_ID = 'ikiahnapldjmdmpkmfhjdjilojjhgcbf'; // Flip this flag to true to enable verbose console debug logging. + + var __DEBUG__ = false; // Flip this flag to true to enable performance.mark() and performance.measure() timings. + + var __PERFORMANCE_PROFILE__ = false; + var TREE_OPERATION_ADD = 1; + var TREE_OPERATION_REMOVE = 2; + var TREE_OPERATION_REORDER_CHILDREN = 3; + var TREE_OPERATION_UPDATE_TREE_BASE_DURATION = 4; + var TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS = 5; + var TREE_OPERATION_REMOVE_ROOT = 6; + var TREE_OPERATION_SET_SUBTREE_MODE = 7; + var PROFILING_FLAG_BASIC_SUPPORT = 1; + var PROFILING_FLAG_TIMELINE_SUPPORT = 2; + var LOCAL_STORAGE_DEFAULT_TAB_KEY = 'React::DevTools::defaultTab'; + var constants_LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY = 'React::DevTools::componentFilters'; + var SESSION_STORAGE_LAST_SELECTION_KEY = 'React::DevTools::lastSelection'; + var constants_LOCAL_STORAGE_OPEN_IN_EDITOR_URL = 'React::DevTools::openInEditorUrl'; + var LOCAL_STORAGE_OPEN_IN_EDITOR_URL_PRESET = 'React::DevTools::openInEditorUrlPreset'; + var LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY = 'React::DevTools::parseHookNames'; + var SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY = 'React::DevTools::recordChangeDescriptions'; + var SESSION_STORAGE_RELOAD_AND_PROFILE_KEY = 'React::DevTools::reloadAndProfile'; + var constants_LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS = 'React::DevTools::breakOnConsoleErrors'; + var LOCAL_STORAGE_BROWSER_THEME = 'React::DevTools::theme'; + var constants_LOCAL_STORAGE_SHOULD_APPEND_COMPONENT_STACK_KEY = 'React::DevTools::appendComponentStack'; + var constants_LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY = 'React::DevTools::showInlineWarningsAndErrors'; + var LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY = 'React::DevTools::traceUpdatesEnabled'; + var constants_LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE = 'React::DevTools::hideConsoleLogsInStrictMode'; + var LOCAL_STORAGE_SUPPORTS_PROFILING_KEY = 'React::DevTools::supportsProfiling'; + var PROFILER_EXPORT_VERSION = 5; + ; // CONCATENATED MODULE: ../react-devtools-shared/src/storage.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + function storage_localStorageGetItem(key) { + try { + return localStorage.getItem(key); + } catch (error) { + return null; + } + } + function localStorageRemoveItem(key) { + try { + localStorage.removeItem(key); + } catch (error) {} + } + function storage_localStorageSetItem(key, value) { + try { + return localStorage.setItem(key, value); + } catch (error) {} + } + function sessionStorageGetItem(key) { + try { + return sessionStorage.getItem(key); + } catch (error) { + return null; + } + } + function sessionStorageRemoveItem(key) { + try { + sessionStorage.removeItem(key); + } catch (error) {} + } + function sessionStorageSetItem(key, value) { + try { + return sessionStorage.setItem(key, value); + } catch (error) {} + } + ; // CONCATENATED MODULE: ../../node_modules/memoize-one/esm/index.js + var simpleIsEqual = function simpleIsEqual(a, b) { + return a === b; + }; + + /* harmony default export */ + function esm(resultFn) { + var isEqual = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : simpleIsEqual; + var lastThis = void 0; + var lastArgs = []; + var lastResult = void 0; + var calledOnce = false; + var isNewArgEqualToLast = function isNewArgEqualToLast(newArg, index) { + return isEqual(newArg, lastArgs[index]); + }; + var result = function result() { + for (var _len = arguments.length, newArgs = Array(_len), _key = 0; _key < _len; _key++) { + newArgs[_key] = arguments[_key]; + } + if (calledOnce && lastThis === this && newArgs.length === lastArgs.length && newArgs.every(isNewArgEqualToLast)) { + return lastResult; + } + calledOnce = true; + lastThis = this; + lastArgs = newArgs; + lastResult = resultFn.apply(this, newArgs); + return lastResult; + }; + return result; + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/views/utils.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + // Get the window object for the document that a node belongs to, + // or return null if it cannot be found (node not attached to DOM, + // etc). + function getOwnerWindow(node) { + if (!node.ownerDocument) { + return null; + } + return node.ownerDocument.defaultView; + } // Get the iframe containing a node, or return null if it cannot + // be found (node not within iframe, etc). + + function getOwnerIframe(node) { + var nodeWindow = getOwnerWindow(node); + if (nodeWindow) { + return nodeWindow.frameElement; + } + return null; + } // Get a bounding client rect for a node, with an + // offset added to compensate for its border. + + function getBoundingClientRectWithBorderOffset(node) { + var dimensions = getElementDimensions(node); + return mergeRectOffsets([node.getBoundingClientRect(), { + top: dimensions.borderTop, + left: dimensions.borderLeft, + bottom: dimensions.borderBottom, + right: dimensions.borderRight, + // This width and height won't get used by mergeRectOffsets (since this + // is not the first rect in the array), but we set them so that this + // object type checks as a ClientRect. + width: 0, + height: 0 + }]); + } // Add together the top, left, bottom, and right properties of + // each ClientRect, but keep the width and height of the first one. + + function mergeRectOffsets(rects) { + return rects.reduce(function (previousRect, rect) { + if (previousRect == null) { + return rect; + } + return { + top: previousRect.top + rect.top, + left: previousRect.left + rect.left, + width: previousRect.width, + height: previousRect.height, + bottom: previousRect.bottom + rect.bottom, + right: previousRect.right + rect.right + }; + }); + } // Calculate a boundingClientRect for a node relative to boundaryWindow, + // taking into account any offsets caused by intermediate iframes. + + function getNestedBoundingClientRect(node, boundaryWindow) { + var ownerIframe = getOwnerIframe(node); + if (ownerIframe && ownerIframe !== boundaryWindow) { + var rects = [node.getBoundingClientRect()]; + var currentIframe = ownerIframe; + var onlyOneMore = false; + while (currentIframe) { + var rect = getBoundingClientRectWithBorderOffset(currentIframe); + rects.push(rect); + currentIframe = getOwnerIframe(currentIframe); + if (onlyOneMore) { + break; + } // We don't want to calculate iframe offsets upwards beyond + // the iframe containing the boundaryWindow, but we + // need to calculate the offset relative to the boundaryWindow. + + if (currentIframe && getOwnerWindow(currentIframe) === boundaryWindow) { + onlyOneMore = true; + } + } + return mergeRectOffsets(rects); + } else { + return node.getBoundingClientRect(); + } + } + function getElementDimensions(domElement) { + var calculatedStyle = window.getComputedStyle(domElement); + return { + borderLeft: parseInt(calculatedStyle.borderLeftWidth, 10), + borderRight: parseInt(calculatedStyle.borderRightWidth, 10), + borderTop: parseInt(calculatedStyle.borderTopWidth, 10), + borderBottom: parseInt(calculatedStyle.borderBottomWidth, 10), + marginLeft: parseInt(calculatedStyle.marginLeft, 10), + marginRight: parseInt(calculatedStyle.marginRight, 10), + marginTop: parseInt(calculatedStyle.marginTop, 10), + marginBottom: parseInt(calculatedStyle.marginBottom, 10), + paddingLeft: parseInt(calculatedStyle.paddingLeft, 10), + paddingRight: parseInt(calculatedStyle.paddingRight, 10), + paddingTop: parseInt(calculatedStyle.paddingTop, 10), + paddingBottom: parseInt(calculatedStyle.paddingBottom, 10) + }; + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/views/Highlighter/Overlay.js + function Overlay_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function Overlay_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function Overlay_createClass(Constructor, protoProps, staticProps) { + if (protoProps) Overlay_defineProperties(Constructor.prototype, protoProps); + if (staticProps) Overlay_defineProperties(Constructor, staticProps); + return Constructor; + } + + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + var Overlay_assign = Object.assign; // Note that the Overlay components are not affected by the active Theme, + // because they highlight elements in the main Chrome window (outside of devtools). + // The colors below were chosen to roughly match those used by Chrome devtools. + + var OverlayRect = /*#__PURE__*/function () { + function OverlayRect(doc, container) { + Overlay_classCallCheck(this, OverlayRect); + this.node = doc.createElement('div'); + this.border = doc.createElement('div'); + this.padding = doc.createElement('div'); + this.content = doc.createElement('div'); + this.border.style.borderColor = overlayStyles.border; + this.padding.style.borderColor = overlayStyles.padding; + this.content.style.backgroundColor = overlayStyles.background; + Overlay_assign(this.node.style, { + borderColor: overlayStyles.margin, + pointerEvents: 'none', + position: 'fixed' + }); + this.node.style.zIndex = '10000000'; + this.node.appendChild(this.border); + this.border.appendChild(this.padding); + this.padding.appendChild(this.content); + container.appendChild(this.node); + } + Overlay_createClass(OverlayRect, [{ + key: "remove", + value: function remove() { + if (this.node.parentNode) { + this.node.parentNode.removeChild(this.node); + } + } + }, { + key: "update", + value: function update(box, dims) { + boxWrap(dims, 'margin', this.node); + boxWrap(dims, 'border', this.border); + boxWrap(dims, 'padding', this.padding); + Overlay_assign(this.content.style, { + height: box.height - dims.borderTop - dims.borderBottom - dims.paddingTop - dims.paddingBottom + 'px', + width: box.width - dims.borderLeft - dims.borderRight - dims.paddingLeft - dims.paddingRight + 'px' + }); + Overlay_assign(this.node.style, { + top: box.top - dims.marginTop + 'px', + left: box.left - dims.marginLeft + 'px' + }); + } + }]); + return OverlayRect; + }(); + var OverlayTip = /*#__PURE__*/function () { + function OverlayTip(doc, container) { + Overlay_classCallCheck(this, OverlayTip); + this.tip = doc.createElement('div'); + Overlay_assign(this.tip.style, { + display: 'flex', + flexFlow: 'row nowrap', + backgroundColor: '#333740', + borderRadius: '2px', + fontFamily: '"SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace', + fontWeight: 'bold', + padding: '3px 5px', + pointerEvents: 'none', + position: 'fixed', + fontSize: '12px', + whiteSpace: 'nowrap' + }); + this.nameSpan = doc.createElement('span'); + this.tip.appendChild(this.nameSpan); + Overlay_assign(this.nameSpan.style, { + color: '#ee78e6', + borderRight: '1px solid #aaaaaa', + paddingRight: '0.5rem', + marginRight: '0.5rem' + }); + this.dimSpan = doc.createElement('span'); + this.tip.appendChild(this.dimSpan); + Overlay_assign(this.dimSpan.style, { + color: '#d7d7d7' + }); + this.tip.style.zIndex = '10000000'; + container.appendChild(this.tip); + } + Overlay_createClass(OverlayTip, [{ + key: "remove", + value: function remove() { + if (this.tip.parentNode) { + this.tip.parentNode.removeChild(this.tip); + } + } + }, { + key: "updateText", + value: function updateText(name, width, height) { + this.nameSpan.textContent = name; + this.dimSpan.textContent = Math.round(width) + 'px × ' + Math.round(height) + 'px'; + } + }, { + key: "updatePosition", + value: function updatePosition(dims, bounds) { + var tipRect = this.tip.getBoundingClientRect(); + var tipPos = findTipPos(dims, bounds, { + width: tipRect.width, + height: tipRect.height + }); + Overlay_assign(this.tip.style, tipPos.style); + } + }]); + return OverlayTip; + }(); + var Overlay = /*#__PURE__*/function () { + function Overlay(agent) { + Overlay_classCallCheck(this, Overlay); + + // Find the root window, because overlays are positioned relative to it. + var currentWindow = window.__REACT_DEVTOOLS_TARGET_WINDOW__ || window; + this.window = currentWindow; // When opened in shells/dev, the tooltip should be bound by the app iframe, not by the topmost window. + + var tipBoundsWindow = window.__REACT_DEVTOOLS_TARGET_WINDOW__ || window; + this.tipBoundsWindow = tipBoundsWindow; + var doc = currentWindow.document; + this.container = doc.createElement('div'); + this.container.style.zIndex = '10000000'; + this.tip = new OverlayTip(doc, this.container); + this.rects = []; + this.agent = agent; + doc.body.appendChild(this.container); + } + Overlay_createClass(Overlay, [{ + key: "remove", + value: function remove() { + this.tip.remove(); + this.rects.forEach(function (rect) { + rect.remove(); + }); + this.rects.length = 0; + if (this.container.parentNode) { + this.container.parentNode.removeChild(this.container); + } + } + }, { + key: "inspect", + value: function inspect(nodes, name) { + var _this = this; + + // We can't get the size of text nodes or comment nodes. React as of v15 + // heavily uses comment nodes to delimit text. + var elements = nodes.filter(function (node) { + return node.nodeType === Node.ELEMENT_NODE; + }); + while (this.rects.length > elements.length) { + var rect = this.rects.pop(); + rect.remove(); + } + if (elements.length === 0) { + return; + } + while (this.rects.length < elements.length) { + this.rects.push(new OverlayRect(this.window.document, this.container)); + } + var outerBox = { + top: Number.POSITIVE_INFINITY, + right: Number.NEGATIVE_INFINITY, + bottom: Number.NEGATIVE_INFINITY, + left: Number.POSITIVE_INFINITY + }; + elements.forEach(function (element, index) { + var box = getNestedBoundingClientRect(element, _this.window); + var dims = getElementDimensions(element); + outerBox.top = Math.min(outerBox.top, box.top - dims.marginTop); + outerBox.right = Math.max(outerBox.right, box.left + box.width + dims.marginRight); + outerBox.bottom = Math.max(outerBox.bottom, box.top + box.height + dims.marginBottom); + outerBox.left = Math.min(outerBox.left, box.left - dims.marginLeft); + var rect = _this.rects[index]; + rect.update(box, dims); + }); + if (!name) { + name = elements[0].nodeName.toLowerCase(); + var node = elements[0]; + var rendererInterface = this.agent.getBestMatchingRendererInterface(node); + if (rendererInterface) { + var id = rendererInterface.getFiberIDForNative(node, true); + if (id) { + var ownerName = rendererInterface.getDisplayNameForFiberID(id, true); + if (ownerName) { + name += ' (in ' + ownerName + ')'; + } + } + } + } + this.tip.updateText(name, outerBox.right - outerBox.left, outerBox.bottom - outerBox.top); + var tipBounds = getNestedBoundingClientRect(this.tipBoundsWindow.document.documentElement, this.window); + this.tip.updatePosition({ + top: outerBox.top, + left: outerBox.left, + height: outerBox.bottom - outerBox.top, + width: outerBox.right - outerBox.left + }, { + top: tipBounds.top + this.tipBoundsWindow.scrollY, + left: tipBounds.left + this.tipBoundsWindow.scrollX, + height: this.tipBoundsWindow.innerHeight, + width: this.tipBoundsWindow.innerWidth + }); + } + }]); + return Overlay; + }(); + function findTipPos(dims, bounds, tipSize) { + var tipHeight = Math.max(tipSize.height, 20); + var tipWidth = Math.max(tipSize.width, 60); + var margin = 5; + var top; + if (dims.top + dims.height + tipHeight <= bounds.top + bounds.height) { + if (dims.top + dims.height < bounds.top + 0) { + top = bounds.top + margin; + } else { + top = dims.top + dims.height + margin; + } + } else if (dims.top - tipHeight <= bounds.top + bounds.height) { + if (dims.top - tipHeight - margin < bounds.top + margin) { + top = bounds.top + margin; + } else { + top = dims.top - tipHeight - margin; + } + } else { + top = bounds.top + bounds.height - tipHeight - margin; + } + var left = dims.left + margin; + if (dims.left < bounds.left) { + left = bounds.left + margin; + } + if (dims.left + tipWidth > bounds.left + bounds.width) { + left = bounds.left + bounds.width - tipWidth - margin; + } + top += 'px'; + left += 'px'; + return { + style: { + top: top, + left: left + } + }; + } + function boxWrap(dims, what, node) { + Overlay_assign(node.style, { + borderTopWidth: dims[what + 'Top'] + 'px', + borderLeftWidth: dims[what + 'Left'] + 'px', + borderRightWidth: dims[what + 'Right'] + 'px', + borderBottomWidth: dims[what + 'Bottom'] + 'px', + borderStyle: 'solid' + }); + } + var overlayStyles = { + background: 'rgba(120, 170, 210, 0.7)', + padding: 'rgba(77, 200, 0, 0.3)', + margin: 'rgba(255, 155, 0, 0.3)', + border: 'rgba(255, 200, 50, 0.3)' + }; + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/views/Highlighter/Highlighter.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + var SHOW_DURATION = 2000; + var timeoutID = null; + var overlay = null; + function hideOverlay(agent) { + if (window.document == null) { + agent.emit('hideNativeHighlight'); + return; + } + timeoutID = null; + if (overlay !== null) { + overlay.remove(); + overlay = null; + } + } + function showOverlay(elements, componentName, agent, hideAfterTimeout) { + if (window.document == null) { + if (elements != null && elements[0] != null) { + agent.emit('showNativeHighlight', elements[0]); + } + return; + } + if (timeoutID !== null) { + clearTimeout(timeoutID); + } + if (elements == null) { + return; + } + if (overlay === null) { + overlay = new Overlay(agent); + } + overlay.inspect(elements, componentName); + if (hideAfterTimeout) { + timeoutID = setTimeout(function () { + return hideOverlay(agent); + }, SHOW_DURATION); + } + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/views/Highlighter/index.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + // This plug-in provides in-page highlighting of the selected element. + // It is used by the browser extension and the standalone DevTools shell (when connected to a browser). + // It is not currently the mechanism used to highlight React Native views. + // That is done by the React Native Inspector component. + var iframesListeningTo = new Set(); + function setupHighlighter(bridge, agent) { + bridge.addListener('clearNativeElementHighlight', clearNativeElementHighlight); + bridge.addListener('highlightNativeElement', highlightNativeElement); + bridge.addListener('shutdown', stopInspectingNative); + bridge.addListener('startInspectingNative', startInspectingNative); + bridge.addListener('stopInspectingNative', stopInspectingNative); + function startInspectingNative() { + registerListenersOnWindow(window); + } + function registerListenersOnWindow(window) { + // This plug-in may run in non-DOM environments (e.g. React Native). + if (window && typeof window.addEventListener === 'function') { + window.addEventListener('click', onClick, true); + window.addEventListener('mousedown', onMouseEvent, true); + window.addEventListener('mouseover', onMouseEvent, true); + window.addEventListener('mouseup', onMouseEvent, true); + window.addEventListener('pointerdown', onPointerDown, true); + window.addEventListener('pointermove', onPointerMove, true); + window.addEventListener('pointerup', onPointerUp, true); + } else { + agent.emit('startInspectingNative'); + } + } + function stopInspectingNative() { + hideOverlay(agent); + removeListenersOnWindow(window); + iframesListeningTo.forEach(function (frame) { + try { + removeListenersOnWindow(frame.contentWindow); + } catch (error) {// This can error when the iframe is on a cross-origin. + } + }); + iframesListeningTo = new Set(); + } + function removeListenersOnWindow(window) { + // This plug-in may run in non-DOM environments (e.g. React Native). + if (window && typeof window.removeEventListener === 'function') { + window.removeEventListener('click', onClick, true); + window.removeEventListener('mousedown', onMouseEvent, true); + window.removeEventListener('mouseover', onMouseEvent, true); + window.removeEventListener('mouseup', onMouseEvent, true); + window.removeEventListener('pointerdown', onPointerDown, true); + window.removeEventListener('pointermove', onPointerMove, true); + window.removeEventListener('pointerup', onPointerUp, true); + } else { + agent.emit('stopInspectingNative'); + } + } + function clearNativeElementHighlight() { + hideOverlay(agent); + } + function highlightNativeElement(_ref) { + var displayName = _ref.displayName, + hideAfterTimeout = _ref.hideAfterTimeout, + id = _ref.id, + openNativeElementsPanel = _ref.openNativeElementsPanel, + rendererID = _ref.rendererID, + scrollIntoView = _ref.scrollIntoView; + var renderer = agent.rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\"")); + hideOverlay(agent); + return; + } // In some cases fiber may already be unmounted + + if (!renderer.hasFiberWithId(id)) { + hideOverlay(agent); + return; + } + var nodes = renderer.findNativeNodesForFiberID(id); + if (nodes != null && nodes[0] != null) { + var node = nodes[0]; // $FlowFixMe[method-unbinding] + + if (scrollIntoView && typeof node.scrollIntoView === 'function') { + // If the node isn't visible show it before highlighting it. + // We may want to reconsider this; it might be a little disruptive. + node.scrollIntoView({ + block: 'nearest', + inline: 'nearest' + }); + } + showOverlay(nodes, displayName, agent, hideAfterTimeout); + if (openNativeElementsPanel) { + window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0 = node; + bridge.send('syncSelectionToNativeElementsPanel'); + } + } else { + hideOverlay(agent); + } + } + function onClick(event) { + event.preventDefault(); + event.stopPropagation(); + stopInspectingNative(); + bridge.send('stopInspectingNative', true); + } + function onMouseEvent(event) { + event.preventDefault(); + event.stopPropagation(); + } + function onPointerDown(event) { + event.preventDefault(); + event.stopPropagation(); + selectFiberForNode(getEventTarget(event)); + } + var lastHoveredNode = null; + function onPointerMove(event) { + event.preventDefault(); + event.stopPropagation(); + var target = getEventTarget(event); + if (lastHoveredNode === target) return; + lastHoveredNode = target; + if (target.tagName === 'IFRAME') { + var iframe = target; + try { + if (!iframesListeningTo.has(iframe)) { + var _window = iframe.contentWindow; + registerListenersOnWindow(_window); + iframesListeningTo.add(iframe); + } + } catch (error) {// This can error when the iframe is on a cross-origin. + } + } // Don't pass the name explicitly. + // It will be inferred from DOM tag and Fiber owner. + + showOverlay([target], null, agent, false); + selectFiberForNode(target); + } + function onPointerUp(event) { + event.preventDefault(); + event.stopPropagation(); + } + var selectFiberForNode = lodash_throttle_default()(esm(function (node) { + var id = agent.getIDForNode(node); + if (id !== null) { + bridge.send('selectFiber', id); + } + }), 200, + // Don't change the selection in the very first 200ms + // because those are usually unintentional as you lift the cursor. + { + leading: false + }); + function getEventTarget(event) { + if (event.composed) { + return event.composedPath()[0]; + } + return event.target; + } + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/views/TraceUpdates/canvas.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + var OUTLINE_COLOR = '#f0f0f0'; // Note these colors are in sync with DevTools Profiler chart colors. + + var COLORS = ['#37afa9', '#63b19e', '#80b393', '#97b488', '#abb67d', '#beb771', '#cfb965', '#dfba57', '#efbb49', '#febc38']; + var canvas = null; + function draw(nodeToData, agent) { + if (window.document == null) { + var nodesToDraw = []; + iterateNodes(nodeToData, function (_, color, node) { + nodesToDraw.push({ + node: node, + color: color + }); + }); + agent.emit('drawTraceUpdates', nodesToDraw); + return; + } + if (canvas === null) { + initialize(); + } + var canvasFlow = canvas; + canvasFlow.width = window.innerWidth; + canvasFlow.height = window.innerHeight; + var context = canvasFlow.getContext('2d'); + context.clearRect(0, 0, canvasFlow.width, canvasFlow.height); + iterateNodes(nodeToData, function (rect, color) { + if (rect !== null) { + drawBorder(context, rect, color); + } + }); + } + function iterateNodes(nodeToData, execute) { + nodeToData.forEach(function (_ref, node) { + var count = _ref.count, + rect = _ref.rect; + var colorIndex = Math.min(COLORS.length - 1, count - 1); + var color = COLORS[colorIndex]; + execute(rect, color, node); + }); + } + function drawBorder(context, rect, color) { + var height = rect.height, + left = rect.left, + top = rect.top, + width = rect.width; // outline + + context.lineWidth = 1; + context.strokeStyle = OUTLINE_COLOR; + context.strokeRect(left - 1, top - 1, width + 2, height + 2); // inset + + context.lineWidth = 1; + context.strokeStyle = OUTLINE_COLOR; + context.strokeRect(left + 1, top + 1, width - 1, height - 1); + context.strokeStyle = color; + context.setLineDash([0]); // border + + context.lineWidth = 1; + context.strokeRect(left, top, width - 1, height - 1); + context.setLineDash([0]); + } + function destroy(agent) { + if (window.document == null) { + agent.emit('disableTraceUpdates'); + return; + } + if (canvas !== null) { + if (canvas.parentNode != null) { + canvas.parentNode.removeChild(canvas); + } + canvas = null; + } + } + function initialize() { + canvas = window.document.createElement('canvas'); + canvas.style.cssText = "\n xx-background-color: red;\n xx-opacity: 0.5;\n bottom: 0;\n left: 0;\n pointer-events: none;\n position: fixed;\n right: 0;\n top: 0;\n z-index: 1000000000;\n "; + var root = window.document.documentElement; + root.insertBefore(canvas, root.firstChild); + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/views/TraceUpdates/index.js + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return _typeof(obj); + } + + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + // How long the rect should be shown for? + var DISPLAY_DURATION = 250; // What's the longest we are willing to show the overlay for? + // This can be important if we're getting a flurry of events (e.g. scroll update). + + var MAX_DISPLAY_DURATION = 3000; // How long should a rect be considered valid for? + + var REMEASUREMENT_AFTER_DURATION = 250; // Some environments (e.g. React Native / Hermes) don't support the performance API yet. + + var getCurrentTime = + // $FlowFixMe[method-unbinding] + (typeof performance === "undefined" ? "undefined" : _typeof(performance)) === 'object' && typeof performance.now === 'function' ? function () { + return performance.now(); + } : function () { + return Date.now(); + }; + var nodeToData = new Map(); + var agent = null; + var drawAnimationFrameID = null; + var isEnabled = false; + var redrawTimeoutID = null; + function TraceUpdates_initialize(injectedAgent) { + agent = injectedAgent; + agent.addListener('traceUpdates', traceUpdates); + } + function toggleEnabled(value) { + isEnabled = value; + if (!isEnabled) { + nodeToData.clear(); + if (drawAnimationFrameID !== null) { + cancelAnimationFrame(drawAnimationFrameID); + drawAnimationFrameID = null; + } + if (redrawTimeoutID !== null) { + clearTimeout(redrawTimeoutID); + redrawTimeoutID = null; + } + destroy(agent); + } + } + function traceUpdates(nodes) { + if (!isEnabled) { + return; + } + nodes.forEach(function (node) { + var data = nodeToData.get(node); + var now = getCurrentTime(); + var lastMeasuredAt = data != null ? data.lastMeasuredAt : 0; + var rect = data != null ? data.rect : null; + if (rect === null || lastMeasuredAt + REMEASUREMENT_AFTER_DURATION < now) { + lastMeasuredAt = now; + rect = measureNode(node); + } + nodeToData.set(node, { + count: data != null ? data.count + 1 : 1, + expirationTime: data != null ? Math.min(now + MAX_DISPLAY_DURATION, data.expirationTime + DISPLAY_DURATION) : now + DISPLAY_DURATION, + lastMeasuredAt: lastMeasuredAt, + rect: rect + }); + }); + if (redrawTimeoutID !== null) { + clearTimeout(redrawTimeoutID); + redrawTimeoutID = null; + } + if (drawAnimationFrameID === null) { + drawAnimationFrameID = requestAnimationFrame(prepareToDraw); + } + } + function prepareToDraw() { + drawAnimationFrameID = null; + redrawTimeoutID = null; + var now = getCurrentTime(); + var earliestExpiration = Number.MAX_VALUE; // Remove any items that have already expired. + + nodeToData.forEach(function (data, node) { + if (data.expirationTime < now) { + nodeToData.delete(node); + } else { + earliestExpiration = Math.min(earliestExpiration, data.expirationTime); + } + }); + draw(nodeToData, agent); + if (earliestExpiration !== Number.MAX_VALUE) { + redrawTimeoutID = setTimeout(prepareToDraw, earliestExpiration - now); + } + } + function measureNode(node) { + if (!node || typeof node.getBoundingClientRect !== 'function') { + return null; + } + var currentWindow = window.__REACT_DEVTOOLS_TARGET_WINDOW__ || window; + return getNestedBoundingClientRect(node, currentWindow); + } + ; // CONCATENATED MODULE: ../../node_modules/compare-versions/lib/esm/index.js + function esm_typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + esm_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + esm_typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return esm_typeof(obj); + } + function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); + } + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + function _iterableToArrayLimit(arr, i) { + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + + /** + * Compare [semver](https://semver.org/) version strings to find greater, equal or lesser. + * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. + * @param v1 - First version to compare + * @param v2 - Second version to compare + * @returns Numeric value compatible with the [Array.sort(fn) interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters). + */ + var compareVersions = function compareVersions(v1, v2) { + // validate input and split into segments + var n1 = validateAndParse(v1); + var n2 = validateAndParse(v2); // pop off the patch + + var p1 = n1.pop(); + var p2 = n2.pop(); // validate numbers + + var r = compareSegments(n1, n2); + if (r !== 0) return r; // validate pre-release + + if (p1 && p2) { + return compareSegments(p1.split('.'), p2.split('.')); + } else if (p1 || p2) { + return p1 ? -1 : 1; + } + return 0; + }; + /** + * Validate [semver](https://semver.org/) version strings. + * + * @param version Version number to validate + * @returns `true` if the version number is a valid semver version number, `false` otherwise. + * + * @example + * ``` + * validate('1.0.0-rc.1'); // return true + * validate('1.0-rc.1'); // return false + * validate('foo'); // return false + * ``` + */ + + var validate = function validate(version) { + return typeof version === 'string' && /^[v\d]/.test(version) && semver.test(version); + }; + /** + * Compare [semver](https://semver.org/) version strings using the specified operator. + * + * @param v1 First version to compare + * @param v2 Second version to compare + * @param operator Allowed arithmetic operator to use + * @returns `true` if the comparison between the firstVersion and the secondVersion satisfies the operator, `false` otherwise. + * + * @example + * ``` + * compare('10.1.8', '10.0.4', '>'); // return true + * compare('10.0.1', '10.0.1', '='); // return true + * compare('10.1.1', '10.2.2', '<'); // return true + * compare('10.1.1', '10.2.2', '<='); // return true + * compare('10.1.1', '10.2.2', '>='); // return false + * ``` + */ + + var compare = function compare(v1, v2, operator) { + // validate input operator + assertValidOperator(operator); // since result of compareVersions can only be -1 or 0 or 1 + // a simple map can be used to replace switch + + var res = compareVersions(v1, v2); + return operatorResMap[operator].includes(res); + }; + /** + * Match [npm semver](https://docs.npmjs.com/cli/v6/using-npm/semver) version range. + * + * @param version Version number to match + * @param range Range pattern for version + * @returns `true` if the version number is within the range, `false` otherwise. + * + * @example + * ``` + * satisfies('1.1.0', '^1.0.0'); // return true + * satisfies('1.1.0', '~1.0.0'); // return false + * ``` + */ + + var satisfies = function satisfies(version, range) { + // if no range operator then "=" + var m = range.match(/^([<>=~^]+)/); + var op = m ? m[1] : '='; // if gt/lt/eq then operator compare + + if (op !== '^' && op !== '~') return compare(version, range, op); // else range of either "~" or "^" is assumed + + var _validateAndParse = validateAndParse(version), + _validateAndParse2 = _slicedToArray(_validateAndParse, 5), + v1 = _validateAndParse2[0], + v2 = _validateAndParse2[1], + v3 = _validateAndParse2[2], + vp = _validateAndParse2[4]; + var _validateAndParse3 = validateAndParse(range), + _validateAndParse4 = _slicedToArray(_validateAndParse3, 5), + r1 = _validateAndParse4[0], + r2 = _validateAndParse4[1], + r3 = _validateAndParse4[2], + rp = _validateAndParse4[4]; + var v = [v1, v2, v3]; + var r = [r1, r2 !== null && r2 !== void 0 ? r2 : 'x', r3 !== null && r3 !== void 0 ? r3 : 'x']; // validate pre-release + + if (rp) { + if (!vp) return false; + if (compareSegments(v, r) !== 0) return false; + if (compareSegments(vp.split('.'), rp.split('.')) === -1) return false; + } // first non-zero number + + var nonZero = r.findIndex(function (v) { + return v !== '0'; + }) + 1; // pointer to where segments can be >= + + var i = op === '~' ? 2 : nonZero > 1 ? nonZero : 1; // before pointer must be equal + + if (compareSegments(v.slice(0, i), r.slice(0, i)) !== 0) return false; // after pointer must be >= + + if (compareSegments(v.slice(i), r.slice(i)) === -1) return false; + return true; + }; + var semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i; + var validateAndParse = function validateAndParse(version) { + if (typeof version !== 'string') { + throw new TypeError('Invalid argument expected string'); + } + var match = version.match(semver); + if (!match) { + throw new Error("Invalid argument not valid semver ('".concat(version, "' received)")); + } + match.shift(); + return match; + }; + var isWildcard = function isWildcard(s) { + return s === '*' || s === 'x' || s === 'X'; + }; + var tryParse = function tryParse(v) { + var n = parseInt(v, 10); + return isNaN(n) ? v : n; + }; + var forceType = function forceType(a, b) { + return esm_typeof(a) !== esm_typeof(b) ? [String(a), String(b)] : [a, b]; + }; + var compareStrings = function compareStrings(a, b) { + if (isWildcard(a) || isWildcard(b)) return 0; + var _forceType = forceType(tryParse(a), tryParse(b)), + _forceType2 = _slicedToArray(_forceType, 2), + ap = _forceType2[0], + bp = _forceType2[1]; + if (ap > bp) return 1; + if (ap < bp) return -1; + return 0; + }; + var compareSegments = function compareSegments(a, b) { + for (var i = 0; i < Math.max(a.length, b.length); i++) { + var r = compareStrings(a[i] || '0', b[i] || '0'); + if (r !== 0) return r; + } + return 0; + }; + var operatorResMap = { + '>': [1], + '>=': [0, 1], + '=': [0], + '<=': [-1, 0], + '<': [-1] + }; + var allowedOperators = Object.keys(operatorResMap); + var assertValidOperator = function assertValidOperator(op) { + if (typeof op !== 'string') { + throw new TypeError("Invalid operator type, expected string but got ".concat(esm_typeof(op))); + } + if (allowedOperators.indexOf(op) === -1) { + throw new Error("Invalid operator, expected one of ".concat(allowedOperators.join('|'))); + } + }; + // EXTERNAL MODULE: ../../node_modules/lru-cache/index.js + var lru_cache = __webpack_require__(730); + var lru_cache_default = /*#__PURE__*/__webpack_require__.n(lru_cache); + // EXTERNAL MODULE: ../../build/oss-experimental/react-is/index.js + var react_is = __webpack_require__(550); + ; // CONCATENATED MODULE: ../shared/ReactSymbols.js + function ReactSymbols_typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + ReactSymbols_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + ReactSymbols_typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return ReactSymbols_typeof(obj); + } + + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + // ATTENTION + // When adding new symbols to this file, + // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' + // The Symbol used to tag the ReactElement-like types. + var REACT_ELEMENT_TYPE = Symbol.for('react.element'); + var REACT_PORTAL_TYPE = Symbol.for('react.portal'); + var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); + var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); + var REACT_PROFILER_TYPE = Symbol.for('react.profiler'); + var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); + var REACT_CONTEXT_TYPE = Symbol.for('react.context'); + var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context'); + var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); + var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); + var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); + var REACT_MEMO_TYPE = Symbol.for('react.memo'); + var REACT_LAZY_TYPE = Symbol.for('react.lazy'); + var REACT_SCOPE_TYPE = Symbol.for('react.scope'); + var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode'); + var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); + var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden'); + var REACT_CACHE_TYPE = Symbol.for('react.cache'); + var REACT_TRACING_MARKER_TYPE = Symbol.for('react.tracing_marker'); + var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value'); + var REACT_MEMO_CACHE_SENTINEL = Symbol.for('react.memo_cache_sentinel'); + var REACT_POSTPONE_TYPE = Symbol.for('react.postpone'); + var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || ReactSymbols_typeof(maybeIterable) !== 'object') { + return null; + } + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + return null; + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/frontend/types.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + /** + * WARNING: + * This file contains types that are designed for React DevTools UI and how it interacts with the backend. + * They might be used in different versions of DevTools backends. + * Be mindful of backwards compatibility when making changes. + */ + // WARNING + // The values below are referenced by ComponentFilters (which are saved via localStorage). + // Do not change them or it will break previously saved user customizations. + // If new element types are added, use new numbers rather than re-ordering existing ones. + // + // Changing these types is also a backwards breaking change for the standalone shell, + // since the frontend and backend must share the same values- + // and the backend is embedded in certain environments (like React Native). + var types_ElementTypeClass = 1; + var ElementTypeContext = 2; + var types_ElementTypeFunction = 5; + var types_ElementTypeForwardRef = 6; + var ElementTypeHostComponent = 7; + var types_ElementTypeMemo = 8; + var ElementTypeOtherOrUnknown = 9; + var ElementTypeProfiler = 10; + var ElementTypeRoot = 11; + var ElementTypeSuspense = 12; + var ElementTypeSuspenseList = 13; + var ElementTypeTracingMarker = 14; // Different types of elements displayed in the Elements tree. + // These types may be used to visually distinguish types, + // or to enable/disable certain functionality. + + // WARNING + // The values below are referenced by ComponentFilters (which are saved via localStorage). + // Do not change them or it will break previously saved user customizations. + // If new filter types are added, use new numbers rather than re-ordering existing ones. + var ComponentFilterElementType = 1; + var ComponentFilterDisplayName = 2; + var ComponentFilterLocation = 3; + var ComponentFilterHOC = 4; + var StrictMode = 1; // Each element on the frontend corresponds to a Fiber on the backend. + // Some of its information (e.g. id, type, displayName) come from the backend. + // Other bits (e.g. weight and depth) are computed on the frontend for windowing and display purposes. + // Elements are updated on a push basis– meaning the backend pushes updates to the frontend when needed. + ; // CONCATENATED MODULE: ../react-devtools-shared/src/isArray.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + var isArray = Array.isArray; + /* harmony default export */ + var src_isArray = isArray; + ; // CONCATENATED MODULE: ../react-devtools-shared/src/utils.js + /* provided dependency */ + var process = __webpack_require__(169); + function utils_typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + utils_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + utils_typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return utils_typeof(obj); + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || utils_unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function utils_unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return utils_arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return utils_arrayLikeToArray(o, minLen); + } + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return utils_arrayLikeToArray(arr); + } + function utils_arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + // $FlowFixMe[method-unbinding] + var utils_hasOwnProperty = Object.prototype.hasOwnProperty; + var cachedDisplayNames = new WeakMap(); // On large trees, encoding takes significant time. + // Try to reuse the already encoded strings. + + var encodedStringCache = new (lru_cache_default())({ + max: 1000 + }); + function alphaSortKeys(a, b) { + if (a.toString() > b.toString()) { + return 1; + } else if (b.toString() > a.toString()) { + return -1; + } else { + return 0; + } + } + function getAllEnumerableKeys(obj) { + var keys = new Set(); + var current = obj; + var _loop = function _loop() { + var currentKeys = [].concat(_toConsumableArray(Object.keys(current)), _toConsumableArray(Object.getOwnPropertySymbols(current))); + var descriptors = Object.getOwnPropertyDescriptors(current); + currentKeys.forEach(function (key) { + // $FlowFixMe[incompatible-type]: key can be a Symbol https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor + if (descriptors[key].enumerable) { + keys.add(key); + } + }); + current = Object.getPrototypeOf(current); + }; + while (current != null) { + _loop(); + } + return keys; + } // Mirror https://github.com/facebook/react/blob/7c21bf72ace77094fd1910cc350a548287ef8350/packages/shared/getComponentName.js#L27-L37 + + function getWrappedDisplayName(outerType, innerType, wrapperName, fallbackName) { + var displayName = outerType.displayName; + return displayName || "".concat(wrapperName, "(").concat(getDisplayName(innerType, fallbackName), ")"); + } + function getDisplayName(type) { + var fallbackName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Anonymous'; + var nameFromCache = cachedDisplayNames.get(type); + if (nameFromCache != null) { + return nameFromCache; + } + var displayName = fallbackName; // The displayName property is not guaranteed to be a string. + // It's only safe to use for our purposes if it's a string. + // github.com/facebook/react-devtools/issues/803 + + if (typeof type.displayName === 'string') { + displayName = type.displayName; + } else if (typeof type.name === 'string' && type.name !== '') { + displayName = type.name; + } + cachedDisplayNames.set(type, displayName); + return displayName; + } + var uidCounter = 0; + function getUID() { + return ++uidCounter; + } + function utfDecodeString(array) { + // Avoid spreading the array (e.g. String.fromCodePoint(...array)) + // Functions arguments are first placed on the stack before the function is called + // which throws a RangeError for large arrays. + // See github.com/facebook/react/issues/22293 + var string = ''; + for (var i = 0; i < array.length; i++) { + var char = array[i]; + string += String.fromCodePoint(char); + } + return string; + } + function surrogatePairToCodePoint(charCode1, charCode2) { + return ((charCode1 & 0x3ff) << 10) + (charCode2 & 0x3ff) + 0x10000; + } // Credit for this encoding approach goes to Tim Down: + // https://stackoverflow.com/questions/4877326/how-can-i-tell-if-a-string-contains-multibyte-characters-in-javascript + + function utfEncodeString(string) { + var cached = encodedStringCache.get(string); + if (cached !== undefined) { + return cached; + } + var encoded = []; + var i = 0; + var charCode; + while (i < string.length) { + charCode = string.charCodeAt(i); // Handle multibyte unicode characters (like emoji). + + if ((charCode & 0xf800) === 0xd800) { + encoded.push(surrogatePairToCodePoint(charCode, string.charCodeAt(++i))); + } else { + encoded.push(charCode); + } + ++i; + } + encodedStringCache.set(string, encoded); + return encoded; + } + function printOperationsArray(operations) { + // The first two values are always rendererID and rootID + var rendererID = operations[0]; + var rootID = operations[1]; + var logs = ["operations for renderer:".concat(rendererID, " and root:").concat(rootID)]; + var i = 2; // Reassemble the string table. + + var stringTable = [null // ID = 0 corresponds to the null string. + ]; + var stringTableSize = operations[i++]; + var stringTableEnd = i + stringTableSize; + while (i < stringTableEnd) { + var nextLength = operations[i++]; + var nextString = utfDecodeString(operations.slice(i, i + nextLength)); + stringTable.push(nextString); + i += nextLength; + } + while (i < operations.length) { + var operation = operations[i]; + switch (operation) { + case TREE_OPERATION_ADD: + { + var _id = operations[i + 1]; + var type = operations[i + 2]; + i += 3; + if (type === ElementTypeRoot) { + logs.push("Add new root node ".concat(_id)); + i++; // isStrictModeCompliant + + i++; // supportsProfiling + + i++; // supportsStrictMode + + i++; // hasOwnerMetadata + } else { + var parentID = operations[i]; + i++; + i++; // ownerID + + var displayNameStringID = operations[i]; + var displayName = stringTable[displayNameStringID]; + i++; + i++; // key + + logs.push("Add node ".concat(_id, " (").concat(displayName || 'null', ") as child of ").concat(parentID)); + } + break; + } + case TREE_OPERATION_REMOVE: + { + var removeLength = operations[i + 1]; + i += 2; + for (var removeIndex = 0; removeIndex < removeLength; removeIndex++) { + var _id2 = operations[i]; + i += 1; + logs.push("Remove node ".concat(_id2)); + } + break; + } + case TREE_OPERATION_REMOVE_ROOT: + { + i += 1; + logs.push("Remove root ".concat(rootID)); + break; + } + case TREE_OPERATION_SET_SUBTREE_MODE: + { + var _id3 = operations[i + 1]; + var mode = operations[i + 1]; + i += 3; + logs.push("Mode ".concat(mode, " set for subtree with root ").concat(_id3)); + break; + } + case TREE_OPERATION_REORDER_CHILDREN: + { + var _id4 = operations[i + 1]; + var numChildren = operations[i + 2]; + i += 3; + var children = operations.slice(i, i + numChildren); + i += numChildren; + logs.push("Re-order node ".concat(_id4, " children ").concat(children.join(','))); + break; + } + case TREE_OPERATION_UPDATE_TREE_BASE_DURATION: + // Base duration updates are only sent while profiling is in progress. + // We can ignore them at this point. + // The profiler UI uses them lazily in order to generate the tree. + i += 3; + break; + case TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS: + var id = operations[i + 1]; + var numErrors = operations[i + 2]; + var numWarnings = operations[i + 3]; + i += 4; + logs.push("Node ".concat(id, " has ").concat(numErrors, " errors and ").concat(numWarnings, " warnings")); + break; + default: + throw Error("Unsupported Bridge operation \"".concat(operation, "\"")); + } + } + console.log(logs.join('\n ')); + } + function getDefaultComponentFilters() { + return [{ + type: ComponentFilterElementType, + value: ElementTypeHostComponent, + isEnabled: true + }]; + } + function getSavedComponentFilters() { + try { + var raw = localStorageGetItem(LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY); + if (raw != null) { + return JSON.parse(raw); + } + } catch (error) {} + return getDefaultComponentFilters(); + } + function setSavedComponentFilters(componentFilters) { + localStorageSetItem(LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY, JSON.stringify(componentFilters)); + } + function parseBool(s) { + if (s === 'true') { + return true; + } + if (s === 'false') { + return false; + } + } + function castBool(v) { + if (v === true || v === false) { + return v; + } + } + function castBrowserTheme(v) { + if (v === 'light' || v === 'dark' || v === 'auto') { + return v; + } + } + function getAppendComponentStack() { + var _parseBool; + var raw = localStorageGetItem(LOCAL_STORAGE_SHOULD_APPEND_COMPONENT_STACK_KEY); + return (_parseBool = parseBool(raw)) !== null && _parseBool !== void 0 ? _parseBool : true; + } + function getBreakOnConsoleErrors() { + var _parseBool2; + var raw = localStorageGetItem(LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS); + return (_parseBool2 = parseBool(raw)) !== null && _parseBool2 !== void 0 ? _parseBool2 : false; + } + function getHideConsoleLogsInStrictMode() { + var _parseBool3; + var raw = localStorageGetItem(LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE); + return (_parseBool3 = parseBool(raw)) !== null && _parseBool3 !== void 0 ? _parseBool3 : false; + } + function getShowInlineWarningsAndErrors() { + var _parseBool4; + var raw = localStorageGetItem(LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY); + return (_parseBool4 = parseBool(raw)) !== null && _parseBool4 !== void 0 ? _parseBool4 : true; + } + function getDefaultOpenInEditorURL() { + return typeof process.env.EDITOR_URL === 'string' ? process.env.EDITOR_URL : ''; + } + function getOpenInEditorURL() { + try { + var raw = localStorageGetItem(LOCAL_STORAGE_OPEN_IN_EDITOR_URL); + if (raw != null) { + return JSON.parse(raw); + } + } catch (error) {} + return getDefaultOpenInEditorURL(); + } + function separateDisplayNameAndHOCs(displayName, type) { + if (displayName === null) { + return [null, null]; + } + var hocDisplayNames = null; + switch (type) { + case ElementTypeClass: + case ElementTypeForwardRef: + case ElementTypeFunction: + case ElementTypeMemo: + if (displayName.indexOf('(') >= 0) { + var matches = displayName.match(/[^()]+/g); + if (matches != null) { + displayName = matches.pop(); + hocDisplayNames = matches; + } + } + break; + default: + break; + } + return [displayName, hocDisplayNames]; + } // Pulled from react-compat + // https://github.com/developit/preact-compat/blob/7c5de00e7c85e2ffd011bf3af02899b63f699d3a/src/index.js#L349 + + function shallowDiffers(prev, next) { + for (var attribute in prev) { + if (!(attribute in next)) { + return true; + } + } + for (var _attribute in next) { + if (prev[_attribute] !== next[_attribute]) { + return true; + } + } + return false; + } + function utils_getInObject(object, path) { + return path.reduce(function (reduced, attr) { + if (reduced) { + if (utils_hasOwnProperty.call(reduced, attr)) { + return reduced[attr]; + } + if (typeof reduced[Symbol.iterator] === 'function') { + // Convert iterable to array and return array[index] + // + // TRICKY + // Don't use [...spread] syntax for this purpose. + // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values. + // Other types (e.g. typed arrays, Sets) will not spread correctly. + return Array.from(reduced)[attr]; + } + } + return null; + }, object); + } + function deletePathInObject(object, path) { + var length = path.length; + var last = path[length - 1]; + if (object != null) { + var parent = utils_getInObject(object, path.slice(0, length - 1)); + if (parent) { + if (src_isArray(parent)) { + parent.splice(last, 1); + } else { + delete parent[last]; + } + } + } + } + function renamePathInObject(object, oldPath, newPath) { + var length = oldPath.length; + if (object != null) { + var parent = utils_getInObject(object, oldPath.slice(0, length - 1)); + if (parent) { + var lastOld = oldPath[length - 1]; + var lastNew = newPath[length - 1]; + parent[lastNew] = parent[lastOld]; + if (src_isArray(parent)) { + parent.splice(lastOld, 1); + } else { + delete parent[lastOld]; + } + } + } + } + function utils_setInObject(object, path, value) { + var length = path.length; + var last = path[length - 1]; + if (object != null) { + var parent = utils_getInObject(object, path.slice(0, length - 1)); + if (parent) { + parent[last] = value; + } + } + } + + /** + * Get a enhanced/artificial type string based on the object instance + */ + function getDataType(data) { + if (data === null) { + return 'null'; + } else if (data === undefined) { + return 'undefined'; + } + if ((0, react_is.isElement)(data)) { + return 'react_element'; + } + if (typeof HTMLElement !== 'undefined' && data instanceof HTMLElement) { + return 'html_element'; + } + var type = utils_typeof(data); + switch (type) { + case 'bigint': + return 'bigint'; + case 'boolean': + return 'boolean'; + case 'function': + return 'function'; + case 'number': + if (Number.isNaN(data)) { + return 'nan'; + } else if (!Number.isFinite(data)) { + return 'infinity'; + } else { + return 'number'; + } + case 'object': + if (src_isArray(data)) { + return 'array'; + } else if (ArrayBuffer.isView(data)) { + return utils_hasOwnProperty.call(data.constructor, 'BYTES_PER_ELEMENT') ? 'typed_array' : 'data_view'; + } else if (data.constructor && data.constructor.name === 'ArrayBuffer') { + // HACK This ArrayBuffer check is gross; is there a better way? + // We could try to create a new DataView with the value. + // If it doesn't error, we know it's an ArrayBuffer, + // but this seems kind of awkward and expensive. + return 'array_buffer'; + } else if (typeof data[Symbol.iterator] === 'function') { + var iterator = data[Symbol.iterator](); + if (!iterator) {// Proxies might break assumptoins about iterators. + // See github.com/facebook/react/issues/21654 + } else { + return iterator === data ? 'opaque_iterator' : 'iterator'; + } + } else if (data.constructor && data.constructor.name === 'RegExp') { + return 'regexp'; + } else { + // $FlowFixMe[method-unbinding] + var toStringValue = Object.prototype.toString.call(data); + if (toStringValue === '[object Date]') { + return 'date'; + } else if (toStringValue === '[object HTMLAllCollection]') { + return 'html_all_collection'; + } + } + if (!isPlainObject(data)) { + return 'class_instance'; + } + return 'object'; + case 'string': + return 'string'; + case 'symbol': + return 'symbol'; + case 'undefined': + if ( + // $FlowFixMe[method-unbinding] + Object.prototype.toString.call(data) === '[object HTMLAllCollection]') { + return 'html_all_collection'; + } + return 'undefined'; + default: + return 'unknown'; + } + } + function getDisplayNameForReactElement(element) { + var elementType = (0, react_is.typeOf)(element); + switch (elementType) { + case react_is.ContextConsumer: + return 'ContextConsumer'; + case react_is.ContextProvider: + return 'ContextProvider'; + case react_is.ForwardRef: + return 'ForwardRef'; + case react_is.Fragment: + return 'Fragment'; + case react_is.Lazy: + return 'Lazy'; + case react_is.Memo: + return 'Memo'; + case react_is.Portal: + return 'Portal'; + case react_is.Profiler: + return 'Profiler'; + case react_is.StrictMode: + return 'StrictMode'; + case react_is.Suspense: + return 'Suspense'; + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + case REACT_TRACING_MARKER_TYPE: + return 'TracingMarker'; + default: + var type = element.type; + if (typeof type === 'string') { + return type; + } else if (typeof type === 'function') { + return getDisplayName(type, 'Anonymous'); + } else if (type != null) { + return 'NotImplementedInDevtools'; + } else { + return 'Element'; + } + } + } + var MAX_PREVIEW_STRING_LENGTH = 50; + function truncateForDisplay(string) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : MAX_PREVIEW_STRING_LENGTH; + if (string.length > length) { + return string.slice(0, length) + '…'; + } else { + return string; + } + } // Attempts to mimic Chrome's inline preview for values. + // For example, the following value... + // { + // foo: 123, + // bar: "abc", + // baz: [true, false], + // qux: { ab: 1, cd: 2 } + // }; + // + // Would show a preview of... + // {foo: 123, bar: "abc", baz: Array(2), qux: {…}} + // + // And the following value... + // [ + // 123, + // "abc", + // [true, false], + // { foo: 123, bar: "abc" } + // ]; + // + // Would show a preview of... + // [123, "abc", Array(2), {…}] + + function formatDataForPreview(data, showFormattedValue) { + if (data != null && utils_hasOwnProperty.call(data, meta.type)) { + return showFormattedValue ? data[meta.preview_long] : data[meta.preview_short]; + } + var type = getDataType(data); + switch (type) { + case 'html_element': + return "<".concat(truncateForDisplay(data.tagName.toLowerCase()), " />"); + case 'function': + return truncateForDisplay("\u0192 ".concat(typeof data.name === 'function' ? '' : data.name, "() {}")); + case 'string': + return "\"".concat(data, "\""); + case 'bigint': + return truncateForDisplay(data.toString() + 'n'); + case 'regexp': + return truncateForDisplay(data.toString()); + case 'symbol': + return truncateForDisplay(data.toString()); + case 'react_element': + return "<".concat(truncateForDisplay(getDisplayNameForReactElement(data) || 'Unknown'), " />"); + case 'array_buffer': + return "ArrayBuffer(".concat(data.byteLength, ")"); + case 'data_view': + return "DataView(".concat(data.buffer.byteLength, ")"); + case 'array': + if (showFormattedValue) { + var formatted = ''; + for (var i = 0; i < data.length; i++) { + if (i > 0) { + formatted += ', '; + } + formatted += formatDataForPreview(data[i], false); + if (formatted.length > MAX_PREVIEW_STRING_LENGTH) { + // Prevent doing a lot of unnecessary iteration... + break; + } + } + return "[".concat(truncateForDisplay(formatted), "]"); + } else { + var length = utils_hasOwnProperty.call(data, meta.size) ? data[meta.size] : data.length; + return "Array(".concat(length, ")"); + } + case 'typed_array': + var shortName = "".concat(data.constructor.name, "(").concat(data.length, ")"); + if (showFormattedValue) { + var _formatted = ''; + for (var _i = 0; _i < data.length; _i++) { + if (_i > 0) { + _formatted += ', '; + } + _formatted += data[_i]; + if (_formatted.length > MAX_PREVIEW_STRING_LENGTH) { + // Prevent doing a lot of unnecessary iteration... + break; + } + } + return "".concat(shortName, " [").concat(truncateForDisplay(_formatted), "]"); + } else { + return shortName; + } + case 'iterator': + var name = data.constructor.name; + if (showFormattedValue) { + // TRICKY + // Don't use [...spread] syntax for this purpose. + // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values. + // Other types (e.g. typed arrays, Sets) will not spread correctly. + var array = Array.from(data); + var _formatted2 = ''; + for (var _i2 = 0; _i2 < array.length; _i2++) { + var entryOrEntries = array[_i2]; + if (_i2 > 0) { + _formatted2 += ', '; + } // TRICKY + // Browsers display Maps and Sets differently. + // To mimic their behavior, detect if we've been given an entries tuple. + // Map(2) {"abc" => 123, "def" => 123} + // Set(2) {"abc", 123} + + if (src_isArray(entryOrEntries)) { + var key = formatDataForPreview(entryOrEntries[0], true); + var value = formatDataForPreview(entryOrEntries[1], false); + _formatted2 += "".concat(key, " => ").concat(value); + } else { + _formatted2 += formatDataForPreview(entryOrEntries, false); + } + if (_formatted2.length > MAX_PREVIEW_STRING_LENGTH) { + // Prevent doing a lot of unnecessary iteration... + break; + } + } + return "".concat(name, "(").concat(data.size, ") {").concat(truncateForDisplay(_formatted2), "}"); + } else { + return "".concat(name, "(").concat(data.size, ")"); + } + case 'opaque_iterator': + { + return data[Symbol.toStringTag]; + } + case 'date': + return data.toString(); + case 'class_instance': + return data.constructor.name; + case 'object': + if (showFormattedValue) { + var keys = Array.from(getAllEnumerableKeys(data)).sort(alphaSortKeys); + var _formatted3 = ''; + for (var _i3 = 0; _i3 < keys.length; _i3++) { + var _key = keys[_i3]; + if (_i3 > 0) { + _formatted3 += ', '; + } + _formatted3 += "".concat(_key.toString(), ": ").concat(formatDataForPreview(data[_key], false)); + if (_formatted3.length > MAX_PREVIEW_STRING_LENGTH) { + // Prevent doing a lot of unnecessary iteration... + break; + } + } + return "{".concat(truncateForDisplay(_formatted3), "}"); + } else { + return '{…}'; + } + case 'boolean': + case 'number': + case 'infinity': + case 'nan': + case 'null': + case 'undefined': + return data; + default: + try { + return truncateForDisplay(String(data)); + } catch (error) { + return 'unserializable'; + } + } + } // Basically checking that the object only has Object in its prototype chain + + var isPlainObject = function isPlainObject(object) { + var objectPrototype = Object.getPrototypeOf(object); + if (!objectPrototype) return true; + var objectParentPrototype = Object.getPrototypeOf(objectPrototype); + return !objectParentPrototype; + }; + ; // CONCATENATED MODULE: ../react-devtools-shared/src/hydration.js + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + hydration_defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + return target; + } + function hydration_defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + var meta = { + inspectable: Symbol('inspectable'), + inspected: Symbol('inspected'), + name: Symbol('name'), + preview_long: Symbol('preview_long'), + preview_short: Symbol('preview_short'), + readonly: Symbol('readonly'), + size: Symbol('size'), + type: Symbol('type'), + unserializable: Symbol('unserializable') + }; + // This threshold determines the depth at which the bridge "dehydrates" nested data. + // Dehydration means that we don't serialize the data for e.g. postMessage or stringify, + // unless the frontend explicitly requests it (e.g. a user clicks to expand a props object). + // + // Reducing this threshold will improve the speed of initial component inspection, + // but may decrease the responsiveness of expanding objects/arrays to inspect further. + var LEVEL_THRESHOLD = 2; + /** + * Generate the dehydrated metadata for complex object instances + */ + + function createDehydrated(type, inspectable, data, cleaned, path) { + cleaned.push(path); + var dehydrated = { + inspectable: inspectable, + type: type, + preview_long: formatDataForPreview(data, true), + preview_short: formatDataForPreview(data, false), + name: !data.constructor || data.constructor.name === 'Object' ? '' : data.constructor.name + }; + if (type === 'array' || type === 'typed_array') { + dehydrated.size = data.length; + } else if (type === 'object') { + dehydrated.size = Object.keys(data).length; + } + if (type === 'iterator' || type === 'typed_array') { + dehydrated.readonly = true; + } + return dehydrated; + } + /** + * Strip out complex data (instances, functions, and data nested > LEVEL_THRESHOLD levels deep). + * The paths of the stripped out objects are appended to the `cleaned` list. + * On the other side of the barrier, the cleaned list is used to "re-hydrate" the cleaned representation into + * an object with symbols as attributes, so that a sanitized object can be distinguished from a normal object. + * + * Input: {"some": {"attr": fn()}, "other": AnInstance} + * Output: { + * "some": { + * "attr": {"name": the fn.name, type: "function"} + * }, + * "other": { + * "name": "AnInstance", + * "type": "object", + * }, + * } + * and cleaned = [["some", "attr"], ["other"]] + */ + + function dehydrate(data, cleaned, unserializable, path, isPathAllowed) { + var level = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; + var type = getDataType(data); + var isPathAllowedCheck; + switch (type) { + case 'html_element': + cleaned.push(path); + return { + inspectable: false, + preview_short: formatDataForPreview(data, false), + preview_long: formatDataForPreview(data, true), + name: data.tagName, + type: type + }; + case 'function': + cleaned.push(path); + return { + inspectable: false, + preview_short: formatDataForPreview(data, false), + preview_long: formatDataForPreview(data, true), + name: typeof data.name === 'function' || !data.name ? 'function' : data.name, + type: type + }; + case 'string': + isPathAllowedCheck = isPathAllowed(path); + if (isPathAllowedCheck) { + return data; + } else { + return data.length <= 500 ? data : data.slice(0, 500) + '...'; + } + case 'bigint': + cleaned.push(path); + return { + inspectable: false, + preview_short: formatDataForPreview(data, false), + preview_long: formatDataForPreview(data, true), + name: data.toString(), + type: type + }; + case 'symbol': + cleaned.push(path); + return { + inspectable: false, + preview_short: formatDataForPreview(data, false), + preview_long: formatDataForPreview(data, true), + name: data.toString(), + type: type + }; + // React Elements aren't very inspector-friendly, + // and often contain private fields or circular references. + + case 'react_element': + cleaned.push(path); + return { + inspectable: false, + preview_short: formatDataForPreview(data, false), + preview_long: formatDataForPreview(data, true), + name: getDisplayNameForReactElement(data) || 'Unknown', + type: type + }; + // ArrayBuffers error if you try to inspect them. + + case 'array_buffer': + case 'data_view': + cleaned.push(path); + return { + inspectable: false, + preview_short: formatDataForPreview(data, false), + preview_long: formatDataForPreview(data, true), + name: type === 'data_view' ? 'DataView' : 'ArrayBuffer', + size: data.byteLength, + type: type + }; + case 'array': + isPathAllowedCheck = isPathAllowed(path); + if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) { + return createDehydrated(type, true, data, cleaned, path); + } + return data.map(function (item, i) { + return dehydrate(item, cleaned, unserializable, path.concat([i]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1); + }); + case 'html_all_collection': + case 'typed_array': + case 'iterator': + isPathAllowedCheck = isPathAllowed(path); + if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) { + return createDehydrated(type, true, data, cleaned, path); + } else { + var unserializableValue = { + unserializable: true, + type: type, + readonly: true, + size: type === 'typed_array' ? data.length : undefined, + preview_short: formatDataForPreview(data, false), + preview_long: formatDataForPreview(data, true), + name: !data.constructor || data.constructor.name === 'Object' ? '' : data.constructor.name + }; // TRICKY + // Don't use [...spread] syntax for this purpose. + // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values. + // Other types (e.g. typed arrays, Sets) will not spread correctly. + + Array.from(data).forEach(function (item, i) { + return unserializableValue[i] = dehydrate(item, cleaned, unserializable, path.concat([i]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1); + }); + unserializable.push(path); + return unserializableValue; + } + case 'opaque_iterator': + cleaned.push(path); + return { + inspectable: false, + preview_short: formatDataForPreview(data, false), + preview_long: formatDataForPreview(data, true), + name: data[Symbol.toStringTag], + type: type + }; + case 'date': + cleaned.push(path); + return { + inspectable: false, + preview_short: formatDataForPreview(data, false), + preview_long: formatDataForPreview(data, true), + name: data.toString(), + type: type + }; + case 'regexp': + cleaned.push(path); + return { + inspectable: false, + preview_short: formatDataForPreview(data, false), + preview_long: formatDataForPreview(data, true), + name: data.toString(), + type: type + }; + case 'object': + isPathAllowedCheck = isPathAllowed(path); + if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) { + return createDehydrated(type, true, data, cleaned, path); + } else { + var object = {}; + getAllEnumerableKeys(data).forEach(function (key) { + var name = key.toString(); + object[name] = dehydrate(data[key], cleaned, unserializable, path.concat([name]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1); + }); + return object; + } + case 'class_instance': + isPathAllowedCheck = isPathAllowed(path); + if (level >= LEVEL_THRESHOLD && !isPathAllowedCheck) { + return createDehydrated(type, true, data, cleaned, path); + } + var value = { + unserializable: true, + type: type, + readonly: true, + preview_short: formatDataForPreview(data, false), + preview_long: formatDataForPreview(data, true), + name: data.constructor.name + }; + getAllEnumerableKeys(data).forEach(function (key) { + var keyAsString = key.toString(); + value[keyAsString] = dehydrate(data[key], cleaned, unserializable, path.concat([keyAsString]), isPathAllowed, isPathAllowedCheck ? 1 : level + 1); + }); + unserializable.push(path); + return value; + case 'infinity': + case 'nan': + case 'undefined': + // Some values are lossy when sent through a WebSocket. + // We dehydrate+rehydrate them to preserve their type. + cleaned.push(path); + return { + type: type + }; + default: + return data; + } + } + function fillInPath(object, data, path, value) { + var target = getInObject(object, path); + if (target != null) { + if (!target[meta.unserializable]) { + delete target[meta.inspectable]; + delete target[meta.inspected]; + delete target[meta.name]; + delete target[meta.preview_long]; + delete target[meta.preview_short]; + delete target[meta.readonly]; + delete target[meta.size]; + delete target[meta.type]; + } + } + if (value !== null && data.unserializable.length > 0) { + var unserializablePath = data.unserializable[0]; + var isMatch = unserializablePath.length === path.length; + for (var i = 0; i < path.length; i++) { + if (path[i] !== unserializablePath[i]) { + isMatch = false; + break; + } + } + if (isMatch) { + upgradeUnserializable(value, value); + } + } + setInObject(object, path, value); + } + function hydrate(object, cleaned, unserializable) { + cleaned.forEach(function (path) { + var length = path.length; + var last = path[length - 1]; + var parent = getInObject(object, path.slice(0, length - 1)); + if (!parent || !parent.hasOwnProperty(last)) { + return; + } + var value = parent[last]; + if (!value) { + return; + } else if (value.type === 'infinity') { + parent[last] = Infinity; + } else if (value.type === 'nan') { + parent[last] = NaN; + } else if (value.type === 'undefined') { + parent[last] = undefined; + } else { + // Replace the string keys with Symbols so they're non-enumerable. + var replaced = {}; + replaced[meta.inspectable] = !!value.inspectable; + replaced[meta.inspected] = false; + replaced[meta.name] = value.name; + replaced[meta.preview_long] = value.preview_long; + replaced[meta.preview_short] = value.preview_short; + replaced[meta.size] = value.size; + replaced[meta.readonly] = !!value.readonly; + replaced[meta.type] = value.type; + parent[last] = replaced; + } + }); + unserializable.forEach(function (path) { + var length = path.length; + var last = path[length - 1]; + var parent = getInObject(object, path.slice(0, length - 1)); + if (!parent || !parent.hasOwnProperty(last)) { + return; + } + var node = parent[last]; + var replacement = _objectSpread({}, node); + upgradeUnserializable(replacement, node); + parent[last] = replacement; + }); + return object; + } + function upgradeUnserializable(destination, source) { + var _Object$definePropert; + Object.defineProperties(destination, (_Object$definePropert = {}, hydration_defineProperty(_Object$definePropert, meta.inspected, { + configurable: true, + enumerable: false, + value: !!source.inspected + }), hydration_defineProperty(_Object$definePropert, meta.name, { + configurable: true, + enumerable: false, + value: source.name + }), hydration_defineProperty(_Object$definePropert, meta.preview_long, { + configurable: true, + enumerable: false, + value: source.preview_long + }), hydration_defineProperty(_Object$definePropert, meta.preview_short, { + configurable: true, + enumerable: false, + value: source.preview_short + }), hydration_defineProperty(_Object$definePropert, meta.size, { + configurable: true, + enumerable: false, + value: source.size + }), hydration_defineProperty(_Object$definePropert, meta.readonly, { + configurable: true, + enumerable: false, + value: !!source.readonly + }), hydration_defineProperty(_Object$definePropert, meta.type, { + configurable: true, + enumerable: false, + value: source.type + }), hydration_defineProperty(_Object$definePropert, meta.unserializable, { + configurable: true, + enumerable: false, + value: !!source.unserializable + }), _Object$definePropert)); + delete destination.inspected; + delete destination.name; + delete destination.preview_long; + delete destination.preview_short; + delete destination.size; + delete destination.readonly; + delete destination.type; + delete destination.unserializable; + } + ; // CONCATENATED MODULE: ../shared/isArray.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare + + function isArray_isArray(a) { + return isArrayImpl(a); + } + + /* harmony default export */ + var shared_isArray = isArray_isArray; + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/utils.js + function utils_toConsumableArray(arr) { + return utils_arrayWithoutHoles(arr) || utils_iterableToArray(arr) || backend_utils_unsupportedIterableToArray(arr) || utils_nonIterableSpread(); + } + function utils_nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function backend_utils_unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return backend_utils_arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return backend_utils_arrayLikeToArray(o, minLen); + } + function utils_iterableToArray(iter) { + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + } + function utils_arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return backend_utils_arrayLikeToArray(arr); + } + function backend_utils_arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + function backend_utils_typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + backend_utils_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + backend_utils_typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return backend_utils_typeof(obj); + } + function utils_ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + return keys; + } + function utils_objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + if (i % 2) { + utils_ownKeys(Object(source), true).forEach(function (key) { + utils_defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + utils_ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + return target; + } + function utils_defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + + /** + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + // TODO: update this to the first React version that has a corresponding DevTools backend + var FIRST_DEVTOOLS_BACKEND_LOCKSTEP_VER = '999.9.9'; + function hasAssignedBackend(version) { + if (version == null || version === '') { + return false; + } + return gte(version, FIRST_DEVTOOLS_BACKEND_LOCKSTEP_VER); + } + function cleanForBridge(data, isPathAllowed) { + var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + if (data !== null) { + var cleanedPaths = []; + var unserializablePaths = []; + var cleanedData = dehydrate(data, cleanedPaths, unserializablePaths, path, isPathAllowed); + return { + data: cleanedData, + cleaned: cleanedPaths, + unserializable: unserializablePaths + }; + } else { + return null; + } + } + function copyWithDelete(obj, path) { + var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var key = path[index]; + var updated = shared_isArray(obj) ? obj.slice() : utils_objectSpread({}, obj); + if (index + 1 === path.length) { + if (shared_isArray(updated)) { + updated.splice(key, 1); + } else { + delete updated[key]; + } + } else { + // $FlowFixMe[incompatible-use] number or string is fine here + updated[key] = copyWithDelete(obj[key], path, index + 1); + } + return updated; + } // This function expects paths to be the same except for the final value. + // e.g. ['path', 'to', 'foo'] and ['path', 'to', 'bar'] + + function copyWithRename(obj, oldPath, newPath) { + var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + var oldKey = oldPath[index]; + var updated = shared_isArray(obj) ? obj.slice() : utils_objectSpread({}, obj); + if (index + 1 === oldPath.length) { + var newKey = newPath[index]; // $FlowFixMe[incompatible-use] number or string is fine here + + updated[newKey] = updated[oldKey]; + if (shared_isArray(updated)) { + updated.splice(oldKey, 1); + } else { + delete updated[oldKey]; + } + } else { + // $FlowFixMe[incompatible-use] number or string is fine here + updated[oldKey] = copyWithRename(obj[oldKey], oldPath, newPath, index + 1); + } + return updated; + } + function copyWithSet(obj, path, value) { + var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + if (index >= path.length) { + return value; + } + var key = path[index]; + var updated = shared_isArray(obj) ? obj.slice() : utils_objectSpread({}, obj); // $FlowFixMe[incompatible-use] number or string is fine here + + updated[key] = copyWithSet(obj[key], path, value, index + 1); + return updated; + } + function getEffectDurations(root) { + // Profiling durations are only available for certain builds. + // If available, they'll be stored on the HostRoot. + var effectDuration = null; + var passiveEffectDuration = null; + var hostRoot = root.current; + if (hostRoot != null) { + var stateNode = hostRoot.stateNode; + if (stateNode != null) { + effectDuration = stateNode.effectDuration != null ? stateNode.effectDuration : null; + passiveEffectDuration = stateNode.passiveEffectDuration != null ? stateNode.passiveEffectDuration : null; + } + } + return { + effectDuration: effectDuration, + passiveEffectDuration: passiveEffectDuration + }; + } + function serializeToString(data) { + if (data === undefined) { + return 'undefined'; + } + var cache = new Set(); // Use a custom replacer function to protect against circular references. + + return JSON.stringify(data, function (key, value) { + if (backend_utils_typeof(value) === 'object' && value !== null) { + if (cache.has(value)) { + return; + } + cache.add(value); + } + if (typeof value === 'bigint') { + return value.toString() + 'n'; + } + return value; + }, 2); + } // Formats an array of args with a style for console methods, using + // the following algorithm: + // 1. The first param is a string that contains %c + // - Bail out and return the args without modifying the styles. + // We don't want to affect styles that the developer deliberately set. + // 2. The first param is a string that doesn't contain %c but contains + // string formatting + // - [`%c${args[0]}`, style, ...args.slice(1)] + // - Note: we assume that the string formatting that the developer uses + // is correct. + // 3. The first param is a string that doesn't contain string formatting + // OR is not a string + // - Create a formatting string where: + // boolean, string, symbol -> %s + // number -> %f OR %i depending on if it's an int or float + // default -> %o + + function formatWithStyles(inputArgs, style) { + if (inputArgs === undefined || inputArgs === null || inputArgs.length === 0 || + // Matches any of %c but not %%c + typeof inputArgs[0] === 'string' && inputArgs[0].match(/([^%]|^)(%c)/g) || style === undefined) { + return inputArgs; + } // Matches any of %(o|O|d|i|s|f), but not %%(o|O|d|i|s|f) + + var REGEXP = /([^%]|^)((%%)*)(%([oOdisf]))/g; + if (typeof inputArgs[0] === 'string' && inputArgs[0].match(REGEXP)) { + return ["%c".concat(inputArgs[0]), style].concat(utils_toConsumableArray(inputArgs.slice(1))); + } else { + var firstArg = inputArgs.reduce(function (formatStr, elem, i) { + if (i > 0) { + formatStr += ' '; + } + switch (backend_utils_typeof(elem)) { + case 'string': + case 'boolean': + case 'symbol': + return formatStr += '%s'; + case 'number': + var formatting = Number.isInteger(elem) ? '%i' : '%f'; + return formatStr += formatting; + default: + return formatStr += '%o'; + } + }, '%c'); + return [firstArg, style].concat(utils_toConsumableArray(inputArgs)); + } + } // based on https://github.com/tmpfs/format-util/blob/0e62d430efb0a1c51448709abd3e2406c14d8401/format.js#L1 + // based on https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions + // Implements s, d, i and f placeholders + // NOTE: KEEP IN SYNC with src/hook.js + + function format(maybeMessage) { + for (var _len = arguments.length, inputArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + inputArgs[_key - 1] = arguments[_key]; + } + var args = inputArgs.slice(); + var formatted = String(maybeMessage); // If the first argument is a string, check for substitutions. + + if (typeof maybeMessage === 'string') { + if (args.length) { + var REGEXP = /(%?)(%([jds]))/g; + formatted = formatted.replace(REGEXP, function (match, escaped, ptn, flag) { + var arg = args.shift(); + switch (flag) { + case 's': + arg += ''; + break; + case 'd': + case 'i': + arg = parseInt(arg, 10).toString(); + break; + case 'f': + arg = parseFloat(arg).toString(); + break; + } + if (!escaped) { + return arg; + } + args.unshift(arg); + return match; + }); + } + } // Arguments that remain after formatting. + + if (args.length) { + for (var i = 0; i < args.length; i++) { + formatted += ' ' + String(args[i]); + } + } // Update escaped %% values. + + formatted = formatted.replace(/%{2,2}/g, '%'); + return String(formatted); + } + function isSynchronousXHRSupported() { + return !!(window.document && window.document.featurePolicy && window.document.featurePolicy.allowsFeature('sync-xhr')); + } + function gt() { + var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + return compareVersions(a, b) === 1; + } + function gte() { + var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + return compareVersions(a, b) > -1; + } + // EXTERNAL MODULE: ../../build/oss-experimental/react-debug-tools/index.js + var react_debug_tools = __webpack_require__(987); + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/ReactSymbols.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + // This list should be kept updated to reflect additions to 'shared/ReactSymbols'. + // DevTools can't import symbols from 'shared/ReactSymbols' directly for two reasons: + // 1. DevTools requires symbols which may have been deleted in more recent versions (e.g. concurrent mode) + // 2. DevTools must support both Symbol and numeric forms of each symbol; + // Since e.g. standalone DevTools runs in a separate process, it can't rely on its own ES capabilities. + var CONCURRENT_MODE_NUMBER = 0xeacf; + var CONCURRENT_MODE_SYMBOL_STRING = 'Symbol(react.concurrent_mode)'; + var CONTEXT_NUMBER = 0xeace; + var CONTEXT_SYMBOL_STRING = 'Symbol(react.context)'; + var SERVER_CONTEXT_SYMBOL_STRING = 'Symbol(react.server_context)'; + var DEPRECATED_ASYNC_MODE_SYMBOL_STRING = 'Symbol(react.async_mode)'; + var ELEMENT_NUMBER = 0xeac7; + var ELEMENT_SYMBOL_STRING = 'Symbol(react.element)'; + var DEBUG_TRACING_MODE_NUMBER = 0xeae1; + var DEBUG_TRACING_MODE_SYMBOL_STRING = 'Symbol(react.debug_trace_mode)'; + var ReactSymbols_FORWARD_REF_NUMBER = 0xead0; + var ReactSymbols_FORWARD_REF_SYMBOL_STRING = 'Symbol(react.forward_ref)'; + var FRAGMENT_NUMBER = 0xeacb; + var FRAGMENT_SYMBOL_STRING = 'Symbol(react.fragment)'; + var ReactSymbols_LAZY_NUMBER = 0xead4; + var ReactSymbols_LAZY_SYMBOL_STRING = 'Symbol(react.lazy)'; + var ReactSymbols_MEMO_NUMBER = 0xead3; + var ReactSymbols_MEMO_SYMBOL_STRING = 'Symbol(react.memo)'; + var PORTAL_NUMBER = 0xeaca; + var PORTAL_SYMBOL_STRING = 'Symbol(react.portal)'; + var PROFILER_NUMBER = 0xead2; + var PROFILER_SYMBOL_STRING = 'Symbol(react.profiler)'; + var PROVIDER_NUMBER = 0xeacd; + var PROVIDER_SYMBOL_STRING = 'Symbol(react.provider)'; + var SCOPE_NUMBER = 0xead7; + var SCOPE_SYMBOL_STRING = 'Symbol(react.scope)'; + var STRICT_MODE_NUMBER = 0xeacc; + var STRICT_MODE_SYMBOL_STRING = 'Symbol(react.strict_mode)'; + var ReactSymbols_SUSPENSE_NUMBER = 0xead1; + var ReactSymbols_SUSPENSE_SYMBOL_STRING = 'Symbol(react.suspense)'; + var ReactSymbols_SUSPENSE_LIST_NUMBER = 0xead8; + var ReactSymbols_SUSPENSE_LIST_SYMBOL_STRING = 'Symbol(react.suspense_list)'; + var SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED_SYMBOL_STRING = 'Symbol(react.server_context.defaultValue)'; + ; // CONCATENATED MODULE: ../react-devtools-shared/src/config/DevToolsFeatureFlags.core-oss.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + /************************************************************************ + * This file is forked between different DevTools implementations. + * It should never be imported directly! + * It should always be imported from "react-devtools-feature-flags". + ************************************************************************/ + var consoleManagedByDevToolsDuringStrictMode = false; + var enableLogger = false; + var enableStyleXFeatures = false; + var isInternalFacebookBuild = false; + /************************************************************************ + * Do not edit the code below. + * It ensures this fork exports the same types as the default flags file. + ************************************************************************/ + + // Flow magic to verify the exports of this file match the original version. + null; + ; // CONCATENATED MODULE: ../shared/objectIs.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + function is(x, y) { + return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare + ; + } + var objectIs = + // $FlowFixMe[method-unbinding] + typeof Object.is === 'function' ? Object.is : is; + /* harmony default export */ + var shared_objectIs = objectIs; + ; // CONCATENATED MODULE: ../shared/hasOwnProperty.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + // $FlowFixMe[method-unbinding] + var hasOwnProperty_hasOwnProperty = Object.prototype.hasOwnProperty; + /* harmony default export */ + var shared_hasOwnProperty = hasOwnProperty_hasOwnProperty; + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/StyleX/utils.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + var cachedStyleNameToValueMap = new Map(); + function getStyleXData(data) { + var sources = new Set(); + var resolvedStyles = {}; + crawlData(data, sources, resolvedStyles); + return { + sources: Array.from(sources).sort(), + resolvedStyles: resolvedStyles + }; + } + function crawlData(data, sources, resolvedStyles) { + if (data == null) { + return; + } + if (src_isArray(data)) { + data.forEach(function (entry) { + if (entry == null) { + return; + } + if (src_isArray(entry)) { + crawlData(entry, sources, resolvedStyles); + } else { + crawlObjectProperties(entry, sources, resolvedStyles); + } + }); + } else { + crawlObjectProperties(data, sources, resolvedStyles); + } + resolvedStyles = Object.fromEntries(Object.entries(resolvedStyles).sort()); + } + function crawlObjectProperties(entry, sources, resolvedStyles) { + var keys = Object.keys(entry); + keys.forEach(function (key) { + var value = entry[key]; + if (typeof value === 'string') { + if (key === value) { + // Special case; this key is the name of the style's source/file/module. + sources.add(key); + } else { + var propertyValue = getPropertyValueForStyleName(value); + if (propertyValue != null) { + resolvedStyles[key] = propertyValue; + } + } + } else { + var nestedStyle = {}; + resolvedStyles[key] = nestedStyle; + crawlData([value], sources, nestedStyle); + } + }); + } + function getPropertyValueForStyleName(styleName) { + if (cachedStyleNameToValueMap.has(styleName)) { + return cachedStyleNameToValueMap.get(styleName); + } + for (var styleSheetIndex = 0; styleSheetIndex < document.styleSheets.length; styleSheetIndex++) { + var styleSheet = document.styleSheets[styleSheetIndex]; + var rules = null; // this might throw if CORS rules are enforced https://www.w3.org/TR/cssom-1/#the-cssstylesheet-interface + + try { + rules = styleSheet.cssRules; + } catch (_e) { + continue; + } + for (var ruleIndex = 0; ruleIndex < rules.length; ruleIndex++) { + if (!(rules[ruleIndex] instanceof CSSStyleRule)) { + continue; + } + var rule = rules[ruleIndex]; + var cssText = rule.cssText, + selectorText = rule.selectorText, + style = rule.style; + if (selectorText != null) { + if (selectorText.startsWith(".".concat(styleName))) { + var match = cssText.match(/{ *([a-z\-]+):/); + if (match !== null) { + var property = match[1]; + var value = style.getPropertyValue(property); + cachedStyleNameToValueMap.set(styleName, value); + return value; + } else { + return null; + } + } + } + } + } + return null; + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/devtools/constants.js + var CHANGE_LOG_URL = 'https://github.com/facebook/react/blob/main/packages/react-devtools/CHANGELOG.md'; + var UNSUPPORTED_VERSION_URL = 'https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-do-i-get-the-old-version-back'; + var REACT_DEVTOOLS_WORKPLACE_URL = 'https://fburl.com/react-devtools-workplace-group'; + var THEME_STYLES = { + light: { + '--color-attribute-name': '#ef6632', + '--color-attribute-name-not-editable': '#23272f', + '--color-attribute-name-inverted': 'rgba(255, 255, 255, 0.7)', + '--color-attribute-value': '#1a1aa6', + '--color-attribute-value-inverted': '#ffffff', + '--color-attribute-editable-value': '#1a1aa6', + '--color-background': '#ffffff', + '--color-background-hover': 'rgba(0, 136, 250, 0.1)', + '--color-background-inactive': '#e5e5e5', + '--color-background-invalid': '#fff0f0', + '--color-background-selected': '#0088fa', + '--color-button-background': '#ffffff', + '--color-button-background-focus': '#ededed', + '--color-button': '#5f6673', + '--color-button-disabled': '#cfd1d5', + '--color-button-active': '#0088fa', + '--color-button-focus': '#23272f', + '--color-button-hover': '#23272f', + '--color-border': '#eeeeee', + '--color-commit-did-not-render-fill': '#cfd1d5', + '--color-commit-did-not-render-fill-text': '#000000', + '--color-commit-did-not-render-pattern': '#cfd1d5', + '--color-commit-did-not-render-pattern-text': '#333333', + '--color-commit-gradient-0': '#37afa9', + '--color-commit-gradient-1': '#63b19e', + '--color-commit-gradient-2': '#80b393', + '--color-commit-gradient-3': '#97b488', + '--color-commit-gradient-4': '#abb67d', + '--color-commit-gradient-5': '#beb771', + '--color-commit-gradient-6': '#cfb965', + '--color-commit-gradient-7': '#dfba57', + '--color-commit-gradient-8': '#efbb49', + '--color-commit-gradient-9': '#febc38', + '--color-commit-gradient-text': '#000000', + '--color-component-name': '#6a51b2', + '--color-component-name-inverted': '#ffffff', + '--color-component-badge-background': 'rgba(0, 0, 0, 0.1)', + '--color-component-badge-background-inverted': 'rgba(255, 255, 255, 0.25)', + '--color-component-badge-count': '#777d88', + '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)', + '--color-console-error-badge-text': '#ffffff', + '--color-console-error-background': '#fff0f0', + '--color-console-error-border': '#ffd6d6', + '--color-console-error-icon': '#eb3941', + '--color-console-error-text': '#fe2e31', + '--color-console-warning-badge-text': '#000000', + '--color-console-warning-background': '#fffbe5', + '--color-console-warning-border': '#fff5c1', + '--color-console-warning-icon': '#f4bd00', + '--color-console-warning-text': '#64460c', + '--color-context-background': 'rgba(0,0,0,.9)', + '--color-context-background-hover': 'rgba(255, 255, 255, 0.1)', + '--color-context-background-selected': '#178fb9', + '--color-context-border': '#3d424a', + '--color-context-text': '#ffffff', + '--color-context-text-selected': '#ffffff', + '--color-dim': '#777d88', + '--color-dimmer': '#cfd1d5', + '--color-dimmest': '#eff0f1', + '--color-error-background': 'hsl(0, 100%, 97%)', + '--color-error-border': 'hsl(0, 100%, 92%)', + '--color-error-text': '#ff0000', + '--color-expand-collapse-toggle': '#777d88', + '--color-link': '#0000ff', + '--color-modal-background': 'rgba(255, 255, 255, 0.75)', + '--color-bridge-version-npm-background': '#eff0f1', + '--color-bridge-version-npm-text': '#000000', + '--color-bridge-version-number': '#0088fa', + '--color-primitive-hook-badge-background': '#e5e5e5', + '--color-primitive-hook-badge-text': '#5f6673', + '--color-record-active': '#fc3a4b', + '--color-record-hover': '#3578e5', + '--color-record-inactive': '#0088fa', + '--color-resize-bar': '#eeeeee', + '--color-resize-bar-active': '#dcdcdc', + '--color-resize-bar-border': '#d1d1d1', + '--color-resize-bar-dot': '#333333', + '--color-timeline-internal-module': '#d1d1d1', + '--color-timeline-internal-module-hover': '#c9c9c9', + '--color-timeline-internal-module-text': '#444', + '--color-timeline-native-event': '#ccc', + '--color-timeline-native-event-hover': '#aaa', + '--color-timeline-network-primary': '#fcf3dc', + '--color-timeline-network-primary-hover': '#f0e7d1', + '--color-timeline-network-secondary': '#efc457', + '--color-timeline-network-secondary-hover': '#e3ba52', + '--color-timeline-priority-background': '#f6f6f6', + '--color-timeline-priority-border': '#eeeeee', + '--color-timeline-user-timing': '#c9cacd', + '--color-timeline-user-timing-hover': '#93959a', + '--color-timeline-react-idle': '#d3e5f6', + '--color-timeline-react-idle-hover': '#c3d9ef', + '--color-timeline-react-render': '#9fc3f3', + '--color-timeline-react-render-hover': '#83afe9', + '--color-timeline-react-render-text': '#11365e', + '--color-timeline-react-commit': '#c88ff0', + '--color-timeline-react-commit-hover': '#b281d6', + '--color-timeline-react-commit-text': '#3e2c4a', + '--color-timeline-react-layout-effects': '#b281d6', + '--color-timeline-react-layout-effects-hover': '#9d71bd', + '--color-timeline-react-layout-effects-text': '#3e2c4a', + '--color-timeline-react-passive-effects': '#b281d6', + '--color-timeline-react-passive-effects-hover': '#9d71bd', + '--color-timeline-react-passive-effects-text': '#3e2c4a', + '--color-timeline-react-schedule': '#9fc3f3', + '--color-timeline-react-schedule-hover': '#2683E2', + '--color-timeline-react-suspense-rejected': '#f1cc14', + '--color-timeline-react-suspense-rejected-hover': '#ffdf37', + '--color-timeline-react-suspense-resolved': '#a6e59f', + '--color-timeline-react-suspense-resolved-hover': '#89d281', + '--color-timeline-react-suspense-unresolved': '#c9cacd', + '--color-timeline-react-suspense-unresolved-hover': '#93959a', + '--color-timeline-thrown-error': '#ee1638', + '--color-timeline-thrown-error-hover': '#da1030', + '--color-timeline-text-color': '#000000', + '--color-timeline-text-dim-color': '#ccc', + '--color-timeline-react-work-border': '#eeeeee', + '--color-search-match': 'yellow', + '--color-search-match-current': '#f7923b', + '--color-selected-tree-highlight-active': 'rgba(0, 136, 250, 0.1)', + '--color-selected-tree-highlight-inactive': 'rgba(0, 0, 0, 0.05)', + '--color-scroll-caret': 'rgba(150, 150, 150, 0.5)', + '--color-tab-selected-border': '#0088fa', + '--color-text': '#000000', + '--color-text-invalid': '#ff0000', + '--color-text-selected': '#ffffff', + '--color-toggle-background-invalid': '#fc3a4b', + '--color-toggle-background-on': '#0088fa', + '--color-toggle-background-off': '#cfd1d5', + '--color-toggle-text': '#ffffff', + '--color-warning-background': '#fb3655', + '--color-warning-background-hover': '#f82042', + '--color-warning-text-color': '#ffffff', + '--color-warning-text-color-inverted': '#fd4d69', + // The styles below should be kept in sync with 'root.css' + // They are repeated there because they're used by e.g. tooltips or context menus + // which get rendered outside of the DOM subtree (where normal theme/styles are written). + '--color-scroll-thumb': '#c2c2c2', + '--color-scroll-track': '#fafafa', + '--color-tooltip-background': 'rgba(0, 0, 0, 0.9)', + '--color-tooltip-text': '#ffffff' + }, + dark: { + '--color-attribute-name': '#9d87d2', + '--color-attribute-name-not-editable': '#ededed', + '--color-attribute-name-inverted': '#282828', + '--color-attribute-value': '#cedae0', + '--color-attribute-value-inverted': '#ffffff', + '--color-attribute-editable-value': 'yellow', + '--color-background': '#282c34', + '--color-background-hover': 'rgba(255, 255, 255, 0.1)', + '--color-background-inactive': '#3d424a', + '--color-background-invalid': '#5c0000', + '--color-background-selected': '#178fb9', + '--color-button-background': '#282c34', + '--color-button-background-focus': '#3d424a', + '--color-button': '#afb3b9', + '--color-button-active': '#61dafb', + '--color-button-disabled': '#4f5766', + '--color-button-focus': '#a2e9fc', + '--color-button-hover': '#ededed', + '--color-border': '#3d424a', + '--color-commit-did-not-render-fill': '#777d88', + '--color-commit-did-not-render-fill-text': '#000000', + '--color-commit-did-not-render-pattern': '#666c77', + '--color-commit-did-not-render-pattern-text': '#ffffff', + '--color-commit-gradient-0': '#37afa9', + '--color-commit-gradient-1': '#63b19e', + '--color-commit-gradient-2': '#80b393', + '--color-commit-gradient-3': '#97b488', + '--color-commit-gradient-4': '#abb67d', + '--color-commit-gradient-5': '#beb771', + '--color-commit-gradient-6': '#cfb965', + '--color-commit-gradient-7': '#dfba57', + '--color-commit-gradient-8': '#efbb49', + '--color-commit-gradient-9': '#febc38', + '--color-commit-gradient-text': '#000000', + '--color-component-name': '#61dafb', + '--color-component-name-inverted': '#282828', + '--color-component-badge-background': 'rgba(255, 255, 255, 0.25)', + '--color-component-badge-background-inverted': 'rgba(0, 0, 0, 0.25)', + '--color-component-badge-count': '#8f949d', + '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)', + '--color-console-error-badge-text': '#000000', + '--color-console-error-background': '#290000', + '--color-console-error-border': '#5c0000', + '--color-console-error-icon': '#eb3941', + '--color-console-error-text': '#fc7f7f', + '--color-console-warning-badge-text': '#000000', + '--color-console-warning-background': '#332b00', + '--color-console-warning-border': '#665500', + '--color-console-warning-icon': '#f4bd00', + '--color-console-warning-text': '#f5f2ed', + '--color-context-background': 'rgba(255,255,255,.95)', + '--color-context-background-hover': 'rgba(0, 136, 250, 0.1)', + '--color-context-background-selected': '#0088fa', + '--color-context-border': '#eeeeee', + '--color-context-text': '#000000', + '--color-context-text-selected': '#ffffff', + '--color-dim': '#8f949d', + '--color-dimmer': '#777d88', + '--color-dimmest': '#4f5766', + '--color-error-background': '#200', + '--color-error-border': '#900', + '--color-error-text': '#f55', + '--color-expand-collapse-toggle': '#8f949d', + '--color-link': '#61dafb', + '--color-modal-background': 'rgba(0, 0, 0, 0.75)', + '--color-bridge-version-npm-background': 'rgba(0, 0, 0, 0.25)', + '--color-bridge-version-npm-text': '#ffffff', + '--color-bridge-version-number': 'yellow', + '--color-primitive-hook-badge-background': 'rgba(0, 0, 0, 0.25)', + '--color-primitive-hook-badge-text': 'rgba(255, 255, 255, 0.7)', + '--color-record-active': '#fc3a4b', + '--color-record-hover': '#a2e9fc', + '--color-record-inactive': '#61dafb', + '--color-resize-bar': '#282c34', + '--color-resize-bar-active': '#31363f', + '--color-resize-bar-border': '#3d424a', + '--color-resize-bar-dot': '#cfd1d5', + '--color-timeline-internal-module': '#303542', + '--color-timeline-internal-module-hover': '#363b4a', + '--color-timeline-internal-module-text': '#7f8899', + '--color-timeline-native-event': '#b2b2b2', + '--color-timeline-native-event-hover': '#949494', + '--color-timeline-network-primary': '#fcf3dc', + '--color-timeline-network-primary-hover': '#e3dbc5', + '--color-timeline-network-secondary': '#efc457', + '--color-timeline-network-secondary-hover': '#d6af4d', + '--color-timeline-priority-background': '#1d2129', + '--color-timeline-priority-border': '#282c34', + '--color-timeline-user-timing': '#c9cacd', + '--color-timeline-user-timing-hover': '#93959a', + '--color-timeline-react-idle': '#3d485b', + '--color-timeline-react-idle-hover': '#465269', + '--color-timeline-react-render': '#2683E2', + '--color-timeline-react-render-hover': '#1a76d4', + '--color-timeline-react-render-text': '#11365e', + '--color-timeline-react-commit': '#731fad', + '--color-timeline-react-commit-hover': '#611b94', + '--color-timeline-react-commit-text': '#e5c1ff', + '--color-timeline-react-layout-effects': '#611b94', + '--color-timeline-react-layout-effects-hover': '#51167a', + '--color-timeline-react-layout-effects-text': '#e5c1ff', + '--color-timeline-react-passive-effects': '#611b94', + '--color-timeline-react-passive-effects-hover': '#51167a', + '--color-timeline-react-passive-effects-text': '#e5c1ff', + '--color-timeline-react-schedule': '#2683E2', + '--color-timeline-react-schedule-hover': '#1a76d4', + '--color-timeline-react-suspense-rejected': '#f1cc14', + '--color-timeline-react-suspense-rejected-hover': '#e4c00f', + '--color-timeline-react-suspense-resolved': '#a6e59f', + '--color-timeline-react-suspense-resolved-hover': '#89d281', + '--color-timeline-react-suspense-unresolved': '#c9cacd', + '--color-timeline-react-suspense-unresolved-hover': '#93959a', + '--color-timeline-thrown-error': '#fb3655', + '--color-timeline-thrown-error-hover': '#f82042', + '--color-timeline-text-color': '#282c34', + '--color-timeline-text-dim-color': '#555b66', + '--color-timeline-react-work-border': '#3d424a', + '--color-search-match': 'yellow', + '--color-search-match-current': '#f7923b', + '--color-selected-tree-highlight-active': 'rgba(23, 143, 185, 0.15)', + '--color-selected-tree-highlight-inactive': 'rgba(255, 255, 255, 0.05)', + '--color-scroll-caret': '#4f5766', + '--color-shadow': 'rgba(0, 0, 0, 0.5)', + '--color-tab-selected-border': '#178fb9', + '--color-text': '#ffffff', + '--color-text-invalid': '#ff8080', + '--color-text-selected': '#ffffff', + '--color-toggle-background-invalid': '#fc3a4b', + '--color-toggle-background-on': '#178fb9', + '--color-toggle-background-off': '#777d88', + '--color-toggle-text': '#ffffff', + '--color-warning-background': '#ee1638', + '--color-warning-background-hover': '#da1030', + '--color-warning-text-color': '#ffffff', + '--color-warning-text-color-inverted': '#ee1638', + // The styles below should be kept in sync with 'root.css' + // They are repeated there because they're used by e.g. tooltips or context menus + // which get rendered outside of the DOM subtree (where normal theme/styles are written). + '--color-scroll-thumb': '#afb3b9', + '--color-scroll-track': '#313640', + '--color-tooltip-background': 'rgba(255, 255, 255, 0.95)', + '--color-tooltip-text': '#000000' + }, + compact: { + '--font-size-monospace-small': '9px', + '--font-size-monospace-normal': '11px', + '--font-size-monospace-large': '15px', + '--font-size-sans-small': '10px', + '--font-size-sans-normal': '12px', + '--font-size-sans-large': '14px', + '--line-height-data': '18px' + }, + comfortable: { + '--font-size-monospace-small': '10px', + '--font-size-monospace-normal': '13px', + '--font-size-monospace-large': '17px', + '--font-size-sans-small': '12px', + '--font-size-sans-normal': '14px', + '--font-size-sans-large': '16px', + '--line-height-data': '22px' + } + }; // HACK + // + // Sometimes the inline target is rendered before root styles are applied, + // which would result in e.g. NaN itemSize being passed to react-window list. + + var COMFORTABLE_LINE_HEIGHT = parseInt(THEME_STYLES.comfortable['--line-height-data'], 10); + var COMPACT_LINE_HEIGHT = parseInt(THEME_STYLES.compact['--line-height-data'], 10); + ; // CONCATENATED MODULE: ../react-devtools-timeline/src/constants.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + var REACT_TOTAL_NUM_LANES = 31; // Increment this number any time a backwards breaking change is made to the profiler metadata. + + var SCHEDULING_PROFILER_VERSION = 1; + var SNAPSHOT_MAX_HEIGHT = 60; + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/DevToolsConsolePatching.js + function DevToolsConsolePatching_ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + return keys; + } + function DevToolsConsolePatching_objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + if (i % 2) { + DevToolsConsolePatching_ownKeys(Object(source), true).forEach(function (key) { + DevToolsConsolePatching_defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + DevToolsConsolePatching_ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + return target; + } + function DevToolsConsolePatching_defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + // This is a DevTools fork of shared/ConsolePatchingDev. + // The shared console patching code is DEV-only. + // We can't use it since DevTools only ships production builds. + // Helpers to patch console.logs to avoid logging during side-effect free + // replaying on render function. This currently only patches the object + // lazily which won't cover if the log function was extracted eagerly. + // We could also eagerly patch the method. + var disabledDepth = 0; + var prevLog; + var prevInfo; + var prevWarn; + var prevError; + var prevGroup; + var prevGroupCollapsed; + var prevGroupEnd; + function disabledLog() {} + disabledLog.__reactDisabledLog = true; + function disableLogs() { + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 + + var props = { + configurable: true, + enumerable: true, + value: disabledLog, + writable: true + }; // $FlowFixMe[cannot-write] Flow thinks console is immutable. + + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + /* eslint-enable react-internal/no-production-logging */ + } + disabledDepth++; + } + function reenableLogs() { + disabledDepth--; + if (disabledDepth === 0) { + /* eslint-disable react-internal/no-production-logging */ + var props = { + configurable: true, + enumerable: true, + writable: true + }; // $FlowFixMe[cannot-write] Flow thinks console is immutable. + + Object.defineProperties(console, { + log: DevToolsConsolePatching_objectSpread(DevToolsConsolePatching_objectSpread({}, props), {}, { + value: prevLog + }), + info: DevToolsConsolePatching_objectSpread(DevToolsConsolePatching_objectSpread({}, props), {}, { + value: prevInfo + }), + warn: DevToolsConsolePatching_objectSpread(DevToolsConsolePatching_objectSpread({}, props), {}, { + value: prevWarn + }), + error: DevToolsConsolePatching_objectSpread(DevToolsConsolePatching_objectSpread({}, props), {}, { + value: prevError + }), + group: DevToolsConsolePatching_objectSpread(DevToolsConsolePatching_objectSpread({}, props), {}, { + value: prevGroup + }), + groupCollapsed: DevToolsConsolePatching_objectSpread(DevToolsConsolePatching_objectSpread({}, props), {}, { + value: prevGroupCollapsed + }), + groupEnd: DevToolsConsolePatching_objectSpread(DevToolsConsolePatching_objectSpread({}, props), {}, { + value: prevGroupEnd + }) + }); + /* eslint-enable react-internal/no-production-logging */ + } + if (disabledDepth < 0) { + console.error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); + } + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/DevToolsComponentStackFrame.js + function DevToolsComponentStackFrame_typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + DevToolsComponentStackFrame_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + DevToolsComponentStackFrame_typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return DevToolsComponentStackFrame_typeof(obj); + } + + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + // This is a DevTools fork of ReactComponentStackFrame. + // This fork enables DevTools to use the same "native" component stack format, + // while still maintaining support for multiple renderer versions + // (which use different values for ReactTypeOfWork). + // The shared console patching code is DEV-only. + // We can't use it since DevTools only ships production builds. + + var prefix; + function describeBuiltInComponentFrame(name, ownerFn) { + if (prefix === undefined) { + // Extract the VM specific prefix used by each line. + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = match && match[1] || ''; + } + } // We use the prefix to ensure our stacks line up with native stack frames. + + return '\n' + prefix + name; + } + var reentry = false; + var componentFrameCache; + if (false) { + var PossiblyWeakMap; + } + function describeNativeComponentFrame(fn, construct, currentDispatcherRef) { + // If something asked for a stack inside a fake render, it should get ignored. + if (!fn || reentry) { + return ''; + } + if (false) { + var frame; + } + var control; + var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined. + + Error.prepareStackTrace = undefined; + reentry = true; // Override the dispatcher so effects scheduled by this shallow render are thrown away. + // + // Note that unlike the code this was forked from (in ReactComponentStackFrame) + // DevTools should override the dispatcher even when DevTools is compiled in production mode, + // because the app itself may be in development mode and log errors/warnings. + + var previousDispatcher = currentDispatcherRef.current; + currentDispatcherRef.current = null; + disableLogs(); + try { + // This should throw. + if (construct) { + // Something should be setting the props in the constructor. + var Fake = function Fake() { + throw Error(); + }; // $FlowFixMe[prop-missing] + + Object.defineProperty(Fake.prototype, 'props', { + set: function set() { + // We use a throwing setter instead of frozen or non-writable props + // because that won't throw in a non-strict mode function. + throw Error(); + } + }); + if ((typeof Reflect === "undefined" ? "undefined" : DevToolsComponentStackFrame_typeof(Reflect)) === 'object' && Reflect.construct) { + // We construct a different control for this case to include any extra + // frames added by the construct call. + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } // $FlowFixMe[prop-missing] found when upgrading Flow + + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } + fn(); + } + } catch (sample) { + // This is inlined manually because closure doesn't do it for us. + if (sample && control && typeof sample.stack === 'string') { + // This extracts the first frame from the sample that isn't also in the control. + // Skipping one frame that we assume is the frame that calls the two. + var sampleLines = sample.stack.split('\n'); + var controlLines = control.stack.split('\n'); + var s = sampleLines.length - 1; + var c = controlLines.length - 1; + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + // We expect at least one stack frame to be shared. + // Typically this will be the root most one. However, stack frames may be + // cut off due to maximum stack limits. In this case, one maybe cut off + // earlier than the other. We assume that the sample is longer or the same + // and there for cut off earlier. So we should find the root most frame in + // the sample somewhere in the control. + c--; + } + for (; s >= 1 && c >= 0; s--, c--) { + // Next we find the first one that isn't the same which should be the + // frame that called our sample function and the control. + if (sampleLines[s] !== controlLines[c]) { + // In V8, the first line is describing the message but other VMs don't. + // If we're about to return the first line, and the control is also on the same + // line, that's a pretty good indicator that our sample threw at same line as + // the control. I.e. before we entered the sample frame. So we ignore this result. + // This can happen if you passed a class to function component, or non-function. + if (s !== 1 || c !== 1) { + do { + s--; + c--; // We may still have similar intermediate frames from the construct call. + // The next one that isn't the same should be our match though. + + if (c < 0 || sampleLines[s] !== controlLines[c]) { + // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. + var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); + if (false) {} // Return the line we found. + + return _frame; + } + } while (s >= 1 && c >= 0); + } + break; + } + } + } + } finally { + reentry = false; + Error.prepareStackTrace = previousPrepareStackTrace; + currentDispatcherRef.current = previousDispatcher; + reenableLogs(); + } // Fallback to just using the name if we couldn't make it throw. + + var name = fn ? fn.displayName || fn.name : ''; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; + if (false) {} + return syntheticFrame; + } + function describeClassComponentFrame(ctor, ownerFn, currentDispatcherRef) { + return describeNativeComponentFrame(ctor, true, currentDispatcherRef); + } + function describeFunctionComponentFrame(fn, ownerFn, currentDispatcherRef) { + return describeNativeComponentFrame(fn, false, currentDispatcherRef); + } + function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); + } + function describeUnknownElementTypeFrameInDEV(type, ownerFn, currentDispatcherRef) { + if (true) { + return ''; + } + if (type == null) { + return ''; + } + if (typeof type === 'function') { + return describeNativeComponentFrame(type, shouldConstruct(type), currentDispatcherRef); + } + if (typeof type === 'string') { + return describeBuiltInComponentFrame(type, ownerFn); + } + switch (type) { + case SUSPENSE_NUMBER: + case SUSPENSE_SYMBOL_STRING: + return describeBuiltInComponentFrame('Suspense', ownerFn); + case SUSPENSE_LIST_NUMBER: + case SUSPENSE_LIST_SYMBOL_STRING: + return describeBuiltInComponentFrame('SuspenseList', ownerFn); + } + if (DevToolsComponentStackFrame_typeof(type) === 'object') { + switch (type.$$typeof) { + case FORWARD_REF_NUMBER: + case FORWARD_REF_SYMBOL_STRING: + return describeFunctionComponentFrame(type.render, ownerFn, currentDispatcherRef); + case MEMO_NUMBER: + case MEMO_SYMBOL_STRING: + // Memo may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(type.type, ownerFn, currentDispatcherRef); + case LAZY_NUMBER: + case LAZY_SYMBOL_STRING: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + // Lazy may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(init(payload), ownerFn, currentDispatcherRef); + } catch (x) {} + } + } + } + return ''; + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/DevToolsFiberComponentStack.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + // This is a DevTools fork of ReactFiberComponentStack. + // This fork enables DevTools to use the same "native" component stack format, + // while still maintaining support for multiple renderer versions + // (which use different values for ReactTypeOfWork). + + function describeFiber(workTagMap, workInProgress, currentDispatcherRef) { + var HostComponent = workTagMap.HostComponent, + LazyComponent = workTagMap.LazyComponent, + SuspenseComponent = workTagMap.SuspenseComponent, + SuspenseListComponent = workTagMap.SuspenseListComponent, + FunctionComponent = workTagMap.FunctionComponent, + IndeterminateComponent = workTagMap.IndeterminateComponent, + SimpleMemoComponent = workTagMap.SimpleMemoComponent, + ForwardRef = workTagMap.ForwardRef, + ClassComponent = workTagMap.ClassComponent; + var owner = false ? 0 : null; + switch (workInProgress.tag) { + case HostComponent: + return describeBuiltInComponentFrame(workInProgress.type, owner); + case LazyComponent: + return describeBuiltInComponentFrame('Lazy', owner); + case SuspenseComponent: + return describeBuiltInComponentFrame('Suspense', owner); + case SuspenseListComponent: + return describeBuiltInComponentFrame('SuspenseList', owner); + case FunctionComponent: + case IndeterminateComponent: + case SimpleMemoComponent: + return describeFunctionComponentFrame(workInProgress.type, owner, currentDispatcherRef); + case ForwardRef: + return describeFunctionComponentFrame(workInProgress.type.render, owner, currentDispatcherRef); + case ClassComponent: + return describeClassComponentFrame(workInProgress.type, owner, currentDispatcherRef); + default: + return ''; + } + } + function getStackByFiberInDevAndProd(workTagMap, workInProgress, currentDispatcherRef) { + try { + var info = ''; + var node = workInProgress; + do { + info += describeFiber(workTagMap, node, currentDispatcherRef); // $FlowFixMe[incompatible-type] we bail out when we get a null + + node = node.return; + } while (node); + return info; + } catch (x) { + return '\nError generating stack: ' + x.message + '\n' + x.stack; + } + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/profilingHooks.js + function profilingHooks_slicedToArray(arr, i) { + return profilingHooks_arrayWithHoles(arr) || profilingHooks_iterableToArrayLimit(arr, i) || profilingHooks_unsupportedIterableToArray(arr, i) || profilingHooks_nonIterableRest(); + } + function profilingHooks_nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function profilingHooks_unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return profilingHooks_arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return profilingHooks_arrayLikeToArray(o, minLen); + } + function profilingHooks_arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + function profilingHooks_iterableToArrayLimit(arr, i) { + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + function profilingHooks_arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + function profilingHooks_typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + profilingHooks_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + profilingHooks_typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return profilingHooks_typeof(obj); + } + + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + // Add padding to the start/stop time of the profile. + // This makes the UI nicer to use. + + var TIME_OFFSET = 10; + var performanceTarget = null; // If performance exists and supports the subset of the User Timing API that we require. + + var supportsUserTiming = typeof performance !== 'undefined' && + // $FlowFixMe[method-unbinding] + typeof performance.mark === 'function' && + // $FlowFixMe[method-unbinding] + typeof performance.clearMarks === 'function'; + var supportsUserTimingV3 = false; + if (supportsUserTiming) { + var CHECK_V3_MARK = '__v3'; + var markOptions = {}; + Object.defineProperty(markOptions, 'startTime', { + get: function get() { + supportsUserTimingV3 = true; + return 0; + }, + set: function set() {} + }); + try { + performance.mark(CHECK_V3_MARK, markOptions); + } catch (error) {// Ignore + } finally { + performance.clearMarks(CHECK_V3_MARK); + } + } + if (supportsUserTimingV3) { + performanceTarget = performance; + } // Some environments (e.g. React Native / Hermes) don't support the performance API yet. + + var profilingHooks_getCurrentTime = + // $FlowFixMe[method-unbinding] + (typeof performance === "undefined" ? "undefined" : profilingHooks_typeof(performance)) === 'object' && typeof performance.now === 'function' ? function () { + return performance.now(); + } : function () { + return Date.now(); + }; // Mocking the Performance Object (and User Timing APIs) for testing is fragile. + // This API allows tests to directly override the User Timing APIs. + + function setPerformanceMock_ONLY_FOR_TESTING(performanceMock) { + performanceTarget = performanceMock; + supportsUserTiming = performanceMock !== null; + supportsUserTimingV3 = performanceMock !== null; + } + function createProfilingHooks(_ref) { + var getDisplayNameForFiber = _ref.getDisplayNameForFiber, + getIsProfiling = _ref.getIsProfiling, + getLaneLabelMap = _ref.getLaneLabelMap, + workTagMap = _ref.workTagMap, + currentDispatcherRef = _ref.currentDispatcherRef, + reactVersion = _ref.reactVersion; + var currentBatchUID = 0; + var currentReactComponentMeasure = null; + var currentReactMeasuresStack = []; + var currentTimelineData = null; + var currentFiberStacks = new Map(); + var isProfiling = false; + var nextRenderShouldStartNewBatch = false; + function getRelativeTime() { + var currentTime = profilingHooks_getCurrentTime(); + if (currentTimelineData) { + if (currentTimelineData.startTime === 0) { + currentTimelineData.startTime = currentTime - TIME_OFFSET; + } + return currentTime - currentTimelineData.startTime; + } + return 0; + } + function getInternalModuleRanges() { + /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.getInternalModuleRanges === 'function') { + // Ask the DevTools hook for module ranges that may have been reported by the current renderer(s). + // Don't do this eagerly like the laneToLabelMap, + // because some modules might not yet have registered their boundaries when the renderer is injected. + var ranges = __REACT_DEVTOOLS_GLOBAL_HOOK__.getInternalModuleRanges(); // This check would not be required, + // except that it's possible for things to override __REACT_DEVTOOLS_GLOBAL_HOOK__. + + if (shared_isArray(ranges)) { + return ranges; + } + } + return null; + } + function getTimelineData() { + return currentTimelineData; + } + function laneToLanesArray(lanes) { + var lanesArray = []; + var lane = 1; + for (var index = 0; index < REACT_TOTAL_NUM_LANES; index++) { + if (lane & lanes) { + lanesArray.push(lane); + } + lane *= 2; + } + return lanesArray; + } + var laneToLabelMap = typeof getLaneLabelMap === 'function' ? getLaneLabelMap() : null; + function markMetadata() { + markAndClear("--react-version-".concat(reactVersion)); + markAndClear("--profiler-version-".concat(SCHEDULING_PROFILER_VERSION)); + var ranges = getInternalModuleRanges(); + if (ranges) { + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (shared_isArray(range) && range.length === 2) { + var _ranges$i = profilingHooks_slicedToArray(ranges[i], 2), + startStackFrame = _ranges$i[0], + stopStackFrame = _ranges$i[1]; + markAndClear("--react-internal-module-start-".concat(startStackFrame)); + markAndClear("--react-internal-module-stop-".concat(stopStackFrame)); + } + } + } + if (laneToLabelMap != null) { + var labels = Array.from(laneToLabelMap.values()).join(','); + markAndClear("--react-lane-labels-".concat(labels)); + } + } + function markAndClear(markName) { + // This method won't be called unless these functions are defined, so we can skip the extra typeof check. + performanceTarget.mark(markName); + performanceTarget.clearMarks(markName); + } + function recordReactMeasureStarted(type, lanes) { + // Decide what depth thi work should be rendered at, based on what's on the top of the stack. + // It's okay to render over top of "idle" work but everything else should be on its own row. + var depth = 0; + if (currentReactMeasuresStack.length > 0) { + var top = currentReactMeasuresStack[currentReactMeasuresStack.length - 1]; + depth = top.type === 'render-idle' ? top.depth : top.depth + 1; + } + var lanesArray = laneToLanesArray(lanes); + var reactMeasure = { + type: type, + batchUID: currentBatchUID, + depth: depth, + lanes: lanesArray, + timestamp: getRelativeTime(), + duration: 0 + }; + currentReactMeasuresStack.push(reactMeasure); + if (currentTimelineData) { + var _currentTimelineData = currentTimelineData, + batchUIDToMeasuresMap = _currentTimelineData.batchUIDToMeasuresMap, + laneToReactMeasureMap = _currentTimelineData.laneToReactMeasureMap; + var reactMeasures = batchUIDToMeasuresMap.get(currentBatchUID); + if (reactMeasures != null) { + reactMeasures.push(reactMeasure); + } else { + batchUIDToMeasuresMap.set(currentBatchUID, [reactMeasure]); + } + lanesArray.forEach(function (lane) { + reactMeasures = laneToReactMeasureMap.get(lane); + if (reactMeasures) { + reactMeasures.push(reactMeasure); + } + }); + } + } + function recordReactMeasureCompleted(type) { + var currentTime = getRelativeTime(); + if (currentReactMeasuresStack.length === 0) { + console.error('Unexpected type "%s" completed at %sms while currentReactMeasuresStack is empty.', type, currentTime); // Ignore work "completion" user timing mark that doesn't complete anything + + return; + } + var top = currentReactMeasuresStack.pop(); + if (top.type !== type) { + console.error('Unexpected type "%s" completed at %sms before "%s" completed.', type, currentTime, top.type); + } // $FlowFixMe[cannot-write] This property should not be writable outside of this function. + + top.duration = currentTime - top.timestamp; + if (currentTimelineData) { + currentTimelineData.duration = getRelativeTime() + TIME_OFFSET; + } + } + function markCommitStarted(lanes) { + if (isProfiling) { + recordReactMeasureStarted('commit', lanes); // TODO (timeline) Re-think this approach to "batching"; I don't think it works for Suspense or pre-rendering. + // This issue applies to the User Timing data also. + + nextRenderShouldStartNewBatch = true; + } + if (supportsUserTimingV3) { + markAndClear("--commit-start-".concat(lanes)); // Some metadata only needs to be logged once per session, + // but if profiling information is being recorded via the Performance tab, + // DevTools has no way of knowing when the recording starts. + // Because of that, we log thie type of data periodically (once per commit). + + markMetadata(); + } + } + function markCommitStopped() { + if (isProfiling) { + recordReactMeasureCompleted('commit'); + recordReactMeasureCompleted('render-idle'); + } + if (supportsUserTimingV3) { + markAndClear('--commit-stop'); + } + } + function markComponentRenderStarted(fiber) { + if (isProfiling || supportsUserTimingV3) { + var componentName = getDisplayNameForFiber(fiber) || 'Unknown'; + if (isProfiling) { + // TODO (timeline) Record and cache component stack + if (isProfiling) { + currentReactComponentMeasure = { + componentName: componentName, + duration: 0, + timestamp: getRelativeTime(), + type: 'render', + warning: null + }; + } + } + if (supportsUserTimingV3) { + markAndClear("--component-render-start-".concat(componentName)); + } + } + } + function markComponentRenderStopped() { + if (isProfiling) { + if (currentReactComponentMeasure) { + if (currentTimelineData) { + currentTimelineData.componentMeasures.push(currentReactComponentMeasure); + } // $FlowFixMe[incompatible-use] found when upgrading Flow + + currentReactComponentMeasure.duration = + // $FlowFixMe[incompatible-use] found when upgrading Flow + getRelativeTime() - currentReactComponentMeasure.timestamp; + currentReactComponentMeasure = null; + } + } + if (supportsUserTimingV3) { + markAndClear('--component-render-stop'); + } + } + function markComponentLayoutEffectMountStarted(fiber) { + if (isProfiling || supportsUserTimingV3) { + var componentName = getDisplayNameForFiber(fiber) || 'Unknown'; + if (isProfiling) { + // TODO (timeline) Record and cache component stack + if (isProfiling) { + currentReactComponentMeasure = { + componentName: componentName, + duration: 0, + timestamp: getRelativeTime(), + type: 'layout-effect-mount', + warning: null + }; + } + } + if (supportsUserTimingV3) { + markAndClear("--component-layout-effect-mount-start-".concat(componentName)); + } + } + } + function markComponentLayoutEffectMountStopped() { + if (isProfiling) { + if (currentReactComponentMeasure) { + if (currentTimelineData) { + currentTimelineData.componentMeasures.push(currentReactComponentMeasure); + } // $FlowFixMe[incompatible-use] found when upgrading Flow + + currentReactComponentMeasure.duration = + // $FlowFixMe[incompatible-use] found when upgrading Flow + getRelativeTime() - currentReactComponentMeasure.timestamp; + currentReactComponentMeasure = null; + } + } + if (supportsUserTimingV3) { + markAndClear('--component-layout-effect-mount-stop'); + } + } + function markComponentLayoutEffectUnmountStarted(fiber) { + if (isProfiling || supportsUserTimingV3) { + var componentName = getDisplayNameForFiber(fiber) || 'Unknown'; + if (isProfiling) { + // TODO (timeline) Record and cache component stack + if (isProfiling) { + currentReactComponentMeasure = { + componentName: componentName, + duration: 0, + timestamp: getRelativeTime(), + type: 'layout-effect-unmount', + warning: null + }; + } + } + if (supportsUserTimingV3) { + markAndClear("--component-layout-effect-unmount-start-".concat(componentName)); + } + } + } + function markComponentLayoutEffectUnmountStopped() { + if (isProfiling) { + if (currentReactComponentMeasure) { + if (currentTimelineData) { + currentTimelineData.componentMeasures.push(currentReactComponentMeasure); + } // $FlowFixMe[incompatible-use] found when upgrading Flow + + currentReactComponentMeasure.duration = + // $FlowFixMe[incompatible-use] found when upgrading Flow + getRelativeTime() - currentReactComponentMeasure.timestamp; + currentReactComponentMeasure = null; + } + } + if (supportsUserTimingV3) { + markAndClear('--component-layout-effect-unmount-stop'); + } + } + function markComponentPassiveEffectMountStarted(fiber) { + if (isProfiling || supportsUserTimingV3) { + var componentName = getDisplayNameForFiber(fiber) || 'Unknown'; + if (isProfiling) { + // TODO (timeline) Record and cache component stack + if (isProfiling) { + currentReactComponentMeasure = { + componentName: componentName, + duration: 0, + timestamp: getRelativeTime(), + type: 'passive-effect-mount', + warning: null + }; + } + } + if (supportsUserTimingV3) { + markAndClear("--component-passive-effect-mount-start-".concat(componentName)); + } + } + } + function markComponentPassiveEffectMountStopped() { + if (isProfiling) { + if (currentReactComponentMeasure) { + if (currentTimelineData) { + currentTimelineData.componentMeasures.push(currentReactComponentMeasure); + } // $FlowFixMe[incompatible-use] found when upgrading Flow + + currentReactComponentMeasure.duration = + // $FlowFixMe[incompatible-use] found when upgrading Flow + getRelativeTime() - currentReactComponentMeasure.timestamp; + currentReactComponentMeasure = null; + } + } + if (supportsUserTimingV3) { + markAndClear('--component-passive-effect-mount-stop'); + } + } + function markComponentPassiveEffectUnmountStarted(fiber) { + if (isProfiling || supportsUserTimingV3) { + var componentName = getDisplayNameForFiber(fiber) || 'Unknown'; + if (isProfiling) { + // TODO (timeline) Record and cache component stack + if (isProfiling) { + currentReactComponentMeasure = { + componentName: componentName, + duration: 0, + timestamp: getRelativeTime(), + type: 'passive-effect-unmount', + warning: null + }; + } + } + if (supportsUserTimingV3) { + markAndClear("--component-passive-effect-unmount-start-".concat(componentName)); + } + } + } + function markComponentPassiveEffectUnmountStopped() { + if (isProfiling) { + if (currentReactComponentMeasure) { + if (currentTimelineData) { + currentTimelineData.componentMeasures.push(currentReactComponentMeasure); + } // $FlowFixMe[incompatible-use] found when upgrading Flow + + currentReactComponentMeasure.duration = + // $FlowFixMe[incompatible-use] found when upgrading Flow + getRelativeTime() - currentReactComponentMeasure.timestamp; + currentReactComponentMeasure = null; + } + } + if (supportsUserTimingV3) { + markAndClear('--component-passive-effect-unmount-stop'); + } + } + function markComponentErrored(fiber, thrownValue, lanes) { + if (isProfiling || supportsUserTimingV3) { + var componentName = getDisplayNameForFiber(fiber) || 'Unknown'; + var phase = fiber.alternate === null ? 'mount' : 'update'; + var message = ''; + if (thrownValue !== null && profilingHooks_typeof(thrownValue) === 'object' && typeof thrownValue.message === 'string') { + message = thrownValue.message; + } else if (typeof thrownValue === 'string') { + message = thrownValue; + } + if (isProfiling) { + // TODO (timeline) Record and cache component stack + if (currentTimelineData) { + currentTimelineData.thrownErrors.push({ + componentName: componentName, + message: message, + phase: phase, + timestamp: getRelativeTime(), + type: 'thrown-error' + }); + } + } + if (supportsUserTimingV3) { + markAndClear("--error-".concat(componentName, "-").concat(phase, "-").concat(message)); + } + } + } + var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // $FlowFixMe[incompatible-type]: Flow cannot handle polymorphic WeakMaps + + var wakeableIDs = new PossiblyWeakMap(); + var wakeableID = 0; + function getWakeableID(wakeable) { + if (!wakeableIDs.has(wakeable)) { + wakeableIDs.set(wakeable, wakeableID++); + } + return wakeableIDs.get(wakeable); + } + function markComponentSuspended(fiber, wakeable, lanes) { + if (isProfiling || supportsUserTimingV3) { + var eventType = wakeableIDs.has(wakeable) ? 'resuspend' : 'suspend'; + var id = getWakeableID(wakeable); + var componentName = getDisplayNameForFiber(fiber) || 'Unknown'; + var phase = fiber.alternate === null ? 'mount' : 'update'; // Following the non-standard fn.displayName convention, + // frameworks like Relay may also annotate Promises with a displayName, + // describing what operation/data the thrown Promise is related to. + // When this is available we should pass it along to the Timeline. + + var displayName = wakeable.displayName || ''; + var suspenseEvent = null; + if (isProfiling) { + // TODO (timeline) Record and cache component stack + suspenseEvent = { + componentName: componentName, + depth: 0, + duration: 0, + id: "".concat(id), + phase: phase, + promiseName: displayName, + resolution: 'unresolved', + timestamp: getRelativeTime(), + type: 'suspense', + warning: null + }; + if (currentTimelineData) { + currentTimelineData.suspenseEvents.push(suspenseEvent); + } + } + if (supportsUserTimingV3) { + markAndClear("--suspense-".concat(eventType, "-").concat(id, "-").concat(componentName, "-").concat(phase, "-").concat(lanes, "-").concat(displayName)); + } + wakeable.then(function () { + if (suspenseEvent) { + suspenseEvent.duration = getRelativeTime() - suspenseEvent.timestamp; + suspenseEvent.resolution = 'resolved'; + } + if (supportsUserTimingV3) { + markAndClear("--suspense-resolved-".concat(id, "-").concat(componentName)); + } + }, function () { + if (suspenseEvent) { + suspenseEvent.duration = getRelativeTime() - suspenseEvent.timestamp; + suspenseEvent.resolution = 'rejected'; + } + if (supportsUserTimingV3) { + markAndClear("--suspense-rejected-".concat(id, "-").concat(componentName)); + } + }); + } + } + function markLayoutEffectsStarted(lanes) { + if (isProfiling) { + recordReactMeasureStarted('layout-effects', lanes); + } + if (supportsUserTimingV3) { + markAndClear("--layout-effects-start-".concat(lanes)); + } + } + function markLayoutEffectsStopped() { + if (isProfiling) { + recordReactMeasureCompleted('layout-effects'); + } + if (supportsUserTimingV3) { + markAndClear('--layout-effects-stop'); + } + } + function markPassiveEffectsStarted(lanes) { + if (isProfiling) { + recordReactMeasureStarted('passive-effects', lanes); + } + if (supportsUserTimingV3) { + markAndClear("--passive-effects-start-".concat(lanes)); + } + } + function markPassiveEffectsStopped() { + if (isProfiling) { + recordReactMeasureCompleted('passive-effects'); + } + if (supportsUserTimingV3) { + markAndClear('--passive-effects-stop'); + } + } + function markRenderStarted(lanes) { + if (isProfiling) { + if (nextRenderShouldStartNewBatch) { + nextRenderShouldStartNewBatch = false; + currentBatchUID++; + } // If this is a new batch of work, wrap an "idle" measure around it. + // Log it before the "render" measure to preserve the stack ordering. + + if (currentReactMeasuresStack.length === 0 || currentReactMeasuresStack[currentReactMeasuresStack.length - 1].type !== 'render-idle') { + recordReactMeasureStarted('render-idle', lanes); + } + recordReactMeasureStarted('render', lanes); + } + if (supportsUserTimingV3) { + markAndClear("--render-start-".concat(lanes)); + } + } + function markRenderYielded() { + if (isProfiling) { + recordReactMeasureCompleted('render'); + } + if (supportsUserTimingV3) { + markAndClear('--render-yield'); + } + } + function markRenderStopped() { + if (isProfiling) { + recordReactMeasureCompleted('render'); + } + if (supportsUserTimingV3) { + markAndClear('--render-stop'); + } + } + function markRenderScheduled(lane) { + if (isProfiling) { + if (currentTimelineData) { + currentTimelineData.schedulingEvents.push({ + lanes: laneToLanesArray(lane), + timestamp: getRelativeTime(), + type: 'schedule-render', + warning: null + }); + } + } + if (supportsUserTimingV3) { + markAndClear("--schedule-render-".concat(lane)); + } + } + function markForceUpdateScheduled(fiber, lane) { + if (isProfiling || supportsUserTimingV3) { + var componentName = getDisplayNameForFiber(fiber) || 'Unknown'; + if (isProfiling) { + // TODO (timeline) Record and cache component stack + if (currentTimelineData) { + currentTimelineData.schedulingEvents.push({ + componentName: componentName, + lanes: laneToLanesArray(lane), + timestamp: getRelativeTime(), + type: 'schedule-force-update', + warning: null + }); + } + } + if (supportsUserTimingV3) { + markAndClear("--schedule-forced-update-".concat(lane, "-").concat(componentName)); + } + } + } + function getParentFibers(fiber) { + var parents = []; + var parent = fiber; + while (parent !== null) { + parents.push(parent); + parent = parent.return; + } + return parents; + } + function markStateUpdateScheduled(fiber, lane) { + if (isProfiling || supportsUserTimingV3) { + var componentName = getDisplayNameForFiber(fiber) || 'Unknown'; + if (isProfiling) { + // TODO (timeline) Record and cache component stack + if (currentTimelineData) { + var event = { + componentName: componentName, + // Store the parent fibers so we can post process + // them after we finish profiling + lanes: laneToLanesArray(lane), + timestamp: getRelativeTime(), + type: 'schedule-state-update', + warning: null + }; + currentFiberStacks.set(event, getParentFibers(fiber)); // $FlowFixMe[incompatible-use] found when upgrading Flow + + currentTimelineData.schedulingEvents.push(event); + } + } + if (supportsUserTimingV3) { + markAndClear("--schedule-state-update-".concat(lane, "-").concat(componentName)); + } + } + } + function toggleProfilingStatus(value) { + if (isProfiling !== value) { + isProfiling = value; + if (isProfiling) { + var internalModuleSourceToRanges = new Map(); + if (supportsUserTimingV3) { + var ranges = getInternalModuleRanges(); + if (ranges) { + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (shared_isArray(range) && range.length === 2) { + var _ranges$i2 = profilingHooks_slicedToArray(ranges[i], 2), + startStackFrame = _ranges$i2[0], + stopStackFrame = _ranges$i2[1]; + markAndClear("--react-internal-module-start-".concat(startStackFrame)); + markAndClear("--react-internal-module-stop-".concat(stopStackFrame)); + } + } + } + } + var laneToReactMeasureMap = new Map(); + var lane = 1; + for (var index = 0; index < REACT_TOTAL_NUM_LANES; index++) { + laneToReactMeasureMap.set(lane, []); + lane *= 2; + } + currentBatchUID = 0; + currentReactComponentMeasure = null; + currentReactMeasuresStack = []; + currentFiberStacks = new Map(); + currentTimelineData = { + // Session wide metadata; only collected once. + internalModuleSourceToRanges: internalModuleSourceToRanges, + laneToLabelMap: laneToLabelMap || new Map(), + reactVersion: reactVersion, + // Data logged by React during profiling session. + componentMeasures: [], + schedulingEvents: [], + suspenseEvents: [], + thrownErrors: [], + // Data inferred based on what React logs. + batchUIDToMeasuresMap: new Map(), + duration: 0, + laneToReactMeasureMap: laneToReactMeasureMap, + startTime: 0, + // Data only available in Chrome profiles. + flamechart: [], + nativeEvents: [], + networkMeasures: [], + otherUserTimingMarks: [], + snapshots: [], + snapshotHeight: 0 + }; + nextRenderShouldStartNewBatch = true; + } else { + // Postprocess Profile data + if (currentTimelineData !== null) { + currentTimelineData.schedulingEvents.forEach(function (event) { + if (event.type === 'schedule-state-update') { + // TODO(luna): We can optimize this by creating a map of + // fiber to component stack instead of generating the stack + // for every fiber every time + var fiberStack = currentFiberStacks.get(event); + if (fiberStack && currentDispatcherRef != null) { + event.componentStack = fiberStack.reduce(function (trace, fiber) { + return trace + describeFiber(workTagMap, fiber, currentDispatcherRef); + }, ''); + } + } + }); + } // Clear the current fiber stacks so we don't hold onto the fibers + // in memory after profiling finishes + + currentFiberStacks.clear(); + } + } + } + return { + getTimelineData: getTimelineData, + profilingHooks: { + markCommitStarted: markCommitStarted, + markCommitStopped: markCommitStopped, + markComponentRenderStarted: markComponentRenderStarted, + markComponentRenderStopped: markComponentRenderStopped, + markComponentPassiveEffectMountStarted: markComponentPassiveEffectMountStarted, + markComponentPassiveEffectMountStopped: markComponentPassiveEffectMountStopped, + markComponentPassiveEffectUnmountStarted: markComponentPassiveEffectUnmountStarted, + markComponentPassiveEffectUnmountStopped: markComponentPassiveEffectUnmountStopped, + markComponentLayoutEffectMountStarted: markComponentLayoutEffectMountStarted, + markComponentLayoutEffectMountStopped: markComponentLayoutEffectMountStopped, + markComponentLayoutEffectUnmountStarted: markComponentLayoutEffectUnmountStarted, + markComponentLayoutEffectUnmountStopped: markComponentLayoutEffectUnmountStopped, + markComponentErrored: markComponentErrored, + markComponentSuspended: markComponentSuspended, + markLayoutEffectsStarted: markLayoutEffectsStarted, + markLayoutEffectsStopped: markLayoutEffectsStopped, + markPassiveEffectsStarted: markPassiveEffectsStarted, + markPassiveEffectsStopped: markPassiveEffectsStopped, + markRenderStarted: markRenderStarted, + markRenderYielded: markRenderYielded, + markRenderStopped: markRenderStopped, + markRenderScheduled: markRenderScheduled, + markForceUpdateScheduled: markForceUpdateScheduled, + markStateUpdateScheduled: markStateUpdateScheduled + }, + toggleProfilingStatus: toggleProfilingStatus + }; + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/renderer.js + function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; + var target = _objectWithoutPropertiesLoose(source, excluded); + var key, i; + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; + target[key] = source[key]; + } + } + return target; + } + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + return target; + } + function renderer_ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + return keys; + } + function renderer_objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + if (i % 2) { + renderer_ownKeys(Object(source), true).forEach(function (key) { + renderer_defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + renderer_ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + return target; + } + function renderer_defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + function renderer_slicedToArray(arr, i) { + return renderer_arrayWithHoles(arr) || renderer_iterableToArrayLimit(arr, i) || renderer_unsupportedIterableToArray(arr, i) || renderer_nonIterableRest(); + } + function renderer_nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function renderer_iterableToArrayLimit(arr, i) { + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + function renderer_arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + function renderer_toConsumableArray(arr) { + return renderer_arrayWithoutHoles(arr) || renderer_iterableToArray(arr) || renderer_unsupportedIterableToArray(arr) || renderer_nonIterableSpread(); + } + function renderer_nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function renderer_iterableToArray(iter) { + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + } + function renderer_arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return renderer_arrayLikeToArray(arr); + } + function _createForOfIteratorHelper(o, allowArrayLike) { + var it; + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { + if (Array.isArray(o) || (it = renderer_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + var F = function F() {}; + return { + s: F, + n: function n() { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }, + e: function e(_e2) { + throw _e2; + }, + f: F + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var normalCompletion = true, + didErr = false, + err; + return { + s: function s() { + it = o[Symbol.iterator](); + }, + n: function n() { + var step = it.next(); + normalCompletion = step.done; + return step; + }, + e: function e(_e3) { + didErr = true; + err = _e3; + }, + f: function f() { + try { + if (!normalCompletion && it.return != null) it.return(); + } finally { + if (didErr) throw err; + } + } + }; + } + function renderer_unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return renderer_arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return renderer_arrayLikeToArray(o, minLen); + } + function renderer_arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + function renderer_typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + renderer_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + renderer_typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return renderer_typeof(obj); + } + + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + function getFiberFlags(fiber) { + // The name of this field changed from "effectTag" to "flags" + return fiber.flags !== undefined ? fiber.flags : fiber.effectTag; + } // Some environments (e.g. React Native / Hermes) don't support the performance API yet. + + var renderer_getCurrentTime = + // $FlowFixMe[method-unbinding] + (typeof performance === "undefined" ? "undefined" : renderer_typeof(performance)) === 'object' && typeof performance.now === 'function' ? function () { + return performance.now(); + } : function () { + return Date.now(); + }; + function getInternalReactConstants(version) { + // ********************************************************** + // The section below is copied from files in React repo. + // Keep it in sync, and add version guards if it changes. + // + // Technically these priority levels are invalid for versions before 16.9, + // but 16.9 is the first version to report priority level to DevTools, + // so we can avoid checking for earlier versions and support pre-16.9 canary releases in the process. + var ReactPriorityLevels = { + ImmediatePriority: 99, + UserBlockingPriority: 98, + NormalPriority: 97, + LowPriority: 96, + IdlePriority: 95, + NoPriority: 90 + }; + if (gt(version, '17.0.2')) { + ReactPriorityLevels = { + ImmediatePriority: 1, + UserBlockingPriority: 2, + NormalPriority: 3, + LowPriority: 4, + IdlePriority: 5, + NoPriority: 0 + }; + } + var StrictModeBits = 0; + if (gte(version, '18.0.0-alpha')) { + // 18+ + StrictModeBits = 24; + } else if (gte(version, '16.9.0')) { + // 16.9 - 17 + StrictModeBits = 1; + } else if (gte(version, '16.3.0')) { + // 16.3 - 16.8 + StrictModeBits = 2; + } + var ReactTypeOfWork = null; // ********************************************************** + // The section below is copied from files in React repo. + // Keep it in sync, and add version guards if it changes. + // + // TODO Update the gt() check below to be gte() whichever the next version number is. + // Currently the version in Git is 17.0.2 (but that version has not been/may not end up being released). + + if (gt(version, '17.0.1')) { + ReactTypeOfWork = { + CacheComponent: 24, + // Experimental + ClassComponent: 1, + ContextConsumer: 9, + ContextProvider: 10, + CoroutineComponent: -1, + // Removed + CoroutineHandlerPhase: -1, + // Removed + DehydratedSuspenseComponent: 18, + // Behind a flag + ForwardRef: 11, + Fragment: 7, + FunctionComponent: 0, + HostComponent: 5, + HostPortal: 4, + HostRoot: 3, + HostHoistable: 26, + // In reality, 18.2+. But doesn't hurt to include it here + HostSingleton: 27, + // Same as above + HostText: 6, + IncompleteClassComponent: 17, + IndeterminateComponent: 2, + LazyComponent: 16, + LegacyHiddenComponent: 23, + MemoComponent: 14, + Mode: 8, + OffscreenComponent: 22, + // Experimental + Profiler: 12, + ScopeComponent: 21, + // Experimental + SimpleMemoComponent: 15, + SuspenseComponent: 13, + SuspenseListComponent: 19, + // Experimental + TracingMarkerComponent: 25, + // Experimental - This is technically in 18 but we don't + // want to fork again so we're adding it here instead + YieldComponent: -1 // Removed + }; + } else if (gte(version, '17.0.0-alpha')) { + ReactTypeOfWork = { + CacheComponent: -1, + // Doesn't exist yet + ClassComponent: 1, + ContextConsumer: 9, + ContextProvider: 10, + CoroutineComponent: -1, + // Removed + CoroutineHandlerPhase: -1, + // Removed + DehydratedSuspenseComponent: 18, + // Behind a flag + ForwardRef: 11, + Fragment: 7, + FunctionComponent: 0, + HostComponent: 5, + HostPortal: 4, + HostRoot: 3, + HostHoistable: -1, + // Doesn't exist yet + HostSingleton: -1, + // Doesn't exist yet + HostText: 6, + IncompleteClassComponent: 17, + IndeterminateComponent: 2, + LazyComponent: 16, + LegacyHiddenComponent: 24, + MemoComponent: 14, + Mode: 8, + OffscreenComponent: 23, + // Experimental + Profiler: 12, + ScopeComponent: 21, + // Experimental + SimpleMemoComponent: 15, + SuspenseComponent: 13, + SuspenseListComponent: 19, + // Experimental + TracingMarkerComponent: -1, + // Doesn't exist yet + YieldComponent: -1 // Removed + }; + } else if (gte(version, '16.6.0-beta.0')) { + ReactTypeOfWork = { + CacheComponent: -1, + // Doesn't exist yet + ClassComponent: 1, + ContextConsumer: 9, + ContextProvider: 10, + CoroutineComponent: -1, + // Removed + CoroutineHandlerPhase: -1, + // Removed + DehydratedSuspenseComponent: 18, + // Behind a flag + ForwardRef: 11, + Fragment: 7, + FunctionComponent: 0, + HostComponent: 5, + HostPortal: 4, + HostRoot: 3, + HostHoistable: -1, + // Doesn't exist yet + HostSingleton: -1, + // Doesn't exist yet + HostText: 6, + IncompleteClassComponent: 17, + IndeterminateComponent: 2, + LazyComponent: 16, + LegacyHiddenComponent: -1, + MemoComponent: 14, + Mode: 8, + OffscreenComponent: -1, + // Experimental + Profiler: 12, + ScopeComponent: -1, + // Experimental + SimpleMemoComponent: 15, + SuspenseComponent: 13, + SuspenseListComponent: 19, + // Experimental + TracingMarkerComponent: -1, + // Doesn't exist yet + YieldComponent: -1 // Removed + }; + } else if (gte(version, '16.4.3-alpha')) { + ReactTypeOfWork = { + CacheComponent: -1, + // Doesn't exist yet + ClassComponent: 2, + ContextConsumer: 11, + ContextProvider: 12, + CoroutineComponent: -1, + // Removed + CoroutineHandlerPhase: -1, + // Removed + DehydratedSuspenseComponent: -1, + // Doesn't exist yet + ForwardRef: 13, + Fragment: 9, + FunctionComponent: 0, + HostComponent: 7, + HostPortal: 6, + HostRoot: 5, + HostHoistable: -1, + // Doesn't exist yet + HostSingleton: -1, + // Doesn't exist yet + HostText: 8, + IncompleteClassComponent: -1, + // Doesn't exist yet + IndeterminateComponent: 4, + LazyComponent: -1, + // Doesn't exist yet + LegacyHiddenComponent: -1, + MemoComponent: -1, + // Doesn't exist yet + Mode: 10, + OffscreenComponent: -1, + // Experimental + Profiler: 15, + ScopeComponent: -1, + // Experimental + SimpleMemoComponent: -1, + // Doesn't exist yet + SuspenseComponent: 16, + SuspenseListComponent: -1, + // Doesn't exist yet + TracingMarkerComponent: -1, + // Doesn't exist yet + YieldComponent: -1 // Removed + }; + } else { + ReactTypeOfWork = { + CacheComponent: -1, + // Doesn't exist yet + ClassComponent: 2, + ContextConsumer: 12, + ContextProvider: 13, + CoroutineComponent: 7, + CoroutineHandlerPhase: 8, + DehydratedSuspenseComponent: -1, + // Doesn't exist yet + ForwardRef: 14, + Fragment: 10, + FunctionComponent: 1, + HostComponent: 5, + HostPortal: 4, + HostRoot: 3, + HostHoistable: -1, + // Doesn't exist yet + HostSingleton: -1, + // Doesn't exist yet + HostText: 6, + IncompleteClassComponent: -1, + // Doesn't exist yet + IndeterminateComponent: 0, + LazyComponent: -1, + // Doesn't exist yet + LegacyHiddenComponent: -1, + MemoComponent: -1, + // Doesn't exist yet + Mode: 11, + OffscreenComponent: -1, + // Experimental + Profiler: 15, + ScopeComponent: -1, + // Experimental + SimpleMemoComponent: -1, + // Doesn't exist yet + SuspenseComponent: 16, + SuspenseListComponent: -1, + // Doesn't exist yet + TracingMarkerComponent: -1, + // Doesn't exist yet + YieldComponent: 9 + }; + } // ********************************************************** + // End of copied code. + // ********************************************************** + + function getTypeSymbol(type) { + var symbolOrNumber = renderer_typeof(type) === 'object' && type !== null ? type.$$typeof : type; + return renderer_typeof(symbolOrNumber) === 'symbol' ? + // $FlowFixMe[incompatible-return] `toString()` doesn't match the type signature? + symbolOrNumber.toString() : symbolOrNumber; + } + var _ReactTypeOfWork = ReactTypeOfWork, + CacheComponent = _ReactTypeOfWork.CacheComponent, + ClassComponent = _ReactTypeOfWork.ClassComponent, + IncompleteClassComponent = _ReactTypeOfWork.IncompleteClassComponent, + FunctionComponent = _ReactTypeOfWork.FunctionComponent, + IndeterminateComponent = _ReactTypeOfWork.IndeterminateComponent, + ForwardRef = _ReactTypeOfWork.ForwardRef, + HostRoot = _ReactTypeOfWork.HostRoot, + HostHoistable = _ReactTypeOfWork.HostHoistable, + HostSingleton = _ReactTypeOfWork.HostSingleton, + HostComponent = _ReactTypeOfWork.HostComponent, + HostPortal = _ReactTypeOfWork.HostPortal, + HostText = _ReactTypeOfWork.HostText, + Fragment = _ReactTypeOfWork.Fragment, + LazyComponent = _ReactTypeOfWork.LazyComponent, + LegacyHiddenComponent = _ReactTypeOfWork.LegacyHiddenComponent, + MemoComponent = _ReactTypeOfWork.MemoComponent, + OffscreenComponent = _ReactTypeOfWork.OffscreenComponent, + Profiler = _ReactTypeOfWork.Profiler, + ScopeComponent = _ReactTypeOfWork.ScopeComponent, + SimpleMemoComponent = _ReactTypeOfWork.SimpleMemoComponent, + SuspenseComponent = _ReactTypeOfWork.SuspenseComponent, + SuspenseListComponent = _ReactTypeOfWork.SuspenseListComponent, + TracingMarkerComponent = _ReactTypeOfWork.TracingMarkerComponent; + function resolveFiberType(type) { + var typeSymbol = getTypeSymbol(type); + switch (typeSymbol) { + case ReactSymbols_MEMO_NUMBER: + case ReactSymbols_MEMO_SYMBOL_STRING: + // recursively resolving memo type in case of memo(forwardRef(Component)) + return resolveFiberType(type.type); + case ReactSymbols_FORWARD_REF_NUMBER: + case ReactSymbols_FORWARD_REF_SYMBOL_STRING: + return type.render; + default: + return type; + } + } // NOTICE Keep in sync with shouldFilterFiber() and other get*ForFiber methods + + function getDisplayNameForFiber(fiber) { + var elementType = fiber.elementType, + type = fiber.type, + tag = fiber.tag; + var resolvedType = type; + if (renderer_typeof(type) === 'object' && type !== null) { + resolvedType = resolveFiberType(type); + } + var resolvedContext = null; + switch (tag) { + case CacheComponent: + return 'Cache'; + case ClassComponent: + case IncompleteClassComponent: + return getDisplayName(resolvedType); + case FunctionComponent: + case IndeterminateComponent: + return getDisplayName(resolvedType); + case ForwardRef: + return getWrappedDisplayName(elementType, resolvedType, 'ForwardRef', 'Anonymous'); + case HostRoot: + var fiberRoot = fiber.stateNode; + if (fiberRoot != null && fiberRoot._debugRootType !== null) { + return fiberRoot._debugRootType; + } + return null; + case HostComponent: + case HostSingleton: + case HostHoistable: + return type; + case HostPortal: + case HostText: + return null; + case Fragment: + return 'Fragment'; + case LazyComponent: + // This display name will not be user visible. + // Once a Lazy component loads its inner component, React replaces the tag and type. + // This display name will only show up in console logs when DevTools DEBUG mode is on. + return 'Lazy'; + case MemoComponent: + case SimpleMemoComponent: + // Display name in React does not use `Memo` as a wrapper but fallback name. + return getWrappedDisplayName(elementType, resolvedType, 'Memo', 'Anonymous'); + case SuspenseComponent: + return 'Suspense'; + case LegacyHiddenComponent: + return 'LegacyHidden'; + case OffscreenComponent: + return 'Offscreen'; + case ScopeComponent: + return 'Scope'; + case SuspenseListComponent: + return 'SuspenseList'; + case Profiler: + return 'Profiler'; + case TracingMarkerComponent: + return 'TracingMarker'; + default: + var typeSymbol = getTypeSymbol(type); + switch (typeSymbol) { + case CONCURRENT_MODE_NUMBER: + case CONCURRENT_MODE_SYMBOL_STRING: + case DEPRECATED_ASYNC_MODE_SYMBOL_STRING: + return null; + case PROVIDER_NUMBER: + case PROVIDER_SYMBOL_STRING: + // 16.3.0 exposed the context object as "context" + // PR #12501 changed it to "_context" for 16.3.1+ + // NOTE Keep in sync with inspectElementRaw() + resolvedContext = fiber.type._context || fiber.type.context; + return "".concat(resolvedContext.displayName || 'Context', ".Provider"); + case CONTEXT_NUMBER: + case CONTEXT_SYMBOL_STRING: + case SERVER_CONTEXT_SYMBOL_STRING: + // 16.3-16.5 read from "type" because the Consumer is the actual context object. + // 16.6+ should read from "type._context" because Consumer can be different (in DEV). + // NOTE Keep in sync with inspectElementRaw() + resolvedContext = fiber.type._context || fiber.type; // NOTE: TraceUpdatesBackendManager depends on the name ending in '.Consumer' + // If you change the name, figure out a more resilient way to detect it. + + return "".concat(resolvedContext.displayName || 'Context', ".Consumer"); + case STRICT_MODE_NUMBER: + case STRICT_MODE_SYMBOL_STRING: + return null; + case PROFILER_NUMBER: + case PROFILER_SYMBOL_STRING: + return "Profiler(".concat(fiber.memoizedProps.id, ")"); + case SCOPE_NUMBER: + case SCOPE_SYMBOL_STRING: + return 'Scope'; + default: + // Unknown element type. + // This may mean a new element type that has not yet been added to DevTools. + return null; + } + } + } + return { + getDisplayNameForFiber: getDisplayNameForFiber, + getTypeSymbol: getTypeSymbol, + ReactPriorityLevels: ReactPriorityLevels, + ReactTypeOfWork: ReactTypeOfWork, + StrictModeBits: StrictModeBits + }; + } // Map of one or more Fibers in a pair to their unique id number. + // We track both Fibers to support Fast Refresh, + // which may forcefully replace one of the pair as part of hot reloading. + // In that case it's still important to be able to locate the previous ID during subsequent renders. + + var fiberToIDMap = new Map(); // Map of id to one (arbitrary) Fiber in a pair. + // This Map is used to e.g. get the display name for a Fiber or schedule an update, + // operations that should be the same whether the current and work-in-progress Fiber is used. + + var idToArbitraryFiberMap = new Map(); + function attach(hook, rendererID, renderer, global) { + // Newer versions of the reconciler package also specific reconciler version. + // If that version number is present, use it. + // Third party renderer versions may not match the reconciler version, + // and the latter is what's important in terms of tags and symbols. + var version = renderer.reconcilerVersion || renderer.version; + var _getInternalReactCons = getInternalReactConstants(version), + getDisplayNameForFiber = _getInternalReactCons.getDisplayNameForFiber, + getTypeSymbol = _getInternalReactCons.getTypeSymbol, + ReactPriorityLevels = _getInternalReactCons.ReactPriorityLevels, + ReactTypeOfWork = _getInternalReactCons.ReactTypeOfWork, + StrictModeBits = _getInternalReactCons.StrictModeBits; + var CacheComponent = ReactTypeOfWork.CacheComponent, + ClassComponent = ReactTypeOfWork.ClassComponent, + ContextConsumer = ReactTypeOfWork.ContextConsumer, + DehydratedSuspenseComponent = ReactTypeOfWork.DehydratedSuspenseComponent, + ForwardRef = ReactTypeOfWork.ForwardRef, + Fragment = ReactTypeOfWork.Fragment, + FunctionComponent = ReactTypeOfWork.FunctionComponent, + HostRoot = ReactTypeOfWork.HostRoot, + HostHoistable = ReactTypeOfWork.HostHoistable, + HostSingleton = ReactTypeOfWork.HostSingleton, + HostPortal = ReactTypeOfWork.HostPortal, + HostComponent = ReactTypeOfWork.HostComponent, + HostText = ReactTypeOfWork.HostText, + IncompleteClassComponent = ReactTypeOfWork.IncompleteClassComponent, + IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, + LegacyHiddenComponent = ReactTypeOfWork.LegacyHiddenComponent, + MemoComponent = ReactTypeOfWork.MemoComponent, + OffscreenComponent = ReactTypeOfWork.OffscreenComponent, + SimpleMemoComponent = ReactTypeOfWork.SimpleMemoComponent, + SuspenseComponent = ReactTypeOfWork.SuspenseComponent, + SuspenseListComponent = ReactTypeOfWork.SuspenseListComponent, + TracingMarkerComponent = ReactTypeOfWork.TracingMarkerComponent; + var ImmediatePriority = ReactPriorityLevels.ImmediatePriority, + UserBlockingPriority = ReactPriorityLevels.UserBlockingPriority, + NormalPriority = ReactPriorityLevels.NormalPriority, + LowPriority = ReactPriorityLevels.LowPriority, + IdlePriority = ReactPriorityLevels.IdlePriority, + NoPriority = ReactPriorityLevels.NoPriority; + var getLaneLabelMap = renderer.getLaneLabelMap, + injectProfilingHooks = renderer.injectProfilingHooks, + overrideHookState = renderer.overrideHookState, + overrideHookStateDeletePath = renderer.overrideHookStateDeletePath, + overrideHookStateRenamePath = renderer.overrideHookStateRenamePath, + overrideProps = renderer.overrideProps, + overridePropsDeletePath = renderer.overridePropsDeletePath, + overridePropsRenamePath = renderer.overridePropsRenamePath, + scheduleRefresh = renderer.scheduleRefresh, + setErrorHandler = renderer.setErrorHandler, + setSuspenseHandler = renderer.setSuspenseHandler, + scheduleUpdate = renderer.scheduleUpdate; + var supportsTogglingError = typeof setErrorHandler === 'function' && typeof scheduleUpdate === 'function'; + var supportsTogglingSuspense = typeof setSuspenseHandler === 'function' && typeof scheduleUpdate === 'function'; + if (typeof scheduleRefresh === 'function') { + // When Fast Refresh updates a component, the frontend may need to purge cached information. + // For example, ASTs cached for the component (for named hooks) may no longer be valid. + // Send a signal to the frontend to purge this cached information. + // The "fastRefreshScheduled" dispatched is global (not Fiber or even Renderer specific). + // This is less effecient since it means the front-end will need to purge the entire cache, + // but this is probably an okay trade off in order to reduce coupling between the DevTools and Fast Refresh. + renderer.scheduleRefresh = function () { + try { + hook.emit('fastRefreshScheduled'); + } finally { + return scheduleRefresh.apply(void 0, arguments); + } + }; + } + var getTimelineData = null; + var toggleProfilingStatus = null; + if (typeof injectProfilingHooks === 'function') { + var response = createProfilingHooks({ + getDisplayNameForFiber: getDisplayNameForFiber, + getIsProfiling: function getIsProfiling() { + return isProfiling; + }, + getLaneLabelMap: getLaneLabelMap, + currentDispatcherRef: renderer.currentDispatcherRef, + workTagMap: ReactTypeOfWork, + reactVersion: version + }); // Pass the Profiling hooks to the reconciler for it to call during render. + + injectProfilingHooks(response.profilingHooks); // Hang onto this toggle so we can notify the external methods of profiling status changes. + + getTimelineData = response.getTimelineData; + toggleProfilingStatus = response.toggleProfilingStatus; + } // Tracks Fibers with recently changed number of error/warning messages. + // These collections store the Fiber rather than the ID, + // in order to avoid generating an ID for Fibers that never get mounted + // (due to e.g. Suspense or error boundaries). + // onErrorOrWarning() adds Fibers and recordPendingErrorsAndWarnings() later clears them. + + var fibersWithChangedErrorOrWarningCounts = new Set(); + var pendingFiberToErrorsMap = new Map(); + var pendingFiberToWarningsMap = new Map(); // Mapping of fiber IDs to error/warning messages and counts. + + var fiberIDToErrorsMap = new Map(); + var fiberIDToWarningsMap = new Map(); + function clearErrorsAndWarnings() { + // eslint-disable-next-line no-for-of-loops/no-for-of-loops + var _iterator = _createForOfIteratorHelper(fiberIDToErrorsMap.keys()), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var id = _step.value; + var _fiber = idToArbitraryFiberMap.get(id); + if (_fiber != null) { + fibersWithChangedErrorOrWarningCounts.add(_fiber); + updateMostRecentlyInspectedElementIfNecessary(id); + } + } // eslint-disable-next-line no-for-of-loops/no-for-of-loops + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + var _iterator2 = _createForOfIteratorHelper(fiberIDToWarningsMap.keys()), + _step2; + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var _id = _step2.value; + var _fiber2 = idToArbitraryFiberMap.get(_id); + if (_fiber2 != null) { + fibersWithChangedErrorOrWarningCounts.add(_fiber2); + updateMostRecentlyInspectedElementIfNecessary(_id); + } + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + fiberIDToErrorsMap.clear(); + fiberIDToWarningsMap.clear(); + flushPendingEvents(); + } + function clearMessageCountHelper(fiberID, pendingFiberToMessageCountMap, fiberIDToMessageCountMap) { + var fiber = idToArbitraryFiberMap.get(fiberID); + if (fiber != null) { + // Throw out any pending changes. + pendingFiberToErrorsMap.delete(fiber); + if (fiberIDToMessageCountMap.has(fiberID)) { + fiberIDToMessageCountMap.delete(fiberID); // If previous flushed counts have changed, schedule an update too. + + fibersWithChangedErrorOrWarningCounts.add(fiber); + flushPendingEvents(); + updateMostRecentlyInspectedElementIfNecessary(fiberID); + } else { + fibersWithChangedErrorOrWarningCounts.delete(fiber); + } + } + } + function clearErrorsForFiberID(fiberID) { + clearMessageCountHelper(fiberID, pendingFiberToErrorsMap, fiberIDToErrorsMap); + } + function clearWarningsForFiberID(fiberID) { + clearMessageCountHelper(fiberID, pendingFiberToWarningsMap, fiberIDToWarningsMap); + } + function updateMostRecentlyInspectedElementIfNecessary(fiberID) { + if (mostRecentlyInspectedElement !== null && mostRecentlyInspectedElement.id === fiberID) { + hasElementUpdatedSinceLastInspected = true; + } + } // Called when an error or warning is logged during render, commit, or passive (including unmount functions). + + function onErrorOrWarning(fiber, type, args) { + if (type === 'error') { + var maybeID = getFiberIDUnsafe(fiber); // if this is an error simulated by us to trigger error boundary, ignore + + if (maybeID != null && forceErrorForFiberIDs.get(maybeID) === true) { + return; + } + } + var message = format.apply(void 0, renderer_toConsumableArray(args)); + if (__DEBUG__) { + debug('onErrorOrWarning', fiber, null, "".concat(type, ": \"").concat(message, "\"")); + } // Mark this Fiber as needed its warning/error count updated during the next flush. + + fibersWithChangedErrorOrWarningCounts.add(fiber); // Track the warning/error for later. + + var fiberMap = type === 'error' ? pendingFiberToErrorsMap : pendingFiberToWarningsMap; + var messageMap = fiberMap.get(fiber); + if (messageMap != null) { + var count = messageMap.get(message) || 0; + messageMap.set(message, count + 1); + } else { + fiberMap.set(fiber, new Map([[message, 1]])); + } // Passive effects may trigger errors or warnings too; + // In this case, we should wait until the rest of the passive effects have run, + // but we shouldn't wait until the next commit because that might be a long time. + // This would also cause "tearing" between an inspected Component and the tree view. + // Then again we don't want to flush too soon because this could be an error during async rendering. + // Use a debounce technique to ensure that we'll eventually flush. + + flushPendingErrorsAndWarningsAfterDelay(); + } // Patching the console enables DevTools to do a few useful things: + // * Append component stacks to warnings and error messages + // * Disable logging during re-renders to inspect hooks (see inspectHooksOfFiber) + + registerRenderer(renderer, onErrorOrWarning); // The renderer interface can't read these preferences directly, + // because it is stored in localStorage within the context of the extension. + // It relies on the extension to pass the preference through via the global. + + patchConsoleUsingWindowValues(); + var debug = function debug(name, fiber, parentFiber) { + var extraString = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ''; + if (__DEBUG__) { + var displayName = fiber.tag + ':' + (getDisplayNameForFiber(fiber) || 'null'); + var maybeID = getFiberIDUnsafe(fiber) || ''; + var parentDisplayName = parentFiber ? parentFiber.tag + ':' + (getDisplayNameForFiber(parentFiber) || 'null') : ''; + var maybeParentID = parentFiber ? getFiberIDUnsafe(parentFiber) || '' : ''; + console.groupCollapsed("[renderer] %c".concat(name, " %c").concat(displayName, " (").concat(maybeID, ") %c").concat(parentFiber ? "".concat(parentDisplayName, " (").concat(maybeParentID, ")") : '', " %c").concat(extraString), 'color: red; font-weight: bold;', 'color: blue;', 'color: purple;', 'color: black;'); + console.log(new Error().stack.split('\n').slice(1).join('\n')); + console.groupEnd(); + } + }; // Configurable Components tree filters. + + var hideElementsWithDisplayNames = new Set(); + var hideElementsWithPaths = new Set(); + var hideElementsWithTypes = new Set(); // Highlight updates + + var traceUpdatesEnabled = false; + var traceUpdatesForNodes = new Set(); + function applyComponentFilters(componentFilters) { + hideElementsWithTypes.clear(); + hideElementsWithDisplayNames.clear(); + hideElementsWithPaths.clear(); + componentFilters.forEach(function (componentFilter) { + if (!componentFilter.isEnabled) { + return; + } + switch (componentFilter.type) { + case ComponentFilterDisplayName: + if (componentFilter.isValid && componentFilter.value !== '') { + hideElementsWithDisplayNames.add(new RegExp(componentFilter.value, 'i')); + } + break; + case ComponentFilterElementType: + hideElementsWithTypes.add(componentFilter.value); + break; + case ComponentFilterLocation: + if (componentFilter.isValid && componentFilter.value !== '') { + hideElementsWithPaths.add(new RegExp(componentFilter.value, 'i')); + } + break; + case ComponentFilterHOC: + hideElementsWithDisplayNames.add(new RegExp('\\(')); + break; + default: + console.warn("Invalid component filter type \"".concat(componentFilter.type, "\"")); + break; + } + }); + } // The renderer interface can't read saved component filters directly, + // because they are stored in localStorage within the context of the extension. + // Instead it relies on the extension to pass filters through. + + if (window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ != null) { + applyComponentFilters(window.__REACT_DEVTOOLS_COMPONENT_FILTERS__); + } else { + // Unfortunately this feature is not expected to work for React Native for now. + // It would be annoying for us to spam YellowBox warnings with unactionable stuff, + // so for now just skip this message... + //console.warn('⚛️ DevTools: Could not locate saved component filters'); + // Fallback to assuming the default filters in this case. + applyComponentFilters(getDefaultComponentFilters()); + } // If necessary, we can revisit optimizing this operation. + // For example, we could add a new recursive unmount tree operation. + // The unmount operations are already significantly smaller than mount operations though. + // This is something to keep in mind for later. + + function updateComponentFilters(componentFilters) { + if (isProfiling) { + // Re-mounting a tree while profiling is in progress might break a lot of assumptions. + // If necessary, we could support this- but it doesn't seem like a necessary use case. + throw Error('Cannot modify filter preferences while profiling'); + } // Recursively unmount all roots. + + hook.getFiberRoots(rendererID).forEach(function (root) { + currentRootID = getOrGenerateFiberID(root.current); // The TREE_OPERATION_REMOVE_ROOT operation serves two purposes: + // 1. It avoids sending unnecessary bridge traffic to clear a root. + // 2. It preserves Fiber IDs when remounting (below) which in turn ID to error/warning mapping. + + pushOperation(TREE_OPERATION_REMOVE_ROOT); + flushPendingEvents(root); + currentRootID = -1; + }); + applyComponentFilters(componentFilters); // Reset pseudo counters so that new path selections will be persisted. + + rootDisplayNameCounter.clear(); // Recursively re-mount all roots with new filter criteria applied. + + hook.getFiberRoots(rendererID).forEach(function (root) { + currentRootID = getOrGenerateFiberID(root.current); + setRootPseudoKey(currentRootID, root.current); + mountFiberRecursively(root.current, null, false, false); + flushPendingEvents(root); + currentRootID = -1; + }); // Also re-evaluate all error and warning counts given the new filters. + + reevaluateErrorsAndWarnings(); + flushPendingEvents(); + } // NOTICE Keep in sync with get*ForFiber methods + + function shouldFilterFiber(fiber) { + var _debugSource = fiber._debugSource, + tag = fiber.tag, + type = fiber.type, + key = fiber.key; + switch (tag) { + case DehydratedSuspenseComponent: + // TODO: ideally we would show dehydrated Suspense immediately. + // However, it has some special behavior (like disconnecting + // an alternate and turning into real Suspense) which breaks DevTools. + // For now, ignore it, and only show it once it gets hydrated. + // https://github.com/bvaughn/react-devtools-experimental/issues/197 + return true; + case HostPortal: + case HostText: + case LegacyHiddenComponent: + case OffscreenComponent: + return true; + case HostRoot: + // It is never valid to filter the root element. + return false; + case Fragment: + return key === null; + default: + var typeSymbol = getTypeSymbol(type); + switch (typeSymbol) { + case CONCURRENT_MODE_NUMBER: + case CONCURRENT_MODE_SYMBOL_STRING: + case DEPRECATED_ASYNC_MODE_SYMBOL_STRING: + case STRICT_MODE_NUMBER: + case STRICT_MODE_SYMBOL_STRING: + return true; + default: + break; + } + } + var elementType = getElementTypeForFiber(fiber); + if (hideElementsWithTypes.has(elementType)) { + return true; + } + if (hideElementsWithDisplayNames.size > 0) { + var displayName = getDisplayNameForFiber(fiber); + if (displayName != null) { + // eslint-disable-next-line no-for-of-loops/no-for-of-loops + var _iterator3 = _createForOfIteratorHelper(hideElementsWithDisplayNames), + _step3; + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + var displayNameRegExp = _step3.value; + if (displayNameRegExp.test(displayName)) { + return true; + } + } + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); + } + } + } + if (_debugSource != null && hideElementsWithPaths.size > 0) { + var fileName = _debugSource.fileName; // eslint-disable-next-line no-for-of-loops/no-for-of-loops + + var _iterator4 = _createForOfIteratorHelper(hideElementsWithPaths), + _step4; + try { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { + var pathRegExp = _step4.value; + if (pathRegExp.test(fileName)) { + return true; + } + } + } catch (err) { + _iterator4.e(err); + } finally { + _iterator4.f(); + } + } + return false; + } // NOTICE Keep in sync with shouldFilterFiber() and other get*ForFiber methods + + function getElementTypeForFiber(fiber) { + var type = fiber.type, + tag = fiber.tag; + switch (tag) { + case ClassComponent: + case IncompleteClassComponent: + return types_ElementTypeClass; + case FunctionComponent: + case IndeterminateComponent: + return types_ElementTypeFunction; + case ForwardRef: + return types_ElementTypeForwardRef; + case HostRoot: + return ElementTypeRoot; + case HostComponent: + case HostHoistable: + case HostSingleton: + return ElementTypeHostComponent; + case HostPortal: + case HostText: + case Fragment: + return ElementTypeOtherOrUnknown; + case MemoComponent: + case SimpleMemoComponent: + return types_ElementTypeMemo; + case SuspenseComponent: + return ElementTypeSuspense; + case SuspenseListComponent: + return ElementTypeSuspenseList; + case TracingMarkerComponent: + return ElementTypeTracingMarker; + default: + var typeSymbol = getTypeSymbol(type); + switch (typeSymbol) { + case CONCURRENT_MODE_NUMBER: + case CONCURRENT_MODE_SYMBOL_STRING: + case DEPRECATED_ASYNC_MODE_SYMBOL_STRING: + return ElementTypeOtherOrUnknown; + case PROVIDER_NUMBER: + case PROVIDER_SYMBOL_STRING: + return ElementTypeContext; + case CONTEXT_NUMBER: + case CONTEXT_SYMBOL_STRING: + return ElementTypeContext; + case STRICT_MODE_NUMBER: + case STRICT_MODE_SYMBOL_STRING: + return ElementTypeOtherOrUnknown; + case PROFILER_NUMBER: + case PROFILER_SYMBOL_STRING: + return ElementTypeProfiler; + default: + return ElementTypeOtherOrUnknown; + } + } + } // When profiling is supported, we store the latest tree base durations for each Fiber. + // This is so that we can quickly capture a snapshot of those values if profiling starts. + // If we didn't store these values, we'd have to crawl the tree when profiling started, + // and use a slow path to find each of the current Fibers. + + var idToTreeBaseDurationMap = new Map(); // When profiling is supported, we store the latest tree base durations for each Fiber. + // This map enables us to filter these times by root when sending them to the frontend. + + var idToRootMap = new Map(); // When a mount or update is in progress, this value tracks the root that is being operated on. + + var currentRootID = -1; // Returns the unique ID for a Fiber or generates and caches a new one if the Fiber hasn't been seen before. + // Once this method has been called for a Fiber, untrackFiberID() should always be called later to avoid leaking. + + function getOrGenerateFiberID(fiber) { + var id = null; + if (fiberToIDMap.has(fiber)) { + id = fiberToIDMap.get(fiber); + } else { + var _alternate = fiber.alternate; + if (_alternate !== null && fiberToIDMap.has(_alternate)) { + id = fiberToIDMap.get(_alternate); + } + } + var didGenerateID = false; + if (id === null) { + didGenerateID = true; + id = getUID(); + } // This refinement is for Flow purposes only. + + var refinedID = id; // Make sure we're tracking this Fiber + // e.g. if it just mounted or an error was logged during initial render. + + if (!fiberToIDMap.has(fiber)) { + fiberToIDMap.set(fiber, refinedID); + idToArbitraryFiberMap.set(refinedID, fiber); + } // Also make sure we're tracking its alternate, + // e.g. in case this is the first update after mount. + + var alternate = fiber.alternate; + if (alternate !== null) { + if (!fiberToIDMap.has(alternate)) { + fiberToIDMap.set(alternate, refinedID); + } + } + if (__DEBUG__) { + if (didGenerateID) { + debug('getOrGenerateFiberID()', fiber, fiber.return, 'Generated a new UID'); + } + } + return refinedID; + } // Returns an ID if one has already been generated for the Fiber or throws. + + function getFiberIDThrows(fiber) { + var maybeID = getFiberIDUnsafe(fiber); + if (maybeID !== null) { + return maybeID; + } + throw Error("Could not find ID for Fiber \"".concat(getDisplayNameForFiber(fiber) || '', "\"")); + } // Returns an ID if one has already been generated for the Fiber or null if one has not been generated. + // Use this method while e.g. logging to avoid over-retaining Fibers. + + function getFiberIDUnsafe(fiber) { + if (fiberToIDMap.has(fiber)) { + return fiberToIDMap.get(fiber); + } else { + var alternate = fiber.alternate; + if (alternate !== null && fiberToIDMap.has(alternate)) { + return fiberToIDMap.get(alternate); + } + } + return null; + } // Removes a Fiber (and its alternate) from the Maps used to track their id. + // This method should always be called when a Fiber is unmounting. + + function untrackFiberID(fiber) { + if (__DEBUG__) { + debug('untrackFiberID()', fiber, fiber.return, 'schedule after delay'); + } // Untrack Fibers after a slight delay in order to support a Fast Refresh edge case: + // 1. Component type is updated and Fast Refresh schedules an update+remount. + // 2. flushPendingErrorsAndWarningsAfterDelay() runs, sees the old Fiber is no longer mounted + // (it's been disconnected by Fast Refresh), and calls untrackFiberID() to clear it from the Map. + // 3. React flushes pending passive effects before it runs the next render, + // which logs an error or warning, which causes a new ID to be generated for this Fiber. + // 4. DevTools now tries to unmount the old Component with the new ID. + // + // The underlying problem here is the premature clearing of the Fiber ID, + // but DevTools has no way to detect that a given Fiber has been scheduled for Fast Refresh. + // (The "_debugNeedsRemount" flag won't necessarily be set.) + // + // The best we can do is to delay untracking by a small amount, + // and give React time to process the Fast Refresh delay. + + untrackFibersSet.add(fiber); // React may detach alternate pointers during unmount; + // Since our untracking code is async, we should explicily track the pending alternate here as well. + + var alternate = fiber.alternate; + if (alternate !== null) { + untrackFibersSet.add(alternate); + } + if (untrackFibersTimeoutID === null) { + untrackFibersTimeoutID = setTimeout(untrackFibers, 1000); + } + } + var untrackFibersSet = new Set(); + var untrackFibersTimeoutID = null; + function untrackFibers() { + if (untrackFibersTimeoutID !== null) { + clearTimeout(untrackFibersTimeoutID); + untrackFibersTimeoutID = null; + } + untrackFibersSet.forEach(function (fiber) { + var fiberID = getFiberIDUnsafe(fiber); + if (fiberID !== null) { + idToArbitraryFiberMap.delete(fiberID); // Also clear any errors/warnings associated with this fiber. + + clearErrorsForFiberID(fiberID); + clearWarningsForFiberID(fiberID); + } + fiberToIDMap.delete(fiber); + var alternate = fiber.alternate; + if (alternate !== null) { + fiberToIDMap.delete(alternate); + } + if (forceErrorForFiberIDs.has(fiberID)) { + forceErrorForFiberIDs.delete(fiberID); + if (forceErrorForFiberIDs.size === 0 && setErrorHandler != null) { + setErrorHandler(shouldErrorFiberAlwaysNull); + } + } + }); + untrackFibersSet.clear(); + } + function getChangeDescription(prevFiber, nextFiber) { + switch (getElementTypeForFiber(nextFiber)) { + case types_ElementTypeClass: + case types_ElementTypeFunction: + case types_ElementTypeMemo: + case types_ElementTypeForwardRef: + if (prevFiber === null) { + return { + context: null, + didHooksChange: false, + isFirstMount: true, + props: null, + state: null + }; + } else { + var data = { + context: getContextChangedKeys(nextFiber), + didHooksChange: false, + isFirstMount: false, + props: getChangedKeys(prevFiber.memoizedProps, nextFiber.memoizedProps), + state: getChangedKeys(prevFiber.memoizedState, nextFiber.memoizedState) + }; // Only traverse the hooks list once, depending on what info we're returning. + + var indices = getChangedHooksIndices(prevFiber.memoizedState, nextFiber.memoizedState); + data.hooks = indices; + data.didHooksChange = indices !== null && indices.length > 0; + return data; + } + default: + return null; + } + } + function updateContextsForFiber(fiber) { + switch (getElementTypeForFiber(fiber)) { + case types_ElementTypeClass: + case types_ElementTypeForwardRef: + case types_ElementTypeFunction: + case types_ElementTypeMemo: + if (idToContextsMap !== null) { + var id = getFiberIDThrows(fiber); + var contexts = getContextsForFiber(fiber); + if (contexts !== null) { + // $FlowFixMe[incompatible-use] found when upgrading Flow + idToContextsMap.set(id, contexts); + } + } + break; + default: + break; + } + } // Differentiates between a null context value and no context. + + var NO_CONTEXT = {}; + function getContextsForFiber(fiber) { + var legacyContext = NO_CONTEXT; + var modernContext = NO_CONTEXT; + switch (getElementTypeForFiber(fiber)) { + case types_ElementTypeClass: + var instance = fiber.stateNode; + if (instance != null) { + if (instance.constructor && instance.constructor.contextType != null) { + modernContext = instance.context; + } else { + legacyContext = instance.context; + if (legacyContext && Object.keys(legacyContext).length === 0) { + legacyContext = NO_CONTEXT; + } + } + } + return [legacyContext, modernContext]; + case types_ElementTypeForwardRef: + case types_ElementTypeFunction: + case types_ElementTypeMemo: + var dependencies = fiber.dependencies; + if (dependencies && dependencies.firstContext) { + modernContext = dependencies.firstContext; + } + return [legacyContext, modernContext]; + default: + return null; + } + } // Record all contexts at the time profiling is started. + // Fibers only store the current context value, + // so we need to track them separately in order to determine changed keys. + + function crawlToInitializeContextsMap(fiber) { + var id = getFiberIDUnsafe(fiber); // Not all Fibers in the subtree have mounted yet. + // For example, Offscreen (hidden) or Suspense (suspended) subtrees won't yet be tracked. + // We can safely skip these subtrees. + + if (id !== null) { + updateContextsForFiber(fiber); + var current = fiber.child; + while (current !== null) { + crawlToInitializeContextsMap(current); + current = current.sibling; + } + } + } + function getContextChangedKeys(fiber) { + if (idToContextsMap !== null) { + var id = getFiberIDThrows(fiber); // $FlowFixMe[incompatible-use] found when upgrading Flow + + var prevContexts = idToContextsMap.has(id) ? + // $FlowFixMe[incompatible-use] found when upgrading Flow + idToContextsMap.get(id) : null; + var nextContexts = getContextsForFiber(fiber); + if (prevContexts == null || nextContexts == null) { + return null; + } + var _prevContexts = renderer_slicedToArray(prevContexts, 2), + prevLegacyContext = _prevContexts[0], + prevModernContext = _prevContexts[1]; + var _nextContexts = renderer_slicedToArray(nextContexts, 2), + nextLegacyContext = _nextContexts[0], + nextModernContext = _nextContexts[1]; + switch (getElementTypeForFiber(fiber)) { + case types_ElementTypeClass: + if (prevContexts && nextContexts) { + if (nextLegacyContext !== NO_CONTEXT) { + return getChangedKeys(prevLegacyContext, nextLegacyContext); + } else if (nextModernContext !== NO_CONTEXT) { + return prevModernContext !== nextModernContext; + } + } + break; + case types_ElementTypeForwardRef: + case types_ElementTypeFunction: + case types_ElementTypeMemo: + if (nextModernContext !== NO_CONTEXT) { + var prevContext = prevModernContext; + var nextContext = nextModernContext; + while (prevContext && nextContext) { + // Note this only works for versions of React that support this key (e.v. 18+) + // For older versions, there's no good way to read the current context value after render has completed. + // This is because React maintains a stack of context values during render, + // but by the time DevTools is called, render has finished and the stack is empty. + if (!shared_objectIs(prevContext.memoizedValue, nextContext.memoizedValue)) { + return true; + } + prevContext = prevContext.next; + nextContext = nextContext.next; + } + return false; + } + break; + default: + break; + } + } + return null; + } + function isHookThatCanScheduleUpdate(hookObject) { + var queue = hookObject.queue; + if (!queue) { + return false; + } + var boundHasOwnProperty = shared_hasOwnProperty.bind(queue); // Detect the shape of useState() / useReducer() / useTransition() + // using the attributes that are unique to these hooks + // but also stable (e.g. not tied to current Lanes implementation) + // We don't check for dispatch property, because useTransition doesn't have it + + if (boundHasOwnProperty('pending')) { + return true; + } // Detect useSyncExternalStore() + + return boundHasOwnProperty('value') && boundHasOwnProperty('getSnapshot') && typeof queue.getSnapshot === 'function'; + } + function didStatefulHookChange(prev, next) { + var prevMemoizedState = prev.memoizedState; + var nextMemoizedState = next.memoizedState; + if (isHookThatCanScheduleUpdate(prev)) { + return prevMemoizedState !== nextMemoizedState; + } + return false; + } + function getChangedHooksIndices(prev, next) { + if (prev == null || next == null) { + return null; + } + var indices = []; + var index = 0; + if (next.hasOwnProperty('baseState') && next.hasOwnProperty('memoizedState') && next.hasOwnProperty('next') && next.hasOwnProperty('queue')) { + while (next !== null) { + if (didStatefulHookChange(prev, next)) { + indices.push(index); + } + next = next.next; + prev = prev.next; + index++; + } + } + return indices; + } + function getChangedKeys(prev, next) { + if (prev == null || next == null) { + return null; + } // We can't report anything meaningful for hooks changes. + + if (next.hasOwnProperty('baseState') && next.hasOwnProperty('memoizedState') && next.hasOwnProperty('next') && next.hasOwnProperty('queue')) { + return null; + } + var keys = new Set([].concat(renderer_toConsumableArray(Object.keys(prev)), renderer_toConsumableArray(Object.keys(next)))); + var changedKeys = []; // eslint-disable-next-line no-for-of-loops/no-for-of-loops + + var _iterator5 = _createForOfIteratorHelper(keys), + _step5; + try { + for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) { + var key = _step5.value; + if (prev[key] !== next[key]) { + changedKeys.push(key); + } + } + } catch (err) { + _iterator5.e(err); + } finally { + _iterator5.f(); + } + return changedKeys; + } // eslint-disable-next-line no-unused-vars + + function didFiberRender(prevFiber, nextFiber) { + switch (nextFiber.tag) { + case ClassComponent: + case FunctionComponent: + case ContextConsumer: + case MemoComponent: + case SimpleMemoComponent: + case ForwardRef: + // For types that execute user code, we check PerformedWork effect. + // We don't reflect bailouts (either referential or sCU) in DevTools. + // TODO: This flag is a leaked implementation detail. Once we start + // releasing DevTools in lockstep with React, we should import a + // function from the reconciler instead. + var PerformedWork = 1; + return (getFiberFlags(nextFiber) & PerformedWork) === PerformedWork; + // Note: ContextConsumer only gets PerformedWork effect in 16.3.3+ + // so it won't get highlighted with React 16.3.0 to 16.3.2. + + default: + // For host components and other types, we compare inputs + // to determine whether something is an update. + return prevFiber.memoizedProps !== nextFiber.memoizedProps || prevFiber.memoizedState !== nextFiber.memoizedState || prevFiber.ref !== nextFiber.ref; + } + } + var pendingOperations = []; + var pendingRealUnmountedIDs = []; + var pendingSimulatedUnmountedIDs = []; + var pendingOperationsQueue = []; + var pendingStringTable = new Map(); + var pendingStringTableLength = 0; + var pendingUnmountedRootID = null; + function pushOperation(op) { + if (false) {} + pendingOperations.push(op); + } + function shouldBailoutWithPendingOperations() { + if (isProfiling) { + if (currentCommitProfilingMetadata != null && currentCommitProfilingMetadata.durations.length > 0) { + return false; + } + } + return pendingOperations.length === 0 && pendingRealUnmountedIDs.length === 0 && pendingSimulatedUnmountedIDs.length === 0 && pendingUnmountedRootID === null; + } + function flushOrQueueOperations(operations) { + if (shouldBailoutWithPendingOperations()) { + return; + } + if (pendingOperationsQueue !== null) { + pendingOperationsQueue.push(operations); + } else { + hook.emit('operations', operations); + } + } + var flushPendingErrorsAndWarningsAfterDelayTimeoutID = null; + function clearPendingErrorsAndWarningsAfterDelay() { + if (flushPendingErrorsAndWarningsAfterDelayTimeoutID !== null) { + clearTimeout(flushPendingErrorsAndWarningsAfterDelayTimeoutID); + flushPendingErrorsAndWarningsAfterDelayTimeoutID = null; + } + } + function flushPendingErrorsAndWarningsAfterDelay() { + clearPendingErrorsAndWarningsAfterDelay(); + flushPendingErrorsAndWarningsAfterDelayTimeoutID = setTimeout(function () { + flushPendingErrorsAndWarningsAfterDelayTimeoutID = null; + if (pendingOperations.length > 0) { + // On the off chance that something else has pushed pending operations, + // we should bail on warnings; it's probably not safe to push midway. + return; + } + recordPendingErrorsAndWarnings(); + if (shouldBailoutWithPendingOperations()) { + // No warnings or errors to flush; we can bail out early here too. + return; + } // We can create a smaller operations array than flushPendingEvents() + // because we only need to flush warning and error counts. + // Only a few pieces of fixed information are required up front. + + var operations = new Array(3 + pendingOperations.length); + operations[0] = rendererID; + operations[1] = currentRootID; + operations[2] = 0; // String table size + + for (var j = 0; j < pendingOperations.length; j++) { + operations[3 + j] = pendingOperations[j]; + } + flushOrQueueOperations(operations); + pendingOperations.length = 0; + }, 1000); + } + function reevaluateErrorsAndWarnings() { + fibersWithChangedErrorOrWarningCounts.clear(); + fiberIDToErrorsMap.forEach(function (countMap, fiberID) { + var fiber = idToArbitraryFiberMap.get(fiberID); + if (fiber != null) { + fibersWithChangedErrorOrWarningCounts.add(fiber); + } + }); + fiberIDToWarningsMap.forEach(function (countMap, fiberID) { + var fiber = idToArbitraryFiberMap.get(fiberID); + if (fiber != null) { + fibersWithChangedErrorOrWarningCounts.add(fiber); + } + }); + recordPendingErrorsAndWarnings(); + } + function mergeMapsAndGetCountHelper(fiber, fiberID, pendingFiberToMessageCountMap, fiberIDToMessageCountMap) { + var newCount = 0; + var messageCountMap = fiberIDToMessageCountMap.get(fiberID); + var pendingMessageCountMap = pendingFiberToMessageCountMap.get(fiber); + if (pendingMessageCountMap != null) { + if (messageCountMap == null) { + messageCountMap = pendingMessageCountMap; + fiberIDToMessageCountMap.set(fiberID, pendingMessageCountMap); + } else { + // This Flow refinement should not be necessary and yet... + var refinedMessageCountMap = messageCountMap; + pendingMessageCountMap.forEach(function (pendingCount, message) { + var previousCount = refinedMessageCountMap.get(message) || 0; + refinedMessageCountMap.set(message, previousCount + pendingCount); + }); + } + } + if (!shouldFilterFiber(fiber)) { + if (messageCountMap != null) { + messageCountMap.forEach(function (count) { + newCount += count; + }); + } + } + pendingFiberToMessageCountMap.delete(fiber); + return newCount; + } + function recordPendingErrorsAndWarnings() { + clearPendingErrorsAndWarningsAfterDelay(); + fibersWithChangedErrorOrWarningCounts.forEach(function (fiber) { + var fiberID = getFiberIDUnsafe(fiber); + if (fiberID === null) {// Don't send updates for Fibers that didn't mount due to e.g. Suspense or an error boundary. + } else { + var errorCount = mergeMapsAndGetCountHelper(fiber, fiberID, pendingFiberToErrorsMap, fiberIDToErrorsMap); + var warningCount = mergeMapsAndGetCountHelper(fiber, fiberID, pendingFiberToWarningsMap, fiberIDToWarningsMap); + pushOperation(TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS); + pushOperation(fiberID); + pushOperation(errorCount); + pushOperation(warningCount); + } // Always clean up so that we don't leak. + + pendingFiberToErrorsMap.delete(fiber); + pendingFiberToWarningsMap.delete(fiber); + }); + fibersWithChangedErrorOrWarningCounts.clear(); + } + function flushPendingEvents(root) { + // Add any pending errors and warnings to the operations array. + // We do this just before flushing, so we can ignore errors for no-longer-mounted Fibers. + recordPendingErrorsAndWarnings(); + if (shouldBailoutWithPendingOperations()) { + // If we aren't profiling, we can just bail out here. + // No use sending an empty update over the bridge. + // + // The Profiler stores metadata for each commit and reconstructs the app tree per commit using: + // (1) an initial tree snapshot and + // (2) the operations array for each commit + // Because of this, it's important that the operations and metadata arrays align, + // So it's important not to omit even empty operations while profiling is active. + return; + } + var numUnmountIDs = pendingRealUnmountedIDs.length + pendingSimulatedUnmountedIDs.length + (pendingUnmountedRootID === null ? 0 : 1); + var operations = new Array( + // Identify which renderer this update is coming from. + 2 + + // [rendererID, rootFiberID] + // How big is the string table? + 1 + + // [stringTableLength] + // Then goes the actual string table. + pendingStringTableLength + ( + // All unmounts are batched in a single message. + // [TREE_OPERATION_REMOVE, removedIDLength, ...ids] + numUnmountIDs > 0 ? 2 + numUnmountIDs : 0) + + // Regular operations + pendingOperations.length); // Identify which renderer this update is coming from. + // This enables roots to be mapped to renderers, + // Which in turn enables fiber props, states, and hooks to be inspected. + + var i = 0; + operations[i++] = rendererID; + operations[i++] = currentRootID; // Now fill in the string table. + // [stringTableLength, str1Length, ...str1, str2Length, ...str2, ...] + + operations[i++] = pendingStringTableLength; + pendingStringTable.forEach(function (entry, stringKey) { + var encodedString = entry.encodedString; // Don't use the string length. + // It won't work for multibyte characters (like emoji). + + var length = encodedString.length; + operations[i++] = length; + for (var j = 0; j < length; j++) { + operations[i + j] = encodedString[j]; + } + i += length; + }); + if (numUnmountIDs > 0) { + // All unmounts except roots are batched in a single message. + operations[i++] = TREE_OPERATION_REMOVE; // The first number is how many unmounted IDs we're gonna send. + + operations[i++] = numUnmountIDs; // Fill in the real unmounts in the reverse order. + // They were inserted parents-first by React, but we want children-first. + // So we traverse our array backwards. + + for (var j = pendingRealUnmountedIDs.length - 1; j >= 0; j--) { + operations[i++] = pendingRealUnmountedIDs[j]; + } // Fill in the simulated unmounts (hidden Suspense subtrees) in their order. + // (We want children to go before parents.) + // They go *after* the real unmounts because we know for sure they won't be + // children of already pushed "real" IDs. If they were, we wouldn't be able + // to discover them during the traversal, as they would have been deleted. + + for (var _j = 0; _j < pendingSimulatedUnmountedIDs.length; _j++) { + operations[i + _j] = pendingSimulatedUnmountedIDs[_j]; + } + i += pendingSimulatedUnmountedIDs.length; // The root ID should always be unmounted last. + + if (pendingUnmountedRootID !== null) { + operations[i] = pendingUnmountedRootID; + i++; + } + } // Fill in the rest of the operations. + + for (var _j2 = 0; _j2 < pendingOperations.length; _j2++) { + operations[i + _j2] = pendingOperations[_j2]; + } + i += pendingOperations.length; // Let the frontend know about tree operations. + + flushOrQueueOperations(operations); // Reset all of the pending state now that we've told the frontend about it. + + pendingOperations.length = 0; + pendingRealUnmountedIDs.length = 0; + pendingSimulatedUnmountedIDs.length = 0; + pendingUnmountedRootID = null; + pendingStringTable.clear(); + pendingStringTableLength = 0; + } + function getStringID(string) { + if (string === null) { + return 0; + } + var existingEntry = pendingStringTable.get(string); + if (existingEntry !== undefined) { + return existingEntry.id; + } + var id = pendingStringTable.size + 1; + var encodedString = utfEncodeString(string); + pendingStringTable.set(string, { + encodedString: encodedString, + id: id + }); // The string table total length needs to account both for the string length, + // and for the array item that contains the length itself. + // + // Don't use string length for this table. + // It won't work for multibyte characters (like emoji). + + pendingStringTableLength += encodedString.length + 1; + return id; + } + function recordMount(fiber, parentFiber) { + var isRoot = fiber.tag === HostRoot; + var id = getOrGenerateFiberID(fiber); + if (__DEBUG__) { + debug('recordMount()', fiber, parentFiber); + } + var hasOwnerMetadata = fiber.hasOwnProperty('_debugOwner'); + var isProfilingSupported = fiber.hasOwnProperty('treeBaseDuration'); // Adding a new field here would require a bridge protocol version bump (a backwads breaking change). + // Instead let's re-purpose a pre-existing field to carry more information. + + var profilingFlags = 0; + if (isProfilingSupported) { + profilingFlags = PROFILING_FLAG_BASIC_SUPPORT; + if (typeof injectProfilingHooks === 'function') { + profilingFlags |= PROFILING_FLAG_TIMELINE_SUPPORT; + } + } + if (isRoot) { + pushOperation(TREE_OPERATION_ADD); + pushOperation(id); + pushOperation(ElementTypeRoot); + pushOperation((fiber.mode & StrictModeBits) !== 0 ? 1 : 0); + pushOperation(profilingFlags); + pushOperation(StrictModeBits !== 0 ? 1 : 0); + pushOperation(hasOwnerMetadata ? 1 : 0); + if (isProfiling) { + if (displayNamesByRootID !== null) { + displayNamesByRootID.set(id, getDisplayNameForRoot(fiber)); + } + } + } else { + var key = fiber.key; + var displayName = getDisplayNameForFiber(fiber); + var elementType = getElementTypeForFiber(fiber); + var _debugOwner = fiber._debugOwner; // Ideally we should call getFiberIDThrows() for _debugOwner, + // since owners are almost always higher in the tree (and so have already been processed), + // but in some (rare) instances reported in open source, a descendant mounts before an owner. + // Since this is a DEV only field it's probably okay to also just lazily generate and ID here if needed. + // See https://github.com/facebook/react/issues/21445 + + var ownerID = _debugOwner != null ? getOrGenerateFiberID(_debugOwner) : 0; + var parentID = parentFiber ? getFiberIDThrows(parentFiber) : 0; + var displayNameStringID = getStringID(displayName); // This check is a guard to handle a React element that has been modified + // in such a way as to bypass the default stringification of the "key" property. + + var keyString = key === null ? null : String(key); + var keyStringID = getStringID(keyString); + pushOperation(TREE_OPERATION_ADD); + pushOperation(id); + pushOperation(elementType); + pushOperation(parentID); + pushOperation(ownerID); + pushOperation(displayNameStringID); + pushOperation(keyStringID); // If this subtree has a new mode, let the frontend know. + + if ((fiber.mode & StrictModeBits) !== 0 && (parentFiber.mode & StrictModeBits) === 0) { + pushOperation(TREE_OPERATION_SET_SUBTREE_MODE); + pushOperation(id); + pushOperation(StrictMode); + } + } + if (isProfilingSupported) { + idToRootMap.set(id, currentRootID); + recordProfilingDurations(fiber); + } + } + function recordUnmount(fiber, isSimulated) { + if (__DEBUG__) { + debug('recordUnmount()', fiber, null, isSimulated ? 'unmount is simulated' : ''); + } + if (trackedPathMatchFiber !== null) { + // We're in the process of trying to restore previous selection. + // If this fiber matched but is being unmounted, there's no use trying. + // Reset the state so we don't keep holding onto it. + if (fiber === trackedPathMatchFiber || fiber === trackedPathMatchFiber.alternate) { + setTrackedPath(null); + } + } + var unsafeID = getFiberIDUnsafe(fiber); + if (unsafeID === null) { + // If we've never seen this Fiber, it might be inside of a legacy render Suspense fragment (so the store is not even aware of it). + // In that case we can just ignore it or it will cause errors later on. + // One example of this is a Lazy component that never resolves before being unmounted. + // + // This also might indicate a Fast Refresh force-remount scenario. + // + // TODO: This is fragile and can obscure actual bugs. + return; + } // Flow refinement. + + var id = unsafeID; + var isRoot = fiber.tag === HostRoot; + if (isRoot) { + // Roots must be removed only after all children (pending and simulated) have been removed. + // So we track it separately. + pendingUnmountedRootID = id; + } else if (!shouldFilterFiber(fiber)) { + // To maintain child-first ordering, + // we'll push it into one of these queues, + // and later arrange them in the correct order. + if (isSimulated) { + pendingSimulatedUnmountedIDs.push(id); + } else { + pendingRealUnmountedIDs.push(id); + } + } + if (!fiber._debugNeedsRemount) { + untrackFiberID(fiber); + var isProfilingSupported = fiber.hasOwnProperty('treeBaseDuration'); + if (isProfilingSupported) { + idToRootMap.delete(id); + idToTreeBaseDurationMap.delete(id); + } + } + } + function mountFiberRecursively(firstChild, parentFiber, traverseSiblings, traceNearestHostComponentUpdate) { + // Iterate over siblings rather than recursing. + // This reduces the chance of stack overflow for wide trees (e.g. lists with many items). + var fiber = firstChild; + while (fiber !== null) { + // Generate an ID even for filtered Fibers, in case it's needed later (e.g. for Profiling). + getOrGenerateFiberID(fiber); + if (__DEBUG__) { + debug('mountFiberRecursively()', fiber, parentFiber); + } // If we have the tree selection from previous reload, try to match this Fiber. + // Also remember whether to do the same for siblings. + + var mightSiblingsBeOnTrackedPath = updateTrackedPathStateBeforeMount(fiber); + var shouldIncludeInTree = !shouldFilterFiber(fiber); + if (shouldIncludeInTree) { + recordMount(fiber, parentFiber); + } + if (traceUpdatesEnabled) { + if (traceNearestHostComponentUpdate) { + var elementType = getElementTypeForFiber(fiber); // If an ancestor updated, we should mark the nearest host nodes for highlighting. + + if (elementType === ElementTypeHostComponent) { + traceUpdatesForNodes.add(fiber.stateNode); + traceNearestHostComponentUpdate = false; + } + } // We intentionally do not re-enable the traceNearestHostComponentUpdate flag in this branch, + // because we don't want to highlight every host node inside of a newly mounted subtree. + } + var isSuspense = fiber.tag === ReactTypeOfWork.SuspenseComponent; + if (isSuspense) { + var isTimedOut = fiber.memoizedState !== null; + if (isTimedOut) { + // Special case: if Suspense mounts in a timed-out state, + // get the fallback child from the inner fragment and mount + // it as if it was our own child. Updates handle this too. + var primaryChildFragment = fiber.child; + var fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null; + var fallbackChild = fallbackChildFragment ? fallbackChildFragment.child : null; + if (fallbackChild !== null) { + mountFiberRecursively(fallbackChild, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate); + } + } else { + var primaryChild = null; + var areSuspenseChildrenConditionallyWrapped = OffscreenComponent === -1; + if (areSuspenseChildrenConditionallyWrapped) { + primaryChild = fiber.child; + } else if (fiber.child !== null) { + primaryChild = fiber.child.child; + } + if (primaryChild !== null) { + mountFiberRecursively(primaryChild, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate); + } + } + } else { + if (fiber.child !== null) { + mountFiberRecursively(fiber.child, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate); + } + } // We're exiting this Fiber now, and entering its siblings. + // If we have selection to restore, we might need to re-activate tracking. + + updateTrackedPathStateAfterMount(mightSiblingsBeOnTrackedPath); + fiber = traverseSiblings ? fiber.sibling : null; + } + } // We use this to simulate unmounting for Suspense trees + // when we switch from primary to fallback. + + function unmountFiberChildrenRecursively(fiber) { + if (__DEBUG__) { + debug('unmountFiberChildrenRecursively()', fiber); + } // We might meet a nested Suspense on our way. + + var isTimedOutSuspense = fiber.tag === ReactTypeOfWork.SuspenseComponent && fiber.memoizedState !== null; + var child = fiber.child; + if (isTimedOutSuspense) { + // If it's showing fallback tree, let's traverse it instead. + var primaryChildFragment = fiber.child; + var fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null; // Skip over to the real Fiber child. + + child = fallbackChildFragment ? fallbackChildFragment.child : null; + } + while (child !== null) { + // Record simulated unmounts children-first. + // We skip nodes without return because those are real unmounts. + if (child.return !== null) { + unmountFiberChildrenRecursively(child); + recordUnmount(child, true); + } + child = child.sibling; + } + } + function recordProfilingDurations(fiber) { + var id = getFiberIDThrows(fiber); + var actualDuration = fiber.actualDuration, + treeBaseDuration = fiber.treeBaseDuration; + idToTreeBaseDurationMap.set(id, treeBaseDuration || 0); + if (isProfiling) { + var alternate = fiber.alternate; // It's important to update treeBaseDuration even if the current Fiber did not render, + // because it's possible that one of its descendants did. + + if (alternate == null || treeBaseDuration !== alternate.treeBaseDuration) { + // Tree base duration updates are included in the operations typed array. + // So we have to convert them from milliseconds to microseconds so we can send them as ints. + var convertedTreeBaseDuration = Math.floor((treeBaseDuration || 0) * 1000); + pushOperation(TREE_OPERATION_UPDATE_TREE_BASE_DURATION); + pushOperation(id); + pushOperation(convertedTreeBaseDuration); + } + if (alternate == null || didFiberRender(alternate, fiber)) { + if (actualDuration != null) { + // The actual duration reported by React includes time spent working on children. + // This is useful information, but it's also useful to be able to exclude child durations. + // The frontend can't compute this, since the immediate children may have been filtered out. + // So we need to do this on the backend. + // Note that this calculated self duration is not the same thing as the base duration. + // The two are calculated differently (tree duration does not accumulate). + var selfDuration = actualDuration; + var child = fiber.child; + while (child !== null) { + selfDuration -= child.actualDuration || 0; + child = child.sibling; + } // If profiling is active, store durations for elements that were rendered during the commit. + // Note that we should do this for any fiber we performed work on, regardless of its actualDuration value. + // In some cases actualDuration might be 0 for fibers we worked on (particularly if we're using Date.now) + // In other cases (e.g. Memo) actualDuration might be greater than 0 even if we "bailed out". + + var metadata = currentCommitProfilingMetadata; + metadata.durations.push(id, actualDuration, selfDuration); + metadata.maxActualDuration = Math.max(metadata.maxActualDuration, actualDuration); + if (recordChangeDescriptions) { + var changeDescription = getChangeDescription(alternate, fiber); + if (changeDescription !== null) { + if (metadata.changeDescriptions !== null) { + metadata.changeDescriptions.set(id, changeDescription); + } + } + updateContextsForFiber(fiber); + } + } + } + } + } + function recordResetChildren(fiber, childSet) { + if (__DEBUG__) { + debug('recordResetChildren()', childSet, fiber); + } // The frontend only really cares about the displayName, key, and children. + // The first two don't really change, so we are only concerned with the order of children here. + // This is trickier than a simple comparison though, since certain types of fibers are filtered. + + var nextChildren = []; // This is a naive implementation that shallowly recourses children. + // We might want to revisit this if it proves to be too inefficient. + + var child = childSet; + while (child !== null) { + findReorderedChildrenRecursively(child, nextChildren); + child = child.sibling; + } + var numChildren = nextChildren.length; + if (numChildren < 2) { + // No need to reorder. + return; + } + pushOperation(TREE_OPERATION_REORDER_CHILDREN); + pushOperation(getFiberIDThrows(fiber)); + pushOperation(numChildren); + for (var i = 0; i < nextChildren.length; i++) { + pushOperation(nextChildren[i]); + } + } + function findReorderedChildrenRecursively(fiber, nextChildren) { + if (!shouldFilterFiber(fiber)) { + nextChildren.push(getFiberIDThrows(fiber)); + } else { + var child = fiber.child; + var isTimedOutSuspense = fiber.tag === SuspenseComponent && fiber.memoizedState !== null; + if (isTimedOutSuspense) { + // Special case: if Suspense mounts in a timed-out state, + // get the fallback child from the inner fragment, + // and skip over the primary child. + var primaryChildFragment = fiber.child; + var fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null; + var fallbackChild = fallbackChildFragment ? fallbackChildFragment.child : null; + if (fallbackChild !== null) { + child = fallbackChild; + } + } + while (child !== null) { + findReorderedChildrenRecursively(child, nextChildren); + child = child.sibling; + } + } + } // Returns whether closest unfiltered fiber parent needs to reset its child list. + + function updateFiberRecursively(nextFiber, prevFiber, parentFiber, traceNearestHostComponentUpdate) { + var id = getOrGenerateFiberID(nextFiber); + if (__DEBUG__) { + debug('updateFiberRecursively()', nextFiber, parentFiber); + } + if (traceUpdatesEnabled) { + var elementType = getElementTypeForFiber(nextFiber); + if (traceNearestHostComponentUpdate) { + // If an ancestor updated, we should mark the nearest host nodes for highlighting. + if (elementType === ElementTypeHostComponent) { + traceUpdatesForNodes.add(nextFiber.stateNode); + traceNearestHostComponentUpdate = false; + } + } else { + if (elementType === types_ElementTypeFunction || elementType === types_ElementTypeClass || elementType === ElementTypeContext || elementType === types_ElementTypeMemo || elementType === types_ElementTypeForwardRef) { + // Otherwise if this is a traced ancestor, flag for the nearest host descendant(s). + traceNearestHostComponentUpdate = didFiberRender(prevFiber, nextFiber); + } + } + } + if (mostRecentlyInspectedElement !== null && mostRecentlyInspectedElement.id === id && didFiberRender(prevFiber, nextFiber)) { + // If this Fiber has updated, clear cached inspected data. + // If it is inspected again, it may need to be re-run to obtain updated hooks values. + hasElementUpdatedSinceLastInspected = true; + } + var shouldIncludeInTree = !shouldFilterFiber(nextFiber); + var isSuspense = nextFiber.tag === SuspenseComponent; + var shouldResetChildren = false; // The behavior of timed-out Suspense trees is unique. + // Rather than unmount the timed out content (and possibly lose important state), + // React re-parents this content within a hidden Fragment while the fallback is showing. + // This behavior doesn't need to be observable in the DevTools though. + // It might even result in a bad user experience for e.g. node selection in the Elements panel. + // The easiest fix is to strip out the intermediate Fragment fibers, + // so the Elements panel and Profiler don't need to special case them. + // Suspense components only have a non-null memoizedState if they're timed-out. + + var prevDidTimeout = isSuspense && prevFiber.memoizedState !== null; + var nextDidTimeOut = isSuspense && nextFiber.memoizedState !== null; // The logic below is inspired by the code paths in updateSuspenseComponent() + // inside ReactFiberBeginWork in the React source code. + + if (prevDidTimeout && nextDidTimeOut) { + // Fallback -> Fallback: + // 1. Reconcile fallback set. + var nextFiberChild = nextFiber.child; + var nextFallbackChildSet = nextFiberChild ? nextFiberChild.sibling : null; // Note: We can't use nextFiber.child.sibling.alternate + // because the set is special and alternate may not exist. + + var prevFiberChild = prevFiber.child; + var prevFallbackChildSet = prevFiberChild ? prevFiberChild.sibling : null; + if (prevFallbackChildSet == null && nextFallbackChildSet != null) { + mountFiberRecursively(nextFallbackChildSet, shouldIncludeInTree ? nextFiber : parentFiber, true, traceNearestHostComponentUpdate); + shouldResetChildren = true; + } + if (nextFallbackChildSet != null && prevFallbackChildSet != null && updateFiberRecursively(nextFallbackChildSet, prevFallbackChildSet, nextFiber, traceNearestHostComponentUpdate)) { + shouldResetChildren = true; + } + } else if (prevDidTimeout && !nextDidTimeOut) { + // Fallback -> Primary: + // 1. Unmount fallback set + // Note: don't emulate fallback unmount because React actually did it. + // 2. Mount primary set + var nextPrimaryChildSet = nextFiber.child; + if (nextPrimaryChildSet !== null) { + mountFiberRecursively(nextPrimaryChildSet, shouldIncludeInTree ? nextFiber : parentFiber, true, traceNearestHostComponentUpdate); + } + shouldResetChildren = true; + } else if (!prevDidTimeout && nextDidTimeOut) { + // Primary -> Fallback: + // 1. Hide primary set + // This is not a real unmount, so it won't get reported by React. + // We need to manually walk the previous tree and record unmounts. + unmountFiberChildrenRecursively(prevFiber); // 2. Mount fallback set + + var _nextFiberChild = nextFiber.child; + var _nextFallbackChildSet = _nextFiberChild ? _nextFiberChild.sibling : null; + if (_nextFallbackChildSet != null) { + mountFiberRecursively(_nextFallbackChildSet, shouldIncludeInTree ? nextFiber : parentFiber, true, traceNearestHostComponentUpdate); + shouldResetChildren = true; + } + } else { + // Common case: Primary -> Primary. + // This is the same code path as for non-Suspense fibers. + if (nextFiber.child !== prevFiber.child) { + // If the first child is different, we need to traverse them. + // Each next child will be either a new child (mount) or an alternate (update). + var nextChild = nextFiber.child; + var prevChildAtSameIndex = prevFiber.child; + while (nextChild) { + // We already know children will be referentially different because + // they are either new mounts or alternates of previous children. + // Schedule updates and mounts depending on whether alternates exist. + // We don't track deletions here because they are reported separately. + if (nextChild.alternate) { + var prevChild = nextChild.alternate; + if (updateFiberRecursively(nextChild, prevChild, shouldIncludeInTree ? nextFiber : parentFiber, traceNearestHostComponentUpdate)) { + // If a nested tree child order changed but it can't handle its own + // child order invalidation (e.g. because it's filtered out like host nodes), + // propagate the need to reset child order upwards to this Fiber. + shouldResetChildren = true; + } // However we also keep track if the order of the children matches + // the previous order. They are always different referentially, but + // if the instances line up conceptually we'll want to know that. + + if (prevChild !== prevChildAtSameIndex) { + shouldResetChildren = true; + } + } else { + mountFiberRecursively(nextChild, shouldIncludeInTree ? nextFiber : parentFiber, false, traceNearestHostComponentUpdate); + shouldResetChildren = true; + } // Try the next child. + + nextChild = nextChild.sibling; // Advance the pointer in the previous list so that we can + // keep comparing if they line up. + + if (!shouldResetChildren && prevChildAtSameIndex !== null) { + prevChildAtSameIndex = prevChildAtSameIndex.sibling; + } + } // If we have no more children, but used to, they don't line up. + + if (prevChildAtSameIndex !== null) { + shouldResetChildren = true; + } + } else { + if (traceUpdatesEnabled) { + // If we're tracing updates and we've bailed out before reaching a host node, + // we should fall back to recursively marking the nearest host descendants for highlight. + if (traceNearestHostComponentUpdate) { + var hostFibers = findAllCurrentHostFibers(getFiberIDThrows(nextFiber)); + hostFibers.forEach(function (hostFiber) { + traceUpdatesForNodes.add(hostFiber.stateNode); + }); + } + } + } + } + if (shouldIncludeInTree) { + var isProfilingSupported = nextFiber.hasOwnProperty('treeBaseDuration'); + if (isProfilingSupported) { + recordProfilingDurations(nextFiber); + } + } + if (shouldResetChildren) { + // We need to crawl the subtree for closest non-filtered Fibers + // so that we can display them in a flat children set. + if (shouldIncludeInTree) { + // Normally, search for children from the rendered child. + var nextChildSet = nextFiber.child; + if (nextDidTimeOut) { + // Special case: timed-out Suspense renders the fallback set. + var _nextFiberChild2 = nextFiber.child; + nextChildSet = _nextFiberChild2 ? _nextFiberChild2.sibling : null; + } + if (nextChildSet != null) { + recordResetChildren(nextFiber, nextChildSet); + } // We've handled the child order change for this Fiber. + // Since it's included, there's no need to invalidate parent child order. + + return false; + } else { + // Let the closest unfiltered parent Fiber reset its child order instead. + return true; + } + } else { + return false; + } + } + function cleanup() {// We don't patch any methods so there is no cleanup. + } + function rootSupportsProfiling(root) { + if (root.memoizedInteractions != null) { + // v16 builds include this field for the scheduler/tracing API. + return true; + } else if (root.current != null && root.current.hasOwnProperty('treeBaseDuration')) { + // The scheduler/tracing API was removed in v17 though + // so we need to check a non-root Fiber. + return true; + } else { + return false; + } + } + function flushInitialOperations() { + var localPendingOperationsQueue = pendingOperationsQueue; + pendingOperationsQueue = null; + if (localPendingOperationsQueue !== null && localPendingOperationsQueue.length > 0) { + // We may have already queued up some operations before the frontend connected + // If so, let the frontend know about them. + localPendingOperationsQueue.forEach(function (operations) { + hook.emit('operations', operations); + }); + } else { + // Before the traversals, remember to start tracking + // our path in case we have selection to restore. + if (trackedPath !== null) { + mightBeOnTrackedPath = true; + } // If we have not been profiling, then we can just walk the tree and build up its current state as-is. + + hook.getFiberRoots(rendererID).forEach(function (root) { + currentRootID = getOrGenerateFiberID(root.current); + setRootPseudoKey(currentRootID, root.current); // Handle multi-renderer edge-case where only some v16 renderers support profiling. + + if (isProfiling && rootSupportsProfiling(root)) { + // If profiling is active, store commit time and duration. + // The frontend may request this information after profiling has stopped. + currentCommitProfilingMetadata = { + changeDescriptions: recordChangeDescriptions ? new Map() : null, + durations: [], + commitTime: renderer_getCurrentTime() - profilingStartTime, + maxActualDuration: 0, + priorityLevel: null, + updaters: getUpdatersList(root), + effectDuration: null, + passiveEffectDuration: null + }; + } + mountFiberRecursively(root.current, null, false, false); + flushPendingEvents(root); + currentRootID = -1; + }); + } + } + function getUpdatersList(root) { + return root.memoizedUpdaters != null ? Array.from(root.memoizedUpdaters).filter(function (fiber) { + return getFiberIDUnsafe(fiber) !== null; + }).map(fiberToSerializedElement) : null; + } + function handleCommitFiberUnmount(fiber) { + // If the untrackFiberSet already has the unmounted Fiber, this means we've already + // recordedUnmount, so we don't need to do it again. If we don't do this, we might + // end up double-deleting Fibers in some cases (like Legacy Suspense). + if (!untrackFibersSet.has(fiber)) { + // This is not recursive. + // We can't traverse fibers after unmounting so instead + // we rely on React telling us about each unmount. + recordUnmount(fiber, false); + } + } + function handlePostCommitFiberRoot(root) { + if (isProfiling && rootSupportsProfiling(root)) { + if (currentCommitProfilingMetadata !== null) { + var _getEffectDurations = getEffectDurations(root), + effectDuration = _getEffectDurations.effectDuration, + passiveEffectDuration = _getEffectDurations.passiveEffectDuration; // $FlowFixMe[incompatible-use] found when upgrading Flow + + currentCommitProfilingMetadata.effectDuration = effectDuration; // $FlowFixMe[incompatible-use] found when upgrading Flow + + currentCommitProfilingMetadata.passiveEffectDuration = passiveEffectDuration; + } + } + } + function handleCommitFiberRoot(root, priorityLevel) { + var current = root.current; + var alternate = current.alternate; // Flush any pending Fibers that we are untracking before processing the new commit. + // If we don't do this, we might end up double-deleting Fibers in some cases (like Legacy Suspense). + + untrackFibers(); + currentRootID = getOrGenerateFiberID(current); // Before the traversals, remember to start tracking + // our path in case we have selection to restore. + + if (trackedPath !== null) { + mightBeOnTrackedPath = true; + } + if (traceUpdatesEnabled) { + traceUpdatesForNodes.clear(); + } // Handle multi-renderer edge-case where only some v16 renderers support profiling. + + var isProfilingSupported = rootSupportsProfiling(root); + if (isProfiling && isProfilingSupported) { + // If profiling is active, store commit time and duration. + // The frontend may request this information after profiling has stopped. + currentCommitProfilingMetadata = { + changeDescriptions: recordChangeDescriptions ? new Map() : null, + durations: [], + commitTime: renderer_getCurrentTime() - profilingStartTime, + maxActualDuration: 0, + priorityLevel: priorityLevel == null ? null : formatPriorityLevel(priorityLevel), + updaters: getUpdatersList(root), + // Initialize to null; if new enough React version is running, + // these values will be read during separate handlePostCommitFiberRoot() call. + effectDuration: null, + passiveEffectDuration: null + }; + } + if (alternate) { + // TODO: relying on this seems a bit fishy. + var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null && + // A dehydrated root is not considered mounted + alternate.memoizedState.isDehydrated !== true; + var isMounted = current.memoizedState != null && current.memoizedState.element != null && + // A dehydrated root is not considered mounted + current.memoizedState.isDehydrated !== true; + if (!wasMounted && isMounted) { + // Mount a new root. + setRootPseudoKey(currentRootID, current); + mountFiberRecursively(current, null, false, false); + } else if (wasMounted && isMounted) { + // Update an existing root. + updateFiberRecursively(current, alternate, null, false); + } else if (wasMounted && !isMounted) { + // Unmount an existing root. + removeRootPseudoKey(currentRootID); + recordUnmount(current, false); + } + } else { + // Mount a new root. + setRootPseudoKey(currentRootID, current); + mountFiberRecursively(current, null, false, false); + } + if (isProfiling && isProfilingSupported) { + if (!shouldBailoutWithPendingOperations()) { + var commitProfilingMetadata = rootToCommitProfilingMetadataMap.get(currentRootID); + if (commitProfilingMetadata != null) { + commitProfilingMetadata.push(currentCommitProfilingMetadata); + } else { + rootToCommitProfilingMetadataMap.set(currentRootID, [currentCommitProfilingMetadata]); + } + } + } // We're done here. + + flushPendingEvents(root); + if (traceUpdatesEnabled) { + hook.emit('traceUpdates', traceUpdatesForNodes); + } + currentRootID = -1; + } + function findAllCurrentHostFibers(id) { + var fibers = []; + var fiber = findCurrentFiberUsingSlowPathById(id); + if (!fiber) { + return fibers; + } // Next we'll drill down this component to find all HostComponent/Text. + + var node = fiber; + while (true) { + if (node.tag === HostComponent || node.tag === HostText) { + fibers.push(node); + } else if (node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === fiber) { + return fibers; + } + while (!node.sibling) { + if (!node.return || node.return === fiber) { + return fibers; + } + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } // Flow needs the return here, but ESLint complains about it. + // eslint-disable-next-line no-unreachable + + return fibers; + } + function findNativeNodesForFiberID(id) { + try { + var _fiber3 = findCurrentFiberUsingSlowPathById(id); + if (_fiber3 === null) { + return null; + } + var hostFibers = findAllCurrentHostFibers(id); + return hostFibers.map(function (hostFiber) { + return hostFiber.stateNode; + }).filter(Boolean); + } catch (err) { + // The fiber might have unmounted by now. + return null; + } + } + function getDisplayNameForFiberID(id) { + var fiber = idToArbitraryFiberMap.get(id); + return fiber != null ? getDisplayNameForFiber(fiber) : null; + } + function getFiberForNative(hostInstance) { + return renderer.findFiberByHostInstance(hostInstance); + } + function getFiberIDForNative(hostInstance) { + var findNearestUnfilteredAncestor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var fiber = renderer.findFiberByHostInstance(hostInstance); + if (fiber != null) { + if (findNearestUnfilteredAncestor) { + while (fiber !== null && shouldFilterFiber(fiber)) { + fiber = fiber.return; + } + } + return getFiberIDThrows(fiber); + } + return null; + } // This function is copied from React and should be kept in sync: + // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js + + function assertIsMounted(fiber) { + if (getNearestMountedFiber(fiber) !== fiber) { + throw new Error('Unable to find node on an unmounted component.'); + } + } // This function is copied from React and should be kept in sync: + // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js + + function getNearestMountedFiber(fiber) { + var node = fiber; + var nearestMounted = fiber; + if (!fiber.alternate) { + // If there is no alternate, this might be a new tree that isn't inserted + // yet. If it is, then it will have a pending insertion effect on it. + var nextNode = node; + do { + node = nextNode; // TODO: This function, and these flags, are a leaked implementation + // detail. Once we start releasing DevTools in lockstep with React, we + // should import a function from the reconciler instead. + + var Placement = 2; + var Hydrating = 4096; + if ((node.flags & (Placement | Hydrating)) !== 0) { + // This is an insertion or in-progress hydration. The nearest possible + // mounted fiber is the parent but we need to continue to figure out + // if that one is still mounted. + nearestMounted = node.return; + } // $FlowFixMe[incompatible-type] we bail out when we get a null + + nextNode = node.return; + } while (nextNode); + } else { + while (node.return) { + node = node.return; + } + } + if (node.tag === HostRoot) { + // TODO: Check if this was a nested HostRoot when used with + // renderContainerIntoSubtree. + return nearestMounted; + } // If we didn't hit the root, that means that we're in an disconnected tree + // that has been unmounted. + + return null; + } // This function is copied from React and should be kept in sync: + // https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberTreeReflection.js + // It would be nice if we updated React to inject this function directly (vs just indirectly via findDOMNode). + // BEGIN copied code + + function findCurrentFiberUsingSlowPathById(id) { + var fiber = idToArbitraryFiberMap.get(id); + if (fiber == null) { + console.warn("Could not find Fiber with id \"".concat(id, "\"")); + return null; + } + var alternate = fiber.alternate; + if (!alternate) { + // If there is no alternate, then we only need to check if it is mounted. + var nearestMounted = getNearestMountedFiber(fiber); + if (nearestMounted === null) { + throw new Error('Unable to find node on an unmounted component.'); + } + if (nearestMounted !== fiber) { + return null; + } + return fiber; + } // If we have two possible branches, we'll walk backwards up to the root + // to see what path the root points to. On the way we may hit one of the + // special cases and we'll deal with them. + + var a = fiber; + var b = alternate; + while (true) { + var parentA = a.return; + if (parentA === null) { + // We're at the root. + break; + } + var parentB = parentA.alternate; + if (parentB === null) { + // There is no alternate. This is an unusual case. Currently, it only + // happens when a Suspense component is hidden. An extra fragment fiber + // is inserted in between the Suspense fiber and its children. Skip + // over this extra fragment fiber and proceed to the next parent. + var nextParent = parentA.return; + if (nextParent !== null) { + a = b = nextParent; + continue; + } // If there's no parent, we're at the root. + + break; + } // If both copies of the parent fiber point to the same child, we can + // assume that the child is current. This happens when we bailout on low + // priority: the bailed out fiber's child reuses the current child. + + if (parentA.child === parentB.child) { + var child = parentA.child; + while (child) { + if (child === a) { + // We've determined that A is the current branch. + assertIsMounted(parentA); + return fiber; + } + if (child === b) { + // We've determined that B is the current branch. + assertIsMounted(parentA); + return alternate; + } + child = child.sibling; + } // We should never have an alternate for any mounting node. So the only + // way this could possibly happen is if this was unmounted, if at all. + + throw new Error('Unable to find node on an unmounted component.'); + } + if (a.return !== b.return) { + // The return pointer of A and the return pointer of B point to different + // fibers. We assume that return pointers never criss-cross, so A must + // belong to the child set of A.return, and B must belong to the child + // set of B.return. + a = parentA; + b = parentB; + } else { + // The return pointers point to the same fiber. We'll have to use the + // default, slow path: scan the child sets of each parent alternate to see + // which child belongs to which set. + // + // Search parent A's child set + var didFindChild = false; + var _child = parentA.child; + while (_child) { + if (_child === a) { + didFindChild = true; + a = parentA; + b = parentB; + break; + } + if (_child === b) { + didFindChild = true; + b = parentA; + a = parentB; + break; + } + _child = _child.sibling; + } + if (!didFindChild) { + // Search parent B's child set + _child = parentB.child; + while (_child) { + if (_child === a) { + didFindChild = true; + a = parentB; + b = parentA; + break; + } + if (_child === b) { + didFindChild = true; + b = parentB; + a = parentA; + break; + } + _child = _child.sibling; + } + if (!didFindChild) { + throw new 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 new Error("Return fibers should always be each others' alternates. " + 'This error is likely caused by a bug in React. Please file an issue.'); + } + } // If the root is not a host container, we're in a disconnected tree. I.e. + // unmounted. + + if (a.tag !== HostRoot) { + throw new Error('Unable to find node on an unmounted component.'); + } + if (a.stateNode.current === a) { + // We've determined that A is the current branch. + return fiber; + } // Otherwise B has to be current branch. + + return alternate; + } // END copied code + + function prepareViewAttributeSource(id, path) { + if (isMostRecentlyInspectedElement(id)) { + window.$attribute = utils_getInObject(mostRecentlyInspectedElement, path); + } + } + function prepareViewElementSource(id) { + var fiber = idToArbitraryFiberMap.get(id); + if (fiber == null) { + console.warn("Could not find Fiber with id \"".concat(id, "\"")); + return; + } + var elementType = fiber.elementType, + tag = fiber.tag, + type = fiber.type; + switch (tag) { + case ClassComponent: + case IncompleteClassComponent: + case IndeterminateComponent: + case FunctionComponent: + global.$type = type; + break; + case ForwardRef: + global.$type = type.render; + break; + case MemoComponent: + case SimpleMemoComponent: + global.$type = elementType != null && elementType.type != null ? elementType.type : type; + break; + default: + global.$type = null; + break; + } + } + function fiberToSerializedElement(fiber) { + return { + displayName: getDisplayNameForFiber(fiber) || 'Anonymous', + id: getFiberIDThrows(fiber), + key: fiber.key, + type: getElementTypeForFiber(fiber) + }; + } + function getOwnersList(id) { + var fiber = findCurrentFiberUsingSlowPathById(id); + if (fiber == null) { + return null; + } + var _debugOwner = fiber._debugOwner; + var owners = [fiberToSerializedElement(fiber)]; + if (_debugOwner) { + var owner = _debugOwner; + while (owner !== null) { + owners.unshift(fiberToSerializedElement(owner)); + owner = owner._debugOwner || null; + } + } + return owners; + } // Fast path props lookup for React Native style editor. + // Could use inspectElementRaw() but that would require shallow rendering hooks components, + // and could also mess with memoization. + + function getInstanceAndStyle(id) { + var instance = null; + var style = null; + var fiber = findCurrentFiberUsingSlowPathById(id); + if (fiber !== null) { + instance = fiber.stateNode; + if (fiber.memoizedProps !== null) { + style = fiber.memoizedProps.style; + } + } + return { + instance: instance, + style: style + }; + } + function isErrorBoundary(fiber) { + var tag = fiber.tag, + type = fiber.type; + switch (tag) { + case ClassComponent: + case IncompleteClassComponent: + var instance = fiber.stateNode; + return typeof type.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function'; + default: + return false; + } + } + function getNearestErrorBoundaryID(fiber) { + var parent = fiber.return; + while (parent !== null) { + if (isErrorBoundary(parent)) { + return getFiberIDUnsafe(parent); + } + parent = parent.return; + } + return null; + } + function inspectElementRaw(id) { + var fiber = findCurrentFiberUsingSlowPathById(id); + if (fiber == null) { + return null; + } + var _debugOwner = fiber._debugOwner, + _debugSource = fiber._debugSource, + stateNode = fiber.stateNode, + key = fiber.key, + memoizedProps = fiber.memoizedProps, + memoizedState = fiber.memoizedState, + dependencies = fiber.dependencies, + tag = fiber.tag, + type = fiber.type; + var elementType = getElementTypeForFiber(fiber); + var usesHooks = (tag === FunctionComponent || tag === SimpleMemoComponent || tag === ForwardRef) && (!!memoizedState || !!dependencies); // TODO Show custom UI for Cache like we do for Suspense + // For now, just hide state data entirely since it's not meant to be inspected. + + var showState = !usesHooks && tag !== CacheComponent; + var typeSymbol = getTypeSymbol(type); + var canViewSource = false; + var context = null; + if (tag === ClassComponent || tag === FunctionComponent || tag === IncompleteClassComponent || tag === IndeterminateComponent || tag === MemoComponent || tag === ForwardRef || tag === SimpleMemoComponent) { + canViewSource = true; + if (stateNode && stateNode.context != null) { + // Don't show an empty context object for class components that don't use the context API. + var shouldHideContext = elementType === types_ElementTypeClass && !(type.contextTypes || type.contextType); + if (!shouldHideContext) { + context = stateNode.context; + } + } + } else if (typeSymbol === CONTEXT_NUMBER || typeSymbol === CONTEXT_SYMBOL_STRING) { + // 16.3-16.5 read from "type" because the Consumer is the actual context object. + // 16.6+ should read from "type._context" because Consumer can be different (in DEV). + // NOTE Keep in sync with getDisplayNameForFiber() + var consumerResolvedContext = type._context || type; // Global context value. + + context = consumerResolvedContext._currentValue || null; // Look for overridden value. + + var _current = fiber.return; + while (_current !== null) { + var currentType = _current.type; + var currentTypeSymbol = getTypeSymbol(currentType); + if (currentTypeSymbol === PROVIDER_NUMBER || currentTypeSymbol === PROVIDER_SYMBOL_STRING) { + // 16.3.0 exposed the context object as "context" + // PR #12501 changed it to "_context" for 16.3.1+ + // NOTE Keep in sync with getDisplayNameForFiber() + var providerResolvedContext = currentType._context || currentType.context; + if (providerResolvedContext === consumerResolvedContext) { + context = _current.memoizedProps.value; + break; + } + } + _current = _current.return; + } + } + var hasLegacyContext = false; + if (context !== null) { + hasLegacyContext = !!type.contextTypes; // To simplify hydration and display logic for context, wrap in a value object. + // Otherwise simple values (e.g. strings, booleans) become harder to handle. + + context = { + value: context + }; + } + var owners = null; + if (_debugOwner) { + owners = []; + var owner = _debugOwner; + while (owner !== null) { + owners.push(fiberToSerializedElement(owner)); + owner = owner._debugOwner || null; + } + } + var isTimedOutSuspense = tag === SuspenseComponent && memoizedState !== null; + var hooks = null; + if (usesHooks) { + var originalConsoleMethods = {}; // Temporarily disable all console logging before re-running the hook. + + for (var method in console) { + try { + originalConsoleMethods[method] = console[method]; // $FlowFixMe[prop-missing] + + console[method] = function () {}; + } catch (error) {} + } + try { + hooks = (0, react_debug_tools.inspectHooksOfFiber)(fiber, renderer.currentDispatcherRef, true // Include source location info for hooks + ); + } finally { + // Restore original console functionality. + for (var _method in originalConsoleMethods) { + try { + // $FlowFixMe[prop-missing] + console[_method] = originalConsoleMethods[_method]; + } catch (error) {} + } + } + } + var rootType = null; + var current = fiber; + while (current.return !== null) { + current = current.return; + } + var fiberRoot = current.stateNode; + if (fiberRoot != null && fiberRoot._debugRootType !== null) { + rootType = fiberRoot._debugRootType; + } + var errors = fiberIDToErrorsMap.get(id) || new Map(); + var warnings = fiberIDToWarningsMap.get(id) || new Map(); + var isErrored = false; + var targetErrorBoundaryID; + if (isErrorBoundary(fiber)) { + // if the current inspected element is an error boundary, + // either that we want to use it to toggle off error state + // or that we allow to force error state on it if it's within another + // error boundary + // + // TODO: This flag is a leaked implementation detail. Once we start + // releasing DevTools in lockstep with React, we should import a function + // from the reconciler instead. + var DidCapture = 128; + isErrored = (fiber.flags & DidCapture) !== 0 || forceErrorForFiberIDs.get(id) === true; + targetErrorBoundaryID = isErrored ? id : getNearestErrorBoundaryID(fiber); + } else { + targetErrorBoundaryID = getNearestErrorBoundaryID(fiber); + } + var plugins = { + stylex: null + }; + if (enableStyleXFeatures) { + if (memoizedProps != null && memoizedProps.hasOwnProperty('xstyle')) { + plugins.stylex = getStyleXData(memoizedProps.xstyle); + } + } + return { + id: id, + // Does the current renderer support editable hooks and function props? + canEditHooks: typeof overrideHookState === 'function', + canEditFunctionProps: typeof overrideProps === 'function', + // Does the current renderer support advanced editing interface? + canEditHooksAndDeletePaths: typeof overrideHookStateDeletePath === 'function', + canEditHooksAndRenamePaths: typeof overrideHookStateRenamePath === 'function', + canEditFunctionPropsDeletePaths: typeof overridePropsDeletePath === 'function', + canEditFunctionPropsRenamePaths: typeof overridePropsRenamePath === 'function', + canToggleError: supportsTogglingError && targetErrorBoundaryID != null, + // Is this error boundary in error state. + isErrored: isErrored, + targetErrorBoundaryID: targetErrorBoundaryID, + canToggleSuspense: supportsTogglingSuspense && ( + // If it's showing the real content, we can always flip fallback. + !isTimedOutSuspense || + // If it's showing fallback because we previously forced it to, + // allow toggling it back to remove the fallback override. + forceFallbackForSuspenseIDs.has(id)), + // Can view component source location. + canViewSource: canViewSource, + // Does the component have legacy context attached to it. + hasLegacyContext: hasLegacyContext, + key: key != null ? key : null, + displayName: getDisplayNameForFiber(fiber), + type: elementType, + // Inspectable properties. + // TODO Review sanitization approach for the below inspectable values. + context: context, + hooks: hooks, + props: memoizedProps, + state: showState ? memoizedState : null, + errors: Array.from(errors.entries()), + warnings: Array.from(warnings.entries()), + // List of owners + owners: owners, + // Location of component in source code. + source: _debugSource || null, + rootType: rootType, + rendererPackageName: renderer.rendererPackageName, + rendererVersion: renderer.version, + plugins: plugins + }; + } + var mostRecentlyInspectedElement = null; + var hasElementUpdatedSinceLastInspected = false; + var currentlyInspectedPaths = {}; + function isMostRecentlyInspectedElement(id) { + return mostRecentlyInspectedElement !== null && mostRecentlyInspectedElement.id === id; + } + function isMostRecentlyInspectedElementCurrent(id) { + return isMostRecentlyInspectedElement(id) && !hasElementUpdatedSinceLastInspected; + } // Track the intersection of currently inspected paths, + // so that we can send their data along if the element is re-rendered. + + function mergeInspectedPaths(path) { + var current = currentlyInspectedPaths; + path.forEach(function (key) { + if (!current[key]) { + current[key] = {}; + } + current = current[key]; + }); + } + function createIsPathAllowed(key, secondaryCategory) { + // This function helps prevent previously-inspected paths from being dehydrated in updates. + // This is important to avoid a bad user experience where expanded toggles collapse on update. + return function isPathAllowed(path) { + switch (secondaryCategory) { + case 'hooks': + if (path.length === 1) { + // Never dehydrate the "hooks" object at the top levels. + return true; + } + if (path[path.length - 2] === 'hookSource' && path[path.length - 1] === 'fileName') { + // It's important to preserve the full file name (URL) for hook sources + // in case the user has enabled the named hooks feature. + // Otherwise the frontend may end up with a partial URL which it can't load. + return true; + } + if (path[path.length - 1] === 'subHooks' || path[path.length - 2] === 'subHooks') { + // Dehydrating the 'subHooks' property makes the HooksTree UI a lot more complicated, + // so it's easiest for now if we just don't break on this boundary. + // We can always dehydrate a level deeper (in the value object). + return true; + } + break; + default: + break; + } + var current = key === null ? currentlyInspectedPaths : currentlyInspectedPaths[key]; + if (!current) { + return false; + } + for (var i = 0; i < path.length; i++) { + current = current[path[i]]; + if (!current) { + return false; + } + } + return true; + }; + } + function updateSelectedElement(inspectedElement) { + var hooks = inspectedElement.hooks, + id = inspectedElement.id, + props = inspectedElement.props; + var fiber = idToArbitraryFiberMap.get(id); + if (fiber == null) { + console.warn("Could not find Fiber with id \"".concat(id, "\"")); + return; + } + var elementType = fiber.elementType, + stateNode = fiber.stateNode, + tag = fiber.tag, + type = fiber.type; + switch (tag) { + case ClassComponent: + case IncompleteClassComponent: + case IndeterminateComponent: + global.$r = stateNode; + break; + case FunctionComponent: + global.$r = { + hooks: hooks, + props: props, + type: type + }; + break; + case ForwardRef: + global.$r = { + hooks: hooks, + props: props, + type: type.render + }; + break; + case MemoComponent: + case SimpleMemoComponent: + global.$r = { + hooks: hooks, + props: props, + type: elementType != null && elementType.type != null ? elementType.type : type + }; + break; + default: + global.$r = null; + break; + } + } + function storeAsGlobal(id, path, count) { + if (isMostRecentlyInspectedElement(id)) { + var value = utils_getInObject(mostRecentlyInspectedElement, path); + var key = "$reactTemp".concat(count); + window[key] = value; + console.log(key); + console.log(value); + } + } + function getSerializedElementValueByPath(id, path) { + if (isMostRecentlyInspectedElement(id)) { + var valueToCopy = utils_getInObject(mostRecentlyInspectedElement, path); + return serializeToString(valueToCopy); + } + } + function inspectElement(requestID, id, path, forceFullData) { + if (path !== null) { + mergeInspectedPaths(path); + } + if (isMostRecentlyInspectedElement(id) && !forceFullData) { + if (!hasElementUpdatedSinceLastInspected) { + if (path !== null) { + var secondaryCategory = null; + if (path[0] === 'hooks') { + secondaryCategory = 'hooks'; + } // If this element has not been updated since it was last inspected, + // we can just return the subset of data in the newly-inspected path. + + return { + id: id, + responseID: requestID, + type: 'hydrated-path', + path: path, + value: cleanForBridge(utils_getInObject(mostRecentlyInspectedElement, path), createIsPathAllowed(null, secondaryCategory), path) + }; + } else { + // If this element has not been updated since it was last inspected, we don't need to return it. + // Instead we can just return the ID to indicate that it has not changed. + return { + id: id, + responseID: requestID, + type: 'no-change' + }; + } + } + } else { + currentlyInspectedPaths = {}; + } + hasElementUpdatedSinceLastInspected = false; + try { + mostRecentlyInspectedElement = inspectElementRaw(id); + } catch (error) { + // the error name is synced with ReactDebugHooks + if (error.name === 'ReactDebugToolsRenderError') { + var message = 'Error rendering inspected element.'; + var stack; // Log error & cause for user to debug + + console.error(message + '\n\n', error); + if (error.cause != null) { + var _fiber4 = findCurrentFiberUsingSlowPathById(id); + var componentName = _fiber4 != null ? getDisplayNameForFiber(_fiber4) : null; + console.error('React DevTools encountered an error while trying to inspect hooks. ' + 'This is most likely caused by an error in current inspected component' + (componentName != null ? ": \"".concat(componentName, "\".") : '.') + '\nThe error thrown in the component is: \n\n', error.cause); + if (error.cause instanceof Error) { + message = error.cause.message || message; + stack = error.cause.stack; + } + } + return { + type: 'error', + errorType: 'user', + id: id, + responseID: requestID, + message: message, + stack: stack + }; + } // the error name is synced with ReactDebugHooks + + if (error.name === 'ReactDebugToolsUnsupportedHookError') { + return { + type: 'error', + errorType: 'unknown-hook', + id: id, + responseID: requestID, + message: 'Unsupported hook in the react-debug-tools package: ' + error.message + }; + } // Log Uncaught Error + + console.error('Error inspecting element.\n\n', error); + return { + type: 'error', + errorType: 'uncaught', + id: id, + responseID: requestID, + message: error.message, + stack: error.stack + }; + } + if (mostRecentlyInspectedElement === null) { + return { + id: id, + responseID: requestID, + type: 'not-found' + }; + } // Any time an inspected element has an update, + // we should update the selected $r value as wel. + // Do this before dehydration (cleanForBridge). + + updateSelectedElement(mostRecentlyInspectedElement); // Clone before cleaning so that we preserve the full data. + // This will enable us to send patches without re-inspecting if hydrated paths are requested. + // (Reducing how often we shallow-render is a better DX for function components that use hooks.) + + var cleanedInspectedElement = renderer_objectSpread({}, mostRecentlyInspectedElement); // $FlowFixMe[prop-missing] found when upgrading Flow + + cleanedInspectedElement.context = cleanForBridge(cleanedInspectedElement.context, createIsPathAllowed('context', null)); // $FlowFixMe[prop-missing] found when upgrading Flow + + cleanedInspectedElement.hooks = cleanForBridge(cleanedInspectedElement.hooks, createIsPathAllowed('hooks', 'hooks')); // $FlowFixMe[prop-missing] found when upgrading Flow + + cleanedInspectedElement.props = cleanForBridge(cleanedInspectedElement.props, createIsPathAllowed('props', null)); // $FlowFixMe[prop-missing] found when upgrading Flow + + cleanedInspectedElement.state = cleanForBridge(cleanedInspectedElement.state, createIsPathAllowed('state', null)); + return { + id: id, + responseID: requestID, + type: 'full-data', + // $FlowFixMe[prop-missing] found when upgrading Flow + value: cleanedInspectedElement + }; + } + function logElementToConsole(id) { + var result = isMostRecentlyInspectedElementCurrent(id) ? mostRecentlyInspectedElement : inspectElementRaw(id); + if (result === null) { + console.warn("Could not find Fiber with id \"".concat(id, "\"")); + return; + } + var supportsGroup = typeof console.groupCollapsed === 'function'; + if (supportsGroup) { + console.groupCollapsed("[Click to expand] %c<".concat(result.displayName || 'Component', " />"), + // --dom-tag-name-color is the CSS variable Chrome styles HTML elements with in the console. + 'color: var(--dom-tag-name-color); font-weight: normal;'); + } + if (result.props !== null) { + console.log('Props:', result.props); + } + if (result.state !== null) { + console.log('State:', result.state); + } + if (result.hooks !== null) { + console.log('Hooks:', result.hooks); + } + var nativeNodes = findNativeNodesForFiberID(id); + if (nativeNodes !== null) { + console.log('Nodes:', nativeNodes); + } + if (result.source !== null) { + console.log('Location:', result.source); + } + if (window.chrome || /firefox/i.test(navigator.userAgent)) { + console.log('Right-click any value to save it as a global variable for further inspection.'); + } + if (supportsGroup) { + console.groupEnd(); + } + } + function deletePath(type, id, hookID, path) { + var fiber = findCurrentFiberUsingSlowPathById(id); + if (fiber !== null) { + var instance = fiber.stateNode; + switch (type) { + case 'context': + // To simplify hydration and display of primitive context values (e.g. number, string) + // the inspectElement() method wraps context in a {value: ...} object. + // We need to remove the first part of the path (the "value") before continuing. + path = path.slice(1); + switch (fiber.tag) { + case ClassComponent: + if (path.length === 0) {// Simple context value (noop) + } else { + deletePathInObject(instance.context, path); + } + instance.forceUpdate(); + break; + case FunctionComponent: + // Function components using legacy context are not editable + // because there's no instance on which to create a cloned, mutated context. + break; + } + break; + case 'hooks': + if (typeof overrideHookStateDeletePath === 'function') { + overrideHookStateDeletePath(fiber, hookID, path); + } + break; + case 'props': + if (instance === null) { + if (typeof overridePropsDeletePath === 'function') { + overridePropsDeletePath(fiber, path); + } + } else { + fiber.pendingProps = copyWithDelete(instance.props, path); + instance.forceUpdate(); + } + break; + case 'state': + deletePathInObject(instance.state, path); + instance.forceUpdate(); + break; + } + } + } + function renamePath(type, id, hookID, oldPath, newPath) { + var fiber = findCurrentFiberUsingSlowPathById(id); + if (fiber !== null) { + var instance = fiber.stateNode; + switch (type) { + case 'context': + // To simplify hydration and display of primitive context values (e.g. number, string) + // the inspectElement() method wraps context in a {value: ...} object. + // We need to remove the first part of the path (the "value") before continuing. + oldPath = oldPath.slice(1); + newPath = newPath.slice(1); + switch (fiber.tag) { + case ClassComponent: + if (oldPath.length === 0) {// Simple context value (noop) + } else { + renamePathInObject(instance.context, oldPath, newPath); + } + instance.forceUpdate(); + break; + case FunctionComponent: + // Function components using legacy context are not editable + // because there's no instance on which to create a cloned, mutated context. + break; + } + break; + case 'hooks': + if (typeof overrideHookStateRenamePath === 'function') { + overrideHookStateRenamePath(fiber, hookID, oldPath, newPath); + } + break; + case 'props': + if (instance === null) { + if (typeof overridePropsRenamePath === 'function') { + overridePropsRenamePath(fiber, oldPath, newPath); + } + } else { + fiber.pendingProps = copyWithRename(instance.props, oldPath, newPath); + instance.forceUpdate(); + } + break; + case 'state': + renamePathInObject(instance.state, oldPath, newPath); + instance.forceUpdate(); + break; + } + } + } + function overrideValueAtPath(type, id, hookID, path, value) { + var fiber = findCurrentFiberUsingSlowPathById(id); + if (fiber !== null) { + var instance = fiber.stateNode; + switch (type) { + case 'context': + // To simplify hydration and display of primitive context values (e.g. number, string) + // the inspectElement() method wraps context in a {value: ...} object. + // We need to remove the first part of the path (the "value") before continuing. + path = path.slice(1); + switch (fiber.tag) { + case ClassComponent: + if (path.length === 0) { + // Simple context value + instance.context = value; + } else { + utils_setInObject(instance.context, path, value); + } + instance.forceUpdate(); + break; + case FunctionComponent: + // Function components using legacy context are not editable + // because there's no instance on which to create a cloned, mutated context. + break; + } + break; + case 'hooks': + if (typeof overrideHookState === 'function') { + overrideHookState(fiber, hookID, path, value); + } + break; + case 'props': + switch (fiber.tag) { + case ClassComponent: + fiber.pendingProps = copyWithSet(instance.props, path, value); + instance.forceUpdate(); + break; + default: + if (typeof overrideProps === 'function') { + overrideProps(fiber, path, value); + } + break; + } + break; + case 'state': + switch (fiber.tag) { + case ClassComponent: + utils_setInObject(instance.state, path, value); + instance.forceUpdate(); + break; + } + break; + } + } + } + var currentCommitProfilingMetadata = null; + var displayNamesByRootID = null; + var idToContextsMap = null; + var initialTreeBaseDurationsMap = null; + var initialIDToRootMap = null; + var isProfiling = false; + var profilingStartTime = 0; + var recordChangeDescriptions = false; + var rootToCommitProfilingMetadataMap = null; + function getProfilingData() { + var dataForRoots = []; + if (rootToCommitProfilingMetadataMap === null) { + throw Error('getProfilingData() called before any profiling data was recorded'); + } + rootToCommitProfilingMetadataMap.forEach(function (commitProfilingMetadata, rootID) { + var commitData = []; + var initialTreeBaseDurations = []; + var displayName = displayNamesByRootID !== null && displayNamesByRootID.get(rootID) || 'Unknown'; + if (initialTreeBaseDurationsMap != null) { + initialTreeBaseDurationsMap.forEach(function (treeBaseDuration, id) { + if (initialIDToRootMap != null && initialIDToRootMap.get(id) === rootID) { + // We don't need to convert milliseconds to microseconds in this case, + // because the profiling summary is JSON serialized. + initialTreeBaseDurations.push([id, treeBaseDuration]); + } + }); + } + commitProfilingMetadata.forEach(function (commitProfilingData, commitIndex) { + var changeDescriptions = commitProfilingData.changeDescriptions, + durations = commitProfilingData.durations, + effectDuration = commitProfilingData.effectDuration, + maxActualDuration = commitProfilingData.maxActualDuration, + passiveEffectDuration = commitProfilingData.passiveEffectDuration, + priorityLevel = commitProfilingData.priorityLevel, + commitTime = commitProfilingData.commitTime, + updaters = commitProfilingData.updaters; + var fiberActualDurations = []; + var fiberSelfDurations = []; + for (var i = 0; i < durations.length; i += 3) { + var fiberID = durations[i]; + fiberActualDurations.push([fiberID, durations[i + 1]]); + fiberSelfDurations.push([fiberID, durations[i + 2]]); + } + commitData.push({ + changeDescriptions: changeDescriptions !== null ? Array.from(changeDescriptions.entries()) : null, + duration: maxActualDuration, + effectDuration: effectDuration, + fiberActualDurations: fiberActualDurations, + fiberSelfDurations: fiberSelfDurations, + passiveEffectDuration: passiveEffectDuration, + priorityLevel: priorityLevel, + timestamp: commitTime, + updaters: updaters + }); + }); + dataForRoots.push({ + commitData: commitData, + displayName: displayName, + initialTreeBaseDurations: initialTreeBaseDurations, + rootID: rootID + }); + }); + var timelineData = null; + if (typeof getTimelineData === 'function') { + var currentTimelineData = getTimelineData(); + if (currentTimelineData) { + var batchUIDToMeasuresMap = currentTimelineData.batchUIDToMeasuresMap, + internalModuleSourceToRanges = currentTimelineData.internalModuleSourceToRanges, + laneToLabelMap = currentTimelineData.laneToLabelMap, + laneToReactMeasureMap = currentTimelineData.laneToReactMeasureMap, + rest = _objectWithoutProperties(currentTimelineData, ["batchUIDToMeasuresMap", "internalModuleSourceToRanges", "laneToLabelMap", "laneToReactMeasureMap"]); + timelineData = renderer_objectSpread(renderer_objectSpread({}, rest), {}, { + // Most of the data is safe to parse as-is, + // but we need to convert the nested Arrays back to Maps. + // Most of the data is safe to serialize as-is, + // but we need to convert the Maps to nested Arrays. + batchUIDToMeasuresKeyValueArray: Array.from(batchUIDToMeasuresMap.entries()), + internalModuleSourceToRanges: Array.from(internalModuleSourceToRanges.entries()), + laneToLabelKeyValueArray: Array.from(laneToLabelMap.entries()), + laneToReactMeasureKeyValueArray: Array.from(laneToReactMeasureMap.entries()) + }); + } + } + return { + dataForRoots: dataForRoots, + rendererID: rendererID, + timelineData: timelineData + }; + } + function startProfiling(shouldRecordChangeDescriptions) { + if (isProfiling) { + return; + } + recordChangeDescriptions = shouldRecordChangeDescriptions; // Capture initial values as of the time profiling starts. + // It's important we snapshot both the durations and the id-to-root map, + // since either of these may change during the profiling session + // (e.g. when a fiber is re-rendered or when a fiber gets removed). + + displayNamesByRootID = new Map(); + initialTreeBaseDurationsMap = new Map(idToTreeBaseDurationMap); + initialIDToRootMap = new Map(idToRootMap); + idToContextsMap = new Map(); + hook.getFiberRoots(rendererID).forEach(function (root) { + var rootID = getFiberIDThrows(root.current); + displayNamesByRootID.set(rootID, getDisplayNameForRoot(root.current)); + if (shouldRecordChangeDescriptions) { + // Record all contexts at the time profiling is started. + // Fibers only store the current context value, + // so we need to track them separately in order to determine changed keys. + crawlToInitializeContextsMap(root.current); + } + }); + isProfiling = true; + profilingStartTime = renderer_getCurrentTime(); + rootToCommitProfilingMetadataMap = new Map(); + if (toggleProfilingStatus !== null) { + toggleProfilingStatus(true); + } + } + function stopProfiling() { + isProfiling = false; + recordChangeDescriptions = false; + if (toggleProfilingStatus !== null) { + toggleProfilingStatus(false); + } + } // Automatically start profiling so that we don't miss timing info from initial "mount". + + if (sessionStorageGetItem(SESSION_STORAGE_RELOAD_AND_PROFILE_KEY) === 'true') { + startProfiling(sessionStorageGetItem(SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY) === 'true'); + } // React will switch between these implementations depending on whether + // we have any manually suspended/errored-out Fibers or not. + + function shouldErrorFiberAlwaysNull() { + return null; + } // Map of id and its force error status: true (error), false (toggled off), + // null (do nothing) + + var forceErrorForFiberIDs = new Map(); + function shouldErrorFiberAccordingToMap(fiber) { + if (typeof setErrorHandler !== 'function') { + throw new Error('Expected overrideError() to not get called for earlier React versions.'); + } + var id = getFiberIDUnsafe(fiber); + if (id === null) { + return null; + } + var status = null; + if (forceErrorForFiberIDs.has(id)) { + status = forceErrorForFiberIDs.get(id); + if (status === false) { + // TRICKY overrideError adds entries to this Map, + // so ideally it would be the method that clears them too, + // but that would break the functionality of the feature, + // since DevTools needs to tell React to act differently than it normally would + // (don't just re-render the failed boundary, but reset its errored state too). + // So we can only clear it after telling React to reset the state. + // Technically this is premature and we should schedule it for later, + // since the render could always fail without committing the updated error boundary, + // but since this is a DEV-only feature, the simplicity is worth the trade off. + forceErrorForFiberIDs.delete(id); + if (forceErrorForFiberIDs.size === 0) { + // Last override is gone. Switch React back to fast path. + setErrorHandler(shouldErrorFiberAlwaysNull); + } + } + } + return status; + } + function overrideError(id, forceError) { + if (typeof setErrorHandler !== 'function' || typeof scheduleUpdate !== 'function') { + throw new Error('Expected overrideError() to not get called for earlier React versions.'); + } + forceErrorForFiberIDs.set(id, forceError); + if (forceErrorForFiberIDs.size === 1) { + // First override is added. Switch React to slower path. + setErrorHandler(shouldErrorFiberAccordingToMap); + } + var fiber = idToArbitraryFiberMap.get(id); + if (fiber != null) { + scheduleUpdate(fiber); + } + } + function shouldSuspendFiberAlwaysFalse() { + return false; + } + var forceFallbackForSuspenseIDs = new Set(); + function shouldSuspendFiberAccordingToSet(fiber) { + var maybeID = getFiberIDUnsafe(fiber); + return maybeID !== null && forceFallbackForSuspenseIDs.has(maybeID); + } + function overrideSuspense(id, forceFallback) { + if (typeof setSuspenseHandler !== 'function' || typeof scheduleUpdate !== 'function') { + throw new Error('Expected overrideSuspense() to not get called for earlier React versions.'); + } + if (forceFallback) { + forceFallbackForSuspenseIDs.add(id); + if (forceFallbackForSuspenseIDs.size === 1) { + // First override is added. Switch React to slower path. + setSuspenseHandler(shouldSuspendFiberAccordingToSet); + } + } else { + forceFallbackForSuspenseIDs.delete(id); + if (forceFallbackForSuspenseIDs.size === 0) { + // Last override is gone. Switch React back to fast path. + setSuspenseHandler(shouldSuspendFiberAlwaysFalse); + } + } + var fiber = idToArbitraryFiberMap.get(id); + if (fiber != null) { + scheduleUpdate(fiber); + } + } // Remember if we're trying to restore the selection after reload. + // In that case, we'll do some extra checks for matching mounts. + + var trackedPath = null; + var trackedPathMatchFiber = null; + var trackedPathMatchDepth = -1; + var mightBeOnTrackedPath = false; + function setTrackedPath(path) { + if (path === null) { + trackedPathMatchFiber = null; + trackedPathMatchDepth = -1; + mightBeOnTrackedPath = false; + } + trackedPath = path; + } // We call this before traversing a new mount. + // It remembers whether this Fiber is the next best match for tracked path. + // The return value signals whether we should keep matching siblings or not. + + function updateTrackedPathStateBeforeMount(fiber) { + if (trackedPath === null || !mightBeOnTrackedPath) { + // Fast path: there's nothing to track so do nothing and ignore siblings. + return false; + } + var returnFiber = fiber.return; + var returnAlternate = returnFiber !== null ? returnFiber.alternate : null; // By now we know there's some selection to restore, and this is a new Fiber. + // Is this newly mounted Fiber a direct child of the current best match? + // (This will also be true for new roots if we haven't matched anything yet.) + + if (trackedPathMatchFiber === returnFiber || trackedPathMatchFiber === returnAlternate && returnAlternate !== null) { + // Is this the next Fiber we should select? Let's compare the frames. + var actualFrame = getPathFrame(fiber); // $FlowFixMe[incompatible-use] found when upgrading Flow + + var expectedFrame = trackedPath[trackedPathMatchDepth + 1]; + if (expectedFrame === undefined) { + throw new Error('Expected to see a frame at the next depth.'); + } + if (actualFrame.index === expectedFrame.index && actualFrame.key === expectedFrame.key && actualFrame.displayName === expectedFrame.displayName) { + // We have our next match. + trackedPathMatchFiber = fiber; + trackedPathMatchDepth++; // Are we out of frames to match? + // $FlowFixMe[incompatible-use] found when upgrading Flow + + if (trackedPathMatchDepth === trackedPath.length - 1) { + // There's nothing that can possibly match afterwards. + // Don't check the children. + mightBeOnTrackedPath = false; + } else { + // Check the children, as they might reveal the next match. + mightBeOnTrackedPath = true; + } // In either case, since we have a match, we don't need + // to check the siblings. They'll never match. + + return false; + } + } // This Fiber's parent is on the path, but this Fiber itself isn't. + // There's no need to check its children--they won't be on the path either. + + mightBeOnTrackedPath = false; // However, one of its siblings may be on the path so keep searching. + + return true; + } + function updateTrackedPathStateAfterMount(mightSiblingsBeOnTrackedPath) { + // updateTrackedPathStateBeforeMount() told us whether to match siblings. + // Now that we're entering siblings, let's use that information. + mightBeOnTrackedPath = mightSiblingsBeOnTrackedPath; + } // Roots don't have a real persistent identity. + // A root's "pseudo key" is "childDisplayName:indexWithThatName". + // For example, "App:0" or, in case of similar roots, "Story:0", "Story:1", etc. + // We will use this to try to disambiguate roots when restoring selection between reloads. + + var rootPseudoKeys = new Map(); + var rootDisplayNameCounter = new Map(); + function setRootPseudoKey(id, fiber) { + var name = getDisplayNameForRoot(fiber); + var counter = rootDisplayNameCounter.get(name) || 0; + rootDisplayNameCounter.set(name, counter + 1); + var pseudoKey = "".concat(name, ":").concat(counter); + rootPseudoKeys.set(id, pseudoKey); + } + function removeRootPseudoKey(id) { + var pseudoKey = rootPseudoKeys.get(id); + if (pseudoKey === undefined) { + throw new Error('Expected root pseudo key to be known.'); + } + var name = pseudoKey.slice(0, pseudoKey.lastIndexOf(':')); + var counter = rootDisplayNameCounter.get(name); + if (counter === undefined) { + throw new Error('Expected counter to be known.'); + } + if (counter > 1) { + rootDisplayNameCounter.set(name, counter - 1); + } else { + rootDisplayNameCounter.delete(name); + } + rootPseudoKeys.delete(id); + } + function getDisplayNameForRoot(fiber) { + var preferredDisplayName = null; + var fallbackDisplayName = null; + var child = fiber.child; // Go at most three levels deep into direct children + // while searching for a child that has a displayName. + + for (var i = 0; i < 3; i++) { + if (child === null) { + break; + } + var displayName = getDisplayNameForFiber(child); + if (displayName !== null) { + // Prefer display names that we get from user-defined components. + // We want to avoid using e.g. 'Suspense' unless we find nothing else. + if (typeof child.type === 'function') { + // There's a few user-defined tags, but we'll prefer the ones + // that are usually explicitly named (function or class components). + preferredDisplayName = displayName; + } else if (fallbackDisplayName === null) { + fallbackDisplayName = displayName; + } + } + if (preferredDisplayName !== null) { + break; + } + child = child.child; + } + return preferredDisplayName || fallbackDisplayName || 'Anonymous'; + } + function getPathFrame(fiber) { + var key = fiber.key; + var displayName = getDisplayNameForFiber(fiber); + var index = fiber.index; + switch (fiber.tag) { + case HostRoot: + // Roots don't have a real displayName, index, or key. + // Instead, we'll use the pseudo key (childDisplayName:indexWithThatName). + var id = getFiberIDThrows(fiber); + var pseudoKey = rootPseudoKeys.get(id); + if (pseudoKey === undefined) { + throw new Error('Expected mounted root to have known pseudo key.'); + } + displayName = pseudoKey; + break; + case HostComponent: + displayName = fiber.type; + break; + default: + break; + } + return { + displayName: displayName, + key: key, + index: index + }; + } // Produces a serializable representation that does a best effort + // of identifying a particular Fiber between page reloads. + // The return path will contain Fibers that are "invisible" to the store + // because their keys and indexes are important to restoring the selection. + + function getPathForElement(id) { + var fiber = idToArbitraryFiberMap.get(id); + if (fiber == null) { + return null; + } + var keyPath = []; + while (fiber !== null) { + // $FlowFixMe[incompatible-call] found when upgrading Flow + keyPath.push(getPathFrame(fiber)); // $FlowFixMe[incompatible-use] found when upgrading Flow + + fiber = fiber.return; + } + keyPath.reverse(); + return keyPath; + } + function getBestMatchForTrackedPath() { + if (trackedPath === null) { + // Nothing to match. + return null; + } + if (trackedPathMatchFiber === null) { + // We didn't find anything. + return null; + } // Find the closest Fiber store is aware of. + + var fiber = trackedPathMatchFiber; + while (fiber !== null && shouldFilterFiber(fiber)) { + fiber = fiber.return; + } + if (fiber === null) { + return null; + } + return { + id: getFiberIDThrows(fiber), + // $FlowFixMe[incompatible-use] found when upgrading Flow + isFullMatch: trackedPathMatchDepth === trackedPath.length - 1 + }; + } + var formatPriorityLevel = function formatPriorityLevel(priorityLevel) { + if (priorityLevel == null) { + return 'Unknown'; + } + switch (priorityLevel) { + case ImmediatePriority: + return 'Immediate'; + case UserBlockingPriority: + return 'User-Blocking'; + case NormalPriority: + return 'Normal'; + case LowPriority: + return 'Low'; + case IdlePriority: + return 'Idle'; + case NoPriority: + default: + return 'Unknown'; + } + }; + function setTraceUpdatesEnabled(isEnabled) { + traceUpdatesEnabled = isEnabled; + } + function hasFiberWithId(id) { + return idToArbitraryFiberMap.has(id); + } + return { + cleanup: cleanup, + clearErrorsAndWarnings: clearErrorsAndWarnings, + clearErrorsForFiberID: clearErrorsForFiberID, + clearWarningsForFiberID: clearWarningsForFiberID, + getSerializedElementValueByPath: getSerializedElementValueByPath, + deletePath: deletePath, + findNativeNodesForFiberID: findNativeNodesForFiberID, + flushInitialOperations: flushInitialOperations, + getBestMatchForTrackedPath: getBestMatchForTrackedPath, + getDisplayNameForFiberID: getDisplayNameForFiberID, + getFiberForNative: getFiberForNative, + getFiberIDForNative: getFiberIDForNative, + getInstanceAndStyle: getInstanceAndStyle, + getOwnersList: getOwnersList, + getPathForElement: getPathForElement, + getProfilingData: getProfilingData, + handleCommitFiberRoot: handleCommitFiberRoot, + handleCommitFiberUnmount: handleCommitFiberUnmount, + handlePostCommitFiberRoot: handlePostCommitFiberRoot, + hasFiberWithId: hasFiberWithId, + inspectElement: inspectElement, + logElementToConsole: logElementToConsole, + patchConsoleForStrictMode: patchForStrictMode, + prepareViewAttributeSource: prepareViewAttributeSource, + prepareViewElementSource: prepareViewElementSource, + overrideError: overrideError, + overrideSuspense: overrideSuspense, + overrideValueAtPath: overrideValueAtPath, + renamePath: renamePath, + renderer: renderer, + setTraceUpdatesEnabled: setTraceUpdatesEnabled, + setTrackedPath: setTrackedPath, + startProfiling: startProfiling, + stopProfiling: stopProfiling, + storeAsGlobal: storeAsGlobal, + unpatchConsoleForStrictMode: unpatchForStrictMode, + updateComponentFilters: updateComponentFilters + }; + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/console.js + function console_toConsumableArray(arr) { + return console_arrayWithoutHoles(arr) || console_iterableToArray(arr) || console_unsupportedIterableToArray(arr) || console_nonIterableSpread(); + } + function console_nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function console_iterableToArray(iter) { + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + } + function console_arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return console_arrayLikeToArray(arr); + } + function console_createForOfIteratorHelper(o, allowArrayLike) { + var it; + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { + if (Array.isArray(o) || (it = console_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + var F = function F() {}; + return { + s: F, + n: function n() { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }, + e: function e(_e) { + throw _e; + }, + f: F + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var normalCompletion = true, + didErr = false, + err; + return { + s: function s() { + it = o[Symbol.iterator](); + }, + n: function n() { + var step = it.next(); + normalCompletion = step.done; + return step; + }, + e: function e(_e2) { + didErr = true; + err = _e2; + }, + f: function f() { + try { + if (!normalCompletion && it.return != null) it.return(); + } finally { + if (didErr) throw err; + } + } + }; + } + function console_unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return console_arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return console_arrayLikeToArray(o, minLen); + } + function console_arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + var OVERRIDE_CONSOLE_METHODS = ['error', 'trace', 'warn']; + var DIMMED_NODE_CONSOLE_COLOR = '\x1b[2m%s\x1b[0m'; // React's custom built component stack strings match "\s{4}in" + // Chrome's prefix matches "\s{4}at" + + var PREFIX_REGEX = /\s{4}(in|at)\s{1}/; // Firefox and Safari have no prefix ("") + // but we can fallback to looking for location info (e.g. "foo.js:12:345") + + var ROW_COLUMN_NUMBER_REGEX = /:\d+:\d+(\n|$)/; + function isStringComponentStack(text) { + return PREFIX_REGEX.test(text) || ROW_COLUMN_NUMBER_REGEX.test(text); + } + var STYLE_DIRECTIVE_REGEX = /^%c/; // This function tells whether or not the arguments for a console + // method has been overridden by the patchForStrictMode function. + // If it has we'll need to do some special formatting of the arguments + // so the console color stays consistent + + function isStrictModeOverride(args, method) { + return args.length >= 2 && STYLE_DIRECTIVE_REGEX.test(args[0]) && args[1] === "color: ".concat(getConsoleColor(method) || ''); + } + function getConsoleColor(method) { + switch (method) { + case 'warn': + return consoleSettingsRef.browserTheme === 'light' ? "rgba(250, 180, 50, 0.75)" : "rgba(250, 180, 50, 0.5)"; + case 'error': + return consoleSettingsRef.browserTheme === 'light' ? "rgba(250, 123, 130, 0.75)" : "rgba(250, 123, 130, 0.5)"; + case 'log': + default: + return consoleSettingsRef.browserTheme === 'light' ? "rgba(125, 125, 125, 0.75)" : "rgba(125, 125, 125, 0.5)"; + } + } + var injectedRenderers = new Map(); + var targetConsole = console; + var targetConsoleMethods = {}; + for (var method in console) { + targetConsoleMethods[method] = console[method]; + } + var unpatchFn = null; + var isNode = false; + try { + isNode = undefined === global; + } catch (error) {} // Enables e.g. Jest tests to inject a mock console object. + + function dangerous_setTargetConsoleForTesting(targetConsoleForTesting) { + targetConsole = targetConsoleForTesting; + targetConsoleMethods = {}; + for (var _method in targetConsole) { + targetConsoleMethods[_method] = console[_method]; + } + } // v16 renderers should use this method to inject internals necessary to generate a component stack. + // These internals will be used if the console is patched. + // Injecting them separately allows the console to easily be patched or un-patched later (at runtime). + + function registerRenderer(renderer, onErrorOrWarning) { + var currentDispatcherRef = renderer.currentDispatcherRef, + getCurrentFiber = renderer.getCurrentFiber, + findFiberByHostInstance = renderer.findFiberByHostInstance, + version = renderer.version; // Ignore React v15 and older because they don't expose a component stack anyway. + + if (typeof findFiberByHostInstance !== 'function') { + return; + } // currentDispatcherRef gets injected for v16.8+ to support hooks inspection. + // getCurrentFiber gets injected for v16.9+. + + if (currentDispatcherRef != null && typeof getCurrentFiber === 'function') { + var _getInternalReactCons = getInternalReactConstants(version), + ReactTypeOfWork = _getInternalReactCons.ReactTypeOfWork; + injectedRenderers.set(renderer, { + currentDispatcherRef: currentDispatcherRef, + getCurrentFiber: getCurrentFiber, + workTagMap: ReactTypeOfWork, + onErrorOrWarning: onErrorOrWarning + }); + } + } + var consoleSettingsRef = { + appendComponentStack: false, + breakOnConsoleErrors: false, + showInlineWarningsAndErrors: false, + hideConsoleLogsInStrictMode: false, + browserTheme: 'dark' + }; // Patches console methods to append component stack for the current fiber. + // Call unpatch() to remove the injected behavior. + + function patch(_ref) { + var appendComponentStack = _ref.appendComponentStack, + breakOnConsoleErrors = _ref.breakOnConsoleErrors, + showInlineWarningsAndErrors = _ref.showInlineWarningsAndErrors, + hideConsoleLogsInStrictMode = _ref.hideConsoleLogsInStrictMode, + browserTheme = _ref.browserTheme; + // Settings may change after we've patched the console. + // Using a shared ref allows the patch function to read the latest values. + consoleSettingsRef.appendComponentStack = appendComponentStack; + consoleSettingsRef.breakOnConsoleErrors = breakOnConsoleErrors; + consoleSettingsRef.showInlineWarningsAndErrors = showInlineWarningsAndErrors; + consoleSettingsRef.hideConsoleLogsInStrictMode = hideConsoleLogsInStrictMode; + consoleSettingsRef.browserTheme = browserTheme; + if (appendComponentStack || breakOnConsoleErrors || showInlineWarningsAndErrors) { + if (unpatchFn !== null) { + // Don't patch twice. + return; + } + var originalConsoleMethods = {}; + unpatchFn = function unpatchFn() { + for (var _method2 in originalConsoleMethods) { + try { + targetConsole[_method2] = originalConsoleMethods[_method2]; + } catch (error) {} + } + }; + OVERRIDE_CONSOLE_METHODS.forEach(function (method) { + try { + var originalMethod = originalConsoleMethods[method] = targetConsole[method].__REACT_DEVTOOLS_ORIGINAL_METHOD__ ? targetConsole[method].__REACT_DEVTOOLS_ORIGINAL_METHOD__ : targetConsole[method]; // $FlowFixMe[missing-local-annot] + + var overrideMethod = function overrideMethod() { + var shouldAppendWarningStack = false; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + if (method !== 'log') { + if (consoleSettingsRef.appendComponentStack) { + var lastArg = args.length > 0 ? args[args.length - 1] : null; + var alreadyHasComponentStack = typeof lastArg === 'string' && isStringComponentStack(lastArg); // If we are ever called with a string that already has a component stack, + // e.g. a React error/warning, don't append a second stack. + + shouldAppendWarningStack = !alreadyHasComponentStack; + } + } + var shouldShowInlineWarningsAndErrors = consoleSettingsRef.showInlineWarningsAndErrors && (method === 'error' || method === 'warn'); // Search for the first renderer that has a current Fiber. + // We don't handle the edge case of stacks for more than one (e.g. interleaved renderers?) + // eslint-disable-next-line no-for-of-loops/no-for-of-loops + + var _iterator = console_createForOfIteratorHelper(injectedRenderers.values()), + _step; + try { + var _loop2 = function _loop2() { + _step$value = _step.value, currentDispatcherRef = _step$value.currentDispatcherRef, getCurrentFiber = _step$value.getCurrentFiber, onErrorOrWarning = _step$value.onErrorOrWarning, workTagMap = _step$value.workTagMap; + current = getCurrentFiber(); + if (current != null) { + try { + if (shouldShowInlineWarningsAndErrors) { + // patch() is called by two places: (1) the hook and (2) the renderer backend. + // The backend is what implements a message queue, so it's the only one that injects onErrorOrWarning. + if (typeof onErrorOrWarning === 'function') { + onErrorOrWarning(current, method, + // Copy args before we mutate them (e.g. adding the component stack) + args.slice()); + } + } + if (shouldAppendWarningStack) { + componentStack = getStackByFiberInDevAndProd(workTagMap, current, currentDispatcherRef); + if (componentStack !== '') { + if (isStrictModeOverride(args, method)) { + args[0] = "".concat(args[0], " %s"); + args.push(componentStack); + } else { + args.push(componentStack); + } + } + } + } catch (error) { + // Don't let a DevTools or React internal error interfere with logging. + setTimeout(function () { + throw error; + }, 0); + } finally { + return 1; // break + } + } + }, + _step$value, + currentDispatcherRef, + getCurrentFiber, + onErrorOrWarning, + workTagMap, + current, + componentStack; + for (_iterator.s(); !(_step = _iterator.n()).done;) { + if (_loop2()) break; + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + if (consoleSettingsRef.breakOnConsoleErrors) { + // --- Welcome to debugging with React DevTools --- + // This debugger statement means that you've enabled the "break on warnings" feature. + // Use the browser's Call Stack panel to step out of this override function- + // to where the original warning or error was logged. + // eslint-disable-next-line no-debugger + debugger; + } + originalMethod.apply(void 0, args); + }; + overrideMethod.__REACT_DEVTOOLS_ORIGINAL_METHOD__ = originalMethod; + originalMethod.__REACT_DEVTOOLS_OVERRIDE_METHOD__ = overrideMethod; + targetConsole[method] = overrideMethod; + } catch (error) {} + }); + } else { + unpatch(); + } + } // Removed component stack patch from console methods. + + function unpatch() { + if (unpatchFn !== null) { + unpatchFn(); + unpatchFn = null; + } + } + var unpatchForStrictModeFn = null; // NOTE: KEEP IN SYNC with src/hook.js:patchConsoleForInitialRenderInStrictMode + + function patchForStrictMode() { + if (consoleManagedByDevToolsDuringStrictMode) { + var overrideConsoleMethods = ['error', 'group', 'groupCollapsed', 'info', 'log', 'trace', 'warn']; + if (unpatchForStrictModeFn !== null) { + // Don't patch twice. + return; + } + var originalConsoleMethods = {}; + unpatchForStrictModeFn = function unpatchForStrictModeFn() { + for (var _method3 in originalConsoleMethods) { + try { + targetConsole[_method3] = originalConsoleMethods[_method3]; + } catch (error) {} + } + }; + overrideConsoleMethods.forEach(function (method) { + try { + var originalMethod = originalConsoleMethods[method] = targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ ? targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ : targetConsole[method]; // $FlowFixMe[missing-local-annot] + + var overrideMethod = function overrideMethod() { + if (!consoleSettingsRef.hideConsoleLogsInStrictMode) { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + // Dim the text color of the double logs if we're not + // hiding them. + if (isNode) { + originalMethod(DIMMED_NODE_CONSOLE_COLOR, format.apply(void 0, args)); + } else { + var color = getConsoleColor(method); + if (color) { + originalMethod.apply(void 0, console_toConsumableArray(formatWithStyles(args, "color: ".concat(color)))); + } else { + throw Error('Console color is not defined'); + } + } + } + }; + overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ = originalMethod; + originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ = overrideMethod; + targetConsole[method] = overrideMethod; + } catch (error) {} + }); + } + } // NOTE: KEEP IN SYNC with src/hook.js:unpatchConsoleForInitialRenderInStrictMode + + function unpatchForStrictMode() { + if (consoleManagedByDevToolsDuringStrictMode) { + if (unpatchForStrictModeFn !== null) { + unpatchForStrictModeFn(); + unpatchForStrictModeFn = null; + } + } + } + function patchConsoleUsingWindowValues() { + var _castBool, _castBool2, _castBool3, _castBool4, _castBrowserTheme; + var appendComponentStack = (_castBool = castBool(window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__)) !== null && _castBool !== void 0 ? _castBool : true; + var breakOnConsoleErrors = (_castBool2 = castBool(window.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__)) !== null && _castBool2 !== void 0 ? _castBool2 : false; + var showInlineWarningsAndErrors = (_castBool3 = castBool(window.__REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__)) !== null && _castBool3 !== void 0 ? _castBool3 : true; + var hideConsoleLogsInStrictMode = (_castBool4 = castBool(window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__)) !== null && _castBool4 !== void 0 ? _castBool4 : false; + var browserTheme = (_castBrowserTheme = castBrowserTheme(window.__REACT_DEVTOOLS_BROWSER_THEME__)) !== null && _castBrowserTheme !== void 0 ? _castBrowserTheme : 'dark'; + patch({ + appendComponentStack: appendComponentStack, + breakOnConsoleErrors: breakOnConsoleErrors, + showInlineWarningsAndErrors: showInlineWarningsAndErrors, + hideConsoleLogsInStrictMode: hideConsoleLogsInStrictMode, + browserTheme: browserTheme + }); + } // After receiving cached console patch settings from React Native, we set them on window. + // When the console is initially patched (in renderer.js and hook.js), these values are read. + // The browser extension (etc.) sets these values on window, but through another method. + + function writeConsolePatchSettingsToWindow(settings) { + window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ = settings.appendComponentStack; + window.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__ = settings.breakOnConsoleErrors; + window.__REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__ = settings.showInlineWarningsAndErrors; + window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ = settings.hideConsoleLogsInStrictMode; + window.__REACT_DEVTOOLS_BROWSER_THEME__ = settings.browserTheme; + } + function installConsoleFunctionsToWindow() { + window.__REACT_DEVTOOLS_CONSOLE_FUNCTIONS__ = { + patchConsoleUsingWindowValues: patchConsoleUsingWindowValues, + registerRendererWithConsole: registerRenderer + }; + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/bridge.js + function bridge_typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + bridge_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + bridge_typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return bridge_typeof(obj); + } + function bridge_toConsumableArray(arr) { + return bridge_arrayWithoutHoles(arr) || bridge_iterableToArray(arr) || bridge_unsupportedIterableToArray(arr) || bridge_nonIterableSpread(); + } + function bridge_nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function bridge_unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return bridge_arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return bridge_arrayLikeToArray(o, minLen); + } + function bridge_iterableToArray(iter) { + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + } + function bridge_arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return bridge_arrayLikeToArray(arr); + } + function bridge_arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + function bridge_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function bridge_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function bridge_createClass(Constructor, protoProps, staticProps) { + if (protoProps) bridge_defineProperties(Constructor.prototype, protoProps); + if (staticProps) bridge_defineProperties(Constructor, staticProps); + return Constructor; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + return function _createSuperInternal() { + var Super = _getPrototypeOf(Derived), + result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if (call && (bridge_typeof(call) === "object" || typeof call === "function")) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self; + } + function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); + return true; + } catch (e) { + return false; + } + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function bridge_defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + var BATCH_DURATION = 100; // This message specifies the version of the DevTools protocol currently supported by the backend, + // as well as the earliest NPM version (e.g. "4.13.0") that protocol is supported by on the frontend. + // This enables an older frontend to display an upgrade message to users for a newer, unsupported backend. + + // Bump protocol version whenever a backwards breaking change is made + // in the messages sent between BackendBridge and FrontendBridge. + // This mapping is embedded in both frontend and backend builds. + // + // The backend protocol will always be the latest entry in the BRIDGE_PROTOCOL array. + // + // When an older frontend connects to a newer backend, + // the backend can send the minNpmVersion and the frontend can display an NPM upgrade prompt. + // + // When a newer frontend connects with an older protocol version, + // the frontend can use the embedded minNpmVersion/maxNpmVersion values to display a downgrade prompt. + var BRIDGE_PROTOCOL = [ + // This version technically never existed, + // but a backwards breaking change was added in 4.11, + // so the safest guess to downgrade the frontend would be to version 4.10. + { + version: 0, + minNpmVersion: '"<4.11.0"', + maxNpmVersion: '"<4.11.0"' + }, + // Versions 4.11.x – 4.12.x contained the backwards breaking change, + // but we didn't add the "fix" of checking the protocol version until 4.13, + // so we don't recommend downgrading to 4.11 or 4.12. + { + version: 1, + minNpmVersion: '4.13.0', + maxNpmVersion: '4.21.0' + }, + // Version 2 adds a StrictMode-enabled and supports-StrictMode bits to add-root operation. + { + version: 2, + minNpmVersion: '4.22.0', + maxNpmVersion: null + }]; + var currentBridgeProtocol = BRIDGE_PROTOCOL[BRIDGE_PROTOCOL.length - 1]; + var Bridge = /*#__PURE__*/function (_EventEmitter) { + _inherits(Bridge, _EventEmitter); + var _super = _createSuper(Bridge); + function Bridge(wall) { + var _this; + bridge_classCallCheck(this, Bridge); + _this = _super.call(this); + bridge_defineProperty(_assertThisInitialized(_this), "_isShutdown", false); + bridge_defineProperty(_assertThisInitialized(_this), "_messageQueue", []); + bridge_defineProperty(_assertThisInitialized(_this), "_timeoutID", null); + bridge_defineProperty(_assertThisInitialized(_this), "_wallUnlisten", null); + bridge_defineProperty(_assertThisInitialized(_this), "_flush", function () { + // This method is used after the bridge is marked as destroyed in shutdown sequence, + // so we do not bail out if the bridge marked as destroyed. + // It is a private method that the bridge ensures is only called at the right times. + if (_this._timeoutID !== null) { + clearTimeout(_this._timeoutID); + _this._timeoutID = null; + } + if (_this._messageQueue.length) { + for (var i = 0; i < _this._messageQueue.length; i += 2) { + var _this$_wall; + (_this$_wall = _this._wall).send.apply(_this$_wall, [_this._messageQueue[i]].concat(bridge_toConsumableArray(_this._messageQueue[i + 1]))); + } + _this._messageQueue.length = 0; // Check again for queued messages in BATCH_DURATION ms. This will keep + // flushing in a loop as long as messages continue to be added. Once no + // more are, the timer expires. + + _this._timeoutID = setTimeout(_this._flush, BATCH_DURATION); + } + }); + bridge_defineProperty(_assertThisInitialized(_this), "overrideValueAtPath", function (_ref) { + var id = _ref.id, + path = _ref.path, + rendererID = _ref.rendererID, + type = _ref.type, + value = _ref.value; + switch (type) { + case 'context': + _this.send('overrideContext', { + id: id, + path: path, + rendererID: rendererID, + wasForwarded: true, + value: value + }); + break; + case 'hooks': + _this.send('overrideHookState', { + id: id, + path: path, + rendererID: rendererID, + wasForwarded: true, + value: value + }); + break; + case 'props': + _this.send('overrideProps', { + id: id, + path: path, + rendererID: rendererID, + wasForwarded: true, + value: value + }); + break; + case 'state': + _this.send('overrideState', { + id: id, + path: path, + rendererID: rendererID, + wasForwarded: true, + value: value + }); + break; + } + }); + _this._wall = wall; + _this._wallUnlisten = wall.listen(function (message) { + if (message && message.event) { + _assertThisInitialized(_this).emit(message.event, message.payload); + } + }) || null; // Temporarily support older standalone front-ends sending commands to newer embedded backends. + // We do this because React Native embeds the React DevTools backend, + // but cannot control which version of the frontend users use. + + _this.addListener('overrideValueAtPath', _this.overrideValueAtPath); + return _this; + } // Listening directly to the wall isn't advised. + // It can be used to listen for legacy (v3) messages (since they use a different format). + + bridge_createClass(Bridge, [{ + key: "send", + value: function send(event) { + if (this._isShutdown) { + console.warn("Cannot send message \"".concat(event, "\" through a Bridge that has been shutdown.")); + return; + } // When we receive a message: + // - we add it to our queue of messages to be sent + // - if there hasn't been a message recently, we set a timer for 0 ms in + // the future, allowing all messages created in the same tick to be sent + // together + // - if there *has* been a message flushed in the last BATCH_DURATION ms + // (or we're waiting for our setTimeout-0 to fire), then _timeoutID will + // be set, and we'll simply add to the queue and wait for that + + for (var _len = arguments.length, payload = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + payload[_key - 1] = arguments[_key]; + } + this._messageQueue.push(event, payload); + if (!this._timeoutID) { + this._timeoutID = setTimeout(this._flush, 0); + } + } + }, { + key: "shutdown", + value: function shutdown() { + if (this._isShutdown) { + console.warn('Bridge was already shutdown.'); + return; + } // Queue the shutdown outgoing message for subscribers. + + this.emit('shutdown'); + this.send('shutdown'); // Mark this bridge as destroyed, i.e. disable its public API. + + this._isShutdown = true; // Disable the API inherited from EventEmitter that can add more listeners and send more messages. + // $FlowFixMe[cannot-write] This property is not writable. + + this.addListener = function () {}; // $FlowFixMe[cannot-write] This property is not writable. + + this.emit = function () {}; // NOTE: There's also EventEmitter API like `on` and `prependListener` that we didn't add to our Flow type of EventEmitter. + // Unsubscribe this bridge incoming message listeners to be sure, and so they don't have to do that. + + this.removeAllListeners(); // Stop accepting and emitting incoming messages from the wall. + + var wallUnlisten = this._wallUnlisten; + if (wallUnlisten) { + wallUnlisten(); + } // Synchronously flush all queued outgoing messages. + // At this step the subscribers' code may run in this call stack. + + do { + this._flush(); + } while (this._messageQueue.length); // Make sure once again that there is no dangling timer. + + if (this._timeoutID !== null) { + clearTimeout(this._timeoutID); + this._timeoutID = null; + } + } + }, { + key: "wall", + get: function get() { + return this._wall; + } + }]); + return Bridge; + }(EventEmitter); + + /* harmony default export */ + var src_bridge = Bridge; + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/agent.js + function agent_typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + agent_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + agent_typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return agent_typeof(obj); + } + function agent_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function agent_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function agent_createClass(Constructor, protoProps, staticProps) { + if (protoProps) agent_defineProperties(Constructor.prototype, protoProps); + if (staticProps) agent_defineProperties(Constructor, staticProps); + return Constructor; + } + function agent_inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) agent_setPrototypeOf(subClass, superClass); + } + function agent_setPrototypeOf(o, p) { + agent_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return agent_setPrototypeOf(o, p); + } + function agent_createSuper(Derived) { + var hasNativeReflectConstruct = agent_isNativeReflectConstruct(); + return function _createSuperInternal() { + var Super = agent_getPrototypeOf(Derived), + result; + if (hasNativeReflectConstruct) { + var NewTarget = agent_getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return agent_possibleConstructorReturn(this, result); + }; + } + function agent_possibleConstructorReturn(self, call) { + if (call && (agent_typeof(call) === "object" || typeof call === "function")) { + return call; + } + return agent_assertThisInitialized(self); + } + function agent_assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self; + } + function agent_isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); + return true; + } catch (e) { + return false; + } + } + function agent_getPrototypeOf(o) { + agent_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return agent_getPrototypeOf(o); + } + function agent_defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + var debug = function debug(methodName) { + if (__DEBUG__) { + var _console; + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + (_console = console).log.apply(_console, ["%cAgent %c".concat(methodName), 'color: purple; font-weight: bold;', 'font-weight: bold;'].concat(args)); + } + }; + var Agent = /*#__PURE__*/function (_EventEmitter) { + agent_inherits(Agent, _EventEmitter); + var _super = agent_createSuper(Agent); + function Agent(bridge) { + var _this; + agent_classCallCheck(this, Agent); + _this = _super.call(this); + agent_defineProperty(agent_assertThisInitialized(_this), "_isProfiling", false); + agent_defineProperty(agent_assertThisInitialized(_this), "_recordChangeDescriptions", false); + agent_defineProperty(agent_assertThisInitialized(_this), "_rendererInterfaces", {}); + agent_defineProperty(agent_assertThisInitialized(_this), "_persistedSelection", null); + agent_defineProperty(agent_assertThisInitialized(_this), "_persistedSelectionMatch", null); + agent_defineProperty(agent_assertThisInitialized(_this), "_traceUpdatesEnabled", false); + agent_defineProperty(agent_assertThisInitialized(_this), "clearErrorsAndWarnings", function (_ref) { + var rendererID = _ref.rendererID; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\"")); + } else { + renderer.clearErrorsAndWarnings(); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "clearErrorsForFiberID", function (_ref2) { + var id = _ref2.id, + rendererID = _ref2.rendererID; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\"")); + } else { + renderer.clearErrorsForFiberID(id); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "clearWarningsForFiberID", function (_ref3) { + var id = _ref3.id, + rendererID = _ref3.rendererID; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\"")); + } else { + renderer.clearWarningsForFiberID(id); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "copyElementPath", function (_ref4) { + var id = _ref4.id, + path = _ref4.path, + rendererID = _ref4.rendererID; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\"")); + } else { + var value = renderer.getSerializedElementValueByPath(id, path); + if (value != null) { + _this._bridge.send('saveToClipboard', value); + } else { + console.warn("Unable to obtain serialized value for element \"".concat(id, "\"")); + } + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "deletePath", function (_ref5) { + var hookID = _ref5.hookID, + id = _ref5.id, + path = _ref5.path, + rendererID = _ref5.rendererID, + type = _ref5.type; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\"")); + } else { + renderer.deletePath(type, id, hookID, path); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "getBackendVersion", function () { + var version = "4.28.5-ef8a840bd"; + if (version) { + _this._bridge.send('backendVersion', version); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "getBridgeProtocol", function () { + _this._bridge.send('bridgeProtocol', currentBridgeProtocol); + }); + agent_defineProperty(agent_assertThisInitialized(_this), "getProfilingData", function (_ref6) { + var rendererID = _ref6.rendererID; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\"")); + } + _this._bridge.send('profilingData', renderer.getProfilingData()); + }); + agent_defineProperty(agent_assertThisInitialized(_this), "getProfilingStatus", function () { + _this._bridge.send('profilingStatus', _this._isProfiling); + }); + agent_defineProperty(agent_assertThisInitialized(_this), "getOwnersList", function (_ref7) { + var id = _ref7.id, + rendererID = _ref7.rendererID; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\"")); + } else { + var owners = renderer.getOwnersList(id); + _this._bridge.send('ownersList', { + id: id, + owners: owners + }); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "inspectElement", function (_ref8) { + var forceFullData = _ref8.forceFullData, + id = _ref8.id, + path = _ref8.path, + rendererID = _ref8.rendererID, + requestID = _ref8.requestID; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\"")); + } else { + _this._bridge.send('inspectedElement', renderer.inspectElement(requestID, id, path, forceFullData)); // When user selects an element, stop trying to restore the selection, + // and instead remember the current selection for the next reload. + + if (_this._persistedSelectionMatch === null || _this._persistedSelectionMatch.id !== id) { + _this._persistedSelection = null; + _this._persistedSelectionMatch = null; + renderer.setTrackedPath(null); + _this._throttledPersistSelection(rendererID, id); + } // TODO: If there was a way to change the selected DOM element + // in native Elements tab without forcing a switch to it, we'd do it here. + // For now, it doesn't seem like there is a way to do that: + // https://github.com/bvaughn/react-devtools-experimental/issues/102 + // (Setting $0 doesn't work, and calling inspect() switches the tab.) + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "logElementToConsole", function (_ref9) { + var id = _ref9.id, + rendererID = _ref9.rendererID; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\"")); + } else { + renderer.logElementToConsole(id); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "overrideError", function (_ref10) { + var id = _ref10.id, + rendererID = _ref10.rendererID, + forceError = _ref10.forceError; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\"")); + } else { + renderer.overrideError(id, forceError); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "overrideSuspense", function (_ref11) { + var id = _ref11.id, + rendererID = _ref11.rendererID, + forceFallback = _ref11.forceFallback; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\"")); + } else { + renderer.overrideSuspense(id, forceFallback); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "overrideValueAtPath", function (_ref12) { + var hookID = _ref12.hookID, + id = _ref12.id, + path = _ref12.path, + rendererID = _ref12.rendererID, + type = _ref12.type, + value = _ref12.value; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\"")); + } else { + renderer.overrideValueAtPath(type, id, hookID, path, value); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "overrideContext", function (_ref13) { + var id = _ref13.id, + path = _ref13.path, + rendererID = _ref13.rendererID, + wasForwarded = _ref13.wasForwarded, + value = _ref13.value; + + // Don't forward a message that's already been forwarded by the front-end Bridge. + // We only need to process the override command once! + if (!wasForwarded) { + _this.overrideValueAtPath({ + id: id, + path: path, + rendererID: rendererID, + type: 'context', + value: value + }); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "overrideHookState", function (_ref14) { + var id = _ref14.id, + hookID = _ref14.hookID, + path = _ref14.path, + rendererID = _ref14.rendererID, + wasForwarded = _ref14.wasForwarded, + value = _ref14.value; + + // Don't forward a message that's already been forwarded by the front-end Bridge. + // We only need to process the override command once! + if (!wasForwarded) { + _this.overrideValueAtPath({ + id: id, + path: path, + rendererID: rendererID, + type: 'hooks', + value: value + }); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "overrideProps", function (_ref15) { + var id = _ref15.id, + path = _ref15.path, + rendererID = _ref15.rendererID, + wasForwarded = _ref15.wasForwarded, + value = _ref15.value; + + // Don't forward a message that's already been forwarded by the front-end Bridge. + // We only need to process the override command once! + if (!wasForwarded) { + _this.overrideValueAtPath({ + id: id, + path: path, + rendererID: rendererID, + type: 'props', + value: value + }); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "overrideState", function (_ref16) { + var id = _ref16.id, + path = _ref16.path, + rendererID = _ref16.rendererID, + wasForwarded = _ref16.wasForwarded, + value = _ref16.value; + + // Don't forward a message that's already been forwarded by the front-end Bridge. + // We only need to process the override command once! + if (!wasForwarded) { + _this.overrideValueAtPath({ + id: id, + path: path, + rendererID: rendererID, + type: 'state', + value: value + }); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "reloadAndProfile", function (recordChangeDescriptions) { + sessionStorageSetItem(SESSION_STORAGE_RELOAD_AND_PROFILE_KEY, 'true'); + sessionStorageSetItem(SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY, recordChangeDescriptions ? 'true' : 'false'); // This code path should only be hit if the shell has explicitly told the Store that it supports profiling. + // In that case, the shell must also listen for this specific message to know when it needs to reload the app. + // The agent can't do this in a way that is renderer agnostic. + + _this._bridge.send('reloadAppForProfiling'); + }); + agent_defineProperty(agent_assertThisInitialized(_this), "renamePath", function (_ref17) { + var hookID = _ref17.hookID, + id = _ref17.id, + newPath = _ref17.newPath, + oldPath = _ref17.oldPath, + rendererID = _ref17.rendererID, + type = _ref17.type; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\"")); + } else { + renderer.renamePath(type, id, hookID, oldPath, newPath); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "setTraceUpdatesEnabled", function (traceUpdatesEnabled) { + _this._traceUpdatesEnabled = traceUpdatesEnabled; + toggleEnabled(traceUpdatesEnabled); + for (var rendererID in _this._rendererInterfaces) { + var renderer = _this._rendererInterfaces[rendererID]; + renderer.setTraceUpdatesEnabled(traceUpdatesEnabled); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "syncSelectionFromNativeElementsPanel", function () { + var target = window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0; + if (target == null) { + return; + } + _this.selectNode(target); + }); + agent_defineProperty(agent_assertThisInitialized(_this), "shutdown", function () { + // Clean up the overlay if visible, and associated events. + _this.emit('shutdown'); + }); + agent_defineProperty(agent_assertThisInitialized(_this), "startProfiling", function (recordChangeDescriptions) { + _this._recordChangeDescriptions = recordChangeDescriptions; + _this._isProfiling = true; + for (var rendererID in _this._rendererInterfaces) { + var renderer = _this._rendererInterfaces[rendererID]; + renderer.startProfiling(recordChangeDescriptions); + } + _this._bridge.send('profilingStatus', _this._isProfiling); + }); + agent_defineProperty(agent_assertThisInitialized(_this), "stopProfiling", function () { + _this._isProfiling = false; + _this._recordChangeDescriptions = false; + for (var rendererID in _this._rendererInterfaces) { + var renderer = _this._rendererInterfaces[rendererID]; + renderer.stopProfiling(); + } + _this._bridge.send('profilingStatus', _this._isProfiling); + }); + agent_defineProperty(agent_assertThisInitialized(_this), "stopInspectingNative", function (selected) { + _this._bridge.send('stopInspectingNative', selected); + }); + agent_defineProperty(agent_assertThisInitialized(_this), "storeAsGlobal", function (_ref18) { + var count = _ref18.count, + id = _ref18.id, + path = _ref18.path, + rendererID = _ref18.rendererID; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\"")); + } else { + renderer.storeAsGlobal(id, path, count); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "updateConsolePatchSettings", function (_ref19) { + var appendComponentStack = _ref19.appendComponentStack, + breakOnConsoleErrors = _ref19.breakOnConsoleErrors, + showInlineWarningsAndErrors = _ref19.showInlineWarningsAndErrors, + hideConsoleLogsInStrictMode = _ref19.hideConsoleLogsInStrictMode, + browserTheme = _ref19.browserTheme; + // If the frontend preferences have changed, + // or in the case of React Native- if the backend is just finding out the preferences- + // then reinstall the console overrides. + // It's safe to call `patchConsole` multiple times. + patch({ + appendComponentStack: appendComponentStack, + breakOnConsoleErrors: breakOnConsoleErrors, + showInlineWarningsAndErrors: showInlineWarningsAndErrors, + hideConsoleLogsInStrictMode: hideConsoleLogsInStrictMode, + browserTheme: browserTheme + }); + }); + agent_defineProperty(agent_assertThisInitialized(_this), "updateComponentFilters", function (componentFilters) { + for (var rendererID in _this._rendererInterfaces) { + var renderer = _this._rendererInterfaces[rendererID]; + renderer.updateComponentFilters(componentFilters); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "viewAttributeSource", function (_ref20) { + var id = _ref20.id, + path = _ref20.path, + rendererID = _ref20.rendererID; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\"")); + } else { + renderer.prepareViewAttributeSource(id, path); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "viewElementSource", function (_ref21) { + var id = _ref21.id, + rendererID = _ref21.rendererID; + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\" for element \"").concat(id, "\"")); + } else { + renderer.prepareViewElementSource(id); + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "onTraceUpdates", function (nodes) { + _this.emit('traceUpdates', nodes); + }); + agent_defineProperty(agent_assertThisInitialized(_this), "onFastRefreshScheduled", function () { + if (__DEBUG__) { + debug('onFastRefreshScheduled'); + } + _this._bridge.send('fastRefreshScheduled'); + }); + agent_defineProperty(agent_assertThisInitialized(_this), "onHookOperations", function (operations) { + if (__DEBUG__) { + debug('onHookOperations', "(".concat(operations.length, ") [").concat(operations.join(', '), "]")); + } // TODO: + // The chrome.runtime does not currently support transferables; it forces JSON serialization. + // See bug https://bugs.chromium.org/p/chromium/issues/detail?id=927134 + // + // Regarding transferables, the postMessage doc states: + // If the ownership of an object is transferred, it becomes unusable (neutered) + // in the context it was sent from and becomes available only to the worker it was sent to. + // + // Even though Chrome is eventually JSON serializing the array buffer, + // using the transferable approach also sometimes causes it to throw: + // DOMException: Failed to execute 'postMessage' on 'Window': ArrayBuffer at index 0 is already neutered. + // + // See bug https://github.com/bvaughn/react-devtools-experimental/issues/25 + // + // The Store has a fallback in place that parses the message as JSON if the type isn't an array. + // For now the simplest fix seems to be to not transfer the array. + // This will negatively impact performance on Firefox so it's unfortunate, + // but until we're able to fix the Chrome error mentioned above, it seems necessary. + // + // this._bridge.send('operations', operations, [operations.buffer]); + + _this._bridge.send('operations', operations); + if (_this._persistedSelection !== null) { + var rendererID = operations[0]; + if (_this._persistedSelection.rendererID === rendererID) { + // Check if we can select a deeper match for the persisted selection. + var renderer = _this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\"")); + } else { + var prevMatch = _this._persistedSelectionMatch; + var nextMatch = renderer.getBestMatchForTrackedPath(); + _this._persistedSelectionMatch = nextMatch; + var prevMatchID = prevMatch !== null ? prevMatch.id : null; + var nextMatchID = nextMatch !== null ? nextMatch.id : null; + if (prevMatchID !== nextMatchID) { + if (nextMatchID !== null) { + // We moved forward, unlocking a deeper node. + _this._bridge.send('selectFiber', nextMatchID); + } + } + if (nextMatch !== null && nextMatch.isFullMatch) { + // We've just unlocked the innermost selected node. + // There's no point tracking it further. + _this._persistedSelection = null; + _this._persistedSelectionMatch = null; + renderer.setTrackedPath(null); + } + } + } + } + }); + agent_defineProperty(agent_assertThisInitialized(_this), "_throttledPersistSelection", lodash_throttle_default()(function (rendererID, id) { + // This is throttled, so both renderer and selected ID + // might not be available by the time we read them. + // This is why we need the defensive checks here. + var renderer = _this._rendererInterfaces[rendererID]; + var path = renderer != null ? renderer.getPathForElement(id) : null; + if (path !== null) { + sessionStorageSetItem(SESSION_STORAGE_LAST_SELECTION_KEY, JSON.stringify({ + rendererID: rendererID, + path: path + })); + } else { + sessionStorageRemoveItem(SESSION_STORAGE_LAST_SELECTION_KEY); + } + }, 1000)); + if (sessionStorageGetItem(SESSION_STORAGE_RELOAD_AND_PROFILE_KEY) === 'true') { + _this._recordChangeDescriptions = sessionStorageGetItem(SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY) === 'true'; + _this._isProfiling = true; + sessionStorageRemoveItem(SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY); + sessionStorageRemoveItem(SESSION_STORAGE_RELOAD_AND_PROFILE_KEY); + } + var persistedSelectionString = sessionStorageGetItem(SESSION_STORAGE_LAST_SELECTION_KEY); + if (persistedSelectionString != null) { + _this._persistedSelection = JSON.parse(persistedSelectionString); + } + _this._bridge = bridge; + bridge.addListener('clearErrorsAndWarnings', _this.clearErrorsAndWarnings); + bridge.addListener('clearErrorsForFiberID', _this.clearErrorsForFiberID); + bridge.addListener('clearWarningsForFiberID', _this.clearWarningsForFiberID); + bridge.addListener('copyElementPath', _this.copyElementPath); + bridge.addListener('deletePath', _this.deletePath); + bridge.addListener('getBackendVersion', _this.getBackendVersion); + bridge.addListener('getBridgeProtocol', _this.getBridgeProtocol); + bridge.addListener('getProfilingData', _this.getProfilingData); + bridge.addListener('getProfilingStatus', _this.getProfilingStatus); + bridge.addListener('getOwnersList', _this.getOwnersList); + bridge.addListener('inspectElement', _this.inspectElement); + bridge.addListener('logElementToConsole', _this.logElementToConsole); + bridge.addListener('overrideError', _this.overrideError); + bridge.addListener('overrideSuspense', _this.overrideSuspense); + bridge.addListener('overrideValueAtPath', _this.overrideValueAtPath); + bridge.addListener('reloadAndProfile', _this.reloadAndProfile); + bridge.addListener('renamePath', _this.renamePath); + bridge.addListener('setTraceUpdatesEnabled', _this.setTraceUpdatesEnabled); + bridge.addListener('startProfiling', _this.startProfiling); + bridge.addListener('stopProfiling', _this.stopProfiling); + bridge.addListener('storeAsGlobal', _this.storeAsGlobal); + bridge.addListener('syncSelectionFromNativeElementsPanel', _this.syncSelectionFromNativeElementsPanel); + bridge.addListener('shutdown', _this.shutdown); + bridge.addListener('updateConsolePatchSettings', _this.updateConsolePatchSettings); + bridge.addListener('updateComponentFilters', _this.updateComponentFilters); + bridge.addListener('viewAttributeSource', _this.viewAttributeSource); + bridge.addListener('viewElementSource', _this.viewElementSource); // Temporarily support older standalone front-ends sending commands to newer embedded backends. + // We do this because React Native embeds the React DevTools backend, + // but cannot control which version of the frontend users use. + + bridge.addListener('overrideContext', _this.overrideContext); + bridge.addListener('overrideHookState', _this.overrideHookState); + bridge.addListener('overrideProps', _this.overrideProps); + bridge.addListener('overrideState', _this.overrideState); + if (_this._isProfiling) { + bridge.send('profilingStatus', true); + } // Send the Bridge protocol and backend versions, after initialization, in case the frontend has already requested it. + // The Store may be instantiated beore the agent. + + var _version = "4.28.5-ef8a840bd"; + if (_version) { + _this._bridge.send('backendVersion', _version); + } + _this._bridge.send('bridgeProtocol', currentBridgeProtocol); // Notify the frontend if the backend supports the Storage API (e.g. localStorage). + // If not, features like reload-and-profile will not work correctly and must be disabled. + + var isBackendStorageAPISupported = false; + try { + localStorage.getItem('test'); + isBackendStorageAPISupported = true; + } catch (error) {} + bridge.send('isBackendStorageAPISupported', isBackendStorageAPISupported); + bridge.send('isSynchronousXHRSupported', isSynchronousXHRSupported()); + setupHighlighter(bridge, agent_assertThisInitialized(_this)); + TraceUpdates_initialize(agent_assertThisInitialized(_this)); + return _this; + } + agent_createClass(Agent, [{ + key: "getInstanceAndStyle", + value: function getInstanceAndStyle(_ref22) { + var id = _ref22.id, + rendererID = _ref22.rendererID; + var renderer = this._rendererInterfaces[rendererID]; + if (renderer == null) { + console.warn("Invalid renderer id \"".concat(rendererID, "\"")); + return null; + } + return renderer.getInstanceAndStyle(id); + } + }, { + key: "getBestMatchingRendererInterface", + value: function getBestMatchingRendererInterface(node) { + var bestMatch = null; + for (var rendererID in this._rendererInterfaces) { + var renderer = this._rendererInterfaces[rendererID]; + var fiber = renderer.getFiberForNative(node); + if (fiber !== null) { + // check if fiber.stateNode is matching the original hostInstance + if (fiber.stateNode === node) { + return renderer; + } else if (bestMatch === null) { + bestMatch = renderer; + } + } + } // if an exact match is not found, return the first valid renderer as fallback + + return bestMatch; + } + }, { + key: "getIDForNode", + value: function getIDForNode(node) { + var rendererInterface = this.getBestMatchingRendererInterface(node); + if (rendererInterface != null) { + try { + return rendererInterface.getFiberIDForNative(node, true); + } catch (error) {// Some old React versions might throw if they can't find a match. + // If so we should ignore it... + } + } + return null; + } + }, { + key: "selectNode", + value: function selectNode(target) { + var id = this.getIDForNode(target); + if (id !== null) { + this._bridge.send('selectFiber', id); + } + } + }, { + key: "setRendererInterface", + value: function setRendererInterface(rendererID, rendererInterface) { + this._rendererInterfaces[rendererID] = rendererInterface; + if (this._isProfiling) { + rendererInterface.startProfiling(this._recordChangeDescriptions); + } + rendererInterface.setTraceUpdatesEnabled(this._traceUpdatesEnabled); // When the renderer is attached, we need to tell it whether + // we remember the previous selection that we'd like to restore. + // It'll start tracking mounts for matches to the last selection path. + + var selection = this._persistedSelection; + if (selection !== null && selection.rendererID === rendererID) { + rendererInterface.setTrackedPath(selection.path); + } + } + }, { + key: "onUnsupportedRenderer", + value: function onUnsupportedRenderer(rendererID) { + this._bridge.send('unsupportedRendererVersion', rendererID); + } + }, { + key: "rendererInterfaces", + get: function get() { + return this._rendererInterfaces; + } + }]); + return Agent; + }(EventEmitter); + ; // CONCATENATED MODULE: ../react-devtools-shared/src/hook.js + function hook_typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + hook_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + hook_typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return hook_typeof(obj); + } + function hook_toConsumableArray(arr) { + return hook_arrayWithoutHoles(arr) || hook_iterableToArray(arr) || hook_unsupportedIterableToArray(arr) || hook_nonIterableSpread(); + } + function hook_nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function hook_unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return hook_arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return hook_arrayLikeToArray(o, minLen); + } + function hook_iterableToArray(iter) { + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + } + function hook_arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return hook_arrayLikeToArray(arr); + } + function hook_arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + + /** + * Install the hook on window, which is an event emitter. + * Note: this global hook __REACT_DEVTOOLS_GLOBAL_HOOK__ is a de facto public API. + * It's especially important to avoid creating direct dependency on the DevTools Backend. + * That's why we still inline the whole event emitter implementation, + * the string format implementation, and part of the console implementation here. + * + * + */ + function installHook(target) { + if (target.hasOwnProperty('__REACT_DEVTOOLS_GLOBAL_HOOK__')) { + return null; + } + var targetConsole = console; + var targetConsoleMethods = {}; + for (var method in console) { + targetConsoleMethods[method] = console[method]; + } + function dangerous_setTargetConsoleForTesting(targetConsoleForTesting) { + targetConsole = targetConsoleForTesting; + targetConsoleMethods = {}; + for (var _method in targetConsole) { + targetConsoleMethods[_method] = console[_method]; + } + } + function detectReactBuildType(renderer) { + try { + if (typeof renderer.version === 'string') { + // React DOM Fiber (16+) + if (renderer.bundleType > 0) { + // This is not a production build. + // We are currently only using 0 (PROD) and 1 (DEV) + // but might add 2 (PROFILE) in the future. + return 'development'; + } // React 16 uses flat bundles. If we report the bundle as production + // version, it means we also minified and envified it ourselves. + + return 'production'; // Note: There is still a risk that the CommonJS entry point has not + // been envified or uglified. In this case the user would have *both* + // development and production bundle, but only the prod one would run. + // This would be really bad. We have a separate check for this because + // it happens *outside* of the renderer injection. See `checkDCE` below. + } // $FlowFixMe[method-unbinding] + + var _toString = Function.prototype.toString; + if (renderer.Mount && renderer.Mount._renderNewRootComponent) { + // React DOM Stack + var renderRootCode = _toString.call(renderer.Mount._renderNewRootComponent); // Filter out bad results (if that is even possible): + + if (renderRootCode.indexOf('function') !== 0) { + // Hope for the best if we're not sure. + return 'production'; + } // Check for React DOM Stack < 15.1.0 in development. + // If it contains "storedMeasure" call, it's wrapped in ReactPerf (DEV only). + // This would be true even if it's minified, as method name still matches. + + if (renderRootCode.indexOf('storedMeasure') !== -1) { + return 'development'; + } // For other versions (and configurations) it's not so easy. + // Let's quickly exclude proper production builds. + // If it contains a warning message, it's either a DEV build, + // or an PROD build without proper dead code elimination. + + if (renderRootCode.indexOf('should be a pure function') !== -1) { + // Now how do we tell a DEV build from a bad PROD build? + // If we see NODE_ENV, we're going to assume this is a dev build + // because most likely it is referring to an empty shim. + if (renderRootCode.indexOf('NODE_ENV') !== -1) { + return 'development'; + } // If we see "development", we're dealing with an envified DEV build + // (such as the official React DEV UMD). + + if (renderRootCode.indexOf('development') !== -1) { + return 'development'; + } // I've seen process.env.NODE_ENV !== 'production' being smartly + // replaced by `true` in DEV by Webpack. I don't know how that + // works but we can safely guard against it because `true` was + // never used in the function source since it was written. + + if (renderRootCode.indexOf('true') !== -1) { + return 'development'; + } // By now either it is a production build that has not been minified, + // or (worse) this is a minified development build using non-standard + // environment (e.g. "staging"). We're going to look at whether + // the function argument name is mangled: + + if ( + // 0.13 to 15 + renderRootCode.indexOf('nextElement') !== -1 || + // 0.12 + renderRootCode.indexOf('nextComponent') !== -1) { + // We can't be certain whether this is a development build or not, + // but it is definitely unminified. + return 'unminified'; + } else { + // This is likely a minified development build. + return 'development'; + } + } // By now we know that it's envified and dead code elimination worked, + // but what if it's still not minified? (Is this even possible?) + // Let's check matches for the first argument name. + + if ( + // 0.13 to 15 + renderRootCode.indexOf('nextElement') !== -1 || + // 0.12 + renderRootCode.indexOf('nextComponent') !== -1) { + return 'unminified'; + } // Seems like we're using the production version. + // However, the branch above is Stack-only so this is 15 or earlier. + + return 'outdated'; + } + } catch (err) {// Weird environments may exist. + // This code needs a higher fault tolerance + // because it runs even with closed DevTools. + // TODO: should we catch errors in all injected code, and not just this part? + } + return 'production'; + } + function checkDCE(fn) { + // This runs for production versions of React. + // Needs to be super safe. + try { + // $FlowFixMe[method-unbinding] + var _toString2 = Function.prototype.toString; + var code = _toString2.call(fn); // This is a string embedded in the passed function under DEV-only + // condition. However the function executes only in PROD. Therefore, + // if we see it, dead code elimination did not work. + + if (code.indexOf('^_^') > -1) { + // Remember to report during next injection. + hasDetectedBadDCE = true; // Bonus: throw an exception hoping that it gets picked up by a reporting system. + // Not synchronously so that it doesn't break the calling code. + + setTimeout(function () { + throw new Error('React is running in production mode, but dead code ' + 'elimination has not been applied. Read how to correctly ' + 'configure React for production: ' + 'https://reactjs.org/link/perf-use-production-build'); + }); + } + } catch (err) {} + } // NOTE: KEEP IN SYNC with src/backend/utils.js + + function formatWithStyles(inputArgs, style) { + if (inputArgs === undefined || inputArgs === null || inputArgs.length === 0 || + // Matches any of %c but not %%c + typeof inputArgs[0] === 'string' && inputArgs[0].match(/([^%]|^)(%c)/g) || style === undefined) { + return inputArgs; + } // Matches any of %(o|O|d|i|s|f), but not %%(o|O|d|i|s|f) + + var REGEXP = /([^%]|^)((%%)*)(%([oOdisf]))/g; + if (typeof inputArgs[0] === 'string' && inputArgs[0].match(REGEXP)) { + return ["%c".concat(inputArgs[0]), style].concat(hook_toConsumableArray(inputArgs.slice(1))); + } else { + var firstArg = inputArgs.reduce(function (formatStr, elem, i) { + if (i > 0) { + formatStr += ' '; + } + switch (hook_typeof(elem)) { + case 'string': + case 'boolean': + case 'symbol': + return formatStr += '%s'; + case 'number': + var formatting = Number.isInteger(elem) ? '%i' : '%f'; + return formatStr += formatting; + default: + return formatStr += '%o'; + } + }, '%c'); + return [firstArg, style].concat(hook_toConsumableArray(inputArgs)); + } + } + var unpatchFn = null; // NOTE: KEEP IN SYNC with src/backend/console.js:patchForStrictMode + // This function hides or dims console logs during the initial double renderer + // in Strict Mode. We need this function because during initial render, + // React and DevTools are connecting and the renderer interface isn't avaiable + // and we want to be able to have consistent logging behavior for double logs + // during the initial renderer. + + function patchConsoleForInitialRenderInStrictMode(_ref) { + var hideConsoleLogsInStrictMode = _ref.hideConsoleLogsInStrictMode, + browserTheme = _ref.browserTheme; + var overrideConsoleMethods = ['error', 'group', 'groupCollapsed', 'info', 'log', 'trace', 'warn']; + if (unpatchFn !== null) { + // Don't patch twice. + return; + } + var originalConsoleMethods = {}; + unpatchFn = function unpatchFn() { + for (var _method2 in originalConsoleMethods) { + try { + targetConsole[_method2] = originalConsoleMethods[_method2]; + } catch (error) {} + } + }; + overrideConsoleMethods.forEach(function (method) { + try { + var originalMethod = originalConsoleMethods[method] = targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ ? targetConsole[method].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ : targetConsole[method]; + var overrideMethod = function overrideMethod() { + if (!hideConsoleLogsInStrictMode) { + // Dim the text color of the double logs if we're not + // hiding them. + var color; + switch (method) { + case 'warn': + color = browserTheme === 'light' ? "rgba(250, 180, 50, 0.75)" : "rgba(250, 180, 50, 0.5)"; + break; + case 'error': + color = browserTheme === 'light' ? "rgba(250, 123, 130, 0.75)" : "rgba(250, 123, 130, 0.5)"; + break; + case 'log': + default: + color = browserTheme === 'light' ? "rgba(125, 125, 125, 0.75)" : "rgba(125, 125, 125, 0.5)"; + break; + } + if (color) { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + originalMethod.apply(void 0, hook_toConsumableArray(formatWithStyles(args, "color: ".concat(color)))); + } else { + throw Error('Console color is not defined'); + } + } + }; + overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ = originalMethod; + originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ = overrideMethod; + targetConsole[method] = overrideMethod; + } catch (error) {} + }); + } // NOTE: KEEP IN SYNC with src/backend/console.js:unpatchForStrictMode + + function unpatchConsoleForInitialRenderInStrictMode() { + if (unpatchFn !== null) { + unpatchFn(); + unpatchFn = null; + } + } + var uidCounter = 0; + function inject(renderer) { + var id = ++uidCounter; + renderers.set(id, renderer); + var reactBuildType = hasDetectedBadDCE ? 'deadcode' : detectReactBuildType(renderer); // Patching the console enables DevTools to do a few useful things: + // * Append component stacks to warnings and error messages + // * Disabling or marking logs during a double render in Strict Mode + // * Disable logging during re-renders to inspect hooks (see inspectHooksOfFiber) + // + // Allow patching console early (during injection) to + // provide developers with components stacks even if they don't run DevTools. + + if (target.hasOwnProperty('__REACT_DEVTOOLS_CONSOLE_FUNCTIONS__')) { + var _target$__REACT_DEVTO = target.__REACT_DEVTOOLS_CONSOLE_FUNCTIONS__, + registerRendererWithConsole = _target$__REACT_DEVTO.registerRendererWithConsole, + patchConsoleUsingWindowValues = _target$__REACT_DEVTO.patchConsoleUsingWindowValues; + if (typeof registerRendererWithConsole === 'function' && typeof patchConsoleUsingWindowValues === 'function') { + registerRendererWithConsole(renderer); + patchConsoleUsingWindowValues(); + } + } // If we have just reloaded to profile, we need to inject the renderer interface before the app loads. + // Otherwise the renderer won't yet exist and we can skip this step. + + var attach = target.__REACT_DEVTOOLS_ATTACH__; + if (typeof attach === 'function') { + var rendererInterface = attach(hook, id, renderer, target); + hook.rendererInterfaces.set(id, rendererInterface); + } + hook.emit('renderer', { + id: id, + renderer: renderer, + reactBuildType: reactBuildType + }); + return id; + } + var hasDetectedBadDCE = false; + function sub(event, fn) { + hook.on(event, fn); + return function () { + return hook.off(event, fn); + }; + } + function on(event, fn) { + if (!listeners[event]) { + listeners[event] = []; + } + listeners[event].push(fn); + } + function off(event, fn) { + if (!listeners[event]) { + return; + } + var index = listeners[event].indexOf(fn); + if (index !== -1) { + listeners[event].splice(index, 1); + } + if (!listeners[event].length) { + delete listeners[event]; + } + } + function emit(event, data) { + if (listeners[event]) { + listeners[event].map(function (fn) { + return fn(data); + }); + } + } + function getFiberRoots(rendererID) { + var roots = fiberRoots; + if (!roots[rendererID]) { + roots[rendererID] = new Set(); + } + return roots[rendererID]; + } + function onCommitFiberUnmount(rendererID, fiber) { + var rendererInterface = rendererInterfaces.get(rendererID); + if (rendererInterface != null) { + rendererInterface.handleCommitFiberUnmount(fiber); + } + } + function onCommitFiberRoot(rendererID, root, priorityLevel) { + var mountedRoots = hook.getFiberRoots(rendererID); + var current = root.current; + var isKnownRoot = mountedRoots.has(root); + var isUnmounting = current.memoizedState == null || current.memoizedState.element == null; // Keep track of mounted roots so we can hydrate when DevTools connect. + + if (!isKnownRoot && !isUnmounting) { + mountedRoots.add(root); + } else if (isKnownRoot && isUnmounting) { + mountedRoots.delete(root); + } + var rendererInterface = rendererInterfaces.get(rendererID); + if (rendererInterface != null) { + rendererInterface.handleCommitFiberRoot(root, priorityLevel); + } + } + function onPostCommitFiberRoot(rendererID, root) { + var rendererInterface = rendererInterfaces.get(rendererID); + if (rendererInterface != null) { + rendererInterface.handlePostCommitFiberRoot(root); + } + } + function setStrictMode(rendererID, isStrictMode) { + var rendererInterface = rendererInterfaces.get(rendererID); + if (rendererInterface != null) { + if (isStrictMode) { + rendererInterface.patchConsoleForStrictMode(); + } else { + rendererInterface.unpatchConsoleForStrictMode(); + } + } else { + // This should only happen during initial render in the extension before DevTools + // finishes its handshake with the injected renderer + if (isStrictMode) { + var hideConsoleLogsInStrictMode = window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ === true; + var browserTheme = window.__REACT_DEVTOOLS_BROWSER_THEME__; + patchConsoleForInitialRenderInStrictMode({ + hideConsoleLogsInStrictMode: hideConsoleLogsInStrictMode, + browserTheme: browserTheme + }); + } else { + unpatchConsoleForInitialRenderInStrictMode(); + } + } + } + var openModuleRangesStack = []; + var moduleRanges = []; + function getTopStackFrameString(error) { + var frames = error.stack.split('\n'); + var frame = frames.length > 1 ? frames[1] : null; + return frame; + } + function getInternalModuleRanges() { + return moduleRanges; + } + function registerInternalModuleStart(error) { + var startStackFrame = getTopStackFrameString(error); + if (startStackFrame !== null) { + openModuleRangesStack.push(startStackFrame); + } + } + function registerInternalModuleStop(error) { + if (openModuleRangesStack.length > 0) { + var startStackFrame = openModuleRangesStack.pop(); + var stopStackFrame = getTopStackFrameString(error); + if (stopStackFrame !== null) { + moduleRanges.push([startStackFrame, stopStackFrame]); + } + } + } // TODO: More meaningful names for "rendererInterfaces" and "renderers". + + var fiberRoots = {}; + var rendererInterfaces = new Map(); + var listeners = {}; + var renderers = new Map(); + var backends = new Map(); + var hook = { + rendererInterfaces: rendererInterfaces, + listeners: listeners, + backends: backends, + // Fast Refresh for web relies on this. + renderers: renderers, + emit: emit, + getFiberRoots: getFiberRoots, + inject: inject, + on: on, + off: off, + sub: sub, + // This is a legacy flag. + // React v16 checks the hook for this to ensure DevTools is new enough. + supportsFiber: true, + // React calls these methods. + checkDCE: checkDCE, + onCommitFiberUnmount: onCommitFiberUnmount, + onCommitFiberRoot: onCommitFiberRoot, + onPostCommitFiberRoot: onPostCommitFiberRoot, + setStrictMode: setStrictMode, + // Schedule Profiler runtime helpers. + // These internal React modules to report their own boundaries + // which in turn enables the profiler to dim or filter internal frames. + getInternalModuleRanges: getInternalModuleRanges, + registerInternalModuleStart: registerInternalModuleStart, + registerInternalModuleStop: registerInternalModuleStop + }; + if (false) {} + Object.defineProperty(target, '__REACT_DEVTOOLS_GLOBAL_HOOK__', { + // This property needs to be configurable for the test environment, + // else we won't be able to delete and recreate it between tests. + configurable: false, + enumerable: false, + get: function get() { + return hook; + } + }); + return hook; + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/legacy/utils.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + function decorate(object, attr, fn) { + var old = object[attr]; // $FlowFixMe[missing-this-annot] webpack config needs to be updated to allow `this` type annotations + + object[attr] = function (instance) { + return fn.call(this, old, arguments); + }; + return old; + } + function decorateMany(source, fns) { + var olds = {}; + for (var name in fns) { + olds[name] = decorate(source, name, fns[name]); + } + return olds; + } + function restoreMany(source, olds) { + for (var name in olds) { + source[name] = olds[name]; + } + } // $FlowFixMe[missing-this-annot] webpack config needs to be updated to allow `this` type annotations + + function forceUpdate(instance) { + if (typeof instance.forceUpdate === 'function') { + instance.forceUpdate(); + } else if (instance.updater != null && typeof instance.updater.enqueueForceUpdate === 'function') { + instance.updater.enqueueForceUpdate(this, function () {}, 'forceUpdate'); + } + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/legacy/renderer.js + function legacy_renderer_ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + return keys; + } + function legacy_renderer_objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + if (i % 2) { + legacy_renderer_ownKeys(Object(source), true).forEach(function (key) { + legacy_renderer_defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + legacy_renderer_ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + return target; + } + function legacy_renderer_defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + function legacy_renderer_typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + legacy_renderer_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + legacy_renderer_typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return legacy_renderer_typeof(obj); + } + + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + function getData(internalInstance) { + var displayName = null; + var key = null; // != used deliberately here to catch undefined and null + + if (internalInstance._currentElement != null) { + if (internalInstance._currentElement.key) { + key = String(internalInstance._currentElement.key); + } + var elementType = internalInstance._currentElement.type; + if (typeof elementType === 'string') { + displayName = elementType; + } else if (typeof elementType === 'function') { + displayName = getDisplayName(elementType); + } + } + return { + displayName: displayName, + key: key + }; + } + function getElementType(internalInstance) { + // != used deliberately here to catch undefined and null + if (internalInstance._currentElement != null) { + var elementType = internalInstance._currentElement.type; + if (typeof elementType === 'function') { + var publicInstance = internalInstance.getPublicInstance(); + if (publicInstance !== null) { + return types_ElementTypeClass; + } else { + return types_ElementTypeFunction; + } + } else if (typeof elementType === 'string') { + return ElementTypeHostComponent; + } + } + return ElementTypeOtherOrUnknown; + } + function getChildren(internalInstance) { + var children = []; // If the parent is a native node without rendered children, but with + // multiple string children, then the `element` that gets passed in here is + // a plain value -- a string or number. + + if (legacy_renderer_typeof(internalInstance) !== 'object') {// No children + } else if (internalInstance._currentElement === null || internalInstance._currentElement === false) {// No children + } else if (internalInstance._renderedComponent) { + var child = internalInstance._renderedComponent; + if (getElementType(child) !== ElementTypeOtherOrUnknown) { + children.push(child); + } + } else if (internalInstance._renderedChildren) { + var renderedChildren = internalInstance._renderedChildren; + for (var name in renderedChildren) { + var _child = renderedChildren[name]; + if (getElementType(_child) !== ElementTypeOtherOrUnknown) { + children.push(_child); + } + } + } // Note: we skip the case where children are just strings or numbers + // because the new DevTools skips over host text nodes anyway. + + return children; + } + function renderer_attach(hook, rendererID, renderer, global) { + var idToInternalInstanceMap = new Map(); + var internalInstanceToIDMap = new WeakMap(); + var internalInstanceToRootIDMap = new WeakMap(); + var getInternalIDForNative = null; + var findNativeNodeForInternalID; + var getFiberForNative = function getFiberForNative(node) { + // Not implemented. + return null; + }; + if (renderer.ComponentTree) { + getInternalIDForNative = function getInternalIDForNative(node, findNearestUnfilteredAncestor) { + var internalInstance = renderer.ComponentTree.getClosestInstanceFromNode(node); + return internalInstanceToIDMap.get(internalInstance) || null; + }; + findNativeNodeForInternalID = function findNativeNodeForInternalID(id) { + var internalInstance = idToInternalInstanceMap.get(id); + return renderer.ComponentTree.getNodeFromInstance(internalInstance); + }; + getFiberForNative = function getFiberForNative(node) { + return renderer.ComponentTree.getClosestInstanceFromNode(node); + }; + } else if (renderer.Mount.getID && renderer.Mount.getNode) { + getInternalIDForNative = function getInternalIDForNative(node, findNearestUnfilteredAncestor) { + // Not implemented. + return null; + }; + findNativeNodeForInternalID = function findNativeNodeForInternalID(id) { + // Not implemented. + return null; + }; + } + function getDisplayNameForFiberID(id) { + var internalInstance = idToInternalInstanceMap.get(id); + return internalInstance ? getData(internalInstance).displayName : null; + } + function getID(internalInstance) { + if (legacy_renderer_typeof(internalInstance) !== 'object' || internalInstance === null) { + throw new Error('Invalid internal instance: ' + internalInstance); + } + if (!internalInstanceToIDMap.has(internalInstance)) { + var _id = getUID(); + internalInstanceToIDMap.set(internalInstance, _id); + idToInternalInstanceMap.set(_id, internalInstance); + } + return internalInstanceToIDMap.get(internalInstance); + } + function areEqualArrays(a, b) { + if (a.length !== b.length) { + return false; + } + for (var i = 0; i < a.length; i++) { + if (a[i] !== b[i]) { + return false; + } + } + return true; + } // This is shared mutable state that lets us keep track of where we are. + + var parentIDStack = []; + var oldReconcilerMethods = null; + if (renderer.Reconciler) { + // React 15 + oldReconcilerMethods = decorateMany(renderer.Reconciler, { + mountComponent: function mountComponent(fn, args) { + var internalInstance = args[0]; + var hostContainerInfo = args[3]; + if (getElementType(internalInstance) === ElementTypeOtherOrUnknown) { + // $FlowFixMe[object-this-reference] found when upgrading Flow + return fn.apply(this, args); + } + if (hostContainerInfo._topLevelWrapper === undefined) { + // SSR + // $FlowFixMe[object-this-reference] found when upgrading Flow + return fn.apply(this, args); + } + var id = getID(internalInstance); // Push the operation. + + var parentID = parentIDStack.length > 0 ? parentIDStack[parentIDStack.length - 1] : 0; + recordMount(internalInstance, id, parentID); + parentIDStack.push(id); // Remember the root. + + internalInstanceToRootIDMap.set(internalInstance, getID(hostContainerInfo._topLevelWrapper)); + try { + // $FlowFixMe[object-this-reference] found when upgrading Flow + var result = fn.apply(this, args); + parentIDStack.pop(); + return result; + } catch (err) { + parentIDStack = []; + throw err; + } finally { + if (parentIDStack.length === 0) { + var rootID = internalInstanceToRootIDMap.get(internalInstance); + if (rootID === undefined) { + throw new Error('Expected to find root ID.'); + } + flushPendingEvents(rootID); + } + } + }, + performUpdateIfNecessary: function performUpdateIfNecessary(fn, args) { + var internalInstance = args[0]; + if (getElementType(internalInstance) === ElementTypeOtherOrUnknown) { + // $FlowFixMe[object-this-reference] found when upgrading Flow + return fn.apply(this, args); + } + var id = getID(internalInstance); + parentIDStack.push(id); + var prevChildren = getChildren(internalInstance); + try { + // $FlowFixMe[object-this-reference] found when upgrading Flow + var result = fn.apply(this, args); + var nextChildren = getChildren(internalInstance); + if (!areEqualArrays(prevChildren, nextChildren)) { + // Push the operation + recordReorder(internalInstance, id, nextChildren); + } + parentIDStack.pop(); + return result; + } catch (err) { + parentIDStack = []; + throw err; + } finally { + if (parentIDStack.length === 0) { + var rootID = internalInstanceToRootIDMap.get(internalInstance); + if (rootID === undefined) { + throw new Error('Expected to find root ID.'); + } + flushPendingEvents(rootID); + } + } + }, + receiveComponent: function receiveComponent(fn, args) { + var internalInstance = args[0]; + if (getElementType(internalInstance) === ElementTypeOtherOrUnknown) { + // $FlowFixMe[object-this-reference] found when upgrading Flow + return fn.apply(this, args); + } + var id = getID(internalInstance); + parentIDStack.push(id); + var prevChildren = getChildren(internalInstance); + try { + // $FlowFixMe[object-this-reference] found when upgrading Flow + var result = fn.apply(this, args); + var nextChildren = getChildren(internalInstance); + if (!areEqualArrays(prevChildren, nextChildren)) { + // Push the operation + recordReorder(internalInstance, id, nextChildren); + } + parentIDStack.pop(); + return result; + } catch (err) { + parentIDStack = []; + throw err; + } finally { + if (parentIDStack.length === 0) { + var rootID = internalInstanceToRootIDMap.get(internalInstance); + if (rootID === undefined) { + throw new Error('Expected to find root ID.'); + } + flushPendingEvents(rootID); + } + } + }, + unmountComponent: function unmountComponent(fn, args) { + var internalInstance = args[0]; + if (getElementType(internalInstance) === ElementTypeOtherOrUnknown) { + // $FlowFixMe[object-this-reference] found when upgrading Flow + return fn.apply(this, args); + } + var id = getID(internalInstance); + parentIDStack.push(id); + try { + // $FlowFixMe[object-this-reference] found when upgrading Flow + var result = fn.apply(this, args); + parentIDStack.pop(); // Push the operation. + + recordUnmount(internalInstance, id); + return result; + } catch (err) { + parentIDStack = []; + throw err; + } finally { + if (parentIDStack.length === 0) { + var rootID = internalInstanceToRootIDMap.get(internalInstance); + if (rootID === undefined) { + throw new Error('Expected to find root ID.'); + } + flushPendingEvents(rootID); + } + } + } + }); + } + function cleanup() { + if (oldReconcilerMethods !== null) { + if (renderer.Component) { + restoreMany(renderer.Component.Mixin, oldReconcilerMethods); + } else { + restoreMany(renderer.Reconciler, oldReconcilerMethods); + } + } + oldReconcilerMethods = null; + } + function recordMount(internalInstance, id, parentID) { + var isRoot = parentID === 0; + if (__DEBUG__) { + console.log('%crecordMount()', 'color: green; font-weight: bold;', id, getData(internalInstance).displayName); + } + if (isRoot) { + // TODO Is this right? For all versions? + var hasOwnerMetadata = internalInstance._currentElement != null && internalInstance._currentElement._owner != null; + pushOperation(TREE_OPERATION_ADD); + pushOperation(id); + pushOperation(ElementTypeRoot); + pushOperation(0); // StrictMode compliant? + + pushOperation(0); // Profiling flag + + pushOperation(0); // StrictMode supported? + + pushOperation(hasOwnerMetadata ? 1 : 0); + } else { + var type = getElementType(internalInstance); + var _getData = getData(internalInstance), + displayName = _getData.displayName, + key = _getData.key; + var ownerID = internalInstance._currentElement != null && internalInstance._currentElement._owner != null ? getID(internalInstance._currentElement._owner) : 0; + var displayNameStringID = getStringID(displayName); + var keyStringID = getStringID(key); + pushOperation(TREE_OPERATION_ADD); + pushOperation(id); + pushOperation(type); + pushOperation(parentID); + pushOperation(ownerID); + pushOperation(displayNameStringID); + pushOperation(keyStringID); + } + } + function recordReorder(internalInstance, id, nextChildren) { + pushOperation(TREE_OPERATION_REORDER_CHILDREN); + pushOperation(id); + var nextChildIDs = nextChildren.map(getID); + pushOperation(nextChildIDs.length); + for (var i = 0; i < nextChildIDs.length; i++) { + pushOperation(nextChildIDs[i]); + } + } + function recordUnmount(internalInstance, id) { + pendingUnmountedIDs.push(id); + idToInternalInstanceMap.delete(id); + } + function crawlAndRecordInitialMounts(id, parentID, rootID) { + if (__DEBUG__) { + console.group('crawlAndRecordInitialMounts() id:', id); + } + var internalInstance = idToInternalInstanceMap.get(id); + if (internalInstance != null) { + internalInstanceToRootIDMap.set(internalInstance, rootID); + recordMount(internalInstance, id, parentID); + getChildren(internalInstance).forEach(function (child) { + return crawlAndRecordInitialMounts(getID(child), id, rootID); + }); + } + if (__DEBUG__) { + console.groupEnd(); + } + } + function flushInitialOperations() { + // Crawl roots though and register any nodes that mounted before we were injected. + var roots = renderer.Mount._instancesByReactRootID || renderer.Mount._instancesByContainerID; + for (var key in roots) { + var internalInstance = roots[key]; + var _id2 = getID(internalInstance); + crawlAndRecordInitialMounts(_id2, 0, _id2); + flushPendingEvents(_id2); + } + } + var pendingOperations = []; + var pendingStringTable = new Map(); + var pendingUnmountedIDs = []; + var pendingStringTableLength = 0; + var pendingUnmountedRootID = null; + function flushPendingEvents(rootID) { + if (pendingOperations.length === 0 && pendingUnmountedIDs.length === 0 && pendingUnmountedRootID === null) { + return; + } + var numUnmountIDs = pendingUnmountedIDs.length + (pendingUnmountedRootID === null ? 0 : 1); + var operations = new Array( + // Identify which renderer this update is coming from. + 2 + + // [rendererID, rootFiberID] + // How big is the string table? + 1 + + // [stringTableLength] + // Then goes the actual string table. + pendingStringTableLength + ( + // All unmounts are batched in a single message. + // [TREE_OPERATION_REMOVE, removedIDLength, ...ids] + numUnmountIDs > 0 ? 2 + numUnmountIDs : 0) + + // Mount operations + pendingOperations.length); // Identify which renderer this update is coming from. + // This enables roots to be mapped to renderers, + // Which in turn enables fiber properations, states, and hooks to be inspected. + + var i = 0; + operations[i++] = rendererID; + operations[i++] = rootID; // Now fill in the string table. + // [stringTableLength, str1Length, ...str1, str2Length, ...str2, ...] + + operations[i++] = pendingStringTableLength; + pendingStringTable.forEach(function (value, key) { + operations[i++] = key.length; + var encodedKey = utfEncodeString(key); + for (var j = 0; j < encodedKey.length; j++) { + operations[i + j] = encodedKey[j]; + } + i += key.length; + }); + if (numUnmountIDs > 0) { + // All unmounts except roots are batched in a single message. + operations[i++] = TREE_OPERATION_REMOVE; // The first number is how many unmounted IDs we're gonna send. + + operations[i++] = numUnmountIDs; // Fill in the unmounts + + for (var j = 0; j < pendingUnmountedIDs.length; j++) { + operations[i++] = pendingUnmountedIDs[j]; + } // The root ID should always be unmounted last. + + if (pendingUnmountedRootID !== null) { + operations[i] = pendingUnmountedRootID; + i++; + } + } // Fill in the rest of the operations. + + for (var _j = 0; _j < pendingOperations.length; _j++) { + operations[i + _j] = pendingOperations[_j]; + } + i += pendingOperations.length; + if (__DEBUG__) { + printOperationsArray(operations); + } // If we've already connected to the frontend, just pass the operations through. + + hook.emit('operations', operations); + pendingOperations.length = 0; + pendingUnmountedIDs = []; + pendingUnmountedRootID = null; + pendingStringTable.clear(); + pendingStringTableLength = 0; + } + function pushOperation(op) { + if (false) {} + pendingOperations.push(op); + } + function getStringID(str) { + if (str === null) { + return 0; + } + var existingID = pendingStringTable.get(str); + if (existingID !== undefined) { + return existingID; + } + var stringID = pendingStringTable.size + 1; + pendingStringTable.set(str, stringID); // The string table total length needs to account + // both for the string length, and for the array item + // that contains the length itself. Hence + 1. + + pendingStringTableLength += str.length + 1; + return stringID; + } + var currentlyInspectedElementID = null; + var currentlyInspectedPaths = {}; // Track the intersection of currently inspected paths, + // so that we can send their data along if the element is re-rendered. + + function mergeInspectedPaths(path) { + var current = currentlyInspectedPaths; + path.forEach(function (key) { + if (!current[key]) { + current[key] = {}; + } + current = current[key]; + }); + } + function createIsPathAllowed(key) { + // This function helps prevent previously-inspected paths from being dehydrated in updates. + // This is important to avoid a bad user experience where expanded toggles collapse on update. + return function isPathAllowed(path) { + var current = currentlyInspectedPaths[key]; + if (!current) { + return false; + } + for (var i = 0; i < path.length; i++) { + current = current[path[i]]; + if (!current) { + return false; + } + } + return true; + }; + } // Fast path props lookup for React Native style editor. + + function getInstanceAndStyle(id) { + var instance = null; + var style = null; + var internalInstance = idToInternalInstanceMap.get(id); + if (internalInstance != null) { + instance = internalInstance._instance || null; + var element = internalInstance._currentElement; + if (element != null && element.props != null) { + style = element.props.style || null; + } + } + return { + instance: instance, + style: style + }; + } + function updateSelectedElement(id) { + var internalInstance = idToInternalInstanceMap.get(id); + if (internalInstance == null) { + console.warn("Could not find instance with id \"".concat(id, "\"")); + return; + } + switch (getElementType(internalInstance)) { + case types_ElementTypeClass: + global.$r = internalInstance._instance; + break; + case types_ElementTypeFunction: + var element = internalInstance._currentElement; + if (element == null) { + console.warn("Could not find element with id \"".concat(id, "\"")); + return; + } + global.$r = { + props: element.props, + type: element.type + }; + break; + default: + global.$r = null; + break; + } + } + function storeAsGlobal(id, path, count) { + var inspectedElement = inspectElementRaw(id); + if (inspectedElement !== null) { + var value = utils_getInObject(inspectedElement, path); + var key = "$reactTemp".concat(count); + window[key] = value; + console.log(key); + console.log(value); + } + } + function getSerializedElementValueByPath(id, path) { + var inspectedElement = inspectElementRaw(id); + if (inspectedElement !== null) { + var valueToCopy = utils_getInObject(inspectedElement, path); + return serializeToString(valueToCopy); + } + } + function inspectElement(requestID, id, path, forceFullData) { + if (forceFullData || currentlyInspectedElementID !== id) { + currentlyInspectedElementID = id; + currentlyInspectedPaths = {}; + } + var inspectedElement = inspectElementRaw(id); + if (inspectedElement === null) { + return { + id: id, + responseID: requestID, + type: 'not-found' + }; + } + if (path !== null) { + mergeInspectedPaths(path); + } // Any time an inspected element has an update, + // we should update the selected $r value as wel. + // Do this before dehydration (cleanForBridge). + + updateSelectedElement(id); + inspectedElement.context = cleanForBridge(inspectedElement.context, createIsPathAllowed('context')); + inspectedElement.props = cleanForBridge(inspectedElement.props, createIsPathAllowed('props')); + inspectedElement.state = cleanForBridge(inspectedElement.state, createIsPathAllowed('state')); + return { + id: id, + responseID: requestID, + type: 'full-data', + value: inspectedElement + }; + } + function inspectElementRaw(id) { + var internalInstance = idToInternalInstanceMap.get(id); + if (internalInstance == null) { + return null; + } + var _getData2 = getData(internalInstance), + displayName = _getData2.displayName, + key = _getData2.key; + var type = getElementType(internalInstance); + var context = null; + var owners = null; + var props = null; + var state = null; + var source = null; + var element = internalInstance._currentElement; + if (element !== null) { + props = element.props; + source = element._source != null ? element._source : null; + var owner = element._owner; + if (owner) { + owners = []; + while (owner != null) { + owners.push({ + displayName: getData(owner).displayName || 'Unknown', + id: getID(owner), + key: element.key, + type: getElementType(owner) + }); + if (owner._currentElement) { + owner = owner._currentElement._owner; + } + } + } + } + var publicInstance = internalInstance._instance; + if (publicInstance != null) { + context = publicInstance.context || null; + state = publicInstance.state || null; + } // Not implemented + + var errors = []; + var warnings = []; + return { + id: id, + // Does the current renderer support editable hooks and function props? + canEditHooks: false, + canEditFunctionProps: false, + // Does the current renderer support advanced editing interface? + canEditHooksAndDeletePaths: false, + canEditHooksAndRenamePaths: false, + canEditFunctionPropsDeletePaths: false, + canEditFunctionPropsRenamePaths: false, + // Toggle error boundary did not exist in legacy versions + canToggleError: false, + isErrored: false, + targetErrorBoundaryID: null, + // Suspense did not exist in legacy versions + canToggleSuspense: false, + // Can view component source location. + canViewSource: type === types_ElementTypeClass || type === types_ElementTypeFunction, + // Only legacy context exists in legacy versions. + hasLegacyContext: true, + displayName: displayName, + type: type, + key: key != null ? key : null, + // Inspectable properties. + context: context, + hooks: null, + props: props, + state: state, + errors: errors, + warnings: warnings, + // List of owners + owners: owners, + // Location of component in source code. + source: source, + rootType: null, + rendererPackageName: null, + rendererVersion: null, + plugins: { + stylex: null + } + }; + } + function logElementToConsole(id) { + var result = inspectElementRaw(id); + if (result === null) { + console.warn("Could not find element with id \"".concat(id, "\"")); + return; + } + var supportsGroup = typeof console.groupCollapsed === 'function'; + if (supportsGroup) { + console.groupCollapsed("[Click to expand] %c<".concat(result.displayName || 'Component', " />"), + // --dom-tag-name-color is the CSS variable Chrome styles HTML elements with in the console. + 'color: var(--dom-tag-name-color); font-weight: normal;'); + } + if (result.props !== null) { + console.log('Props:', result.props); + } + if (result.state !== null) { + console.log('State:', result.state); + } + if (result.context !== null) { + console.log('Context:', result.context); + } + var nativeNode = findNativeNodeForInternalID(id); + if (nativeNode !== null) { + console.log('Node:', nativeNode); + } + if (window.chrome || /firefox/i.test(navigator.userAgent)) { + console.log('Right-click any value to save it as a global variable for further inspection.'); + } + if (supportsGroup) { + console.groupEnd(); + } + } + function prepareViewAttributeSource(id, path) { + var inspectedElement = inspectElementRaw(id); + if (inspectedElement !== null) { + window.$attribute = utils_getInObject(inspectedElement, path); + } + } + function prepareViewElementSource(id) { + var internalInstance = idToInternalInstanceMap.get(id); + if (internalInstance == null) { + console.warn("Could not find instance with id \"".concat(id, "\"")); + return; + } + var element = internalInstance._currentElement; + if (element == null) { + console.warn("Could not find element with id \"".concat(id, "\"")); + return; + } + global.$type = element.type; + } + function deletePath(type, id, hookID, path) { + var internalInstance = idToInternalInstanceMap.get(id); + if (internalInstance != null) { + var publicInstance = internalInstance._instance; + if (publicInstance != null) { + switch (type) { + case 'context': + deletePathInObject(publicInstance.context, path); + forceUpdate(publicInstance); + break; + case 'hooks': + throw new Error('Hooks not supported by this renderer'); + case 'props': + var element = internalInstance._currentElement; + internalInstance._currentElement = legacy_renderer_objectSpread(legacy_renderer_objectSpread({}, element), {}, { + props: copyWithDelete(element.props, path) + }); + forceUpdate(publicInstance); + break; + case 'state': + deletePathInObject(publicInstance.state, path); + forceUpdate(publicInstance); + break; + } + } + } + } + function renamePath(type, id, hookID, oldPath, newPath) { + var internalInstance = idToInternalInstanceMap.get(id); + if (internalInstance != null) { + var publicInstance = internalInstance._instance; + if (publicInstance != null) { + switch (type) { + case 'context': + renamePathInObject(publicInstance.context, oldPath, newPath); + forceUpdate(publicInstance); + break; + case 'hooks': + throw new Error('Hooks not supported by this renderer'); + case 'props': + var element = internalInstance._currentElement; + internalInstance._currentElement = legacy_renderer_objectSpread(legacy_renderer_objectSpread({}, element), {}, { + props: copyWithRename(element.props, oldPath, newPath) + }); + forceUpdate(publicInstance); + break; + case 'state': + renamePathInObject(publicInstance.state, oldPath, newPath); + forceUpdate(publicInstance); + break; + } + } + } + } + function overrideValueAtPath(type, id, hookID, path, value) { + var internalInstance = idToInternalInstanceMap.get(id); + if (internalInstance != null) { + var publicInstance = internalInstance._instance; + if (publicInstance != null) { + switch (type) { + case 'context': + utils_setInObject(publicInstance.context, path, value); + forceUpdate(publicInstance); + break; + case 'hooks': + throw new Error('Hooks not supported by this renderer'); + case 'props': + var element = internalInstance._currentElement; + internalInstance._currentElement = legacy_renderer_objectSpread(legacy_renderer_objectSpread({}, element), {}, { + props: copyWithSet(element.props, path, value) + }); + forceUpdate(publicInstance); + break; + case 'state': + utils_setInObject(publicInstance.state, path, value); + forceUpdate(publicInstance); + break; + } + } + } + } // v16+ only features + + var getProfilingData = function getProfilingData() { + throw new Error('getProfilingData not supported by this renderer'); + }; + var handleCommitFiberRoot = function handleCommitFiberRoot() { + throw new Error('handleCommitFiberRoot not supported by this renderer'); + }; + var handleCommitFiberUnmount = function handleCommitFiberUnmount() { + throw new Error('handleCommitFiberUnmount not supported by this renderer'); + }; + var handlePostCommitFiberRoot = function handlePostCommitFiberRoot() { + throw new Error('handlePostCommitFiberRoot not supported by this renderer'); + }; + var overrideError = function overrideError() { + throw new Error('overrideError not supported by this renderer'); + }; + var overrideSuspense = function overrideSuspense() { + throw new Error('overrideSuspense not supported by this renderer'); + }; + var startProfiling = function startProfiling() {// Do not throw, since this would break a multi-root scenario where v15 and v16 were both present. + }; + var stopProfiling = function stopProfiling() {// Do not throw, since this would break a multi-root scenario where v15 and v16 were both present. + }; + function getBestMatchForTrackedPath() { + // Not implemented. + return null; + } + function getPathForElement(id) { + // Not implemented. + return null; + } + function updateComponentFilters(componentFilters) {// Not implemented. + } + function setTraceUpdatesEnabled(enabled) {// Not implemented. + } + function setTrackedPath(path) {// Not implemented. + } + function getOwnersList(id) { + // Not implemented. + return null; + } + function clearErrorsAndWarnings() {// Not implemented + } + function clearErrorsForFiberID(id) {// Not implemented + } + function clearWarningsForFiberID(id) {// Not implemented + } + function patchConsoleForStrictMode() {} + function unpatchConsoleForStrictMode() {} + function hasFiberWithId(id) { + return idToInternalInstanceMap.has(id); + } + return { + clearErrorsAndWarnings: clearErrorsAndWarnings, + clearErrorsForFiberID: clearErrorsForFiberID, + clearWarningsForFiberID: clearWarningsForFiberID, + cleanup: cleanup, + getSerializedElementValueByPath: getSerializedElementValueByPath, + deletePath: deletePath, + flushInitialOperations: flushInitialOperations, + getBestMatchForTrackedPath: getBestMatchForTrackedPath, + getDisplayNameForFiberID: getDisplayNameForFiberID, + getFiberForNative: getFiberForNative, + getFiberIDForNative: getInternalIDForNative, + getInstanceAndStyle: getInstanceAndStyle, + findNativeNodesForFiberID: function findNativeNodesForFiberID(id) { + var nativeNode = findNativeNodeForInternalID(id); + return nativeNode == null ? null : [nativeNode]; + }, + getOwnersList: getOwnersList, + getPathForElement: getPathForElement, + getProfilingData: getProfilingData, + handleCommitFiberRoot: handleCommitFiberRoot, + handleCommitFiberUnmount: handleCommitFiberUnmount, + handlePostCommitFiberRoot: handlePostCommitFiberRoot, + hasFiberWithId: hasFiberWithId, + inspectElement: inspectElement, + logElementToConsole: logElementToConsole, + overrideError: overrideError, + overrideSuspense: overrideSuspense, + overrideValueAtPath: overrideValueAtPath, + renamePath: renamePath, + patchConsoleForStrictMode: patchConsoleForStrictMode, + prepareViewAttributeSource: prepareViewAttributeSource, + prepareViewElementSource: prepareViewElementSource, + renderer: renderer, + setTraceUpdatesEnabled: setTraceUpdatesEnabled, + setTrackedPath: setTrackedPath, + startProfiling: startProfiling, + stopProfiling: stopProfiling, + storeAsGlobal: storeAsGlobal, + unpatchConsoleForStrictMode: unpatchConsoleForStrictMode, + updateComponentFilters: updateComponentFilters + }; + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/index.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + // this is the backend that is compatible with all older React versions + function isMatchingRender(version) { + return !hasAssignedBackend(version); + } + function initBackend(hook, agent, global) { + if (hook == null) { + // DevTools didn't get injected into this page (maybe b'c of the contentType). + return function () {}; + } + var subs = [hook.sub('renderer-attached', function (_ref) { + var id = _ref.id, + renderer = _ref.renderer, + rendererInterface = _ref.rendererInterface; + agent.setRendererInterface(id, rendererInterface); // Now that the Store and the renderer interface are connected, + // it's time to flush the pending operation codes to the frontend. + + rendererInterface.flushInitialOperations(); + }), hook.sub('unsupported-renderer-version', function (id) { + agent.onUnsupportedRenderer(id); + }), hook.sub('fastRefreshScheduled', agent.onFastRefreshScheduled), hook.sub('operations', agent.onHookOperations), hook.sub('traceUpdates', agent.onTraceUpdates) // TODO Add additional subscriptions required for profiling mode + ]; + var attachRenderer = function attachRenderer(id, renderer) { + // only attach if the renderer is compatible with the current version of the backend + if (!isMatchingRender(renderer.reconcilerVersion || renderer.version)) { + return; + } + var rendererInterface = hook.rendererInterfaces.get(id); // Inject any not-yet-injected renderers (if we didn't reload-and-profile) + + if (rendererInterface == null) { + if (typeof renderer.findFiberByHostInstance === 'function') { + // react-reconciler v16+ + rendererInterface = attach(hook, id, renderer, global); + } else if (renderer.ComponentTree) { + // react-dom v15 + rendererInterface = renderer_attach(hook, id, renderer, global); + } else {// Older react-dom or other unsupported renderer version + } + if (rendererInterface != null) { + hook.rendererInterfaces.set(id, rendererInterface); + } + } // Notify the DevTools frontend about new renderers. + // This includes any that were attached early (via __REACT_DEVTOOLS_ATTACH__). + + if (rendererInterface != null) { + hook.emit('renderer-attached', { + id: id, + renderer: renderer, + rendererInterface: rendererInterface + }); + } else { + hook.emit('unsupported-renderer-version', id); + } + }; // Connect renderers that have already injected themselves. + + hook.renderers.forEach(function (renderer, id) { + attachRenderer(id, renderer); + }); // Connect any new renderers that injected themselves. + + subs.push(hook.sub('renderer', function (_ref2) { + var id = _ref2.id, + renderer = _ref2.renderer; + attachRenderer(id, renderer); + })); + hook.emit('react-devtools', agent); + hook.reactDevtoolsAgent = agent; + var onAgentShutdown = function onAgentShutdown() { + subs.forEach(function (fn) { + return fn(); + }); + hook.rendererInterfaces.forEach(function (rendererInterface) { + rendererInterface.cleanup(); + }); + hook.reactDevtoolsAgent = null; + }; + agent.addListener('shutdown', onAgentShutdown); + subs.push(function () { + agent.removeListener('shutdown', onAgentShutdown); + }); + return function () { + subs.forEach(function (fn) { + return fn(); + }); + }; + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/NativeStyleEditor/resolveBoxStyle.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + /** + * This mirrors react-native/Libraries/Inspector/resolveBoxStyle.js (but without RTL support). + * + * Resolve a style property into it's component parts, e.g. + * + * resolveBoxStyle('margin', {margin: 5, marginBottom: 10}) + * -> {top: 5, left: 5, right: 5, bottom: 10} + */ + function resolveBoxStyle(prefix, style) { + var hasParts = false; + var result = { + bottom: 0, + left: 0, + right: 0, + top: 0 + }; + var styleForAll = style[prefix]; + if (styleForAll != null) { + // eslint-disable-next-line no-for-of-loops/no-for-of-loops + for (var _i = 0, _Object$keys = Object.keys(result); _i < _Object$keys.length; _i++) { + var key = _Object$keys[_i]; + result[key] = styleForAll; + } + hasParts = true; + } + var styleForHorizontal = style[prefix + 'Horizontal']; + if (styleForHorizontal != null) { + result.left = styleForHorizontal; + result.right = styleForHorizontal; + hasParts = true; + } else { + var styleForLeft = style[prefix + 'Left']; + if (styleForLeft != null) { + result.left = styleForLeft; + hasParts = true; + } + var styleForRight = style[prefix + 'Right']; + if (styleForRight != null) { + result.right = styleForRight; + hasParts = true; + } + var styleForEnd = style[prefix + 'End']; + if (styleForEnd != null) { + // TODO RTL support + result.right = styleForEnd; + hasParts = true; + } + var styleForStart = style[prefix + 'Start']; + if (styleForStart != null) { + // TODO RTL support + result.left = styleForStart; + hasParts = true; + } + } + var styleForVertical = style[prefix + 'Vertical']; + if (styleForVertical != null) { + result.bottom = styleForVertical; + result.top = styleForVertical; + hasParts = true; + } else { + var styleForBottom = style[prefix + 'Bottom']; + if (styleForBottom != null) { + result.bottom = styleForBottom; + hasParts = true; + } + var styleForTop = style[prefix + 'Top']; + if (styleForTop != null) { + result.top = styleForTop; + hasParts = true; + } + } + return hasParts ? result : null; + } + ; // CONCATENATED MODULE: ../react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor.js + function setupNativeStyleEditor_typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + setupNativeStyleEditor_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + setupNativeStyleEditor_typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return setupNativeStyleEditor_typeof(obj); + } + function setupNativeStyleEditor_defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + function setupNativeStyleEditor(bridge, agent, resolveNativeStyle, validAttributes) { + bridge.addListener('NativeStyleEditor_measure', function (_ref) { + var id = _ref.id, + rendererID = _ref.rendererID; + measureStyle(agent, bridge, resolveNativeStyle, id, rendererID); + }); + bridge.addListener('NativeStyleEditor_renameAttribute', function (_ref2) { + var id = _ref2.id, + rendererID = _ref2.rendererID, + oldName = _ref2.oldName, + newName = _ref2.newName, + value = _ref2.value; + renameStyle(agent, id, rendererID, oldName, newName, value); + setTimeout(function () { + return measureStyle(agent, bridge, resolveNativeStyle, id, rendererID); + }); + }); + bridge.addListener('NativeStyleEditor_setValue', function (_ref3) { + var id = _ref3.id, + rendererID = _ref3.rendererID, + name = _ref3.name, + value = _ref3.value; + setStyle(agent, id, rendererID, name, value); + setTimeout(function () { + return measureStyle(agent, bridge, resolveNativeStyle, id, rendererID); + }); + }); + bridge.send('isNativeStyleEditorSupported', { + isSupported: true, + validAttributes: validAttributes + }); + } + var EMPTY_BOX_STYLE = { + top: 0, + left: 0, + right: 0, + bottom: 0 + }; + var componentIDToStyleOverrides = new Map(); + function measureStyle(agent, bridge, resolveNativeStyle, id, rendererID) { + var data = agent.getInstanceAndStyle({ + id: id, + rendererID: rendererID + }); + if (!data || !data.style) { + bridge.send('NativeStyleEditor_styleAndLayout', { + id: id, + layout: null, + style: null + }); + return; + } + var instance = data.instance, + style = data.style; + var resolvedStyle = resolveNativeStyle(style); // If it's a host component we edited before, amend styles. + + var styleOverrides = componentIDToStyleOverrides.get(id); + if (styleOverrides != null) { + resolvedStyle = Object.assign({}, resolvedStyle, styleOverrides); + } + if (!instance || typeof instance.measure !== 'function') { + bridge.send('NativeStyleEditor_styleAndLayout', { + id: id, + layout: null, + style: resolvedStyle || null + }); + return; + } + instance.measure(function (x, y, width, height, left, top) { + // RN Android sometimes returns undefined here. Don't send measurements in this case. + // https://github.com/jhen0409/react-native-debugger/issues/84#issuecomment-304611817 + if (typeof x !== 'number') { + bridge.send('NativeStyleEditor_styleAndLayout', { + id: id, + layout: null, + style: resolvedStyle || null + }); + return; + } + var margin = resolvedStyle != null && resolveBoxStyle('margin', resolvedStyle) || EMPTY_BOX_STYLE; + var padding = resolvedStyle != null && resolveBoxStyle('padding', resolvedStyle) || EMPTY_BOX_STYLE; + bridge.send('NativeStyleEditor_styleAndLayout', { + id: id, + layout: { + x: x, + y: y, + width: width, + height: height, + left: left, + top: top, + margin: margin, + padding: padding + }, + style: resolvedStyle || null + }); + }); + } + function shallowClone(object) { + var cloned = {}; + for (var n in object) { + cloned[n] = object[n]; + } + return cloned; + } + function renameStyle(agent, id, rendererID, oldName, newName, value) { + var _ref4; + var data = agent.getInstanceAndStyle({ + id: id, + rendererID: rendererID + }); + if (!data || !data.style) { + return; + } + var instance = data.instance, + style = data.style; + var newStyle = newName ? (_ref4 = {}, setupNativeStyleEditor_defineProperty(_ref4, oldName, undefined), setupNativeStyleEditor_defineProperty(_ref4, newName, value), _ref4) : setupNativeStyleEditor_defineProperty({}, oldName, undefined); + var customStyle; // TODO It would be nice if the renderer interface abstracted this away somehow. + + if (instance !== null && typeof instance.setNativeProps === 'function') { + // In the case of a host component, we need to use setNativeProps(). + // Remember to "correct" resolved styles when we read them next time. + var styleOverrides = componentIDToStyleOverrides.get(id); + if (!styleOverrides) { + componentIDToStyleOverrides.set(id, newStyle); + } else { + Object.assign(styleOverrides, newStyle); + } // TODO Fabric does not support setNativeProps; chat with Sebastian or Eli + + instance.setNativeProps({ + style: newStyle + }); + } else if (src_isArray(style)) { + var lastIndex = style.length - 1; + if (setupNativeStyleEditor_typeof(style[lastIndex]) === 'object' && !src_isArray(style[lastIndex])) { + customStyle = shallowClone(style[lastIndex]); + delete customStyle[oldName]; + if (newName) { + customStyle[newName] = value; + } else { + customStyle[oldName] = undefined; + } + agent.overrideValueAtPath({ + type: 'props', + id: id, + rendererID: rendererID, + path: ['style', lastIndex], + value: customStyle + }); + } else { + agent.overrideValueAtPath({ + type: 'props', + id: id, + rendererID: rendererID, + path: ['style'], + value: style.concat([newStyle]) + }); + } + } else if (setupNativeStyleEditor_typeof(style) === 'object') { + customStyle = shallowClone(style); + delete customStyle[oldName]; + if (newName) { + customStyle[newName] = value; + } else { + customStyle[oldName] = undefined; + } + agent.overrideValueAtPath({ + type: 'props', + id: id, + rendererID: rendererID, + path: ['style'], + value: customStyle + }); + } else { + agent.overrideValueAtPath({ + type: 'props', + id: id, + rendererID: rendererID, + path: ['style'], + value: [style, newStyle] + }); + } + agent.emit('hideNativeHighlight'); + } + function setStyle(agent, id, rendererID, name, value) { + var data = agent.getInstanceAndStyle({ + id: id, + rendererID: rendererID + }); + if (!data || !data.style) { + return; + } + var instance = data.instance, + style = data.style; + var newStyle = setupNativeStyleEditor_defineProperty({}, name, value); // TODO It would be nice if the renderer interface abstracted this away somehow. + + if (instance !== null && typeof instance.setNativeProps === 'function') { + // In the case of a host component, we need to use setNativeProps(). + // Remember to "correct" resolved styles when we read them next time. + var styleOverrides = componentIDToStyleOverrides.get(id); + if (!styleOverrides) { + componentIDToStyleOverrides.set(id, newStyle); + } else { + Object.assign(styleOverrides, newStyle); + } // TODO Fabric does not support setNativeProps; chat with Sebastian or Eli + + instance.setNativeProps({ + style: newStyle + }); + } else if (src_isArray(style)) { + var lastLength = style.length - 1; + if (setupNativeStyleEditor_typeof(style[lastLength]) === 'object' && !src_isArray(style[lastLength])) { + agent.overrideValueAtPath({ + type: 'props', + id: id, + rendererID: rendererID, + path: ['style', lastLength, name], + value: value + }); + } else { + agent.overrideValueAtPath({ + type: 'props', + id: id, + rendererID: rendererID, + path: ['style'], + value: style.concat([newStyle]) + }); + } + } else { + agent.overrideValueAtPath({ + type: 'props', + id: id, + rendererID: rendererID, + path: ['style'], + value: [style, newStyle] + }); + } + agent.emit('hideNativeHighlight'); + } + ; // CONCATENATED MODULE: ./src/cachedSettings.js + /** + * Copyright (c) Meta Platforms, 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. + * + * + */ + + // Note: all keys should be optional in this type, because users can use newer + // versions of React DevTools with older versions of React Native, and the object + // provided by React Native may not include all of this type's fields. + + function initializeUsingCachedSettings(devToolsSettingsManager) { + initializeConsolePatchSettings(devToolsSettingsManager); + } + function initializeConsolePatchSettings(devToolsSettingsManager) { + if (devToolsSettingsManager.getConsolePatchSettings == null) { + return; + } + var consolePatchSettingsString = devToolsSettingsManager.getConsolePatchSettings(); + if (consolePatchSettingsString == null) { + return; + } + var parsedConsolePatchSettings = parseConsolePatchSettings(consolePatchSettingsString); + if (parsedConsolePatchSettings == null) { + return; + } + writeConsolePatchSettingsToWindow(parsedConsolePatchSettings); + } + function parseConsolePatchSettings(consolePatchSettingsString) { + var _castBool, _castBool2, _castBool3, _castBool4, _castBrowserTheme; + var parsedValue = JSON.parse(consolePatchSettingsString !== null && consolePatchSettingsString !== void 0 ? consolePatchSettingsString : '{}'); + var appendComponentStack = parsedValue.appendComponentStack, + breakOnConsoleErrors = parsedValue.breakOnConsoleErrors, + showInlineWarningsAndErrors = parsedValue.showInlineWarningsAndErrors, + hideConsoleLogsInStrictMode = parsedValue.hideConsoleLogsInStrictMode, + browserTheme = parsedValue.browserTheme; + return { + appendComponentStack: (_castBool = castBool(appendComponentStack)) !== null && _castBool !== void 0 ? _castBool : true, + breakOnConsoleErrors: (_castBool2 = castBool(breakOnConsoleErrors)) !== null && _castBool2 !== void 0 ? _castBool2 : false, + showInlineWarningsAndErrors: (_castBool3 = castBool(showInlineWarningsAndErrors)) !== null && _castBool3 !== void 0 ? _castBool3 : true, + hideConsoleLogsInStrictMode: (_castBool4 = castBool(hideConsoleLogsInStrictMode)) !== null && _castBool4 !== void 0 ? _castBool4 : false, + browserTheme: (_castBrowserTheme = castBrowserTheme(browserTheme)) !== null && _castBrowserTheme !== void 0 ? _castBrowserTheme : 'dark' + }; + } + function cacheConsolePatchSettings(devToolsSettingsManager, value) { + if (devToolsSettingsManager.setConsolePatchSettings == null) { + return; + } + devToolsSettingsManager.setConsolePatchSettings(JSON.stringify(value)); + } + ; // CONCATENATED MODULE: ./src/backend.js + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + // Install a global variable to allow patching console early (during injection). + // This provides React Native developers with components stacks even if they don't run DevTools. + installConsoleFunctionsToWindow(); + installHook(window); + var hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; + var savedComponentFilters = getDefaultComponentFilters(); + function backend_debug(methodName) { + if (__DEBUG__) { + var _console; + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + (_console = console).log.apply(_console, ["%c[core/backend] %c".concat(methodName), 'color: teal; font-weight: bold;', 'font-weight: bold;'].concat(args)); + } + } + function _connectToDevTools(options) { + if (hook == null) { + // DevTools didn't get injected into this page (maybe b'c of the contentType). + return; + } + var _ref = options || {}, + _ref$host = _ref.host, + host = _ref$host === void 0 ? 'localhost' : _ref$host, + nativeStyleEditorValidAttributes = _ref.nativeStyleEditorValidAttributes, + _ref$useHttps = _ref.useHttps, + useHttps = _ref$useHttps === void 0 ? false : _ref$useHttps, + _ref$port = _ref.port, + port = _ref$port === void 0 ? 8097 : _ref$port, + websocket = _ref.websocket, + _ref$resolveRNStyle = _ref.resolveRNStyle, + resolveRNStyle = _ref$resolveRNStyle === void 0 ? null : _ref$resolveRNStyle, + _ref$retryConnectionD = _ref.retryConnectionDelay, + retryConnectionDelay = _ref$retryConnectionD === void 0 ? 2000 : _ref$retryConnectionD, + _ref$isAppActive = _ref.isAppActive, + isAppActive = _ref$isAppActive === void 0 ? function () { + return true; + } : _ref$isAppActive, + devToolsSettingsManager = _ref.devToolsSettingsManager; + var protocol = useHttps ? 'wss' : 'ws'; + var retryTimeoutID = null; + function scheduleRetry() { + if (retryTimeoutID === null) { + // Two seconds because RN had issues with quick retries. + retryTimeoutID = setTimeout(function () { + return _connectToDevTools(options); + }, retryConnectionDelay); + } + } + if (devToolsSettingsManager != null) { + try { + initializeUsingCachedSettings(devToolsSettingsManager); + } catch (e) { + // If we call a method on devToolsSettingsManager that throws, or if + // is invalid data read out, don't throw and don't interrupt initialization + console.error(e); + } + } + if (!isAppActive()) { + // If the app is in background, maybe retry later. + // Don't actually attempt to connect until we're in foreground. + scheduleRetry(); + return; + } + var bridge = null; + var messageListeners = []; + var uri = protocol + '://' + host + ':' + port; // If existing websocket is passed, use it. + // This is necessary to support our custom integrations. + // See D6251744. + + var ws = websocket ? websocket : new window.WebSocket(uri); + ws.onclose = handleClose; + ws.onerror = handleFailed; + ws.onmessage = handleMessage; + ws.onopen = function () { + bridge = new src_bridge({ + listen: function listen(fn) { + messageListeners.push(fn); + return function () { + var index = messageListeners.indexOf(fn); + if (index >= 0) { + messageListeners.splice(index, 1); + } + }; + }, + send: function send(event, payload, transferable) { + if (ws.readyState === ws.OPEN) { + if (__DEBUG__) { + backend_debug('wall.send()', event, payload); + } + ws.send(JSON.stringify({ + event: event, + payload: payload + })); + } else { + if (__DEBUG__) { + backend_debug('wall.send()', 'Shutting down bridge because of closed WebSocket connection'); + } + if (bridge !== null) { + bridge.shutdown(); + } + scheduleRetry(); + } + } + }); + bridge.addListener('updateComponentFilters', function (componentFilters) { + // Save filter changes in memory, in case DevTools is reloaded. + // In that case, the renderer will already be using the updated values. + // We'll lose these in between backend reloads but that can't be helped. + savedComponentFilters = componentFilters; + }); + if (devToolsSettingsManager != null && bridge != null) { + bridge.addListener('updateConsolePatchSettings', function (consolePatchSettings) { + return cacheConsolePatchSettings(devToolsSettingsManager, consolePatchSettings); + }); + } // The renderer interface doesn't read saved component filters directly, + // because they are generally stored in localStorage within the context of the extension. + // Because of this it relies on the extension to pass filters. + // In the case of the standalone DevTools being used with a website, + // saved filters are injected along with the backend script tag so we shouldn't override them here. + // This injection strategy doesn't work for React Native though. + // Ideally the backend would save the filters itself, but RN doesn't provide a sync storage solution. + // So for now we just fall back to using the default filters... + + if (window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ == null) { + // $FlowFixMe[incompatible-use] found when upgrading Flow + bridge.send('overrideComponentFilters', savedComponentFilters); + } // TODO (npm-packages) Warn if "isBackendStorageAPISupported" + // $FlowFixMe[incompatible-call] found when upgrading Flow + + var agent = new Agent(bridge); + agent.addListener('shutdown', function () { + // If we received 'shutdown' from `agent`, we assume the `bridge` is already shutting down, + // and that caused the 'shutdown' event on the `agent`, so we don't need to call `bridge.shutdown()` here. + hook.emit('shutdown'); + }); + initBackend(hook, agent, window); // Setup React Native style editor if the environment supports it. + + if (resolveRNStyle != null || hook.resolveRNStyle != null) { + setupNativeStyleEditor( + // $FlowFixMe[incompatible-call] found when upgrading Flow + bridge, agent, resolveRNStyle || hook.resolveRNStyle, nativeStyleEditorValidAttributes || hook.nativeStyleEditorValidAttributes || null); + } else { + // Otherwise listen to detect if the environment later supports it. + // For example, Flipper does not eagerly inject these values. + // Instead it relies on the React Native Inspector to lazily inject them. + var lazyResolveRNStyle; + var lazyNativeStyleEditorValidAttributes; + var initAfterTick = function initAfterTick() { + if (bridge !== null) { + setupNativeStyleEditor(bridge, agent, lazyResolveRNStyle, lazyNativeStyleEditorValidAttributes); + } + }; + if (!hook.hasOwnProperty('resolveRNStyle')) { + Object.defineProperty(hook, 'resolveRNStyle', { + enumerable: false, + get: function get() { + return lazyResolveRNStyle; + }, + set: function set(value) { + lazyResolveRNStyle = value; + initAfterTick(); + } + }); + } + if (!hook.hasOwnProperty('nativeStyleEditorValidAttributes')) { + Object.defineProperty(hook, 'nativeStyleEditorValidAttributes', { + enumerable: false, + get: function get() { + return lazyNativeStyleEditorValidAttributes; + }, + set: function set(value) { + lazyNativeStyleEditorValidAttributes = value; + initAfterTick(); + } + }); + } + } + }; + function handleClose() { + if (__DEBUG__) { + backend_debug('WebSocket.onclose'); + } + if (bridge !== null) { + bridge.emit('shutdown'); + } + scheduleRetry(); + } + function handleFailed() { + if (__DEBUG__) { + backend_debug('WebSocket.onerror'); + } + scheduleRetry(); + } + function handleMessage(event) { + var data; + try { + if (typeof event.data === 'string') { + data = JSON.parse(event.data); + if (__DEBUG__) { + backend_debug('WebSocket.onmessage', data); + } + } else { + throw Error(); + } + } catch (e) { + console.error('[React DevTools] Failed to parse JSON: ' + event.data); + return; + } + messageListeners.forEach(function (fn) { + try { + fn(data); + } catch (error) { + // jsc doesn't play so well with tracebacks that go into eval'd code, + // so the stack trace here will stop at the `eval()` call. Getting the + // message that caused the error is the best we can do for now. + console.log('[React DevTools] Error calling listener', data); + console.log('error:', error); + throw error; + } + }); + } + } + })(); + + /******/ + return __webpack_exports__; + /******/ + }(); + }); +},209,[],"node_modules\\react-devtools-core\\dist\\backend.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _NativeEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../EventEmitter/NativeEventEmitter")); + var _logError = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../Utilities/logError")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../Utilities/Platform")); + var _NativeAppState = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./NativeAppState")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + /** + * `AppState` can tell you if the app is in the foreground or background, + * and notify you when the state changes. + * + * See https://reactnative.dev/docs/appstate + */ + var AppState = /*#__PURE__*/function () { + function AppState() { + var _this = this; + (0, _classCallCheck2.default)(this, AppState); + this.currentState = null; + if (_NativeAppState.default == null) { + this.isAvailable = false; + } else { + this.isAvailable = true; + var emitter = new _NativeEventEmitter.default( + // T88715063: NativeEventEmitter only used this parameter on iOS. Now it uses it on all platforms, so this code was modified automatically to preserve its behavior + // If you want to use the native module on other platforms, please remove this condition and test its behavior + _Platform.default.OS !== 'ios' ? null : _NativeAppState.default); + this._emitter = emitter; + this.currentState = _NativeAppState.default.getConstants().initialAppState; + var eventUpdated = false; + + // TODO: this is a terrible solution - in order to ensure `currentState` + // prop is up to date, we have to register an observer that updates it + // whenever the state changes, even if nobody cares. We should just + // deprecate the `currentState` property and get rid of this. + emitter.addListener('appStateDidChange', function (appStateData) { + eventUpdated = true; + _this.currentState = appStateData.app_state; + }); + + // TODO: see above - this request just populates the value of `currentState` + // when the module is first initialized. Would be better to get rid of the + // prop and expose `getCurrentAppState` method directly. + // $FlowExpectedError[incompatible-call] + _NativeAppState.default.getCurrentAppState(function (appStateData) { + // It's possible that the state will have changed here & listeners need to be notified + if (!eventUpdated && _this.currentState !== appStateData.app_state) { + _this.currentState = appStateData.app_state; + // $FlowFixMe[incompatible-call] + emitter.emit('appStateDidChange', appStateData); + } + }, _logError.default); + } + } + + /** + * Add a handler to AppState changes by listening to the `change` event type + * and providing the handler. + * + * See https://reactnative.dev/docs/appstate#addeventlistener + */ + return (0, _createClass2.default)(AppState, [{ + key: "addEventListener", + value: function addEventListener(type, handler) { + var emitter = this._emitter; + if (emitter == null) { + throw new Error('Cannot use AppState when `isAvailable` is false.'); + } + switch (type) { + case 'change': + // $FlowIssue[invalid-tuple-arity] Flow cannot refine handler based on the event type + var changeHandler = handler; + return emitter.addListener('appStateDidChange', function (appStateData) { + changeHandler(appStateData.app_state); + }); + case 'memoryWarning': + // $FlowIssue[invalid-tuple-arity] Flow cannot refine handler based on the event type + var memoryWarningHandler = handler; + return emitter.addListener('memoryWarning', memoryWarningHandler); + case 'blur': + case 'focus': + // $FlowIssue[invalid-tuple-arity] Flow cannot refine handler based on the event type + var focusOrBlurHandler = handler; + return emitter.addListener('appStateFocusChange', function (hasFocus) { + if (type === 'blur' && !hasFocus) { + focusOrBlurHandler(); + } + if (type === 'focus' && hasFocus) { + focusOrBlurHandler(); + } + }); + } + throw new Error('Trying to subscribe to unknown event: ' + type); + } + }]); + }(); + module.exports = new AppState(); +},210,[6,18,19,160,211,34,212],"node_modules\\react-native\\Libraries\\AppState\\AppState.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * Small utility that can be used as an error handler. You cannot just pass + * `console.error` as a failure callback - it's not properly bound. If passes an + * `Error` object, it will print the message and stack. + */ + var logError = function logError() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + if (args.length === 1 && args[0] instanceof Error) { + var err = args[0]; + console.error('Error: "' + err.message + '". Stack:\n' + err.stack); + } else { + console.error.apply(console, args); + } + }; + module.exports = logError; +},211,[],"node_modules\\react-native\\Libraries\\Utilities\\logError.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.getEnforcing('AppState'); +},212,[36],"node_modules\\react-native\\Libraries\\AppState\\NativeAppState.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _processAspectRatio = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../StyleSheet/processAspectRatio")); + var _processColor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../StyleSheet/processColor")); + var _processFontVariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/processFontVariant")); + var _processTransform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../StyleSheet/processTransform")); + var _processTransformOrigin = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../../StyleSheet/processTransformOrigin")); + var _sizesDiffer = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../../Utilities/differ/sizesDiffer")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format strict-local + * + */ + + var colorAttributes = { + process: _processColor.default + }; + var ReactNativeStyleAttributes = { + /** + * Layout + */ + alignContent: true, + alignItems: true, + alignSelf: true, + aspectRatio: { + process: _processAspectRatio.default + }, + borderBottomWidth: true, + borderEndWidth: true, + borderLeftWidth: true, + borderRightWidth: true, + borderStartWidth: true, + borderTopWidth: true, + columnGap: true, + borderWidth: true, + bottom: true, + direction: true, + display: true, + end: true, + flex: true, + flexBasis: true, + flexDirection: true, + flexGrow: true, + flexShrink: true, + flexWrap: true, + gap: true, + height: true, + inset: true, + insetBlock: true, + insetBlockEnd: true, + insetBlockStart: true, + insetInline: true, + insetInlineEnd: true, + insetInlineStart: true, + justifyContent: true, + left: true, + margin: true, + marginBlock: true, + marginBlockEnd: true, + marginBlockStart: true, + marginBottom: true, + marginEnd: true, + marginHorizontal: true, + marginInline: true, + marginInlineEnd: true, + marginInlineStart: true, + marginLeft: true, + marginRight: true, + marginStart: true, + marginTop: true, + marginVertical: true, + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true, + overflow: true, + padding: true, + paddingBlock: true, + paddingBlockEnd: true, + paddingBlockStart: true, + paddingBottom: true, + paddingEnd: true, + paddingHorizontal: true, + paddingInline: true, + paddingInlineEnd: true, + paddingInlineStart: true, + paddingLeft: true, + paddingRight: true, + paddingStart: true, + paddingTop: true, + paddingVertical: true, + position: true, + right: true, + rowGap: true, + start: true, + top: true, + width: true, + zIndex: true, + /** + * Shadow + */ + elevation: true, + shadowColor: colorAttributes, + shadowOffset: { + diff: _sizesDiffer.default + }, + shadowOpacity: true, + shadowRadius: true, + /** + * Transform + */ + transform: { + process: _processTransform.default + }, + transformOrigin: { + process: _processTransformOrigin.default + }, + /** + * View + */ + backfaceVisibility: true, + backgroundColor: colorAttributes, + borderBlockColor: colorAttributes, + borderBlockEndColor: colorAttributes, + borderBlockStartColor: colorAttributes, + borderBottomColor: colorAttributes, + borderBottomEndRadius: true, + borderBottomLeftRadius: true, + borderBottomRightRadius: true, + borderBottomStartRadius: true, + borderColor: colorAttributes, + borderCurve: true, + borderEndColor: colorAttributes, + borderEndEndRadius: true, + borderEndStartRadius: true, + borderLeftColor: colorAttributes, + borderRadius: true, + borderRightColor: colorAttributes, + borderStartColor: colorAttributes, + borderStartEndRadius: true, + borderStartStartRadius: true, + borderStyle: true, + borderTopColor: colorAttributes, + borderTopEndRadius: true, + borderTopLeftRadius: true, + borderTopRightRadius: true, + borderTopStartRadius: true, + opacity: true, + pointerEvents: true, + /** + * Text + */ + color: colorAttributes, + fontFamily: true, + fontSize: true, + fontStyle: true, + fontVariant: { + process: _processFontVariant.default + }, + fontWeight: true, + includeFontPadding: true, + letterSpacing: true, + lineHeight: true, + textAlign: true, + textAlignVertical: true, + textDecorationColor: colorAttributes, + textDecorationLine: true, + textDecorationStyle: true, + textShadowColor: colorAttributes, + textShadowOffset: true, + textShadowRadius: true, + textTransform: true, + userSelect: true, + verticalAlign: true, + writingDirection: true, + /** + * Image + */ + overlayColor: colorAttributes, + resizeMode: true, + tintColor: colorAttributes, + objectFit: true + }; + module.exports = ReactNativeStyleAttributes; +},213,[6,214,189,215,216,218,219],"node_modules\\react-native\\Libraries\\Components\\View\\ReactNativeStyleAttributes.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + function processAspectRatio(aspectRatio) { + if (typeof aspectRatio === 'number') { + return aspectRatio; + } + if (typeof aspectRatio !== 'string') { + if (__DEV__) { + _$$_REQUIRE(_dependencyMap[0], "invariant")(!aspectRatio, 'aspectRatio must either be a number, a ratio string or `auto`. You passed: %s', aspectRatio); + } + return; + } + var matches = aspectRatio.split('/').map(function (s) { + return s.trim(); + }); + if (matches.includes('auto')) { + if (__DEV__) { + _$$_REQUIRE(_dependencyMap[0], "invariant")(matches.length, 'aspectRatio does not support `auto `. You passed: %s', aspectRatio); + } + return; + } + var hasNonNumericValues = matches.some(function (n) { + return Number.isNaN(Number(n)); + }); + if (__DEV__) { + _$$_REQUIRE(_dependencyMap[0], "invariant")(!hasNonNumericValues && (matches.length === 1 || matches.length === 2), 'aspectRatio must either be a number, a ratio string or `auto`. You passed: %s', aspectRatio); + } + if (hasNonNumericValues) { + return; + } + if (matches.length === 2) { + return Number(matches[0]) / Number(matches[1]); + } + return Number(matches[0]); + } + module.exports = processAspectRatio; +},214,[37],"node_modules\\react-native\\Libraries\\StyleSheet\\processAspectRatio.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + function processFontVariant(fontVariant) { + if (Array.isArray(fontVariant)) { + return fontVariant; + } + + // $FlowFixMe[incompatible-type] + var match = fontVariant.split(' ').filter(Boolean); + return match; + } + module.exports = processFontVariant; +},215,[],"node_modules\\react-native\\Libraries\\StyleSheet\\processFontVariant.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _defineProperty = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/defineProperty"); + /** + * Generate a transform matrix based on the provided transforms, and use that + * within the style object instead. + * + * This allows us to provide an API that is similar to CSS, where transforms may + * be applied in an arbitrary order, and yet have a universal, singular + * interface to native code. + */ + function processTransform(transform) { + if (typeof transform === 'string') { + var regex = new RegExp(/(\w+)\(([^)]+)\)/g); + var transformArray = []; + var matches; + while (matches = regex.exec(transform)) { + var _getKeyAndValueFromCS = _getKeyAndValueFromCSSTransform(matches[1], matches[2]), + _key = _getKeyAndValueFromCS.key, + value = _getKeyAndValueFromCS.value; + if (value !== undefined) { + transformArray.push(_defineProperty({}, _key, value)); + } + } + transform = transformArray; + } + if (__DEV__) { + _validateTransforms(transform); + } + return transform; + } + var _getKeyAndValueFromCSSTransform = function _getKeyAndValueFromCSSTransform(key, args) { + var _args$match; + var argsWithUnitsRegex = new RegExp(/([+-]?\d+(\.\d+)?)([a-zA-Z]+)?/g); + switch (key) { + case 'matrix': + return { + key: key, + value: (_args$match = args.match(/[+-]?\d+(\.\d+)?/g)) == null ? void 0 : _args$match.map(Number) + }; + case 'translate': + case 'translate3d': + var parsedArgs = []; + var missingUnitOfMeasurement = false; + var matches; + while (matches = argsWithUnitsRegex.exec(args)) { + var _value = Number(matches[1]); + var _unitOfMeasurement = matches[3]; + if (_value !== 0 && !_unitOfMeasurement) { + missingUnitOfMeasurement = true; + } + parsedArgs.push(_value); + } + if (__DEV__) { + _$$_REQUIRE(_dependencyMap[1], "invariant")(!missingUnitOfMeasurement, `Transform with key ${key} must have units unless the provided value is 0, found %s`, `${key}(${args})`); + if (key === 'translate') { + _$$_REQUIRE(_dependencyMap[1], "invariant")((parsedArgs == null ? void 0 : parsedArgs.length) === 1 || (parsedArgs == null ? void 0 : parsedArgs.length) === 2, 'Transform with key translate must be an string with 1 or 2 parameters, found %s: %s', parsedArgs == null ? void 0 : parsedArgs.length, `${key}(${args})`); + } else { + _$$_REQUIRE(_dependencyMap[1], "invariant")((parsedArgs == null ? void 0 : parsedArgs.length) === 3, 'Transform with key translate3d must be an string with 3 parameters, found %s: %s', parsedArgs == null ? void 0 : parsedArgs.length, `${key}(${args})`); + } + } + if ((parsedArgs == null ? void 0 : parsedArgs.length) === 1) { + parsedArgs.push(0); + } + return { + key: 'translate', + value: parsedArgs + }; + case 'translateX': + case 'translateY': + case 'perspective': + var argMatches = argsWithUnitsRegex.exec(args); + if (!(argMatches != null && argMatches.length)) { + return { + key: key, + value: undefined + }; + } + var value = Number(argMatches[1]); + var unitOfMeasurement = argMatches[3]; + if (__DEV__) { + _$$_REQUIRE(_dependencyMap[1], "invariant")(value === 0 || unitOfMeasurement, `Transform with key ${key} must have units unless the provided value is 0, found %s`, `${key}(${args})`); + } + return { + key: key, + value: value + }; + default: + return { + key: key, + value: !isNaN(args) ? Number(args) : args + }; + } + }; + function _validateTransforms(transform) { + transform.forEach(function (transformation) { + var keys = Object.keys(transformation); + _$$_REQUIRE(_dependencyMap[1], "invariant")(keys.length === 1, 'You must specify exactly one property per transform object. Passed properties: %s', _$$_REQUIRE(_dependencyMap[2], "../Utilities/stringifySafe").default(transformation)); + var key = keys[0]; + var value = transformation[key]; + _validateTransform(key, value, transformation); + }); + } + function _validateTransform(key, value, transformation) { + _$$_REQUIRE(_dependencyMap[1], "invariant")(!value.getValue, 'You passed an Animated.Value to a normal component. ' + 'You need to wrap that component in an Animated. For example, ' + 'replace by .'); + var multivalueTransforms = ['matrix', 'translate']; + if (multivalueTransforms.indexOf(key) !== -1) { + _$$_REQUIRE(_dependencyMap[1], "invariant")(Array.isArray(value), 'Transform with key of %s must have an array as the value: %s', key, _$$_REQUIRE(_dependencyMap[2], "../Utilities/stringifySafe").default(transformation)); + } + switch (key) { + case 'matrix': + _$$_REQUIRE(_dependencyMap[1], "invariant")(value.length === 9 || value.length === 16, 'Matrix transform must have a length of 9 (2d) or 16 (3d). ' + 'Provided matrix has a length of %s: %s', + /* $FlowFixMe[prop-missing] (>=0.84.0 site=react_native_fb) This + * comment suppresses an error found when Flow v0.84 was deployed. To + * see the error, delete this comment and run Flow. */ + value.length, _$$_REQUIRE(_dependencyMap[2], "../Utilities/stringifySafe").default(transformation)); + break; + case 'translate': + _$$_REQUIRE(_dependencyMap[1], "invariant")(value.length === 2 || value.length === 3, 'Transform with key translate must be an array of length 2 or 3, found %s: %s', + /* $FlowFixMe[prop-missing] (>=0.84.0 site=react_native_fb) This + * comment suppresses an error found when Flow v0.84 was deployed. To + * see the error, delete this comment and run Flow. */ + value.length, _$$_REQUIRE(_dependencyMap[2], "../Utilities/stringifySafe").default(transformation)); + break; + case 'rotateX': + case 'rotateY': + case 'rotateZ': + case 'rotate': + case 'skewX': + case 'skewY': + _$$_REQUIRE(_dependencyMap[1], "invariant")(typeof value === 'string', 'Transform with key of "%s" must be a string: %s', key, _$$_REQUIRE(_dependencyMap[2], "../Utilities/stringifySafe").default(transformation)); + _$$_REQUIRE(_dependencyMap[1], "invariant")(value.indexOf('deg') > -1 || value.indexOf('rad') > -1, 'Rotate transform must be expressed in degrees (deg) or radians ' + '(rad): %s', _$$_REQUIRE(_dependencyMap[2], "../Utilities/stringifySafe").default(transformation)); + break; + case 'perspective': + _$$_REQUIRE(_dependencyMap[1], "invariant")(typeof value === 'number', 'Transform with key of "%s" must be a number: %s', key, _$$_REQUIRE(_dependencyMap[2], "../Utilities/stringifySafe").default(transformation)); + _$$_REQUIRE(_dependencyMap[1], "invariant")(value !== 0, 'Transform with key of "%s" cannot be zero: %s', key, _$$_REQUIRE(_dependencyMap[2], "../Utilities/stringifySafe").default(transformation)); + break; + case 'translateX': + case 'translateY': + case 'scale': + case 'scaleX': + case 'scaleY': + _$$_REQUIRE(_dependencyMap[1], "invariant")(typeof value === 'number', 'Transform with key of "%s" must be a number: %s', key, _$$_REQUIRE(_dependencyMap[2], "../Utilities/stringifySafe").default(transformation)); + break; + default: + _$$_REQUIRE(_dependencyMap[1], "invariant")(false, 'Invalid transform %s: %s', key, _$$_REQUIRE(_dependencyMap[2], "../Utilities/stringifySafe").default(transformation)); + } + } + module.exports = processTransform; +},216,[217,37,46],"node_modules\\react-native\\Libraries\\StyleSheet\\processTransform.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _defineProperty(e, r, t) { + return (r = _$$_REQUIRE(_dependencyMap[0], "./toPropertyKey.js")(r)) in e ? Object.defineProperty(e, r, { + value: t, + enumerable: !0, + configurable: !0, + writable: !0 + }) : e[r] = t, e; + } + module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; +},217,[20],"node_modules\\@babel\\runtime\\helpers\\defineProperty.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = processTransformOrigin; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "invariant")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var INDEX_X = 0; + var INDEX_Y = 1; + var INDEX_Z = 2; + + /* eslint-disable no-labels */ + function processTransformOrigin(transformOrigin) { + if (typeof transformOrigin === 'string') { + var transformOriginString = transformOrigin; + var regex = /(top|bottom|left|right|center|\d+(?:%|px)|0)/gi; + var transformOriginArray = ['50%', '50%', 0]; + var index = INDEX_X; + var matches; + outer: while (matches = regex.exec(transformOriginString)) { + var nextIndex = index + 1; + var value = matches[0]; + var valueLower = value.toLowerCase(); + switch (valueLower) { + case 'left': + case 'right': + { + (0, _invariant.default)(index === INDEX_X, 'Transform-origin %s can only be used for x-position', value); + transformOriginArray[INDEX_X] = valueLower === 'left' ? 0 : '100%'; + break; + } + case 'top': + case 'bottom': + { + (0, _invariant.default)(index !== INDEX_Z, 'Transform-origin %s can only be used for y-position', value); + transformOriginArray[INDEX_Y] = valueLower === 'top' ? 0 : '100%'; + + // Handle [[ center | left | right ] && [ center | top | bottom ]] ? + if (index === INDEX_X) { + var horizontal = regex.exec(transformOriginString); + if (horizontal == null) { + break outer; + } + switch (horizontal[0].toLowerCase()) { + case 'left': + transformOriginArray[INDEX_X] = 0; + break; + case 'right': + transformOriginArray[INDEX_X] = '100%'; + break; + case 'center': + transformOriginArray[INDEX_X] = '50%'; + break; + default: + (0, _invariant.default)(false, 'Could not parse transform-origin: %s', transformOriginString); + } + nextIndex = INDEX_Z; + } + break; + } + case 'center': + { + (0, _invariant.default)(index !== INDEX_Z, 'Transform-origin value %s cannot be used for z-position', value); + transformOriginArray[index] = '50%'; + break; + } + default: + { + if (value.endsWith('%')) { + transformOriginArray[index] = value; + } else { + transformOriginArray[index] = parseFloat(value); // Remove `px` + } + break; + } + } + index = nextIndex; + } + transformOrigin = transformOriginArray; + } + if (__DEV__) { + _validateTransformOrigin(transformOrigin); + } + return transformOrigin; + } + function _validateTransformOrigin(transformOrigin) { + (0, _invariant.default)(transformOrigin.length === 3, 'Transform origin must have exactly 3 values.'); + var _transformOrigin = (0, _slicedToArray2.default)(transformOrigin, 3), + x = _transformOrigin[0], + y = _transformOrigin[1], + z = _transformOrigin[2]; + (0, _invariant.default)(typeof x === 'number' || typeof x === 'string' && x.endsWith('%'), 'Transform origin x-position must be a number. Passed value: %s.', x); + (0, _invariant.default)(typeof y === 'number' || typeof y === 'string' && y.endsWith('%'), 'Transform origin y-position must be a number. Passed value: %s.', y); + (0, _invariant.default)(typeof z === 'number', 'Transform origin z-position must be a number. Passed value: %s.', z); + } +},218,[6,7,37],"node_modules\\react-native\\Libraries\\StyleSheet\\processTransformOrigin.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var dummySize = { + width: undefined, + height: undefined + }; + var sizesDiffer = function sizesDiffer(one, two) { + var defaultedOne = one || dummySize; + var defaultedTwo = two || dummySize; + return defaultedOne !== defaultedTwo && (defaultedOne.width !== defaultedTwo.width || defaultedOne.height !== defaultedTwo.height); + }; + module.exports = sizesDiffer; +},219,[],"node_modules\\react-native\\Libraries\\Utilities\\differ\\sizesDiffer.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _DevSettings = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../Utilities/DevSettings")); + var _NativeDevToolsSettingsManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "./NativeDevToolsSettingsManager")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + module.exports = { + setConsolePatchSettings: function setConsolePatchSettings(newSettings) { + _NativeDevToolsSettingsManager.default == null ? void 0 : _NativeDevToolsSettingsManager.default.setConsolePatchSettings(newSettings); + }, + getConsolePatchSettings: function getConsolePatchSettings() { + return _NativeDevToolsSettingsManager.default == null ? void 0 : _NativeDevToolsSettingsManager.default.getConsolePatchSettings(); + }, + setProfilingSettings: function setProfilingSettings(newSettings) { + if ((_NativeDevToolsSettingsManager.default == null ? void 0 : _NativeDevToolsSettingsManager.default.setProfilingSettings) != null) { + _NativeDevToolsSettingsManager.default.setProfilingSettings(newSettings); + } + }, + getProfilingSettings: function getProfilingSettings() { + if ((_NativeDevToolsSettingsManager.default == null ? void 0 : _NativeDevToolsSettingsManager.default.getProfilingSettings) != null) { + return _NativeDevToolsSettingsManager.default.getProfilingSettings(); + } + return null; + }, + reload: function reload() { + _DevSettings.default == null ? void 0 : _DevSettings.default.reload(); + } + }; +},220,[6,199,221],"node_modules\\react-native\\Libraries\\DevToolsSettings\\DevToolsSettingsManager.android.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('DevToolsSettingsManager'); +},221,[36],"node_modules\\react-native\\Libraries\\DevToolsSettings\\NativeDevToolsSettingsManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + // $FlowFixMe[unsupported-variance-annotation] + function flattenStyle(style + // $FlowFixMe[underconstrained-implicit-instantiation] + ) { + if (style === null || typeof style !== 'object') { + return undefined; + } + if (!Array.isArray(style)) { + return style; + } + var result = {}; + for (var i = 0, styleLength = style.length; i < styleLength; ++i) { + // $FlowFixMe[underconstrained-implicit-instantiation] + var computedStyle = flattenStyle(style[i]); + if (computedStyle) { + // $FlowFixMe[invalid-in-rhs] + for (var key in computedStyle) { + // $FlowFixMe[incompatible-use] + result[key] = computedStyle[key]; + } + } + } + // $FlowFixMe[incompatible-return] + return result; + } + module.exports = flattenStyle; +},222,[],"node_modules\\react-native\\Libraries\\StyleSheet\\flattenStyle.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + // Flow doesn't support static declarations in interface + + var JSInspector = { + registerAgent: function registerAgent(type) { + if (global.__registerInspectorAgent) { + global.__registerInspectorAgent(type); + } + }, + getTimestamp: function getTimestamp() { + return global.__inspectorTimestamp(); + } + }; + module.exports = JSInspector; +},223,[],"node_modules\\react-native\\Libraries\\JSInspector\\JSInspector.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _possibleConstructorReturn = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/possibleConstructorReturn"); + var _getPrototypeOf = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/getPrototypeOf"); + var _inherits = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/inherits"); + var _classCallCheck = _$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/createClass"); + function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + // We don't currently care about this + var Interceptor = /*#__PURE__*/function () { + function Interceptor(agent) { + _classCallCheck(this, Interceptor); + this._agent = agent; + this._requests = new Map(); + } + return _createClass(Interceptor, [{ + key: "getData", + value: function getData(requestId) { + return this._requests.get(requestId); + } + }, { + key: "requestSent", + value: function requestSent(id, url, method, headers) { + var requestId = String(id); + this._requests.set(requestId, ''); + var request = { + url: url, + method: method, + headers: headers, + initialPriority: 'Medium' + }; + var event = { + requestId: requestId, + documentURL: '', + frameId: '1', + loaderId: '1', + request: request, + timestamp: _$$_REQUIRE(_dependencyMap[5], "./JSInspector").getTimestamp(), + initiator: { + // TODO(blom): Get stack trace + // If type is 'script' the inspector will try to execute + // `stack.callFrames[0]` + type: 'other' + }, + type: 'Other' + }; + this._agent.sendEvent('requestWillBeSent', event); + } + }, { + key: "responseReceived", + value: function responseReceived(id, url, status, headers) { + var requestId = String(id); + var response = { + url: url, + status: status, + statusText: String(status), + headers: headers, + // TODO(blom) refined headers, can we get this? + requestHeaders: {}, + mimeType: this._getMimeType(headers), + connectionReused: false, + connectionId: -1, + encodedDataLength: 0, + securityState: 'unknown' + }; + var event = { + requestId: requestId, + frameId: '1', + loaderId: '1', + timestamp: _$$_REQUIRE(_dependencyMap[5], "./JSInspector").getTimestamp(), + type: 'Other', + response: response + }; + this._agent.sendEvent('responseReceived', event); + } + }, { + key: "dataReceived", + value: function dataReceived(id, data) { + var requestId = String(id); + var existingData = this._requests.get(requestId) || ''; + this._requests.set(requestId, existingData.concat(data)); + var event = { + requestId: requestId, + timestamp: _$$_REQUIRE(_dependencyMap[5], "./JSInspector").getTimestamp(), + dataLength: data.length, + encodedDataLength: data.length + }; + this._agent.sendEvent('dataReceived', event); + } + }, { + key: "loadingFinished", + value: function loadingFinished(id, encodedDataLength) { + var event = { + requestId: String(id), + timestamp: _$$_REQUIRE(_dependencyMap[5], "./JSInspector").getTimestamp(), + encodedDataLength: encodedDataLength + }; + this._agent.sendEvent('loadingFinished', event); + } + }, { + key: "loadingFailed", + value: function loadingFailed(id, error) { + var event = { + requestId: String(id), + timestamp: _$$_REQUIRE(_dependencyMap[5], "./JSInspector").getTimestamp(), + type: 'Other', + errorText: error + }; + this._agent.sendEvent('loadingFailed', event); + } + }, { + key: "_getMimeType", + value: function _getMimeType(headers) { + var contentType = headers['Content-Type'] || ''; + return contentType.split(';')[0]; + } + }]); + }(); + var NetworkAgent = /*#__PURE__*/function (_InspectorAgent) { + function NetworkAgent() { + _classCallCheck(this, NetworkAgent); + return _callSuper(this, NetworkAgent, arguments); + } + _inherits(NetworkAgent, _InspectorAgent); + return _createClass(NetworkAgent, [{ + key: "enable", + value: function enable(_ref) { + var maxResourceBufferSize = _ref.maxResourceBufferSize, + maxTotalBufferSize = _ref.maxTotalBufferSize; + this._interceptor = new Interceptor(this); + _$$_REQUIRE(_dependencyMap[6], "../Network/XMLHttpRequest").setInterceptor(this._interceptor); + } + }, { + key: "disable", + value: function disable() { + _$$_REQUIRE(_dependencyMap[6], "../Network/XMLHttpRequest").setInterceptor(null); + this._interceptor = null; + } + }, { + key: "getResponseBody", + value: function getResponseBody(_ref2) { + var requestId = _ref2.requestId; + return { + body: this.interceptor().getData(requestId), + base64Encoded: false + }; + } + }, { + key: "interceptor", + value: function interceptor() { + if (this._interceptor) { + return this._interceptor; + } else { + throw Error('_interceptor can not be null'); + } + } + }]); + }(_$$_REQUIRE(_dependencyMap[7], "./InspectorAgent")); + NetworkAgent.DOMAIN = 'Network'; + module.exports = NetworkAgent; +},224,[23,25,28,18,19,223,149,225],"node_modules\\react-native\\Libraries\\JSInspector\\NetworkAgent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _classCallCheck = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/createClass"); + var InspectorAgent = /*#__PURE__*/function () { + function InspectorAgent(eventSender) { + _classCallCheck(this, InspectorAgent); + this._eventSender = eventSender; + } + return _createClass(InspectorAgent, [{ + key: "sendEvent", + value: function sendEvent(name, params) { + this._eventSender(name, params); + } + }]); + }(); + module.exports = InspectorAgent; +},225,[18,19],"node_modules\\react-native\\Libraries\\JSInspector\\InspectorAgent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + if (__DEV__) { + var DevSettings = _$$_REQUIRE(_dependencyMap[0], "../Utilities/DevSettings"); + if (typeof DevSettings.reload !== 'function') { + throw new Error('Could not find the reload() implementation.'); + } + + // This needs to run before the renderer initializes. + var ReactRefreshRuntime = _$$_REQUIRE(_dependencyMap[1], "react-refresh/runtime"); + ReactRefreshRuntime.injectIntoGlobalHook(global); + var Refresh = { + performFullRefresh: function performFullRefresh(reason) { + DevSettings.reload(reason); + }, + createSignatureFunctionForTransform: ReactRefreshRuntime.createSignatureFunctionForTransform, + isLikelyComponentType: ReactRefreshRuntime.isLikelyComponentType, + getFamilyByType: ReactRefreshRuntime.getFamilyByType, + register: ReactRefreshRuntime.register, + performReactRefresh: function performReactRefresh() { + if (ReactRefreshRuntime.hasUnrecoverableErrors()) { + DevSettings.reload('Fast Refresh - Unrecoverable'); + return; + } + ReactRefreshRuntime.performReactRefresh(); + DevSettings.onFastRefresh(); + } + }; + + // The metro require polyfill can not have dependencies (applies for all polyfills). + // Expose `Refresh` by assigning it to global to make it available in the polyfill. + global[(global.__METRO_GLOBAL_PREFIX__ || '') + '__ReactRefresh'] = Refresh; + } +},226,[199,227],"node_modules\\react-native\\Libraries\\Core\\setUpReactRefresh.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + if (process.env.NODE_ENV === 'production') { + module.exports = _$$_REQUIRE(_dependencyMap[0], "./cjs/react-refresh-runtime.production.min.js"); + } else { + module.exports = _$$_REQUIRE(_dependencyMap[1], "./cjs/react-refresh-runtime.development.js"); + } +},227,[228,229],"node_modules\\react-refresh\\runtime.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * @license React + * react-refresh-runtime.production.min.js + * + * 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. + */ + 'use strict'; + + throw Error("React Refresh runtime should not be included in the production bundle."); +},228,[],"node_modules\\react-refresh\\cjs\\react-refresh-runtime.production.min.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * @license React + * react-refresh-runtime.development.js + * + * 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. + */ + + 'use strict'; + + if (process.env.NODE_ENV !== "production") { + (function () { + 'use strict'; + + // ATTENTION + var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); + var REACT_MEMO_TYPE = Symbol.for('react.memo'); + var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // We never remove these associations. + // It's OK to reference families, but use WeakMap/Set for types. + + var allFamiliesByID = new Map(); + var allFamiliesByType = new PossiblyWeakMap(); + var allSignaturesByType = new PossiblyWeakMap(); // This WeakMap is read by React, so we only put families + // that have actually been edited here. This keeps checks fast. + // $FlowIssue + + var updatedFamiliesByType = new PossiblyWeakMap(); // This is cleared on every performReactRefresh() call. + // It is an array of [Family, NextType] tuples. + + var pendingUpdates = []; // This is injected by the renderer via DevTools global hook. + + var helpersByRendererID = new Map(); + var helpersByRoot = new Map(); // We keep track of mounted roots so we can schedule updates. + + var mountedRoots = new Set(); // If a root captures an error, we remember it so we can retry on edit. + + var failedRoots = new Set(); // In environments that support WeakMap, we also remember the last element for every root. + // It needs to be weak because we do this even for roots that failed to mount. + // If there is no WeakMap, we won't attempt to do retrying. + // $FlowIssue + + var rootElements = + // $FlowIssue + typeof WeakMap === 'function' ? new WeakMap() : null; + var isPerformingRefresh = false; + function computeFullKey(signature) { + if (signature.fullKey !== null) { + return signature.fullKey; + } + var fullKey = signature.ownKey; + var hooks; + try { + hooks = signature.getCustomHooks(); + } catch (err) { + // This can happen in an edge case, e.g. if expression like Foo.useSomething + // depends on Foo which is lazily initialized during rendering. + // In that case just assume we'll have to remount. + signature.forceReset = true; + signature.fullKey = fullKey; + return fullKey; + } + for (var i = 0; i < hooks.length; i++) { + var hook = hooks[i]; + if (typeof hook !== 'function') { + // Something's wrong. Assume we need to remount. + signature.forceReset = true; + signature.fullKey = fullKey; + return fullKey; + } + var nestedHookSignature = allSignaturesByType.get(hook); + if (nestedHookSignature === undefined) { + // No signature means Hook wasn't in the source code, e.g. in a library. + // We'll skip it because we can assume it won't change during this session. + continue; + } + var nestedHookKey = computeFullKey(nestedHookSignature); + if (nestedHookSignature.forceReset) { + signature.forceReset = true; + } + fullKey += '\n---\n' + nestedHookKey; + } + signature.fullKey = fullKey; + return fullKey; + } + function haveEqualSignatures(prevType, nextType) { + var prevSignature = allSignaturesByType.get(prevType); + var nextSignature = allSignaturesByType.get(nextType); + if (prevSignature === undefined && nextSignature === undefined) { + return true; + } + if (prevSignature === undefined || nextSignature === undefined) { + return false; + } + if (computeFullKey(prevSignature) !== computeFullKey(nextSignature)) { + return false; + } + if (nextSignature.forceReset) { + return false; + } + return true; + } + function isReactClass(type) { + return type.prototype && type.prototype.isReactComponent; + } + function canPreserveStateBetween(prevType, nextType) { + if (isReactClass(prevType) || isReactClass(nextType)) { + return false; + } + if (haveEqualSignatures(prevType, nextType)) { + return true; + } + return false; + } + function resolveFamily(type) { + // Only check updated types to keep lookups fast. + return updatedFamiliesByType.get(type); + } // If we didn't care about IE11, we could use new Map/Set(iterable). + + function cloneMap(map) { + var clone = new Map(); + map.forEach(function (value, key) { + clone.set(key, value); + }); + return clone; + } + function cloneSet(set) { + var clone = new Set(); + set.forEach(function (value) { + clone.add(value); + }); + return clone; + } // This is a safety mechanism to protect against rogue getters and Proxies. + + function getProperty(object, property) { + try { + return object[property]; + } catch (err) { + // Intentionally ignore. + return undefined; + } + } + function performReactRefresh() { + if (pendingUpdates.length === 0) { + return null; + } + if (isPerformingRefresh) { + return null; + } + isPerformingRefresh = true; + try { + var staleFamilies = new Set(); + var updatedFamilies = new Set(); + var updates = pendingUpdates; + pendingUpdates = []; + updates.forEach(function (_ref) { + var family = _ref[0], + nextType = _ref[1]; + // Now that we got a real edit, we can create associations + // that will be read by the React reconciler. + var prevType = family.current; + updatedFamiliesByType.set(prevType, family); + updatedFamiliesByType.set(nextType, family); + family.current = nextType; // Determine whether this should be a re-render or a re-mount. + + if (canPreserveStateBetween(prevType, nextType)) { + updatedFamilies.add(family); + } else { + staleFamilies.add(family); + } + }); // TODO: rename these fields to something more meaningful. + + var update = { + updatedFamilies: updatedFamilies, + // Families that will re-render preserving state + staleFamilies: staleFamilies // Families that will be remounted + }; + helpersByRendererID.forEach(function (helpers) { + // Even if there are no roots, set the handler on first update. + // This ensures that if *new* roots are mounted, they'll use the resolve handler. + helpers.setRefreshHandler(resolveFamily); + }); + var didError = false; + var firstError = null; // We snapshot maps and sets that are mutated during commits. + // If we don't do this, there is a risk they will be mutated while + // we iterate over them. For example, trying to recover a failed root + // may cause another root to be added to the failed list -- an infinite loop. + + var failedRootsSnapshot = cloneSet(failedRoots); + var mountedRootsSnapshot = cloneSet(mountedRoots); + var helpersByRootSnapshot = cloneMap(helpersByRoot); + failedRootsSnapshot.forEach(function (root) { + var helpers = helpersByRootSnapshot.get(root); + if (helpers === undefined) { + throw new Error('Could not find helpers for a root. This is a bug in React Refresh.'); + } + if (!failedRoots.has(root)) {// No longer failed. + } + if (rootElements === null) { + return; + } + if (!rootElements.has(root)) { + return; + } + var element = rootElements.get(root); + try { + helpers.scheduleRoot(root, element); + } catch (err) { + if (!didError) { + didError = true; + firstError = err; + } // Keep trying other roots. + } + }); + mountedRootsSnapshot.forEach(function (root) { + var helpers = helpersByRootSnapshot.get(root); + if (helpers === undefined) { + throw new Error('Could not find helpers for a root. This is a bug in React Refresh.'); + } + if (!mountedRoots.has(root)) {// No longer mounted. + } + try { + helpers.scheduleRefresh(root, update); + } catch (err) { + if (!didError) { + didError = true; + firstError = err; + } // Keep trying other roots. + } + }); + if (didError) { + throw firstError; + } + return update; + } finally { + isPerformingRefresh = false; + } + } + function register(type, id) { + { + if (type === null) { + return; + } + if (typeof type !== 'function' && typeof type !== 'object') { + return; + } // This can happen in an edge case, e.g. if we register + // return value of a HOC but it returns a cached component. + // Ignore anything but the first registration for each type. + + if (allFamiliesByType.has(type)) { + return; + } // Create family or remember to update it. + // None of this bookkeeping affects reconciliation + // until the first performReactRefresh() call above. + + var family = allFamiliesByID.get(id); + if (family === undefined) { + family = { + current: type + }; + allFamiliesByID.set(id, family); + } else { + pendingUpdates.push([family, type]); + } + allFamiliesByType.set(type, family); // Visit inner types because we might not have registered them. + + if (typeof type === 'object' && type !== null) { + switch (getProperty(type, '$$typeof')) { + case REACT_FORWARD_REF_TYPE: + register(type.render, id + '$render'); + break; + case REACT_MEMO_TYPE: + register(type.type, id + '$type'); + break; + } + } + } + } + function setSignature(type, key) { + var forceReset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + var getCustomHooks = arguments.length > 3 ? arguments[3] : undefined; + { + if (!allSignaturesByType.has(type)) { + allSignaturesByType.set(type, { + forceReset: forceReset, + ownKey: key, + fullKey: null, + getCustomHooks: getCustomHooks || function () { + return []; + } + }); + } // Visit inner types because we might not have signed them. + + if (typeof type === 'object' && type !== null) { + switch (getProperty(type, '$$typeof')) { + case REACT_FORWARD_REF_TYPE: + setSignature(type.render, key, forceReset, getCustomHooks); + break; + case REACT_MEMO_TYPE: + setSignature(type.type, key, forceReset, getCustomHooks); + break; + } + } + } + } // This is lazily called during first render for a type. + // It captures Hook list at that time so inline requires don't break comparisons. + + function collectCustomHooksForSignature(type) { + { + var signature = allSignaturesByType.get(type); + if (signature !== undefined) { + computeFullKey(signature); + } + } + } + function getFamilyByID(id) { + { + return allFamiliesByID.get(id); + } + } + function getFamilyByType(type) { + { + return allFamiliesByType.get(type); + } + } + function findAffectedHostInstances(families) { + { + var affectedInstances = new Set(); + mountedRoots.forEach(function (root) { + var helpers = helpersByRoot.get(root); + if (helpers === undefined) { + throw new Error('Could not find helpers for a root. This is a bug in React Refresh.'); + } + var instancesForRoot = helpers.findHostInstancesForRefresh(root, families); + instancesForRoot.forEach(function (inst) { + affectedInstances.add(inst); + }); + }); + return affectedInstances; + } + } + function injectIntoGlobalHook(globalObject) { + { + // For React Native, the global hook will be set up by require('react-devtools-core'). + // That code will run before us. So we need to monkeypatch functions on existing hook. + // For React Web, the global hook will be set up by the extension. + // This will also run before us. + var hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__; + if (hook === undefined) { + // However, if there is no DevTools extension, we'll need to set up the global hook ourselves. + // Note that in this case it's important that renderer code runs *after* this method call. + // Otherwise, the renderer will think that there is no global hook, and won't do the injection. + var nextID = 0; + globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = { + renderers: new Map(), + supportsFiber: true, + inject: function inject(injected) { + return nextID++; + }, + onScheduleFiberRoot: function onScheduleFiberRoot(id, root, children) {}, + onCommitFiberRoot: function onCommitFiberRoot(id, root, maybePriorityLevel, didError) {}, + onCommitFiberUnmount: function onCommitFiberUnmount() {} + }; + } + if (hook.isDisabled) { + // This isn't a real property on the hook, but it can be set to opt out + // of DevTools integration and associated warnings and logs. + // Using console['warn'] to evade Babel and ESLint + console['warn']('Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). ' + 'Fast Refresh is not compatible with this shim and will be disabled.'); + return; + } // Here, we just want to get a reference to scheduleRefresh. + + var oldInject = hook.inject; + hook.inject = function (injected) { + var id = oldInject.apply(this, arguments); + if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') { + // This version supports React Refresh. + helpersByRendererID.set(id, injected); + } + return id; + }; // Do the same for any already injected roots. + // This is useful if ReactDOM has already been initialized. + // https://github.com/facebook/react/issues/17626 + + hook.renderers.forEach(function (injected, id) { + if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') { + // This version supports React Refresh. + helpersByRendererID.set(id, injected); + } + }); // We also want to track currently mounted roots. + + var oldOnCommitFiberRoot = hook.onCommitFiberRoot; + var oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || function () {}; + hook.onScheduleFiberRoot = function (id, root, children) { + if (!isPerformingRefresh) { + // If it was intentionally scheduled, don't attempt to restore. + // This includes intentionally scheduled unmounts. + failedRoots.delete(root); + if (rootElements !== null) { + rootElements.set(root, children); + } + } + return oldOnScheduleFiberRoot.apply(this, arguments); + }; + hook.onCommitFiberRoot = function (id, root, maybePriorityLevel, didError) { + var helpers = helpersByRendererID.get(id); + if (helpers !== undefined) { + helpersByRoot.set(root, helpers); + var current = root.current; + var alternate = current.alternate; // We need to determine whether this root has just (un)mounted. + // This logic is copy-pasted from similar logic in the DevTools backend. + // If this breaks with some refactoring, you'll want to update DevTools too. + + if (alternate !== null) { + var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null && mountedRoots.has(root); + var isMounted = current.memoizedState != null && current.memoizedState.element != null; + if (!wasMounted && isMounted) { + // Mount a new root. + mountedRoots.add(root); + failedRoots.delete(root); + } else if (wasMounted && isMounted) ;else if (wasMounted && !isMounted) { + // Unmount an existing root. + mountedRoots.delete(root); + if (didError) { + // We'll remount it on future edits. + failedRoots.add(root); + } else { + helpersByRoot.delete(root); + } + } else if (!wasMounted && !isMounted) { + if (didError) { + // We'll remount it on future edits. + failedRoots.add(root); + } + } + } else { + // Mount a new root. + mountedRoots.add(root); + } + } // Always call the decorated DevTools hook. + + return oldOnCommitFiberRoot.apply(this, arguments); + }; + } + } + function hasUnrecoverableErrors() { + // TODO: delete this after removing dependency in RN. + return false; + } // Exposed for testing. + + function _getMountedRootCount() { + { + return mountedRoots.size; + } + } // This is a wrapper over more primitive functions for setting signature. + // Signatures let us decide whether the Hook order has changed on refresh. + // + // This function is intended to be used as a transform target, e.g.: + // var _s = createSignatureFunctionForTransform() + // + // function Hello() { + // const [foo, setFoo] = useState(0); + // const value = useCustomHook(); + // _s(); /* Call without arguments triggers collecting the custom Hook list. + // * This doesn't happen during the module evaluation because we + // * don't want to change the module order with inline requires. + // * Next calls are noops. */ + // return

Hi

; + // } + // + // /* Call with arguments attaches the signature to the type: */ + // _s( + // Hello, + // 'useState{[foo, setFoo]}(0)', + // () => [useCustomHook], /* Lazy to avoid triggering inline requires */ + // ); + + function createSignatureFunctionForTransform() { + { + var savedType; + var hasCustomHooks; + var didCollectHooks = false; + return function (type, key, forceReset, getCustomHooks) { + if (typeof key === 'string') { + // We're in the initial phase that associates signatures + // with the functions. Note this may be called multiple times + // in HOC chains like _s(hoc1(_s(hoc2(_s(actualFunction))))). + if (!savedType) { + // We're in the innermost call, so this is the actual type. + savedType = type; + hasCustomHooks = typeof getCustomHooks === 'function'; + } // Set the signature for all types (even wrappers!) in case + // they have no signatures of their own. This is to prevent + // problems like https://github.com/facebook/react/issues/20417. + + if (type != null && (typeof type === 'function' || typeof type === 'object')) { + setSignature(type, key, forceReset, getCustomHooks); + } + return type; + } else { + // We're in the _s() call without arguments, which means + // this is the time to collect custom Hook signatures. + // Only do this once. This path is hot and runs *inside* every render! + if (!didCollectHooks && hasCustomHooks) { + didCollectHooks = true; + collectCustomHooksForSignature(savedType); + } + } + }; + } + } + function isLikelyComponentType(type) { + { + switch (typeof type) { + case 'function': + { + // First, deal with classes. + if (type.prototype != null) { + if (type.prototype.isReactComponent) { + // React class. + return true; + } + var ownNames = Object.getOwnPropertyNames(type.prototype); + if (ownNames.length > 1 || ownNames[0] !== 'constructor') { + // This looks like a class. + return false; + } // eslint-disable-next-line no-proto + + if (type.prototype.__proto__ !== Object.prototype) { + // It has a superclass. + return false; + } // Pass through. + // This looks like a regular function with empty prototype. + } // For plain functions and arrows, use name as a heuristic. + + var name = type.name || type.displayName; + return typeof name === 'string' && /^[A-Z]/.test(name); + } + case 'object': + { + if (type != null) { + switch (getProperty(type, '$$typeof')) { + case REACT_FORWARD_REF_TYPE: + case REACT_MEMO_TYPE: + // Definitely React components. + return true; + default: + return false; + } + } + return false; + } + default: + { + return false; + } + } + } + } + exports._getMountedRootCount = _getMountedRootCount; + exports.collectCustomHooksForSignature = collectCustomHooksForSignature; + exports.createSignatureFunctionForTransform = createSignatureFunctionForTransform; + exports.findAffectedHostInstances = findAffectedHostInstances; + exports.getFamilyByID = getFamilyByID; + exports.getFamilyByType = getFamilyByType; + exports.hasUnrecoverableErrors = hasUnrecoverableErrors; + exports.injectIntoGlobalHook = injectIntoGlobalHook; + exports.isLikelyComponentType = isLikelyComponentType; + exports.performReactRefresh = performReactRefresh; + exports.register = register; + exports.setSignature = setSignature; + })(); + } +},229,[],"node_modules\\react-refresh\\cjs\\react-refresh-runtime.development.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _RCTNetworking = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Network/RCTNetworking")); + var _HMRClient = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Utilities/HMRClient")); + var _LoadingView = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../Utilities/LoadingView")); + var _getDevServer2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "./getDevServer")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + * @oncall react_native + */ + + var pendingRequests = 0; + var cachedPromisesByUrl = new Map(); + function asyncRequest(url) { + var id = null; + var responseText = null; + var headers = null; + var dataListener; + var completeListener; + var responseListener; + var incrementalDataListener; + return new Promise(function (resolve, reject) { + dataListener = _RCTNetworking.default.addListener('didReceiveNetworkData', function (_ref) { + var _ref2 = (0, _slicedToArray2.default)(_ref, 2), + requestId = _ref2[0], + response = _ref2[1]; + if (requestId === id) { + responseText = response; + } + }); + incrementalDataListener = _RCTNetworking.default.addListener('didReceiveNetworkIncrementalData', function (_ref3) { + var _ref4 = (0, _slicedToArray2.default)(_ref3, 2), + requestId = _ref4[0], + data = _ref4[1]; + if (requestId === id) { + if (responseText != null) { + responseText += data; + } else { + responseText = data; + } + } + }); + responseListener = _RCTNetworking.default.addListener('didReceiveNetworkResponse', function (_ref5) { + var _ref6 = (0, _slicedToArray2.default)(_ref5, 3), + requestId = _ref6[0], + status = _ref6[1], + responseHeaders = _ref6[2]; + if (requestId === id) { + headers = responseHeaders; + } + }); + completeListener = _RCTNetworking.default.addListener('didCompleteNetworkResponse', function (_ref7) { + var _ref8 = (0, _slicedToArray2.default)(_ref7, 2), + requestId = _ref8[0], + error = _ref8[1]; + if (requestId === id) { + if (error) { + reject(error); + } else { + //$FlowFixMe[incompatible-call] + resolve({ + body: responseText, + headers: headers + }); + } + } + }); + _RCTNetworking.default.sendRequest('GET', 'asyncRequest', url, {}, '', 'text', true, 0, function (requestId) { + id = requestId; + }, true); + }).finally(function () { + var _dataListener, _completeListener, _responseListener, _incrementalDataListe; + (_dataListener = dataListener) == null ? void 0 : _dataListener.remove(); + (_completeListener = completeListener) == null ? void 0 : _completeListener.remove(); + (_responseListener = responseListener) == null ? void 0 : _responseListener.remove(); + (_incrementalDataListe = incrementalDataListener) == null ? void 0 : _incrementalDataListe.remove(); + }); + } + function buildUrlForBundle(bundlePathAndQuery) { + var _getDevServer = (0, _getDevServer2.default)(), + serverUrl = _getDevServer.url; + return serverUrl.replace(/\/+$/, '') + '/' + bundlePathAndQuery.replace(/^\/+/, ''); + } + module.exports = function (bundlePathAndQuery) { + var requestUrl = buildUrlForBundle(bundlePathAndQuery); + var loadPromise = cachedPromisesByUrl.get(requestUrl); + if (loadPromise) { + return loadPromise; + } + _LoadingView.default.showMessage('Downloading...', 'load'); + ++pendingRequests; + loadPromise = asyncRequest(requestUrl).then(function (_ref9) { + var body = _ref9.body, + headers = _ref9.headers; + if (headers['Content-Type'] != null && headers['Content-Type'].indexOf('application/json') >= 0) { + // Errors are returned as JSON. + throw new Error(JSON.parse(body).message || `Unknown error fetching '${bundlePathAndQuery}'`); + } + _HMRClient.default.registerBundle(requestUrl); + + // Some engines do not support `sourceURL` as a comment. We expose a + // `globalEvalWithSourceUrl` function to handle updates in that case. + if (global.globalEvalWithSourceUrl) { + global.globalEvalWithSourceUrl(body, requestUrl); + } else { + // eslint-disable-next-line no-eval + eval(body); + } + }).catch(function (e) { + cachedPromisesByUrl.delete(requestUrl); + throw e; + }).finally(function () { + if (! --pendingRequests) { + _LoadingView.default.hide(); + } + }); + cachedPromisesByUrl.set(requestUrl, loadPromise); + return loadPromise; + }; +},230,[6,7,159,186,188,102],"node_modules\\react-native\\Libraries\\Core\\Devtools\\loadBundleFromServer.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _BatchedBridge = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../BatchedBridge/BatchedBridge")); + var _BugReporting = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../BugReporting/BugReporting")); + var _createPerformanceLogger = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../Utilities/createPerformanceLogger")); + var _infoLog = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../Utilities/infoLog")); + var _SceneTracker = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../Utilities/SceneTracker")); + var _HeadlessJsTaskError = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./HeadlessJsTaskError")); + var _NativeHeadlessJsTaskSupport = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./NativeHeadlessJsTaskSupport")); + var _renderApplication = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./renderApplication")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "invariant")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var runnables = {}; + var runCount = 1; + var sections = {}; + var taskProviders = new Map(); + var taskCancelProviders = new Map(); + var componentProviderInstrumentationHook = function componentProviderInstrumentationHook(component) { + return component(); + }; + var wrapperComponentProvider; + var showArchitectureIndicator = false; + + /** + * `AppRegistry` is the JavaScript entry point to running all React Native apps. + * + * See https://reactnative.dev/docs/appregistry + */ + var AppRegistry = { + setWrapperComponentProvider: function setWrapperComponentProvider(provider) { + wrapperComponentProvider = provider; + }, + enableArchitectureIndicator: function enableArchitectureIndicator(enabled) { + showArchitectureIndicator = enabled; + }, + registerConfig: function registerConfig(config) { + config.forEach(function (appConfig) { + if (appConfig.run) { + AppRegistry.registerRunnable(appConfig.appKey, appConfig.run); + } else { + (0, _invariant.default)(appConfig.component != null, 'AppRegistry.registerConfig(...): Every config is expected to set ' + 'either `run` or `component`, but `%s` has neither.', appConfig.appKey); + AppRegistry.registerComponent(appConfig.appKey, appConfig.component, appConfig.section); + } + }); + }, + /** + * Registers an app's root component. + * + * See https://reactnative.dev/docs/appregistry#registercomponent + */ + registerComponent: function registerComponent(appKey, componentProvider, section) { + var scopedPerformanceLogger = (0, _createPerformanceLogger.default)(); + runnables[appKey] = function (appParameters, displayMode) { + var _appParameters$initia; + var concurrentRootEnabled = Boolean(((_appParameters$initia = appParameters.initialProps) == null ? void 0 : _appParameters$initia.concurrentRoot) || appParameters.concurrentRoot); + (0, _renderApplication.default)(componentProviderInstrumentationHook(componentProvider, scopedPerformanceLogger), appParameters.initialProps, appParameters.rootTag, wrapperComponentProvider && wrapperComponentProvider(appParameters), appParameters.fabric, showArchitectureIndicator, scopedPerformanceLogger, appKey === 'LogBox', + // is logbox + appKey, displayMode, concurrentRootEnabled); + }; + if (section) { + sections[appKey] = runnables[appKey]; + } + return appKey; + }, + registerRunnable: function registerRunnable(appKey, run) { + runnables[appKey] = run; + return appKey; + }, + registerSection: function registerSection(appKey, component) { + AppRegistry.registerComponent(appKey, component, true); + }, + getAppKeys: function getAppKeys() { + return Object.keys(runnables); + }, + getSectionKeys: function getSectionKeys() { + return Object.keys(sections); + }, + getSections: function getSections() { + return Object.assign({}, sections); + }, + getRunnable: function getRunnable(appKey) { + return runnables[appKey]; + }, + getRegistry: function getRegistry() { + return { + sections: AppRegistry.getSectionKeys(), + runnables: Object.assign({}, runnables) + }; + }, + setComponentProviderInstrumentationHook: function setComponentProviderInstrumentationHook(hook) { + componentProviderInstrumentationHook = hook; + }, + /** + * Loads the JavaScript bundle and runs the app. + * + * See https://reactnative.dev/docs/appregistry#runapplication + */ + runApplication: function runApplication(appKey, appParameters, displayMode) { + if (appKey !== 'LogBox') { + var logParams = __DEV__ ? '" with ' + JSON.stringify(appParameters) : ''; + var msg = 'Running "' + appKey + logParams; + (0, _infoLog.default)(msg); + _BugReporting.default.addSource('AppRegistry.runApplication' + runCount++, function () { + return msg; + }); + } + (0, _invariant.default)(runnables[appKey], `"${appKey}" has not been registered. This can happen if:\n` + '* Metro (the local dev server) is run from the wrong folder. ' + 'Check if Metro is running, stop it and restart it in the current project.\n' + "* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called."); + _SceneTracker.default.setActiveScene({ + name: appKey + }); + runnables[appKey](appParameters, (0, _$$_REQUIRE(_dependencyMap[10], "./DisplayMode").coerceDisplayMode)(displayMode)); + }, + /** + * Update initial props for a surface that's already rendered + */ + setSurfaceProps: function setSurfaceProps(appKey, appParameters, displayMode) { + if (appKey !== 'LogBox') { + var msg = 'Updating props for Surface "' + appKey + '" with ' + JSON.stringify(appParameters); + (0, _infoLog.default)(msg); + _BugReporting.default.addSource('AppRegistry.setSurfaceProps' + runCount++, function () { + return msg; + }); + } + (0, _invariant.default)(runnables[appKey], `"${appKey}" has not been registered. This can happen if:\n` + '* Metro (the local dev server) is run from the wrong folder. ' + 'Check if Metro is running, stop it and restart it in the current project.\n' + "* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called."); + runnables[appKey](appParameters, (0, _$$_REQUIRE(_dependencyMap[10], "./DisplayMode").coerceDisplayMode)(displayMode)); + }, + /** + * Stops an application when a view should be destroyed. + * + * See https://reactnative.dev/docs/appregistry#unmountapplicationcomponentatroottag + */ + unmountApplicationComponentAtRootTag: function unmountApplicationComponentAtRootTag(rootTag) { + (0, _$$_REQUIRE(_dependencyMap[11], "./RendererProxy").unmountComponentAtNodeAndRemoveContainer)(rootTag); + }, + /** + * Register a headless task. A headless task is a bit of code that runs without a UI. + * + * See https://reactnative.dev/docs/appregistry#registerheadlesstask + */ + registerHeadlessTask: function registerHeadlessTask(taskKey, taskProvider) { + // $FlowFixMe[object-this-reference] + this.registerCancellableHeadlessTask(taskKey, taskProvider, function () { + return function () { + /* Cancel is no-op */ + }; + }); + }, + /** + * Register a cancellable headless task. A headless task is a bit of code that runs without a UI. + * + * See https://reactnative.dev/docs/appregistry#registercancellableheadlesstask + */ + registerCancellableHeadlessTask: function registerCancellableHeadlessTask(taskKey, taskProvider, taskCancelProvider) { + if (taskProviders.has(taskKey)) { + console.warn(`registerHeadlessTask or registerCancellableHeadlessTask called multiple times for same key '${taskKey}'`); + } + taskProviders.set(taskKey, taskProvider); + taskCancelProviders.set(taskKey, taskCancelProvider); + }, + /** + * Only called from native code. Starts a headless task. + * + * See https://reactnative.dev/docs/appregistry#startheadlesstask + */ + startHeadlessTask: function startHeadlessTask(taskId, taskKey, data) { + var taskProvider = taskProviders.get(taskKey); + if (!taskProvider) { + console.warn(`No task registered for key ${taskKey}`); + if (_NativeHeadlessJsTaskSupport.default) { + _NativeHeadlessJsTaskSupport.default.notifyTaskFinished(taskId); + } + return; + } + taskProvider()(data).then(function () { + if (_NativeHeadlessJsTaskSupport.default) { + _NativeHeadlessJsTaskSupport.default.notifyTaskFinished(taskId); + } + }).catch(function (reason) { + console.error(reason); + if (_NativeHeadlessJsTaskSupport.default && reason instanceof _HeadlessJsTaskError.default) { + // $FlowFixMe[unused-promise] + _NativeHeadlessJsTaskSupport.default.notifyTaskRetry(taskId).then(function (retryPosted) { + if (!retryPosted) { + _NativeHeadlessJsTaskSupport.default.notifyTaskFinished(taskId); + } + }); + } + }); + }, + /** + * Only called from native code. Cancels a headless task. + * + * See https://reactnative.dev/docs/appregistry#cancelheadlesstask + */ + cancelHeadlessTask: function cancelHeadlessTask(taskId, taskKey) { + var taskCancelProvider = taskCancelProviders.get(taskKey); + if (!taskCancelProvider) { + throw new Error(`No task canceller registered for key '${taskKey}'`); + } + taskCancelProvider()(); + } + }; + + // Register LogBox as a default surface + AppRegistry.registerComponent('LogBox', function () { + if (__DEV__ && typeof jest === 'undefined') { + return _$$_REQUIRE(_dependencyMap[12], "../LogBox/LogBoxInspectorContainer").default; + } else { + return function NoOp() { + return null; + }; + } + }); + global.RN$AppRegistry = AppRegistry; + + // Backwards compat with SurfaceRegistry, remove me later + global.RN$SurfaceRegistry = { + renderSurface: AppRegistry.runApplication, + setSurfaceProps: AppRegistry.setSurfaceProps + }; + if (global.RN$Bridgeless !== true) { + _BatchedBridge.default.registerCallableModule('AppRegistry', AppRegistry); + } + module.exports = AppRegistry; +},231,[6,39,232,156,158,235,236,237,238,37,465,61,469],"node_modules\\react-native\\Libraries\\ReactNative\\AppRegistry.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/createClass")); + var _RCTDeviceEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../EventEmitter/RCTDeviceEventEmitter")); + var _NativeRedBox = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../NativeModules/specs/NativeRedBox")); + var _NativeBugReporting = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./NativeBugReporting")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + function defaultExtras() { + BugReporting.addFileSource('react_hierarchy.txt', function () { + return _$$_REQUIRE(_dependencyMap[7], "./dumpReactTree")(); + }); + } + + /** + * A simple class for collecting bug report data. Components can add sources that will be queried when a bug report + * is created via `collectExtraData`. For example, a list component might add a source that provides the list of rows + * that are currently visible on screen. Components should also remember to call `remove()` on the object that is + * returned by `addSource` when they are unmounted. + */ + var BugReporting = /*#__PURE__*/function () { + function BugReporting() { + (0, _classCallCheck2.default)(this, BugReporting); + } + return (0, _createClass2.default)(BugReporting, null, [{ + key: "_maybeInit", + value: function _maybeInit() { + if (!BugReporting._subscription) { + BugReporting._subscription = _RCTDeviceEventEmitter.default.addListener('collectBugExtraData', + // $FlowFixMe[method-unbinding] + BugReporting.collectExtraData, null); + defaultExtras(); + } + if (!BugReporting._redboxSubscription) { + BugReporting._redboxSubscription = _RCTDeviceEventEmitter.default.addListener('collectRedBoxExtraData', + // $FlowFixMe[method-unbinding] + BugReporting.collectExtraData, null); + } + } + + /** + * Maps a string key to a simple callback that should return a string payload to be attached + * to a bug report. Source callbacks are called when `collectExtraData` is called. + * + * Returns an object to remove the source when the component unmounts. + * + * Conflicts trample with a warning. + */ + }, { + key: "addSource", + value: function addSource(key, callback) { + return this._addSource(key, callback, BugReporting._extraSources); + } + + /** + * Maps a string key to a simple callback that should return a string payload to be attached + * to a bug report. Source callbacks are called when `collectExtraData` is called. + * + * Returns an object to remove the source when the component unmounts. + * + * Conflicts trample with a warning. + */ + }, { + key: "addFileSource", + value: function addFileSource(key, callback) { + return this._addSource(key, callback, BugReporting._fileSources); + } + }, { + key: "_addSource", + value: function _addSource(key, callback, source) { + BugReporting._maybeInit(); + if (source.has(key)) { + console.warn(`BugReporting.add* called multiple times for same key '${key}'`); + } + source.set(key, callback); + return { + remove: function remove() { + source.delete(key); + } + }; + } + + /** + * This can be called from a native bug reporting flow, or from JS code. + * + * If available, this will call `NativeModules.BugReporting.setExtraData(extraData)` + * after collecting `extraData`. + */ + }, { + key: "collectExtraData", + value: function collectExtraData() { + var extraData = {}; + for (var _ref of BugReporting._extraSources) { + var _ref2 = (0, _slicedToArray2.default)(_ref, 2); + var _key = _ref2[0]; + var callback = _ref2[1]; + extraData[_key] = callback(); + } + var fileData = {}; + for (var _ref3 of BugReporting._fileSources) { + var _ref4 = (0, _slicedToArray2.default)(_ref3, 2); + var _key2 = _ref4[0]; + var _callback = _ref4[1]; + fileData[_key2] = _callback(); + } + if (_NativeBugReporting.default != null && _NativeBugReporting.default.setExtraData != null) { + _NativeBugReporting.default.setExtraData(extraData, fileData); + } + if (_NativeRedBox.default != null && _NativeRedBox.default.setExtraData != null) { + _NativeRedBox.default.setExtraData(extraData, 'From BugReporting.js'); + } + return { + extras: extraData, + files: fileData + }; + } + }]); + }(); + BugReporting._extraSources = new Map(); + BugReporting._fileSources = new Map(); + BugReporting._subscription = null; + BugReporting._redboxSubscription = null; + module.exports = BugReporting; +},232,[6,7,18,19,17,187,233,234],"node_modules\\react-native\\Libraries\\BugReporting\\BugReporting.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + var _default = exports.default = TurboModuleRegistry.get('BugReporting'); +},233,[36],"node_modules\\react-native\\Libraries\\BugReporting\\NativeBugReporting.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /* + const getReactData = require('getReactData'); + + const INDENTATION_SIZE = 2; + const MAX_DEPTH = 2; + const MAX_STRING_LENGTH = 50; + */ + + /** + * Dump all React Native root views and their content. This function tries + * it best to get the content but ultimately relies on implementation details + * of React and will fail in future versions. + */ + function dumpReactTree() { + try { + return getReactTree(); + } catch (e) { + return 'Failed to dump react tree: ' + e; + } + } + function getReactTree() { + // TODO(sema): Reenable tree dumps using the Fiber tree structure. #15945684 + return 'React tree dumps have been temporarily disabled while React is ' + 'upgraded to Fiber.'; + /* + let output = ''; + const rootIds = Object.getOwnPropertyNames(ReactNativeMount._instancesByContainerID); + for (const rootId of rootIds) { + const instance = ReactNativeMount._instancesByContainerID[rootId]; + output += `============ Root ID: ${rootId} ============\n`; + output += dumpNode(instance, 0); + output += `============ End root ID: ${rootId} ============\n`; + } + return output; + */ + } + + /* + function dumpNode(node: Object, indentation: number) { + const data = getReactData(node); + if (data.nodeType === 'Text') { + return indent(indentation) + data.text + '\n'; + } else if (data.nodeType === 'Empty') { + return ''; + } + let output = indent(indentation) + `<${data.name}`; + if (data.nodeType === 'Composite') { + for (const propName of Object.getOwnPropertyNames(data.props || {})) { + if (isNormalProp(propName)) { + try { + const value = convertValue(data.props[propName]); + if (value) { + output += ` ${propName}=${value}`; + } + } catch (e) { + const message = `[Failed to get property: ${e}]`; + output += ` ${propName}=${message}`; + } + } + } + } + let childOutput = ''; + for (const child of data.children || []) { + childOutput += dumpNode(child, indentation + 1); + } + + if (childOutput) { + output += '>\n' + childOutput + indent(indentation) + `\n`; + } else { + output += ' />\n'; + } + + return output; + } + + function isNormalProp(name: string): boolean { + switch (name) { + case 'children': + case 'key': + case 'ref': + return false; + default: + return true; + } + } + + function convertObject(object: Object, depth: number) { + if (depth >= MAX_DEPTH) { + return '[...omitted]'; + } + let output = '{'; + let first = true; + for (const key of Object.getOwnPropertyNames(object)) { + if (!first) { + output += ', '; + } + output += `${key}: ${convertValue(object[key], depth + 1)}`; + first = false; + } + return output + '}'; + } + + function convertValue(value, depth = 0): ?string { + if (!value) { + return null; + } + + switch (typeof value) { + case 'string': + return JSON.stringify(possiblyEllipsis(value).replace('\n', '\\n')); + case 'boolean': + case 'number': + return JSON.stringify(value); + case 'function': + return '[function]'; + case 'object': + return convertObject(value, depth); + default: + return null; + } + } + + function possiblyEllipsis(value: string) { + if (value.length > MAX_STRING_LENGTH) { + return value.slice(0, MAX_STRING_LENGTH) + '...'; + } else { + return value; + } + } + + function indent(size: number) { + return ' '.repeat(size * INDENTATION_SIZE); + } + */ + + module.exports = dumpReactTree; +},234,[],"node_modules\\react-native\\Libraries\\BugReporting\\dumpReactTree.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _listeners = []; + var _activeScene = { + name: 'default' + }; + var SceneTracker = { + setActiveScene: function setActiveScene(scene) { + _activeScene = scene; + _listeners.forEach(function (listener) { + return listener(_activeScene); + }); + }, + getActiveScene: function getActiveScene() { + return _activeScene; + }, + addActiveSceneChangedListener: function addActiveSceneChangedListener(callback) { + _listeners.push(callback); + return { + remove: function remove() { + _listeners = _listeners.filter(function (listener) { + return callback !== listener; + }); + } + }; + } + }; + module.exports = SceneTracker; +},235,[],"node_modules\\react-native\\Libraries\\Utilities\\SceneTracker.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/createClass")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _wrapNativeSuper2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/wrapNativeSuper")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var HeadlessJsTaskError = exports.default = /*#__PURE__*/function (_Error) { + function HeadlessJsTaskError() { + (0, _classCallCheck2.default)(this, HeadlessJsTaskError); + return _callSuper(this, HeadlessJsTaskError, arguments); + } + (0, _inherits2.default)(HeadlessJsTaskError, _Error); + return (0, _createClass2.default)(HeadlessJsTaskError); + }(/*#__PURE__*/(0, _wrapNativeSuper2.default)(Error)); +},236,[6,19,18,23,25,28,88],"node_modules\\react-native\\Libraries\\ReactNative\\HeadlessJsTaskError.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('HeadlessJsTaskSupport'); +},237,[36],"node_modules\\react-native\\Libraries\\ReactNative\\NativeHeadlessJsTaskSupport.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = renderApplication; + var _GlobalPerformanceLogger = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../Utilities/GlobalPerformanceLogger")); + var _PerformanceLoggerContext = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../Utilities/PerformanceLoggerContext")); + var _AppContainer = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "./AppContainer")); + var _DisplayMode = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "./DisplayMode")); + var _getCachedComponentWithDebugName = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "./getCachedComponentWithDebugName")); + var Renderer = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6], "./RendererProxy")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "invariant")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8], "react")); + _$$_REQUIRE(_dependencyMap[9], "../Utilities/BackHandler"); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[10], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\ReactNative\\renderApplication.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + // require BackHandler so it sets the default handler that exits the app if no listeners respond + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function renderApplication(RootComponent, initialProps, rootTag, WrapperComponent, fabric, showArchitectureIndicator, scopedPerformanceLogger, isLogBox, debugName, displayMode, useConcurrentRoot, useOffscreen) { + (0, _invariant.default)(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag); + var performanceLogger = scopedPerformanceLogger != null ? scopedPerformanceLogger : _GlobalPerformanceLogger.default; + var renderable = /*#__PURE__*/(0, _jsxRuntime.jsx)(_PerformanceLoggerContext.default.Provider, { + value: performanceLogger, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_AppContainer.default, { + rootTag: rootTag, + fabric: fabric, + showArchitectureIndicator: showArchitectureIndicator, + WrapperComponent: WrapperComponent, + initialProps: initialProps != null ? initialProps : Object.freeze({}), + internal_excludeLogBox: isLogBox, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(RootComponent, Object.assign({}, initialProps, { + rootTag: rootTag + })) + }) + }); + if (__DEV__ && debugName) { + var RootComponentWithMeaningfulName = (0, _getCachedComponentWithDebugName.default)(`${debugName}(RootComponent)`); + renderable = /*#__PURE__*/(0, _jsxRuntime.jsx)(RootComponentWithMeaningfulName, { + children: renderable + }); + } + if (useOffscreen && displayMode != null) { + // $FlowFixMe[incompatible-type] + // $FlowFixMe[prop-missing] + var Offscreen = React.unstable_Offscreen; + renderable = /*#__PURE__*/(0, _jsxRuntime.jsx)(Offscreen, { + mode: displayMode === _DisplayMode.default.VISIBLE ? 'visible' : 'hidden', + children: renderable + }); + } + performanceLogger.startTimespan('renderApplication_React_render'); + performanceLogger.setExtra('usedReactConcurrentRoot', useConcurrentRoot ? '1' : '0'); + performanceLogger.setExtra('usedReactFabric', fabric ? '1' : '0'); + performanceLogger.setExtra('usedReactProfiler', Renderer.isProfilingRenderer()); + Renderer.renderElement({ + element: renderable, + rootTag: rootTag, + useFabric: Boolean(fabric), + useConcurrentRoot: Boolean(useConcurrentRoot) + }); + performanceLogger.stopTimespan('renderApplication_React_render'); + } +},238,[6,155,239,240,465,466,61,37,65,467,106],"node_modules\\react-native\\Libraries\\ReactNative\\renderApplication.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + exports.usePerformanceLogger = usePerformanceLogger; + var _GlobalPerformanceLogger = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./GlobalPerformanceLogger")); + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2], "react")); + var React = _react; + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /** + * This is a React Context that provides a scoped instance of IPerformanceLogger. + * We wrap every with a Provider for this context so the logger + * should be available in every component. + * See React docs about using Context: https://react.dev/docs/context.html + */ + var PerformanceLoggerContext = React.createContext(_GlobalPerformanceLogger.default); + if (__DEV__) { + PerformanceLoggerContext.displayName = 'PerformanceLoggerContext'; + } + function usePerformanceLogger() { + return (0, _react.useContext)(PerformanceLoggerContext); + } + var _default = exports.default = PerformanceLoggerContext; +},239,[6,155,65],"node_modules\\react-native\\Libraries\\Utilities\\PerformanceLoggerContext.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../Components/View/View")); + var _RCTDeviceEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../EventEmitter/RCTDeviceEventEmitter")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "../StyleSheet/StyleSheet")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[10], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\ReactNative\\AppContainer.js"; + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + var reactDevToolsHook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; + var AppContainer = /*#__PURE__*/function (_React$Component) { + function AppContainer() { + var _this; + (0, _classCallCheck2.default)(this, AppContainer); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, AppContainer, [].concat(args)); + _this.state = { + inspector: null, + devtoolsOverlay: null, + traceUpdateOverlay: null, + mainKey: 1 + }; + _this._subscription = null; + _this._reactDevToolsAgentListener = null; + return _this; + } + (0, _inherits2.default)(AppContainer, _React$Component); + return (0, _createClass2.default)(AppContainer, [{ + key: "mountReactDevToolsOverlays", + value: function mountReactDevToolsOverlays() { + var DevtoolsOverlay = _$$_REQUIRE(_dependencyMap[11], "../Inspector/DevtoolsOverlay").default; + var devtoolsOverlay = /*#__PURE__*/(0, _jsxRuntime.jsx)(DevtoolsOverlay, { + inspectedView: this._mainRef + }); + var TraceUpdateOverlay = _$$_REQUIRE(_dependencyMap[12], "../Components/TraceUpdateOverlay/TraceUpdateOverlay").default; + var traceUpdateOverlay = /*#__PURE__*/(0, _jsxRuntime.jsx)(TraceUpdateOverlay, {}); + this.setState({ + devtoolsOverlay: devtoolsOverlay, + traceUpdateOverlay: traceUpdateOverlay + }); + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + if (__DEV__) { + if (!this.props.internal_excludeInspector) { + this._subscription = _RCTDeviceEventEmitter.default.addListener('toggleElementInspector', function () { + var Inspector = _$$_REQUIRE(_dependencyMap[13], "../Inspector/Inspector"); + var inspector = _this2.state.inspector ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(Inspector, { + inspectedView: _this2._mainRef, + onRequestRerenderApp: function onRequestRerenderApp(updateInspectedView) { + _this2.setState(function (s) { + return { + mainKey: s.mainKey + 1 + }; + }, function () { + return updateInspectedView(_this2._mainRef); + }); + } + }); + _this2.setState({ + inspector: inspector + }); + }); + if (reactDevToolsHook != null) { + if (reactDevToolsHook.reactDevtoolsAgent) { + // In case if this is not the first AppContainer rendered and React DevTools are already attached + this.mountReactDevToolsOverlays(); + return; + } + this._reactDevToolsAgentListener = function () { + return _this2.mountReactDevToolsOverlays(); + }; + reactDevToolsHook.on('react-devtools', this._reactDevToolsAgentListener); + } + } + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this._subscription != null) { + this._subscription.remove(); + } + if (reactDevToolsHook != null && this._reactDevToolsAgentListener != null) { + reactDevToolsHook.off('react-devtools', this._reactDevToolsAgentListener); + } + } + }, { + key: "render", + value: function render() { + var _this3 = this; + var logBox = null; + if (__DEV__) { + if (!this.props.internal_excludeLogBox) { + var LogBoxNotificationContainer = _$$_REQUIRE(_dependencyMap[14], "../LogBox/LogBoxNotificationContainer").default; + logBox = /*#__PURE__*/(0, _jsxRuntime.jsx)(LogBoxNotificationContainer, {}); + } + } + var innerView = /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + collapsable: !this.state.inspector && !this.state.devtoolsOverlay, + pointerEvents: "box-none", + style: styles.appContainer, + ref: function ref(_ref) { + _this3._mainRef = _ref; + }, + children: this.props.children + }, this.state.mainKey); + var Wrapper = this.props.WrapperComponent; + if (Wrapper != null) { + innerView = /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, { + initialProps: this.props.initialProps, + fabric: this.props.fabric === true, + showArchitectureIndicator: this.props.showArchitectureIndicator === true, + children: innerView + }); + } + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[15], "./RootTag").RootTagContext.Provider, { + value: (0, _$$_REQUIRE(_dependencyMap[15], "./RootTag").createRootTag)(this.props.rootTag), + children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, { + style: styles.appContainer, + pointerEvents: "box-none", + children: [innerView, this.state.traceUpdateOverlay, this.state.devtoolsOverlay, this.state.inspector, logBox] + }) + }); + } + }]); + }(React.Component); + AppContainer.getDerivedStateFromError = undefined; + var styles = _StyleSheet.default.create({ + appContainer: { + flex: 1 + } + }); + module.exports = AppContainer; +},240,[6,18,19,23,25,28,241,17,266,65,106,267,274,303,454,464],"node_modules\\react-native\\Libraries\\ReactNative\\AppContainer.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _objectWithoutProperties2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/objectWithoutProperties")); + var _ReactNativeFeatureFlags = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../ReactNative/ReactNativeFeatureFlags")); + var _flattenStyle = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/flattenStyle")); + var _TextAncestor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../Text/TextAncestor")); + var _ViewNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "./ViewNativeComponent")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[7], "react/jsx-runtime"); + var _excluded = ["accessibilityElementsHidden", "accessibilityLabel", "accessibilityLabelledBy", "accessibilityLiveRegion", "accessibilityState", "accessibilityValue", "aria-busy", "aria-checked", "aria-disabled", "aria-expanded", "aria-hidden", "aria-label", "aria-labelledby", "aria-live", "aria-selected", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext", "focusable", "id", "importantForAccessibility", "nativeID", "pointerEvents", "tabIndex"]; + var _this = this, + _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Components\\View\\View.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * The most fundamental component for building a UI, View is a container that + * supports layout with flexbox, style, some touch handling, and accessibility + * controls. + * + * @see https://reactnative.dev/docs/view + */ + var View = React.forwardRef(function (_ref, forwardedRef) { + var _ariaLabelledBy$split; + var accessibilityElementsHidden = _ref.accessibilityElementsHidden, + accessibilityLabel = _ref.accessibilityLabel, + accessibilityLabelledBy = _ref.accessibilityLabelledBy, + accessibilityLiveRegion = _ref.accessibilityLiveRegion, + accessibilityState = _ref.accessibilityState, + accessibilityValue = _ref.accessibilityValue, + ariaBusy = _ref['aria-busy'], + ariaChecked = _ref['aria-checked'], + ariaDisabled = _ref['aria-disabled'], + ariaExpanded = _ref['aria-expanded'], + ariaHidden = _ref['aria-hidden'], + ariaLabel = _ref['aria-label'], + ariaLabelledBy = _ref['aria-labelledby'], + ariaLive = _ref['aria-live'], + ariaSelected = _ref['aria-selected'], + ariaValueMax = _ref['aria-valuemax'], + ariaValueMin = _ref['aria-valuemin'], + ariaValueNow = _ref['aria-valuenow'], + ariaValueText = _ref['aria-valuetext'], + focusable = _ref.focusable, + id = _ref.id, + importantForAccessibility = _ref.importantForAccessibility, + nativeID = _ref.nativeID, + pointerEvents = _ref.pointerEvents, + tabIndex = _ref.tabIndex, + otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded); + var hasTextAncestor = React.useContext(_TextAncestor.default); + var _accessibilityLabelledBy = (_ariaLabelledBy$split = ariaLabelledBy == null ? void 0 : ariaLabelledBy.split(/\s*,\s*/g)) != null ? _ariaLabelledBy$split : accessibilityLabelledBy; + var _accessibilityState; + if (accessibilityState != null || ariaBusy != null || ariaChecked != null || ariaDisabled != null || ariaExpanded != null || ariaSelected != null) { + _accessibilityState = { + busy: ariaBusy != null ? ariaBusy : accessibilityState == null ? void 0 : accessibilityState.busy, + checked: ariaChecked != null ? ariaChecked : accessibilityState == null ? void 0 : accessibilityState.checked, + disabled: ariaDisabled != null ? ariaDisabled : accessibilityState == null ? void 0 : accessibilityState.disabled, + expanded: ariaExpanded != null ? ariaExpanded : accessibilityState == null ? void 0 : accessibilityState.expanded, + selected: ariaSelected != null ? ariaSelected : accessibilityState == null ? void 0 : accessibilityState.selected + }; + } + var _accessibilityValue; + if (accessibilityValue != null || ariaValueMax != null || ariaValueMin != null || ariaValueNow != null || ariaValueText != null) { + _accessibilityValue = { + max: ariaValueMax != null ? ariaValueMax : accessibilityValue == null ? void 0 : accessibilityValue.max, + min: ariaValueMin != null ? ariaValueMin : accessibilityValue == null ? void 0 : accessibilityValue.min, + now: ariaValueNow != null ? ariaValueNow : accessibilityValue == null ? void 0 : accessibilityValue.now, + text: ariaValueText != null ? ariaValueText : accessibilityValue == null ? void 0 : accessibilityValue.text + }; + } + + // $FlowFixMe[underconstrained-implicit-instantiation] + var style = (0, _flattenStyle.default)(otherProps.style); + + // $FlowFixMe[sketchy-null-mixed] + var newPointerEvents = (style == null ? void 0 : style.pointerEvents) || pointerEvents; + var collapsableOverride = _ReactNativeFeatureFlags.default.shouldForceUnflattenForElevation() ? { + collapsable: style != null && style.elevation != null && style.elevation !== 0 ? false : otherProps.collapsable + } : {}; + var actualView = /*#__PURE__*/(0, _jsxRuntime.jsx)(_ViewNativeComponent.default, Object.assign({}, otherProps, collapsableOverride, { + accessibilityLiveRegion: ariaLive === 'off' ? 'none' : ariaLive != null ? ariaLive : accessibilityLiveRegion, + accessibilityLabel: ariaLabel != null ? ariaLabel : accessibilityLabel, + focusable: tabIndex !== undefined ? !tabIndex : focusable, + accessibilityState: _accessibilityState, + accessibilityElementsHidden: ariaHidden != null ? ariaHidden : accessibilityElementsHidden, + accessibilityLabelledBy: _accessibilityLabelledBy, + accessibilityValue: _accessibilityValue, + importantForAccessibility: ariaHidden === true ? 'no-hide-descendants' : importantForAccessibility, + nativeID: id != null ? id : nativeID, + style: style + // $FlowFixMe[incompatible-type] + , + pointerEvents: newPointerEvents, + ref: forwardedRef + })); + if (hasTextAncestor) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextAncestor.default.Provider, { + value: false, + children: actualView + }); + } + return actualView; + }); + View.displayName = 'View'; + module.exports = View; +},241,[6,166,157,222,242,243,65,106],"node_modules\\react-native\\Libraries\\Components\\View\\View.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var React = _$$_REQUIRE(_dependencyMap[0], "react"); + + /** + * Whether the current element is the descendant of a element. + */ + var TextAncestorContext = React.createContext(false); + if (__DEV__) { + TextAncestorContext.displayName = 'TextAncestorContext'; + } + module.exports = TextAncestorContext; +},242,[65],"node_modules\\react-native\\Libraries\\Text\\TextAncestor.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.__INTERNAL_VIEW_CONFIG = exports.Commands = void 0; + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[1], "../../NativeComponent/NativeComponentRegistry")); + var _codegenNativeCommands = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Utilities/codegenNativeCommands")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Utilities/Platform")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = _Platform.default.OS === 'android' ? { + uiViewClassName: 'RCTView', + validAttributes: { + // ReactClippingViewManager @ReactProps + removeClippedSubviews: true, + // ReactViewManager @ReactProps + accessible: true, + hasTVPreferredFocus: true, + nextFocusDown: true, + nextFocusForward: true, + nextFocusLeft: true, + nextFocusRight: true, + nextFocusUp: true, + borderRadius: true, + borderTopLeftRadius: true, + borderTopRightRadius: true, + borderBottomRightRadius: true, + borderBottomLeftRadius: true, + borderTopStartRadius: true, + borderTopEndRadius: true, + borderBottomStartRadius: true, + borderBottomEndRadius: true, + borderEndEndRadius: true, + borderEndStartRadius: true, + borderStartEndRadius: true, + borderStartStartRadius: true, + borderStyle: true, + hitSlop: true, + pointerEvents: true, + nativeBackgroundAndroid: true, + nativeForegroundAndroid: true, + needsOffscreenAlphaCompositing: true, + borderWidth: true, + borderLeftWidth: true, + borderRightWidth: true, + borderTopWidth: true, + borderBottomWidth: true, + borderStartWidth: true, + borderEndWidth: true, + borderColor: { + process: _$$_REQUIRE(_dependencyMap[5], "../../StyleSheet/processColor").default + }, + borderLeftColor: { + process: _$$_REQUIRE(_dependencyMap[5], "../../StyleSheet/processColor").default + }, + borderRightColor: { + process: _$$_REQUIRE(_dependencyMap[5], "../../StyleSheet/processColor").default + }, + borderTopColor: { + process: _$$_REQUIRE(_dependencyMap[5], "../../StyleSheet/processColor").default + }, + borderBottomColor: { + process: _$$_REQUIRE(_dependencyMap[5], "../../StyleSheet/processColor").default + }, + borderStartColor: { + process: _$$_REQUIRE(_dependencyMap[5], "../../StyleSheet/processColor").default + }, + borderEndColor: { + process: _$$_REQUIRE(_dependencyMap[5], "../../StyleSheet/processColor").default + }, + borderBlockColor: { + process: _$$_REQUIRE(_dependencyMap[5], "../../StyleSheet/processColor").default + }, + borderBlockEndColor: { + process: _$$_REQUIRE(_dependencyMap[5], "../../StyleSheet/processColor").default + }, + borderBlockStartColor: { + process: _$$_REQUIRE(_dependencyMap[5], "../../StyleSheet/processColor").default + }, + focusable: true, + overflow: true, + backfaceVisibility: true, + experimental_layoutConformance: true + } + } : { + uiViewClassName: 'RCTView' + }; + var ViewNativeComponent = NativeComponentRegistry.get('RCTView', function () { + return __INTERNAL_VIEW_CONFIG; + }); + var Commands = exports.Commands = (0, _codegenNativeCommands.default)({ + supportedCommands: ['hotspotUpdate', 'setPressed'] + }); + var _default = exports.default = ViewNativeComponent; +},243,[6,244,265,34,65,189],"node_modules\\react-native\\Libraries\\Components\\View\\ViewNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.get = get; + exports.getWithFallback_DEPRECATED = getWithFallback_DEPRECATED; + exports.setRuntimeConfigProvider = setRuntimeConfigProvider; + exports.unstable_hasStaticViewConfig = unstable_hasStaticViewConfig; + var _getNativeComponentAttributes = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../ReactNative/getNativeComponentAttributes")); + var _UIManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../ReactNative/UIManager")); + var _ReactNativeViewConfigRegistry = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../Renderer/shims/ReactNativeViewConfigRegistry")); + var _verifyComponentAttributeEquivalence = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../Utilities/verifyComponentAttributeEquivalence")); + var StaticViewConfigValidator = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5], "./StaticViewConfigValidator")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "invariant")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var getRuntimeConfig; + + /** + * Configures a function that is called to determine whether a given component + * should be registered using reflection of the native component at runtime. + * + * The provider should return null if the native component is unavailable in + * the current environment. + */ + function setRuntimeConfigProvider(runtimeConfigProvider) { + if (getRuntimeConfig === undefined) { + getRuntimeConfig = runtimeConfigProvider; + } + } + + /** + * Gets a `NativeComponent` that can be rendered by React Native. + * + * The supplied `viewConfigProvider` may or may not be invoked and utilized, + * depending on how `setRuntimeConfigProvider` is configured. + */ + function get(name, viewConfigProvider) { + _ReactNativeViewConfigRegistry.default.register(name, function () { + var _getRuntimeConfig; + var _ref = (_getRuntimeConfig = getRuntimeConfig == null ? void 0 : getRuntimeConfig(name)) != null ? _getRuntimeConfig : { + native: !global.RN$Bridgeless, + strict: false, + verify: false + }, + native = _ref.native, + strict = _ref.strict, + verify = _ref.verify; + var viewConfig; + if (native) { + viewConfig = (0, _getNativeComponentAttributes.default)(name); + } else { + viewConfig = (0, _$$_REQUIRE(_dependencyMap[8], "./ViewConfig").createViewConfig)(viewConfigProvider()); + if (viewConfig == null) { + viewConfig = (0, _getNativeComponentAttributes.default)(name); + } + } + if (verify) { + var nativeViewConfig = native ? viewConfig : (0, _getNativeComponentAttributes.default)(name); + var staticViewConfig = native ? (0, _$$_REQUIRE(_dependencyMap[8], "./ViewConfig").createViewConfig)(viewConfigProvider()) : viewConfig; + if (strict) { + var validationOutput = StaticViewConfigValidator.validate(name, nativeViewConfig, staticViewConfig); + if (validationOutput.type === 'invalid') { + console.error(StaticViewConfigValidator.stringifyValidationResult(name, validationOutput)); + } + } else { + (0, _verifyComponentAttributeEquivalence.default)(nativeViewConfig, staticViewConfig); + } + } + return viewConfig; + }); + + // $FlowFixMe[incompatible-return] `NativeComponent` is actually string! + return name; + } + + /** + * Same as `NativeComponentRegistry.get(...)`, except this will check either + * the `setRuntimeConfigProvider` configuration or use native reflection (slow) + * to determine whether this native component is available. + * + * If the native component is not available, a stub component is returned. Note + * that the return value of this is not `HostComponent` because the returned + * component instance is not guaranteed to have native methods. + */ + function getWithFallback_DEPRECATED(name, viewConfigProvider) { + if (getRuntimeConfig == null) { + // `getRuntimeConfig == null` when static view configs are disabled + // If `setRuntimeConfigProvider` is not configured, use native reflection. + if (hasNativeViewConfig(name)) { + return get(name, viewConfigProvider); + } + } else { + // If there is no runtime config, then the native component is unavailable. + if (getRuntimeConfig(name) != null) { + return get(name, viewConfigProvider); + } + } + var FallbackNativeComponent = function FallbackNativeComponent(props) { + return null; + }; + FallbackNativeComponent.displayName = `Fallback(${name})`; + return FallbackNativeComponent; + } + function hasNativeViewConfig(name) { + (0, _invariant.default)(getRuntimeConfig == null, 'Unexpected invocation!'); + return _UIManager.default.getViewManagerConfig(name) != null; + } + + /** + * Unstable API. Do not use! + * + * This method returns if there is a StaticViewConfig registered for the + * component name received as a parameter. + */ + function unstable_hasStaticViewConfig(name) { + var _getRuntimeConfig2; + var _ref2 = (_getRuntimeConfig2 = getRuntimeConfig == null ? void 0 : getRuntimeConfig(name)) != null ? _getRuntimeConfig2 : { + native: true + }, + native = _ref2.native; + return !native; + } +},244,[6,245,51,258,259,263,37,65,264],"node_modules\\react-native\\Libraries\\NativeComponent\\NativeComponentRegistry.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + function getNativeComponentAttributes(uiViewClassName) { + var _bubblingEventTypes, _directEventTypes; + var viewConfig = _$$_REQUIRE(_dependencyMap[0], "./UIManager").getViewManagerConfig(uiViewClassName); + _$$_REQUIRE(_dependencyMap[1], "invariant")(viewConfig != null && viewConfig.NativeProps != null, 'requireNativeComponent: "%s" was not found in the UIManager.', uiViewClassName); + + // TODO: This seems like a whole lot of runtime initialization for every + // native component that can be either avoided or simplified. + var baseModuleName = viewConfig.baseModuleName, + bubblingEventTypes = viewConfig.bubblingEventTypes, + directEventTypes = viewConfig.directEventTypes; + var nativeProps = viewConfig.NativeProps; + bubblingEventTypes = (_bubblingEventTypes = bubblingEventTypes) != null ? _bubblingEventTypes : {}; + directEventTypes = (_directEventTypes = directEventTypes) != null ? _directEventTypes : {}; + while (baseModuleName) { + var baseModule = _$$_REQUIRE(_dependencyMap[0], "./UIManager").getViewManagerConfig(baseModuleName); + if (!baseModule) { + baseModuleName = null; + } else { + bubblingEventTypes = Object.assign({}, baseModule.bubblingEventTypes, bubblingEventTypes); + directEventTypes = Object.assign({}, baseModule.directEventTypes, directEventTypes); + nativeProps = Object.assign({}, baseModule.NativeProps, nativeProps); + baseModuleName = baseModule.baseModuleName; + } + } + var validAttributes = {}; + for (var key in nativeProps) { + var typeName = nativeProps[key]; + var diff = getDifferForType(typeName); + var process = getProcessorForType(typeName); + + // If diff or process == null, omit the corresponding property from the Attribute + // Why: + // 1. Consistency with AttributeType flow type + // 2. Consistency with Static View Configs, which omit the null properties + validAttributes[key] = diff == null ? process == null ? true : { + process: process + } : process == null ? { + diff: diff + } : { + diff: diff, + process: process + }; + } + + // Unfortunately, the current setup declares style properties as top-level + // props. This makes it so we allow style properties in the `style` prop. + // TODO: Move style properties into a `style` prop and disallow them as + // top-level props on the native side. + validAttributes.style = _$$_REQUIRE(_dependencyMap[2], "../Components/View/ReactNativeStyleAttributes"); + Object.assign(viewConfig, { + uiViewClassName: uiViewClassName, + validAttributes: validAttributes, + bubblingEventTypes: bubblingEventTypes, + directEventTypes: directEventTypes + }); + attachDefaultEventTypes(viewConfig); + return viewConfig; + } + function attachDefaultEventTypes(viewConfig) { + // This is supported on UIManager platforms (ex: Android), + // as lazy view managers are not implemented for all platforms. + // See [UIManager] for details on constants and implementations. + var constants = _$$_REQUIRE(_dependencyMap[0], "./UIManager").getConstants(); + if (constants.ViewManagerNames || constants.LazyViewManagersEnabled) { + // Lazy view managers enabled. + viewConfig = merge(viewConfig, _$$_REQUIRE(_dependencyMap[0], "./UIManager").getDefaultEventTypes()); + } else { + viewConfig.bubblingEventTypes = merge(viewConfig.bubblingEventTypes, constants.genericBubblingEventTypes); + viewConfig.directEventTypes = merge(viewConfig.directEventTypes, constants.genericDirectEventTypes); + } + } + + // TODO: Figure out how to avoid all this runtime initialization cost. + function merge(destination, source) { + if (!source) { + return destination; + } + if (!destination) { + return source; + } + for (var key in source) { + if (!source.hasOwnProperty(key)) { + continue; + } + var sourceValue = source[key]; + if (destination.hasOwnProperty(key)) { + var destinationValue = destination[key]; + if (typeof sourceValue === 'object' && typeof destinationValue === 'object') { + sourceValue = merge(destinationValue, sourceValue); + } + } + destination[key] = sourceValue; + } + return destination; + } + function getDifferForType(typeName) { + switch (typeName) { + // iOS Types + case 'CATransform3D': + return _$$_REQUIRE(_dependencyMap[3], "../Utilities/differ/matricesDiffer"); + case 'CGPoint': + return _$$_REQUIRE(_dependencyMap[4], "../Utilities/differ/pointsDiffer"); + case 'CGSize': + return _$$_REQUIRE(_dependencyMap[5], "../Utilities/differ/sizesDiffer"); + case 'UIEdgeInsets': + return _$$_REQUIRE(_dependencyMap[6], "../Utilities/differ/insetsDiffer"); + // Android Types + case 'Point': + return _$$_REQUIRE(_dependencyMap[4], "../Utilities/differ/pointsDiffer"); + case 'EdgeInsets': + return _$$_REQUIRE(_dependencyMap[6], "../Utilities/differ/insetsDiffer"); + } + return null; + } + function getProcessorForType(typeName) { + switch (typeName) { + // iOS Types + case 'CGColor': + case 'UIColor': + return _$$_REQUIRE(_dependencyMap[7], "../StyleSheet/processColor").default; + case 'CGColorArray': + case 'UIColorArray': + return _$$_REQUIRE(_dependencyMap[8], "../StyleSheet/processColorArray"); + case 'CGImage': + case 'UIImage': + case 'RCTImageSource': + return _$$_REQUIRE(_dependencyMap[9], "../Image/resolveAssetSource"); + // Android Types + case 'Color': + return _$$_REQUIRE(_dependencyMap[7], "../StyleSheet/processColor").default; + case 'ColorArray': + return _$$_REQUIRE(_dependencyMap[8], "../StyleSheet/processColorArray"); + case 'ImageSource': + return _$$_REQUIRE(_dependencyMap[9], "../Image/resolveAssetSource"); + } + return null; + } + module.exports = getNativeComponentAttributes; +},245,[51,37,213,246,247,219,248,189,249,250],"node_modules\\react-native\\Libraries\\ReactNative\\getNativeComponentAttributes.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * Unrolls an array comparison specially for matrices. Prioritizes + * checking of indices that are most likely to change so that the comparison + * bails as early as possible. + * + * @param {MatrixMath.Matrix} one First matrix. + * @param {MatrixMath.Matrix} two Second matrix. + * @return {boolean} Whether or not the two matrices differ. + */ + var matricesDiffer = function matricesDiffer(one, two) { + if (one === two) { + return false; + } + return !one || !two || one[12] !== two[12] || one[13] !== two[13] || one[14] !== two[14] || one[5] !== two[5] || one[10] !== two[10] || one[0] !== two[0] || one[1] !== two[1] || one[2] !== two[2] || one[3] !== two[3] || one[4] !== two[4] || one[6] !== two[6] || one[7] !== two[7] || one[8] !== two[8] || one[9] !== two[9] || one[11] !== two[11] || one[15] !== two[15]; + }; + module.exports = matricesDiffer; +},246,[],"node_modules\\react-native\\Libraries\\Utilities\\differ\\matricesDiffer.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var dummyPoint = { + x: undefined, + y: undefined + }; + var pointsDiffer = function pointsDiffer(one, two) { + one = one || dummyPoint; + two = two || dummyPoint; + return one !== two && (one.x !== two.x || one.y !== two.y); + }; + module.exports = pointsDiffer; +},247,[],"node_modules\\react-native\\Libraries\\Utilities\\differ\\pointsDiffer.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var dummyInsets = { + top: undefined, + left: undefined, + right: undefined, + bottom: undefined + }; + var insetsDiffer = function insetsDiffer(one, two) { + one = one || dummyInsets; + two = two || dummyInsets; + return one !== two && (one.top !== two.top || one.left !== two.left || one.right !== two.right || one.bottom !== two.bottom); + }; + module.exports = insetsDiffer; +},248,[],"node_modules\\react-native\\Libraries\\Utilities\\differ\\insetsDiffer.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _processColor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./processColor")); + var TRANSPARENT = 0; // rgba(0, 0, 0, 0) + + function processColorArray(colors) { + return colors == null ? null : colors.map(processColorElement); + } + function processColorElement(color) { + var value = (0, _processColor.default)(color); + // For invalid colors, fallback to transparent. + if (value == null) { + console.error('Invalid value in color array:', color); + return TRANSPARENT; + } + return value; + } + module.exports = processColorArray; +},249,[6,189],"node_modules\\react-native\\Libraries\\StyleSheet\\processColorArray.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + // Resolves an asset into a `source` for `Image`. + + 'use strict'; + + var _customSourceTransformer, _serverURL, _scriptURL; + var _sourceCodeScriptURL; + function getSourceCodeScriptURL() { + if (_sourceCodeScriptURL) { + return _sourceCodeScriptURL; + } + var sourceCode = global.nativeExtensions && global.nativeExtensions.SourceCode; + if (!sourceCode) { + sourceCode = _$$_REQUIRE(_dependencyMap[0], "../NativeModules/specs/NativeSourceCode").default; + } + _sourceCodeScriptURL = sourceCode.getConstants().scriptURL; + return _sourceCodeScriptURL; + } + function getDevServerURL() { + if (_serverURL === undefined) { + var sourceCodeScriptURL = getSourceCodeScriptURL(); + var match = sourceCodeScriptURL && sourceCodeScriptURL.match(/^https?:\/\/.*?\//); + if (match) { + // jsBundle was loaded from network + _serverURL = match[0]; + } else { + // jsBundle was loaded from file + _serverURL = null; + } + } + return _serverURL; + } + function _coerceLocalScriptURL(scriptURL) { + if (scriptURL) { + if (scriptURL.startsWith('assets://')) { + // android: running from within assets, no offline path to use + return null; + } + scriptURL = scriptURL.substring(0, scriptURL.lastIndexOf('/') + 1); + if (!scriptURL.includes('://')) { + // Add file protocol in case we have an absolute file path and not a URL. + // This shouldn't really be necessary. scriptURL should be a URL. + scriptURL = 'file://' + scriptURL; + } + } + return scriptURL; + } + function getScriptURL() { + if (_scriptURL === undefined) { + _scriptURL = _coerceLocalScriptURL(getSourceCodeScriptURL()); + } + return _scriptURL; + } + function setCustomSourceTransformer(transformer) { + _customSourceTransformer = transformer; + } + + /** + * `source` is either a number (opaque type returned by require('./foo.png')) + * or an `ImageSource` like { uri: '' } + */ + function resolveAssetSource(source) { + if (typeof source === 'object') { + return source; + } + var asset = _$$_REQUIRE(_dependencyMap[1], "@react-native/assets-registry/registry").getAssetByID(source); + if (!asset) { + return null; + } + var resolver = new (_$$_REQUIRE(_dependencyMap[2], "./AssetSourceResolver"))(getDevServerURL(), getScriptURL(), asset); + if (_customSourceTransformer) { + return _customSourceTransformer(resolver); + } + return resolver.defaultAsset(); + } + resolveAssetSource.pickScale = _$$_REQUIRE(_dependencyMap[3], "./AssetUtils").pickScale; + resolveAssetSource.setCustomSourceTransformer = setCustomSourceTransformer; + module.exports = resolveAssetSource; +},250,[103,251,252,253],"node_modules\\react-native\\Libraries\\Image\\resolveAssetSource.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var assets = []; + function registerAsset(asset) { + // `push` returns new array length, so the first asset will + // get id 1 (not 0) to make the value truthy + return assets.push(asset); + } + function getAssetByID(assetId) { + return assets[assetId - 1]; + } + module.exports = { + registerAsset: registerAsset, + getAssetByID: getAssetByID + }; +},251,[],"node_modules\\@react-native\\assets-registry\\registry.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _classCallCheck = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/createClass"); + /** + * Returns a path like 'assets/AwesomeModule/icon@2x.png' + */ + function getScaledAssetPath(asset) { + var scale = _$$_REQUIRE(_dependencyMap[2], "./AssetUtils").pickScale(asset.scales, _$$_REQUIRE(_dependencyMap[3], "../Utilities/PixelRatio").default.get()); + var scaleSuffix = scale === 1 ? '' : '@' + scale + 'x'; + var assetDir = _$$_REQUIRE(_dependencyMap[4], "@react-native/assets-registry/path-support").getBasePath(asset); + return assetDir + '/' + asset.name + scaleSuffix + '.' + asset.type; + } + + /** + * Returns a path like 'drawable-mdpi/icon.png' + */ + function getAssetPathInDrawableFolder(asset) { + var scale = _$$_REQUIRE(_dependencyMap[2], "./AssetUtils").pickScale(asset.scales, _$$_REQUIRE(_dependencyMap[3], "../Utilities/PixelRatio").default.get()); + var drawableFolder = _$$_REQUIRE(_dependencyMap[4], "@react-native/assets-registry/path-support").getAndroidResourceFolderName(asset, scale); + var fileName = _$$_REQUIRE(_dependencyMap[4], "@react-native/assets-registry/path-support").getAndroidResourceIdentifier(asset); + return drawableFolder + '/' + fileName + '.' + asset.type; + } + var AssetSourceResolver = /*#__PURE__*/function () { + // where the jsbundle is being run from + + // the asset to resolve + + function AssetSourceResolver(serverUrl, jsbundleUrl, asset) { + _classCallCheck(this, AssetSourceResolver); + this.serverUrl = serverUrl; + this.jsbundleUrl = jsbundleUrl; + this.asset = asset; + } + return _createClass(AssetSourceResolver, [{ + key: "isLoadedFromServer", + value: function isLoadedFromServer() { + return !!this.serverUrl; + } + }, { + key: "isLoadedFromFileSystem", + value: function isLoadedFromFileSystem() { + return !!(this.jsbundleUrl && this.jsbundleUrl.startsWith('file://')); + } + }, { + key: "defaultAsset", + value: function defaultAsset() { + if (this.isLoadedFromServer()) { + return this.assetServerURL(); + } + if ("android" === 'android') { + return this.isLoadedFromFileSystem() ? this.drawableFolderInBundle() : this.resourceIdentifierWithoutScale(); + } else { + return this.scaledAssetURLNearBundle(); + } + } + + /** + * Returns an absolute URL which can be used to fetch the asset + * from the devserver + */ + }, { + key: "assetServerURL", + value: function assetServerURL() { + _$$_REQUIRE(_dependencyMap[5], "invariant")(!!this.serverUrl, 'need server to load from'); + return this.fromSource(this.serverUrl + getScaledAssetPath(this.asset) + '?platform=' + "android" + '&hash=' + this.asset.hash); + } + + /** + * Resolves to just the scaled asset filename + * E.g. 'assets/AwesomeModule/icon@2x.png' + */ + }, { + key: "scaledAssetPath", + value: function scaledAssetPath() { + return this.fromSource(getScaledAssetPath(this.asset)); + } + + /** + * Resolves to where the bundle is running from, with a scaled asset filename + * E.g. 'file:///sdcard/bundle/assets/AwesomeModule/icon@2x.png' + */ + }, { + key: "scaledAssetURLNearBundle", + value: function scaledAssetURLNearBundle() { + var path = this.jsbundleUrl || 'file://'; + return this.fromSource( + // Assets can have relative paths outside of the project root. + // When bundling them we replace `../` with `_` to make sure they + // don't end up outside of the expected assets directory. + path + getScaledAssetPath(this.asset).replace(/\.\.\//g, '_')); + } + + /** + * The default location of assets bundled with the app, located by + * resource identifier + * The Android resource system picks the correct scale. + * E.g. 'assets_awesomemodule_icon' + */ + }, { + key: "resourceIdentifierWithoutScale", + value: function resourceIdentifierWithoutScale() { + _$$_REQUIRE(_dependencyMap[5], "invariant")("android" === 'android', 'resource identifiers work on Android'); + return this.fromSource(_$$_REQUIRE(_dependencyMap[4], "@react-native/assets-registry/path-support").getAndroidResourceIdentifier(this.asset)); + } + + /** + * If the jsbundle is running from a sideload location, this resolves assets + * relative to its location + * E.g. 'file:///sdcard/AwesomeModule/drawable-mdpi/icon.png' + */ + }, { + key: "drawableFolderInBundle", + value: function drawableFolderInBundle() { + var path = this.jsbundleUrl || 'file://'; + return this.fromSource(path + getAssetPathInDrawableFolder(this.asset)); + } + }, { + key: "fromSource", + value: function fromSource(source) { + return { + __packager_asset: true, + width: this.asset.width, + height: this.asset.height, + uri: source, + scale: _$$_REQUIRE(_dependencyMap[2], "./AssetUtils").pickScale(this.asset.scales, _$$_REQUIRE(_dependencyMap[3], "../Utilities/PixelRatio").default.get()) + }; + } + }]); + }(); + AssetSourceResolver.pickScale = _$$_REQUIRE(_dependencyMap[2], "./AssetUtils").pickScale; + module.exports = AssetSourceResolver; +},252,[18,19,253,254,257,37],"node_modules\\react-native\\Libraries\\Image\\AssetSourceResolver.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getUrlCacheBreaker = getUrlCacheBreaker; + exports.pickScale = pickScale; + exports.setUrlCacheBreaker = setUrlCacheBreaker; + var _PixelRatio = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../Utilities/PixelRatio")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var cacheBreaker; + var warnIfCacheBreakerUnset = true; + function pickScale(scales, deviceScale) { + if (deviceScale == null) { + deviceScale = _PixelRatio.default.get(); + } + // Packager guarantees that `scales` array is sorted + for (var i = 0; i < scales.length; i++) { + if (scales[i] >= deviceScale) { + return scales[i]; + } + } + + // If nothing matches, device scale is larger than any available + // scales, so we return the biggest one. Unless the array is empty, + // in which case we default to 1 + return scales[scales.length - 1] || 1; + } + function setUrlCacheBreaker(appendage) { + cacheBreaker = appendage; + } + function getUrlCacheBreaker() { + if (cacheBreaker == null) { + if (__DEV__ && warnIfCacheBreakerUnset) { + warnIfCacheBreakerUnset = false; + console.warn('AssetUtils.getUrlCacheBreaker: Cache breaker value is unset'); + } + return ''; + } + return cacheBreaker; + } +},253,[6,254],"node_modules\\react-native\\Libraries\\Image\\AssetUtils.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + /** + * PixelRatio class gives access to the device pixel density. + * + * ## Fetching a correctly sized image + * + * You should get a higher resolution image if you are on a high pixel density + * device. A good rule of thumb is to multiply the size of the image you display + * by the pixel ratio. + * + * ``` + * var image = getImage({ + * width: PixelRatio.getPixelSizeForLayoutSize(200), + * height: PixelRatio.getPixelSizeForLayoutSize(100), + * }); + * + * ``` + * + * ## Pixel grid snapping + * + * In iOS, you can specify positions and dimensions for elements with arbitrary + * precision, for example 29.674825. But, ultimately the physical display only + * have a fixed number of pixels, for example 640×960 for iPhone 4 or 750×1334 + * for iPhone 6. iOS tries to be as faithful as possible to the user value by + * spreading one original pixel into multiple ones to trick the eye. The + * downside of this technique is that it makes the resulting element look + * blurry. + * + * In practice, we found out that developers do not want this feature and they + * have to work around it by doing manual rounding in order to avoid having + * blurry elements. In React Native, we are rounding all the pixels + * automatically. + * + * We have to be careful when to do this rounding. You never want to work with + * rounded and unrounded values at the same time as you're going to accumulate + * rounding errors. Having even one rounding error is deadly because a one + * pixel border may vanish or be twice as big. + * + * In React Native, everything in JavaScript and within the layout engine works + * with arbitrary precision numbers. It's only when we set the position and + * dimensions of the native element on the main thread that we round. Also, + * rounding is done relative to the root rather than the parent, again to avoid + * accumulating rounding errors. + * + */ + var PixelRatio = /*#__PURE__*/function () { + function PixelRatio() { + (0, _classCallCheck2.default)(this, PixelRatio); + } + return (0, _createClass2.default)(PixelRatio, null, [{ + key: "get", + value: + /** + * Returns the device pixel density. Some examples: + * + * - PixelRatio.get() === 1 + * - mdpi Android devices (160 dpi) + * - PixelRatio.get() === 1.5 + * - hdpi Android devices (240 dpi) + * - PixelRatio.get() === 2 + * - iPhone 4, 4S + * - iPhone 5, 5c, 5s + * - iPhone 6 + * - iPhone 7 + * - iPhone 8 + * - iPhone SE + * - xhdpi Android devices (320 dpi) + * - PixelRatio.get() === 3 + * - iPhone 6 Plus + * - iPhone 7 Plus + * - iPhone 8 Plus + * - iPhone X + * - xxhdpi Android devices (480 dpi) + * - PixelRatio.get() === 3.5 + * - Nexus 6 + */ + function get() { + return _$$_REQUIRE(_dependencyMap[3], "./Dimensions").default.get('window').scale; + } + + /** + * Returns the scaling factor for font sizes. This is the ratio that is used to calculate the + * absolute font size, so any elements that heavily depend on that should use this to do + * calculations. + * + * If a font scale is not set, this returns the device pixel ratio. + * + * This reflects the user preference set in: + * - Settings > Display > Font size on Android, + * - Settings > Display & Brightness > Text Size on iOS. + */ + }, { + key: "getFontScale", + value: function getFontScale() { + return _$$_REQUIRE(_dependencyMap[3], "./Dimensions").default.get('window').fontScale || PixelRatio.get(); + } + + /** + * Converts a layout size (dp) to pixel size (px). + * + * Guaranteed to return an integer number. + */ + }, { + key: "getPixelSizeForLayoutSize", + value: function getPixelSizeForLayoutSize(layoutSize) { + return Math.round(layoutSize * PixelRatio.get()); + } + + /** + * Rounds a layout size (dp) to the nearest layout size that corresponds to + * an integer number of pixels. For example, on a device with a PixelRatio + * of 3, `PixelRatio.roundToNearestPixel(8.4) = 8.33`, which corresponds to + * exactly (8.33 * 3) = 25 pixels. + */ + }, { + key: "roundToNearestPixel", + value: function roundToNearestPixel(layoutSize) { + var ratio = PixelRatio.get(); + return Math.round(layoutSize * ratio) / ratio; + } + + // No-op for iOS, but used on the web. Should not be documented. + }, { + key: "startDetecting", + value: function startDetecting() {} + }]); + }(); + var _default = exports.default = PixelRatio; +},254,[6,18,19,255],"node_modules\\react-native\\Libraries\\Utilities\\PixelRatio.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _RCTDeviceEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../EventEmitter/RCTDeviceEventEmitter")); + var _EventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../vendor/emitter/EventEmitter")); + var _NativeDeviceInfo = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "./NativeDeviceInfo")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "invariant")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var eventEmitter = new _EventEmitter.default(); + var dimensionsInitialized = false; + var dimensions; + var Dimensions = /*#__PURE__*/function () { + function Dimensions() { + (0, _classCallCheck2.default)(this, Dimensions); + } + return (0, _createClass2.default)(Dimensions, null, [{ + key: "get", + value: + /** + * NOTE: `useWindowDimensions` is the preferred API for React components. + * + * Initial dimensions are set before `runApplication` is called so they should + * be available before any other require's are run, but may be updated later. + * + * Note: Although dimensions are available immediately, they may change (e.g + * due to device rotation) so any rendering logic or styles that depend on + * these constants should try to call this function on every render, rather + * than caching the value (for example, using inline styles rather than + * setting a value in a `StyleSheet`). + * + * Example: `const {height, width} = Dimensions.get('window');` + * + * @param {string} dim Name of dimension as defined when calling `set`. + * @returns {DisplayMetrics? | DisplayMetricsAndroid?} Value for the dimension. + */ + function get(dim) { + (0, _invariant.default)(dimensions[dim], 'No dimension set for key ' + dim); + return dimensions[dim]; + } + + /** + * This should only be called from native code by sending the + * didUpdateDimensions event. + * + * @param {DimensionsPayload} dims Simple string-keyed object of dimensions to set + */ + }, { + key: "set", + value: function set(dims) { + // We calculate the window dimensions in JS so that we don't encounter loss of + // precision in transferring the dimensions (which could be non-integers) over + // the bridge. + var screen = dims.screen, + window = dims.window; + var windowPhysicalPixels = dims.windowPhysicalPixels; + if (windowPhysicalPixels) { + window = { + width: windowPhysicalPixels.width / windowPhysicalPixels.scale, + height: windowPhysicalPixels.height / windowPhysicalPixels.scale, + scale: windowPhysicalPixels.scale, + fontScale: windowPhysicalPixels.fontScale + }; + } + var screenPhysicalPixels = dims.screenPhysicalPixels; + if (screenPhysicalPixels) { + screen = { + width: screenPhysicalPixels.width / screenPhysicalPixels.scale, + height: screenPhysicalPixels.height / screenPhysicalPixels.scale, + scale: screenPhysicalPixels.scale, + fontScale: screenPhysicalPixels.fontScale + }; + } else if (screen == null) { + screen = window; + } + dimensions = { + window: window, + screen: screen + }; + if (dimensionsInitialized) { + // Don't fire 'change' the first time the dimensions are set. + eventEmitter.emit('change', dimensions); + } else { + dimensionsInitialized = true; + } + } + + /** + * Add an event handler. Supported events: + * + * - `change`: Fires when a property within the `Dimensions` object changes. The argument + * to the event handler is an object with `window` and `screen` properties whose values + * are the same as the return values of `Dimensions.get('window')` and + * `Dimensions.get('screen')`, respectively. + */ + }, { + key: "addEventListener", + value: function addEventListener(type, handler) { + (0, _invariant.default)(type === 'change', 'Trying to subscribe to unknown event: "%s"', type); + return eventEmitter.addListener(type, handler); + } + }]); + }(); + var initialDims = global.nativeExtensions && global.nativeExtensions.DeviceInfo && global.nativeExtensions.DeviceInfo.Dimensions; + if (!initialDims) { + // Subscribe before calling getConstants to make sure we don't miss any updates in between. + _RCTDeviceEventEmitter.default.addListener('didUpdateDimensions', function (update) { + Dimensions.set(update); + }); + initialDims = _NativeDeviceInfo.default.getConstants().Dimensions; + } + Dimensions.set(initialDims); + var _default = exports.default = Dimensions; +},255,[6,18,19,17,30,256,37],"node_modules\\react-native\\Libraries\\Utilities\\Dimensions.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var NativeModule = TurboModuleRegistry.getEnforcing('DeviceInfo'); + var constants = null; + var NativeDeviceInfo = { + getConstants: function getConstants() { + if (constants == null) { + constants = NativeModule.getConstants(); + } + return constants; + } + }; + var _default = exports.default = NativeDeviceInfo; +},256,[36],"node_modules\\react-native\\Libraries\\Utilities\\NativeDeviceInfo.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var androidScaleSuffix = { + '0.75': 'ldpi', + '1': 'mdpi', + '1.5': 'hdpi', + '2': 'xhdpi', + '3': 'xxhdpi', + '4': 'xxxhdpi' + }; + var ANDROID_BASE_DENSITY = 160; + + /** + * FIXME: using number to represent discrete scale numbers is fragile in essence because of + * floating point numbers imprecision. + */ + function getAndroidAssetSuffix(scale) { + if (scale.toString() in androidScaleSuffix) { + return androidScaleSuffix[scale.toString()]; + } + // NOTE: Android Gradle Plugin does not fully support the nnndpi format. + // See https://issuetracker.google.com/issues/72884435 + if (Number.isFinite(scale) && scale > 0) { + return Math.round(scale * ANDROID_BASE_DENSITY) + 'dpi'; + } + throw new Error('no such scale ' + scale.toString()); + } + + // See https://developer.android.com/guide/topics/resources/drawable-resource.html + var drawableFileTypes = new Set(['gif', 'jpeg', 'jpg', 'ktx', 'png', 'svg', 'webp', 'xml']); + function getAndroidResourceFolderName(asset, scale) { + if (!drawableFileTypes.has(asset.type)) { + return 'raw'; + } + var suffix = getAndroidAssetSuffix(scale); + if (!suffix) { + throw new Error("Don't know which android drawable suffix to use for scale: " + scale + '\nAsset: ' + JSON.stringify(asset, null, '\t') + '\nPossible scales are:' + JSON.stringify(androidScaleSuffix, null, '\t')); + } + return 'drawable-' + suffix; + } + function getAndroidResourceIdentifier(asset) { + return (getBasePath(asset) + '/' + asset.name).toLowerCase().replace(/\//g, '_') // Encode folder structure in file name + .replace(/([^a-z0-9_])/g, '') // Remove illegal chars + .replace(/^assets_/, ''); // Remove "assets_" prefix + } + function getBasePath(asset) { + var basePath = asset.httpServerLocation; + return basePath.startsWith('/') ? basePath.slice(1) : basePath; + } + module.exports = { + getAndroidResourceFolderName: getAndroidResourceFolderName, + getAndroidResourceIdentifier: getAndroidResourceIdentifier, + getBasePath: getBasePath + }; +},257,[],"node_modules\\@react-native\\assets-registry\\path-support.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @noformat + * + * @nolint + * @generated SignedSource<<1b39316520f5af25f0a141d7d78b0809>> + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "invariant")); + // Event configs + var customBubblingEventTypes = {}; + var customDirectEventTypes = {}; + exports.customBubblingEventTypes = customBubblingEventTypes; + exports.customDirectEventTypes = customDirectEventTypes; + var viewConfigCallbacks = new Map(); + var viewConfigs = new Map(); + function processEventTypes(viewConfig) { + var bubblingEventTypes = viewConfig.bubblingEventTypes, + directEventTypes = viewConfig.directEventTypes; + if (__DEV__) { + if (bubblingEventTypes != null && directEventTypes != null) { + for (var topLevelType in directEventTypes) { + (0, _invariant.default)(bubblingEventTypes[topLevelType] == null, 'Event cannot be both direct and bubbling: %s', topLevelType); + } + } + } + if (bubblingEventTypes != null) { + for (var _topLevelType in bubblingEventTypes) { + if (customBubblingEventTypes[_topLevelType] == null) { + customBubblingEventTypes[_topLevelType] = bubblingEventTypes[_topLevelType]; + } + } + } + if (directEventTypes != null) { + for (var _topLevelType2 in directEventTypes) { + if (customDirectEventTypes[_topLevelType2] == null) { + customDirectEventTypes[_topLevelType2] = directEventTypes[_topLevelType2]; + } + } + } + } + + /** + * Registers a native view/component by name. + * A callback is provided to load the view config from UIManager. + * The callback is deferred until the view is actually rendered. + */ + exports.register = function (name, callback) { + (0, _invariant.default)(!viewConfigCallbacks.has(name), 'Tried to register two views with the same name %s', name); + (0, _invariant.default)(typeof callback === 'function', 'View config getter callback for component `%s` must be a function (received `%s`)', name, callback === null ? 'null' : typeof callback); + viewConfigCallbacks.set(name, callback); + return name; + }; + + /** + * Retrieves a config for the specified view. + * If this is the first time the view has been used, + * This configuration will be lazy-loaded from UIManager. + */ + exports.get = function (name) { + var viewConfig; + if (!viewConfigs.has(name)) { + var callback = viewConfigCallbacks.get(name); + if (typeof callback !== 'function') { + (0, _invariant.default)(false, 'View config getter callback for component `%s` must be a function (received `%s`).%s', name, callback === null ? 'null' : typeof callback, + // $FlowFixMe[recursive-definition] + typeof name[0] === 'string' && /[a-z]/.test(name[0]) ? ' Make sure to start component names with a capital letter.' : ''); + } + viewConfig = callback(); + processEventTypes(viewConfig); + viewConfigs.set(name, viewConfig); + + // Clear the callback after the config is set so that + // we don't mask any errors during registration. + viewConfigCallbacks.set(name, null); + } else { + viewConfig = viewConfigs.get(name); + } + (0, _invariant.default)(viewConfig, 'View config not found for name %s', name); + return viewConfig; + }; +},258,[6,37],"node_modules\\react-native\\Libraries\\Renderer\\shims\\ReactNativeViewConfigRegistry.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = verifyComponentAttributeEquivalence; + exports.getConfigWithoutViewProps = getConfigWithoutViewProps; + exports.stringifyViewConfig = stringifyViewConfig; + var _PlatformBaseViewConfig = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../NativeComponent/PlatformBaseViewConfig")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var IGNORED_KEYS = ['transform', 'hitSlop']; + + /** + * The purpose of this function is to validate that the view config that + * native exposes for a given view manager is the same as the view config + * that is specified for that view manager in JS. + * + * In order to improve perf, we want to avoid calling into native to get + * the view config when each view manager is used. To do this, we are moving + * the configs to JS. In the future we will use these JS based view configs + * to codegen the view manager on native to ensure they stay in sync without + * this runtime check. + * + * If this function fails, that likely means a change was made to the native + * view manager without updating the JS config as well. Ideally you can make + * that direct change to the JS config. If you don't know what the differences + * are, the best approach I've found is to create a view that prints + * the return value of getNativeComponentAttributes, and then copying that + * text and pasting it back into JS: + * {JSON.stringify(getNativeComponentAttributes('RCTView'))} + * + * This is meant to be a stopgap until the time comes when we only have a + * single source of truth. I wonder if this message will still be here two + * years from now... + */ + function verifyComponentAttributeEquivalence(nativeViewConfig, staticViewConfig) { + for (var prop of ['validAttributes', 'bubblingEventTypes', 'directEventTypes']) { + var diff = Object.keys(lefthandObjectDiff(nativeViewConfig[prop], staticViewConfig[prop])); + if (diff.length > 0) { + var _staticViewConfig$uiV; + var name = (_staticViewConfig$uiV = staticViewConfig.uiViewClassName) != null ? _staticViewConfig$uiV : nativeViewConfig.uiViewClassName; + console.error(`'${name}' has a view config that does not match native. ` + `'${prop}' is missing: ${diff.join(', ')}`); + } + } + } + + // Return the different key-value pairs of the right object, by iterating through the keys in the left object + // Note it won't return a difference where a key is missing in the left but exists the right. + function lefthandObjectDiff(leftObj, rightObj) { + var differentKeys = {}; + function compare(leftItem, rightItem, key) { + if (typeof leftItem !== typeof rightItem && leftItem != null) { + differentKeys[key] = rightItem; + return; + } + if (typeof leftItem === 'object') { + var objDiff = lefthandObjectDiff(leftItem, rightItem); + if (Object.keys(objDiff).length > 1) { + differentKeys[key] = objDiff; + } + return; + } + if (leftItem !== rightItem) { + differentKeys[key] = rightItem; + return; + } + } + for (var key in leftObj) { + if (IGNORED_KEYS.includes(key)) { + continue; + } + if (!rightObj) { + differentKeys[key] = {}; + } else if (leftObj.hasOwnProperty(key)) { + compare(leftObj[key], rightObj[key], key); + } + } + return differentKeys; + } + function getConfigWithoutViewProps(viewConfig, propName) { + if (!viewConfig[propName]) { + return {}; + } + return Object.keys(viewConfig[propName]).filter(function (prop) { + return !_PlatformBaseViewConfig.default[propName][prop]; + }).reduce(function (obj, prop) { + obj[prop] = viewConfig[propName][prop]; + return obj; + }, {}); + } + function stringifyViewConfig(viewConfig) { + return JSON.stringify(viewConfig, function (key, val) { + if (typeof val === 'function') { + return `ƒ ${val.name}`; + } + return val; + }, 2); + } +},259,[6,260],"node_modules\\react-native\\Libraries\\Utilities\\verifyComponentAttributeEquivalence.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _BaseViewConfig = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./BaseViewConfig")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var PlatformBaseViewConfig = _BaseViewConfig.default; + + // In Wilde/FB4A, use RNHostComponentListRoute in Bridge mode to verify + // whether the JS props defined here match the native props defined + // in RCTViewManagers in iOS, and ViewManagers in Android. + var _default = exports.default = PlatformBaseViewConfig; +},260,[6,261],"node_modules\\react-native\\Libraries\\NativeComponent\\PlatformBaseViewConfig.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _ReactNativeStyleAttributes = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../Components/View/ReactNativeStyleAttributes")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var bubblingEventTypes = { + // Bubbling events from UIManagerModuleConstants.java + topChange: { + phasedRegistrationNames: { + captured: 'onChangeCapture', + bubbled: 'onChange' + } + }, + topSelect: { + phasedRegistrationNames: { + captured: 'onSelectCapture', + bubbled: 'onSelect' + } + }, + topTouchEnd: { + phasedRegistrationNames: { + captured: 'onTouchEndCapture', + bubbled: 'onTouchEnd' + } + }, + topTouchCancel: { + phasedRegistrationNames: { + captured: 'onTouchCancelCapture', + bubbled: 'onTouchCancel' + } + }, + topTouchStart: { + phasedRegistrationNames: { + captured: 'onTouchStartCapture', + bubbled: 'onTouchStart' + } + }, + topTouchMove: { + phasedRegistrationNames: { + captured: 'onTouchMoveCapture', + bubbled: 'onTouchMove' + } + }, + // Experimental/Work in Progress Pointer Events (not yet ready for use) + topPointerCancel: { + phasedRegistrationNames: { + captured: 'onPointerCancelCapture', + bubbled: 'onPointerCancel' + } + }, + topPointerDown: { + phasedRegistrationNames: { + captured: 'onPointerDownCapture', + bubbled: 'onPointerDown' + } + }, + topPointerEnter: { + phasedRegistrationNames: { + captured: 'onPointerEnterCapture', + bubbled: 'onPointerEnter', + skipBubbling: true + } + }, + topPointerLeave: { + phasedRegistrationNames: { + captured: 'onPointerLeaveCapture', + bubbled: 'onPointerLeave', + skipBubbling: true + } + }, + topPointerMove: { + phasedRegistrationNames: { + captured: 'onPointerMoveCapture', + bubbled: 'onPointerMove' + } + }, + topPointerUp: { + phasedRegistrationNames: { + captured: 'onPointerUpCapture', + bubbled: 'onPointerUp' + } + }, + topPointerOut: { + phasedRegistrationNames: { + captured: 'onPointerOutCapture', + bubbled: 'onPointerOut' + } + }, + topPointerOver: { + phasedRegistrationNames: { + captured: 'onPointerOverCapture', + bubbled: 'onPointerOver' + } + }, + topClick: { + phasedRegistrationNames: { + captured: 'onClickCapture', + bubbled: 'onClick' + } + } + }; + var directEventTypes = { + topAccessibilityAction: { + registrationName: 'onAccessibilityAction' + }, + onGestureHandlerEvent: (0, _$$_REQUIRE(_dependencyMap[2], "./ViewConfigIgnore").DynamicallyInjectedByGestureHandler)({ + registrationName: 'onGestureHandlerEvent' + }), + onGestureHandlerStateChange: (0, _$$_REQUIRE(_dependencyMap[2], "./ViewConfigIgnore").DynamicallyInjectedByGestureHandler)({ + registrationName: 'onGestureHandlerStateChange' + }), + // Direct events from UIManagerModuleConstants.java + topContentSizeChange: { + registrationName: 'onContentSizeChange' + }, + topScrollBeginDrag: { + registrationName: 'onScrollBeginDrag' + }, + topMessage: { + registrationName: 'onMessage' + }, + topSelectionChange: { + registrationName: 'onSelectionChange' + }, + topLoadingFinish: { + registrationName: 'onLoadingFinish' + }, + topMomentumScrollEnd: { + registrationName: 'onMomentumScrollEnd' + }, + topLoadingStart: { + registrationName: 'onLoadingStart' + }, + topLoadingError: { + registrationName: 'onLoadingError' + }, + topMomentumScrollBegin: { + registrationName: 'onMomentumScrollBegin' + }, + topScrollEndDrag: { + registrationName: 'onScrollEndDrag' + }, + topScroll: { + registrationName: 'onScroll' + }, + topLayout: { + registrationName: 'onLayout' + } + }; + var validAttributesForNonEventProps = { + // @ReactProps from BaseViewManager + backgroundColor: { + process: _$$_REQUIRE(_dependencyMap[3], "../StyleSheet/processColor").default + }, + transform: true, + transformOrigin: true, + opacity: true, + elevation: true, + shadowColor: { + process: _$$_REQUIRE(_dependencyMap[3], "../StyleSheet/processColor").default + }, + zIndex: true, + renderToHardwareTextureAndroid: true, + testID: true, + nativeID: true, + accessibilityLabelledBy: true, + accessibilityLabel: true, + accessibilityHint: true, + accessibilityRole: true, + accessibilityCollection: true, + accessibilityCollectionItem: true, + accessibilityState: true, + accessibilityActions: true, + accessibilityValue: true, + importantForAccessibility: true, + role: true, + rotation: true, + scaleX: true, + scaleY: true, + translateX: true, + translateY: true, + accessibilityLiveRegion: true, + // @ReactProps from LayoutShadowNode + width: true, + minWidth: true, + collapsable: true, + maxWidth: true, + height: true, + minHeight: true, + maxHeight: true, + flex: true, + flexGrow: true, + rowGap: true, + columnGap: true, + gap: true, + flexShrink: true, + flexBasis: true, + aspectRatio: true, + flexDirection: true, + flexWrap: true, + alignSelf: true, + alignItems: true, + alignContent: true, + justifyContent: true, + overflow: true, + display: true, + margin: true, + marginBlock: true, + marginBlockEnd: true, + marginBlockStart: true, + marginBottom: true, + marginEnd: true, + marginHorizontal: true, + marginInline: true, + marginInlineEnd: true, + marginInlineStart: true, + marginLeft: true, + marginRight: true, + marginStart: true, + marginTop: true, + marginVertical: true, + padding: true, + paddingBlock: true, + paddingBlockEnd: true, + paddingBlockStart: true, + paddingBottom: true, + paddingEnd: true, + paddingHorizontal: true, + paddingInline: true, + paddingInlineEnd: true, + paddingInlineStart: true, + paddingLeft: true, + paddingRight: true, + paddingStart: true, + paddingTop: true, + paddingVertical: true, + borderWidth: true, + borderStartWidth: true, + borderEndWidth: true, + borderTopWidth: true, + borderBottomWidth: true, + borderLeftWidth: true, + borderRightWidth: true, + start: true, + end: true, + left: true, + right: true, + top: true, + bottom: true, + inset: true, + insetBlock: true, + insetBlockEnd: true, + insetBlockStart: true, + insetInline: true, + insetInlineEnd: true, + insetInlineStart: true, + position: true, + style: _ReactNativeStyleAttributes.default, + experimental_layoutConformance: true + }; + + // Props for bubbling and direct events + var validAttributesForEventProps = { + onLayout: true, + // PanResponder handlers + onMoveShouldSetResponder: true, + onMoveShouldSetResponderCapture: true, + onStartShouldSetResponder: true, + onStartShouldSetResponderCapture: true, + onResponderGrant: true, + onResponderReject: true, + onResponderStart: true, + onResponderEnd: true, + onResponderRelease: true, + onResponderMove: true, + onResponderTerminate: true, + onResponderTerminationRequest: true, + onShouldBlockNativeResponder: true, + // Touch events + onTouchStart: true, + onTouchMove: true, + onTouchEnd: true, + onTouchCancel: true, + // Pointer events + onPointerEnter: true, + onPointerEnterCapture: true, + onPointerLeave: true, + onPointerLeaveCapture: true, + onPointerMove: true, + onPointerMoveCapture: true, + onPointerOut: true, + onPointerOutCapture: true, + onPointerOver: true, + onPointerOverCapture: true + }; + + /** + * On Android, Props are derived from a ViewManager and its ShadowNode. + * + * Where did we find these base platform props from? + * - Nearly all component ViewManagers descend from BaseViewManager, + * - and BaseViewManagers' ShadowNodes descend from LayoutShadowNode. + * - Also, all components inherit ViewConfigs from UIManagerModuleConstants.java. + * + * So, these ViewConfigs are generated from LayoutShadowNode and BaseViewManager. + */ + var PlatformBaseViewConfigAndroid = { + directEventTypes: directEventTypes, + bubblingEventTypes: bubblingEventTypes, + validAttributes: Object.assign({}, validAttributesForNonEventProps, validAttributesForEventProps) + }; + var _default = exports.default = PlatformBaseViewConfigAndroid; +},261,[6,213,262,189],"node_modules\\react-native\\Libraries\\NativeComponent\\BaseViewConfig.android.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.ConditionallyIgnoredEventHandlers = ConditionallyIgnoredEventHandlers; + exports.DynamicallyInjectedByGestureHandler = DynamicallyInjectedByGestureHandler; + exports.isIgnored = isIgnored; + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../Utilities/Platform")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var ignoredViewConfigProps = new WeakSet(); + + /** + * Decorates ViewConfig values that are dynamically injected by the library, + * react-native-gesture-handler. (T45765076) + */ + function DynamicallyInjectedByGestureHandler(object) { + ignoredViewConfigProps.add(object); + return object; + } + + /** + * On iOS, ViewManager event declarations generate {eventName}: true entries + * in ViewConfig valueAttributes. These entries aren't generated for Android. + * This annotation allows Static ViewConfigs to insert these entries into + * iOS but not Android. + * + * In the future, we want to remove this platform-inconsistency. We want + * to set RN$ViewConfigEventValidAttributesDisabled = true server-side, + * so that iOS does not generate validAttributes from event props in iOS RCTViewManager, + * since Android does not generate validAttributes from events props in Android ViewManager. + * + * TODO(T110872225): Remove this logic, after achieving platform-consistency + */ + function ConditionallyIgnoredEventHandlers(value) { + if (_Platform.default.OS === 'ios') { + return value; + } + return undefined; + } + function isIgnored(value) { + if (typeof value === 'object' && value != null) { + return ignoredViewConfigProps.has(value); + } + return false; + } +},262,[6,34],"node_modules\\react-native\\Libraries\\NativeComponent\\ViewConfigIgnore.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.stringifyValidationResult = stringifyValidationResult; + exports.validate = validate; + var _toConsumableArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/toConsumableArray")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /** + * During the migration from native view configs to static view configs, this is + * used to validate that the two are equivalent. + */ + function validate(name, nativeViewConfig, staticViewConfig) { + var differences = []; + accumulateDifferences(differences, [], { + bubblingEventTypes: nativeViewConfig.bubblingEventTypes, + directEventTypes: nativeViewConfig.directEventTypes, + uiViewClassName: nativeViewConfig.uiViewClassName, + validAttributes: nativeViewConfig.validAttributes + }, { + bubblingEventTypes: staticViewConfig.bubblingEventTypes, + directEventTypes: staticViewConfig.directEventTypes, + uiViewClassName: staticViewConfig.uiViewClassName, + validAttributes: staticViewConfig.validAttributes + }); + if (differences.length === 0) { + return { + type: 'valid' + }; + } + return { + type: 'invalid', + differences: differences + }; + } + function stringifyValidationResult(name, validationResult) { + var differences = validationResult.differences; + return [`StaticViewConfigValidator: Invalid static view config for '${name}'.`, ''].concat((0, _toConsumableArray2.default)(differences.map(function (difference) { + var type = difference.type, + path = difference.path; + switch (type) { + case 'missing': + return `- '${path.join('.')}' is missing.`; + case 'unequal': + return `- '${path.join('.')}' is the wrong value.`; + case 'unexpected': + return `- '${path.join('.')}' is present but not expected to be.`; + } + })), ['']).join('\n'); + } + function accumulateDifferences(differences, path, nativeObject, staticObject) { + for (var nativeKey in nativeObject) { + var nativeValue = nativeObject[nativeKey]; + if (!staticObject.hasOwnProperty(nativeKey)) { + differences.push({ + path: [].concat((0, _toConsumableArray2.default)(path), [nativeKey]), + type: 'missing', + nativeValue: nativeValue + }); + continue; + } + var staticValue = staticObject[nativeKey]; + var nativeValueIfObject = ifObject(nativeValue); + if (nativeValueIfObject != null) { + var staticValueIfObject = ifObject(staticValue); + if (staticValueIfObject != null) { + path.push(nativeKey); + accumulateDifferences(differences, path, nativeValueIfObject, staticValueIfObject); + path.pop(); + continue; + } + } + if (nativeValue !== staticValue) { + differences.push({ + path: [].concat((0, _toConsumableArray2.default)(path), [nativeKey]), + type: 'unequal', + nativeValue: nativeValue, + staticValue: staticValue + }); + } + } + for (var staticKey in staticObject) { + if (!nativeObject.hasOwnProperty(staticKey) && !(0, _$$_REQUIRE(_dependencyMap[2], "./ViewConfigIgnore").isIgnored)(staticObject[staticKey])) { + differences.push({ + path: [].concat((0, _toConsumableArray2.default)(path), [staticKey]), + type: 'unexpected', + staticValue: staticObject[staticKey] + }); + } + } + } + function ifObject(value) { + return typeof value === 'object' && !Array.isArray(value) ? value : null; + } +},263,[6,41,262],"node_modules\\react-native\\Libraries\\NativeComponent\\StaticViewConfigValidator.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createViewConfig = createViewConfig; + var _PlatformBaseViewConfig = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./PlatformBaseViewConfig")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /** + * Creates a complete `ViewConfig` from a `PartialViewConfig`. + */ + function createViewConfig(partialViewConfig) { + return { + uiViewClassName: partialViewConfig.uiViewClassName, + Commands: {}, + bubblingEventTypes: composeIndexers(_PlatformBaseViewConfig.default.bubblingEventTypes, partialViewConfig.bubblingEventTypes), + directEventTypes: composeIndexers(_PlatformBaseViewConfig.default.directEventTypes, partialViewConfig.directEventTypes), + // $FlowFixMe[incompatible-return] + validAttributes: composeIndexers( + // $FlowFixMe[incompatible-call] `style` property confuses Flow. + _PlatformBaseViewConfig.default.validAttributes, + // $FlowFixMe[incompatible-call] `style` property confuses Flow. + partialViewConfig.validAttributes) + }; + } + function composeIndexers(maybeA, maybeB) { + var _ref; + return maybeA == null || maybeB == null ? (_ref = maybeA != null ? maybeA : maybeB) != null ? _ref : {} : Object.assign({}, maybeA, maybeB); + } +},264,[6,260],"node_modules\\react-native\\Libraries\\NativeComponent\\ViewConfig.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + function codegenNativeCommands(options) { + var commandObj = {}; + options.supportedCommands.forEach(function (command) { + // $FlowFixMe[missing-local-annot] + commandObj[command] = function (ref) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + // $FlowFixMe[incompatible-call] + _$$_REQUIRE(_dependencyMap[0], "../ReactNative/RendererProxy").dispatchCommand(ref, command, args); + }; + }); + return commandObj; + } + var _default = exports.default = codegenNativeCommands; +},265,[61],"node_modules\\react-native\\Libraries\\Utilities\\codegenNativeCommands.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + /** + * This type should be used as the type for anything that is a color. It is + * most useful when using DynamicColorIOS which can be a string or a dynamic + * color object. + * + * type props = {backgroundColor: ColorValue}; + */ + + /** + * This type should be used as the type for a prop that is passed through + * to a 's `style` prop. This ensures call sites of the component + * can't pass styles that View doesn't support such as `fontSize`.` + * + * type Props = {style: ViewStyleProp} + * const MyComponent = (props: Props) => + */ + + /** + * This type should be used as the type for a prop that is passed through + * to a 's `style` prop. This ensures call sites of the component + * can't pass styles that Text doesn't support such as `resizeMode`.` + * + * type Props = {style: TextStyleProp} + * const MyComponent = (props: Props) => + */ + + /** + * This type should be used as the type for a prop that is passed through + * to an 's `style` prop. This ensures call sites of the component + * can't pass styles that Image doesn't support such as `fontSize`.` + * + * type Props = {style: ImageStyleProp} + * const MyComponent = (props: Props) => + */ + + /** + * WARNING: You probably shouldn't be using this type. This type + * is similar to the ones above except it allows styles that are accepted + * by all of View, Text, or Image. It is therefore very unsafe to pass this + * through to an underlying component. Using this is almost always a mistake + * and using one of the other more restrictive types is likely the right choice. + */ + + /** + * Utility type for getting the values for specific style keys. + * + * The following is bad because position is more restrictive than 'string': + * ``` + * type Props = {position: string}; + * ``` + * + * You should use the following instead: + * + * ``` + * type Props = {position: TypeForStyleKey<'position'>}; + * ``` + * + * This will correctly give you the type 'absolute' | 'relative' + */ + + /** + * This type is an object of the different possible style + * properties that can be specified for View. + * + * Note that this isn't a safe way to type a style prop for a component as + * results from StyleSheet.create return an internal identifier, not + * an object of styles. + * + * If you want to type the style prop of a function, + * consider using ViewStyleProp. + * + * A reasonable usage of this type is for helper functions that return an + * object of styles to pass to a View that can't be precomputed with + * StyleSheet.create. + */ + + /** + * This type is an object of the different possible style + * properties that can be specified for Text. + * + * Note that this isn't a safe way to type a style prop for a component as + * results from StyleSheet.create return an internal identifier, not + * an object of styles. + * + * If you want to type the style prop of a function, + * consider using TextStyleProp. + * + * A reasonable usage of this type is for helper functions that return an + * object of styles to pass to a Text that can't be precomputed with + * StyleSheet.create. + */ + + /** + * This type is an object of the different possible style + * properties that can be specified for Image. + * + * Note that this isn't a safe way to type a style prop for a component as + * results from StyleSheet.create return an internal identifier, not + * an object of styles. + * + * If you want to type the style prop of a function, + * consider using ImageStyleProp. + * + * A reasonable usage of this type is for helper functions that return an + * object of styles to pass to an Image that can't be precomputed with + * StyleSheet.create. + */ + + /** + * WARNING: You probably shouldn't be using this type. This type is an object + * with all possible style keys and their values. Note that this isn't + * a safe way to type a style prop for a component as results from + * StyleSheet.create return an internal identifier, not an object of styles. + * + * If you want to type the style prop of a function, consider using + * ViewStyleProp, TextStyleProp, or ImageStyleProp. + * + * This should only be used by very core utilities that operate on an object + * containing any possible style value. + */ + + var hairlineWidth = _$$_REQUIRE(_dependencyMap[0], "../Utilities/PixelRatio").default.roundToNearestPixel(0.4); + if (hairlineWidth === 0) { + hairlineWidth = 1 / _$$_REQUIRE(_dependencyMap[0], "../Utilities/PixelRatio").default.get(); + } + var absoluteFill = { + position: 'absolute', + left: 0, + right: 0, + top: 0, + bottom: 0 + }; + if (__DEV__) { + Object.freeze(absoluteFill); + } + + /** + * A StyleSheet is an abstraction similar to CSS StyleSheets + * + * Create a new StyleSheet: + * + * ``` + * const styles = StyleSheet.create({ + * container: { + * borderRadius: 4, + * borderWidth: 0.5, + * borderColor: '#d6d7da', + * }, + * title: { + * fontSize: 19, + * fontWeight: 'bold', + * }, + * activeTitle: { + * color: 'red', + * }, + * }); + * ``` + * + * Use a StyleSheet: + * + * ``` + * + * + * + * ``` + * + * Code quality: + * + * - By moving styles away from the render function, you're making the code + * easier to understand. + * - Naming the styles is a good way to add meaning to the low level components + * in the render function. + * + * Performance: + * + * - Making a stylesheet from a style object makes it possible to refer to it + * by ID instead of creating a new style object every time. + * - It also allows to send the style only once through the bridge. All + * subsequent uses are going to refer an id (not implemented yet). + */ + module.exports = { + /** + * This is defined as the width of a thin line on the platform. It can be + * used as the thickness of a border or division between two elements. + * Example: + * ``` + * { + * borderBottomColor: '#bbb', + * borderBottomWidth: StyleSheet.hairlineWidth + * } + * ``` + * + * This constant will always be a round number of pixels (so a line defined + * by it look crisp) and will try to match the standard width of a thin line + * on the underlying platform. However, you should not rely on it being a + * constant size, because on different platforms and screen densities its + * value may be calculated differently. + * + * A line with hairline width may not be visible if your simulator is downscaled. + */ + hairlineWidth: hairlineWidth, + /** + * A very common pattern is to create overlays with position absolute and zero positioning, + * so `absoluteFill` can be used for convenience and to reduce duplication of these repeated + * styles. + */ + absoluteFill: absoluteFill, + // TODO: This should be updated after we fix downstream Flow sites. + + /** + * Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be + * used to create a customized entry in a `StyleSheet`, e.g.: + * + * const styles = StyleSheet.create({ + * wrapper: { + * ...StyleSheet.absoluteFillObject, + * top: 10, + * backgroundColor: 'transparent', + * }, + * }); + */ + absoluteFillObject: absoluteFill, + /** + * Combines two styles such that `style2` will override any styles in `style1`. + * If either style is falsy, the other one is returned without allocating an + * array, saving allocations and maintaining reference equality for + * PureComponent checks. + */ + compose: function compose(style1, style2) { + if (style1 != null && style2 != null) { + return [style1, style2]; + } else { + return style1 != null ? style1 : style2; + } + }, + /** + * Flattens an array of style objects, into one aggregated style object. + * Alternatively, this method can be used to lookup IDs, returned by + * StyleSheet.register. + * + * > **NOTE**: Exercise caution as abusing this can tax you in terms of + * > optimizations. + * > + * > IDs enable optimizations through the bridge and memory in general. Referring + * > to style objects directly will deprive you of these optimizations. + * + * Example: + * ``` + * const styles = StyleSheet.create({ + * listItem: { + * flex: 1, + * fontSize: 16, + * color: 'white' + * }, + * selectedListItem: { + * color: 'green' + * } + * }); + * + * StyleSheet.flatten([styles.listItem, styles.selectedListItem]) + * // returns { flex: 1, fontSize: 16, color: 'green' } + * ``` + * Alternative use: + * ``` + * StyleSheet.flatten(styles.listItem); + * // return { flex: 1, fontSize: 16, color: 'white' } + * // Simply styles.listItem would return its ID (number) + * ``` + * This method internally uses `StyleSheetRegistry.getStyleByID(style)` + * to resolve style objects represented by IDs. Thus, an array of style + * objects (instances of StyleSheet.create), are individually resolved to, + * their respective objects, merged as one and then returned. This also explains + * the alternative use. + */ + flatten: _$$_REQUIRE(_dependencyMap[1], "./flattenStyle"), + /** + * WARNING: EXPERIMENTAL. Breaking changes will probably happen a lot and will + * not be reliably announced. The whole thing might be deleted, who knows? Use + * at your own risk. + * + * Sets a function to use to pre-process a style property value. This is used + * internally to process color and transform values. You should not use this + * unless you really know what you are doing and have exhausted other options. + */ + setStyleAttributePreprocessor: function setStyleAttributePreprocessor(property, process) { + var _ReactNativeStyleAttr, _ReactNativeStyleAttr2; + var value; + if (_$$_REQUIRE(_dependencyMap[2], "../Components/View/ReactNativeStyleAttributes")[property] === true) { + value = { + process: process + }; + } else if (typeof _$$_REQUIRE(_dependencyMap[2], "../Components/View/ReactNativeStyleAttributes")[property] === 'object') { + value = Object.assign({}, _$$_REQUIRE(_dependencyMap[2], "../Components/View/ReactNativeStyleAttributes")[property], { + process: process + }); + } else { + console.error(`${property} is not a valid style attribute`); + return; + } + if (__DEV__ && typeof value.process === 'function' && typeof ((_ReactNativeStyleAttr = _$$_REQUIRE(_dependencyMap[2], "../Components/View/ReactNativeStyleAttributes")[property]) == null ? void 0 : _ReactNativeStyleAttr.process) === 'function' && value.process !== ((_ReactNativeStyleAttr2 = _$$_REQUIRE(_dependencyMap[2], "../Components/View/ReactNativeStyleAttributes")[property]) == null ? void 0 : _ReactNativeStyleAttr2.process)) { + console.warn(`Overwriting ${property} style attribute preprocessor`); + } + _$$_REQUIRE(_dependencyMap[2], "../Components/View/ReactNativeStyleAttributes")[property] = value; + }, + /** + * Creates a StyleSheet style reference from the given object. + */ + // $FlowFixMe[unsupported-variance-annotation] + create: function create(obj) { + // TODO: This should return S as the return type. But first, + // we need to codemod all the callsites that are typing this + // return value as a number (even though it was opaque). + if (__DEV__) { + for (var _key in obj) { + if (obj[_key]) { + Object.freeze(obj[_key]); + } + } + } + return obj; + } + }; +},266,[254,222,213],"node_modules\\react-native\\Libraries\\StyleSheet\\StyleSheet.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = DevtoolsOverlay; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../Components/View/View")); + var _ReactNativeFeatureFlags = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../ReactNative/ReactNativeFeatureFlags")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../StyleSheet/StyleSheet")); + var _Dimensions = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../Utilities/Dimensions")); + var _ElementBox = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./ElementBox")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[8], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Inspector\\DevtoolsOverlay.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + var useEffect = React.useEffect, + useState = React.useState, + useCallback = React.useCallback, + useRef = React.useRef; + var hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; + function DevtoolsOverlay(_ref) { + var inspectedView = _ref.inspectedView; + var _useState = useState(null), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + inspected = _useState2[0], + setInspected = _useState2[1]; + var _useState3 = useState(false), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + isInspecting = _useState4[0], + setIsInspecting = _useState4[1]; + var devToolsAgentRef = useRef(null); + useEffect(function () { + var devToolsAgent = null; + var hideTimeoutId = null; + function onAgentHideNativeHighlight() { + // we wait to actually hide in order to avoid flicker + clearTimeout(hideTimeoutId); + hideTimeoutId = setTimeout(function () { + setInspected(null); + }, 100); + } + function onAgentShowNativeHighlight(node) { + var _ref2, _ref3; + clearTimeout(hideTimeoutId); + + // `canonical.publicInstance` => Fabric + // `canonical` => Legacy Fabric + // `node` => Legacy renderer + var component = (_ref2 = (_ref3 = node.canonical && node.canonical.publicInstance) != null ? _ref3 : + // TODO: remove this check when syncing the new version of the renderer from React to React Native. + node.canonical) != null ? _ref2 : node; + if (!component || !component.measure) { + return; + } + component.measure(function (x, y, width, height, left, top) { + setInspected({ + frame: { + left: left, + top: top, + width: width, + height: height + } + }); + }); + } + function cleanup() { + var currentAgent = devToolsAgent; + if (currentAgent != null) { + currentAgent.removeListener('hideNativeHighlight', onAgentHideNativeHighlight); + currentAgent.removeListener('showNativeHighlight', onAgentShowNativeHighlight); + currentAgent.removeListener('shutdown', cleanup); + currentAgent.removeListener('startInspectingNative', onStartInspectingNative); + currentAgent.removeListener('stopInspectingNative', onStopInspectingNative); + devToolsAgent = null; + } + devToolsAgentRef.current = null; + } + function onStartInspectingNative() { + setIsInspecting(true); + } + function onStopInspectingNative() { + setIsInspecting(false); + } + function _attachToDevtools(agent) { + devToolsAgent = agent; + devToolsAgentRef.current = agent; + agent.addListener('hideNativeHighlight', onAgentHideNativeHighlight); + agent.addListener('showNativeHighlight', onAgentShowNativeHighlight); + agent.addListener('shutdown', cleanup); + agent.addListener('startInspectingNative', onStartInspectingNative); + agent.addListener('stopInspectingNative', onStopInspectingNative); + } + hook.on('react-devtools', _attachToDevtools); + if (hook.reactDevtoolsAgent) { + _attachToDevtools(hook.reactDevtoolsAgent); + } + return function () { + hook.off('react-devtools', _attachToDevtools); + cleanup(); + }; + }, []); + var findViewForLocation = useCallback(function (x, y) { + var agent = devToolsAgentRef.current; + if (agent == null) { + return; + } + _$$_REQUIRE(_dependencyMap[9], "./getInspectorDataForViewAtPoint")(inspectedView, x, y, function (viewData) { + var touchedViewTag = viewData.touchedViewTag, + closestInstance = viewData.closestInstance, + frame = viewData.frame; + if (closestInstance != null || touchedViewTag != null) { + // We call `selectNode` for both non-fabric(viewTag) and fabric(instance), + // this makes sure it works for both architectures. + agent.selectNode(_$$_REQUIRE(_dependencyMap[10], "../ReactNative/RendererProxy").findNodeHandle(touchedViewTag)); + if (closestInstance != null) { + agent.selectNode(closestInstance); + } + setInspected({ + frame: frame + }); + return true; + } + return false; + }); + }, [inspectedView]); + var stopInspecting = useCallback(function () { + var agent = devToolsAgentRef.current; + if (agent == null) { + return; + } + agent.stopInspectingNative(true); + setIsInspecting(false); + setInspected(null); + }, []); + var onPointerMove = useCallback(function (e) { + findViewForLocation(e.nativeEvent.x, e.nativeEvent.y); + }, [findViewForLocation]); + var onResponderMove = useCallback(function (e) { + findViewForLocation(e.nativeEvent.touches[0].locationX, e.nativeEvent.touches[0].locationY); + }, [findViewForLocation]); + var shouldSetResponder = useCallback(function (e) { + onResponderMove(e); + return true; + }, [onResponderMove]); + var highlight = inspected ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ElementBox.default, { + frame: inspected.frame + }) : null; + if (isInspecting) { + var events = + // Pointer events only work on fabric + _ReactNativeFeatureFlags.default.shouldEmitW3CPointerEvents() ? { + onPointerMove: onPointerMove, + onPointerDown: onPointerMove, + onPointerUp: stopInspecting + } : { + onStartShouldSetResponder: shouldSetResponder, + onResponderMove: onResponderMove, + onResponderRelease: stopInspecting + }; + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, Object.assign({ + nativeID: "devToolsInspectorOverlay", + style: [styles.inspector, { + height: _Dimensions.default.get('window').height + }] + }, events, { + children: highlight + })); + } + return highlight; + } + var styles = _StyleSheet.default.create({ + inspector: { + backgroundColor: 'transparent', + position: 'absolute', + left: 0, + top: 0, + right: 0 + } + }); +},267,[6,7,241,157,266,255,268,65,106,273,61],"node_modules\\react-native\\Libraries\\Inspector\\DevtoolsOverlay.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _reactJsxRuntime = _$$_REQUIRE(_dependencyMap[0], "react/jsx-runtime"); + var _classCallCheck = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass"); + var _possibleConstructorReturn = _$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn"); + var _getPrototypeOf = _$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf"); + var _inherits = _$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Inspector\\ElementBox.js"; + function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + var React = _$$_REQUIRE(_dependencyMap[6], "react"); + var ElementBox = /*#__PURE__*/function (_React$Component) { + function ElementBox() { + _classCallCheck(this, ElementBox); + return _callSuper(this, ElementBox, arguments); + } + _inherits(ElementBox, _React$Component); + return _createClass(ElementBox, [{ + key: "render", + value: function render() { + // $FlowFixMe[underconstrained-implicit-instantiation] + var style = _$$_REQUIRE(_dependencyMap[7], "../StyleSheet/flattenStyle")(this.props.style) || {}; + var margin = _$$_REQUIRE(_dependencyMap[8], "./resolveBoxStyle")('margin', style); + var padding = _$$_REQUIRE(_dependencyMap[8], "./resolveBoxStyle")('padding', style); + var frameStyle = Object.assign({}, this.props.frame); + var contentStyle = { + width: this.props.frame.width, + height: this.props.frame.height + }; + if (margin != null) { + margin = resolveRelativeSizes(margin); + frameStyle.top -= margin.top; + frameStyle.left -= margin.left; + frameStyle.height += margin.top + margin.bottom; + frameStyle.width += margin.left + margin.right; + if (margin.top < 0) { + contentStyle.height += margin.top; + } + if (margin.bottom < 0) { + contentStyle.height += margin.bottom; + } + if (margin.left < 0) { + contentStyle.width += margin.left; + } + if (margin.right < 0) { + contentStyle.width += margin.right; + } + } + if (padding != null) { + padding = resolveRelativeSizes(padding); + contentStyle.width -= padding.left + padding.right; + contentStyle.height -= padding.top + padding.bottom; + } + return /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Components/View/View"), { + style: [styles.frame, frameStyle], + pointerEvents: "none", + children: /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[10], "./BorderBox"), { + box: margin, + style: styles.margin, + children: /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[10], "./BorderBox"), { + box: padding, + style: styles.padding, + children: /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Components/View/View"), { + style: [styles.content, contentStyle] + }) + }) + }) + }); + } + }]); + }(React.Component); + var styles = _$$_REQUIRE(_dependencyMap[11], "../StyleSheet/StyleSheet").create({ + frame: { + position: 'absolute' + }, + content: { + backgroundColor: 'rgba(200, 230, 255, 0.8)' // blue + }, + padding: { + borderColor: 'rgba(77, 255, 0, 0.3)' // green + }, + margin: { + borderColor: 'rgba(255, 132, 0, 0.3)' // orange + } + }); + /** + * Resolves relative sizes (percentages and auto) in a style object. + * + * @param style the style to resolve + * @return a modified copy + */ + function resolveRelativeSizes(style) { + var resolvedStyle = Object.assign({}, style); + resolveSizeInPlace(resolvedStyle, 'top', 'height'); + resolveSizeInPlace(resolvedStyle, 'right', 'width'); + resolveSizeInPlace(resolvedStyle, 'bottom', 'height'); + resolveSizeInPlace(resolvedStyle, 'left', 'width'); + return resolvedStyle; + } + + /** + * Resolves the given size of a style object in place. + * + * @param style the style object to modify + * @param direction the direction to resolve (e.g. 'top') + * @param dimension the window dimension that this direction belongs to (e.g. 'height') + */ + function resolveSizeInPlace(style, direction, dimension) { + if (style[direction] !== null && typeof style[direction] === 'string') { + if (style[direction].indexOf('%') !== -1) { + // $FlowFixMe[prop-missing] + style[direction] = parseFloat(style[direction]) / 100.0 * _$$_REQUIRE(_dependencyMap[12], "../Utilities/Dimensions").default.get('window')[dimension]; + } + if (style[direction] === 'auto') { + // Ignore auto sizing in frame drawing due to complexity of correctly rendering this + // $FlowFixMe[prop-missing] + style[direction] = 0; + } + } + } + module.exports = ElementBox; +},268,[106,18,19,23,25,28,65,222,269,241,272,266,255],"node_modules\\react-native\\Libraries\\Inspector\\ElementBox.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * Resolve a style property into its component parts. + * + * For example: + * + * > resolveProperties('margin', {margin: 5, marginBottom: 10}) + * {top: 5, left: 5, right: 5, bottom: 10} + * + * If no parts exist, this returns null. + */ + function resolveBoxStyle(prefix, style) { + var hasParts = false; + var result = { + bottom: 0, + left: 0, + right: 0, + top: 0 + }; + + // TODO: Fix issues with multiple properties affecting the same side. + + var styleForAll = style[prefix]; + if (styleForAll != null) { + for (var key of Object.keys(result)) { + result[key] = styleForAll; + } + hasParts = true; + } + var styleForHorizontal = style[prefix + 'Horizontal']; + if (styleForHorizontal != null) { + result.left = styleForHorizontal; + result.right = styleForHorizontal; + hasParts = true; + } else { + var styleForLeft = style[prefix + 'Left']; + if (styleForLeft != null) { + result.left = styleForLeft; + hasParts = true; + } + var styleForRight = style[prefix + 'Right']; + if (styleForRight != null) { + result.right = styleForRight; + hasParts = true; + } + var styleForEnd = style[prefix + 'End']; + if (styleForEnd != null) { + var constants = _$$_REQUIRE(_dependencyMap[0], "../ReactNative/I18nManager").getConstants(); + if (constants.isRTL && constants.doLeftAndRightSwapInRTL) { + result.left = styleForEnd; + } else { + result.right = styleForEnd; + } + hasParts = true; + } + var styleForStart = style[prefix + 'Start']; + if (styleForStart != null) { + var _constants = _$$_REQUIRE(_dependencyMap[0], "../ReactNative/I18nManager").getConstants(); + if (_constants.isRTL && _constants.doLeftAndRightSwapInRTL) { + result.right = styleForStart; + } else { + result.left = styleForStart; + } + hasParts = true; + } + } + var styleForVertical = style[prefix + 'Vertical']; + if (styleForVertical != null) { + result.bottom = styleForVertical; + result.top = styleForVertical; + hasParts = true; + } else { + var styleForBottom = style[prefix + 'Bottom']; + if (styleForBottom != null) { + result.bottom = styleForBottom; + hasParts = true; + } + var styleForTop = style[prefix + 'Top']; + if (styleForTop != null) { + result.top = styleForTop; + hasParts = true; + } + } + return hasParts ? result : null; + } + module.exports = resolveBoxStyle; +},269,[270],"node_modules\\react-native\\Libraries\\Inspector\\resolveBoxStyle.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _NativeI18nManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./NativeI18nManager")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var i18nConstants = getI18nManagerConstants(); + function getI18nManagerConstants() { + if (_NativeI18nManager.default) { + var _NativeI18nManager$ge = _NativeI18nManager.default.getConstants(), + isRTL = _NativeI18nManager$ge.isRTL, + doLeftAndRightSwapInRTL = _NativeI18nManager$ge.doLeftAndRightSwapInRTL, + localeIdentifier = _NativeI18nManager$ge.localeIdentifier; + return { + isRTL: isRTL, + doLeftAndRightSwapInRTL: doLeftAndRightSwapInRTL, + localeIdentifier: localeIdentifier + }; + } + return { + isRTL: false, + doLeftAndRightSwapInRTL: true + }; + } + module.exports = { + getConstants: function getConstants() { + return i18nConstants; + }, + allowRTL: function allowRTL(shouldAllow) { + if (!_NativeI18nManager.default) { + return; + } + _NativeI18nManager.default.allowRTL(shouldAllow); + }, + forceRTL: function forceRTL(shouldForce) { + if (!_NativeI18nManager.default) { + return; + } + _NativeI18nManager.default.forceRTL(shouldForce); + }, + swapLeftAndRightInRTL: function swapLeftAndRightInRTL(flipStyles) { + if (!_NativeI18nManager.default) { + return; + } + _NativeI18nManager.default.swapLeftAndRightInRTL(flipStyles); + }, + isRTL: i18nConstants.isRTL, + doLeftAndRightSwapInRTL: i18nConstants.doLeftAndRightSwapInRTL + }; +},270,[6,271],"node_modules\\react-native\\Libraries\\ReactNative\\I18nManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('I18nManager'); +},271,[36],"node_modules\\react-native\\Libraries\\ReactNative\\NativeI18nManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _reactJsxRuntime = _$$_REQUIRE(_dependencyMap[0], "react/jsx-runtime"); + var _classCallCheck = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass"); + var _possibleConstructorReturn = _$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn"); + var _getPrototypeOf = _$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf"); + var _inherits = _$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Inspector\\BorderBox.js"; + function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + var React = _$$_REQUIRE(_dependencyMap[6], "react"); + var BorderBox = /*#__PURE__*/function (_React$Component) { + function BorderBox() { + _classCallCheck(this, BorderBox); + return _callSuper(this, BorderBox, arguments); + } + _inherits(BorderBox, _React$Component); + return _createClass(BorderBox, [{ + key: "render", + value: function render() { + var box = this.props.box; + if (!box) { + return this.props.children; + } + var style = { + borderTopWidth: box.top, + borderBottomWidth: box.bottom, + borderLeftWidth: box.left, + borderRightWidth: box.right + }; + return /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[7], "../Components/View/View"), { + style: [style, this.props.style], + children: this.props.children + }); + } + }]); + }(React.Component); + module.exports = BorderBox; +},272,[106,18,19,23,25,28,65,241],"node_modules\\react-native\\Libraries\\Inspector\\BorderBox.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var React = _$$_REQUIRE(_dependencyMap[0], "react"); + var hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; + var renderers = findRenderers(); + function findRenderers() { + var allRenderers = Array.from(hook.renderers.values()); + _$$_REQUIRE(_dependencyMap[1], "invariant")(allRenderers.length >= 1, 'Expected to find at least one React Native renderer on DevTools hook.'); + return allRenderers; + } + module.exports = function getInspectorDataForViewAtPoint(inspectedView, locationX, locationY, callback) { + var shouldBreak = false; + // Check all renderers for inspector data. + for (var i = 0; i < renderers.length; i++) { + var _renderer$rendererCon; + if (shouldBreak) { + break; + } + var renderer = renderers[i]; + if ((renderer == null ? void 0 : (_renderer$rendererCon = renderer.rendererConfig) == null ? void 0 : _renderer$rendererCon.getInspectorDataForViewAtPoint) != null) { + renderer.rendererConfig.getInspectorDataForViewAtPoint(inspectedView, locationX, locationY, function (viewData) { + // Only return with non-empty view data since only one renderer will have this view. + if (viewData && viewData.hierarchy.length > 0) { + shouldBreak = callback(viewData); + } + }); + } + } + }; +},273,[65,37],"node_modules\\react-native\\Libraries\\Inspector\\getInspectorDataForViewAtPoint.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = TraceUpdateOverlay; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _UIManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../ReactNative/UIManager")); + var _processColor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/processColor")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../StyleSheet/StyleSheet")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../../Utilities/Platform")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../View/View")); + var _TraceUpdateOverlayNativeComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7], "./TraceUpdateOverlayNativeComponent")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[9], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Components\\TraceUpdateOverlay\\TraceUpdateOverlay.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + var useEffect = React.useEffect, + useRef = React.useRef, + useState = React.useState; + var hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; + var isNativeComponentReady = _Platform.default.OS === 'android' && _UIManager.default.hasViewManagerConfig('TraceUpdateOverlay'); + var devToolsAgent; + function TraceUpdateOverlay() { + var _useState = useState(false), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + overlayDisabled = _useState2[0], + setOverlayDisabled = _useState2[1]; + // This effect is designed to be explicitly shown here to avoid re-subscribe from the same + // overlay component. + useEffect(function () { + if (!isNativeComponentReady) { + return; + } + function attachToDevtools(agent) { + devToolsAgent = agent; + agent.addListener('drawTraceUpdates', onAgentDrawTraceUpdates); + agent.addListener('disableTraceUpdates', onAgentDisableTraceUpdates); + } + function subscribe() { + hook == null ? void 0 : hook.on('react-devtools', attachToDevtools); + if (hook != null && hook.reactDevtoolsAgent) { + attachToDevtools(hook.reactDevtoolsAgent); + } + } + function unsubscribe() { + hook == null ? void 0 : hook.off('react-devtools', attachToDevtools); + var agent = devToolsAgent; + if (agent != null) { + agent.removeListener('drawTraceUpdates', onAgentDrawTraceUpdates); + agent.removeListener('disableTraceUpdates', onAgentDisableTraceUpdates); + devToolsAgent = null; + } + } + function onAgentDrawTraceUpdates() { + var nodesToDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + // If overlay is disabled before, now it's enabled. + setOverlayDisabled(false); + var newFramesToDraw = []; + nodesToDraw.forEach(function (_ref) { + var _ref2, _ref3; + var node = _ref.node, + color = _ref.color; + // `canonical.publicInstance` => Fabric + // TODO: remove this check when syncing the new version of the renderer from React to React Native. + // `canonical` => Legacy Fabric + // `node` => Legacy renderer + var component = (_ref2 = (_ref3 = node.canonical && node.canonical.publicInstance) != null ? _ref3 : node.canonical) != null ? _ref2 : node; + if (!component || !component.measure) { + return; + } + var frameToDrawPromise = new Promise(function (resolve) { + // The if statement here is to make flow happy + if (component.measure) { + // TODO(T145522797): We should refactor this to use `getBoundingClientRect` when Paper is no longer supported. + component.measure(function (x, y, width, height, left, top) { + resolve({ + rect: { + left: left, + top: top, + width: width, + height: height + }, + color: (0, _processColor.default)(color) + }); + }); + } + }); + newFramesToDraw.push(frameToDrawPromise); + }); + Promise.all(newFramesToDraw).then(function (results) { + if (nativeComponentRef.current != null) { + _TraceUpdateOverlayNativeComponent.Commands.draw(nativeComponentRef.current, JSON.stringify(results.filter(function (_ref4) { + var rect = _ref4.rect, + color = _ref4.color; + return rect.width >= 0 && rect.height >= 0; + }))); + } + }, function (err) { + console.error(`Failed to measure updated traces. Error: ${err}`); + }); + } + function onAgentDisableTraceUpdates() { + // When trace updates are disabled from the backend, we won't receive draw events until it's enabled by the next draw. We can safely remove the overlay as it's not needed now. + setOverlayDisabled(true); + } + subscribe(); + return unsubscribe; + }, []); // Only run once when the overlay initially rendered + + var nativeComponentRef = useRef(null); + return !overlayDisabled && isNativeComponentReady && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + pointerEvents: "none", + style: styles.overlay, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TraceUpdateOverlayNativeComponent.default, { + ref: nativeComponentRef, + style: styles.overlay + }) + }); + } + var styles = _StyleSheet.default.create({ + overlay: { + position: 'absolute', + top: 0, + bottom: 0, + left: 0, + right: 0 + } + }); +},274,[6,7,51,189,266,34,241,275,65,106],"node_modules\\react-native\\Libraries\\Components\\TraceUpdateOverlay\\TraceUpdateOverlay.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.__INTERNAL_VIEW_CONFIG = exports.Commands = void 0; + var _codegenNativeCommands = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Utilities/codegenNativeCommands")); + var _codegenNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Utilities/codegenNativeComponent")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var nativeComponentName = 'TraceUpdateOverlay'; + var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = { + uiViewClassName: 'TraceUpdateOverlay', + validAttributes: {} + }; + var _default = exports.default = _$$_REQUIRE(_dependencyMap[4], "react-native/Libraries/NativeComponent/NativeComponentRegistry").get(nativeComponentName, function () { + return __INTERNAL_VIEW_CONFIG; + }); + var Commands = exports.Commands = { + draw: function draw(ref, overlays) { + _$$_REQUIRE(_dependencyMap[5], "react-native/Libraries/ReactNative/RendererProxy").dispatchCommand(ref, "draw", [overlays]); + } + }; +},275,[6,265,276,65,244,61],"node_modules\\react-native\\Libraries\\Components\\TraceUpdateOverlay\\TraceUpdateOverlayNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _requireNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Libraries/ReactNative/requireNativeComponent")); + var _UIManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../ReactNative/UIManager")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + // TODO: move this file to shims/ReactNative (requires React update and sync) + + // TODO: import from CodegenSchema once workspaces are enabled + + // If this function runs then that means the view configs were not + // generated at build time using `GenerateViewConfigJs.js`. Thus + // we need to `requireNativeComponent` to get the view configs from view managers. + // `requireNativeComponent` is not available in Bridgeless mode. + // e.g. This function runs at runtime if `codegenNativeComponent` was not called + // from a file suffixed with NativeComponent.js. + function codegenNativeComponent(componentName, options) { + if (global.RN$Bridgeless === true) { + var errorMessage = "Native Component '" + componentName + "' that calls codegenNativeComponent was not code generated at build time. Please check its definition."; + console.error(errorMessage); + } + var componentNameInUse = options && options.paperComponentName != null ? options.paperComponentName : componentName; + if (options != null && options.paperComponentNameDeprecated != null) { + if (_UIManager.default.hasViewManagerConfig(componentName)) { + componentNameInUse = componentName; + } else if (options.paperComponentNameDeprecated != null && _UIManager.default.hasViewManagerConfig(options.paperComponentNameDeprecated)) { + // $FlowFixMe[incompatible-type] + componentNameInUse = options.paperComponentNameDeprecated; + } else { + var _options$paperCompone; + throw new Error(`Failed to find native component for either ${componentName} or ${(_options$paperCompone = options.paperComponentNameDeprecated) != null ? _options$paperCompone : '(unknown)'}`); + } + } + return (0, _requireNativeComponent.default)( + // $FlowFixMe[incompatible-call] + componentNameInUse); + } + var _default = exports.default = codegenNativeComponent; +},276,[6,277,51],"node_modules\\react-native\\Libraries\\Utilities\\codegenNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + /** + * Creates values that can be used like React components which represent native + * view managers. You should create JavaScript modules that wrap these values so + * that the results are memoized. Example: + * + * const View = requireNativeComponent('RCTView'); + * + */ + + var requireNativeComponent = function requireNativeComponent(uiViewClassName) { + return _$$_REQUIRE(_dependencyMap[0], "../Renderer/shims/createReactNativeComponentClass")(uiViewClassName, function () { + return _$$_REQUIRE(_dependencyMap[1], "./getNativeComponentAttributes")(uiViewClassName); + }); + }; + var _default = exports.default = requireNativeComponent; +},277,[278,245],"node_modules\\react-native\\Libraries\\ReactNative\\requireNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @noformat + * + * @nolint + * @generated SignedSource<> + */ + + 'use strict'; + + var register = _$$_REQUIRE(_dependencyMap[0], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").ReactNativeViewConfigRegistry.register; + + /** + * Creates a renderable ReactNative host component. + * Use this method for view configs that are loaded from UIManager. + * Use createReactNativeComponentClass() for view configs defined within JavaScript. + * + * @param {string} config iOS View configuration. + * @private + */ + var createReactNativeComponentClass = function createReactNativeComponentClass(name, callback) { + return register(name, callback); + }; + module.exports = createReactNativeComponentClass; +},278,[279],"node_modules\\react-native\\Libraries\\Renderer\\shims\\createReactNativeComponentClass.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + // flowlint unsafe-getters-setters:off + module.exports = { + get BatchedBridge() { + return _$$_REQUIRE(_dependencyMap[0], "../BatchedBridge/BatchedBridge"); + }, + get ExceptionsManager() { + return _$$_REQUIRE(_dependencyMap[1], "../Core/ExceptionsManager"); + }, + get Platform() { + return _$$_REQUIRE(_dependencyMap[2], "../Utilities/Platform"); + }, + get RCTEventEmitter() { + return _$$_REQUIRE(_dependencyMap[3], "../EventEmitter/RCTEventEmitter"); + }, + get ReactNativeViewConfigRegistry() { + return _$$_REQUIRE(_dependencyMap[4], "../Renderer/shims/ReactNativeViewConfigRegistry"); + }, + get TextInputState() { + return _$$_REQUIRE(_dependencyMap[5], "../Components/TextInput/TextInputState"); + }, + get UIManager() { + return _$$_REQUIRE(_dependencyMap[6], "../ReactNative/UIManager"); + }, + // TODO: Remove when React has migrated to `createAttributePayload` and `diffAttributePayloads` + get deepDiffer() { + return _$$_REQUIRE(_dependencyMap[7], "../Utilities/differ/deepDiffer"); + }, + get deepFreezeAndThrowOnMutationInDev() { + return _$$_REQUIRE(_dependencyMap[8], "../Utilities/deepFreezeAndThrowOnMutationInDev"); + }, + // TODO: Remove when React has migrated to `createAttributePayload` and `diffAttributePayloads` + get flattenStyle() { + // $FlowFixMe[underconstrained-implicit-instantiation] + // $FlowFixMe[incompatible-return] + return _$$_REQUIRE(_dependencyMap[9], "../StyleSheet/flattenStyle"); + }, + get ReactFiberErrorDialog() { + return _$$_REQUIRE(_dependencyMap[10], "../Core/ReactFiberErrorDialog").default; + }, + get legacySendAccessibilityEvent() { + return _$$_REQUIRE(_dependencyMap[11], "../Components/AccessibilityInfo/legacySendAccessibilityEvent"); + }, + get RawEventEmitter() { + return _$$_REQUIRE(_dependencyMap[12], "../Core/RawEventEmitter").default; + }, + get CustomEvent() { + return _$$_REQUIRE(_dependencyMap[13], "../Events/CustomEvent").default; + }, + get createAttributePayload() { + return _$$_REQUIRE(_dependencyMap[14], "../ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload").create; + }, + get diffAttributePayloads() { + return _$$_REQUIRE(_dependencyMap[14], "../ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload").diff; + }, + get createPublicInstance() { + return _$$_REQUIRE(_dependencyMap[15], "../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance").createPublicInstance; + }, + get createPublicTextInstance() { + return _$$_REQUIRE(_dependencyMap[15], "../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance").createPublicTextInstance; + }, + get getNativeTagFromPublicInstance() { + return _$$_REQUIRE(_dependencyMap[15], "../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance").getNativeTagFromPublicInstance; + }, + get getNodeFromPublicInstance() { + return _$$_REQUIRE(_dependencyMap[15], "../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance").getNodeFromPublicInstance; + } + }; +},279,[39,87,34,280,258,281,51,285,47,222,286,50,287,288,290,291],"node_modules\\react-native\\Libraries\\ReactPrivate\\ReactNativePrivateInterface.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var RCTEventEmitter = { + register: function register(eventEmitter) { + if (global.RN$Bridgeless) { + global.RN$registerCallableModule('RCTEventEmitter', function () { + return eventEmitter; + }); + } else { + _$$_REQUIRE(_dependencyMap[0], "../BatchedBridge/BatchedBridge").registerCallableModule('RCTEventEmitter', eventEmitter); + } + } + }; + module.exports = RCTEventEmitter; +},280,[39],"node_modules\\react-native\\Libraries\\EventEmitter\\RCTEventEmitter.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + // This class is responsible for coordinating the "focused" state for + // TextInputs. All calls relating to the keyboard should be funneled + // through here. + + var React = _$$_REQUIRE(_dependencyMap[0], "react"); + var currentlyFocusedInputRef = null; + var inputs = new Set(); + function currentlyFocusedInput() { + return currentlyFocusedInputRef; + } + + /** + * Returns the ID of the currently focused text field, if one exists + * If no text field is focused it returns null + */ + function currentlyFocusedField() { + if (__DEV__) { + console.error('currentlyFocusedField is deprecated and will be removed in a future release. Use currentlyFocusedInput'); + } + return _$$_REQUIRE(_dependencyMap[1], "../../ReactNative/RendererProxy").findNodeHandle(currentlyFocusedInputRef); + } + function focusInput(textField) { + if (currentlyFocusedInputRef !== textField && textField != null) { + currentlyFocusedInputRef = textField; + } + } + function blurInput(textField) { + if (currentlyFocusedInputRef === textField && textField != null) { + currentlyFocusedInputRef = null; + } + } + function focusField(textFieldID) { + if (__DEV__) { + console.error('focusField no longer works. Use focusInput'); + } + return; + } + function blurField(textFieldID) { + if (__DEV__) { + console.error('blurField no longer works. Use blurInput'); + } + return; + } + + /** + * @param {number} TextInputID id of the text field to focus + * Focuses the specified text field + * noop if the text field was already focused or if the field is not editable + */ + function focusTextInput(textField) { + if (typeof textField === 'number') { + if (__DEV__) { + console.error('focusTextInput must be called with a host component. Passing a react tag is deprecated.'); + } + return; + } + if (textField != null) { + var _textField$currentPro; + var fieldCanBeFocused = currentlyFocusedInputRef !== textField && + // $FlowFixMe - `currentProps` is missing in `NativeMethods` + ((_textField$currentPro = textField.currentProps) == null ? void 0 : _textField$currentPro.editable) !== false; + if (!fieldCanBeFocused) { + return; + } + focusInput(textField); + if ("android" === 'ios') { + // This isn't necessarily a single line text input + // But commands don't actually care as long as the thing being passed in + // actually has a command with that name. So this should work with single + // and multiline text inputs. Ideally we'll merge them into one component + // in the future. + _$$_REQUIRE(_dependencyMap[2], "../../Components/TextInput/RCTSingelineTextInputNativeComponent").Commands.focus(textField); + } else if ("android" === 'android') { + _$$_REQUIRE(_dependencyMap[3], "../../Components/TextInput/AndroidTextInputNativeComponent").Commands.focus(textField); + } + } + } + + /** + * @param {number} textFieldID id of the text field to unfocus + * Unfocuses the specified text field + * noop if it wasn't focused + */ + function blurTextInput(textField) { + if (typeof textField === 'number') { + if (__DEV__) { + console.error('blurTextInput must be called with a host component. Passing a react tag is deprecated.'); + } + return; + } + if (currentlyFocusedInputRef === textField && textField != null) { + blurInput(textField); + if ("android" === 'ios') { + // This isn't necessarily a single line text input + // But commands don't actually care as long as the thing being passed in + // actually has a command with that name. So this should work with single + // and multiline text inputs. Ideally we'll merge them into one component + // in the future. + _$$_REQUIRE(_dependencyMap[2], "../../Components/TextInput/RCTSingelineTextInputNativeComponent").Commands.blur(textField); + } else if ("android" === 'android') { + _$$_REQUIRE(_dependencyMap[3], "../../Components/TextInput/AndroidTextInputNativeComponent").Commands.blur(textField); + } + } + } + function registerInput(textField) { + if (typeof textField === 'number') { + if (__DEV__) { + console.error('registerInput must be called with a host component. Passing a react tag is deprecated.'); + } + return; + } + inputs.add(textField); + } + function unregisterInput(textField) { + if (typeof textField === 'number') { + if (__DEV__) { + console.error('unregisterInput must be called with a host component. Passing a react tag is deprecated.'); + } + return; + } + inputs.delete(textField); + } + function isTextInput(textField) { + if (typeof textField === 'number') { + if (__DEV__) { + console.error('isTextInput must be called with a host component. Passing a react tag is deprecated.'); + } + return false; + } + return inputs.has(textField); + } + module.exports = { + currentlyFocusedInput: currentlyFocusedInput, + focusInput: focusInput, + blurInput: blurInput, + currentlyFocusedField: currentlyFocusedField, + focusField: focusField, + blurField: blurField, + focusTextInput: focusTextInput, + blurTextInput: blurTextInput, + registerInput: registerInput, + unregisterInput: unregisterInput, + isTextInput: isTextInput + }; +},281,[65,61,282,284],"node_modules\\react-native\\Libraries\\Components\\TextInput\\TextInputState.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.__INTERNAL_VIEW_CONFIG = exports.Commands = void 0; + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[1], "../../NativeComponent/NativeComponentRegistry")); + var _codegenNativeCommands = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Utilities/codegenNativeCommands")); + var _RCTTextInputViewConfig = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "./RCTTextInputViewConfig")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var Commands = exports.Commands = (0, _codegenNativeCommands.default)({ + supportedCommands: ['focus', 'blur', 'setTextAndSelection'] + }); + var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = Object.assign({ + uiViewClassName: 'RCTSinglelineTextInputView' + }, _RCTTextInputViewConfig.default); + var SinglelineTextInputNativeComponent = NativeComponentRegistry.get('RCTSinglelineTextInputView', function () { + return __INTERNAL_VIEW_CONFIG; + }); + + // flowlint-next-line unclear-type:off + var _default = exports.default = SinglelineTextInputNativeComponent; +},282,[6,244,265,283],"node_modules\\react-native\\Libraries\\Components\\TextInput\\RCTSingelineTextInputNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var RCTTextInputViewConfig = { + bubblingEventTypes: { + topBlur: { + phasedRegistrationNames: { + bubbled: 'onBlur', + captured: 'onBlurCapture' + } + }, + topChange: { + phasedRegistrationNames: { + bubbled: 'onChange', + captured: 'onChangeCapture' + } + }, + topContentSizeChange: { + phasedRegistrationNames: { + captured: 'onContentSizeChangeCapture', + bubbled: 'onContentSizeChange' + } + }, + topEndEditing: { + phasedRegistrationNames: { + bubbled: 'onEndEditing', + captured: 'onEndEditingCapture' + } + }, + topFocus: { + phasedRegistrationNames: { + bubbled: 'onFocus', + captured: 'onFocusCapture' + } + }, + topKeyPress: { + phasedRegistrationNames: { + bubbled: 'onKeyPress', + captured: 'onKeyPressCapture' + } + }, + topSubmitEditing: { + phasedRegistrationNames: { + bubbled: 'onSubmitEditing', + captured: 'onSubmitEditingCapture' + } + }, + topTouchCancel: { + phasedRegistrationNames: { + bubbled: 'onTouchCancel', + captured: 'onTouchCancelCapture' + } + }, + topTouchEnd: { + phasedRegistrationNames: { + bubbled: 'onTouchEnd', + captured: 'onTouchEndCapture' + } + }, + topTouchMove: { + phasedRegistrationNames: { + bubbled: 'onTouchMove', + captured: 'onTouchMoveCapture' + } + } + }, + directEventTypes: { + topTextInput: { + registrationName: 'onTextInput' + }, + topKeyPressSync: { + registrationName: 'onKeyPressSync' + }, + topScroll: { + registrationName: 'onScroll' + }, + topSelectionChange: { + registrationName: 'onSelectionChange' + }, + topChangeSync: { + registrationName: 'onChangeSync' + } + }, + validAttributes: Object.assign({ + fontSize: true, + fontWeight: true, + fontVariant: true, + // flowlint-next-line untyped-import:off + textShadowOffset: { + diff: _$$_REQUIRE(_dependencyMap[0], "../../Utilities/differ/sizesDiffer") + }, + allowFontScaling: true, + fontStyle: true, + textTransform: true, + textAlign: true, + fontFamily: true, + lineHeight: true, + isHighlighted: true, + writingDirection: true, + textDecorationLine: true, + textShadowRadius: true, + letterSpacing: true, + textDecorationStyle: true, + textDecorationColor: { + process: _$$_REQUIRE(_dependencyMap[1], "../../StyleSheet/processColor").default + }, + color: { + process: _$$_REQUIRE(_dependencyMap[1], "../../StyleSheet/processColor").default + }, + maxFontSizeMultiplier: true, + textShadowColor: { + process: _$$_REQUIRE(_dependencyMap[1], "../../StyleSheet/processColor").default + }, + editable: true, + inputAccessoryViewID: true, + caretHidden: true, + enablesReturnKeyAutomatically: true, + placeholderTextColor: { + process: _$$_REQUIRE(_dependencyMap[1], "../../StyleSheet/processColor").default + }, + clearButtonMode: true, + keyboardType: true, + selection: true, + returnKeyType: true, + submitBehavior: true, + mostRecentEventCount: true, + scrollEnabled: true, + selectionColor: { + process: _$$_REQUIRE(_dependencyMap[1], "../../StyleSheet/processColor").default + }, + contextMenuHidden: true, + secureTextEntry: true, + placeholder: true, + autoCorrect: true, + multiline: true, + textContentType: true, + maxLength: true, + autoCapitalize: true, + keyboardAppearance: true, + passwordRules: true, + spellCheck: true, + selectTextOnFocus: true, + text: true, + clearTextOnFocus: true, + showSoftInputOnFocus: true, + autoFocus: true, + lineBreakStrategyIOS: true, + smartInsertDelete: true + }, (0, _$$_REQUIRE(_dependencyMap[2], "../../NativeComponent/ViewConfigIgnore").ConditionallyIgnoredEventHandlers)({ + onChange: true, + onSelectionChange: true, + onContentSizeChange: true, + onScroll: true, + onChangeSync: true, + onKeyPressSync: true, + onTextInput: true + })) + }; + module.exports = RCTTextInputViewConfig; +},283,[219,189,262],"node_modules\\react-native\\Libraries\\Components\\TextInput\\RCTTextInputViewConfig.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.__INTERNAL_VIEW_CONFIG = exports.Commands = void 0; + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[1], "../../NativeComponent/NativeComponentRegistry")); + var _codegenNativeCommands = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Utilities/codegenNativeCommands")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var Commands = exports.Commands = (0, _codegenNativeCommands.default)({ + supportedCommands: ['focus', 'blur', 'setTextAndSelection'] + }); + var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = { + uiViewClassName: 'AndroidTextInput', + bubblingEventTypes: { + topBlur: { + phasedRegistrationNames: { + bubbled: 'onBlur', + captured: 'onBlurCapture' + } + }, + topEndEditing: { + phasedRegistrationNames: { + bubbled: 'onEndEditing', + captured: 'onEndEditingCapture' + } + }, + topFocus: { + phasedRegistrationNames: { + bubbled: 'onFocus', + captured: 'onFocusCapture' + } + }, + topKeyPress: { + phasedRegistrationNames: { + bubbled: 'onKeyPress', + captured: 'onKeyPressCapture' + } + }, + topSubmitEditing: { + phasedRegistrationNames: { + bubbled: 'onSubmitEditing', + captured: 'onSubmitEditingCapture' + } + }, + topTextInput: { + phasedRegistrationNames: { + bubbled: 'onTextInput', + captured: 'onTextInputCapture' + } + } + }, + directEventTypes: { + topScroll: { + registrationName: 'onScroll' + } + }, + validAttributes: { + maxFontSizeMultiplier: true, + adjustsFontSizeToFit: true, + minimumFontScale: true, + autoFocus: true, + placeholder: true, + inlineImagePadding: true, + contextMenuHidden: true, + textShadowColor: { + process: _$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/processColor").default + }, + maxLength: true, + selectTextOnFocus: true, + textShadowRadius: true, + underlineColorAndroid: { + process: _$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/processColor").default + }, + textDecorationLine: true, + submitBehavior: true, + textAlignVertical: true, + fontStyle: true, + textShadowOffset: true, + selectionColor: { + process: _$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/processColor").default + }, + placeholderTextColor: { + process: _$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/processColor").default + }, + importantForAutofill: true, + lineHeight: true, + textTransform: true, + returnKeyType: true, + keyboardType: true, + multiline: true, + color: { + process: _$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/processColor").default + }, + autoComplete: true, + numberOfLines: true, + letterSpacing: true, + returnKeyLabel: true, + fontSize: true, + onKeyPress: true, + cursorColor: { + process: _$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/processColor").default + }, + text: true, + showSoftInputOnFocus: true, + textAlign: true, + autoCapitalize: true, + autoCorrect: true, + caretHidden: true, + secureTextEntry: true, + textBreakStrategy: true, + onScroll: true, + onContentSizeChange: true, + disableFullscreenUI: true, + includeFontPadding: true, + fontWeight: true, + fontFamily: true, + allowFontScaling: true, + onSelectionChange: true, + mostRecentEventCount: true, + inlineImageLeft: true, + editable: true, + fontVariant: true, + borderBottomRightRadius: true, + borderBottomColor: { + process: _$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/processColor").default + }, + borderRadius: true, + borderRightColor: { + process: _$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/processColor").default + }, + borderColor: { + process: _$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/processColor").default + }, + borderTopRightRadius: true, + borderStyle: true, + borderBottomLeftRadius: true, + borderLeftColor: { + process: _$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/processColor").default + }, + borderTopLeftRadius: true, + borderTopColor: { + process: _$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/processColor").default + } + } + }; + var AndroidTextInputNativeComponent = NativeComponentRegistry.get('AndroidTextInput', function () { + return __INTERNAL_VIEW_CONFIG; + }); + + // flowlint-next-line unclear-type:off + var _default = exports.default = AndroidTextInputNativeComponent; +},284,[6,244,265,189],"node_modules\\react-native\\Libraries\\Components\\TextInput\\AndroidTextInputNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var logListeners; + function unstable_setLogListeners(listeners) { + logListeners = listeners; + } + + /* + * @returns {bool} true if different, false if equal + */ + var _deepDiffer = function deepDiffer(one, two) { + var maxDepthOrOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1; + var maybeOptions = arguments.length > 3 ? arguments[3] : undefined; + var options = typeof maxDepthOrOptions === 'number' ? maybeOptions : maxDepthOrOptions; + var maxDepth = typeof maxDepthOrOptions === 'number' ? maxDepthOrOptions : -1; + if (maxDepth === 0) { + return true; + } + if (one === two) { + // Short circuit on identical object references instead of traversing them. + return false; + } + if (typeof one === 'function' && typeof two === 'function') { + // We consider all functions equal unless explicitly configured otherwise + var unsafelyIgnoreFunctions = options == null ? void 0 : options.unsafelyIgnoreFunctions; + if (unsafelyIgnoreFunctions == null) { + if (logListeners && logListeners.onDifferentFunctionsIgnored && (!options || !('unsafelyIgnoreFunctions' in options))) { + logListeners.onDifferentFunctionsIgnored(one.name, two.name); + } + unsafelyIgnoreFunctions = true; + } + return !unsafelyIgnoreFunctions; + } + if (typeof one !== 'object' || one === null) { + // Primitives can be directly compared + return one !== two; + } + if (typeof two !== 'object' || two === null) { + // We know they are different because the previous case would have triggered + // otherwise. + return true; + } + if (one.constructor !== two.constructor) { + return true; + } + if (Array.isArray(one)) { + // We know two is also an array because the constructors are equal + var len = one.length; + if (two.length !== len) { + return true; + } + for (var ii = 0; ii < len; ii++) { + if (_deepDiffer(one[ii], two[ii], maxDepth - 1, options)) { + return true; + } + } + } else { + for (var key in one) { + if (_deepDiffer(one[key], two[key], maxDepth - 1, options)) { + return true; + } + } + for (var twoKey in two) { + // The only case we haven't checked yet is keys that are in two but aren't + // in one, which means they are different. + if (one[twoKey] === undefined && two[twoKey] !== undefined) { + return true; + } + } + } + return false; + }; + _deepDiffer.unstable_setLogListeners = unstable_setLogListeners; + module.exports = _deepDiffer; +},285,[],"node_modules\\react-native\\Libraries\\Utilities\\differ\\deepDiffer.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var ReactFiberErrorDialog = { + /** + * Intercept lifecycle errors and ensure they are shown with the correct stack + * trace within the native redbox component. + */ + showErrorDialog: function showErrorDialog(_ref) { + var componentStack = _ref.componentStack, + errorValue = _ref.error; + var error; + + // Typically, `errorValue` should be an error. However, other values such as + // strings (or even null) are sometimes thrown. + if (errorValue instanceof Error) { + /* $FlowFixMe[class-object-subtyping] added when improving typing for + * this parameters */ + error = errorValue; + } else if (typeof errorValue === 'string') { + /* $FlowFixMe[class-object-subtyping] added when improving typing for + * this parameters */ + error = new (_$$_REQUIRE(_dependencyMap[0], "./ExceptionsManager").SyntheticError)(errorValue); + } else { + /* $FlowFixMe[class-object-subtyping] added when improving typing for + * this parameters */ + error = new (_$$_REQUIRE(_dependencyMap[0], "./ExceptionsManager").SyntheticError)('Unspecified error'); + } + try { + error.componentStack = componentStack; + error.isComponentError = true; + } catch (_unused) { + // Ignored. + } + (0, _$$_REQUIRE(_dependencyMap[0], "./ExceptionsManager").handleException)(error, false); + + // Return false here to prevent ReactFiberErrorLogger default behavior of + // logging error details to console.error. Calls to console.error are + // automatically routed to the native redbox controller, which we've already + // done above by calling ExceptionsManager. + return false; + } + }; + var _default = exports.default = ReactFiberErrorDialog; +},286,[87],"node_modules\\react-native\\Libraries\\Core\\ReactFiberErrorDialog.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _EventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../vendor/emitter/EventEmitter")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var RawEventEmitter = new _EventEmitter.default(); + + // See the React renderer / react repo for how this is used. + // Raw events are emitted here when they are received in JS + // and before any event Plugins process them or before components + // have a chance to respond to them. This allows you to implement + // app-specific perf monitoring, which is unimplemented by default, + // making this entire RawEventEmitter do nothing by default until + // *you* add listeners for your own app. + // Besides perf monitoring and maybe debugging, this RawEventEmitter + // should not be used. + var _default = exports.default = RawEventEmitter; +},287,[6,30],"node_modules\\react-native\\Libraries\\Core\\RawEventEmitter.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/createClass")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _EventPolyfill2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./EventPolyfill")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ // Make sure global Event is defined + var CustomEvent = /*#__PURE__*/function (_EventPolyfill) { + function CustomEvent(typeArg, options) { + var _this; + (0, _classCallCheck2.default)(this, CustomEvent); + var bubbles = options.bubbles, + cancelable = options.cancelable, + composed = options.composed; + _this = _callSuper(this, CustomEvent, [typeArg, { + bubbles: bubbles, + cancelable: cancelable, + composed: composed + }]); + _this.detail = options.detail; // this would correspond to `NativeEvent` in SyntheticEvent + return _this; + } + (0, _inherits2.default)(CustomEvent, _EventPolyfill); + return (0, _createClass2.default)(CustomEvent); + }(_EventPolyfill2.default); + var _default = exports.default = CustomEvent; +},288,[6,19,18,23,25,28,289],"node_modules\\react-native\\Libraries\\Events\\CustomEvent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + // https://dom.spec.whatwg.org/#dictdef-eventinit + /** + * This is a copy of the Event interface defined in Flow: + * https://github.com/facebook/flow/blob/741104e69c43057ebd32804dd6bcc1b5e97548ea/lib/dom.js + * which is itself a faithful interface of the W3 spec: + * https://dom.spec.whatwg.org/#interface-event + * + * Since Flow assumes that Event is provided and is on the global object, + * we must provide an implementation of Event for CustomEvent (and future + * alignment of React Native's event system with the W3 spec). + */ + var EventPolyfill = /*#__PURE__*/function () { + // Non-standard. See `composed` instead. + + // https://developer.mozilla.org/en-US/docs/Web/API/Event/eventPhase + + // TODO: nullable + // TODO: nullable + /** @deprecated */ + // TODO: nullable + + // React Native-specific: proxy data to a SyntheticEvent when + // certain methods are called. + // SyntheticEvent will also have a reference to this instance - + // it is circular - and both classes use this reference to keep + // data with the other in sync. + + function EventPolyfill(type, eventInitDict) { + (0, _classCallCheck2.default)(this, EventPolyfill); + this.type = type; + this.bubbles = !!(eventInitDict != null && eventInitDict.bubbles || false); + this.cancelable = !!(eventInitDict != null && eventInitDict.cancelable || false); + this.composed = !!(eventInitDict != null && eventInitDict.composed || false); + this.scoped = !!(eventInitDict != null && eventInitDict.scoped || false); + + // TODO: somehow guarantee that only "private" instantiations of Event + // can set this to true + this.isTrusted = false; + + // TODO: in the future we'll want to make sure this has the same + // time-basis as events originating from native + this.timeStamp = Date.now(); + this.defaultPrevented = false; + + // https://developer.mozilla.org/en-US/docs/Web/API/Event/eventPhase + this.NONE = 0; + this.AT_TARGET = 1; + this.BUBBLING_PHASE = 2; + this.CAPTURING_PHASE = 3; + this.eventPhase = this.NONE; + + // $FlowFixMe + this.currentTarget = null; + // $FlowFixMe + this.target = null; + // $FlowFixMe + this.srcElement = null; + } + return (0, _createClass2.default)(EventPolyfill, [{ + key: "composedPath", + value: function composedPath() { + throw new Error('TODO: not yet implemented'); + } + }, { + key: "preventDefault", + value: function preventDefault() { + this.defaultPrevented = true; + if (this._syntheticEvent != null) { + // $FlowFixMe + this._syntheticEvent.preventDefault(); + } + } + }, { + key: "initEvent", + value: function initEvent(type, bubbles, cancelable) { + throw new Error('TODO: not yet implemented. This method is also deprecated.'); + } + }, { + key: "stopImmediatePropagation", + value: function stopImmediatePropagation() { + throw new Error('TODO: not yet implemented'); + } + }, { + key: "stopPropagation", + value: function stopPropagation() { + if (this._syntheticEvent != null) { + // $FlowFixMe + this._syntheticEvent.stopPropagation(); + } + } + }, { + key: "setSyntheticEvent", + value: function setSyntheticEvent(value) { + this._syntheticEvent = value; + } + }]); + }(); // Assertion magic for polyfill follows. + // eslint-disable-line no-unused-vars + + /*:: + // This can be a strict mode error at runtime so put it in a Flow comment. + (checkEvent: IEvent); + */ + + global.Event = EventPolyfill; + var _default = exports.default = EventPolyfill; +},289,[6,18,19],"node_modules\\react-native\\Libraries\\Events\\EventPolyfill.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.create = create; + exports.diff = diff; + var _flattenStyle = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../StyleSheet/flattenStyle")); + var _deepDiffer = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Utilities/differ/deepDiffer")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var emptyObject = {}; + + /** + * Create a payload that contains all the updates between two sets of props. + * + * These helpers are all encapsulated into a single module, because they use + * mutation as a performance optimization which leads to subtle shared + * dependencies between the code paths. To avoid this mutable state leaking + * across modules, I've kept them isolated to this module. + */ + + // Tracks removed keys + var removedKeys = null; + var removedKeyCount = 0; + var deepDifferOptions = { + unsafelyIgnoreFunctions: true + }; + function defaultDiffer(prevProp, nextProp) { + if (typeof nextProp !== 'object' || nextProp === null) { + // Scalars have already been checked for equality + return true; + } else { + // For objects and arrays, the default diffing algorithm is a deep compare + return (0, _deepDiffer.default)(prevProp, nextProp, deepDifferOptions); + } + } + function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) { + if (Array.isArray(node)) { + var i = node.length; + while (i-- && removedKeyCount > 0) { + restoreDeletedValuesInNestedArray(updatePayload, node[i], validAttributes); + } + } else if (node && removedKeyCount > 0) { + var obj = node; + for (var propKey in removedKeys) { + // $FlowFixMe[incompatible-use] found when upgrading Flow + if (!removedKeys[propKey]) { + continue; + } + var nextProp = obj[propKey]; + if (nextProp === undefined) { + continue; + } + var attributeConfig = validAttributes[propKey]; + if (!attributeConfig) { + continue; // not a valid native prop + } + if (typeof nextProp === 'function') { + // $FlowFixMe[incompatible-type] found when upgrading Flow + nextProp = true; + } + if (typeof nextProp === 'undefined') { + // $FlowFixMe[incompatible-type] found when upgrading Flow + nextProp = null; + } + if (typeof attributeConfig !== 'object') { + // case: !Object is the default case + updatePayload[propKey] = nextProp; + } else if (typeof attributeConfig.diff === 'function' || typeof attributeConfig.process === 'function') { + // case: CustomAttributeConfiguration + var nextValue = typeof attributeConfig.process === 'function' ? attributeConfig.process(nextProp) : nextProp; + updatePayload[propKey] = nextValue; + } + // $FlowFixMe[incompatible-use] found when upgrading Flow + removedKeys[propKey] = false; + removedKeyCount--; + } + } + } + function diffNestedArrayProperty(updatePayload, prevArray, nextArray, validAttributes) { + var minLength = prevArray.length < nextArray.length ? prevArray.length : nextArray.length; + var i; + for (i = 0; i < minLength; i++) { + // Diff any items in the array in the forward direction. Repeated keys + // will be overwritten by later values. + updatePayload = diffNestedProperty(updatePayload, prevArray[i], nextArray[i], validAttributes); + } + for (; i < prevArray.length; i++) { + // Clear out all remaining properties. + updatePayload = clearNestedProperty(updatePayload, prevArray[i], validAttributes); + } + for (; i < nextArray.length; i++) { + // Add all remaining properties. + updatePayload = addNestedProperty(updatePayload, nextArray[i], validAttributes); + } + return updatePayload; + } + function diffNestedProperty(updatePayload, prevProp, nextProp, validAttributes) { + if (!updatePayload && prevProp === nextProp) { + // If no properties have been added, then we can bail out quickly on object + // equality. + return updatePayload; + } + if (!prevProp || !nextProp) { + if (nextProp) { + return addNestedProperty(updatePayload, nextProp, validAttributes); + } + if (prevProp) { + return clearNestedProperty(updatePayload, prevProp, validAttributes); + } + return updatePayload; + } + if (!Array.isArray(prevProp) && !Array.isArray(nextProp)) { + // Both are leaves, we can diff the leaves. + return diffProperties(updatePayload, prevProp, nextProp, validAttributes); + } + if (Array.isArray(prevProp) && Array.isArray(nextProp)) { + // Both are arrays, we can diff the arrays. + return diffNestedArrayProperty(updatePayload, prevProp, nextProp, validAttributes); + } + if (Array.isArray(prevProp)) { + return diffProperties(updatePayload, + // $FlowFixMe - We know that this is always an object when the input is. + (0, _flattenStyle.default)(prevProp), + // $FlowFixMe - We know that this isn't an array because of above flow. + nextProp, validAttributes); + } + return diffProperties(updatePayload, prevProp, + // $FlowFixMe - We know that this is always an object when the input is. + (0, _flattenStyle.default)(nextProp), validAttributes); + } + + /** + * addNestedProperty takes a single set of props and valid attribute + * attribute configurations. It processes each prop and adds it to the + * updatePayload. + */ + function addNestedProperty(updatePayload, nextProp, validAttributes) { + if (!nextProp) { + return updatePayload; + } + if (!Array.isArray(nextProp)) { + // Add each property of the leaf. + return addProperties(updatePayload, nextProp, validAttributes); + } + for (var i = 0; i < nextProp.length; i++) { + // Add all the properties of the array. + updatePayload = addNestedProperty(updatePayload, nextProp[i], validAttributes); + } + return updatePayload; + } + + /** + * clearNestedProperty takes a single set of props and valid attributes. It + * adds a null sentinel to the updatePayload, for each prop key. + */ + function clearNestedProperty(updatePayload, prevProp, validAttributes) { + if (!prevProp) { + return updatePayload; + } + if (!Array.isArray(prevProp)) { + // Add each property of the leaf. + return clearProperties(updatePayload, prevProp, validAttributes); + } + for (var i = 0; i < prevProp.length; i++) { + // Add all the properties of the array. + updatePayload = clearNestedProperty(updatePayload, prevProp[i], validAttributes); + } + return updatePayload; + } + + /** + * diffProperties takes two sets of props and a set of valid attributes + * and write to updatePayload the values that changed or were deleted. + * If no updatePayload is provided, a new one is created and returned if + * anything changed. + */ + function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { + var attributeConfig; + var nextProp; + var prevProp; + for (var propKey in nextProps) { + attributeConfig = validAttributes[propKey]; + if (!attributeConfig) { + continue; // not a valid native prop + } + prevProp = prevProps[propKey]; + nextProp = nextProps[propKey]; + + // functions are converted to booleans as markers that the associated + // events should be sent from native. + if (typeof nextProp === 'function') { + nextProp = true; + // If nextProp is not a function, then don't bother changing prevProp + // since nextProp will win and go into the updatePayload regardless. + if (typeof prevProp === 'function') { + prevProp = true; + } + } + + // An explicit value of undefined is treated as a null because it overrides + // any other preceding value. + if (typeof nextProp === 'undefined') { + nextProp = null; + if (typeof prevProp === 'undefined') { + prevProp = null; + } + } + if (removedKeys) { + removedKeys[propKey] = false; + } + if (updatePayload && updatePayload[propKey] !== undefined) { + // Something else already triggered an update to this key because another + // value diffed. Since we're now later in the nested arrays our value is + // more important so we need to calculate it and override the existing + // value. It doesn't matter if nothing changed, we'll set it anyway. + + // Pattern match on: attributeConfig + if (typeof attributeConfig !== 'object') { + // case: !Object is the default case + updatePayload[propKey] = nextProp; + } else if (typeof attributeConfig.diff === 'function' || typeof attributeConfig.process === 'function') { + // case: CustomAttributeConfiguration + var nextValue = typeof attributeConfig.process === 'function' ? attributeConfig.process(nextProp) : nextProp; + updatePayload[propKey] = nextValue; + } + continue; + } + if (prevProp === nextProp) { + continue; // nothing changed + } + + // Pattern match on: attributeConfig + if (typeof attributeConfig !== 'object') { + // case: !Object is the default case + if (defaultDiffer(prevProp, nextProp)) { + // a normal leaf has changed + (updatePayload || (updatePayload = {}))[propKey] = nextProp; + } + } else if (typeof attributeConfig.diff === 'function' || typeof attributeConfig.process === 'function') { + // case: CustomAttributeConfiguration + var shouldUpdate = prevProp === undefined || (typeof attributeConfig.diff === 'function' ? attributeConfig.diff(prevProp, nextProp) : defaultDiffer(prevProp, nextProp)); + if (shouldUpdate) { + var _nextValue = typeof attributeConfig.process === 'function' ? + // $FlowFixMe[incompatible-use] found when upgrading Flow + attributeConfig.process(nextProp) : nextProp; + (updatePayload || (updatePayload = {}))[propKey] = _nextValue; + } + } else { + // default: fallthrough case when nested properties are defined + removedKeys = null; + removedKeyCount = 0; + // We think that attributeConfig is not CustomAttributeConfiguration at + // this point so we assume it must be AttributeConfiguration. + updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig); + if (removedKeyCount > 0 && updatePayload) { + restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig); + removedKeys = null; + } + } + } + + // Also iterate through all the previous props to catch any that have been + // removed and make sure native gets the signal so it can reset them to the + // default. + for (var _propKey in prevProps) { + if (nextProps[_propKey] !== undefined) { + continue; // we've already covered this key in the previous pass + } + attributeConfig = validAttributes[_propKey]; + if (!attributeConfig) { + continue; // not a valid native prop + } + if (updatePayload && updatePayload[_propKey] !== undefined) { + // This was already updated to a diff result earlier. + continue; + } + prevProp = prevProps[_propKey]; + if (prevProp === undefined) { + continue; // was already empty anyway + } + // Pattern match on: attributeConfig + if (typeof attributeConfig !== 'object' || typeof attributeConfig.diff === 'function' || typeof attributeConfig.process === 'function') { + // case: CustomAttributeConfiguration | !Object + // Flag the leaf property for removal by sending a sentinel. + (updatePayload || (updatePayload = {}))[_propKey] = null; + if (!removedKeys) { + removedKeys = {}; + } + if (!removedKeys[_propKey]) { + removedKeys[_propKey] = true; + removedKeyCount++; + } + } else { + // default: + // This is a nested attribute configuration where all the properties + // were removed so we need to go through and clear out all of them. + updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig); + } + } + return updatePayload; + } + + /** + * addProperties adds all the valid props to the payload after being processed. + */ + function addProperties(updatePayload, props, validAttributes) { + // TODO: Fast path + return diffProperties(updatePayload, emptyObject, props, validAttributes); + } + + /** + * clearProperties clears all the previous props by adding a null sentinel + * to the payload for each valid key. + */ + function clearProperties(updatePayload, prevProps, validAttributes) { + // TODO: Fast path + return diffProperties(updatePayload, prevProps, emptyObject, validAttributes); + } + function create(props, validAttributes) { + return addProperties(null, + // updatePayload + props, validAttributes); + } + function diff(prevProps, nextProps, validAttributes) { + return diffProperties(null, + // updatePayload + prevProps, nextProps, validAttributes); + } +},290,[6,222,285],"node_modules\\react-native\\Libraries\\ReactNative\\ReactFabricPublicInstance\\ReactNativeAttributePayload.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createPublicInstance = createPublicInstance; + exports.createPublicTextInstance = createPublicTextInstance; + exports.getNativeTagFromPublicInstance = getNativeTagFromPublicInstance; + exports.getNodeFromPublicInstance = getNodeFromPublicInstance; + var _ReactNativeFeatureFlags = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../ReactNativeFeatureFlags")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + // Lazy loaded to avoid evaluating the module when using the legacy renderer. + var PublicInstanceClass; + var ReadOnlyTextClass; + + // Lazy loaded to avoid evaluating the module when using the legacy renderer. + var ReactFabric; + function createPublicInstance(tag, viewConfig, internalInstanceHandle) { + if (PublicInstanceClass == null) { + // We don't use inline requires in react-native, so this forces lazy loading + // the right module to avoid eagerly loading both. + if (_ReactNativeFeatureFlags.default.enableAccessToHostTreeInFabric()) { + PublicInstanceClass = _$$_REQUIRE(_dependencyMap[2], "../../DOM/Nodes/ReactNativeElement").default; + } else { + PublicInstanceClass = _$$_REQUIRE(_dependencyMap[3], "./ReactFabricHostComponent").default; + } + } + return new PublicInstanceClass(tag, viewConfig, internalInstanceHandle); + } + function createPublicTextInstance(internalInstanceHandle) { + if (ReadOnlyTextClass == null) { + ReadOnlyTextClass = _$$_REQUIRE(_dependencyMap[4], "../../DOM/Nodes/ReadOnlyText").default; + } + return new ReadOnlyTextClass(internalInstanceHandle); + } + function getNativeTagFromPublicInstance(publicInstance) { + return publicInstance.__nativeTag; + } + function getNodeFromPublicInstance(publicInstance) { + // Avoid loading ReactFabric if using an instance from the legacy renderer. + if (publicInstance.__internalInstanceHandle == null) { + return null; + } + if (ReactFabric == null) { + ReactFabric = _$$_REQUIRE(_dependencyMap[5], "../../Renderer/shims/ReactFabric"); + } + return ReactFabric.getNodeFromInternalInstanceHandle(publicInstance.__internalInstanceHandle); + } +},291,[6,157,292,300,301,63],"node_modules\\react-native\\Libraries\\ReactNative\\ReactFabricPublicInstance\\ReactFabricPublicInstance.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _TextInputState = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../../Components/TextInput/TextInputState")); + var _warnForStyleProps = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../../ReactNative/ReactFabricPublicInstance/warnForStyleProps")); + var _ReadOnlyElement2 = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8], "./ReadOnlyElement")); + var _ReadOnlyNode = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9], "./ReadOnlyNode")); + var _nullthrows = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "nullthrows")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ // flowlint unsafe-getters-setters:off + var noop = function noop() {}; + var ReactNativeElement = exports.default = /*#__PURE__*/function (_ReadOnlyElement) { + // These need to be accessible from `ReactFabricPublicInstanceUtils`. + + function ReactNativeElement(tag, viewConfig, internalInstanceHandle) { + var _this; + (0, _classCallCheck2.default)(this, ReactNativeElement); + _this = _callSuper(this, ReactNativeElement, [internalInstanceHandle]); + _this.__nativeTag = tag; + _this.__internalInstanceHandle = internalInstanceHandle; + _this._viewConfig = viewConfig; + return _this; + } + (0, _inherits2.default)(ReactNativeElement, _ReadOnlyElement); + return (0, _createClass2.default)(ReactNativeElement, [{ + key: "offsetHeight", + get: function get() { + return Math.round((0, _ReadOnlyElement2.getBoundingClientRect)(this, { + includeTransform: false + }).height); + } + }, { + key: "offsetLeft", + get: function get() { + var node = (0, _ReadOnlyNode.getShadowNode)(this); + if (node != null) { + var offset = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[11], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getOffset(node); + if (offset != null) { + return Math.round(offset[2]); + } + } + return 0; + } + }, { + key: "offsetParent", + get: function get() { + var node = (0, _ReadOnlyNode.getShadowNode)(this); + if (node != null) { + var offset = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[11], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getOffset(node); + // For children of the root node we currently return offset data + // but a `null` parent because the root node is not accessible + // in JavaScript yet. + if (offset != null && offset[0] != null) { + var offsetParentInstanceHandle = offset[0]; + var offsetParent = (0, _ReadOnlyNode.getPublicInstanceFromInternalInstanceHandle)(offsetParentInstanceHandle); + // $FlowExpectedError[incompatible-type] The value returned by `getOffset` is always an instance handle for `ReadOnlyElement`. + var offsetParentElement = offsetParent; + return offsetParentElement; + } + } + return null; + } + }, { + key: "offsetTop", + get: function get() { + var node = (0, _ReadOnlyNode.getShadowNode)(this); + if (node != null) { + var offset = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[11], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getOffset(node); + if (offset != null) { + return Math.round(offset[1]); + } + } + return 0; + } + }, { + key: "offsetWidth", + get: function get() { + return Math.round((0, _ReadOnlyElement2.getBoundingClientRect)(this, { + includeTransform: false + }).width); + } + + /** + * React Native compatibility methods + */ + }, { + key: "blur", + value: function blur() { + // $FlowFixMe[incompatible-exact] Migrate all usages of `NativeMethods` to an interface to fix this. + _TextInputState.default.blurTextInput(this); + } + }, { + key: "focus", + value: function focus() { + // $FlowFixMe[incompatible-exact] Migrate all usages of `NativeMethods` to an interface to fix this. + _TextInputState.default.focusTextInput(this); + } + }, { + key: "measure", + value: function measure(callback) { + var node = (0, _ReadOnlyNode.getShadowNode)(this); + if (node != null) { + (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[11], "../../ReactNative/FabricUIManager").getFabricUIManager)()).measure(node, callback); + } + } + }, { + key: "measureInWindow", + value: function measureInWindow(callback) { + var node = (0, _ReadOnlyNode.getShadowNode)(this); + if (node != null) { + (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[11], "../../ReactNative/FabricUIManager").getFabricUIManager)()).measureInWindow(node, callback); + } + } + }, { + key: "measureLayout", + value: function measureLayout(relativeToNativeNode, onSuccess, onFail) { + if (!(relativeToNativeNode instanceof _ReadOnlyNode.default)) { + if (__DEV__) { + console.error('Warning: ref.measureLayout must be called with a ref to a native component.'); + } + return; + } + var toStateNode = (0, _ReadOnlyNode.getShadowNode)(this); + var fromStateNode = (0, _ReadOnlyNode.getShadowNode)(relativeToNativeNode); + if (toStateNode != null && fromStateNode != null) { + (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[11], "../../ReactNative/FabricUIManager").getFabricUIManager)()).measureLayout(toStateNode, fromStateNode, onFail != null ? onFail : noop, onSuccess != null ? onSuccess : noop); + } + } + }, { + key: "setNativeProps", + value: function setNativeProps(nativeProps) { + if (__DEV__) { + (0, _warnForStyleProps.default)(nativeProps, this._viewConfig.validAttributes); + } + var updatePayload = (0, _$$_REQUIRE(_dependencyMap[12], "../../ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload").create)(nativeProps, this._viewConfig.validAttributes); + var node = (0, _ReadOnlyNode.getShadowNode)(this); + if (node != null && updatePayload != null) { + (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[11], "../../ReactNative/FabricUIManager").getFabricUIManager)()).setNativeProps(node, updatePayload); + } + } + }]); + }(_ReadOnlyElement2.default); +},292,[6,18,19,23,25,28,281,293,294,295,52,58,290],"node_modules\\react-native\\Libraries\\DOM\\Nodes\\ReactNativeElement.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = warnForStyleProps; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + function warnForStyleProps(props, validAttributes) { + if (__DEV__) { + for (var key in validAttributes.style) { + if (!(validAttributes[key] || props[key] === undefined)) { + console.error('You are setting the style `{ %s' + ': ... }` as a prop. You ' + 'should nest it in a style object. ' + 'E.g. `{ style: { %s' + ': ... } }`', key, key); + } + } + } + } +},293,[],"node_modules\\react-native\\Libraries\\ReactNative\\ReactFabricPublicInstance\\warnForStyleProps.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + exports.getBoundingClientRect = _getBoundingClientRect; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _DOMRect = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../Geometry/DOMRect")); + var _ReadOnlyNode2 = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7], "./ReadOnlyNode")); + var _nullthrows = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "nullthrows")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ // flowlint unsafe-getters-setters:off + var ReadOnlyElement = exports.default = /*#__PURE__*/function (_ReadOnlyNode) { + function ReadOnlyElement() { + (0, _classCallCheck2.default)(this, ReadOnlyElement); + return _callSuper(this, ReadOnlyElement, arguments); + } + (0, _inherits2.default)(ReadOnlyElement, _ReadOnlyNode); + return (0, _createClass2.default)(ReadOnlyElement, [{ + key: "childElementCount", + get: function get() { + return getChildElements(this).length; + } + }, { + key: "children", + get: function get() { + return (0, _$$_REQUIRE(_dependencyMap[9], "../OldStyleCollections/HTMLCollection").createHTMLCollection)(getChildElements(this)); + } + }, { + key: "clientHeight", + get: function get() { + var node = (0, _ReadOnlyNode2.getShadowNode)(this); + if (node != null) { + var innerSize = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[10], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getInnerSize(node); + if (innerSize != null) { + return innerSize[1]; + } + } + return 0; + } + }, { + key: "clientLeft", + get: function get() { + var node = (0, _ReadOnlyNode2.getShadowNode)(this); + if (node != null) { + var borderSize = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[10], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getBorderSize(node); + if (borderSize != null) { + return borderSize[3]; + } + } + return 0; + } + }, { + key: "clientTop", + get: function get() { + var node = (0, _ReadOnlyNode2.getShadowNode)(this); + if (node != null) { + var borderSize = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[10], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getBorderSize(node); + if (borderSize != null) { + return borderSize[0]; + } + } + return 0; + } + }, { + key: "clientWidth", + get: function get() { + var node = (0, _ReadOnlyNode2.getShadowNode)(this); + if (node != null) { + var innerSize = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[10], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getInnerSize(node); + if (innerSize != null) { + return innerSize[0]; + } + } + return 0; + } + }, { + key: "firstElementChild", + get: function get() { + var childElements = getChildElements(this); + if (childElements.length === 0) { + return null; + } + return childElements[0]; + } + }, { + key: "id", + get: function get() { + var _instanceHandle$state, _instanceHandle$state2, _ref, _props$id; + var instanceHandle = (0, _ReadOnlyNode2.getInstanceHandle)(this); + // TODO: migrate off this private React API + // $FlowExpectedError[incompatible-use] + var props = instanceHandle == null ? void 0 : (_instanceHandle$state = instanceHandle.stateNode) == null ? void 0 : (_instanceHandle$state2 = _instanceHandle$state.canonical) == null ? void 0 : _instanceHandle$state2.currentProps; + return (_ref = (_props$id = props == null ? void 0 : props.id) != null ? _props$id : props == null ? void 0 : props.nativeID) != null ? _ref : ''; + } + }, { + key: "lastElementChild", + get: function get() { + var childElements = getChildElements(this); + if (childElements.length === 0) { + return null; + } + return childElements[childElements.length - 1]; + } + }, { + key: "nextElementSibling", + get: function get() { + return (0, _$$_REQUIRE(_dependencyMap[11], "./Utilities/Traversal").getElementSibling)(this, 'next'); + } + }, { + key: "nodeName", + get: function get() { + return this.tagName; + } + }, { + key: "nodeType", + get: function get() { + return _ReadOnlyNode2.default.ELEMENT_NODE; + } + }, { + key: "nodeValue", + get: function get() { + return null; + }, + set: function set(value) {} + }, { + key: "previousElementSibling", + get: function get() { + return (0, _$$_REQUIRE(_dependencyMap[11], "./Utilities/Traversal").getElementSibling)(this, 'previous'); + } + }, { + key: "scrollHeight", + get: function get() { + var node = (0, _ReadOnlyNode2.getShadowNode)(this); + if (node != null) { + var scrollSize = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[10], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getScrollSize(node); + if (scrollSize != null) { + return scrollSize[1]; + } + } + return 0; + } + }, { + key: "scrollLeft", + get: function get() { + var node = (0, _ReadOnlyNode2.getShadowNode)(this); + if (node != null) { + var scrollPosition = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[10], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getScrollPosition(node); + if (scrollPosition != null) { + return scrollPosition[0]; + } + } + return 0; + } + }, { + key: "scrollTop", + get: function get() { + var node = (0, _ReadOnlyNode2.getShadowNode)(this); + if (node != null) { + var scrollPosition = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[10], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getScrollPosition(node); + if (scrollPosition != null) { + return scrollPosition[1]; + } + } + return 0; + } + }, { + key: "scrollWidth", + get: function get() { + var node = (0, _ReadOnlyNode2.getShadowNode)(this); + if (node != null) { + var scrollSize = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[10], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getScrollSize(node); + if (scrollSize != null) { + return scrollSize[0]; + } + } + return 0; + } + }, { + key: "tagName", + get: function get() { + var node = (0, _ReadOnlyNode2.getShadowNode)(this); + if (node != null) { + return (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[10], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getTagName(node); + } + return ''; + } + }, { + key: "textContent", + get: function get() { + var shadowNode = (0, _ReadOnlyNode2.getShadowNode)(this); + if (shadowNode != null) { + return (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[10], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getTextContent(shadowNode); + } + return ''; + } + }, { + key: "getBoundingClientRect", + value: function getBoundingClientRect() { + return _getBoundingClientRect(this, { + includeTransform: true + }); + } + + /** + * Pointer Capture APIs + */ + }, { + key: "hasPointerCapture", + value: function hasPointerCapture(pointerId) { + var node = (0, _ReadOnlyNode2.getShadowNode)(this); + if (node != null) { + return (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[10], "../../ReactNative/FabricUIManager").getFabricUIManager)()).hasPointerCapture(node, pointerId); + } + return false; + } + }, { + key: "setPointerCapture", + value: function setPointerCapture(pointerId) { + var node = (0, _ReadOnlyNode2.getShadowNode)(this); + if (node != null) { + (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[10], "../../ReactNative/FabricUIManager").getFabricUIManager)()).setPointerCapture(node, pointerId); + } + } + }, { + key: "releasePointerCapture", + value: function releasePointerCapture(pointerId) { + var node = (0, _ReadOnlyNode2.getShadowNode)(this); + if (node != null) { + (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[10], "../../ReactNative/FabricUIManager").getFabricUIManager)()).releasePointerCapture(node, pointerId); + } + } + }]); + }(_ReadOnlyNode2.default); + function getChildElements(node) { + // $FlowIssue[incompatible-call] + return (0, _ReadOnlyNode2.getChildNodes)(node).filter(function (childNode) { + return childNode instanceof ReadOnlyElement; + }); + } + + /** + * The public API for `getBoundingClientRect` always includes transform, + * so we use this internal version to get the data without transform to + * implement methods like `offsetWidth` and `offsetHeight`. + */ + function _getBoundingClientRect(node, _ref2) { + var includeTransform = _ref2.includeTransform; + var shadowNode = (0, _ReadOnlyNode2.getShadowNode)(node); + if (shadowNode != null) { + var rect = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[10], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getBoundingClientRect(shadowNode, includeTransform); + if (rect) { + return new _DOMRect.default(rect[0], rect[1], rect[2], rect[3]); + } + } + + // Empty rect if any of the above failed + return new _DOMRect.default(0, 0, 0, 0); + } +},294,[6,18,19,23,25,28,72,295,52,298,58,299],"node_modules\\react-native\\Libraries\\DOM\\Nodes\\ReadOnlyElement.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + exports.getChildNodes = getChildNodes; + exports.getInstanceHandle = getInstanceHandle; + exports.getPublicInstanceFromInternalInstanceHandle = getPublicInstanceFromInternalInstanceHandle; + exports.getShadowNode = getShadowNode; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/createClass")); + var _ReactFabric = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../Renderer/shims/ReactFabric")); + var _nullthrows = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "nullthrows")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + // flowlint unsafe-getters-setters:off + + // We initialize this lazily to avoid a require cycle + // (`ReadOnlyElement` also depends on `ReadOnlyNode`). + var ReadOnlyElementClass; + var ReadOnlyNode = exports.default = /*#__PURE__*/function () { + function ReadOnlyNode(internalInstanceHandle) { + (0, _classCallCheck2.default)(this, ReadOnlyNode); + setInstanceHandle(this, internalInstanceHandle); + } + return (0, _createClass2.default)(ReadOnlyNode, [{ + key: "childNodes", + get: function get() { + var childNodes = getChildNodes(this); + return (0, _$$_REQUIRE(_dependencyMap[6], "../OldStyleCollections/NodeList").createNodeList)(childNodes); + } + }, { + key: "firstChild", + get: function get() { + var childNodes = getChildNodes(this); + if (childNodes.length === 0) { + return null; + } + return childNodes[0]; + } + }, { + key: "isConnected", + get: function get() { + var shadowNode = getShadowNode(this); + if (shadowNode == null) { + return false; + } + return (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[7], "../../ReactNative/FabricUIManager").getFabricUIManager)()).isConnected(shadowNode); + } + }, { + key: "lastChild", + get: function get() { + var childNodes = getChildNodes(this); + if (childNodes.length === 0) { + return null; + } + return childNodes[childNodes.length - 1]; + } + }, { + key: "nextSibling", + get: function get() { + var _getNodeSiblingsAndPo = getNodeSiblingsAndPosition(this), + _getNodeSiblingsAndPo2 = (0, _slicedToArray2.default)(_getNodeSiblingsAndPo, 2), + siblings = _getNodeSiblingsAndPo2[0], + position = _getNodeSiblingsAndPo2[1]; + if (position === siblings.length - 1) { + // this node is the last child of its parent, so there is no next sibling. + return null; + } + return siblings[position + 1]; + } + + /** + * @abstract + */ + }, { + key: "nodeName", + get: function get() { + throw new TypeError('`nodeName` is abstract and must be implemented in a subclass of `ReadOnlyNode`'); + } + + /** + * @abstract + */ + }, { + key: "nodeType", + get: function get() { + throw new TypeError('`nodeType` is abstract and must be implemented in a subclass of `ReadOnlyNode`'); + } + + /** + * @abstract + */ + }, { + key: "nodeValue", + get: function get() { + throw new TypeError('`nodeValue` is abstract and must be implemented in a subclass of `ReadOnlyNode`'); + } + }, { + key: "parentElement", + get: function get() { + var parentNode = this.parentNode; + if (ReadOnlyElementClass == null) { + // We initialize this lazily to avoid a require cycle. + ReadOnlyElementClass = _$$_REQUIRE(_dependencyMap[8], "./ReadOnlyElement").default; + } + if (parentNode instanceof ReadOnlyElementClass) { + return parentNode; + } + return null; + } + }, { + key: "parentNode", + get: function get() { + var shadowNode = getShadowNode(this); + if (shadowNode == null) { + return null; + } + var parentInstanceHandle = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[7], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getParentNode(shadowNode); + if (parentInstanceHandle == null) { + return null; + } + return getPublicInstanceFromInternalInstanceHandle(parentInstanceHandle); + } + }, { + key: "previousSibling", + get: function get() { + var _getNodeSiblingsAndPo3 = getNodeSiblingsAndPosition(this), + _getNodeSiblingsAndPo4 = (0, _slicedToArray2.default)(_getNodeSiblingsAndPo3, 2), + siblings = _getNodeSiblingsAndPo4[0], + position = _getNodeSiblingsAndPo4[1]; + if (position === 0) { + // this node is the first child of its parent, so there is no previous sibling. + return null; + } + return siblings[position - 1]; + } + + /** + * @abstract + */ + }, { + key: "textContent", + get: function get() { + throw new TypeError('`textContent` is abstract and must be implemented in a subclass of `ReadOnlyNode`'); + } + }, { + key: "compareDocumentPosition", + value: function compareDocumentPosition(otherNode) { + // Quick check to avoid having to call into Fabric if the nodes are the same. + if (otherNode === this) { + return 0; + } + var shadowNode = getShadowNode(this); + var otherShadowNode = getShadowNode(otherNode); + if (shadowNode == null || otherShadowNode == null) { + return ReadOnlyNode.DOCUMENT_POSITION_DISCONNECTED; + } + return (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[7], "../../ReactNative/FabricUIManager").getFabricUIManager)()).compareDocumentPosition(shadowNode, otherShadowNode); + } + }, { + key: "contains", + value: function contains(otherNode) { + if (otherNode === this) { + return true; + } + var position = this.compareDocumentPosition(otherNode); + // eslint-disable-next-line no-bitwise + return (position & ReadOnlyNode.DOCUMENT_POSITION_CONTAINED_BY) !== 0; + } + }, { + key: "getRootNode", + value: function getRootNode() { + // eslint-disable-next-line consistent-this + var lastKnownParent = this; + var nextPossibleParent = this.parentNode; + while (nextPossibleParent != null) { + lastKnownParent = nextPossibleParent; + nextPossibleParent = nextPossibleParent.parentNode; + } + return lastKnownParent; + } + }, { + key: "hasChildNodes", + value: function hasChildNodes() { + return getChildNodes(this).length > 0; + } + + /* + * Node types, as returned by the `nodeType` property. + */ + + /** + * Type of Element, HTMLElement and ReactNativeElement instances. + */ + }]); + }(); + ReadOnlyNode.ELEMENT_NODE = 1; + /** + * Currently Unused in React Native. + */ + ReadOnlyNode.ATTRIBUTE_NODE = 2; + /** + * Text nodes. + */ + ReadOnlyNode.TEXT_NODE = 3; + /** + * @deprecated Unused in React Native. + */ + ReadOnlyNode.CDATA_SECTION_NODE = 4; + /** + * @deprecated + */ + ReadOnlyNode.ENTITY_REFERENCE_NODE = 5; + /** + * @deprecated + */ + ReadOnlyNode.ENTITY_NODE = 6; + /** + * @deprecated Unused in React Native. + */ + ReadOnlyNode.PROCESSING_INSTRUCTION_NODE = 7; + /** + * @deprecated Unused in React Native. + */ + ReadOnlyNode.COMMENT_NODE = 8; + /** + * @deprecated Unused in React Native. + */ + ReadOnlyNode.DOCUMENT_NODE = 9; + /** + * @deprecated Unused in React Native. + */ + ReadOnlyNode.DOCUMENT_TYPE_NODE = 10; + /** + * @deprecated Unused in React Native. + */ + ReadOnlyNode.DOCUMENT_FRAGMENT_NODE = 11; + /** + * @deprecated + */ + ReadOnlyNode.NOTATION_NODE = 12; + /* + * Document position flags. Used to check the return value of + * `compareDocumentPosition()`. + */ + /** + * Both nodes are in different documents. + */ + ReadOnlyNode.DOCUMENT_POSITION_DISCONNECTED = 1; + /** + * `otherNode` precedes the node in either a pre-order depth-first traversal of a tree containing both + * (e.g., as an ancestor or previous sibling or a descendant of a previous sibling or previous sibling of an ancestor) + * or (if they are disconnected) in an arbitrary but consistent ordering. + */ + ReadOnlyNode.DOCUMENT_POSITION_PRECEDING = 2; + /** + * `otherNode` follows the node in either a pre-order depth-first traversal of a tree containing both + * (e.g., as a descendant or following sibling or a descendant of a following sibling or following sibling of an ancestor) + * or (if they are disconnected) in an arbitrary but consistent ordering. + */ + ReadOnlyNode.DOCUMENT_POSITION_FOLLOWING = 4; + /** + * `otherNode` is an ancestor of the node. + */ + ReadOnlyNode.DOCUMENT_POSITION_CONTAINS = 8; + /** + * `otherNode` is a descendant of the node. + */ + ReadOnlyNode.DOCUMENT_POSITION_CONTAINED_BY = 16; + /** + * @deprecated Unused in React Native. + */ + ReadOnlyNode.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32; + var INSTANCE_HANDLE_KEY = Symbol('internalInstanceHandle'); + function getInstanceHandle(node) { + // $FlowExpectedError[prop-missing] + return node[INSTANCE_HANDLE_KEY]; + } + function setInstanceHandle(node, instanceHandle) { + // $FlowExpectedError[prop-missing] + node[INSTANCE_HANDLE_KEY] = instanceHandle; + } + function getShadowNode(node) { + return _ReactFabric.default.getNodeFromInternalInstanceHandle(getInstanceHandle(node)); + } + function getChildNodes(node) { + var shadowNode = getShadowNode(node); + if (shadowNode == null) { + return []; + } + var childNodeInstanceHandles = (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[7], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getChildNodes(shadowNode); + return childNodeInstanceHandles.map(function (instanceHandle) { + return getPublicInstanceFromInternalInstanceHandle(instanceHandle); + }); + } + function getNodeSiblingsAndPosition(node) { + var parent = node.parentNode; + if (parent == null) { + // This node is the root or it's disconnected. + return [[node], 0]; + } + var siblings = getChildNodes(parent); + var position = siblings.indexOf(node); + if (position === -1) { + throw new TypeError("Missing node in parent's child node list"); + } + return [siblings, position]; + } + function getPublicInstanceFromInternalInstanceHandle(instanceHandle) { + var mixedPublicInstance = _ReactFabric.default.getPublicInstanceFromInternalInstanceHandle(instanceHandle); + // $FlowExpectedError[incompatible-return] React defines public instances as "mixed" because it can't access the definition from React Native. + return mixedPublicInstance; + } +},295,[6,7,18,19,63,52,296,58,294],"node_modules\\react-native\\Libraries\\DOM\\Nodes\\ReadOnlyNode.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createNodeList = createNodeList; + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + // flowlint unsafe-getters-setters:off + // IMPORTANT: The Flow type definition for this module is defined in `NodeList.js.flow` + // because Flow only supports indexers in classes in declaration files. + // $FlowIssue[prop-missing] Flow doesn't understand [Symbol.iterator]() {} and thinks this class doesn't implement the Iterable interface. + var NodeList = exports.default = /*#__PURE__*/function () { + /** + * Use `createNodeList` to create instances of this class. + * + * @private This is not defined in the declaration file, so users will not see + * the signature of the constructor. + */ + function NodeList(elements) { + (0, _classCallCheck2.default)(this, NodeList); + for (var i = 0; i < elements.length; i++) { + Object.defineProperty(this, i, { + value: elements[i], + writable: false + }); + } + this._length = elements.length; + } + return (0, _createClass2.default)(NodeList, [{ + key: "length", + get: function get() { + return this._length; + } + }, { + key: "item", + value: function item(index) { + if (index < 0 || index >= this._length) { + return null; + } + + // assigning to the interface allows us to access the indexer property in a + // type-safe way. + // eslint-disable-next-line consistent-this + var arrayLike = this; + return arrayLike[index]; + } + }, { + key: "entries", + value: function entries() { + return (0, _$$_REQUIRE(_dependencyMap[3], "./ArrayLikeUtils").createEntriesIterator)(this); + } + }, { + key: "forEach", + value: function forEach(callbackFn, thisArg) { + // assigning to the interface allows us to access the indexer property in a + // type-safe way. + // eslint-disable-next-line consistent-this + var arrayLike = this; + for (var _index = 0; _index < this._length; _index++) { + if (thisArg == null) { + callbackFn(arrayLike[_index], _index, this); + } else { + callbackFn.call(thisArg, arrayLike[_index], _index, this); + } + } + } + }, { + key: "keys", + value: function keys() { + return (0, _$$_REQUIRE(_dependencyMap[3], "./ArrayLikeUtils").createKeyIterator)(this); + } + }, { + key: "values", + value: function values() { + return (0, _$$_REQUIRE(_dependencyMap[3], "./ArrayLikeUtils").createValueIterator)(this); + } + + // $FlowIssue[unsupported-syntax] Flow does not support computed properties in classes. + }, { + key: Symbol.iterator, + value: function value() { + return (0, _$$_REQUIRE(_dependencyMap[3], "./ArrayLikeUtils").createValueIterator)(this); + } + }]); + }(); + /** + * This is an internal method to create instances of `NodeList`, + * which avoids leaking its constructor to end users. + * We can do that because the external definition of `NodeList` lives in + * `NodeList.js.flow`, not here. + */ + function createNodeList(elements) { + return new NodeList(elements); + } +},296,[6,18,19,297],"node_modules\\react-native\\Libraries\\DOM\\OldStyleCollections\\NodeList.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createEntriesIterator = createEntriesIterator; + exports.createKeyIterator = createKeyIterator; + exports.createValueIterator = createValueIterator; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + /** + * This definition is different from the current built-in type `$ArrayLike` + * provided by Flow, in that this is an interface and that one is an object. + * + * The difference is important because, when using objects, Flow thinks + * a `length` property would be copied over when using the spread operator, + * which is incorrect. + */ + + function* createValueIterator(arrayLike) { + for (var i = 0; i < arrayLike.length; i++) { + yield arrayLike[i]; + } + } + function* createKeyIterator(arrayLike) { + for (var i = 0; i < arrayLike.length; i++) { + yield i; + } + } + function* createEntriesIterator(arrayLike) { + for (var i = 0; i < arrayLike.length; i++) { + yield [i, arrayLike[i]]; + } + } +},297,[],"node_modules\\react-native\\Libraries\\DOM\\OldStyleCollections\\ArrayLikeUtils.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createHTMLCollection = createHTMLCollection; + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + // flowlint unsafe-getters-setters:off + // IMPORTANT: The type definition for this module is defined in `HTMLCollection.js.flow` + // because Flow only supports indexers in classes in declaration files. + // $FlowIssue[prop-missing] Flow doesn't understand [Symbol.iterator]() {} and thinks this class doesn't implement the Iterable interface. + var HTMLCollection = exports.default = /*#__PURE__*/function () { + /** + * Use `createHTMLCollection` to create instances of this class. + * + * @private This is not defined in the declaration file, so users will not see + * the signature of the constructor. + */ + function HTMLCollection(elements) { + (0, _classCallCheck2.default)(this, HTMLCollection); + for (var i = 0; i < elements.length; i++) { + Object.defineProperty(this, i, { + value: elements[i], + enumerable: true, + configurable: false, + writable: false + }); + } + this._length = elements.length; + } + return (0, _createClass2.default)(HTMLCollection, [{ + key: "length", + get: function get() { + return this._length; + } + }, { + key: "item", + value: function item(index) { + if (index < 0 || index >= this._length) { + return null; + } + + // assigning to the interface allows us to access the indexer property in a + // type-safe way. + // eslint-disable-next-line consistent-this + var arrayLike = this; + return arrayLike[index]; + } + + /** + * @deprecated Unused in React Native. + */ + }, { + key: "namedItem", + value: function namedItem(name) { + return null; + } + + // $FlowIssue[unsupported-syntax] Flow does not support computed properties in classes. + }, { + key: Symbol.iterator, + value: function value() { + return (0, _$$_REQUIRE(_dependencyMap[3], "./ArrayLikeUtils").createValueIterator)(this); + } + }]); + }(); + /** + * This is an internal method to create instances of `HTMLCollection`, + * which avoids leaking its constructor to end users. + * We can do that because the external definition of `HTMLCollection` lives in + * `HTMLCollection.js.flow`, not here. + */ + function createHTMLCollection(elements) { + return new HTMLCollection(elements); + } +},298,[6,18,19,297],"node_modules\\react-native\\Libraries\\DOM\\OldStyleCollections\\HTMLCollection.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getElementSibling = getElementSibling; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + // We initialize this lazily to avoid a require cycle + // (`ReadOnlyElement` also depends on `Traversal`). + var ReadOnlyElementClass; + function getElementSibling(node, direction) { + var _childNodes$position; + var parent = node.parentNode; + if (parent == null) { + // This node is the root or it's disconnected. + return null; + } + var childNodes = (0, _$$_REQUIRE(_dependencyMap[0], "../ReadOnlyNode").getChildNodes)(parent); + var startPosition = childNodes.indexOf(node); + if (startPosition === -1) { + return null; + } + var increment = direction === 'next' ? 1 : -1; + var position = startPosition + increment; + if (ReadOnlyElementClass == null) { + // We initialize this lazily to avoid a require cycle. + ReadOnlyElementClass = _$$_REQUIRE(_dependencyMap[1], "../ReadOnlyElement").default; + } + while (childNodes[position] != null && !(childNodes[position] instanceof ReadOnlyElementClass)) { + position = position + increment; + } + return (_childNodes$position = childNodes[position]) != null ? _childNodes$position : null; + } +},299,[295,294],"node_modules\\react-native\\Libraries\\DOM\\Nodes\\Utilities\\Traversal.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _TextInputState = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Components/TextInput/TextInputState")); + var _warnForStyleProps = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "./warnForStyleProps")); + var _nullthrows2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "nullthrows")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var _nullthrows = (0, _nullthrows2.default)((0, _$$_REQUIRE(_dependencyMap[6], "../FabricUIManager").getFabricUIManager)()), + fabricMeasure = _nullthrows.measure, + fabricMeasureInWindow = _nullthrows.measureInWindow, + fabricMeasureLayout = _nullthrows.measureLayout, + fabricGetBoundingClientRect = _nullthrows.getBoundingClientRect, + _setNativeProps = _nullthrows.setNativeProps; + var noop = function noop() {}; + + /** + * This is used for refs on host components. + */ + var ReactFabricHostComponent = exports.default = /*#__PURE__*/function () { + // These need to be accessible from `ReactFabricPublicInstanceUtils`. + + function ReactFabricHostComponent(tag, viewConfig, internalInstanceHandle) { + (0, _classCallCheck2.default)(this, ReactFabricHostComponent); + this.__nativeTag = tag; + this._viewConfig = viewConfig; + this.__internalInstanceHandle = internalInstanceHandle; + } + return (0, _createClass2.default)(ReactFabricHostComponent, [{ + key: "blur", + value: function blur() { + // $FlowFixMe[incompatible-exact] Migrate all usages of `NativeMethods` to an interface to fix this. + _TextInputState.default.blurTextInput(this); + } + }, { + key: "focus", + value: function focus() { + // $FlowFixMe[incompatible-exact] Migrate all usages of `NativeMethods` to an interface to fix this. + _TextInputState.default.focusTextInput(this); + } + }, { + key: "measure", + value: function measure(callback) { + var node = (0, _$$_REQUIRE(_dependencyMap[7], "../../Renderer/shims/ReactFabric").getNodeFromInternalInstanceHandle)(this.__internalInstanceHandle); + if (node != null) { + fabricMeasure(node, callback); + } + } + }, { + key: "measureInWindow", + value: function measureInWindow(callback) { + var node = (0, _$$_REQUIRE(_dependencyMap[7], "../../Renderer/shims/ReactFabric").getNodeFromInternalInstanceHandle)(this.__internalInstanceHandle); + if (node != null) { + fabricMeasureInWindow(node, callback); + } + } + }, { + key: "measureLayout", + value: function measureLayout(relativeToNativeNode, onSuccess, onFail) { + if (typeof relativeToNativeNode === 'number' || !(relativeToNativeNode instanceof ReactFabricHostComponent)) { + if (__DEV__) { + console.error('Warning: ref.measureLayout must be called with a ref to a native component.'); + } + return; + } + var toStateNode = (0, _$$_REQUIRE(_dependencyMap[7], "../../Renderer/shims/ReactFabric").getNodeFromInternalInstanceHandle)(this.__internalInstanceHandle); + var fromStateNode = (0, _$$_REQUIRE(_dependencyMap[7], "../../Renderer/shims/ReactFabric").getNodeFromInternalInstanceHandle)(relativeToNativeNode.__internalInstanceHandle); + if (toStateNode != null && fromStateNode != null) { + fabricMeasureLayout(toStateNode, fromStateNode, onFail != null ? onFail : noop, onSuccess != null ? onSuccess : noop); + } + } + }, { + key: "unstable_getBoundingClientRect", + value: function unstable_getBoundingClientRect() { + var node = (0, _$$_REQUIRE(_dependencyMap[7], "../../Renderer/shims/ReactFabric").getNodeFromInternalInstanceHandle)(this.__internalInstanceHandle); + if (node != null) { + var rect = fabricGetBoundingClientRect(node, true); + if (rect) { + return new DOMRect(rect[0], rect[1], rect[2], rect[3]); + } + } + + // Empty rect if any of the above failed + return new DOMRect(0, 0, 0, 0); + } + }, { + key: "setNativeProps", + value: function setNativeProps(nativeProps) { + if (__DEV__) { + (0, _warnForStyleProps.default)(nativeProps, this._viewConfig.validAttributes); + } + var updatePayload = (0, _$$_REQUIRE(_dependencyMap[8], "./ReactNativeAttributePayload").create)(nativeProps, this._viewConfig.validAttributes); + var node = (0, _$$_REQUIRE(_dependencyMap[7], "../../Renderer/shims/ReactFabric").getNodeFromInternalInstanceHandle)(this.__internalInstanceHandle); + if (node != null && updatePayload != null) { + _setNativeProps(node, updatePayload); + } + } + }]); + }(); +},300,[6,18,19,281,293,52,58,63,290],"node_modules\\react-native\\Libraries\\ReactNative\\ReactFabricPublicInstance\\ReactFabricHostComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _ReadOnlyCharacterData = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./ReadOnlyCharacterData")); + var _ReadOnlyNode = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./ReadOnlyNode")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ // flowlint unsafe-getters-setters:off + var ReadOnlyText = exports.default = /*#__PURE__*/function (_ReadOnlyCharacterDat) { + function ReadOnlyText() { + (0, _classCallCheck2.default)(this, ReadOnlyText); + return _callSuper(this, ReadOnlyText, arguments); + } + (0, _inherits2.default)(ReadOnlyText, _ReadOnlyCharacterDat); + return (0, _createClass2.default)(ReadOnlyText, [{ + key: "nodeName", + get: + /** + * @override + */ + function get() { + return '#text'; + } + + /** + * @override + */ + }, { + key: "nodeType", + get: function get() { + return _ReadOnlyNode.default.TEXT_NODE; + } + }]); + }(_ReadOnlyCharacterData.default); +},301,[6,18,19,23,25,28,302,295],"node_modules\\react-native\\Libraries\\DOM\\Nodes\\ReadOnlyText.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _ReadOnlyNode2 = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6], "./ReadOnlyNode")); + var _nullthrows = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "nullthrows")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ // flowlint unsafe-getters-setters:off + var ReadOnlyCharacterData = exports.default = /*#__PURE__*/function (_ReadOnlyNode) { + function ReadOnlyCharacterData() { + (0, _classCallCheck2.default)(this, ReadOnlyCharacterData); + return _callSuper(this, ReadOnlyCharacterData, arguments); + } + (0, _inherits2.default)(ReadOnlyCharacterData, _ReadOnlyNode); + return (0, _createClass2.default)(ReadOnlyCharacterData, [{ + key: "nextElementSibling", + get: function get() { + return (0, _$$_REQUIRE(_dependencyMap[8], "./Utilities/Traversal").getElementSibling)(this, 'next'); + } + }, { + key: "previousElementSibling", + get: function get() { + return (0, _$$_REQUIRE(_dependencyMap[8], "./Utilities/Traversal").getElementSibling)(this, 'previous'); + } + }, { + key: "data", + get: function get() { + var shadowNode = (0, _ReadOnlyNode2.getShadowNode)(this); + if (shadowNode != null) { + return (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[9], "../../ReactNative/FabricUIManager").getFabricUIManager)()).getTextContent(shadowNode); + } + return ''; + } + }, { + key: "length", + get: function get() { + return this.data.length; + } + + /** + * @override + */ + }, { + key: "textContent", + get: function get() { + return this.data; + } + + /** + * @override + */ + }, { + key: "nodeValue", + get: function get() { + return this.data; + } + }, { + key: "substringData", + value: function substringData(offset, count) { + var data = this.data; + if (offset < 0) { + throw new TypeError(`Failed to execute 'substringData' on 'CharacterData': The offset ${offset} is negative.`); + } + if (offset > data.length) { + throw new TypeError(`Failed to execute 'substringData' on 'CharacterData': The offset ${offset} is greater than the node's length (${data.length}).`); + } + var adjustedCount = count < 0 || count > data.length ? data.length : count; + return data.slice(offset, offset + adjustedCount); + } + }]); + }(_ReadOnlyNode2.default); +},302,[6,18,19,23,25,28,295,52,299,58],"node_modules\\react-native\\Libraries\\DOM\\Nodes\\ReadOnlyCharacterData.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _reactJsxRuntime = _$$_REQUIRE(_dependencyMap[0], "react/jsx-runtime"); + var _classCallCheck = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass"); + var _possibleConstructorReturn = _$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn"); + var _getPrototypeOf = _$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf"); + var _inherits = _$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Inspector\\Inspector.js"; + function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + var React = _$$_REQUIRE(_dependencyMap[6], "react"); + var hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; + + // Required for React DevTools to view/edit React Native styles in Flipper. + // Flipper doesn't inject these values when initializing DevTools. + hook.resolveRNStyle = _$$_REQUIRE(_dependencyMap[7], "../StyleSheet/flattenStyle"); + hook.nativeStyleEditorValidAttributes = Object.keys(_$$_REQUIRE(_dependencyMap[8], "../Components/View/ReactNativeStyleAttributes")); + var Inspector = /*#__PURE__*/function (_React$Component) { + function Inspector(props) { + var _this; + _classCallCheck(this, Inspector); + _this = _callSuper(this, Inspector, [props]); + _this._hideTimeoutID = null; + _this._attachToDevtools = function (agent) { + agent.addListener('shutdown', _this._onAgentShutdown); + _this.setState({ + devtoolsAgent: agent + }); + }; + _this._onAgentShutdown = function () { + var agent = _this.state.devtoolsAgent; + if (agent != null) { + agent.removeListener('shutdown', _this._onAgentShutdown); + _this.setState({ + devtoolsAgent: null + }); + } + }; + _this.state = { + devtoolsAgent: null, + hierarchy: null, + panelPos: 'bottom', + inspecting: true, + perfing: false, + inspected: null, + selection: null, + inspectedView: _this.props.inspectedView, + networking: false + }; + return _this; + } + _inherits(Inspector, _React$Component); + return _createClass(Inspector, [{ + key: "componentDidMount", + value: function componentDidMount() { + hook.on('react-devtools', this._attachToDevtools); + // if devtools is already started + if (hook.reactDevtoolsAgent) { + this._attachToDevtools(hook.reactDevtoolsAgent); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this._subs) { + this._subs.map(function (fn) { + return fn(); + }); + } + hook.off('react-devtools', this._attachToDevtools); + this._setTouchedViewData = null; + } + }, { + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(newProps) { + this.setState({ + inspectedView: newProps.inspectedView + }); + } + }, { + key: "setSelection", + value: function setSelection(i) { + var _this2 = this; + var hierarchyItem = this.state.hierarchy[i]; + // we pass in findNodeHandle as the method is injected + var _hierarchyItem$getIns = hierarchyItem.getInspectorData(_$$_REQUIRE(_dependencyMap[9], "../ReactNative/RendererProxy").findNodeHandle), + measure = _hierarchyItem$getIns.measure, + props = _hierarchyItem$getIns.props, + source = _hierarchyItem$getIns.source; + measure(function (x, y, width, height, left, top) { + _this2.setState({ + inspected: { + frame: { + left: left, + top: top, + width: width, + height: height + }, + style: props.style, + source: source + }, + selection: i + }); + }); + } + }, { + key: "onTouchPoint", + value: function onTouchPoint(locationX, locationY) { + var _this3 = this; + this._setTouchedViewData = function (viewData) { + var hierarchy = viewData.hierarchy, + props = viewData.props, + selectedIndex = viewData.selectedIndex, + source = viewData.source, + frame = viewData.frame, + pointerY = viewData.pointerY, + touchedViewTag = viewData.touchedViewTag, + closestInstance = viewData.closestInstance; + + // Sync the touched view with React DevTools. + // Note: This is Paper only. To support Fabric, + // DevTools needs to be updated to not rely on view tags. + var agent = _this3.state.devtoolsAgent; + if (agent) { + agent.selectNode(_$$_REQUIRE(_dependencyMap[9], "../ReactNative/RendererProxy").findNodeHandle(touchedViewTag)); + if (closestInstance != null) { + agent.selectNode(closestInstance); + } + } + _this3.setState({ + panelPos: pointerY > _$$_REQUIRE(_dependencyMap[10], "../Utilities/Dimensions").default.get('window').height / 2 ? 'top' : 'bottom', + selection: selectedIndex, + hierarchy: hierarchy, + inspected: { + style: props.style, + frame: frame, + source: source + } + }); + }; + _$$_REQUIRE(_dependencyMap[11], "./getInspectorDataForViewAtPoint")(this.state.inspectedView, locationX, locationY, function (viewData) { + if (_this3._setTouchedViewData != null) { + _this3._setTouchedViewData(viewData); + _this3._setTouchedViewData = null; + } + return false; + }); + } + }, { + key: "setPerfing", + value: function setPerfing(val) { + this.setState({ + perfing: val, + inspecting: false, + inspected: null, + networking: false + }); + } + }, { + key: "setInspecting", + value: function setInspecting(val) { + this.setState({ + inspecting: val, + inspected: null + }); + } + }, { + key: "setTouchTargeting", + value: function setTouchTargeting(val) { + var _this4 = this; + _$$_REQUIRE(_dependencyMap[12], "../Pressability/PressabilityDebug").setEnabled(val); + this.props.onRequestRerenderApp(function (inspectedView) { + _this4.setState({ + inspectedView: inspectedView + }); + }); + } + }, { + key: "setNetworking", + value: function setNetworking(val) { + this.setState({ + networking: val, + perfing: false, + inspecting: false, + inspected: null + }); + } + }, { + key: "render", + value: function render() { + var panelContainerStyle = this.state.panelPos === 'bottom' ? { + bottom: 0 + } : { + top: "android" === 'ios' ? 20 : 0 + }; + return /*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[13], "../Components/View/View"), { + style: styles.container, + pointerEvents: "box-none", + children: [this.state.inspecting && /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[14], "./InspectorOverlay"), { + inspected: this.state.inspected + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + , + onTouchPoint: this.onTouchPoint.bind(this) + }), /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[13], "../Components/View/View"), { + style: [styles.panelContainer, panelContainerStyle], + children: /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[15], "./InspectorPanel"), { + devtoolsIsOpen: !!this.state.devtoolsAgent, + inspecting: this.state.inspecting, + perfing: this.state.perfing + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + , + setPerfing: this.setPerfing.bind(this) + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + , + setInspecting: this.setInspecting.bind(this), + inspected: this.state.inspected, + hierarchy: this.state.hierarchy, + selection: this.state.selection + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + , + setSelection: this.setSelection.bind(this), + touchTargeting: _$$_REQUIRE(_dependencyMap[12], "../Pressability/PressabilityDebug").isEnabled() + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + , + setTouchTargeting: this.setTouchTargeting.bind(this), + networking: this.state.networking + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + , + setNetworking: this.setNetworking.bind(this) + }) + })] + }); + } + }]); + }(React.Component); + var styles = _$$_REQUIRE(_dependencyMap[16], "../StyleSheet/StyleSheet").create({ + container: { + position: 'absolute', + backgroundColor: 'transparent', + top: 0, + left: 0, + right: 0, + bottom: 0 + }, + panelContainer: { + position: 'absolute', + left: 0, + right: 0 + } + }); + module.exports = Inspector; +},303,[106,18,19,23,25,28,65,222,213,61,255,273,304,241,306,307,266],"node_modules\\react-native\\Libraries\\Inspector\\Inspector.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.PressabilityDebugView = PressabilityDebugView; + exports.isEnabled = isEnabled; + exports.setEnabled = setEnabled; + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../Components/View/View")); + var _normalizeColor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../StyleSheet/normalizeColor")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[4], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Pressability\\PressabilityDebug.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Displays a debug overlay to visualize press targets when enabled via the + * React Native Inspector. Calls to this module should be guarded by `__DEV__`, + * for example: + * + * return ( + * + * {children} + * {__DEV__ ? ( + * + * ) : null} + * + * ); + * + */ + function PressabilityDebugView(props) { + if (__DEV__) { + if (isEnabled()) { + var _hitSlop$bottom, _hitSlop$left, _hitSlop$right, _hitSlop$top; + var normalizedColor = (0, _normalizeColor.default)(props.color); + if (typeof normalizedColor !== 'number') { + return null; + } + var baseColor = '#' + (normalizedColor != null ? normalizedColor : 0).toString(16).padStart(8, '0'); + var hitSlop = (0, _$$_REQUIRE(_dependencyMap[5], "../StyleSheet/Rect").normalizeRect)(props.hitSlop); + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + pointerEvents: "none", + style: + // eslint-disable-next-line react-native/no-inline-styles + { + backgroundColor: baseColor.slice(0, -2) + '0F', + // 15% + borderColor: baseColor.slice(0, -2) + '55', + // 85% + borderStyle: 'dashed', + borderWidth: 1, + bottom: -((_hitSlop$bottom = hitSlop == null ? void 0 : hitSlop.bottom) != null ? _hitSlop$bottom : 0), + left: -((_hitSlop$left = hitSlop == null ? void 0 : hitSlop.left) != null ? _hitSlop$left : 0), + position: 'absolute', + right: -((_hitSlop$right = hitSlop == null ? void 0 : hitSlop.right) != null ? _hitSlop$right : 0), + top: -((_hitSlop$top = hitSlop == null ? void 0 : hitSlop.top) != null ? _hitSlop$top : 0) + } + }); + } + } + return null; + } + var isDebugEnabled = false; + function isEnabled() { + if (__DEV__) { + return isDebugEnabled; + } + return false; + } + function setEnabled(value) { + if (__DEV__) { + isDebugEnabled = value; + } + } +},304,[6,241,190,65,106,305],"node_modules\\react-native\\Libraries\\Pressability\\PressabilityDebug.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createSquare = createSquare; + exports.normalizeRect = normalizeRect; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + function createSquare(size) { + return { + bottom: size, + left: size, + right: size, + top: size + }; + } + function normalizeRect(rectOrSize) { + return typeof rectOrSize === 'number' ? createSquare(rectOrSize) : rectOrSize; + } +},305,[],"node_modules\\react-native\\Libraries\\StyleSheet\\Rect.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _reactJsxRuntime = _$$_REQUIRE(_dependencyMap[0], "react/jsx-runtime"); + var _classCallCheck = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass"); + var _possibleConstructorReturn = _$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn"); + var _getPrototypeOf = _$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf"); + var _inherits = _$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Inspector\\InspectorOverlay.js"; + function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + var React = _$$_REQUIRE(_dependencyMap[6], "react"); + var InspectorOverlay = /*#__PURE__*/function (_React$Component) { + function InspectorOverlay() { + var _this; + _classCallCheck(this, InspectorOverlay); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, InspectorOverlay, [].concat(args)); + _this.findViewForTouchEvent = function (e) { + var _e$nativeEvent$touche = e.nativeEvent.touches[0], + locationX = _e$nativeEvent$touche.locationX, + locationY = _e$nativeEvent$touche.locationY; + _this.props.onTouchPoint(locationX, locationY); + }; + _this.shouldSetResponder = function (e) { + _this.findViewForTouchEvent(e); + return true; + }; + return _this; + } + _inherits(InspectorOverlay, _React$Component); + return _createClass(InspectorOverlay, [{ + key: "render", + value: function render() { + var content = null; + if (this.props.inspected) { + content = /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[7], "./ElementBox"), { + frame: this.props.inspected.frame, + style: this.props.inspected.style + }); + } + return /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + onStartShouldSetResponder: this.shouldSetResponder, + onResponderMove: this.findViewForTouchEvent, + nativeID: "inspectorOverlay" /* TODO: T68258846. */, + style: [styles.inspector, { + height: _$$_REQUIRE(_dependencyMap[9], "../Utilities/Dimensions").default.get('window').height + }], + children: content + }); + } + }]); + }(React.Component); + var styles = _$$_REQUIRE(_dependencyMap[10], "../StyleSheet/StyleSheet").create({ + inspector: { + backgroundColor: 'transparent', + position: 'absolute', + left: 0, + top: 0, + right: 0 + } + }); + module.exports = InspectorOverlay; +},306,[106,18,19,23,25,28,65,268,241,255,266],"node_modules\\react-native\\Libraries\\Inspector\\InspectorOverlay.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _SafeAreaView = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../Components/SafeAreaView/SafeAreaView")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[7], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Inspector\\InspectorPanel.js"; + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + var React = _$$_REQUIRE(_dependencyMap[8], "react"); + var InspectorPanel = /*#__PURE__*/function (_React$Component) { + function InspectorPanel() { + (0, _classCallCheck2.default)(this, InspectorPanel); + return _callSuper(this, InspectorPanel, arguments); + } + (0, _inherits2.default)(InspectorPanel, _React$Component); + return (0, _createClass2.default)(InspectorPanel, [{ + key: "renderWaiting", + value: function renderWaiting() { + if (this.props.inspecting) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: styles.waitingText, + children: "Tap something to inspect it" + }); + } + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: styles.waitingText, + children: "Nothing is inspected" + }); + } + }, { + key: "render", + value: function render() { + var contents; + if (this.props.inspected) { + contents = /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[10], "../Components/ScrollView/ScrollView"), { + style: styles.properties, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[11], "./ElementProperties"), { + style: this.props.inspected.style, + frame: this.props.inspected.frame, + source: this.props.inspected.source + // $FlowFixMe[incompatible-type] : Hierarchy should be non-nullable + , + hierarchy: this.props.hierarchy, + selection: this.props.selection, + setSelection: this.props.setSelection + }) + }); + } else if (this.props.perfing) { + contents = /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[12], "./PerformanceOverlay"), {}); + } else if (this.props.networking) { + contents = /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[13], "./NetworkOverlay"), {}); + } else { + contents = /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[14], "../Components/View/View"), { + style: styles.waiting, + children: this.renderWaiting() + }); + } + return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_SafeAreaView.default, { + style: styles.container, + children: [!this.props.devtoolsIsOpen && contents, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_$$_REQUIRE(_dependencyMap[14], "../Components/View/View"), { + style: styles.buttonRow, + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(InspectorPanelButton, { + title: 'Inspect', + pressed: this.props.inspecting, + onClick: this.props.setInspecting + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(InspectorPanelButton, { + title: 'Perf', + pressed: this.props.perfing, + onClick: this.props.setPerfing + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(InspectorPanelButton, { + title: 'Network', + pressed: this.props.networking, + onClick: this.props.setNetworking + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(InspectorPanelButton, { + title: 'Touchables', + pressed: this.props.touchTargeting, + onClick: this.props.setTouchTargeting + })] + })] + }); + } + }]); + }(React.Component); + var InspectorPanelButton = /*#__PURE__*/function (_React$Component2) { + function InspectorPanelButton() { + (0, _classCallCheck2.default)(this, InspectorPanelButton); + return _callSuper(this, InspectorPanelButton, arguments); + } + (0, _inherits2.default)(InspectorPanelButton, _React$Component2); + return (0, _createClass2.default)(InspectorPanelButton, [{ + key: "render", + value: function render() { + var _this = this; + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[15], "../Components/Touchable/TouchableHighlight"), { + onPress: function onPress() { + return _this.props.onClick(!_this.props.pressed); + }, + style: [styles.button, this.props.pressed && styles.buttonPressed], + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: styles.buttonText, + children: this.props.title + }) + }); + } + }]); + }(React.Component); + var styles = _$$_REQUIRE(_dependencyMap[16], "../StyleSheet/StyleSheet").create({ + buttonRow: { + flexDirection: 'row' + }, + button: { + backgroundColor: 'rgba(0, 0, 0, 0.3)', + margin: 2, + height: 30, + justifyContent: 'center', + alignItems: 'center' + }, + buttonPressed: { + backgroundColor: 'rgba(255, 255, 255, 0.3)' + }, + buttonText: { + textAlign: 'center', + color: 'white', + margin: 5 + }, + container: { + backgroundColor: 'rgba(0, 0, 0, 0.7)' + }, + properties: { + height: 200 + }, + waiting: { + height: 100 + }, + waitingText: { + fontSize: 20, + textAlign: 'center', + marginVertical: 20, + color: 'white' + } + }); + module.exports = InspectorPanel; +},307,[6,18,19,23,25,28,308,106,65,310,346,443,450,451,241,444,266],"node_modules\\react-native\\Libraries\\Inspector\\InspectorPanel.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Utilities/Platform")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../View/View")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /** + * Renders nested content and automatically applies paddings reflect the portion + * of the view that is not covered by navigation bars, tab bars, toolbars, and + * other ancestor views. + * + * Moreover, and most importantly, Safe Area's paddings reflect physical + * limitation of the screen, such as rounded corners or camera notches (aka + * sensor housing area on iPhone X). + */ + var exported = _Platform.default.select({ + ios: _$$_REQUIRE(_dependencyMap[4], "./RCTSafeAreaViewNativeComponent").default, + default: _View.default + }); + var _default = exports.default = exported; +},308,[6,34,241,65,309],"node_modules\\react-native\\Libraries\\Components\\SafeAreaView\\SafeAreaView.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.__INTERNAL_VIEW_CONFIG = void 0; + var _codegenNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Utilities/codegenNativeComponent")); /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var nativeComponentName = 'RCTSafeAreaView'; + var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = { + uiViewClassName: 'RCTSafeAreaView', + validAttributes: {} + }; + var _default = exports.default = _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/NativeComponent/NativeComponentRegistry").get(nativeComponentName, function () { + return __INTERNAL_VIEW_CONFIG; + }); +},309,[6,276,244],"node_modules\\react-native\\Libraries\\Components\\SafeAreaView\\RCTSafeAreaViewNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _objectWithoutProperties2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/objectWithoutProperties")); + var PressabilityDebug = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3], "../Pressability/PressabilityDebug")); + var _usePressability = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../Pressability/usePressability")); + var _flattenStyle = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../StyleSheet/flattenStyle")); + var _processColor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../StyleSheet/processColor")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../Utilities/Platform")); + var _TextAncestor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./TextAncestor")); + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9], "react")); + var React = _react; + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[10], "react/jsx-runtime"); + var _excluded = ["accessible", "accessibilityLabel", "accessibilityState", "allowFontScaling", "aria-busy", "aria-checked", "aria-disabled", "aria-expanded", "aria-label", "aria-selected", "ellipsizeMode", "id", "nativeID", "onLongPress", "onPress", "onPressIn", "onPressOut", "onResponderGrant", "onResponderMove", "onResponderRelease", "onResponderTerminate", "onResponderTerminationRequest", "onStartShouldSetResponder", "pressRetentionOffset", "suppressHighlighting"]; + var _this = this, + _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Text\\Text.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + /** + * Text is the fundamental component for displaying text. + * + * @see https://reactnative.dev/docs/text + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + var Text = React.forwardRef(function (props, forwardedRef) { + var _accessibilityState2, _accessibilityState3, _style, _style3, _style4; + var accessible = props.accessible, + accessibilityLabel = props.accessibilityLabel, + accessibilityState = props.accessibilityState, + allowFontScaling = props.allowFontScaling, + ariaBusy = props['aria-busy'], + ariaChecked = props['aria-checked'], + ariaDisabled = props['aria-disabled'], + ariaExpanded = props['aria-expanded'], + ariaLabel = props['aria-label'], + ariaSelected = props['aria-selected'], + ellipsizeMode = props.ellipsizeMode, + id = props.id, + nativeID = props.nativeID, + onLongPress = props.onLongPress, + onPress = props.onPress, + _onPressIn = props.onPressIn, + _onPressOut = props.onPressOut, + _onResponderGrant = props.onResponderGrant, + _onResponderMove = props.onResponderMove, + _onResponderRelease = props.onResponderRelease, + _onResponderTerminate = props.onResponderTerminate, + onResponderTerminationRequest = props.onResponderTerminationRequest, + onStartShouldSetResponder = props.onStartShouldSetResponder, + pressRetentionOffset = props.pressRetentionOffset, + suppressHighlighting = props.suppressHighlighting, + restProps = (0, _objectWithoutProperties2.default)(props, _excluded); + var _useState = (0, _react.useState)(false), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + isHighlighted = _useState2[0], + setHighlighted = _useState2[1]; + var _accessibilityState; + if (accessibilityState != null || ariaBusy != null || ariaChecked != null || ariaDisabled != null || ariaExpanded != null || ariaSelected != null) { + _accessibilityState = { + busy: ariaBusy != null ? ariaBusy : accessibilityState == null ? void 0 : accessibilityState.busy, + checked: ariaChecked != null ? ariaChecked : accessibilityState == null ? void 0 : accessibilityState.checked, + disabled: ariaDisabled != null ? ariaDisabled : accessibilityState == null ? void 0 : accessibilityState.disabled, + expanded: ariaExpanded != null ? ariaExpanded : accessibilityState == null ? void 0 : accessibilityState.expanded, + selected: ariaSelected != null ? ariaSelected : accessibilityState == null ? void 0 : accessibilityState.selected + }; + } + var _disabled = restProps.disabled != null ? restProps.disabled : (_accessibilityState2 = _accessibilityState) == null ? void 0 : _accessibilityState2.disabled; + var nativeTextAccessibilityState = _disabled !== ((_accessibilityState3 = _accessibilityState) == null ? void 0 : _accessibilityState3.disabled) ? Object.assign({}, _accessibilityState, { + disabled: _disabled + }) : _accessibilityState; + var isPressable = (onPress != null || onLongPress != null || onStartShouldSetResponder != null) && _disabled !== true; + var initialized = useLazyInitialization(isPressable); + var config = (0, _react.useMemo)(function () { + return initialized ? { + disabled: !isPressable, + pressRectOffset: pressRetentionOffset, + onLongPress: onLongPress, + onPress: onPress, + onPressIn: function onPressIn(event) { + // Updating isHighlighted causes unnecessary re-renders for platforms that don't use it + // in the best case, and cause issues with text selection in the worst case. Forcing + // the isHighlighted prop to false on all platforms except iOS. + setHighlighted((suppressHighlighting == null || !suppressHighlighting) && _Platform.default.OS === 'ios'); + _onPressIn == null ? void 0 : _onPressIn(event); + }, + onPressOut: function onPressOut(event) { + setHighlighted(false); + _onPressOut == null ? void 0 : _onPressOut(event); + }, + onResponderTerminationRequest_DEPRECATED: onResponderTerminationRequest, + onStartShouldSetResponder_DEPRECATED: onStartShouldSetResponder + } : null; + }, [initialized, isPressable, pressRetentionOffset, onLongPress, onPress, _onPressIn, _onPressOut, onResponderTerminationRequest, onStartShouldSetResponder, suppressHighlighting]); + var eventHandlers = (0, _usePressability.default)(config); + var eventHandlersForText = (0, _react.useMemo)(function () { + return eventHandlers == null ? null : { + onResponderGrant: function onResponderGrant(event) { + eventHandlers.onResponderGrant(event); + if (_onResponderGrant != null) { + _onResponderGrant(event); + } + }, + onResponderMove: function onResponderMove(event) { + eventHandlers.onResponderMove(event); + if (_onResponderMove != null) { + _onResponderMove(event); + } + }, + onResponderRelease: function onResponderRelease(event) { + eventHandlers.onResponderRelease(event); + if (_onResponderRelease != null) { + _onResponderRelease(event); + } + }, + onResponderTerminate: function onResponderTerminate(event) { + eventHandlers.onResponderTerminate(event); + if (_onResponderTerminate != null) { + _onResponderTerminate(event); + } + }, + onClick: eventHandlers.onClick, + onResponderTerminationRequest: eventHandlers.onResponderTerminationRequest, + onStartShouldSetResponder: eventHandlers.onStartShouldSetResponder + }; + }, [eventHandlers, _onResponderGrant, _onResponderMove, _onResponderRelease, _onResponderTerminate]); + + // TODO: Move this processing to the view configuration. + var selectionColor = restProps.selectionColor == null ? null : (0, _processColor.default)(restProps.selectionColor); + var style = restProps.style; + if (__DEV__) { + if (PressabilityDebug.isEnabled() && onPress != null) { + style = [restProps.style, { + color: 'magenta' + }]; + } + } + var numberOfLines = restProps.numberOfLines; + if (numberOfLines != null && !(numberOfLines >= 0)) { + console.error(`'numberOfLines' in must be a non-negative number, received: ${numberOfLines}. The value will be set to 0.`); + numberOfLines = 0; + } + var hasTextAncestor = (0, _react.useContext)(_TextAncestor.default); + var _accessible = _Platform.default.select({ + ios: accessible !== false, + default: accessible + }); + + // $FlowFixMe[underconstrained-implicit-instantiation] + style = (0, _flattenStyle.default)(style); + if (typeof ((_style = style) == null ? void 0 : _style.fontWeight) === 'number') { + var _style2; + // $FlowFixMe[prop-missing] + // $FlowFixMe[cannot-write] + style.fontWeight = (_style2 = style) == null ? void 0 : _style2.fontWeight.toString(); + } + var _selectable = restProps.selectable; + if (((_style3 = style) == null ? void 0 : _style3.userSelect) != null) { + // $FlowFixMe[invalid-computed-prop] + _selectable = userSelectToSelectableMap[style.userSelect]; + // $FlowFixMe[prop-missing] + // $FlowFixMe[cannot-write] + delete style.userSelect; + } + if (((_style4 = style) == null ? void 0 : _style4.verticalAlign) != null) { + // $FlowFixMe[prop-missing] + // $FlowFixMe[cannot-write] + style.textAlignVertical = + // $FlowFixMe[invalid-computed-prop] + verticalAlignToTextAlignVerticalMap[style.verticalAlign]; + // $FlowFixMe[prop-missing] + // $FlowFixMe[cannot-write] + delete style.verticalAlign; + } + var _hasOnPressOrOnLongPress = props.onPress != null || props.onLongPress != null; + return hasTextAncestor ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[11], "./TextNativeComponent").NativeVirtualText, Object.assign({}, restProps, eventHandlersForText, { + accessibilityLabel: ariaLabel != null ? ariaLabel : accessibilityLabel, + accessibilityState: _accessibilityState, + isHighlighted: isHighlighted, + isPressable: isPressable, + nativeID: id != null ? id : nativeID, + numberOfLines: numberOfLines, + ref: forwardedRef, + selectable: _selectable, + selectionColor: selectionColor, + style: style + })) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextAncestor.default.Provider, { + value: true, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[11], "./TextNativeComponent").NativeText, Object.assign({}, restProps, eventHandlersForText, { + accessibilityLabel: ariaLabel != null ? ariaLabel : accessibilityLabel, + accessibilityState: nativeTextAccessibilityState, + accessible: accessible == null && _Platform.default.OS === 'android' ? _hasOnPressOrOnLongPress : _accessible, + allowFontScaling: allowFontScaling !== false, + disabled: _disabled, + ellipsizeMode: ellipsizeMode != null ? ellipsizeMode : 'tail', + isHighlighted: isHighlighted, + nativeID: id != null ? id : nativeID, + numberOfLines: numberOfLines, + ref: forwardedRef, + selectable: _selectable, + selectionColor: selectionColor, + style: style + })) + }); + }); + Text.displayName = 'Text'; + + /** + * Switch to `deprecated-react-native-prop-types` for compatibility with future + * releases. This is deprecated and will be removed in the future. + */ + Text.propTypes = _$$_REQUIRE(_dependencyMap[12], "deprecated-react-native-prop-types").TextPropTypes; + + /** + * Returns false until the first time `newValue` is true, after which this will + * always return true. This is necessary to lazily initialize `Pressability` so + * we do not eagerly create one for every pressable `Text` component. + */ + function useLazyInitialization(newValue) { + var _useState3 = (0, _react.useState)(newValue), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + oldValue = _useState4[0], + setValue = _useState4[1]; + if (!oldValue && newValue) { + setValue(newValue); + } + return oldValue; + } + var userSelectToSelectableMap = { + auto: true, + text: true, + none: false, + contain: true, + all: true + }; + var verticalAlignToTextAlignVerticalMap = { + auto: 'auto', + top: 'top', + bottom: 'bottom', + middle: 'center' + }; + module.exports = Text; +},310,[6,7,166,304,311,222,189,34,242,65,106,317,318],"node_modules\\react-native\\Libraries\\Text\\Text.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = usePressability; + var _Pressability = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./Pressability")); + var _react = _$$_REQUIRE(_dependencyMap[2], "react"); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /** + * Creates a persistent instance of `Pressability` that automatically configures + * itself and resets. Accepts null `config` to support lazy initialization. Once + * initialized, will not un-initialize until the component has been unmounted. + */ + function usePressability(config) { + var pressabilityRef = (0, _react.useRef)(null); + if (config != null && pressabilityRef.current == null) { + pressabilityRef.current = new _Pressability.default(config); + } + var pressability = pressabilityRef.current; + + // On the initial mount, this is a no-op. On updates, `pressability` will be + // re-configured to use the new configuration. + (0, _react.useEffect)(function () { + if (config != null && pressability != null) { + pressability.configure(config); + } + }, [config, pressability]); + + // On unmount, reset pending state and timers inside `pressability`. This is + // a separate effect because we do not want to reset when `config` changes. + (0, _react.useEffect)(function () { + if (pressability != null) { + return function () { + pressability.reset(); + }; + } + }, [pressability]); + return pressability == null ? null : pressability.getEventHandlers(); + } +},311,[6,312,65],"node_modules\\react-native\\Libraries\\Pressability\\usePressability.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _SoundManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../Components/Sound/SoundManager")); + var _ReactNativeFeatureFlags = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../ReactNative/ReactNativeFeatureFlags")); + var _UIManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../ReactNative/UIManager")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../Utilities/Platform")); + var _PressabilityPerformanceEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./PressabilityPerformanceEventEmitter.js")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "invariant")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var Transitions = Object.freeze({ + NOT_RESPONDER: { + DELAY: 'ERROR', + RESPONDER_GRANT: 'RESPONDER_INACTIVE_PRESS_IN', + RESPONDER_RELEASE: 'ERROR', + RESPONDER_TERMINATED: 'ERROR', + ENTER_PRESS_RECT: 'ERROR', + LEAVE_PRESS_RECT: 'ERROR', + LONG_PRESS_DETECTED: 'ERROR' + }, + RESPONDER_INACTIVE_PRESS_IN: { + DELAY: 'RESPONDER_ACTIVE_PRESS_IN', + RESPONDER_GRANT: 'ERROR', + RESPONDER_RELEASE: 'NOT_RESPONDER', + RESPONDER_TERMINATED: 'NOT_RESPONDER', + ENTER_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_IN', + LEAVE_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_OUT', + LONG_PRESS_DETECTED: 'ERROR' + }, + RESPONDER_INACTIVE_PRESS_OUT: { + DELAY: 'RESPONDER_ACTIVE_PRESS_OUT', + RESPONDER_GRANT: 'ERROR', + RESPONDER_RELEASE: 'NOT_RESPONDER', + RESPONDER_TERMINATED: 'NOT_RESPONDER', + ENTER_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_IN', + LEAVE_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_OUT', + LONG_PRESS_DETECTED: 'ERROR' + }, + RESPONDER_ACTIVE_PRESS_IN: { + DELAY: 'ERROR', + RESPONDER_GRANT: 'ERROR', + RESPONDER_RELEASE: 'NOT_RESPONDER', + RESPONDER_TERMINATED: 'NOT_RESPONDER', + ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_IN', + LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_OUT', + LONG_PRESS_DETECTED: 'RESPONDER_ACTIVE_LONG_PRESS_IN' + }, + RESPONDER_ACTIVE_PRESS_OUT: { + DELAY: 'ERROR', + RESPONDER_GRANT: 'ERROR', + RESPONDER_RELEASE: 'NOT_RESPONDER', + RESPONDER_TERMINATED: 'NOT_RESPONDER', + ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_IN', + LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_OUT', + LONG_PRESS_DETECTED: 'ERROR' + }, + RESPONDER_ACTIVE_LONG_PRESS_IN: { + DELAY: 'ERROR', + RESPONDER_GRANT: 'ERROR', + RESPONDER_RELEASE: 'NOT_RESPONDER', + RESPONDER_TERMINATED: 'NOT_RESPONDER', + ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_IN', + LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT', + LONG_PRESS_DETECTED: 'RESPONDER_ACTIVE_LONG_PRESS_IN' + }, + RESPONDER_ACTIVE_LONG_PRESS_OUT: { + DELAY: 'ERROR', + RESPONDER_GRANT: 'ERROR', + RESPONDER_RELEASE: 'NOT_RESPONDER', + RESPONDER_TERMINATED: 'NOT_RESPONDER', + ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_IN', + LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT', + LONG_PRESS_DETECTED: 'ERROR' + }, + ERROR: { + DELAY: 'NOT_RESPONDER', + RESPONDER_GRANT: 'RESPONDER_INACTIVE_PRESS_IN', + RESPONDER_RELEASE: 'NOT_RESPONDER', + RESPONDER_TERMINATED: 'NOT_RESPONDER', + ENTER_PRESS_RECT: 'NOT_RESPONDER', + LEAVE_PRESS_RECT: 'NOT_RESPONDER', + LONG_PRESS_DETECTED: 'NOT_RESPONDER' + } + }); + var isActiveSignal = function isActiveSignal(signal) { + return signal === 'RESPONDER_ACTIVE_PRESS_IN' || signal === 'RESPONDER_ACTIVE_LONG_PRESS_IN'; + }; + var isActivationSignal = function isActivationSignal(signal) { + return signal === 'RESPONDER_ACTIVE_PRESS_OUT' || signal === 'RESPONDER_ACTIVE_PRESS_IN'; + }; + var isPressInSignal = function isPressInSignal(signal) { + return signal === 'RESPONDER_INACTIVE_PRESS_IN' || signal === 'RESPONDER_ACTIVE_PRESS_IN' || signal === 'RESPONDER_ACTIVE_LONG_PRESS_IN'; + }; + var isTerminalSignal = function isTerminalSignal(signal) { + return signal === 'RESPONDER_TERMINATED' || signal === 'RESPONDER_RELEASE'; + }; + var DEFAULT_LONG_PRESS_DELAY_MS = 500; + var DEFAULT_PRESS_RECT_OFFSETS = { + bottom: 30, + left: 20, + right: 20, + top: 20 + }; + var DEFAULT_MIN_PRESS_DURATION = 130; + var DEFAULT_LONG_PRESS_DEACTIVATION_DISTANCE = 10; + var longPressDeactivationDistance = DEFAULT_LONG_PRESS_DEACTIVATION_DISTANCE; + /** + * Pressability implements press handling capabilities. + * + * =========================== Pressability Tutorial =========================== + * + * The `Pressability` class helps you create press interactions by analyzing the + * geometry of elements and observing when another responder (e.g. ScrollView) + * has stolen the touch lock. It offers hooks for your component to provide + * interaction feedback to the user: + * + * - When a press has activated (e.g. highlight an element) + * - When a press has deactivated (e.g. un-highlight an element) + * - When a press should trigger an action, meaning it activated and deactivated + * while within the geometry of the element without the lock being stolen. + * + * A high quality interaction isn't as simple as you might think. There should + * be a slight delay before activation. Moving your finger beyond an element's + * bounds should trigger deactivation, but moving the same finger back within an + * element's bounds should trigger reactivation. + * + * In order to use `Pressability`, do the following: + * + * 1. Instantiate `Pressability` and store it on your component's state. + * + * state = { + * pressability: new Pressability({ + * // ... + * }), + * }; + * + * 2. Choose the rendered component who should collect the press events. On that + * element, spread `pressability.getEventHandlers()` into its props. + * + * return ( + * + * ); + * + * 3. Reset `Pressability` when your component unmounts. + * + * componentWillUnmount() { + * this.state.pressability.reset(); + * } + * + * ==================== Pressability Implementation Details ==================== + * + * `Pressability` only assumes that there exists a `HitRect` node. The `PressRect` + * is an abstract box that is extended beyond the `HitRect`. + * + * # Geometry + * + * ┌────────────────────────┐ + * │ ┌──────────────────┐ │ - Presses start anywhere within `HitRect`, which + * │ │ ┌────────────┐ │ │ is expanded via the prop `hitSlop`. + * │ │ │ VisualRect │ │ │ + * │ │ └────────────┘ │ │ - When pressed down for sufficient amount of time + * │ │ HitRect │ │ before letting up, `VisualRect` activates for + * │ └──────────────────┘ │ as long as the press stays within `PressRect`. + * │ PressRect o │ + * └────────────────────│───┘ + * Out Region └────── `PressRect`, which is expanded via the prop + * `pressRectOffset`, allows presses to move + * beyond `HitRect` while maintaining activation + * and being eligible for a "press". + * + * # State Machine + * + * ┌───────────────┐ ◀──── RESPONDER_RELEASE + * │ NOT_RESPONDER │ + * └───┬───────────┘ ◀──── RESPONDER_TERMINATED + * │ + * │ RESPONDER_GRANT (HitRect) + * │ + * ▼ + * ┌─────────────────────┐ ┌───────────────────┐ ┌───────────────────┐ + * │ RESPONDER_INACTIVE_ │ DELAY │ RESPONDER_ACTIVE_ │ T + DELAY │ RESPONDER_ACTIVE_ │ + * │ PRESS_IN ├────────▶ │ PRESS_IN ├────────────▶ │ LONG_PRESS_IN │ + * └─┬───────────────────┘ └─┬─────────────────┘ └─┬─────────────────┘ + * │ ▲ │ ▲ │ ▲ + * │LEAVE_ │ │LEAVE_ │ │LEAVE_ │ + * │PRESS_RECT │ENTER_ │PRESS_RECT │ENTER_ │PRESS_RECT │ENTER_ + * │ │PRESS_RECT │ │PRESS_RECT │ │PRESS_RECT + * ▼ │ ▼ │ ▼ │ + * ┌─────────────┴───────┐ ┌─────────────┴─────┐ ┌─────────────┴─────┐ + * │ RESPONDER_INACTIVE_ │ DELAY │ RESPONDER_ACTIVE_ │ │ RESPONDER_ACTIVE_ │ + * │ PRESS_OUT ├────────▶ │ PRESS_OUT │ │ LONG_PRESS_OUT │ + * └─────────────────────┘ └───────────────────┘ └───────────────────┘ + * + * T + DELAY => LONG_PRESS_DELAY + DELAY + * + * Not drawn are the side effects of each transition. The most important side + * effect is the invocation of `onPress` and `onLongPress` that occur when a + * responder is release while in the "press in" states. + */ + var Pressability = exports.default = /*#__PURE__*/function () { + function Pressability(config) { + var _this = this; + (0, _classCallCheck2.default)(this, Pressability); + this._eventHandlers = null; + this._hoverInDelayTimeout = null; + this._hoverOutDelayTimeout = null; + this._isHovered = false; + this._longPressDelayTimeout = null; + this._pressDelayTimeout = null; + this._pressOutDelayTimeout = null; + this._responderID = null; + this._responderRegion = null; + this._touchState = 'NOT_RESPONDER'; + this._measureCallback = function (left, top, width, height, pageX, pageY) { + if (!left && !top && !width && !height && !pageX && !pageY) { + return; + } + _this._responderRegion = { + bottom: pageY + height, + left: pageX, + right: pageX + width, + top: pageY + }; + }; + this.configure(config); + } + return (0, _createClass2.default)(Pressability, [{ + key: "configure", + value: function configure(config) { + this._config = config; + } + + /** + * Resets any pending timers. This should be called on unmount. + */ + }, { + key: "reset", + value: function reset() { + this._cancelHoverInDelayTimeout(); + this._cancelHoverOutDelayTimeout(); + this._cancelLongPressDelayTimeout(); + this._cancelPressDelayTimeout(); + this._cancelPressOutDelayTimeout(); + + // Ensure that, if any async event handlers are fired after unmount + // due to a race, we don't call any configured callbacks. + this._config = Object.freeze({}); + } + + /** + * Returns a set of props to spread into the interactive element. + */ + }, { + key: "getEventHandlers", + value: function getEventHandlers() { + if (this._eventHandlers == null) { + this._eventHandlers = this._createEventHandlers(); + } + return this._eventHandlers; + } + }, { + key: "_createEventHandlers", + value: function _createEventHandlers() { + var _this2 = this; + var focusEventHandlers = { + onBlur: function onBlur(event) { + var onBlur = _this2._config.onBlur; + if (onBlur != null) { + onBlur(event); + } + }, + onFocus: function onFocus(event) { + var onFocus = _this2._config.onFocus; + if (onFocus != null) { + onFocus(event); + } + } + }; + var responderEventHandlers = { + onStartShouldSetResponder: function onStartShouldSetResponder() { + var disabled = _this2._config.disabled; + if (disabled == null) { + var onStartShouldSetResponder_DEPRECATED = _this2._config.onStartShouldSetResponder_DEPRECATED; + return onStartShouldSetResponder_DEPRECATED == null ? true : onStartShouldSetResponder_DEPRECATED(); + } + return !disabled; + }, + onResponderGrant: function onResponderGrant(event) { + event.persist(); + _this2._cancelPressOutDelayTimeout(); + _this2._responderID = event.currentTarget; + _this2._touchState = 'NOT_RESPONDER'; + _this2._receiveSignal('RESPONDER_GRANT', event); + var delayPressIn = normalizeDelay(_this2._config.delayPressIn); + if (delayPressIn > 0) { + _this2._pressDelayTimeout = setTimeout(function () { + _this2._receiveSignal('DELAY', event); + }, delayPressIn); + } else { + _this2._receiveSignal('DELAY', event); + } + var delayLongPress = normalizeDelay(_this2._config.delayLongPress, 10, DEFAULT_LONG_PRESS_DELAY_MS - delayPressIn); + _this2._longPressDelayTimeout = setTimeout(function () { + _this2._handleLongPress(event); + }, delayLongPress + delayPressIn); + return _this2._config.blockNativeResponder === true; + }, + onResponderMove: function onResponderMove(event) { + var onPressMove = _this2._config.onPressMove; + if (onPressMove != null) { + onPressMove(event); + } + + // Region may not have finished being measured, yet. + var responderRegion = _this2._responderRegion; + if (responderRegion == null) { + return; + } + var touch = getTouchFromPressEvent(event); + if (touch == null) { + _this2._cancelLongPressDelayTimeout(); + _this2._receiveSignal('LEAVE_PRESS_RECT', event); + return; + } + if (_this2._touchActivatePosition != null) { + var deltaX = _this2._touchActivatePosition.pageX - touch.pageX; + var deltaY = _this2._touchActivatePosition.pageY - touch.pageY; + if (Math.hypot(deltaX, deltaY) > longPressDeactivationDistance) { + _this2._cancelLongPressDelayTimeout(); + } + } + if (_this2._isTouchWithinResponderRegion(touch, responderRegion)) { + _this2._receiveSignal('ENTER_PRESS_RECT', event); + } else { + _this2._cancelLongPressDelayTimeout(); + _this2._receiveSignal('LEAVE_PRESS_RECT', event); + } + }, + onResponderRelease: function onResponderRelease(event) { + _this2._receiveSignal('RESPONDER_RELEASE', event); + }, + onResponderTerminate: function onResponderTerminate(event) { + _this2._receiveSignal('RESPONDER_TERMINATED', event); + }, + onResponderTerminationRequest: function onResponderTerminationRequest() { + var cancelable = _this2._config.cancelable; + if (cancelable == null) { + var onResponderTerminationRequest_DEPRECATED = _this2._config.onResponderTerminationRequest_DEPRECATED; + return onResponderTerminationRequest_DEPRECATED == null ? true : onResponderTerminationRequest_DEPRECATED(); + } + return cancelable; + }, + onClick: function onClick(event) { + var _event$nativeEvent; + // If event has `pointerType`, it was emitted from a PointerEvent and + // we should ignore it to avoid triggering `onPress` twice. + if (event != null && (_event$nativeEvent = event.nativeEvent) != null && _event$nativeEvent.hasOwnProperty != null && _event$nativeEvent.hasOwnProperty('pointerType')) { + return; + } + + // for non-pointer click events (e.g. accessibility clicks), we should only dispatch when we're the "real" target + // in particular, we shouldn't respond to clicks from nested pressables + if ((event == null ? void 0 : event.currentTarget) !== (event == null ? void 0 : event.target)) { + event == null ? void 0 : event.stopPropagation(); + return; + } + var _this2$_config = _this2._config, + onPress = _this2$_config.onPress, + disabled = _this2$_config.disabled; + if (onPress != null && disabled !== true) { + onPress(event); + } + } + }; + if (process.env.NODE_ENV === 'test') { + // We are setting this in order to find this node in ReactNativeTestTools + // $FlowFixMe[prop-missing] + responderEventHandlers.onStartShouldSetResponder.testOnly_pressabilityConfig = function () { + return _this2._config; + }; + } + if (_ReactNativeFeatureFlags.default.shouldPressibilityUseW3CPointerEventsForHover()) { + var hoverPointerEvents = { + onPointerEnter: undefined, + onPointerLeave: undefined + }; + var _this$_config = this._config, + onHoverIn = _this$_config.onHoverIn, + onHoverOut = _this$_config.onHoverOut; + if (onHoverIn != null) { + hoverPointerEvents.onPointerEnter = function (event) { + _this2._isHovered = true; + _this2._cancelHoverOutDelayTimeout(); + if (onHoverIn != null) { + var delayHoverIn = normalizeDelay(_this2._config.delayHoverIn); + if (delayHoverIn > 0) { + event.persist(); + _this2._hoverInDelayTimeout = setTimeout(function () { + onHoverIn(convertPointerEventToMouseEvent(event)); + }, delayHoverIn); + } else { + onHoverIn(convertPointerEventToMouseEvent(event)); + } + } + }; + } + if (onHoverOut != null) { + hoverPointerEvents.onPointerLeave = function (event) { + if (_this2._isHovered) { + _this2._isHovered = false; + _this2._cancelHoverInDelayTimeout(); + if (onHoverOut != null) { + var delayHoverOut = normalizeDelay(_this2._config.delayHoverOut); + if (delayHoverOut > 0) { + event.persist(); + _this2._hoverOutDelayTimeout = setTimeout(function () { + onHoverOut(convertPointerEventToMouseEvent(event)); + }, delayHoverOut); + } else { + onHoverOut(convertPointerEventToMouseEvent(event)); + } + } + } + }; + } + return Object.assign({}, focusEventHandlers, responderEventHandlers, hoverPointerEvents); + } else { + var mouseEventHandlers = _Platform.default.OS === 'ios' || _Platform.default.OS === 'android' ? null : { + onMouseEnter: function onMouseEnter(event) { + if ((0, _$$_REQUIRE(_dependencyMap[10], "./HoverState").isHoverEnabled)()) { + _this2._isHovered = true; + _this2._cancelHoverOutDelayTimeout(); + var _onHoverIn = _this2._config.onHoverIn; + if (_onHoverIn != null) { + var delayHoverIn = normalizeDelay(_this2._config.delayHoverIn); + if (delayHoverIn > 0) { + event.persist(); + _this2._hoverInDelayTimeout = setTimeout(function () { + _onHoverIn(event); + }, delayHoverIn); + } else { + _onHoverIn(event); + } + } + } + }, + onMouseLeave: function onMouseLeave(event) { + if (_this2._isHovered) { + _this2._isHovered = false; + _this2._cancelHoverInDelayTimeout(); + var _onHoverOut = _this2._config.onHoverOut; + if (_onHoverOut != null) { + var delayHoverOut = normalizeDelay(_this2._config.delayHoverOut); + if (delayHoverOut > 0) { + event.persist(); + _this2._hoverInDelayTimeout = setTimeout(function () { + _onHoverOut(event); + }, delayHoverOut); + } else { + _onHoverOut(event); + } + } + } + } + }; + return Object.assign({}, focusEventHandlers, responderEventHandlers, mouseEventHandlers); + } + } + + /** + * Receives a state machine signal, performs side effects of the transition + * and stores the new state. Validates the transition as well. + */ + }, { + key: "_receiveSignal", + value: function _receiveSignal(signal, event) { + var _Transitions$prevStat; + // Especially on iOS, not all events have timestamps associated. + // For telemetry purposes, this doesn't matter too much, as long as *some* do. + // Since the native timestamp is integral for logging telemetry, just skip + // events if they don't have a timestamp attached. + if (event.nativeEvent.timestamp != null) { + _PressabilityPerformanceEventEmitter.default.emitEvent(function () { + return { + signal: signal, + nativeTimestamp: event.nativeEvent.timestamp + }; + }); + } + var prevState = this._touchState; + var nextState = (_Transitions$prevStat = Transitions[prevState]) == null ? void 0 : _Transitions$prevStat[signal]; + if (this._responderID == null && signal === 'RESPONDER_RELEASE') { + return; + } + (0, _invariant.default)(nextState != null && nextState !== 'ERROR', 'Pressability: Invalid signal `%s` for state `%s` on responder: %s', signal, prevState, typeof this._responderID === 'number' ? this._responderID : '<>'); + if (prevState !== nextState) { + this._performTransitionSideEffects(prevState, nextState, signal, event); + this._touchState = nextState; + } + } + + /** + * Performs a transition between touchable states and identify any activations + * or deactivations (and callback invocations). + */ + }, { + key: "_performTransitionSideEffects", + value: function _performTransitionSideEffects(prevState, nextState, signal, event) { + if (isTerminalSignal(signal)) { + this._touchActivatePosition = null; + this._cancelLongPressDelayTimeout(); + } + var isInitialTransition = prevState === 'NOT_RESPONDER' && nextState === 'RESPONDER_INACTIVE_PRESS_IN'; + var isActivationTransition = !isActivationSignal(prevState) && isActivationSignal(nextState); + if (isInitialTransition || isActivationTransition) { + this._measureResponderRegion(); + } + if (isPressInSignal(prevState) && signal === 'LONG_PRESS_DETECTED') { + var onLongPress = this._config.onLongPress; + if (onLongPress != null) { + onLongPress(event); + } + } + var isPrevActive = isActiveSignal(prevState); + var isNextActive = isActiveSignal(nextState); + if (!isPrevActive && isNextActive) { + this._activate(event); + } else if (isPrevActive && !isNextActive) { + this._deactivate(event); + } + if (isPressInSignal(prevState) && signal === 'RESPONDER_RELEASE') { + // If we never activated (due to delays), activate and deactivate now. + if (!isNextActive && !isPrevActive) { + this._activate(event); + this._deactivate(event); + } + var _this$_config2 = this._config, + _onLongPress = _this$_config2.onLongPress, + onPress = _this$_config2.onPress, + android_disableSound = _this$_config2.android_disableSound; + if (onPress != null) { + var isPressCanceledByLongPress = _onLongPress != null && prevState === 'RESPONDER_ACTIVE_LONG_PRESS_IN' && this._shouldLongPressCancelPress(); + if (!isPressCanceledByLongPress) { + if (_Platform.default.OS === 'android' && android_disableSound !== true) { + _SoundManager.default.playTouchSound(); + } + onPress(event); + } + } + } + this._cancelPressDelayTimeout(); + } + }, { + key: "_activate", + value: function _activate(event) { + var onPressIn = this._config.onPressIn; + var _getTouchFromPressEve = getTouchFromPressEvent(event), + pageX = _getTouchFromPressEve.pageX, + pageY = _getTouchFromPressEve.pageY; + this._touchActivatePosition = { + pageX: pageX, + pageY: pageY + }; + this._touchActivateTime = Date.now(); + if (onPressIn != null) { + onPressIn(event); + } + } + }, { + key: "_deactivate", + value: function _deactivate(event) { + var onPressOut = this._config.onPressOut; + if (onPressOut != null) { + var _this$_touchActivateT; + var minPressDuration = normalizeDelay(this._config.minPressDuration, 0, DEFAULT_MIN_PRESS_DURATION); + var pressDuration = Date.now() - ((_this$_touchActivateT = this._touchActivateTime) != null ? _this$_touchActivateT : 0); + var delayPressOut = Math.max(minPressDuration - pressDuration, normalizeDelay(this._config.delayPressOut)); + if (delayPressOut > 0) { + event.persist(); + this._pressOutDelayTimeout = setTimeout(function () { + onPressOut(event); + }, delayPressOut); + } else { + onPressOut(event); + } + } + this._touchActivateTime = null; + } + }, { + key: "_measureResponderRegion", + value: function _measureResponderRegion() { + if (this._responderID == null) { + return; + } + if (typeof this._responderID === 'number') { + _UIManager.default.measure(this._responderID, this._measureCallback); + } else { + this._responderID.measure(this._measureCallback); + } + } + }, { + key: "_isTouchWithinResponderRegion", + value: function _isTouchWithinResponderRegion(touch, responderRegion) { + var _pressRectOffset$bott, _pressRectOffset$left, _pressRectOffset$righ, _pressRectOffset$top; + var hitSlop = (0, _$$_REQUIRE(_dependencyMap[11], "../StyleSheet/Rect").normalizeRect)(this._config.hitSlop); + var pressRectOffset = (0, _$$_REQUIRE(_dependencyMap[11], "../StyleSheet/Rect").normalizeRect)(this._config.pressRectOffset); + var regionBottom = responderRegion.bottom; + var regionLeft = responderRegion.left; + var regionRight = responderRegion.right; + var regionTop = responderRegion.top; + if (hitSlop != null) { + if (hitSlop.bottom != null) { + regionBottom += hitSlop.bottom; + } + if (hitSlop.left != null) { + regionLeft -= hitSlop.left; + } + if (hitSlop.right != null) { + regionRight += hitSlop.right; + } + if (hitSlop.top != null) { + regionTop -= hitSlop.top; + } + } + regionBottom += (_pressRectOffset$bott = pressRectOffset == null ? void 0 : pressRectOffset.bottom) != null ? _pressRectOffset$bott : DEFAULT_PRESS_RECT_OFFSETS.bottom; + regionLeft -= (_pressRectOffset$left = pressRectOffset == null ? void 0 : pressRectOffset.left) != null ? _pressRectOffset$left : DEFAULT_PRESS_RECT_OFFSETS.left; + regionRight += (_pressRectOffset$righ = pressRectOffset == null ? void 0 : pressRectOffset.right) != null ? _pressRectOffset$righ : DEFAULT_PRESS_RECT_OFFSETS.right; + regionTop -= (_pressRectOffset$top = pressRectOffset == null ? void 0 : pressRectOffset.top) != null ? _pressRectOffset$top : DEFAULT_PRESS_RECT_OFFSETS.top; + return touch.pageX > regionLeft && touch.pageX < regionRight && touch.pageY > regionTop && touch.pageY < regionBottom; + } + }, { + key: "_handleLongPress", + value: function _handleLongPress(event) { + if (this._touchState === 'RESPONDER_ACTIVE_PRESS_IN' || this._touchState === 'RESPONDER_ACTIVE_LONG_PRESS_IN') { + this._receiveSignal('LONG_PRESS_DETECTED', event); + } + } + }, { + key: "_shouldLongPressCancelPress", + value: function _shouldLongPressCancelPress() { + return this._config.onLongPressShouldCancelPress_DEPRECATED == null || this._config.onLongPressShouldCancelPress_DEPRECATED(); + } + }, { + key: "_cancelHoverInDelayTimeout", + value: function _cancelHoverInDelayTimeout() { + if (this._hoverInDelayTimeout != null) { + clearTimeout(this._hoverInDelayTimeout); + this._hoverInDelayTimeout = null; + } + } + }, { + key: "_cancelHoverOutDelayTimeout", + value: function _cancelHoverOutDelayTimeout() { + if (this._hoverOutDelayTimeout != null) { + clearTimeout(this._hoverOutDelayTimeout); + this._hoverOutDelayTimeout = null; + } + } + }, { + key: "_cancelLongPressDelayTimeout", + value: function _cancelLongPressDelayTimeout() { + if (this._longPressDelayTimeout != null) { + clearTimeout(this._longPressDelayTimeout); + this._longPressDelayTimeout = null; + } + } + }, { + key: "_cancelPressDelayTimeout", + value: function _cancelPressDelayTimeout() { + if (this._pressDelayTimeout != null) { + clearTimeout(this._pressDelayTimeout); + this._pressDelayTimeout = null; + } + } + }, { + key: "_cancelPressOutDelayTimeout", + value: function _cancelPressOutDelayTimeout() { + if (this._pressOutDelayTimeout != null) { + clearTimeout(this._pressOutDelayTimeout); + this._pressOutDelayTimeout = null; + } + } + }], [{ + key: "setLongPressDeactivationDistance", + value: function setLongPressDeactivationDistance(distance) { + longPressDeactivationDistance = distance; + } + }]); + }(); + function normalizeDelay(delay) { + var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var fallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + return Math.max(min, delay != null ? delay : fallback); + } + var getTouchFromPressEvent = function getTouchFromPressEvent(event) { + var _event$nativeEvent2 = event.nativeEvent, + changedTouches = _event$nativeEvent2.changedTouches, + touches = _event$nativeEvent2.touches; + if (touches != null && touches.length > 0) { + return touches[0]; + } + if (changedTouches != null && changedTouches.length > 0) { + return changedTouches[0]; + } + return event.nativeEvent; + }; + function convertPointerEventToMouseEvent(input) { + var _input$nativeEvent = input.nativeEvent, + clientX = _input$nativeEvent.clientX, + clientY = _input$nativeEvent.clientY; + return Object.assign({}, input, { + nativeEvent: { + clientX: clientX, + clientY: clientY, + pageX: clientX, + pageY: clientY, + timestamp: input.timeStamp + } + }); + } +},312,[6,18,19,313,157,51,34,315,37,65,316,305],"node_modules\\react-native\\Libraries\\Pressability\\Pressability.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _NativeSoundManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./NativeSoundManager")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var SoundManager = { + playTouchSound: function playTouchSound() { + if (_NativeSoundManager.default) { + _NativeSoundManager.default.playTouchSound(); + } + } + }; + module.exports = SoundManager; +},313,[6,314],"node_modules\\react-native\\Libraries\\Components\\Sound\\SoundManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + /** + * Native Module used for playing sounds in native platform. + */ + var _default = exports.default = TurboModuleRegistry.get('SoundManager'); +},314,[36],"node_modules\\react-native\\Libraries\\Components\\Sound\\NativeSoundManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var PressabilityPerformanceEventEmitter = /*#__PURE__*/function () { + function PressabilityPerformanceEventEmitter() { + (0, _classCallCheck2.default)(this, PressabilityPerformanceEventEmitter); + this._listeners = []; + } + return (0, _createClass2.default)(PressabilityPerformanceEventEmitter, [{ + key: "addListener", + value: function addListener(listener) { + this._listeners.push(listener); + } + }, { + key: "removeListener", + value: function removeListener(listener) { + var index = this._listeners.indexOf(listener); + if (index > -1) { + this._listeners.splice(index, 1); + } + } + }, { + key: "emitEvent", + value: function emitEvent(constructEvent) { + if (this._listeners.length === 0) { + return; + } + var event = constructEvent(); + this._listeners.forEach(function (listener) { + return listener(event); + }); + } + }]); + }(); + var PressabilityPerformanceEventEmitterSingleton = new PressabilityPerformanceEventEmitter(); + var _default = exports.default = PressabilityPerformanceEventEmitterSingleton; +},315,[6,18,19],"node_modules\\react-native\\Libraries\\Pressability\\PressabilityPerformanceEventEmitter.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.isHoverEnabled = isHoverEnabled; + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../Utilities/Platform")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var isEnabled = false; + if (_Platform.default.OS === 'web') { + var canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement); + if (canUseDOM) { + /** + * Web browsers emulate mouse events (and hover states) after touch events. + * This code infers when the currently-in-use modality supports hover + * (including for multi-modality devices) and considers "hover" to be enabled + * if a mouse movement occurs more than 1 second after the last touch event. + * This threshold is long enough to account for longer delays between the + * browser firing touch and mouse events on low-powered devices. + */ + var HOVER_THRESHOLD_MS = 1000; + var lastTouchTimestamp = 0; + var enableHover = function enableHover() { + if (isEnabled || Date.now() - lastTouchTimestamp < HOVER_THRESHOLD_MS) { + return; + } + isEnabled = true; + }; + var disableHover = function disableHover() { + lastTouchTimestamp = Date.now(); + if (isEnabled) { + isEnabled = false; + } + }; + document.addEventListener('touchstart', disableHover, true); + document.addEventListener('touchmove', disableHover, true); + document.addEventListener('mousemove', enableHover, true); + } + } + function isHoverEnabled() { + return isEnabled; + } +},316,[6,34],"node_modules\\react-native\\Libraries\\Pressability\\HoverState.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NativeVirtualText = exports.NativeText = void 0; + var _UIManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../ReactNative/UIManager")); + var _createReactNativeComponentClass = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../Renderer/shims/createReactNativeComponentClass")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var textViewConfig = { + validAttributes: { + isHighlighted: true, + isPressable: true, + numberOfLines: true, + ellipsizeMode: true, + allowFontScaling: true, + dynamicTypeRamp: true, + maxFontSizeMultiplier: true, + disabled: true, + selectable: true, + selectionColor: true, + adjustsFontSizeToFit: true, + minimumFontScale: true, + textBreakStrategy: true, + onTextLayout: true, + onInlineViewLayout: true, + dataDetectorType: true, + android_hyphenationFrequency: true, + lineBreakStrategyIOS: true + }, + directEventTypes: { + topTextLayout: { + registrationName: 'onTextLayout' + }, + topInlineViewLayout: { + registrationName: 'onInlineViewLayout' + } + }, + uiViewClassName: 'RCTText' + }; + var virtualTextViewConfig = { + validAttributes: { + isHighlighted: true, + isPressable: true, + maxFontSizeMultiplier: true + }, + uiViewClassName: 'RCTVirtualText' + }; + var NativeText = exports.NativeText = (0, _createReactNativeComponentClass.default)('RCTText', function () { + return (0, _$$_REQUIRE(_dependencyMap[3], "../NativeComponent/ViewConfig").createViewConfig)(textViewConfig); + }); + var NativeVirtualText = exports.NativeVirtualText = !global.RN$Bridgeless && !_UIManager.default.hasViewManagerConfig('RCTVirtualText') ? NativeText : (0, _createReactNativeComponentClass.default)('RCTVirtualText', function () { + return (0, _$$_REQUIRE(_dependencyMap[3], "../NativeComponent/ViewConfig").createViewConfig)(virtualTextViewConfig); + }); +},317,[6,51,278,264],"node_modules\\react-native\\Libraries\\Text\\TextNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + module.exports = { + get ColorPropType() { + return _$$_REQUIRE(_dependencyMap[0], "./DeprecatedColorPropType"); + }, + get EdgeInsetsPropType() { + return _$$_REQUIRE(_dependencyMap[1], "./DeprecatedEdgeInsetsPropType"); + }, + get ImagePropTypes() { + return _$$_REQUIRE(_dependencyMap[2], "./DeprecatedImagePropType"); + }, + get PointPropType() { + return _$$_REQUIRE(_dependencyMap[3], "./DeprecatedPointPropType"); + }, + get TextInputPropTypes() { + return _$$_REQUIRE(_dependencyMap[4], "./DeprecatedTextInputPropTypes"); + }, + get TextPropTypes() { + return _$$_REQUIRE(_dependencyMap[5], "./DeprecatedTextPropTypes"); + }, + get ViewPropTypes() { + return _$$_REQUIRE(_dependencyMap[6], "./DeprecatedViewPropTypes"); + } + }; +},318,[319,320,331,342,343,344,332],"node_modules\\deprecated-react-native-prop-types\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * @see facebook/react-native/Libraries/StyleSheet/StyleSheetTypes.js + */ + var colorPropType = function colorPropType(isRequired, props, propName, componentName, location, propFullName) { + var color = props[propName]; + if (color == null) { + if (isRequired) { + return new Error('Required ' + location + ' `' + (propFullName || propName) + '` was not specified in `' + componentName + '`.'); + } + return; + } + if (typeof color === 'number') { + // Developers should not use a number, but we are using the prop type + // both for user provided colors and for transformed ones. This isn't ideal + // and should be fixed but will do for now... + return; + } + if (typeof color === 'string' && _$$_REQUIRE(_dependencyMap[0], "@react-native/normalize-colors")(color) === null) { + return new Error('Invalid ' + location + ' `' + (propFullName || propName) + '` supplied to `' + componentName + '`: ' + color + '\n' + `Valid color formats are + - '#f0f' (#rgb) + - '#f0fc' (#rgba) + - '#ff00ff' (#rrggbb) + - '#ff00ff00' (#rrggbbaa) + - 'rgb(255, 255, 255)' + - 'rgba(255, 255, 255, 1.0)' + - 'hsl(360, 100%, 100%)' + - 'hsla(360, 100%, 100%, 1.0)' + - 'transparent' + - 'red' + - 0xff00ff00 (0xrrggbbaa) +`); + } + }; + var ColorPropType = colorPropType.bind(null, false /* isRequired */); + ColorPropType.isRequired = colorPropType.bind(null, true /* isRequired */); + module.exports = ColorPropType; +},319,[191],"node_modules\\deprecated-react-native-prop-types\\DeprecatedColorPropType.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * @see facebook/react-native/Libraries/StyleSheet/Rect.js + */ + var DeprecatedEdgeInsetsPropType = _$$_REQUIRE(_dependencyMap[0], "prop-types").shape({ + bottom: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + left: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + right: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + top: _$$_REQUIRE(_dependencyMap[0], "prop-types").number + }); + module.exports = DeprecatedEdgeInsetsPropType; +},320,[321],"node_modules\\deprecated-react-native-prop-types\\DeprecatedEdgeInsetsPropType.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + if (process.env.NODE_ENV !== 'production') { + var ReactIs = _$$_REQUIRE(_dependencyMap[0], "react-is"); + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = _$$_REQUIRE(_dependencyMap[1], "./factoryWithTypeCheckers")(ReactIs.isElement, throwOnDirectAccess); + } else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = _$$_REQUIRE(_dependencyMap[2], "./factoryWithThrowingShims")(); + } +},321,[322,325,330],"node_modules\\prop-types\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + if (process.env.NODE_ENV === 'production') { + module.exports = _$$_REQUIRE(_dependencyMap[0], "./cjs/react-is.production.min.js"); + } else { + module.exports = _$$_REQUIRE(_dependencyMap[1], "./cjs/react-is.development.js"); + } +},322,[323,324],"node_modules\\prop-types\\node_modules\\react-is\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** @license React v16.13.1 + * react-is.production.min.js + * + * 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. + */ + + 'use strict'; + + var b = "function" === typeof Symbol && Symbol.for, + c = b ? Symbol.for("react.element") : 60103, + d = b ? Symbol.for("react.portal") : 60106, + e = b ? Symbol.for("react.fragment") : 60107, + f = b ? Symbol.for("react.strict_mode") : 60108, + g = b ? Symbol.for("react.profiler") : 60114, + h = b ? Symbol.for("react.provider") : 60109, + k = b ? Symbol.for("react.context") : 60110, + l = b ? Symbol.for("react.async_mode") : 60111, + m = b ? Symbol.for("react.concurrent_mode") : 60111, + n = b ? Symbol.for("react.forward_ref") : 60112, + p = b ? Symbol.for("react.suspense") : 60113, + q = b ? Symbol.for("react.suspense_list") : 60120, + r = b ? Symbol.for("react.memo") : 60115, + t = b ? Symbol.for("react.lazy") : 60116, + v = b ? Symbol.for("react.block") : 60121, + w = b ? Symbol.for("react.fundamental") : 60117, + x = b ? Symbol.for("react.responder") : 60118, + y = b ? Symbol.for("react.scope") : 60119; + function z(a) { + if ("object" === typeof a && null !== a) { + var u = a.$$typeof; + switch (u) { + case c: + switch (a = a.type, a) { + case l: + case m: + case e: + case g: + case f: + case p: + return a; + default: + switch (a = a && a.$$typeof, a) { + case k: + case n: + case t: + case r: + case h: + return a; + default: + return u; + } + } + case d: + return u; + } + } + } + function A(a) { + return z(a) === m; + } + exports.AsyncMode = l; + exports.ConcurrentMode = m; + exports.ContextConsumer = k; + exports.ContextProvider = h; + exports.Element = c; + exports.ForwardRef = n; + exports.Fragment = e; + exports.Lazy = t; + exports.Memo = r; + exports.Portal = d; + exports.Profiler = g; + exports.StrictMode = f; + exports.Suspense = p; + exports.isAsyncMode = function (a) { + return A(a) || z(a) === l; + }; + exports.isConcurrentMode = A; + exports.isContextConsumer = function (a) { + return z(a) === k; + }; + exports.isContextProvider = function (a) { + return z(a) === h; + }; + exports.isElement = function (a) { + return "object" === typeof a && null !== a && a.$$typeof === c; + }; + exports.isForwardRef = function (a) { + return z(a) === n; + }; + exports.isFragment = function (a) { + return z(a) === e; + }; + exports.isLazy = function (a) { + return z(a) === t; + }; + exports.isMemo = function (a) { + return z(a) === r; + }; + exports.isPortal = function (a) { + return z(a) === d; + }; + exports.isProfiler = function (a) { + return z(a) === g; + }; + exports.isStrictMode = function (a) { + return z(a) === f; + }; + exports.isSuspense = function (a) { + return z(a) === p; + }; + exports.isValidElementType = function (a) { + return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v); + }; + exports.typeOf = z; +},323,[],"node_modules\\prop-types\\node_modules\\react-is\\cjs\\react-is.production.min.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** @license React v16.13.1 + * react-is.development.js + * + * 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. + */ + + 'use strict'; + + if (process.env.NODE_ENV !== "production") { + (function () { + 'use strict'; + + // The Symbol used to tag the ReactElement-like types. If there is no native Symbol + // nor polyfill, then a plain number is used for performance. + var hasSymbol = typeof Symbol === 'function' && Symbol.for; + var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary + // (unstable) APIs that have been removed. Can we remove the symbols? + + var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; + var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; + var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; + var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; + var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; + function isValidElementType(type) { + return typeof type === 'string' || typeof type === 'function' || + // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); + } + function typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; + default: + var $$typeofType = type && type.$$typeof; + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + default: + return $$typeof; + } + } + case REACT_PORTAL_TYPE: + return $$typeof; + } + } + return undefined; + } // AsyncMode is deprecated along with isAsyncMode + + var AsyncMode = REACT_ASYNC_MODE_TYPE; + var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; + var ContextConsumer = REACT_CONTEXT_TYPE; + var ContextProvider = REACT_PROVIDER_TYPE; + var Element = REACT_ELEMENT_TYPE; + var ForwardRef = REACT_FORWARD_REF_TYPE; + var Fragment = REACT_FRAGMENT_TYPE; + var Lazy = REACT_LAZY_TYPE; + var Memo = REACT_MEMO_TYPE; + var Portal = REACT_PORTAL_TYPE; + var Profiler = REACT_PROFILER_TYPE; + var StrictMode = REACT_STRICT_MODE_TYPE; + var Suspense = REACT_SUSPENSE_TYPE; + var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated + + function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint + + console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); + } + } + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; + } + function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; + } + function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; + } + function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; + } + function isElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } + function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; + } + function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; + } + function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; + } + function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; + } + function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; + } + function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; + } + function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; + } + function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; + } + exports.AsyncMode = AsyncMode; + exports.ConcurrentMode = ConcurrentMode; + exports.ContextConsumer = ContextConsumer; + exports.ContextProvider = ContextProvider; + exports.Element = Element; + exports.ForwardRef = ForwardRef; + exports.Fragment = Fragment; + exports.Lazy = Lazy; + exports.Memo = Memo; + exports.Portal = Portal; + exports.Profiler = Profiler; + exports.StrictMode = StrictMode; + exports.Suspense = Suspense; + exports.isAsyncMode = isAsyncMode; + exports.isConcurrentMode = isConcurrentMode; + exports.isContextConsumer = isContextConsumer; + exports.isContextProvider = isContextProvider; + exports.isElement = isElement; + exports.isForwardRef = isForwardRef; + exports.isFragment = isFragment; + exports.isLazy = isLazy; + exports.isMemo = isMemo; + exports.isPortal = isPortal; + exports.isProfiler = isProfiler; + exports.isStrictMode = isStrictMode; + exports.isSuspense = isSuspense; + exports.isValidElementType = isValidElementType; + exports.typeOf = typeOf; + })(); + } +},324,[],"node_modules\\prop-types\\node_modules\\react-is\\cjs\\react-is.development.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + 'use strict'; + + var printWarning = function printWarning() {}; + if (process.env.NODE_ENV !== 'production') { + printWarning = function printWarning(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + } + function emptyFunctionThatReturnsNull() { + return null; + } + module.exports = function (isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bigint: createPrimitiveTypeChecker('bigint'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + elementType: createElementTypeTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message, data) { + this.message = message; + this.data = data && typeof data === 'object' ? data : {}; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + function createChainableTypeChecker(validate) { + if (process.env.NODE_ENV !== 'production') { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + if (secret !== _$$_REQUIRE(_dependencyMap[0], "./lib/ReactPropTypesSecret")) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types'); + err.name = 'Invariant Violation'; + throw err; + } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if (!manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3) { + printWarning('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + return chainedCheckType; + } + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), { + expectedType: expectedType + }); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', _$$_REQUIRE(_dependencyMap[0], "./lib/ReactPropTypesSecret")); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createElementTypeTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!_$$_REQUIRE(_dependencyMap[1], "react-is").isValidElementType(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + if (process.env.NODE_ENV !== 'production') { + if (arguments.length > 1) { + printWarning('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'); + } else { + printWarning('Invalid argument supplied to oneOf, expected an array.'); + } + } + return emptyFunctionThatReturnsNull; + } + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { + var type = getPreciseType(value); + if (type === 'symbol') { + return String(value); + } + return value; + }); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (_$$_REQUIRE(_dependencyMap[2], "./lib/has")(propValue, key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, _$$_REQUIRE(_dependencyMap[0], "./lib/ReactPropTypesSecret")); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunctionThatReturnsNull; + } + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'); + return emptyFunctionThatReturnsNull; + } + } + function validate(props, propName, componentName, location, propFullName) { + var expectedTypes = []; + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + var checkerResult = checker(props, propName, componentName, location, propFullName, _$$_REQUIRE(_dependencyMap[0], "./lib/ReactPropTypesSecret")); + if (checkerResult == null) { + return null; + } + if (checkerResult.data && _$$_REQUIRE(_dependencyMap[2], "./lib/has")(checkerResult.data, 'expectedType')) { + expectedTypes.push(checkerResult.data.expectedType); + } + } + var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : ''; + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); + } + return createChainableTypeChecker(validate); + } + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + function invalidValidatorError(componentName, location, propFullName, key, type) { + return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'); + } + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (typeof checker !== 'function') { + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, _$$_REQUIRE(_dependencyMap[0], "./lib/ReactPropTypesSecret")); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from props. + var allKeys = _$$_REQUIRE(_dependencyMap[3], "object-assign")({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (_$$_REQUIRE(_dependencyMap[2], "./lib/has")(shapeTypes, key) && typeof checker !== 'function') { + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); + } + if (!checker) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, _$$_REQUIRE(_dependencyMap[0], "./lib/ReactPropTypesSecret")); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + return true; + default: + return false; + } + } + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // falsy value can't be a Symbol + if (!propValue) { + return false; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + ReactPropTypes.checkPropTypes = _$$_REQUIRE(_dependencyMap[4], "./checkPropTypes"); + ReactPropTypes.resetWarningCache = _$$_REQUIRE(_dependencyMap[4], "./checkPropTypes").resetWarningCache; + ReactPropTypes.PropTypes = ReactPropTypes; + return ReactPropTypes; + }; +},325,[326,322,327,328,329],"node_modules\\prop-types\\factoryWithTypeCheckers.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + 'use strict'; + + var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + module.exports = ReactPropTypesSecret; +},326,[],"node_modules\\prop-types\\lib\\ReactPropTypesSecret.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = Function.call.bind(Object.prototype.hasOwnProperty); +},327,[],"node_modules\\prop-types\\lib\\has.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /* + object-assign + (c) Sindre Sorhus + @license MIT + */ + + 'use strict'; + + /* eslint-disable no-unused-vars */ + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + return Object(val); + } + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { + return false; + } + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } + } + module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + return to; + }; +},328,[],"node_modules\\object-assign\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + 'use strict'; + + var printWarning = function printWarning() {}; + if (process.env.NODE_ENV !== 'production') { + var ReactPropTypesSecret = _$$_REQUIRE(_dependencyMap[0], "./lib/ReactPropTypesSecret"); + var loggedTypeFailures = {}; + var has = _$$_REQUIRE(_dependencyMap[1], "./lib/has"); + printWarning = function printWarning(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {/**/} + }; + } + + /** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ + function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (process.env.NODE_ENV !== 'production') { + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); + err.name = 'Invariant Violation'; + throw err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).'); + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + var stack = getStack ? getStack() : ''; + printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')); + } + } + } + } + } + + /** + * Resets warning cache when testing. + * + * @private + */ + checkPropTypes.resetWarningCache = function () { + if (process.env.NODE_ENV !== 'production') { + loggedTypeFailures = {}; + } + }; + module.exports = checkPropTypes; +},329,[326,327],"node_modules\\prop-types\\checkPropTypes.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + 'use strict'; + + function emptyFunction() {} + function emptyFunctionWithReset() {} + emptyFunctionWithReset.resetWarningCache = emptyFunction; + module.exports = function () { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret === _$$_REQUIRE(_dependencyMap[0], "./lib/ReactPropTypesSecret")) { + // It is still safe when called from React. + return; + } + var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types'); + err.name = 'Invariant Violation'; + throw err; + } + ; + shim.isRequired = shim; + function getShim() { + return shim; + } + ; + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + var ReactPropTypes = { + array: shim, + bigint: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + any: shim, + arrayOf: getShim, + element: shim, + elementType: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim, + exact: getShim, + checkPropTypes: emptyFunctionWithReset, + resetWarningCache: emptyFunction + }; + ReactPropTypes.PropTypes = ReactPropTypes; + return ReactPropTypes; + }; +},330,[326],"node_modules\\prop-types\\factoryWithThrowingShims.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * @see facebook/react-native/Libraries/Image/ImageProps.js + */ + var DeprecatedImagePropType = Object.assign({}, _$$_REQUIRE(_dependencyMap[0], "./DeprecatedViewPropTypes"), { + alt: _$$_REQUIRE(_dependencyMap[1], "prop-types").string, + blurRadius: _$$_REQUIRE(_dependencyMap[1], "prop-types").number, + capInsets: _$$_REQUIRE(_dependencyMap[2], "./DeprecatedEdgeInsetsPropType"), + crossOrigin: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['anonymous', 'use-credentials']), + defaultSource: _$$_REQUIRE(_dependencyMap[3], "./DeprecatedImageSourcePropType"), + fadeDuration: _$$_REQUIRE(_dependencyMap[1], "prop-types").number, + height: _$$_REQUIRE(_dependencyMap[1], "prop-types").number, + internal_analyticTag: _$$_REQUIRE(_dependencyMap[1], "prop-types").string, + loadingIndicatorSource: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOfType([_$$_REQUIRE(_dependencyMap[1], "prop-types").shape({ + uri: _$$_REQUIRE(_dependencyMap[1], "prop-types").string + }), _$$_REQUIRE(_dependencyMap[1], "prop-types").number]), + onError: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onLoad: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onLoadEnd: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onLoadStart: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onPartialLoad: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onProgress: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + progressiveRenderingEnabled: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + referrerPolicy: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url']), + resizeMethod: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['auto', 'resize', 'scale']), + resizeMode: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['cover', 'contain', 'stretch', 'repeat', 'center']), + source: _$$_REQUIRE(_dependencyMap[3], "./DeprecatedImageSourcePropType"), + src: _$$_REQUIRE(_dependencyMap[1], "prop-types").string, + srcSet: _$$_REQUIRE(_dependencyMap[1], "prop-types").string, + style: _$$_REQUIRE(_dependencyMap[4], "./DeprecatedStyleSheetPropType")(_$$_REQUIRE(_dependencyMap[5], "./DeprecatedImageStylePropTypes")), + testID: _$$_REQUIRE(_dependencyMap[1], "prop-types").string, + tintColor: _$$_REQUIRE(_dependencyMap[6], "./DeprecatedColorPropType"), + width: _$$_REQUIRE(_dependencyMap[1], "prop-types").number + }); + module.exports = DeprecatedImagePropType; +},331,[332,321,320,340,334,341,319],"node_modules\\deprecated-react-native-prop-types\\DeprecatedImagePropType.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var MouseEventPropTypes = { + onMouseEnter: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onMouseLeave: _$$_REQUIRE(_dependencyMap[0], "prop-types").func + }; + + // Experimental/Work in Progress Pointer Event Callbacks (not yet ready for use) + var PointerEventPropTypes = { + onPointerEnter: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPointerEnterCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPointerLeave: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPointerLeaveCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPointerMove: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPointerMoveCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPointerCancel: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPointerCancelCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPointerDown: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPointerDownCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPointerUp: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPointerUpCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPointerOver: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPointerOverCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPointerOut: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPointerOutCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func + }; + var FocusEventPropTypes = { + onBlur: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onBlurCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onFocus: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onFocusCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func + }; + var TouchEventPropTypes = { + onTouchCancel: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onTouchCancelCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onTouchEnd: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onTouchEndCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onTouchMove: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onTouchMoveCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onTouchStart: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onTouchStartCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func + }; + var GestureResponderEventPropTypes = { + onMoveShouldSetResponder: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onMoveShouldSetResponderCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onResponderEnd: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onResponderGrant: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onResponderMove: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onResponderReject: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onResponderRelease: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onResponderStart: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onResponderTerminate: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onResponderTerminationRequest: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onStartShouldSetResponder: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onStartShouldSetResponderCapture: _$$_REQUIRE(_dependencyMap[0], "prop-types").func + }; + + /** + * @see facebook/react-native/Libraries/Components/View/ViewPropTypes.js + */ + var DeprecatedViewPropTypes = Object.assign({}, MouseEventPropTypes, PointerEventPropTypes, FocusEventPropTypes, TouchEventPropTypes, GestureResponderEventPropTypes, { + 'aria-busy': _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + 'aria-checked': _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOfType([_$$_REQUIRE(_dependencyMap[0], "prop-types").bool, _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['mixed'])]), + 'aria-disabled': _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + 'aria-expanded': _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + 'aria-hidden': _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + 'aria-label': _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + 'aria-labelledby': _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + 'aria-live': _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['polite', 'assertive', 'off']), + 'aria-modal': _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + 'aria-selected': _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + 'aria-valuemax': _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + 'aria-valuemin': _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + 'aria-valuenow': _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + 'aria-valuetext': _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + accessibilityActions: _$$_REQUIRE(_dependencyMap[0], "prop-types").arrayOf(_$$_REQUIRE(_dependencyMap[1], "./DeprecatedViewAccessibility").AccessibilityActionInfoPropType), + accessibilityElementsHidden: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + accessibilityHint: _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + accessibilityIgnoresInvertColors: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + accessibilityLabel: _$$_REQUIRE(_dependencyMap[0], "prop-types").node, + accessibilityLabelledBy: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOfType([_$$_REQUIRE(_dependencyMap[0], "prop-types").string, _$$_REQUIRE(_dependencyMap[0], "prop-types").arrayOf(_$$_REQUIRE(_dependencyMap[0], "prop-types").string)]), + accessibilityLanguage: _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + accessibilityLiveRegion: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['assertive', 'none', 'polite']), + accessibilityRole: _$$_REQUIRE(_dependencyMap[1], "./DeprecatedViewAccessibility").AccessibilityRolePropType, + accessibilityState: _$$_REQUIRE(_dependencyMap[1], "./DeprecatedViewAccessibility").AccessibilityStatePropType, + accessibilityValue: _$$_REQUIRE(_dependencyMap[1], "./DeprecatedViewAccessibility").AccessibilityValuePropType, + accessibilityViewIsModal: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + accessible: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + collapsable: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + focusable: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + hitSlop: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOfType([_$$_REQUIRE(_dependencyMap[2], "./DeprecatedEdgeInsetsPropType"), _$$_REQUIRE(_dependencyMap[0], "prop-types").number]), + importantForAccessibility: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['auto', 'no', 'no-hide-descendants', 'yes']), + nativeBackgroundAndroid: _$$_REQUIRE(_dependencyMap[0], "prop-types").object, + nativeForegroundAndroid: _$$_REQUIRE(_dependencyMap[0], "prop-types").object, + nativeID: _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + needsOffscreenAlphaCompositing: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + onAccessibilityAction: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onAccessibilityEscape: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onAccessibilityTap: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onClick: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onLayout: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onMagicTap: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + pointerEvents: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['auto', 'box-none', 'box-only', 'none']), + removeClippedSubviews: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + renderToHardwareTextureAndroid: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + role: _$$_REQUIRE(_dependencyMap[1], "./DeprecatedViewAccessibility").RolePropType, + shouldRasterizeIOS: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + style: _$$_REQUIRE(_dependencyMap[3], "./DeprecatedStyleSheetPropType")(_$$_REQUIRE(_dependencyMap[4], "./DeprecatedViewStylePropTypes")), + tabIndex: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf([0, -1]), + testID: _$$_REQUIRE(_dependencyMap[0], "prop-types").string + }); + module.exports = DeprecatedViewPropTypes; +},332,[321,333,320,334,336],"node_modules\\deprecated-react-native-prop-types\\DeprecatedViewPropTypes.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * @see facebook/react-native/Libraries/Components/View/ViewAccessibility.js + */ + var DeprecatedViewAccessibility = { + AccessibilityRolePropType: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['adjustable', 'alert', 'button', 'checkbox', 'combobox', 'drawerlayout', 'dropdownlist', 'grid', 'header', 'horizontalscrollview', 'iconmenu', 'image', 'imagebutton', 'keyboardkey', 'link', 'list', 'menu', 'menubar', 'menuitem', 'none', 'pager', 'progressbar', 'radio', 'radiogroup', 'scrollbar', 'scrollview', 'search', 'slidingdrawer', 'spinbutton', 'summary', 'switch', 'tab', 'tabbar', 'tablist', 'text', 'timer', 'togglebutton', 'toolbar', 'viewgroup', 'webview']), + AccessibilityStatePropType: _$$_REQUIRE(_dependencyMap[0], "prop-types").object, + AccessibilityActionInfoPropType: _$$_REQUIRE(_dependencyMap[0], "prop-types").object, + AccessibilityValuePropType: _$$_REQUIRE(_dependencyMap[0], "prop-types").object, + RolePropType: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['alert', 'alertdialog', 'application', 'article', 'banner', 'button', 'cell', 'checkbox', 'columnheader', 'combobox', 'complementary', 'contentinfo', 'definition', 'dialog', 'directory', 'document', 'feed', 'figure', 'form', 'grid', 'group', 'heading', 'img', 'link', 'list', 'listitem', 'log', 'main', 'marquee', 'math', 'menu', 'menubar', 'menuitem', 'meter', 'navigation', 'none', 'note', 'option', 'presentation', 'progressbar', 'radio', 'radiogroup', 'region', 'row', 'rowgroup', 'rowheader', 'scrollbar', 'searchbox', 'separator', 'slider', 'spinbutton', 'status', 'summary', 'switch', 'tab', 'table', 'tablist', 'tabpanel', 'term', 'timer', 'toolbar', 'tooltip', 'tree', 'treegrid', 'treeitem']) + }; + module.exports = DeprecatedViewAccessibility; +},333,[321],"node_modules\\deprecated-react-native-prop-types\\DeprecatedViewAccessibility.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + function DeprecatedStyleSheetPropType(shape) { + var shapePropType = _$$_REQUIRE(_dependencyMap[0], "./deprecatedCreateStrictShapeTypeChecker")(shape); + return function (props, propName, componentName, location) { + var newProps = props; + if (props[propName]) { + // Just make a dummy prop object with only the flattened style + newProps = {}; + newProps[propName] = flattenStyle(props[propName]); + } + for (var _len = arguments.length, rest = new Array(_len > 4 ? _len - 4 : 0), _key = 4; _key < _len; _key++) { + rest[_key - 4] = arguments[_key]; + } + return shapePropType.apply(void 0, [newProps, propName, componentName, location].concat(rest)); + }; + } + function flattenStyle(style) { + if (style === null || typeof style !== 'object') { + return undefined; + } + if (!Array.isArray(style)) { + return style; + } + var result = {}; + for (var i = 0, styleLength = style.length; i < styleLength; ++i) { + var computedStyle = flattenStyle(style[i]); + if (computedStyle) { + for (var key in computedStyle) { + result[key] = computedStyle[key]; + } + } + } + return result; + } + module.exports = DeprecatedStyleSheetPropType; +},334,[335],"node_modules\\deprecated-react-native-prop-types\\DeprecatedStyleSheetPropType.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + function deprecatedCreateStrictShapeTypeChecker(shapeTypes) { + function checkType(isRequired, props, propName, componentName, location) { + if (!props[propName]) { + if (isRequired) { + _$$_REQUIRE(_dependencyMap[0], "invariant")(false, `Required object \`${propName}\` was not specified in ` + `\`${componentName}\`.`); + } + return; + } + var propValue = props[propName]; + var propType = typeof propValue; + var locationName = location || '(unknown)'; + if (propType !== 'object') { + _$$_REQUIRE(_dependencyMap[0], "invariant")(false, `Invalid ${locationName} \`${propName}\` of type \`${propType}\` ` + `supplied to \`${componentName}\`, expected \`object\`.`); + } + // We need to check all keys in case some are required but missing from + // props. + var allKeys = Object.assign({}, props[propName], shapeTypes); + for (var _len = arguments.length, rest = new Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { + rest[_key - 5] = arguments[_key]; + } + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + _$$_REQUIRE(_dependencyMap[0], "invariant")(false, `Invalid props.${propName} key \`${key}\` supplied to \`${componentName}\`.` + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')); + } + var error = checker.apply(void 0, [propValue, key, componentName, location].concat(rest)); + if (error) { + _$$_REQUIRE(_dependencyMap[0], "invariant")(false, error.message + '\nBad object: ' + JSON.stringify(props[propName], null, ' ')); + } + } + } + function chainedCheckType(props, propName, componentName, location) { + for (var _len2 = arguments.length, rest = new Array(_len2 > 4 ? _len2 - 4 : 0), _key2 = 4; _key2 < _len2; _key2++) { + rest[_key2 - 4] = arguments[_key2]; + } + return checkType.apply(void 0, [false, props, propName, componentName, location].concat(rest)); + } + chainedCheckType.isRequired = checkType.bind(null, true); + return chainedCheckType; + } + module.exports = deprecatedCreateStrictShapeTypeChecker; +},335,[37],"node_modules\\deprecated-react-native-prop-types\\deprecatedCreateStrictShapeTypeChecker.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * @see facebook/react-native/Libraries/StyleSheet/StyleSheetTypes.js + */ + var DeprecatedViewStylePropTypes = Object.assign({}, _$$_REQUIRE(_dependencyMap[0], "./DeprecatedLayoutPropTypes"), _$$_REQUIRE(_dependencyMap[1], "./DeprecatedShadowPropTypesIOS"), _$$_REQUIRE(_dependencyMap[2], "./DeprecatedTransformPropTypes"), { + backfaceVisibility: _$$_REQUIRE(_dependencyMap[3], "prop-types").oneOf(['hidden', 'visible']), + backgroundColor: _$$_REQUIRE(_dependencyMap[4], "./DeprecatedColorPropType"), + borderBottomColor: _$$_REQUIRE(_dependencyMap[4], "./DeprecatedColorPropType"), + borderBottomEndRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderBottomLeftRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderBottomRightRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderBottomStartRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderBottomWidth: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderColor: _$$_REQUIRE(_dependencyMap[4], "./DeprecatedColorPropType"), + borderCurve: _$$_REQUIRE(_dependencyMap[3], "prop-types").oneOf(['circular', 'continuous']), + borderEndColor: _$$_REQUIRE(_dependencyMap[4], "./DeprecatedColorPropType"), + borderEndEndRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderEndStartRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderLeftColor: _$$_REQUIRE(_dependencyMap[4], "./DeprecatedColorPropType"), + borderLeftWidth: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderRightColor: _$$_REQUIRE(_dependencyMap[4], "./DeprecatedColorPropType"), + borderRightWidth: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderStartColor: _$$_REQUIRE(_dependencyMap[4], "./DeprecatedColorPropType"), + borderStartEndRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderStartStartRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderStyle: _$$_REQUIRE(_dependencyMap[3], "prop-types").oneOf(['dashed', 'dotted', 'solid']), + borderTopColor: _$$_REQUIRE(_dependencyMap[4], "./DeprecatedColorPropType"), + borderTopEndRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderTopLeftRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderTopRightRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderTopStartRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderTopWidth: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderWidth: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + elevation: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + opacity: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + pointerEvents: _$$_REQUIRE(_dependencyMap[3], "prop-types").oneOf(['auto', 'box-none', 'box-only', 'none']) + }); + module.exports = DeprecatedViewStylePropTypes; +},336,[337,338,339,321,319],"node_modules\\deprecated-react-native-prop-types\\DeprecatedViewStylePropTypes.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var DimensionValuePropType = _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOfType([_$$_REQUIRE(_dependencyMap[0], "prop-types").number, _$$_REQUIRE(_dependencyMap[0], "prop-types").string]); + + /** + * @see facebook/react-native/Libraries/StyleSheet/StyleSheetTypes.js + */ + var DeprecatedLayoutPropTypes = { + alignContent: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['center', 'flex-end', 'flex-start', 'space-around', 'space-between', 'stretch']), + alignItems: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['baseline', 'center', 'flex-end', 'flex-start', 'stretch']), + alignSelf: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['auto', 'baseline', 'center', 'flex-end', 'flex-start', 'stretch']), + aspectRatio: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOfType([_$$_REQUIRE(_dependencyMap[0], "prop-types").number, _$$_REQUIRE(_dependencyMap[0], "prop-types").string]), + borderBottomWidth: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + borderEndWidth: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + borderLeftWidth: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + borderRightWidth: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + borderStartWidth: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + borderTopWidth: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + borderWidth: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + bottom: DimensionValuePropType, + columnGap: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + direction: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['inherit', 'ltr', 'rtl']), + display: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['flex', 'none']), + end: DimensionValuePropType, + flex: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + flexBasis: DimensionValuePropType, + flexDirection: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['column', 'column-reverse', 'row', 'row-reverse']), + flexGrow: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + flexShrink: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + flexWrap: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['nowrap', 'wrap', 'wrap-reverse']), + gap: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + height: DimensionValuePropType, + inset: DimensionValuePropType, + insetBlock: DimensionValuePropType, + insetBlockEnd: DimensionValuePropType, + insetBlockStart: DimensionValuePropType, + insetInline: DimensionValuePropType, + insetInlineEnd: DimensionValuePropType, + insetInlineStart: DimensionValuePropType, + justifyContent: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['center', 'flex-end', 'flex-start', 'space-around', 'space-between', 'space-evenly']), + left: DimensionValuePropType, + margin: DimensionValuePropType, + marginBlock: DimensionValuePropType, + marginBlockEnd: DimensionValuePropType, + marginBlockStart: DimensionValuePropType, + marginBottom: DimensionValuePropType, + marginEnd: DimensionValuePropType, + marginHorizontal: DimensionValuePropType, + marginInline: DimensionValuePropType, + marginInlineEnd: DimensionValuePropType, + marginInlineStart: DimensionValuePropType, + marginLeft: DimensionValuePropType, + marginRight: DimensionValuePropType, + marginStart: DimensionValuePropType, + marginTop: DimensionValuePropType, + marginVertical: DimensionValuePropType, + maxHeight: DimensionValuePropType, + maxWidth: DimensionValuePropType, + minHeight: DimensionValuePropType, + minWidth: DimensionValuePropType, + overflow: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['hidden', 'scroll', 'visible']), + padding: DimensionValuePropType, + paddingBlock: DimensionValuePropType, + paddingBlockEnd: DimensionValuePropType, + paddingBlockStart: DimensionValuePropType, + paddingBottom: DimensionValuePropType, + paddingEnd: DimensionValuePropType, + paddingHorizontal: DimensionValuePropType, + paddingInline: DimensionValuePropType, + paddingInlineEnd: DimensionValuePropType, + paddingInlineStart: DimensionValuePropType, + paddingLeft: DimensionValuePropType, + paddingRight: DimensionValuePropType, + paddingStart: DimensionValuePropType, + paddingTop: DimensionValuePropType, + paddingVertical: DimensionValuePropType, + position: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['absolute', 'relative']), + right: DimensionValuePropType, + rowGap: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + start: DimensionValuePropType, + top: DimensionValuePropType, + width: DimensionValuePropType, + zIndex: _$$_REQUIRE(_dependencyMap[0], "prop-types").number + }; + module.exports = DeprecatedLayoutPropTypes; +},337,[321],"node_modules\\deprecated-react-native-prop-types\\DeprecatedLayoutPropTypes.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * @see facebook/react-native/Libraries/StyleSheet/StyleSheetTypes.js + */ + var DeprecatedShadowPropTypesIOS = { + shadowColor: _$$_REQUIRE(_dependencyMap[0], "./DeprecatedColorPropType"), + shadowOffset: _$$_REQUIRE(_dependencyMap[1], "prop-types").shape({ + height: _$$_REQUIRE(_dependencyMap[1], "prop-types").number, + width: _$$_REQUIRE(_dependencyMap[1], "prop-types").number + }), + shadowOpacity: _$$_REQUIRE(_dependencyMap[1], "prop-types").number, + shadowRadius: _$$_REQUIRE(_dependencyMap[1], "prop-types").number + }; + module.exports = DeprecatedShadowPropTypesIOS; +},338,[319,321],"node_modules\\deprecated-react-native-prop-types\\DeprecatedShadowPropTypesIOS.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * @see facebook/react-native/Libraries/StyleSheet/private/_TransformStyle.js + */ + var DeprecatedTransformPropTypes = { + transform: _$$_REQUIRE(_dependencyMap[0], "prop-types").arrayOf(_$$_REQUIRE(_dependencyMap[0], "prop-types").oneOfType([_$$_REQUIRE(_dependencyMap[0], "prop-types").shape({ + perspective: _$$_REQUIRE(_dependencyMap[0], "prop-types").number + }), _$$_REQUIRE(_dependencyMap[0], "prop-types").shape({ + rotate: _$$_REQUIRE(_dependencyMap[0], "prop-types").string + }), _$$_REQUIRE(_dependencyMap[0], "prop-types").shape({ + rotateX: _$$_REQUIRE(_dependencyMap[0], "prop-types").string + }), _$$_REQUIRE(_dependencyMap[0], "prop-types").shape({ + rotateY: _$$_REQUIRE(_dependencyMap[0], "prop-types").string + }), _$$_REQUIRE(_dependencyMap[0], "prop-types").shape({ + rotateZ: _$$_REQUIRE(_dependencyMap[0], "prop-types").string + }), _$$_REQUIRE(_dependencyMap[0], "prop-types").shape({ + scale: _$$_REQUIRE(_dependencyMap[0], "prop-types").number + }), _$$_REQUIRE(_dependencyMap[0], "prop-types").shape({ + scaleX: _$$_REQUIRE(_dependencyMap[0], "prop-types").number + }), _$$_REQUIRE(_dependencyMap[0], "prop-types").shape({ + scaleY: _$$_REQUIRE(_dependencyMap[0], "prop-types").number + }), _$$_REQUIRE(_dependencyMap[0], "prop-types").shape({ + skewX: _$$_REQUIRE(_dependencyMap[0], "prop-types").string + }), _$$_REQUIRE(_dependencyMap[0], "prop-types").shape({ + skewY: _$$_REQUIRE(_dependencyMap[0], "prop-types").string + }), _$$_REQUIRE(_dependencyMap[0], "prop-types").shape({ + translateX: _$$_REQUIRE(_dependencyMap[0], "prop-types").number + }), _$$_REQUIRE(_dependencyMap[0], "prop-types").shape({ + translateY: _$$_REQUIRE(_dependencyMap[0], "prop-types").number + })])) + }; + module.exports = DeprecatedTransformPropTypes; +},339,[321],"node_modules\\deprecated-react-native-prop-types\\DeprecatedTransformPropTypes.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * @see facebook/react-native/Libraries/Image/ImageSource.js + */ + var ImageURISourcePropType = _$$_REQUIRE(_dependencyMap[0], "prop-types").shape({ + body: _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + bundle: _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + cache: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['default', 'force-cache', 'only-if-cached', 'reload']), + headers: _$$_REQUIRE(_dependencyMap[0], "prop-types").objectOf(_$$_REQUIRE(_dependencyMap[0], "prop-types").string), + height: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + method: _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + scale: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + uri: _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + width: _$$_REQUIRE(_dependencyMap[0], "prop-types").number + }); + var ImageSourcePropType = _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOfType([ImageURISourcePropType, _$$_REQUIRE(_dependencyMap[0], "prop-types").number, _$$_REQUIRE(_dependencyMap[0], "prop-types").arrayOf(ImageURISourcePropType)]); + module.exports = ImageSourcePropType; +},340,[321],"node_modules\\deprecated-react-native-prop-types\\DeprecatedImageSourcePropType.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * @see facebook/react-native/Libraries/StyleSheet/StyleSheetTypes.js + */ + var DeprecatedImageStylePropTypes = Object.assign({}, _$$_REQUIRE(_dependencyMap[0], "./DeprecatedLayoutPropTypes"), _$$_REQUIRE(_dependencyMap[1], "./DeprecatedShadowPropTypesIOS"), _$$_REQUIRE(_dependencyMap[2], "./DeprecatedTransformPropTypes"), { + backfaceVisibility: _$$_REQUIRE(_dependencyMap[3], "prop-types").oneOf(['hidden', 'visible']), + backgroundColor: _$$_REQUIRE(_dependencyMap[4], "./DeprecatedColorPropType"), + borderBottomLeftRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderBottomRightRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderColor: _$$_REQUIRE(_dependencyMap[4], "./DeprecatedColorPropType"), + borderRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderTopLeftRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderTopRightRadius: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + borderWidth: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + objectFit: _$$_REQUIRE(_dependencyMap[3], "prop-types").oneOf(['contain', 'cover', 'fill', 'scale-down']), + opacity: _$$_REQUIRE(_dependencyMap[3], "prop-types").number, + overflow: _$$_REQUIRE(_dependencyMap[3], "prop-types").oneOf(['hidden', 'visible']), + overlayColor: _$$_REQUIRE(_dependencyMap[3], "prop-types").string, + tintColor: _$$_REQUIRE(_dependencyMap[4], "./DeprecatedColorPropType"), + resizeMode: _$$_REQUIRE(_dependencyMap[3], "prop-types").oneOf(['center', 'contain', 'cover', 'repeat', 'stretch']) + }); + module.exports = DeprecatedImageStylePropTypes; +},341,[337,338,339,321,319],"node_modules\\deprecated-react-native-prop-types\\DeprecatedImageStylePropTypes.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * @see facebook/react-native/Libraries/StyleSheet/StyleSheetTypes.js + */ + var PointPropType = _$$_REQUIRE(_dependencyMap[0], "prop-types").shape({ + x: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + y: _$$_REQUIRE(_dependencyMap[0], "prop-types").number + }); + module.exports = PointPropType; +},342,[321],"node_modules\\deprecated-react-native-prop-types\\DeprecatedPointPropType.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var DataDetectorTypes = ['address', 'all', 'calendarEvent', 'link', 'none', 'phoneNumber']; + + /** + * @see facebook/react-native/Libraries/TextInput/TextInput.js + */ + var DeprecatedTextInputPropTypes = Object.assign({}, _$$_REQUIRE(_dependencyMap[0], "./DeprecatedViewPropTypes"), { + allowFontScaling: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + autoCapitalize: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['none', 'sentences', 'words', 'characters']), + autoComplete: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['additional-name', 'address-line1', 'address-line2', 'bday', 'bday-day', 'bday-month', 'bday-year', 'birthdate-day', 'birthdate-full', 'birthdate-month', 'birthdate-year', 'cc-csc', 'cc-exp', 'cc-exp-day', 'cc-exp-month', 'cc-exp-year', 'cc-family-name', 'cc-given-name', 'cc-middle-name', 'cc-name', 'cc-number', 'cc-type', 'country', 'current-password', 'email', 'family-name', 'gender', 'given-name', 'honorific-prefix', 'honorific-suffix', 'name', 'name-family', 'name-given', 'name-middle', 'name-middle-initial', 'name-prefix', 'name-suffix', 'new-password', 'nickname', 'off', 'one-time-code', 'organization', 'organization-title', 'password', 'password-new', 'postal-address', 'postal-address-country', 'postal-address-extended', 'postal-address-extended-postal-code', 'postal-address-locality', 'postal-address-region', 'postal-code', 'sex', 'sms-otp', 'street-address', 'tel', 'tel-country-code', 'tel-device', 'tel-national', 'url', 'username', 'username-new']), + autoCorrect: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + autoFocus: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + blurOnSubmit: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + caretHidden: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + clearButtonMode: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['always', 'never', 'unless-editing', 'while-editing']), + clearTextOnFocus: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + cursorColor: _$$_REQUIRE(_dependencyMap[2], "./DeprecatedColorPropType"), + contextMenuHidden: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + dataDetectorTypes: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOfType([_$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(DataDetectorTypes), _$$_REQUIRE(_dependencyMap[1], "prop-types").arrayOf(_$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(DataDetectorTypes))]), + defaultValue: _$$_REQUIRE(_dependencyMap[1], "prop-types").string, + disableFullscreenUI: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + editable: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + enablesReturnKeyAutomatically: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + enterKeyHint: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['done', 'enter', 'go', 'next', 'previous', 'search', 'send']), + inlineImageLeft: _$$_REQUIRE(_dependencyMap[1], "prop-types").string, + inlineImagePadding: _$$_REQUIRE(_dependencyMap[1], "prop-types").number, + inputAccessoryViewID: _$$_REQUIRE(_dependencyMap[1], "prop-types").string, + inputMode: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['decimal', 'email', 'none', 'numeric', 'search', 'tel', 'text', 'url']), + keyboardAppearance: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['default', 'dark', 'light']), + keyboardType: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['ascii-capable', 'ascii-capable-number-pad', 'decimal-pad', 'default', 'email-address', 'name-phone-pad', 'number-pad', 'numbers-and-punctuation', 'numeric', 'phone-pad', 'twitter', 'url', 'visible-password', 'web-search']), + lineBreakStrategyIOS: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['hangul-word', 'none', 'push-out', 'standard']), + maxFontSizeMultiplier: _$$_REQUIRE(_dependencyMap[1], "prop-types").number, + maxLength: _$$_REQUIRE(_dependencyMap[1], "prop-types").number, + multiline: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + numberOfLines: _$$_REQUIRE(_dependencyMap[1], "prop-types").number, + onBlur: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onChange: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onChangeText: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onContentSizeChange: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onEndEditing: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onFocus: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onKeyPress: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onLayout: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onScroll: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onSelectionChange: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onSubmitEditing: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + onTextInput: _$$_REQUIRE(_dependencyMap[1], "prop-types").func, + placeholder: _$$_REQUIRE(_dependencyMap[1], "prop-types").string, + placeholderTextColor: _$$_REQUIRE(_dependencyMap[2], "./DeprecatedColorPropType"), + readOnly: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + rejectResponderTermination: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + returnKeyLabel: _$$_REQUIRE(_dependencyMap[1], "prop-types").string, + returnKeyType: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['default', 'done', 'emergency-call', 'go', 'google', 'join', 'next', 'none', 'previous', 'route', 'search', 'send', 'yahoo']), + rows: _$$_REQUIRE(_dependencyMap[1], "prop-types").number, + scrollEnabled: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + secureTextEntry: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + selection: _$$_REQUIRE(_dependencyMap[1], "prop-types").shape({ + end: _$$_REQUIRE(_dependencyMap[1], "prop-types").number, + start: _$$_REQUIRE(_dependencyMap[1], "prop-types").number.isRequired + }), + selectionColor: _$$_REQUIRE(_dependencyMap[2], "./DeprecatedColorPropType"), + selectTextOnFocus: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + showSoftInputOnFocus: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + spellCheck: _$$_REQUIRE(_dependencyMap[1], "prop-types").bool, + style: _$$_REQUIRE(_dependencyMap[3], "./DeprecatedTextPropTypes").style, + submitBehavior: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['blurAndSubmit', 'newline', 'submit']), + textBreakStrategy: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['balanced', 'highQuality', 'simple']), + textContentType: _$$_REQUIRE(_dependencyMap[1], "prop-types").oneOf(['addressCity', 'addressCityAndState', 'addressState', 'birthdate', 'birthdateDay', 'birthdateMonth', 'birthdateYear', 'countryName', 'creditCardExpiration', 'creditCardExpirationMonth', 'creditCardExpirationYear', 'creditCardFamilyName', 'creditCardGivenName', 'creditCardMiddleName', 'creditCardName', 'creditCardNumber', 'creditCardSecurityCode', 'creditCardType', 'emailAddress', 'familyName', 'fullStreetAddress', 'givenName', 'jobTitle', 'location', 'middleName', 'name', 'namePrefix', 'nameSuffix', 'newPassword', 'nickname', 'none', 'oneTimeCode', 'organizationName', 'password', 'postalCode', 'streetAddressLine1', 'streetAddressLine2', 'sublocality', 'telephoneNumber', 'URL', 'username']), + underlineColorAndroid: _$$_REQUIRE(_dependencyMap[2], "./DeprecatedColorPropType"), + value: _$$_REQUIRE(_dependencyMap[1], "prop-types").string + }); + module.exports = DeprecatedTextInputPropTypes; +},343,[332,321,319,344],"node_modules\\deprecated-react-native-prop-types\\DeprecatedTextInputPropTypes.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * @see facebook/react-native/Libraries/Text/TextProps.js + */ + var DeprecatedTextPropTypes = { + 'aria-busy': _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + 'aria-checked': _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOfType([_$$_REQUIRE(_dependencyMap[0], "prop-types").bool, _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['mixed'])]), + 'aria-disabled': _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + 'aria-expanded': _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + 'aria-label': _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + 'aria-labelledby': _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + 'aria-selected': _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + accessibilityActions: _$$_REQUIRE(_dependencyMap[0], "prop-types").arrayOf(_$$_REQUIRE(_dependencyMap[1], "./DeprecatedViewAccessibility").AccessibilityActionInfoPropType), + accessibilityHint: _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + accessibilityLabel: _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + accessibilityLanguage: _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + accessibilityRole: _$$_REQUIRE(_dependencyMap[1], "./DeprecatedViewAccessibility").AccessibilityRolePropType, + accessibilityState: _$$_REQUIRE(_dependencyMap[1], "./DeprecatedViewAccessibility").AccessibilityStatePropType, + accessible: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + adjustsFontSizeToFit: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + allowFontScaling: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + dataDetectorType: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['all', 'email', 'link', 'none', 'phoneNumber']), + disabled: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + dynamicTypeRamp: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['body', 'callout', 'caption1', 'caption2', 'footnote', 'headline', 'largeTitle', 'subheadline', 'title1', 'title2', 'title3']), + ellipsizeMode: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['clip', 'head', 'middle', 'tail']), + id: _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + lineBreakStrategyIOS: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['hangul-word', 'none', 'push-out', 'standard']), + maxFontSizeMultiplier: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + minimumFontScale: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + nativeID: _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + numberOfLines: _$$_REQUIRE(_dependencyMap[0], "prop-types").number, + onAccessibilityAction: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onLayout: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onLongPress: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onMoveShouldSetResponder: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPress: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPressIn: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onPressOut: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onResponderGrant: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onResponderMove: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onResponderRelease: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onResponderTerminate: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onResponderTerminationRequest: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onStartShouldSetResponder: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + onTextLayout: _$$_REQUIRE(_dependencyMap[0], "prop-types").func, + pressRetentionOffset: _$$_REQUIRE(_dependencyMap[2], "./DeprecatedEdgeInsetsPropType"), + role: _$$_REQUIRE(_dependencyMap[1], "./DeprecatedViewAccessibility").RolePropType, + selectable: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + selectionColor: _$$_REQUIRE(_dependencyMap[3], "./DeprecatedColorPropType"), + style: _$$_REQUIRE(_dependencyMap[4], "./DeprecatedStyleSheetPropType")(_$$_REQUIRE(_dependencyMap[5], "./DeprecatedTextStylePropTypes")), + suppressHighlighting: _$$_REQUIRE(_dependencyMap[0], "prop-types").bool, + testID: _$$_REQUIRE(_dependencyMap[0], "prop-types").string, + textBreakStrategy: _$$_REQUIRE(_dependencyMap[0], "prop-types").oneOf(['balanced', 'highQuality', 'simple']) + }; + module.exports = DeprecatedTextPropTypes; +},344,[321,333,320,319,334,345],"node_modules\\deprecated-react-native-prop-types\\DeprecatedTextPropTypes.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * @see facebook/react-native/Libraries/StyleSheet/StyleSheetTypes.js + */ + var DeprecatedTextStylePropTypes = Object.assign({}, _$$_REQUIRE(_dependencyMap[0], "./DeprecatedViewStylePropTypes"), { + color: _$$_REQUIRE(_dependencyMap[1], "./DeprecatedColorPropType"), + fontFamily: _$$_REQUIRE(_dependencyMap[2], "prop-types").string, + fontSize: _$$_REQUIRE(_dependencyMap[2], "prop-types").number, + fontStyle: _$$_REQUIRE(_dependencyMap[2], "prop-types").oneOf(['italic', 'normal']), + fontVariant: _$$_REQUIRE(_dependencyMap[2], "prop-types").oneOfType([_$$_REQUIRE(_dependencyMap[2], "prop-types").arrayOf(_$$_REQUIRE(_dependencyMap[2], "prop-types").oneOf(['lining-nums', 'oldstyle-nums', 'proportional-nums', 'small-caps', 'stylistic-eight', 'stylistic-eighteen', 'stylistic-eleven', 'stylistic-fifteen', 'stylistic-five', 'stylistic-four', 'stylistic-fourteen', 'stylistic-nine', 'stylistic-nineteen', 'stylistic-one', 'stylistic-seven', 'stylistic-seventeen', 'stylistic-six', 'stylistic-sixteen', 'stylistic-ten', 'stylistic-thirteen', 'stylistic-three', 'stylistic-twelve', 'stylistic-twenty', 'stylistic-two', 'tabular-nums'])), _$$_REQUIRE(_dependencyMap[2], "prop-types").string]), + fontWeight: _$$_REQUIRE(_dependencyMap[2], "prop-types").oneOf(['100', '200', '300', '400', '500', '600', '700', '800', '900', 'black', 'bold', 'condensed', 'condensedBold', 'heavy', 'light', 'medium', 'normal', 'regular', 'semibold', 'thin', 'ultralight', 100, 200, 300, 400, 500, 600, 700, 800, 900]), + includeFontPadding: _$$_REQUIRE(_dependencyMap[2], "prop-types").bool, + letterSpacing: _$$_REQUIRE(_dependencyMap[2], "prop-types").number, + lineHeight: _$$_REQUIRE(_dependencyMap[2], "prop-types").number, + textAlign: _$$_REQUIRE(_dependencyMap[2], "prop-types").oneOf(['auto', 'center', 'justify', 'left', 'right']), + textAlignVertical: _$$_REQUIRE(_dependencyMap[2], "prop-types").oneOf(['auto', 'bottom', 'center', 'top']), + textDecorationColor: _$$_REQUIRE(_dependencyMap[1], "./DeprecatedColorPropType"), + textDecorationLine: _$$_REQUIRE(_dependencyMap[2], "prop-types").oneOf(['line-through', 'none', 'underline line-through', 'underline']), + textDecorationStyle: _$$_REQUIRE(_dependencyMap[2], "prop-types").oneOf(['dashed', 'dotted', 'double', 'solid']), + textShadowColor: _$$_REQUIRE(_dependencyMap[1], "./DeprecatedColorPropType"), + textShadowOffset: _$$_REQUIRE(_dependencyMap[2], "prop-types").shape({ + height: _$$_REQUIRE(_dependencyMap[2], "prop-types").number, + width: _$$_REQUIRE(_dependencyMap[2], "prop-types").number + }), + textShadowRadius: _$$_REQUIRE(_dependencyMap[2], "prop-types").number, + textTransform: _$$_REQUIRE(_dependencyMap[2], "prop-types").oneOf(['capitalize', 'lowercase', 'none', 'uppercase']), + userSelect: _$$_REQUIRE(_dependencyMap[2], "prop-types").oneOf(['all', 'auto', 'contain', 'none', 'text']), + verticalAlign: _$$_REQUIRE(_dependencyMap[2], "prop-types").oneOf(['auto', 'bottom', 'middle', 'top']), + writingDirection: _$$_REQUIRE(_dependencyMap[2], "prop-types").oneOf(['auto', 'ltr', 'rtl']) + }); + module.exports = DeprecatedTextStylePropTypes; +},345,[336,319,321],"node_modules\\deprecated-react-native-prop-types\\DeprecatedTextStylePropTypes.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _AnimatedImplementation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../../Animated/AnimatedImplementation")); + var _FrameRateLogger = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "../../Interaction/FrameRateLogger")); + var _UIManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "../../ReactNative/UIManager")); + var _flattenStyle = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "../../StyleSheet/flattenStyle")); + var _splitLayoutProps2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[11], "../../StyleSheet/splitLayoutProps")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[12], "../../StyleSheet/StyleSheet")); + var _Dimensions = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[13], "../../Utilities/Dimensions")); + var _dismissKeyboard = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[14], "../../Utilities/dismissKeyboard")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[15], "../../Utilities/Platform")); + var _Keyboard = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[16], "../Keyboard/Keyboard")); + var _TextInputState = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[17], "../TextInput/TextInputState")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[18], "../View/View")); + var _AndroidHorizontalScrollContentViewNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[19], "./AndroidHorizontalScrollContentViewNativeComponent")); + var _AndroidHorizontalScrollViewNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[20], "./AndroidHorizontalScrollViewNativeComponent")); + var _processDecelerationRate = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[21], "./processDecelerationRate")); + var _ScrollContentViewNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[22], "./ScrollContentViewNativeComponent")); + var _ScrollViewCommands = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[23], "./ScrollViewCommands")); + var _ScrollViewContext = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[24], "./ScrollViewContext")); + var _ScrollViewNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[25], "./ScrollViewNativeComponent")); + var _ScrollViewStickyHeader = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[26], "./ScrollViewStickyHeader")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[27], "invariant")); + var _memoizeOne = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[28], "memoize-one")); + var _nullthrows = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[29], "nullthrows")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[30], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[31], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Components\\ScrollView\\ScrollView.js"; + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + if (_Platform.default.OS === 'ios') { + _$$_REQUIRE(_dependencyMap[32], "../../Renderer/shims/ReactNative"); // Force side effects to prevent T55744311 + } + var _ref = _Platform.default.OS === 'android' ? { + NativeHorizontalScrollViewTuple: [_AndroidHorizontalScrollViewNativeComponent.default, _AndroidHorizontalScrollContentViewNativeComponent.default], + NativeVerticalScrollViewTuple: [_ScrollViewNativeComponent.default, _View.default] + } : { + NativeHorizontalScrollViewTuple: [_ScrollViewNativeComponent.default, _ScrollContentViewNativeComponent.default], + NativeVerticalScrollViewTuple: [_ScrollViewNativeComponent.default, _ScrollContentViewNativeComponent.default] + }, + NativeHorizontalScrollViewTuple = _ref.NativeHorizontalScrollViewTuple, + NativeVerticalScrollViewTuple = _ref.NativeVerticalScrollViewTuple; + + /* + * iOS scroll event timing nuances: + * =============================== + * + * + * Scrolling without bouncing, if you touch down: + * ------------------------------- + * + * 1. `onMomentumScrollBegin` (when animation begins after letting up) + * ... physical touch starts ... + * 2. `onTouchStartCapture` (when you press down to stop the scroll) + * 3. `onTouchStart` (same, but bubble phase) + * 4. `onResponderRelease` (when lifting up - you could pause forever before * lifting) + * 5. `onMomentumScrollEnd` + * + * + * Scrolling with bouncing, if you touch down: + * ------------------------------- + * + * 1. `onMomentumScrollBegin` (when animation begins after letting up) + * ... bounce begins ... + * ... some time elapses ... + * ... physical touch during bounce ... + * 2. `onMomentumScrollEnd` (Makes no sense why this occurs first during bounce) + * 3. `onTouchStartCapture` (immediately after `onMomentumScrollEnd`) + * 4. `onTouchStart` (same, but bubble phase) + * 5. `onTouchEnd` (You could hold the touch start for a long time) + * 6. `onMomentumScrollBegin` (When releasing the view starts bouncing back) + * + * So when we receive an `onTouchStart`, how can we tell if we are touching + * *during* an animation (which then causes the animation to stop)? The only way + * to tell is if the `touchStart` occurred immediately after the + * `onMomentumScrollEnd`. + * + * This is abstracted out for you, so you can just call this.scrollResponderIsAnimating() if + * necessary + * + * `ScrollView` also includes logic for blurring a currently focused input + * if one is focused while scrolling. This is a natural place + * to put this logic since it can support not dismissing the keyboard while + * scrolling, unless a recognized "tap"-like gesture has occurred. + * + * The public lifecycle API includes events for keyboard interaction, responder + * interaction, and scrolling (among others). The keyboard callbacks + * `onKeyboardWill/Did/*` are *global* events, but are invoked on scroll + * responder's props so that you can guarantee that the scroll responder's + * internal state has been updated accordingly (and deterministically) by + * the time the props callbacks are invoke. Otherwise, you would always wonder + * if the scroll responder is currently in a state where it recognizes new + * keyboard positions etc. If coordinating scrolling with keyboard movement, + * *always* use these hooks instead of listening to your own global keyboard + * events. + * + * Public keyboard lifecycle API: (props callbacks) + * + * Standard Keyboard Appearance Sequence: + * + * this.props.onKeyboardWillShow + * this.props.onKeyboardDidShow + * + * `onScrollResponderKeyboardDismissed` will be invoked if an appropriate + * tap inside the scroll responder's scrollable region was responsible + * for the dismissal of the keyboard. There are other reasons why the + * keyboard could be dismissed. + * + * this.props.onScrollResponderKeyboardDismissed + * + * Standard Keyboard Hide Sequence: + * + * this.props.onKeyboardWillHide + * this.props.onKeyboardDidHide + */ + + // Public methods for ScrollView + + var IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16; + /** + * Component that wraps platform ScrollView while providing + * integration with touch locking "responder" system. + * + * Keep in mind that ScrollViews must have a bounded height in order to work, + * since they contain unbounded-height children into a bounded container (via + * a scroll interaction). In order to bound the height of a ScrollView, either + * set the height of the view directly (discouraged) or make sure all parent + * views have bounded height. Forgetting to transfer `{flex: 1}` down the + * view stack can lead to errors here, which the element inspector makes + * easy to debug. + * + * Doesn't yet support other contained responders from blocking this scroll + * view from becoming the responder. + * + * + * `` vs [``](https://reactnative.dev/docs/flatlist) - which one to use? + * + * `ScrollView` simply renders all its react child components at once. That + * makes it very easy to understand and use. + * + * On the other hand, this has a performance downside. Imagine you have a very + * long list of items you want to display, maybe several screens worth of + * content. Creating JS components and native views for everything all at once, + * much of which may not even be shown, will contribute to slow rendering and + * increased memory usage. + * + * This is where `FlatList` comes into play. `FlatList` renders items lazily, + * just when they are about to appear, and removes items that scroll way off + * screen to save memory and processing time. + * + * `FlatList` is also handy if you want to render separators between your items, + * multiple columns, infinite scroll loading, or any number of other features it + * supports out of the box. + */ + var ScrollView = /*#__PURE__*/function (_React$Component) { + function ScrollView(props) { + var _this$props$contentOf, _this$props$contentOf2, _this$props$contentIn, _this$props$contentIn2; + var _this; + (0, _classCallCheck2.default)(this, ScrollView); + _this = _callSuper(this, ScrollView, [props]); + _this._scrollAnimatedValueAttachment = null; + _this._stickyHeaderRefs = new Map(); + _this._headerLayoutYs = new Map(); + _this._keyboardMetrics = null; + _this._additionalScrollOffset = 0; + _this._isTouching = false; + _this._lastMomentumScrollBeginTime = 0; + _this._lastMomentumScrollEndTime = 0; + // Reset to false every time becomes responder. This is used to: + // - Determine if the scroll view has been scrolled and therefore should + // refuse to give up its responder lock. + // - Determine if releasing should dismiss the keyboard when we are in + // tap-to-dismiss mode (this.props.keyboardShouldPersistTaps !== 'always'). + _this._observedScrollSinceBecomingResponder = false; + _this._becameResponderWhileAnimating = false; + _this._preventNegativeScrollOffset = null; + _this._animated = null; + _this._subscriptionKeyboardWillShow = null; + _this._subscriptionKeyboardWillHide = null; + _this._subscriptionKeyboardDidShow = null; + _this._subscriptionKeyboardDidHide = null; + _this.state = { + layoutHeight: null + }; + /** + * Returns a reference to the underlying scroll responder, which supports + * operations like `scrollTo`. All ScrollView-like components should + * implement this method so that they can be composed while providing access + * to the underlying scroll responder's methods. + */ + _this.getScrollResponder = function () { + // $FlowFixMe[unclear-type] + return _this; + }; + _this.getScrollableNode = function () { + return (0, _$$_REQUIRE(_dependencyMap[33], "../../ReactNative/RendererProxy").findNodeHandle)(_this._scrollView.nativeInstance); + }; + _this.getInnerViewNode = function () { + return (0, _$$_REQUIRE(_dependencyMap[33], "../../ReactNative/RendererProxy").findNodeHandle)(_this._innerView.nativeInstance); + }; + _this.getInnerViewRef = function () { + return _this._innerView.nativeInstance; + }; + _this.getNativeScrollRef = function () { + return _this._scrollView.nativeInstance; + }; + /** + * Scrolls to a given x, y offset, either immediately or with a smooth animation. + * + * Example: + * + * `scrollTo({x: 0, y: 0, animated: true})` + * + * Note: The weird function signature is due to the fact that, for historical reasons, + * the function also accepts separate arguments as an alternative to the options object. + * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED. + */ + _this.scrollTo = function (options, deprecatedX, deprecatedAnimated) { + var x, y, animated; + if (typeof options === 'number') { + console.warn('`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, ' + 'animated: true})` instead.'); + y = options; + x = deprecatedX; + animated = deprecatedAnimated; + } else if (options) { + y = options.y; + x = options.x; + animated = options.animated; + } + if (_this._scrollView.nativeInstance == null) { + return; + } + _ScrollViewCommands.default.scrollTo(_this._scrollView.nativeInstance, x || 0, y || 0, animated !== false); + }; + /** + * If this is a vertical ScrollView scrolls to the bottom. + * If this is a horizontal ScrollView scrolls to the right. + * + * Use `scrollToEnd({animated: true})` for smooth animated scrolling, + * `scrollToEnd({animated: false})` for immediate scrolling. + * If no options are passed, `animated` defaults to true. + */ + _this.scrollToEnd = function (options) { + // Default to true + var animated = (options && options.animated) !== false; + if (_this._scrollView.nativeInstance == null) { + return; + } + _ScrollViewCommands.default.scrollToEnd(_this._scrollView.nativeInstance, animated); + }; + /** + * Displays the scroll indicators momentarily. + * + * @platform ios + */ + _this.flashScrollIndicators = function () { + if (_this._scrollView.nativeInstance == null) { + return; + } + _ScrollViewCommands.default.flashScrollIndicators(_this._scrollView.nativeInstance); + }; + /** + * This method should be used as the callback to onFocus in a TextInputs' + * parent view. Note that any module using this mixin needs to return + * the parent view's ref in getScrollViewRef() in order to use this method. + * @param {number} nodeHandle The TextInput node handle + * @param {number} additionalOffset The scroll view's bottom "contentInset". + * Default is 0. + * @param {bool} preventNegativeScrolling Whether to allow pulling the content + * down to make it meet the keyboard's top. Default is false. + */ + _this.scrollResponderScrollNativeHandleToKeyboard = function (nodeHandle, additionalOffset, preventNegativeScrollOffset) { + _this._additionalScrollOffset = additionalOffset || 0; + _this._preventNegativeScrollOffset = !!preventNegativeScrollOffset; + if (_this._innerView.nativeInstance == null) { + return; + } + if (typeof nodeHandle === 'number') { + _UIManager.default.measureLayout(nodeHandle, (0, _nullthrows.default)((0, _$$_REQUIRE(_dependencyMap[33], "../../ReactNative/RendererProxy").findNodeHandle)(_this)), + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + _this._textInputFocusError, _this._inputMeasureAndScrollToKeyboard); + } else { + nodeHandle.measureLayout(_this._innerView.nativeInstance, _this._inputMeasureAndScrollToKeyboard, + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + _this._textInputFocusError); + } + }; + /** + * A helper function to zoom to a specific rect in the scrollview. The argument has the shape + * {x: number; y: number; width: number; height: number; animated: boolean = true} + * + * @platform ios + */ + _this.scrollResponderZoomTo = function (rect, animated // deprecated, put this inside the rect argument instead + ) { + (0, _invariant.default)(_Platform.default.OS === 'ios', 'zoomToRect is not implemented'); + if ('animated' in rect) { + _this._animated = rect.animated; + delete rect.animated; + } else if (typeof animated !== 'undefined') { + console.warn('`scrollResponderZoomTo` `animated` argument is deprecated. Use `options.animated` instead'); + } + if (_this._scrollView.nativeInstance == null) { + return; + } + _ScrollViewCommands.default.zoomToRect(_this._scrollView.nativeInstance, rect, animated !== false); + }; + /** + * The calculations performed here assume the scroll view takes up the entire + * screen - even if has some content inset. We then measure the offsets of the + * keyboard, and compensate both for the scroll view's "contentInset". + * + * @param {number} left Position of input w.r.t. table view. + * @param {number} top Position of input w.r.t. table view. + * @param {number} width Width of the text input. + * @param {number} height Height of the text input. + */ + _this._inputMeasureAndScrollToKeyboard = function (left, top, width, height) { + var keyboardScreenY = _Dimensions.default.get('window').height; + var scrollTextInputIntoVisibleRect = function scrollTextInputIntoVisibleRect() { + if (_this._keyboardMetrics != null) { + keyboardScreenY = _this._keyboardMetrics.screenY; + } + var scrollOffsetY = top - keyboardScreenY + height + _this._additionalScrollOffset; + + // By default, this can scroll with negative offset, pulling the content + // down so that the target component's bottom meets the keyboard's top. + // If requested otherwise, cap the offset at 0 minimum to avoid content + // shifting down. + if (_this._preventNegativeScrollOffset === true) { + scrollOffsetY = Math.max(0, scrollOffsetY); + } + _this.scrollTo({ + x: 0, + y: scrollOffsetY, + animated: true + }); + _this._additionalScrollOffset = 0; + _this._preventNegativeScrollOffset = false; + }; + if (_this._keyboardMetrics == null) { + // `_keyboardMetrics` is set inside `scrollResponderKeyboardWillShow` which + // is not guaranteed to be called before `_inputMeasureAndScrollToKeyboard` but native has already scheduled it. + // In case it was not called before `_inputMeasureAndScrollToKeyboard`, we postpone scrolling to + // text input. + setTimeout(function () { + scrollTextInputIntoVisibleRect(); + }, 0); + } else { + scrollTextInputIntoVisibleRect(); + } + }; + _this._handleScroll = function (e) { + if (__DEV__) { + if (_this.props.onScroll && _this.props.scrollEventThrottle == null && _Platform.default.OS === 'ios') { + console.log('You specified `onScroll` on a but not ' + '`scrollEventThrottle`. You will only receive one event. ' + 'Using `16` you get all the events but be aware that it may ' + "cause frame drops, use a bigger number if you don't need as " + 'much precision.'); + } + } + _this._observedScrollSinceBecomingResponder = true; + _this.props.onScroll && _this.props.onScroll(e); + }; + _this._handleLayout = function (e) { + if (_this.props.invertStickyHeaders === true) { + _this.setState({ + layoutHeight: e.nativeEvent.layout.height + }); + } + if (_this.props.onLayout) { + _this.props.onLayout(e); + } + }; + _this._handleContentOnLayout = function (e) { + var _e$nativeEvent$layout = e.nativeEvent.layout, + width = _e$nativeEvent$layout.width, + height = _e$nativeEvent$layout.height; + _this.props.onContentSizeChange && _this.props.onContentSizeChange(width, height); + }; + _this._innerView = createRefForwarder(function (instance) { + return instance; + }); + _this._scrollView = createRefForwarder(function (nativeInstance) { + // This is a hack. Ideally we would forwardRef to the underlying + // host component. However, since ScrollView has it's own methods that can be + // called as well, if we used the standard forwardRef then these + // methods wouldn't be accessible and thus be a breaking change. + // + // Therefore we edit ref to include ScrollView's public methods so that + // they are callable from the ref. + + // $FlowFixMe[prop-missing] - Known issue with appending custom methods. + var publicInstance = Object.assign(nativeInstance, { + getScrollResponder: _this.getScrollResponder, + getScrollableNode: _this.getScrollableNode, + getInnerViewNode: _this.getInnerViewNode, + getInnerViewRef: _this.getInnerViewRef, + getNativeScrollRef: _this.getNativeScrollRef, + scrollTo: _this.scrollTo, + scrollToEnd: _this.scrollToEnd, + flashScrollIndicators: _this.flashScrollIndicators, + scrollResponderZoomTo: _this.scrollResponderZoomTo, + scrollResponderScrollNativeHandleToKeyboard: _this.scrollResponderScrollNativeHandleToKeyboard + }); + return publicInstance; + }); + /** + * Warning, this may be called several times for a single keyboard opening. + * It's best to store the information in this method and then take any action + * at a later point (either in `keyboardDidShow` or other). + * + * Here's the order that events occur in: + * - focus + * - willShow {startCoordinates, endCoordinates} several times + * - didShow several times + * - blur + * - willHide {startCoordinates, endCoordinates} several times + * - didHide several times + * + * The `ScrollResponder` module callbacks for each of these events. + * Even though any user could have easily listened to keyboard events + * themselves, using these `props` callbacks ensures that ordering of events + * is consistent - and not dependent on the order that the keyboard events are + * subscribed to. This matters when telling the scroll view to scroll to where + * the keyboard is headed - the scroll responder better have been notified of + * the keyboard destination before being instructed to scroll to where the + * keyboard will be. Stick to the `ScrollResponder` callbacks, and everything + * will work. + * + * WARNING: These callbacks will fire even if a keyboard is displayed in a + * different navigation pane. Filter out the events to determine if they are + * relevant to you. (For example, only if you receive these callbacks after + * you had explicitly focused a node etc). + */ + _this.scrollResponderKeyboardWillShow = function (e) { + _this._keyboardMetrics = e.endCoordinates; + _this.props.onKeyboardWillShow && _this.props.onKeyboardWillShow(e); + }; + _this.scrollResponderKeyboardWillHide = function (e) { + _this._keyboardMetrics = null; + _this.props.onKeyboardWillHide && _this.props.onKeyboardWillHide(e); + }; + _this.scrollResponderKeyboardDidShow = function (e) { + _this._keyboardMetrics = e.endCoordinates; + _this.props.onKeyboardDidShow && _this.props.onKeyboardDidShow(e); + }; + _this.scrollResponderKeyboardDidHide = function (e) { + _this._keyboardMetrics = null; + _this.props.onKeyboardDidHide && _this.props.onKeyboardDidHide(e); + }; + /** + * Invoke this from an `onMomentumScrollBegin` event. + */ + _this._handleMomentumScrollBegin = function (e) { + _this._lastMomentumScrollBeginTime = global.performance.now(); + _this.props.onMomentumScrollBegin && _this.props.onMomentumScrollBegin(e); + }; + /** + * Invoke this from an `onMomentumScrollEnd` event. + */ + _this._handleMomentumScrollEnd = function (e) { + _FrameRateLogger.default.endScroll(); + _this._lastMomentumScrollEndTime = global.performance.now(); + _this.props.onMomentumScrollEnd && _this.props.onMomentumScrollEnd(e); + }; + /** + * Unfortunately, `onScrollBeginDrag` also fires when *stopping* the scroll + * animation, and there's not an easy way to distinguish a drag vs. stopping + * momentum. + * + * Invoke this from an `onScrollBeginDrag` event. + */ + _this._handleScrollBeginDrag = function (e) { + _FrameRateLogger.default.beginScroll(); // TODO: track all scrolls after implementing onScrollEndAnimation + + if (_Platform.default.OS === 'android' && _this.props.keyboardDismissMode === 'on-drag') { + (0, _dismissKeyboard.default)(); + } + _this.props.onScrollBeginDrag && _this.props.onScrollBeginDrag(e); + }; + /** + * Invoke this from an `onScrollEndDrag` event. + */ + _this._handleScrollEndDrag = function (e) { + var velocity = e.nativeEvent.velocity; + // - If we are animating, then this is a "drag" that is stopping the scrollview and momentum end + // will fire. + // - If velocity is non-zero, then the interaction will stop when momentum scroll ends or + // another drag starts and ends. + // - If we don't get velocity, better to stop the interaction twice than not stop it. + if (!_this._isAnimating() && (!velocity || velocity.x === 0 && velocity.y === 0)) { + _FrameRateLogger.default.endScroll(); + } + _this.props.onScrollEndDrag && _this.props.onScrollEndDrag(e); + }; + /** + * A helper function for this class that lets us quickly determine if the + * view is currently animating. This is particularly useful to know when + * a touch has just started or ended. + */ + _this._isAnimating = function () { + var now = global.performance.now(); + var timeSinceLastMomentumScrollEnd = now - _this._lastMomentumScrollEndTime; + var isAnimating = timeSinceLastMomentumScrollEnd < IS_ANIMATING_TOUCH_START_THRESHOLD_MS || _this._lastMomentumScrollEndTime < _this._lastMomentumScrollBeginTime; + return isAnimating; + }; + /** + * Invoke this from an `onResponderGrant` event. + */ + _this._handleResponderGrant = function (e) { + _this._observedScrollSinceBecomingResponder = false; + _this.props.onResponderGrant && _this.props.onResponderGrant(e); + _this._becameResponderWhileAnimating = _this._isAnimating(); + }; + /** + * Invoke this from an `onResponderReject` event. + * + * Some other element is not yielding its role as responder. Normally, we'd + * just disable the `UIScrollView`, but a touch has already began on it, the + * `UIScrollView` will not accept being disabled after that. The easiest + * solution for now is to accept the limitation of disallowing this + * altogether. To improve this, find a way to disable the `UIScrollView` after + * a touch has already started. + */ + _this._handleResponderReject = function () {}; + /** + * Invoke this from an `onResponderRelease` event. + */ + _this._handleResponderRelease = function (e) { + _this._isTouching = e.nativeEvent.touches.length !== 0; + _this.props.onResponderRelease && _this.props.onResponderRelease(e); + if (typeof e.target === 'number') { + if (__DEV__) { + console.error('Did not expect event target to be a number. Should have been a native component'); + } + return; + } + + // By default scroll views will unfocus a textField + // if another touch occurs outside of it + var currentlyFocusedTextInput = _TextInputState.default.currentlyFocusedInput(); + if (currentlyFocusedTextInput != null && _this.props.keyboardShouldPersistTaps !== true && _this.props.keyboardShouldPersistTaps !== 'always' && _this._keyboardIsDismissible() && e.target !== currentlyFocusedTextInput && !_this._observedScrollSinceBecomingResponder && !_this._becameResponderWhileAnimating) { + _TextInputState.default.blurTextInput(currentlyFocusedTextInput); + } + }; + /** + * We will allow the scroll view to give up its lock iff it acquired the lock + * during an animation. This is a very useful default that happens to satisfy + * many common user experiences. + * + * - Stop a scroll on the left edge, then turn that into an outer view's + * backswipe. + * - Stop a scroll mid-bounce at the top, continue pulling to have the outer + * view dismiss. + * - However, without catching the scroll view mid-bounce (while it is + * motionless), if you drag far enough for the scroll view to become + * responder (and therefore drag the scroll view a bit), any backswipe + * navigation of a swipe gesture higher in the view hierarchy, should be + * rejected. + */ + _this._handleResponderTerminationRequest = function () { + return !_this._observedScrollSinceBecomingResponder; + }; + /** + * Invoke this from an `onScroll` event. + */ + _this._handleScrollShouldSetResponder = function () { + // Allow any event touch pass through if the default pan responder is disabled + if (_this.props.disableScrollViewPanResponder === true) { + return false; + } + return _this._isTouching; + }; + /** + * Merely touch starting is not sufficient for a scroll view to become the + * responder. Being the "responder" means that the very next touch move/end + * event will result in an action/movement. + * + * Invoke this from an `onStartShouldSetResponder` event. + * + * `onStartShouldSetResponder` is used when the next move/end will trigger + * some UI movement/action, but when you want to yield priority to views + * nested inside of the view. + * + * There may be some cases where scroll views actually should return `true` + * from `onStartShouldSetResponder`: Any time we are detecting a standard tap + * that gives priority to nested views. + * + * - If a single tap on the scroll view triggers an action such as + * recentering a map style view yet wants to give priority to interaction + * views inside (such as dropped pins or labels), then we would return true + * from this method when there is a single touch. + * + * - Similar to the previous case, if a two finger "tap" should trigger a + * zoom, we would check the `touches` count, and if `>= 2`, we would return + * true. + * + */ + _this._handleStartShouldSetResponder = function (e) { + // Allow any event touch pass through if the default pan responder is disabled + if (_this.props.disableScrollViewPanResponder === true) { + return false; + } + var currentlyFocusedInput = _TextInputState.default.currentlyFocusedInput(); + if (_this.props.keyboardShouldPersistTaps === 'handled' && _this._keyboardIsDismissible() && e.target !== currentlyFocusedInput) { + return true; + } + return false; + }; + /** + * There are times when the scroll view wants to become the responder + * (meaning respond to the next immediate `touchStart/touchEnd`), in a way + * that *doesn't* give priority to nested views (hence the capture phase): + * + * - Currently animating. + * - Tapping anywhere that is not a text input, while the keyboard is + * up (which should dismiss the keyboard). + * + * Invoke this from an `onStartShouldSetResponderCapture` event. + */ + _this._handleStartShouldSetResponderCapture = function (e) { + // The scroll view should receive taps instead of its descendants if: + // * it is already animating/decelerating + if (_this._isAnimating()) { + return true; + } + + // Allow any event touch pass through if the default pan responder is disabled + if (_this.props.disableScrollViewPanResponder === true) { + return false; + } + + // * the keyboard is up, keyboardShouldPersistTaps is 'never' (the default), + // and a new touch starts with a non-textinput target (in which case the + // first tap should be sent to the scroll view and dismiss the keyboard, + // then the second tap goes to the actual interior view) + var keyboardShouldPersistTaps = _this.props.keyboardShouldPersistTaps; + var keyboardNeverPersistTaps = !keyboardShouldPersistTaps || keyboardShouldPersistTaps === 'never'; + if (typeof e.target === 'number') { + if (__DEV__) { + console.error('Did not expect event target to be a number. Should have been a native component'); + } + return false; + } + + // Let presses through if the soft keyboard is detached from the viewport + if (_this._softKeyboardIsDetached()) { + return false; + } + if (keyboardNeverPersistTaps && _this._keyboardIsDismissible() && e.target != null && + // $FlowFixMe[incompatible-call] + !_TextInputState.default.isTextInput(e.target)) { + return true; + } + return false; + }; + /** + * Do we consider there to be a dismissible soft-keyboard open? + */ + _this._keyboardIsDismissible = function () { + var currentlyFocusedInput = _TextInputState.default.currentlyFocusedInput(); + + // We cannot dismiss the keyboard without an input to blur, even if a soft + // keyboard is open (e.g. when keyboard is open due to a native component + // not participating in TextInputState). It's also possible that the + // currently focused input isn't a TextInput (such as by calling ref.focus + // on a non-TextInput). + var hasFocusedTextInput = currentlyFocusedInput != null && _TextInputState.default.isTextInput(currentlyFocusedInput); + + // Even if an input is focused, we may not have a keyboard to dismiss. E.g + // when using a physical keyboard. Ensure we have an event for an opened + // keyboard. + var softKeyboardMayBeOpen = _this._keyboardMetrics != null || _this._keyboardEventsAreUnreliable(); + return hasFocusedTextInput && softKeyboardMayBeOpen; + }; + /** + * Whether an open soft keyboard is present which does not overlap the + * viewport. E.g. for a VR soft-keyboard which is detached from the app + * viewport. + */ + _this._softKeyboardIsDetached = function () { + return _this._keyboardMetrics != null && _this._keyboardMetrics.height === 0; + }; + _this._keyboardEventsAreUnreliable = function () { + // Android versions prior to API 30 rely on observing layout changes when + // `android:windowSoftInputMode` is set to `adjustResize` or `adjustPan`. + return _Platform.default.OS === 'android' && _Platform.default.Version < 30; + }; + /** + * Invoke this from an `onTouchEnd` event. + * + * @param {PressEvent} e Event. + */ + _this._handleTouchEnd = function (e) { + var nativeEvent = e.nativeEvent; + _this._isTouching = nativeEvent.touches.length !== 0; + var keyboardShouldPersistTaps = _this.props.keyboardShouldPersistTaps; + var keyboardNeverPersistsTaps = !keyboardShouldPersistTaps || keyboardShouldPersistTaps === 'never'; + + // Dismiss the keyboard now if we didn't become responder in capture phase + // to eat presses, but still want to dismiss on interaction. + // Don't do anything if the target of the touch event is the current input. + var currentlyFocusedTextInput = _TextInputState.default.currentlyFocusedInput(); + if (currentlyFocusedTextInput != null && e.target !== currentlyFocusedTextInput && _this._softKeyboardIsDetached() && _this._keyboardIsDismissible() && keyboardNeverPersistsTaps) { + _TextInputState.default.blurTextInput(currentlyFocusedTextInput); + } + _this.props.onTouchEnd && _this.props.onTouchEnd(e); + }; + /** + * Invoke this from an `onTouchCancel` event. + * + * @param {PressEvent} e Event. + */ + _this._handleTouchCancel = function (e) { + _this._isTouching = false; + _this.props.onTouchCancel && _this.props.onTouchCancel(e); + }; + /** + * Invoke this from an `onTouchStart` event. + * + * Since we know that the `SimpleEventPlugin` occurs later in the plugin + * order, after `ResponderEventPlugin`, we can detect that we were *not* + * permitted to be the responder (presumably because a contained view became + * responder). The `onResponderReject` won't fire in that case - it only + * fires when a *current* responder rejects our request. + * + * @param {PressEvent} e Touch Start event. + */ + _this._handleTouchStart = function (e) { + _this._isTouching = true; + _this.props.onTouchStart && _this.props.onTouchStart(e); + }; + /** + * Invoke this from an `onTouchMove` event. + * + * Since we know that the `SimpleEventPlugin` occurs later in the plugin + * order, after `ResponderEventPlugin`, we can detect that we were *not* + * permitted to be the responder (presumably because a contained view became + * responder). The `onResponderReject` won't fire in that case - it only + * fires when a *current* responder rejects our request. + * + * @param {PressEvent} e Touch Start event. + */ + _this._handleTouchMove = function (e) { + _this.props.onTouchMove && _this.props.onTouchMove(e); + }; + _this._scrollAnimatedValue = new _AnimatedImplementation.default.Value((_this$props$contentOf = (_this$props$contentOf2 = _this.props.contentOffset) == null ? void 0 : _this$props$contentOf2.y) != null ? _this$props$contentOf : 0); + _this._scrollAnimatedValue.setOffset((_this$props$contentIn = (_this$props$contentIn2 = _this.props.contentInset) == null ? void 0 : _this$props$contentIn2.top) != null ? _this$props$contentIn : 0); + return _this; + } + (0, _inherits2.default)(ScrollView, _React$Component); + return (0, _createClass2.default)(ScrollView, [{ + key: "componentDidMount", + value: function componentDidMount() { + if (typeof this.props.keyboardShouldPersistTaps === 'boolean') { + console.warn(`'keyboardShouldPersistTaps={${this.props.keyboardShouldPersistTaps === true ? 'true' : 'false'}}' is deprecated. ` + `Use 'keyboardShouldPersistTaps="${this.props.keyboardShouldPersistTaps ? 'always' : 'never'}"' instead`); + } + this._keyboardMetrics = _Keyboard.default.metrics(); + this._additionalScrollOffset = 0; + this._subscriptionKeyboardWillShow = _Keyboard.default.addListener('keyboardWillShow', this.scrollResponderKeyboardWillShow); + this._subscriptionKeyboardWillHide = _Keyboard.default.addListener('keyboardWillHide', this.scrollResponderKeyboardWillHide); + this._subscriptionKeyboardDidShow = _Keyboard.default.addListener('keyboardDidShow', this.scrollResponderKeyboardDidShow); + this._subscriptionKeyboardDidHide = _Keyboard.default.addListener('keyboardDidHide', this.scrollResponderKeyboardDidHide); + this._updateAnimatedNodeAttachment(); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + var prevContentInsetTop = prevProps.contentInset ? prevProps.contentInset.top : 0; + var newContentInsetTop = this.props.contentInset ? this.props.contentInset.top : 0; + if (prevContentInsetTop !== newContentInsetTop) { + this._scrollAnimatedValue.setOffset(newContentInsetTop || 0); + } + this._updateAnimatedNodeAttachment(); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this._subscriptionKeyboardWillShow != null) { + this._subscriptionKeyboardWillShow.remove(); + } + if (this._subscriptionKeyboardWillHide != null) { + this._subscriptionKeyboardWillHide.remove(); + } + if (this._subscriptionKeyboardDidShow != null) { + this._subscriptionKeyboardDidShow.remove(); + } + if (this._subscriptionKeyboardDidHide != null) { + this._subscriptionKeyboardDidHide.remove(); + } + if (this._scrollAnimatedValueAttachment) { + this._scrollAnimatedValueAttachment.detach(); + } + } + }, { + key: "_textInputFocusError", + value: function _textInputFocusError() { + console.warn('Error measuring text field.'); + } + }, { + key: "_getKeyForIndex", + value: function _getKeyForIndex(index, childArray) { + var child = childArray[index]; + return child && child.key; + } + }, { + key: "_updateAnimatedNodeAttachment", + value: function _updateAnimatedNodeAttachment() { + if (this._scrollAnimatedValueAttachment) { + this._scrollAnimatedValueAttachment.detach(); + } + if (this.props.stickyHeaderIndices && this.props.stickyHeaderIndices.length > 0) { + this._scrollAnimatedValueAttachment = _AnimatedImplementation.default.attachNativeEvent(this._scrollView.nativeInstance, 'onScroll', [{ + nativeEvent: { + contentOffset: { + y: this._scrollAnimatedValue + } + } + }]); + } + } + }, { + key: "_setStickyHeaderRef", + value: function _setStickyHeaderRef(key, ref) { + if (ref) { + this._stickyHeaderRefs.set(key, ref); + } else { + this._stickyHeaderRefs.delete(key); + } + } + }, { + key: "_onStickyHeaderLayout", + value: function _onStickyHeaderLayout(index, event, key) { + var stickyHeaderIndices = this.props.stickyHeaderIndices; + if (!stickyHeaderIndices) { + return; + } + var childArray = React.Children.toArray(this.props.children); + if (key !== this._getKeyForIndex(index, childArray)) { + // ignore stale layout update + return; + } + var layoutY = event.nativeEvent.layout.y; + this._headerLayoutYs.set(key, layoutY); + var indexOfIndex = stickyHeaderIndices.indexOf(index); + var previousHeaderIndex = stickyHeaderIndices[indexOfIndex - 1]; + if (previousHeaderIndex != null) { + var previousHeader = this._stickyHeaderRefs.get(this._getKeyForIndex(previousHeaderIndex, childArray)); + previousHeader && previousHeader.setNextHeaderY && previousHeader.setNextHeaderY(layoutY); + } + } + }, { + key: "render", + value: function render() { + var _this2 = this; + var _ref2 = this.props.horizontal === true ? NativeHorizontalScrollViewTuple : NativeVerticalScrollViewTuple, + _ref3 = (0, _slicedToArray2.default)(_ref2, 2), + NativeDirectionalScrollView = _ref3[0], + NativeDirectionalScrollContentView = _ref3[1]; + var contentContainerStyle = [this.props.horizontal === true && styles.contentContainerHorizontal, this.props.contentContainerStyle]; + if (__DEV__ && this.props.style !== undefined) { + // $FlowFixMe[underconstrained-implicit-instantiation] + var style = (0, _flattenStyle.default)(this.props.style); + var childLayoutProps = ['alignItems', 'justifyContent'].filter( + // $FlowFixMe[incompatible-use] + function (prop) { + return style && style[prop] !== undefined; + }); + (0, _invariant.default)(childLayoutProps.length === 0, 'ScrollView child layout (' + JSON.stringify(childLayoutProps) + ') must be applied through the contentContainerStyle prop.'); + } + var contentSizeChangeProps = this.props.onContentSizeChange == null ? null : { + onLayout: this._handleContentOnLayout + }; + var stickyHeaderIndices = this.props.stickyHeaderIndices; + var children = this.props.children; + if (stickyHeaderIndices != null && stickyHeaderIndices.length > 0) { + var childArray = React.Children.toArray(this.props.children); + children = childArray.map(function (child, index) { + var indexOfIndex = child ? stickyHeaderIndices.indexOf(index) : -1; + if (indexOfIndex > -1) { + var key = child.key; + var nextIndex = stickyHeaderIndices[indexOfIndex + 1]; + var StickyHeaderComponent = _this2.props.StickyHeaderComponent || _ScrollViewStickyHeader.default; + return /*#__PURE__*/(0, _jsxRuntime.jsx)(StickyHeaderComponent, { + ref: function ref(_ref4) { + return _this2._setStickyHeaderRef(key, _ref4); + }, + nextHeaderLayoutY: _this2._headerLayoutYs.get(_this2._getKeyForIndex(nextIndex, childArray)), + onLayout: function onLayout(event) { + return _this2._onStickyHeaderLayout(index, event, key); + }, + scrollAnimatedValue: _this2._scrollAnimatedValue, + inverted: _this2.props.invertStickyHeaders, + hiddenOnScroll: _this2.props.stickyHeaderHiddenOnScroll, + scrollViewHeight: _this2.state.layoutHeight, + children: child + }, key); + } else { + return child; + } + }); + } + children = /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScrollViewContext.default.Provider, { + value: this.props.horizontal === true ? _ScrollViewContext.HORIZONTAL : _ScrollViewContext.VERTICAL, + children: children + }); + var hasStickyHeaders = Array.isArray(stickyHeaderIndices) && stickyHeaderIndices.length > 0; + var contentContainer = /*#__PURE__*/(0, _jsxRuntime.jsx)(NativeDirectionalScrollContentView, Object.assign({}, contentSizeChangeProps, { + ref: this._innerView.getForwardingRef(this.props.innerViewRef), + style: contentContainerStyle, + removeClippedSubviews: + // Subview clipping causes issues with sticky headers on Android and + // would be hard to fix properly in a performant way. + _Platform.default.OS === 'android' && hasStickyHeaders ? false : this.props.removeClippedSubviews, + collapsable: false, + children: children + })); + var alwaysBounceHorizontal = this.props.alwaysBounceHorizontal !== undefined ? this.props.alwaysBounceHorizontal : this.props.horizontal; + var alwaysBounceVertical = this.props.alwaysBounceVertical !== undefined ? this.props.alwaysBounceVertical : !this.props.horizontal; + var baseStyle = this.props.horizontal === true ? styles.baseHorizontal : styles.baseVertical; + var props = Object.assign({}, this.props, { + alwaysBounceHorizontal: alwaysBounceHorizontal, + alwaysBounceVertical: alwaysBounceVertical, + style: _StyleSheet.default.compose(baseStyle, this.props.style), + // Override the onContentSizeChange from props, since this event can + // bubble up from TextInputs + onContentSizeChange: null, + onLayout: this._handleLayout, + onMomentumScrollBegin: this._handleMomentumScrollBegin, + onMomentumScrollEnd: this._handleMomentumScrollEnd, + onResponderGrant: this._handleResponderGrant, + onResponderReject: this._handleResponderReject, + onResponderRelease: this._handleResponderRelease, + onResponderTerminationRequest: this._handleResponderTerminationRequest, + onScrollBeginDrag: this._handleScrollBeginDrag, + onScrollEndDrag: this._handleScrollEndDrag, + onScrollShouldSetResponder: this._handleScrollShouldSetResponder, + onStartShouldSetResponder: this._handleStartShouldSetResponder, + onStartShouldSetResponderCapture: this._handleStartShouldSetResponderCapture, + onTouchEnd: this._handleTouchEnd, + onTouchMove: this._handleTouchMove, + onTouchStart: this._handleTouchStart, + onTouchCancel: this._handleTouchCancel, + onScroll: this._handleScroll, + scrollEventThrottle: hasStickyHeaders ? 1 : this.props.scrollEventThrottle, + sendMomentumEvents: this.props.onMomentumScrollBegin || this.props.onMomentumScrollEnd ? true : false, + // default to true + snapToStart: this.props.snapToStart !== false, + // default to true + snapToEnd: this.props.snapToEnd !== false, + // pagingEnabled is overridden by snapToInterval / snapToOffsets + pagingEnabled: _Platform.default.select({ + // on iOS, pagingEnabled must be set to false to have snapToInterval / snapToOffsets work + ios: this.props.pagingEnabled === true && this.props.snapToInterval == null && this.props.snapToOffsets == null, + // on Android, pagingEnabled must be set to true to have snapToInterval / snapToOffsets work + android: this.props.pagingEnabled === true || this.props.snapToInterval != null || this.props.snapToOffsets != null + }) + }); + var decelerationRate = this.props.decelerationRate; + if (decelerationRate != null) { + props.decelerationRate = (0, _processDecelerationRate.default)(decelerationRate); + } + var refreshControl = this.props.refreshControl; + var scrollViewRef = this._scrollView.getForwardingRef(this.props.scrollViewRef); + if (refreshControl) { + if (_Platform.default.OS === 'ios') { + // On iOS the RefreshControl is a child of the ScrollView. + return /*#__PURE__*/(0, _jsxRuntime.jsxs)(NativeDirectionalScrollView, Object.assign({}, props, { + ref: scrollViewRef, + children: [refreshControl, contentContainer] + })); + } else if (_Platform.default.OS === 'android') { + // On Android wrap the ScrollView with a AndroidSwipeRefreshLayout. + // Since the ScrollView is wrapped add the style props to the + // AndroidSwipeRefreshLayout and use flex: 1 for the ScrollView. + // Note: we should split props.style on the inner and outer props + // however, the ScrollView still needs the baseStyle to be scrollable + // $FlowFixMe[underconstrained-implicit-instantiation] + // $FlowFixMe[incompatible-call] + var _splitLayoutProps = (0, _splitLayoutProps2.default)((0, _flattenStyle.default)(props.style)), + outer = _splitLayoutProps.outer, + inner = _splitLayoutProps.inner; + return React.cloneElement(refreshControl, { + style: _StyleSheet.default.compose(baseStyle, outer) + }, /*#__PURE__*/(0, _jsxRuntime.jsx)(NativeDirectionalScrollView, Object.assign({}, props, { + style: _StyleSheet.default.compose(baseStyle, inner), + ref: scrollViewRef, + children: contentContainer + }))); + } + } + return /*#__PURE__*/(0, _jsxRuntime.jsx)(NativeDirectionalScrollView, Object.assign({}, props, { + ref: scrollViewRef, + children: contentContainer + })); + } + }]); + }(React.Component); + ScrollView.Context = _ScrollViewContext.default; + var styles = _StyleSheet.default.create({ + baseVertical: { + flexGrow: 1, + flexShrink: 1, + flexDirection: 'column', + overflow: 'scroll' + }, + baseHorizontal: { + flexGrow: 1, + flexShrink: 1, + flexDirection: 'row', + overflow: 'scroll' + }, + contentContainerHorizontal: { + flexDirection: 'row' + } + }); + /** + * Helper function that should be replaced with `useCallback` and `useMergeRefs` + * once `ScrollView` is reimplemented as a functional component. + */ + function createRefForwarder(mutator) { + var state = { + getForwardingRef: (0, _memoizeOne.default)(function (forwardedRef) { + return function (nativeInstance) { + var publicInstance = nativeInstance == null ? null : mutator(nativeInstance); + state.nativeInstance = nativeInstance; + state.publicInstance = publicInstance; + if (forwardedRef != null) { + if (typeof forwardedRef === 'function') { + forwardedRef(publicInstance); + } else { + forwardedRef.current = publicInstance; + } + } + }; + }), + nativeInstance: null, + publicInstance: null + }; + return state; + } + + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ + function Wrapper(props, ref) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(ScrollView, Object.assign({}, props, { + scrollViewRef: ref + })); + } + Wrapper.displayName = 'ScrollView'; + // $FlowFixMe[incompatible-call] + var ForwardedScrollView = React.forwardRef(Wrapper); + + // $FlowFixMe[prop-missing] Add static context to ForwardedScrollView + ForwardedScrollView.Context = _ScrollViewContext.default; + ForwardedScrollView.displayName = 'ScrollView'; + module.exports = ForwardedScrollView; +},346,[6,7,18,19,23,25,28,347,384,51,222,386,266,255,387,34,388,281,241,391,392,393,394,395,396,397,398,37,403,52,65,106,437,61],"node_modules\\react-native\\Libraries\\Components\\ScrollView\\ScrollView.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _DecayAnimation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./animations/DecayAnimation")); + var _SpringAnimation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "./animations/SpringAnimation")); + var _TimingAnimation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "./animations/TimingAnimation")); + var _createAnimatedComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "./createAnimatedComponent")); + var _AnimatedAddition = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "./nodes/AnimatedAddition")); + var _AnimatedColor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./nodes/AnimatedColor")); + var _AnimatedDiffClamp = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./nodes/AnimatedDiffClamp")); + var _AnimatedDivision = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./nodes/AnimatedDivision")); + var _AnimatedInterpolation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./nodes/AnimatedInterpolation")); + var _AnimatedModulo = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "./nodes/AnimatedModulo")); + var _AnimatedMultiplication = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[11], "./nodes/AnimatedMultiplication")); + var _AnimatedNode = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[12], "./nodes/AnimatedNode")); + var _AnimatedSubtraction = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[13], "./nodes/AnimatedSubtraction")); + var _AnimatedTracking = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[14], "./nodes/AnimatedTracking")); + var _AnimatedValue = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[15], "./nodes/AnimatedValue")); + var _AnimatedValueXY = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[16], "./nodes/AnimatedValueXY")); + var add = function add(a, b) { + return new _AnimatedAddition.default(a, b); + }; + var subtract = function subtract(a, b) { + return new _AnimatedSubtraction.default(a, b); + }; + var divide = function divide(a, b) { + return new _AnimatedDivision.default(a, b); + }; + var multiply = function multiply(a, b) { + return new _AnimatedMultiplication.default(a, b); + }; + var modulo = function modulo(a, modulus) { + return new _AnimatedModulo.default(a, modulus); + }; + var diffClamp = function diffClamp(a, min, max) { + return new _AnimatedDiffClamp.default(a, min, max); + }; + var _combineCallbacks = function _combineCallbacks(callback, config) { + if (callback && config.onComplete) { + return function () { + config.onComplete && config.onComplete.apply(config, arguments); + callback && callback.apply(void 0, arguments); + }; + } else { + return callback || config.onComplete; + } + }; + var maybeVectorAnim = function maybeVectorAnim(value, config, anim) { + if (value instanceof _AnimatedValueXY.default) { + var configX = Object.assign({}, config); + var configY = Object.assign({}, config); + for (var key in config) { + var _config$key = config[key], + x = _config$key.x, + y = _config$key.y; + if (x !== undefined && y !== undefined) { + configX[key] = x; + configY[key] = y; + } + } + var aX = anim(value.x, configX); + var aY = anim(value.y, configY); + // We use `stopTogether: false` here because otherwise tracking will break + // because the second animation will get stopped before it can update. + return parallel([aX, aY], { + stopTogether: false + }); + } else if (value instanceof _AnimatedColor.default) { + var configR = Object.assign({}, config); + var configG = Object.assign({}, config); + var configB = Object.assign({}, config); + var configA = Object.assign({}, config); + for (var _key in config) { + var _config$_key = config[_key], + r = _config$_key.r, + g = _config$_key.g, + b = _config$_key.b, + a = _config$_key.a; + if (r !== undefined && g !== undefined && b !== undefined && a !== undefined) { + configR[_key] = r; + configG[_key] = g; + configB[_key] = b; + configA[_key] = a; + } + } + var aR = anim(value.r, configR); + var aG = anim(value.g, configG); + var aB = anim(value.b, configB); + var aA = anim(value.a, configA); + // We use `stopTogether: false` here because otherwise tracking will break + // because the second animation will get stopped before it can update. + return parallel([aR, aG, aB, aA], { + stopTogether: false + }); + } + return null; + }; + var _spring = function spring(value, config) { + var _start = function start(animatedValue, configuration, callback) { + callback = _combineCallbacks(callback, configuration); + var singleValue = animatedValue; + var singleConfig = configuration; + singleValue.stopTracking(); + if (configuration.toValue instanceof _AnimatedNode.default) { + singleValue.track(new _AnimatedTracking.default(singleValue, configuration.toValue, _SpringAnimation.default, singleConfig, callback)); + } else { + singleValue.animate(new _SpringAnimation.default(singleConfig), callback); + } + }; + return maybeVectorAnim(value, config, _spring) || { + start: function start(callback) { + _start(value, config, callback); + }, + stop: function stop() { + value.stopAnimation(); + }, + reset: function reset() { + value.resetAnimation(); + }, + _startNativeLoop: function _startNativeLoop(iterations) { + var singleConfig = Object.assign({}, config, { + iterations: iterations + }); + _start(value, singleConfig); + }, + _isUsingNativeDriver: function _isUsingNativeDriver() { + return config.useNativeDriver || false; + } + }; + }; + var _timing = function timing(value, config) { + var _start2 = function start(animatedValue, configuration, callback) { + callback = _combineCallbacks(callback, configuration); + var singleValue = animatedValue; + var singleConfig = configuration; + singleValue.stopTracking(); + if (configuration.toValue instanceof _AnimatedNode.default) { + singleValue.track(new _AnimatedTracking.default(singleValue, configuration.toValue, _TimingAnimation.default, singleConfig, callback)); + } else { + singleValue.animate(new _TimingAnimation.default(singleConfig), callback); + } + }; + return maybeVectorAnim(value, config, _timing) || { + start: function start(callback) { + _start2(value, config, callback); + }, + stop: function stop() { + value.stopAnimation(); + }, + reset: function reset() { + value.resetAnimation(); + }, + _startNativeLoop: function _startNativeLoop(iterations) { + var singleConfig = Object.assign({}, config, { + iterations: iterations + }); + _start2(value, singleConfig); + }, + _isUsingNativeDriver: function _isUsingNativeDriver() { + return config.useNativeDriver || false; + } + }; + }; + var _decay = function decay(value, config) { + var _start3 = function start(animatedValue, configuration, callback) { + callback = _combineCallbacks(callback, configuration); + var singleValue = animatedValue; + var singleConfig = configuration; + singleValue.stopTracking(); + singleValue.animate(new _DecayAnimation.default(singleConfig), callback); + }; + return maybeVectorAnim(value, config, _decay) || { + start: function start(callback) { + _start3(value, config, callback); + }, + stop: function stop() { + value.stopAnimation(); + }, + reset: function reset() { + value.resetAnimation(); + }, + _startNativeLoop: function _startNativeLoop(iterations) { + var singleConfig = Object.assign({}, config, { + iterations: iterations + }); + _start3(value, singleConfig); + }, + _isUsingNativeDriver: function _isUsingNativeDriver() { + return config.useNativeDriver || false; + } + }; + }; + var sequence = function sequence(animations) { + var current = 0; + return { + start: function start(callback) { + var _onComplete = function onComplete(result) { + if (!result.finished) { + callback && callback(result); + return; + } + current++; + if (current === animations.length) { + callback && callback(result); + return; + } + animations[current].start(_onComplete); + }; + if (animations.length === 0) { + callback && callback({ + finished: true + }); + } else { + animations[current].start(_onComplete); + } + }, + stop: function stop() { + if (current < animations.length) { + animations[current].stop(); + } + }, + reset: function reset() { + animations.forEach(function (animation, idx) { + if (idx <= current) { + animation.reset(); + } + }); + current = 0; + }, + _startNativeLoop: function _startNativeLoop() { + throw new Error('Loops run using the native driver cannot contain Animated.sequence animations'); + }, + _isUsingNativeDriver: function _isUsingNativeDriver() { + return false; + } + }; + }; + var parallel = function parallel(animations, config) { + var doneCount = 0; + // Make sure we only call stop() at most once for each animation + var hasEnded = {}; + var stopTogether = !(config && config.stopTogether === false); + var result = { + start: function start(callback) { + if (doneCount === animations.length) { + callback && callback({ + finished: true + }); + return; + } + animations.forEach(function (animation, idx) { + var cb = function cb(endResult) { + hasEnded[idx] = true; + doneCount++; + if (doneCount === animations.length) { + doneCount = 0; + callback && callback(endResult); + return; + } + if (!endResult.finished && stopTogether) { + result.stop(); + } + }; + if (!animation) { + cb({ + finished: true + }); + } else { + animation.start(cb); + } + }); + }, + stop: function stop() { + animations.forEach(function (animation, idx) { + !hasEnded[idx] && animation.stop(); + hasEnded[idx] = true; + }); + }, + reset: function reset() { + animations.forEach(function (animation, idx) { + animation.reset(); + hasEnded[idx] = false; + doneCount = 0; + }); + }, + _startNativeLoop: function _startNativeLoop() { + throw new Error('Loops run using the native driver cannot contain Animated.parallel animations'); + }, + _isUsingNativeDriver: function _isUsingNativeDriver() { + return false; + } + }; + return result; + }; + var delay = function delay(time) { + // Would be nice to make a specialized implementation + return _timing(new _AnimatedValue.default(0), { + toValue: 0, + delay: time, + duration: 0, + useNativeDriver: false + }); + }; + var stagger = function stagger(time, animations) { + return parallel(animations.map(function (animation, i) { + return sequence([delay(time * i), animation]); + })); + }; + var loop = function loop(animation) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$iterations = _ref.iterations, + iterations = _ref$iterations === void 0 ? -1 : _ref$iterations, + _ref$resetBeforeItera = _ref.resetBeforeIteration, + resetBeforeIteration = _ref$resetBeforeItera === void 0 ? true : _ref$resetBeforeItera; + var isFinished = false; + var iterationsSoFar = 0; + return { + start: function start(callback) { + var _restart = function restart() { + var result = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + finished: true + }; + if (isFinished || iterationsSoFar === iterations || result.finished === false) { + callback && callback(result); + } else { + iterationsSoFar++; + resetBeforeIteration && animation.reset(); + animation.start(_restart); + } + }; + if (!animation || iterations === 0) { + callback && callback({ + finished: true + }); + } else { + if (animation._isUsingNativeDriver()) { + animation._startNativeLoop(iterations); + } else { + _restart(); // Start looping recursively on the js thread + } + } + }, + stop: function stop() { + isFinished = true; + animation.stop(); + }, + reset: function reset() { + iterationsSoFar = 0; + isFinished = false; + animation.reset(); + }, + _startNativeLoop: function _startNativeLoop() { + throw new Error('Loops run using the native driver cannot contain Animated.loop animations'); + }, + _isUsingNativeDriver: function _isUsingNativeDriver() { + return animation._isUsingNativeDriver(); + } + }; + }; + function forkEvent(event, listener) { + if (!event) { + return listener; + } else if (event instanceof _$$_REQUIRE(_dependencyMap[17], "./AnimatedEvent").AnimatedEvent) { + event.__addListener(listener); + return event; + } else { + return function () { + typeof event === 'function' && event.apply(void 0, arguments); + listener.apply(void 0, arguments); + }; + } + } + function unforkEvent(event, listener) { + if (event && event instanceof _$$_REQUIRE(_dependencyMap[17], "./AnimatedEvent").AnimatedEvent) { + event.__removeListener(listener); + } + } + var event = function event(argMapping, config) { + var animatedEvent = new (_$$_REQUIRE(_dependencyMap[17], "./AnimatedEvent").AnimatedEvent)(argMapping, config); + if (animatedEvent.__isNative) { + return animatedEvent; + } else { + return animatedEvent.__getHandler(); + } + }; + + // All types of animated nodes that represent scalar numbers and can be interpolated (etc) + /** + * The `Animated` library is designed to make animations fluid, powerful, and + * easy to build and maintain. `Animated` focuses on declarative relationships + * between inputs and outputs, with configurable transforms in between, and + * simple `start`/`stop` methods to control time-based animation execution. + * If additional transforms are added, be sure to include them in + * AnimatedMock.js as well. + * + * See https://reactnative.dev/docs/animated + */ + var _default = exports.default = { + /** + * Standard value class for driving animations. Typically initialized with + * `new Animated.Value(0);` + * + * See https://reactnative.dev/docs/animated#value + */ + Value: _AnimatedValue.default, + /** + * 2D value class for driving 2D animations, such as pan gestures. + * + * See https://reactnative.dev/docs/animatedvaluexy + */ + ValueXY: _AnimatedValueXY.default, + /** + * Value class for driving color animations. + */ + Color: _AnimatedColor.default, + /** + * Exported to use the Interpolation type in flow. + * + * See https://reactnative.dev/docs/animated#interpolation + */ + Interpolation: _AnimatedInterpolation.default, + /** + * Exported for ease of type checking. All animated values derive from this + * class. + * + * See https://reactnative.dev/docs/animated#node + */ + Node: _AnimatedNode.default, + /** + * Animates a value from an initial velocity to zero based on a decay + * coefficient. + * + * See https://reactnative.dev/docs/animated#decay + */ + decay: _decay, + /** + * Animates a value along a timed easing curve. The Easing module has tons of + * predefined curves, or you can use your own function. + * + * See https://reactnative.dev/docs/animated#timing + */ + timing: _timing, + /** + * Animates a value according to an analytical spring model based on + * damped harmonic oscillation. + * + * See https://reactnative.dev/docs/animated#spring + */ + spring: _spring, + /** + * Creates a new Animated value composed from two Animated values added + * together. + * + * See https://reactnative.dev/docs/animated#add + */ + add: add, + /** + * Creates a new Animated value composed by subtracting the second Animated + * value from the first Animated value. + * + * See https://reactnative.dev/docs/animated#subtract + */ + subtract: subtract, + /** + * Creates a new Animated value composed by dividing the first Animated value + * by the second Animated value. + * + * See https://reactnative.dev/docs/animated#divide + */ + divide: divide, + /** + * Creates a new Animated value composed from two Animated values multiplied + * together. + * + * See https://reactnative.dev/docs/animated#multiply + */ + multiply: multiply, + /** + * Creates a new Animated value that is the (non-negative) modulo of the + * provided Animated value. + * + * See https://reactnative.dev/docs/animated#modulo + */ + modulo: modulo, + /** + * Create a new Animated value that is limited between 2 values. It uses the + * difference between the last value so even if the value is far from the + * bounds it will start changing when the value starts getting closer again. + * + * See https://reactnative.dev/docs/animated#diffclamp + */ + diffClamp: diffClamp, + /** + * Starts an animation after the given delay. + * + * See https://reactnative.dev/docs/animated#delay + */ + delay: delay, + /** + * Starts an array of animations in order, waiting for each to complete + * before starting the next. If the current running animation is stopped, no + * following animations will be started. + * + * See https://reactnative.dev/docs/animated#sequence + */ + sequence: sequence, + /** + * Starts an array of animations all at the same time. By default, if one + * of the animations is stopped, they will all be stopped. You can override + * this with the `stopTogether` flag. + * + * See https://reactnative.dev/docs/animated#parallel + */ + parallel: parallel, + /** + * Array of animations may run in parallel (overlap), but are started in + * sequence with successive delays. Nice for doing trailing effects. + * + * See https://reactnative.dev/docs/animated#stagger + */ + stagger: stagger, + /** + * Loops a given animation continuously, so that each time it reaches the + * end, it resets and begins again from the start. + * + * See https://reactnative.dev/docs/animated#loop + */ + loop: loop, + /** + * Takes an array of mappings and extracts values from each arg accordingly, + * then calls `setValue` on the mapped outputs. + * + * See https://reactnative.dev/docs/animated#event + */ + event: event, + /** + * Make any React component Animatable. Used to create `Animated.View`, etc. + * + * See https://reactnative.dev/docs/animated#createanimatedcomponent + */ + createAnimatedComponent: _createAnimatedComponent.default, + /** + * Imperative API to attach an animated value to an event on a view. Prefer + * using `Animated.event` with `useNativeDrive: true` if possible. + * + * See https://reactnative.dev/docs/animated#attachnativeevent + */ + attachNativeEvent: _$$_REQUIRE(_dependencyMap[17], "./AnimatedEvent").attachNativeEvent, + /** + * Advanced imperative API for snooping on animated events that are passed in + * through props. Use values directly where possible. + * + * See https://reactnative.dev/docs/animated#forkevent + */ + forkEvent: forkEvent, + unforkEvent: unforkEvent, + /** + * Expose Event class, so it can be used as a type for type checkers. + */ + Event: _$$_REQUIRE(_dependencyMap[17], "./AnimatedEvent").AnimatedEvent + }; +},347,[6,348,369,371,372,377,354,378,379,358,380,381,362,382,383,355,368,367],"node_modules\\react-native\\Libraries\\Animated\\AnimatedImplementation.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _NativeAnimatedHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../NativeAnimatedHelper")); + var _Animation2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./Animation")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var DecayAnimation = exports.default = /*#__PURE__*/function (_Animation) { + function DecayAnimation(config) { + var _config$deceleration, _config$isInteraction, _config$iterations; + var _this; + (0, _classCallCheck2.default)(this, DecayAnimation); + _this = _callSuper(this, DecayAnimation); + _this._deceleration = (_config$deceleration = config.deceleration) != null ? _config$deceleration : 0.998; + _this._velocity = config.velocity; + _this._useNativeDriver = _NativeAnimatedHelper.default.shouldUseNativeDriver(config); + _this._platformConfig = config.platformConfig; + _this.__isInteraction = (_config$isInteraction = config.isInteraction) != null ? _config$isInteraction : !_this._useNativeDriver; + _this.__iterations = (_config$iterations = config.iterations) != null ? _config$iterations : 1; + return _this; + } + (0, _inherits2.default)(DecayAnimation, _Animation); + return (0, _createClass2.default)(DecayAnimation, [{ + key: "__getNativeAnimationConfig", + value: function __getNativeAnimationConfig() { + return { + type: 'decay', + deceleration: this._deceleration, + velocity: this._velocity, + iterations: this.__iterations, + platformConfig: this._platformConfig + }; + } + }, { + key: "start", + value: function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) { + this.__active = true; + this._lastValue = fromValue; + this._fromValue = fromValue; + this._onUpdate = onUpdate; + this.__onEnd = onEnd; + this._startTime = Date.now(); + if (!this._useNativeDriver && animatedValue.__isNative === true) { + throw new Error('Attempting to run JS driven animation on animated node ' + 'that has been moved to "native" earlier by starting an ' + 'animation with `useNativeDriver: true`'); + } + if (this._useNativeDriver) { + this.__startNativeAnimation(animatedValue); + } else { + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); + } + } + }, { + key: "onUpdate", + value: function onUpdate() { + var now = Date.now(); + var value = this._fromValue + this._velocity / (1 - this._deceleration) * (1 - Math.exp(-(1 - this._deceleration) * (now - this._startTime))); + this._onUpdate(value); + if (Math.abs(this._lastValue - value) < 0.1) { + this.__debouncedOnEnd({ + finished: true + }); + return; + } + this._lastValue = value; + if (this.__active) { + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); + } + } + }, { + key: "stop", + value: function stop() { + _superPropGet(DecayAnimation, "stop", this, 3)([]); + this.__active = false; + global.cancelAnimationFrame(this._animationFrame); + this.__debouncedOnEnd({ + finished: false + }); + } + }]); + }(_Animation2.default); +},348,[6,18,19,23,25,26,28,349,353],"node_modules\\react-native\\Libraries\\Animated\\animations\\DecayAnimation.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _NativeEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../EventEmitter/NativeEventEmitter")); + var _RCTDeviceEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../EventEmitter/RCTDeviceEventEmitter")); + var _ReactNativeFeatureFlags = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../ReactNative/ReactNativeFeatureFlags")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../Utilities/Platform")); + var _NativeAnimatedModule = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "./NativeAnimatedModule")); + var _NativeAnimatedTurboModule = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./NativeAnimatedTurboModule")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "invariant")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + // TODO T69437152 @petetheheat - Delete this fork when Fabric ships to 100%. + var NativeAnimatedModule = _NativeAnimatedModule.default != null ? _NativeAnimatedModule.default : _NativeAnimatedTurboModule.default; + var __nativeAnimatedNodeTagCount = 1; /* used for animated nodes */ + var __nativeAnimationIdCount = 1; /* used for started animations */ + + var nativeEventEmitter; + var waitingForQueuedOperations = new Set(); + var queueOperations = false; + var queue = []; + // $FlowFixMe + var singleOpQueue = []; + var useSingleOpBatching = _Platform.default.OS === 'android' && !!(NativeAnimatedModule != null && NativeAnimatedModule.queueAndExecuteBatchedOperations) && _ReactNativeFeatureFlags.default.animatedShouldUseSingleOp(); + var flushQueueTimeout = null; + var eventListenerGetValueCallbacks = {}; + var eventListenerAnimationFinishedCallbacks = {}; + var globalEventEmitterGetValueListener = null; + var globalEventEmitterAnimationFinishedListener = null; + var nativeOps = useSingleOpBatching ? function () { + var apis = ['createAnimatedNode', + // 1 + 'updateAnimatedNodeConfig', + // 2 + 'getValue', + // 3 + 'startListeningToAnimatedNodeValue', + // 4 + 'stopListeningToAnimatedNodeValue', + // 5 + 'connectAnimatedNodes', + // 6 + 'disconnectAnimatedNodes', + // 7 + 'startAnimatingNode', + // 8 + 'stopAnimation', + // 9 + 'setAnimatedNodeValue', + // 10 + 'setAnimatedNodeOffset', + // 11 + 'flattenAnimatedNodeOffset', + // 12 + 'extractAnimatedNodeOffset', + // 13 + 'connectAnimatedNodeToView', + // 14 + 'disconnectAnimatedNodeFromView', + // 15 + 'restoreDefaultValues', + // 16 + 'dropAnimatedNode', + // 17 + 'addAnimatedEventToView', + // 18 + 'removeAnimatedEventFromView', + // 19 + 'addListener', + // 20 + 'removeListener' // 21 + ]; + return apis.reduce(function (acc, functionName, i) { + // These indices need to be kept in sync with the indices in native (see NativeAnimatedModule in Java, or the equivalent for any other native platform). + // $FlowFixMe[prop-missing] + acc[functionName] = i + 1; + return acc; + }, {}); + }() : NativeAnimatedModule; + + /** + * Wrappers around NativeAnimatedModule to provide flow and autocomplete support for + * the native module methods, and automatic queue management on Android + */ + var API = { + getValue: function getValue(tag, saveValueCallback) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + if (useSingleOpBatching) { + if (saveValueCallback) { + eventListenerGetValueCallbacks[tag] = saveValueCallback; + } + // $FlowFixMe + API.queueOperation(nativeOps.getValue, tag); + } else { + API.queueOperation(nativeOps.getValue, tag, saveValueCallback); + } + }, + setWaitingForIdentifier: function setWaitingForIdentifier(id) { + waitingForQueuedOperations.add(id); + queueOperations = true; + if (_ReactNativeFeatureFlags.default.animatedShouldDebounceQueueFlush() && flushQueueTimeout) { + clearTimeout(flushQueueTimeout); + } + }, + unsetWaitingForIdentifier: function unsetWaitingForIdentifier(id) { + waitingForQueuedOperations.delete(id); + if (waitingForQueuedOperations.size === 0) { + queueOperations = false; + API.disableQueue(); + } + }, + disableQueue: function disableQueue() { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + if (_ReactNativeFeatureFlags.default.animatedShouldDebounceQueueFlush()) { + var prevTimeout = flushQueueTimeout; + clearImmediate(prevTimeout); + flushQueueTimeout = setImmediate(API.flushQueue); + } else { + API.flushQueue(); + } + }, + flushQueue: function flushQueue() { + // TODO: (T136971132) + (0, _invariant.default)(NativeAnimatedModule || process.env.NODE_ENV === 'test', 'Native animated module is not available'); + flushQueueTimeout = null; + + // Early returns before calling any APIs + if (useSingleOpBatching && singleOpQueue.length === 0) { + return; + } + if (!useSingleOpBatching && queue.length === 0) { + return; + } + if (useSingleOpBatching) { + // Set up event listener for callbacks if it's not set up + if (!globalEventEmitterGetValueListener || !globalEventEmitterAnimationFinishedListener) { + setupGlobalEventEmitterListeners(); + } + // Single op batching doesn't use callback functions, instead we + // use RCTDeviceEventEmitter. This reduces overhead of sending lots of + // JSI functions across to native code; but also, TM infrastructure currently + // does not support packing a function into native arrays. + NativeAnimatedModule == null ? void 0 : NativeAnimatedModule.queueAndExecuteBatchedOperations == null ? void 0 : NativeAnimatedModule.queueAndExecuteBatchedOperations(singleOpQueue); + singleOpQueue.length = 0; + } else { + _Platform.default.OS === 'android' && (NativeAnimatedModule == null ? void 0 : NativeAnimatedModule.startOperationBatch == null ? void 0 : NativeAnimatedModule.startOperationBatch()); + for (var q = 0, l = queue.length; q < l; q++) { + queue[q](); + } + queue.length = 0; + _Platform.default.OS === 'android' && (NativeAnimatedModule == null ? void 0 : NativeAnimatedModule.finishOperationBatch == null ? void 0 : NativeAnimatedModule.finishOperationBatch()); + } + }, + queueOperation: function queueOperation(fn) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + if (useSingleOpBatching) { + // Get the command ID from the queued function, and push that ID and any arguments needed to execute the operation + // $FlowFixMe: surprise, fn is actually a number + singleOpQueue.push.apply(singleOpQueue, [fn].concat(args)); + return; + } + + // If queueing is explicitly on, *or* the queue has not yet + // been flushed, use the queue. This is to prevent operations + // from being executed out of order. + if (queueOperations || queue.length !== 0) { + queue.push(function () { + return fn.apply(void 0, args); + }); + } else { + fn.apply(void 0, args); + } + }, + createAnimatedNode: function createAnimatedNode(tag, config) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + API.queueOperation(nativeOps.createAnimatedNode, tag, config); + }, + updateAnimatedNodeConfig: function updateAnimatedNodeConfig(tag, config) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + if (nativeOps.updateAnimatedNodeConfig) { + API.queueOperation(nativeOps.updateAnimatedNodeConfig, tag, config); + } + }, + startListeningToAnimatedNodeValue: function startListeningToAnimatedNodeValue(tag) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + API.queueOperation(nativeOps.startListeningToAnimatedNodeValue, tag); + }, + stopListeningToAnimatedNodeValue: function stopListeningToAnimatedNodeValue(tag) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + API.queueOperation(nativeOps.stopListeningToAnimatedNodeValue, tag); + }, + connectAnimatedNodes: function connectAnimatedNodes(parentTag, childTag) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + API.queueOperation(nativeOps.connectAnimatedNodes, parentTag, childTag); + }, + disconnectAnimatedNodes: function disconnectAnimatedNodes(parentTag, childTag) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + API.queueOperation(nativeOps.disconnectAnimatedNodes, parentTag, childTag); + }, + startAnimatingNode: function startAnimatingNode(animationId, nodeTag, config, endCallback) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + if (useSingleOpBatching) { + if (endCallback) { + eventListenerAnimationFinishedCallbacks[animationId] = endCallback; + } + // $FlowFixMe + API.queueOperation( + // $FlowFixMe[incompatible-call] + nativeOps.startAnimatingNode, animationId, nodeTag, config); + } else { + API.queueOperation(nativeOps.startAnimatingNode, animationId, nodeTag, config, endCallback); + } + }, + stopAnimation: function stopAnimation(animationId) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + API.queueOperation(nativeOps.stopAnimation, animationId); + }, + setAnimatedNodeValue: function setAnimatedNodeValue(nodeTag, value) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + API.queueOperation(nativeOps.setAnimatedNodeValue, nodeTag, value); + }, + setAnimatedNodeOffset: function setAnimatedNodeOffset(nodeTag, offset) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + API.queueOperation(nativeOps.setAnimatedNodeOffset, nodeTag, offset); + }, + flattenAnimatedNodeOffset: function flattenAnimatedNodeOffset(nodeTag) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + API.queueOperation(nativeOps.flattenAnimatedNodeOffset, nodeTag); + }, + extractAnimatedNodeOffset: function extractAnimatedNodeOffset(nodeTag) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + API.queueOperation(nativeOps.extractAnimatedNodeOffset, nodeTag); + }, + connectAnimatedNodeToView: function connectAnimatedNodeToView(nodeTag, viewTag) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + API.queueOperation(nativeOps.connectAnimatedNodeToView, nodeTag, viewTag); + }, + disconnectAnimatedNodeFromView: function disconnectAnimatedNodeFromView(nodeTag, viewTag) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + API.queueOperation(nativeOps.disconnectAnimatedNodeFromView, nodeTag, viewTag); + }, + restoreDefaultValues: function restoreDefaultValues(nodeTag) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + // Backwards compat with older native runtimes, can be removed later. + if (nativeOps.restoreDefaultValues != null) { + API.queueOperation(nativeOps.restoreDefaultValues, nodeTag); + } + }, + dropAnimatedNode: function dropAnimatedNode(tag) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + API.queueOperation(nativeOps.dropAnimatedNode, tag); + }, + addAnimatedEventToView: function addAnimatedEventToView(viewTag, eventName, eventMapping) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + API.queueOperation(nativeOps.addAnimatedEventToView, viewTag, eventName, eventMapping); + }, + removeAnimatedEventFromView: function removeAnimatedEventFromView(viewTag, eventName, animatedNodeTag) { + (0, _invariant.default)(nativeOps, 'Native animated module is not available'); + API.queueOperation(nativeOps.removeAnimatedEventFromView, viewTag, eventName, animatedNodeTag); + } + }; + function setupGlobalEventEmitterListeners() { + globalEventEmitterGetValueListener = _RCTDeviceEventEmitter.default.addListener('onNativeAnimatedModuleGetValue', function (params) { + var tag = params.tag; + var callback = eventListenerGetValueCallbacks[tag]; + if (!callback) { + return; + } + callback(params.value); + delete eventListenerGetValueCallbacks[tag]; + }); + globalEventEmitterAnimationFinishedListener = _RCTDeviceEventEmitter.default.addListener('onNativeAnimatedModuleAnimationFinished', function (params) { + var animationId = params.animationId; + var callback = eventListenerAnimationFinishedCallbacks[animationId]; + if (!callback) { + return; + } + callback(params); + delete eventListenerAnimationFinishedCallbacks[animationId]; + }); + } + + /** + * Styles allowed by the native animated implementation. + * + * In general native animated implementation should support any numeric or color property that + * doesn't need to be updated through the shadow view hierarchy (all non-layout properties). + */ + var SUPPORTED_COLOR_STYLES = { + backgroundColor: true, + borderBottomColor: true, + borderColor: true, + borderEndColor: true, + borderLeftColor: true, + borderRightColor: true, + borderStartColor: true, + borderTopColor: true, + color: true, + tintColor: true + }; + var SUPPORTED_STYLES = Object.assign({}, SUPPORTED_COLOR_STYLES, { + borderBottomEndRadius: true, + borderBottomLeftRadius: true, + borderBottomRightRadius: true, + borderBottomStartRadius: true, + borderEndEndRadius: true, + borderEndStartRadius: true, + borderRadius: true, + borderTopEndRadius: true, + borderTopLeftRadius: true, + borderTopRightRadius: true, + borderTopStartRadius: true, + borderStartEndRadius: true, + borderStartStartRadius: true, + elevation: true, + opacity: true, + transform: true, + zIndex: true, + /* ios styles */ + shadowOpacity: true, + shadowRadius: true, + /* legacy android transform properties */ + scaleX: true, + scaleY: true, + translateX: true, + translateY: true + }); + var SUPPORTED_TRANSFORMS = { + translateX: true, + translateY: true, + scale: true, + scaleX: true, + scaleY: true, + rotate: true, + rotateX: true, + rotateY: true, + rotateZ: true, + perspective: true, + skewX: true, + skewY: true, + matrix: _ReactNativeFeatureFlags.default.shouldUseAnimatedObjectForTransform() + }; + var SUPPORTED_INTERPOLATION_PARAMS = { + inputRange: true, + outputRange: true, + extrapolate: true, + extrapolateRight: true, + extrapolateLeft: true + }; + function addWhitelistedStyleProp(prop) { + // $FlowFixMe[prop-missing] + SUPPORTED_STYLES[prop] = true; + } + function addWhitelistedTransformProp(prop) { + // $FlowFixMe[prop-missing] + SUPPORTED_TRANSFORMS[prop] = true; + } + function addWhitelistedInterpolationParam(param) { + // $FlowFixMe[prop-missing] + SUPPORTED_INTERPOLATION_PARAMS[param] = true; + } + function isSupportedColorStyleProp(prop) { + return SUPPORTED_COLOR_STYLES[prop] === true; + } + function isSupportedStyleProp(prop) { + return SUPPORTED_STYLES[prop] === true; + } + function isSupportedTransformProp(prop) { + return SUPPORTED_TRANSFORMS[prop] === true; + } + function isSupportedInterpolationParam(param) { + return SUPPORTED_INTERPOLATION_PARAMS[param] === true; + } + function validateTransform(configs) { + configs.forEach(function (config) { + if (!isSupportedTransformProp(config.property)) { + throw new Error(`Property '${config.property}' is not supported by native animated module`); + } + }); + } + function validateStyles(styles) { + for (var _key2 in styles) { + if (!isSupportedStyleProp(_key2)) { + throw new Error(`Style property '${_key2}' is not supported by native animated module`); + } + } + } + function validateInterpolation(config) { + for (var _key3 in config) { + if (!isSupportedInterpolationParam(_key3)) { + throw new Error(`Interpolation property '${_key3}' is not supported by native animated module`); + } + } + } + function generateNewNodeTag() { + return __nativeAnimatedNodeTagCount++; + } + function generateNewAnimationId() { + return __nativeAnimationIdCount++; + } + function assertNativeAnimatedModule() { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + } + var _warnedMissingNativeAnimated = false; + function shouldUseNativeDriver(config) { + if (config.useNativeDriver == null) { + console.warn('Animated: `useNativeDriver` was not specified. This is a required ' + 'option and must be explicitly set to `true` or `false`'); + } + if (config.useNativeDriver === true && !NativeAnimatedModule) { + if (process.env.NODE_ENV !== 'test') { + if (!_warnedMissingNativeAnimated) { + console.warn('Animated: `useNativeDriver` is not supported because the native ' + 'animated module is missing. Falling back to JS-based animation. To ' + 'resolve this, add `RCTAnimation` module to this app, or remove ' + '`useNativeDriver`. ' + 'Make sure to run `bundle exec pod install` first. Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md'); + _warnedMissingNativeAnimated = true; + } + } + return false; + } + return config.useNativeDriver || false; + } + function transformDataType(value) { + // Change the string type to number type so we can reuse the same logic in + // iOS and Android platform + if (typeof value !== 'string') { + return value; + } + + // Normalize degrees and radians to a number expressed in radians + if (value.endsWith('deg')) { + var degrees = parseFloat(value) || 0; + return degrees * Math.PI / 180.0; + } else if (value.endsWith('rad')) { + return parseFloat(value) || 0; + } else { + return value; + } + } + var _default = exports.default = { + API: API, + isSupportedColorStyleProp: isSupportedColorStyleProp, + isSupportedStyleProp: isSupportedStyleProp, + isSupportedTransformProp: isSupportedTransformProp, + isSupportedInterpolationParam: isSupportedInterpolationParam, + addWhitelistedStyleProp: addWhitelistedStyleProp, + addWhitelistedTransformProp: addWhitelistedTransformProp, + addWhitelistedInterpolationParam: addWhitelistedInterpolationParam, + validateStyles: validateStyles, + validateTransform: validateTransform, + validateInterpolation: validateInterpolation, + generateNewNodeTag: generateNewNodeTag, + generateNewAnimationId: generateNewAnimationId, + assertNativeAnimatedModule: assertNativeAnimatedModule, + shouldUseNativeDriver: shouldUseNativeDriver, + transformDataType: transformDataType, + // $FlowExpectedError[unsafe-getters-setters] - unsafe getter lint suppression + // $FlowExpectedError[missing-type-arg] - unsafe getter lint suppression + get nativeEventEmitter() { + if (!nativeEventEmitter) { + // $FlowFixMe[underconstrained-implicit-instantiation] + nativeEventEmitter = new _NativeEventEmitter.default( + // T88715063: NativeEventEmitter only used this parameter on iOS. Now it uses it on all platforms, so this code was modified automatically to preserve its behavior + // If you want to use the native module on other platforms, please remove this condition and test its behavior + _Platform.default.OS !== 'ios' ? null : NativeAnimatedModule); + } + return nativeEventEmitter; + } + }; +},349,[6,160,17,157,34,350,352,37],"node_modules\\react-native\\Libraries\\Animated\\NativeAnimatedHelper.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[1], "../TurboModule/TurboModuleRegistry")); + var _shouldUseTurboAnimatedModule = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "./shouldUseTurboAnimatedModule")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + // The config has different keys depending on the type of the Node + // TODO(T54896888): Make these types strict + + var NativeModule = !(0, _shouldUseTurboAnimatedModule.default)() ? TurboModuleRegistry.get('NativeAnimatedModule') : null; + var _default = exports.default = NativeModule; +},350,[6,36,351],"node_modules\\react-native\\Libraries\\Animated\\NativeAnimatedModule.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../Utilities/Platform")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + function shouldUseTurboAnimatedModule() { + return _Platform.default.OS === 'ios' && global.RN$Bridgeless === true; + } + var _default = exports.default = shouldUseTurboAnimatedModule; +},351,[6,34],"node_modules\\react-native\\Libraries\\Animated\\shouldUseTurboAnimatedModule.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[1], "../TurboModule/TurboModuleRegistry")); + var _shouldUseTurboAnimatedModule = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "./shouldUseTurboAnimatedModule")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + // The config has different keys depending on the type of the Node + // TODO(T54896888): Make these types strict + + var NativeModule = (0, _shouldUseTurboAnimatedModule.default)() ? TurboModuleRegistry.get('NativeAnimatedTurboModule') : null; + var _default = exports.default = NativeModule; +},352,[6,36,351],"node_modules\\react-native\\Libraries\\Animated\\NativeAnimatedTurboModule.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _toConsumableArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/toConsumableArray")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/createClass")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../Utilities/Platform")); + var _NativeAnimatedHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../NativeAnimatedHelper")); + var _AnimatedColor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../nodes/AnimatedColor")); + var _AnimatedProps = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../nodes/AnimatedProps")); + var _AnimatedValueXY = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "../nodes/AnimatedValueXY")); + var startNativeAnimationNextId = 1; + + // Important note: start() and stop() will only be called at most once. + // Once an animation has been stopped or finished its course, it will + // not be reused. + var Animation = exports.default = /*#__PURE__*/function () { + function Animation() { + (0, _classCallCheck2.default)(this, Animation); + } + return (0, _createClass2.default)(Animation, [{ + key: "start", + value: function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {} + }, { + key: "stop", + value: function stop() { + if (this.__nativeId) { + _NativeAnimatedHelper.default.API.stopAnimation(this.__nativeId); + } + } + }, { + key: "__getNativeAnimationConfig", + value: function __getNativeAnimationConfig() { + // Subclasses that have corresponding animation implementation done in native + // should override this method + throw new Error('This animation type cannot be offloaded to native'); + } + + // Helper function for subclasses to make sure onEnd is only called once. + }, { + key: "__debouncedOnEnd", + value: function __debouncedOnEnd(result) { + var onEnd = this.__onEnd; + this.__onEnd = null; + onEnd && onEnd(result); + } + }, { + key: "__findAnimatedPropsNodes", + value: function __findAnimatedPropsNodes(node) { + var result = []; + if (node instanceof _AnimatedProps.default) { + result.push(node); + return result; + } + + // Vectorized animations (animations on AnimatedValueXY, AnimatedColor nodes) + // are split into multiple animations for each component that execute in parallel. + // Calling update() on AnimatedProps when each animation completes results in + // potential flickering as all animations that are part of the vectorized animation + // may not have completed yet. For example, only the animation for the red channel of + // an animating color may have been completed, resulting in a temporary red color + // being rendered. So, for now, ignore AnimatedProps that use a vectorized animation. + if (_Platform.default.OS === 'ios' && (node instanceof _AnimatedValueXY.default || node instanceof _AnimatedColor.default)) { + return result; + } + for (var child of node.__getChildren()) { + result.push.apply(result, (0, _toConsumableArray2.default)(this.__findAnimatedPropsNodes(child))); + } + return result; + } + }, { + key: "__startNativeAnimation", + value: function __startNativeAnimation(animatedValue) { + var _this = this; + var startNativeAnimationWaitId = `${startNativeAnimationNextId}:startAnimation`; + startNativeAnimationNextId += 1; + _NativeAnimatedHelper.default.API.setWaitingForIdentifier(startNativeAnimationWaitId); + try { + var config = this.__getNativeAnimationConfig(); + animatedValue.__makeNative(config.platformConfig); + this.__nativeId = _NativeAnimatedHelper.default.generateNewAnimationId(); + _NativeAnimatedHelper.default.API.startAnimatingNode(this.__nativeId, animatedValue.__getNativeTag(), config, function (result) { + _this.__debouncedOnEnd(result); + + // When using natively driven animations, once the animation completes, + // we need to ensure that the JS side nodes are synced with the updated + // values. + var value = result.value; + if (value != null) { + animatedValue.__onAnimatedValueUpdateReceived(value); + + // Once the JS side node is synced with the updated values, trigger an + // update on the AnimatedProps nodes to call any registered callbacks. + _this.__findAnimatedPropsNodes(animatedValue).forEach(function (node) { + return node.update(); + }); + } + }); + } catch (e) { + throw e; + } finally { + _NativeAnimatedHelper.default.API.unsetWaitingForIdentifier(startNativeAnimationWaitId); + } + } + }]); + }(); +},353,[6,41,18,19,34,349,354,363,368],"node_modules\\react-native\\Libraries\\Animated\\animations\\Animation.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _normalizeColor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../../StyleSheet/normalizeColor")); + var _NativeAnimatedHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "../NativeAnimatedHelper")); + var _AnimatedValue = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9], "./AnimatedValue")); + var _AnimatedWithChildren2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "./AnimatedWithChildren")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var NativeAnimatedAPI = _NativeAnimatedHelper.default.API; + var defaultColor = { + r: 0, + g: 0, + b: 0, + a: 1.0 + }; + + /* eslint no-bitwise: 0 */ + function processColor(color) { + if (color === undefined || color === null) { + return null; + } + if (isRgbaValue(color)) { + // $FlowIgnore[incompatible-cast] - Type is verified above + return color; + } + var normalizedColor = (0, _normalizeColor.default)( + // $FlowIgnore[incompatible-cast] - Type is verified above + color); + if (normalizedColor === undefined || normalizedColor === null) { + return null; + } + if (typeof normalizedColor === 'object') { + var processedColorObj = (0, _$$_REQUIRE(_dependencyMap[11], "../../StyleSheet/PlatformColorValueTypes").processColorObject)(normalizedColor); + if (processedColorObj != null) { + return processedColorObj; + } + } else if (typeof normalizedColor === 'number') { + var r = (normalizedColor & 0xff000000) >>> 24; + var g = (normalizedColor & 0x00ff0000) >>> 16; + var b = (normalizedColor & 0x0000ff00) >>> 8; + var a = (normalizedColor & 0x000000ff) / 255; + return { + r: r, + g: g, + b: b, + a: a + }; + } + return null; + } + function isRgbaValue(value) { + return value && typeof value.r === 'number' && typeof value.g === 'number' && typeof value.b === 'number' && typeof value.a === 'number'; + } + function isRgbaAnimatedValue(value) { + return value && value.r instanceof _AnimatedValue.default && value.g instanceof _AnimatedValue.default && value.b instanceof _AnimatedValue.default && value.a instanceof _AnimatedValue.default; + } + var AnimatedColor = exports.default = /*#__PURE__*/function (_AnimatedWithChildren) { + function AnimatedColor(valueIn, config) { + var _this; + (0, _classCallCheck2.default)(this, AnimatedColor); + _this = _callSuper(this, AnimatedColor); + _this._suspendCallbacks = 0; + var value = valueIn != null ? valueIn : defaultColor; + if (isRgbaAnimatedValue(value)) { + // $FlowIgnore[incompatible-cast] - Type is verified above + var rgbaAnimatedValue = value; + _this.r = rgbaAnimatedValue.r; + _this.g = rgbaAnimatedValue.g; + _this.b = rgbaAnimatedValue.b; + _this.a = rgbaAnimatedValue.a; + } else { + var _processColor; + var processedColor = // $FlowIgnore[incompatible-cast] - Type is verified above + (_processColor = processColor(value)) != null ? _processColor : defaultColor; + var initColor = defaultColor; + if (isRgbaValue(processedColor)) { + // $FlowIgnore[incompatible-cast] - Type is verified above + initColor = processedColor; + } else { + // $FlowIgnore[incompatible-cast] - Type is verified above + _this.nativeColor = processedColor; + } + _this.r = new _AnimatedValue.default(initColor.r); + _this.g = new _AnimatedValue.default(initColor.g); + _this.b = new _AnimatedValue.default(initColor.b); + _this.a = new _AnimatedValue.default(initColor.a); + } + if (config != null && config.useNativeDriver) { + _this.__makeNative(); + } + return _this; + } + + /** + * Directly set the value. This will stop any animations running on the value + * and update all the bound properties. + */ + (0, _inherits2.default)(AnimatedColor, _AnimatedWithChildren); + return (0, _createClass2.default)(AnimatedColor, [{ + key: "setValue", + value: function setValue(value) { + var _processColor2, + _this2 = this; + var shouldUpdateNodeConfig = false; + if (this.__isNative) { + var nativeTag = this.__getNativeTag(); + NativeAnimatedAPI.setWaitingForIdentifier(nativeTag.toString()); + } + var processedColor = (_processColor2 = processColor(value)) != null ? _processColor2 : defaultColor; + this._withSuspendedCallbacks(function () { + if (isRgbaValue(processedColor)) { + // $FlowIgnore[incompatible-type] - Type is verified above + var rgbaValue = processedColor; + _this2.r.setValue(rgbaValue.r); + _this2.g.setValue(rgbaValue.g); + _this2.b.setValue(rgbaValue.b); + _this2.a.setValue(rgbaValue.a); + if (_this2.nativeColor != null) { + _this2.nativeColor = null; + shouldUpdateNodeConfig = true; + } + } else { + // $FlowIgnore[incompatible-type] - Type is verified above + var nativeColor = processedColor; + if (_this2.nativeColor !== nativeColor) { + _this2.nativeColor = nativeColor; + shouldUpdateNodeConfig = true; + } + } + }); + if (this.__isNative) { + var _nativeTag = this.__getNativeTag(); + if (shouldUpdateNodeConfig) { + NativeAnimatedAPI.updateAnimatedNodeConfig(_nativeTag, this.__getNativeConfig()); + } + NativeAnimatedAPI.unsetWaitingForIdentifier(_nativeTag.toString()); + } else { + (0, _AnimatedValue.flushValue)(this); + } + + // $FlowFixMe[incompatible-call] + this.__callListeners(this.__getValue()); + } + + /** + * Sets an offset that is applied on top of whatever value is set, whether + * via `setValue`, an animation, or `Animated.event`. Useful for compensating + * things like the start of a pan gesture. + */ + }, { + key: "setOffset", + value: function setOffset(offset) { + this.r.setOffset(offset.r); + this.g.setOffset(offset.g); + this.b.setOffset(offset.b); + this.a.setOffset(offset.a); + } + + /** + * Merges the offset value into the base value and resets the offset to zero. + * The final output of the value is unchanged. + */ + }, { + key: "flattenOffset", + value: function flattenOffset() { + this.r.flattenOffset(); + this.g.flattenOffset(); + this.b.flattenOffset(); + this.a.flattenOffset(); + } + + /** + * Sets the offset value to the base value, and resets the base value to + * zero. The final output of the value is unchanged. + */ + }, { + key: "extractOffset", + value: function extractOffset() { + this.r.extractOffset(); + this.g.extractOffset(); + this.b.extractOffset(); + this.a.extractOffset(); + } + + /** + * Stops any running animation or tracking. `callback` is invoked with the + * final value after stopping the animation, which is useful for updating + * state to match the animation position with layout. + */ + }, { + key: "stopAnimation", + value: function stopAnimation(callback) { + this.r.stopAnimation(); + this.g.stopAnimation(); + this.b.stopAnimation(); + this.a.stopAnimation(); + callback && callback(this.__getValue()); + } + + /** + * Stops any animation and resets the value to its original. + */ + }, { + key: "resetAnimation", + value: function resetAnimation(callback) { + this.r.resetAnimation(); + this.g.resetAnimation(); + this.b.resetAnimation(); + this.a.resetAnimation(); + callback && callback(this.__getValue()); + } + }, { + key: "__getValue", + value: function __getValue() { + if (this.nativeColor != null) { + return this.nativeColor; + } else { + return `rgba(${this.r.__getValue()}, ${this.g.__getValue()}, ${this.b.__getValue()}, ${this.a.__getValue()})`; + } + } + }, { + key: "__attach", + value: function __attach() { + this.r.__addChild(this); + this.g.__addChild(this); + this.b.__addChild(this); + this.a.__addChild(this); + _superPropGet(AnimatedColor, "__attach", this, 3)([]); + } + }, { + key: "__detach", + value: function __detach() { + this.r.__removeChild(this); + this.g.__removeChild(this); + this.b.__removeChild(this); + this.a.__removeChild(this); + _superPropGet(AnimatedColor, "__detach", this, 3)([]); + } + }, { + key: "_withSuspendedCallbacks", + value: function _withSuspendedCallbacks(callback) { + this._suspendCallbacks++; + callback(); + this._suspendCallbacks--; + } + }, { + key: "__callListeners", + value: function __callListeners(value) { + if (this._suspendCallbacks === 0) { + _superPropGet(AnimatedColor, "__callListeners", this, 3)([value]); + } + } + }, { + key: "__makeNative", + value: function __makeNative(platformConfig) { + this.r.__makeNative(platformConfig); + this.g.__makeNative(platformConfig); + this.b.__makeNative(platformConfig); + this.a.__makeNative(platformConfig); + _superPropGet(AnimatedColor, "__makeNative", this, 3)([platformConfig]); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'color', + r: this.r.__getNativeTag(), + g: this.g.__getNativeTag(), + b: this.b.__getNativeTag(), + a: this.a.__getNativeTag(), + nativeColor: this.nativeColor + }; + } + }]); + }(_AnimatedWithChildren2.default); +},354,[6,18,19,23,25,26,28,190,349,355,361,192],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedColor.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + exports.flushValue = flushValue; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _InteractionManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../../Interaction/InteractionManager")); + var _NativeAnimatedHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "../NativeAnimatedHelper")); + var _AnimatedInterpolation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./AnimatedInterpolation")); + var _AnimatedWithChildren2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "./AnimatedWithChildren")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var NativeAnimatedAPI = _NativeAnimatedHelper.default.API; + + /** + * Animated works by building a directed acyclic graph of dependencies + * transparently when you render your Animated components. + * + * new Animated.Value(0) + * .interpolate() .interpolate() new Animated.Value(1) + * opacity translateY scale + * style transform + * View#234 style + * View#123 + * + * A) Top Down phase + * When an Animated.Value is updated, we recursively go down through this + * graph in order to find leaf nodes: the views that we flag as needing + * an update. + * + * B) Bottom Up phase + * When a view is flagged as needing an update, we recursively go back up + * in order to build the new value that it needs. The reason why we need + * this two-phases process is to deal with composite props such as + * transform which can receive values from multiple parents. + */ + function flushValue(rootNode) { + var leaves = new Set(); + function findAnimatedStyles(node) { + // $FlowFixMe[prop-missing] + if (typeof node.update === 'function') { + leaves.add(node); + } else { + node.__getChildren().forEach(findAnimatedStyles); + } + } + findAnimatedStyles(rootNode); + leaves.forEach(function (leaf) { + return leaf.update(); + }); + } + + /** + * Some operations are executed only on batch end, which is _mostly_ scheduled when + * Animated component props change. For some of the changes which require immediate execution + * (e.g. setValue), we create a separate batch in case none is scheduled. + */ + function _executeAsAnimatedBatch(id, operation) { + NativeAnimatedAPI.setWaitingForIdentifier(id); + operation(); + NativeAnimatedAPI.unsetWaitingForIdentifier(id); + } + + /** + * Standard value for driving animations. One `Animated.Value` can drive + * multiple properties in a synchronized fashion, but can only be driven by one + * mechanism at a time. Using a new mechanism (e.g. starting a new animation, + * or calling `setValue`) will stop any previous ones. + * + * See https://reactnative.dev/docs/animatedvalue + */ + var AnimatedValue = exports.default = /*#__PURE__*/function (_AnimatedWithChildren) { + function AnimatedValue(value, config) { + var _this; + (0, _classCallCheck2.default)(this, AnimatedValue); + _this = _callSuper(this, AnimatedValue); + if (typeof value !== 'number') { + throw new Error('AnimatedValue: Attempting to set value to undefined'); + } + _this._startingValue = _this._value = value; + _this._offset = 0; + _this._animation = null; + if (config && config.useNativeDriver) { + _this.__makeNative(); + } + return _this; + } + (0, _inherits2.default)(AnimatedValue, _AnimatedWithChildren); + return (0, _createClass2.default)(AnimatedValue, [{ + key: "__detach", + value: function __detach() { + var _this2 = this; + if (this.__isNative) { + NativeAnimatedAPI.getValue(this.__getNativeTag(), function (value) { + _this2._value = value - _this2._offset; + }); + } + this.stopAnimation(); + _superPropGet(AnimatedValue, "__detach", this, 3)([]); + } + }, { + key: "__getValue", + value: function __getValue() { + return this._value + this._offset; + } + + /** + * Directly set the value. This will stop any animations running on the value + * and update all the bound properties. + * + * See https://reactnative.dev/docs/animatedvalue#setvalue + */ + }, { + key: "setValue", + value: function setValue(value) { + var _this3 = this; + if (this._animation) { + this._animation.stop(); + this._animation = null; + } + this._updateValue(value, !this.__isNative /* don't perform a flush for natively driven values */); + if (this.__isNative) { + _executeAsAnimatedBatch(this.__getNativeTag().toString(), function () { + return NativeAnimatedAPI.setAnimatedNodeValue(_this3.__getNativeTag(), value); + }); + } + } + + /** + * Sets an offset that is applied on top of whatever value is set, whether via + * `setValue`, an animation, or `Animated.event`. Useful for compensating + * things like the start of a pan gesture. + * + * See https://reactnative.dev/docs/animatedvalue#setoffset + */ + }, { + key: "setOffset", + value: function setOffset(offset) { + this._offset = offset; + if (this.__isNative) { + NativeAnimatedAPI.setAnimatedNodeOffset(this.__getNativeTag(), offset); + } + } + + /** + * Merges the offset value into the base value and resets the offset to zero. + * The final output of the value is unchanged. + * + * See https://reactnative.dev/docs/animatedvalue#flattenoffset + */ + }, { + key: "flattenOffset", + value: function flattenOffset() { + this._value += this._offset; + this._offset = 0; + if (this.__isNative) { + NativeAnimatedAPI.flattenAnimatedNodeOffset(this.__getNativeTag()); + } + } + + /** + * Sets the offset value to the base value, and resets the base value to zero. + * The final output of the value is unchanged. + * + * See https://reactnative.dev/docs/animatedvalue#extractoffset + */ + }, { + key: "extractOffset", + value: function extractOffset() { + this._offset += this._value; + this._value = 0; + if (this.__isNative) { + NativeAnimatedAPI.extractAnimatedNodeOffset(this.__getNativeTag()); + } + } + + /** + * Stops any running animation or tracking. `callback` is invoked with the + * final value after stopping the animation, which is useful for updating + * state to match the animation position with layout. + * + * See https://reactnative.dev/docs/animatedvalue#stopanimation + */ + }, { + key: "stopAnimation", + value: function stopAnimation(callback) { + this.stopTracking(); + this._animation && this._animation.stop(); + this._animation = null; + if (callback) { + if (this.__isNative) { + NativeAnimatedAPI.getValue(this.__getNativeTag(), callback); + } else { + callback(this.__getValue()); + } + } + } + + /** + * Stops any animation and resets the value to its original. + * + * See https://reactnative.dev/docs/animatedvalue#resetanimation + */ + }, { + key: "resetAnimation", + value: function resetAnimation(callback) { + this.stopAnimation(callback); + this._value = this._startingValue; + if (this.__isNative) { + NativeAnimatedAPI.setAnimatedNodeValue(this.__getNativeTag(), this._startingValue); + } + } + }, { + key: "__onAnimatedValueUpdateReceived", + value: function __onAnimatedValueUpdateReceived(value) { + this._updateValue(value, false /*flush*/); + } + + /** + * Interpolates the value before updating the property, e.g. mapping 0-1 to + * 0-10. + */ + }, { + key: "interpolate", + value: function interpolate(config) { + return new _AnimatedInterpolation.default(this, config); + } + + /** + * Typically only used internally, but could be used by a custom Animation + * class. + * + * See https://reactnative.dev/docs/animatedvalue#animate + */ + }, { + key: "animate", + value: function animate(animation, callback) { + var _this4 = this; + var handle = null; + if (animation.__isInteraction) { + handle = _InteractionManager.default.createInteractionHandle(); + } + var previousAnimation = this._animation; + this._animation && this._animation.stop(); + this._animation = animation; + animation.start(this._value, function (value) { + // Natively driven animations will never call into that callback, therefore we can always + // pass flush = true to allow the updated value to propagate to native with setNativeProps + _this4._updateValue(value, true /* flush */); + }, function (result) { + _this4._animation = null; + if (handle !== null) { + _InteractionManager.default.clearInteractionHandle(handle); + } + callback && callback(result); + }, previousAnimation, this); + } + + /** + * Typically only used internally. + */ + }, { + key: "stopTracking", + value: function stopTracking() { + this._tracking && this._tracking.__detach(); + this._tracking = null; + } + + /** + * Typically only used internally. + */ + }, { + key: "track", + value: function track(tracking) { + this.stopTracking(); + this._tracking = tracking; + // Make sure that the tracking animation starts executing + this._tracking && this._tracking.update(); + } + }, { + key: "_updateValue", + value: function _updateValue(value, flush) { + if (value === undefined) { + throw new Error('AnimatedValue: Attempting to set value to undefined'); + } + this._value = value; + if (flush) { + flushValue(this); + } + this.__callListeners(this.__getValue()); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'value', + value: this._value, + offset: this._offset + }; + } + }]); + }(_AnimatedWithChildren2.default); +},355,[6,18,19,23,25,26,28,356,349,358,361],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedValue.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _EventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../vendor/emitter/EventEmitter")); /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var _emitter = new _EventEmitter.default(); + var DEBUG_DELAY = 0; + var DEBUG = false; + + /** + * InteractionManager allows long-running work to be scheduled after any + * interactions/animations have completed. In particular, this allows JavaScript + * animations to run smoothly. + * + * Applications can schedule tasks to run after interactions with the following: + * + * ``` + * InteractionManager.runAfterInteractions(() => { + * // ...long-running synchronous task... + * }); + * ``` + * + * Compare this to other scheduling alternatives: + * + * - requestAnimationFrame(): for code that animates a view over time. + * - setImmediate/setTimeout(): run code later, note this may delay animations. + * - runAfterInteractions(): run code later, without delaying active animations. + * + * The touch handling system considers one or more active touches to be an + * 'interaction' and will delay `runAfterInteractions()` callbacks until all + * touches have ended or been cancelled. + * + * InteractionManager also allows applications to register animations by + * creating an interaction 'handle' on animation start, and clearing it upon + * completion: + * + * ``` + * var handle = InteractionManager.createInteractionHandle(); + * // run animation... (`runAfterInteractions` tasks are queued) + * // later, on animation completion: + * InteractionManager.clearInteractionHandle(handle); + * // queued tasks run if all handles were cleared + * ``` + * + * `runAfterInteractions` takes either a plain callback function, or a + * `PromiseTask` object with a `gen` method that returns a `Promise`. If a + * `PromiseTask` is supplied, then it is fully resolved (including asynchronous + * dependencies that also schedule more tasks via `runAfterInteractions`) before + * starting on the next task that might have been queued up synchronously + * earlier. + * + * By default, queued tasks are executed together in a loop in one + * `setImmediate` batch. If `setDeadline` is called with a positive number, then + * tasks will only be executed until the deadline (in terms of js event loop run + * time) approaches, at which point execution will yield via setTimeout, + * allowing events such as touches to start interactions and block queued tasks + * from executing, making apps more responsive. + */ + var InteractionManager = { + Events: { + interactionStart: 'interactionStart', + interactionComplete: 'interactionComplete' + }, + /** + * Schedule a function to run after all interactions have completed. Returns a cancellable + * "promise". + */ + runAfterInteractions: function runAfterInteractions(task) { + var tasks = []; + var promise = new Promise(function (resolve) { + _scheduleUpdate(); + if (task) { + tasks.push(task); + } + tasks.push({ + run: resolve, + name: 'resolve ' + (task && task.name || '?') + }); + _taskQueue.enqueueTasks(tasks); + }); + return { + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + then: promise.then.bind(promise), + cancel: function cancel() { + _taskQueue.cancelTasks(tasks); + } + }; + }, + /** + * Notify manager that an interaction has started. + */ + createInteractionHandle: function createInteractionHandle() { + DEBUG && _$$_REQUIRE(_dependencyMap[2], "../Utilities/infoLog")('InteractionManager: create interaction handle'); + _scheduleUpdate(); + var handle = ++_inc; + _addInteractionSet.add(handle); + return handle; + }, + /** + * Notify manager that an interaction has completed. + */ + clearInteractionHandle: function clearInteractionHandle(handle) { + DEBUG && _$$_REQUIRE(_dependencyMap[2], "../Utilities/infoLog")('InteractionManager: clear interaction handle'); + _$$_REQUIRE(_dependencyMap[3], "invariant")(!!handle, 'InteractionManager: Must provide a handle to clear.'); + _scheduleUpdate(); + _addInteractionSet.delete(handle); + _deleteInteractionSet.add(handle); + }, + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + addListener: _emitter.addListener.bind(_emitter), + /** + * A positive number will use setTimeout to schedule any tasks after the + * eventLoopRunningTime hits the deadline value, otherwise all tasks will be + * executed in one setImmediate batch (default). + */ + setDeadline: function setDeadline(deadline) { + _deadline = deadline; + } + }; + var _interactionSet = new Set(); + var _addInteractionSet = new Set(); + var _deleteInteractionSet = new Set(); + var _taskQueue = new (_$$_REQUIRE(_dependencyMap[4], "./TaskQueue"))({ + onMoreTasks: _scheduleUpdate + }); + var _nextUpdateHandle = 0; + var _inc = 0; + var _deadline = -1; + + /** + * Schedule an asynchronous update to the interaction state. + */ + function _scheduleUpdate() { + if (!_nextUpdateHandle) { + if (_deadline > 0) { + _nextUpdateHandle = setTimeout(_processUpdate, 0 + DEBUG_DELAY); + } else { + _nextUpdateHandle = setImmediate(_processUpdate); + } + } + } + + /** + * Notify listeners, process queue, etc + */ + function _processUpdate() { + _nextUpdateHandle = 0; + var interactionCount = _interactionSet.size; + _addInteractionSet.forEach(function (handle) { + return _interactionSet.add(handle); + }); + _deleteInteractionSet.forEach(function (handle) { + return _interactionSet.delete(handle); + }); + var nextInteractionCount = _interactionSet.size; + if (interactionCount !== 0 && nextInteractionCount === 0) { + // transition from 1+ --> 0 interactions + _emitter.emit(InteractionManager.Events.interactionComplete); + } else if (interactionCount === 0 && nextInteractionCount !== 0) { + // transition from 0 --> 1+ interactions + _emitter.emit(InteractionManager.Events.interactionStart); + } + + // process the queue regardless of a transition + if (nextInteractionCount === 0) { + while (_taskQueue.hasTasksToProcess()) { + _taskQueue.processNext(); + if (_deadline > 0 && _$$_REQUIRE(_dependencyMap[5], "../BatchedBridge/BatchedBridge").getEventLoopRunningTime() >= _deadline) { + // Hit deadline before processing all tasks, so process more later. + _scheduleUpdate(); + break; + } + } + } + _addInteractionSet.clear(); + _deleteInteractionSet.clear(); + } + module.exports = InteractionManager; +},356,[6,30,158,37,357,39],"node_modules\\react-native\\Libraries\\Interaction\\InteractionManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _classCallCheck = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/createClass"); + var DEBUG = false; + + /** + * TaskQueue - A system for queueing and executing a mix of simple callbacks and + * trees of dependent tasks based on Promises. No tasks are executed unless + * `processNext` is called. + * + * `enqueue` takes a Task object with either a simple `run` callback, or a + * `gen` function that returns a `Promise` and puts it in the queue. If a gen + * function is supplied, then the promise it returns will block execution of + * tasks already in the queue until it resolves. This can be used to make sure + * the first task is fully resolved (including asynchronous dependencies that + * also schedule more tasks via `enqueue`) before starting on the next task. + * The `onMoreTasks` constructor argument is used to inform the owner that an + * async task has resolved and that the queue should be processed again. + * + * Note: Tasks are only actually executed with explicit calls to `processNext`. + */ + var TaskQueue = /*#__PURE__*/function () { + /** + * TaskQueue instances are self contained and independent, so multiple tasks + * of varying semantics and priority can operate together. + * + * `onMoreTasks` is invoked when `PromiseTask`s resolve if there are more + * tasks to process. + */ + function TaskQueue(_ref) { + var onMoreTasks = _ref.onMoreTasks; + _classCallCheck(this, TaskQueue); + this._onMoreTasks = onMoreTasks; + this._queueStack = [{ + tasks: [], + popable: false + }]; + } + + /** + * Add a task to the queue. It is recommended to name your tasks for easier + * async debugging. Tasks will not be executed until `processNext` is called + * explicitly. + */ + return _createClass(TaskQueue, [{ + key: "enqueue", + value: function enqueue(task) { + this._getCurrentQueue().push(task); + } + }, { + key: "enqueueTasks", + value: function enqueueTasks(tasks) { + var _this = this; + tasks.forEach(function (task) { + return _this.enqueue(task); + }); + } + }, { + key: "cancelTasks", + value: function cancelTasks(tasksToCancel) { + // search through all tasks and remove them. + this._queueStack = this._queueStack.map(function (queue) { + return Object.assign({}, queue, { + tasks: queue.tasks.filter(function (task) { + return tasksToCancel.indexOf(task) === -1; + }) + }); + }).filter(function (queue, idx) { + return queue.tasks.length > 0 || idx === 0; + }); + } + + /** + * Check to see if `processNext` should be called. + * + * @returns {boolean} Returns true if there are tasks that are ready to be + * processed with `processNext`, or returns false if there are no more tasks + * to be processed right now, although there may be tasks in the queue that + * are blocked by earlier `PromiseTask`s that haven't resolved yet. + * `onMoreTasks` will be called after each `PromiseTask` resolves if there are + * tasks ready to run at that point. + */ + }, { + key: "hasTasksToProcess", + value: function hasTasksToProcess() { + return this._getCurrentQueue().length > 0; + } + + /** + * Executes the next task in the queue. + */ + }, { + key: "processNext", + value: function processNext() { + var queue = this._getCurrentQueue(); + if (queue.length) { + var task = queue.shift(); + try { + if (typeof task === 'object' && task.gen) { + DEBUG && _$$_REQUIRE(_dependencyMap[2], "../Utilities/infoLog")('TaskQueue: genPromise for task ' + task.name); + this._genPromise(task); + } else if (typeof task === 'object' && task.run) { + DEBUG && _$$_REQUIRE(_dependencyMap[2], "../Utilities/infoLog")('TaskQueue: run task ' + task.name); + task.run(); + } else { + _$$_REQUIRE(_dependencyMap[3], "invariant")(typeof task === 'function', 'Expected Function, SimpleTask, or PromiseTask, but got:\n' + JSON.stringify(task, null, 2)); + DEBUG && _$$_REQUIRE(_dependencyMap[2], "../Utilities/infoLog")('TaskQueue: run anonymous task'); + task(); + } + } catch (e) { + e.message = 'TaskQueue: Error with task ' + (task.name || '') + ': ' + e.message; + throw e; + } + } + } + }, { + key: "_getCurrentQueue", + value: function _getCurrentQueue() { + var stackIdx = this._queueStack.length - 1; + var queue = this._queueStack[stackIdx]; + if (queue.popable && queue.tasks.length === 0 && this._queueStack.length > 1) { + this._queueStack.pop(); + DEBUG && _$$_REQUIRE(_dependencyMap[2], "../Utilities/infoLog")('TaskQueue: popped queue: ', { + stackIdx: stackIdx, + queueStackSize: this._queueStack.length + }); + return this._getCurrentQueue(); + } else { + return queue.tasks; + } + } + }, { + key: "_genPromise", + value: function _genPromise(task) { + var _this2 = this; + // Each async task pushes it's own queue onto the queue stack. This + // effectively defers execution of previously queued tasks until the promise + // resolves, at which point we allow the new queue to be popped, which + // happens once it is fully processed. + this._queueStack.push({ + tasks: [], + popable: false + }); + var stackIdx = this._queueStack.length - 1; + var stackItem = this._queueStack[stackIdx]; + DEBUG && _$$_REQUIRE(_dependencyMap[2], "../Utilities/infoLog")('TaskQueue: push new queue: ', { + stackIdx: stackIdx + }); + DEBUG && _$$_REQUIRE(_dependencyMap[2], "../Utilities/infoLog")('TaskQueue: exec gen task ' + task.name); + task.gen().then(function () { + DEBUG && _$$_REQUIRE(_dependencyMap[2], "../Utilities/infoLog")('TaskQueue: onThen for gen task ' + task.name, { + stackIdx: stackIdx, + queueStackSize: _this2._queueStack.length + }); + stackItem.popable = true; + _this2.hasTasksToProcess() && _this2._onMoreTasks(); + }).catch(function (ex) { + setTimeout(function () { + ex.message = `TaskQueue: Error resolving Promise in task ${task.name}: ${ex.message}`; + throw ex; + }, 0); + }); + } + }]); + }(); + module.exports = TaskQueue; +},357,[18,19,158,37],"node_modules\\react-native\\Libraries\\Interaction\\TaskQueue.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /* eslint no-bitwise: 0 */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _normalizeColor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../../StyleSheet/normalizeColor")); + var _processColor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "../../StyleSheet/processColor")); + var _Easing = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "../Easing")); + var _NativeAnimatedHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "../NativeAnimatedHelper")); + var _AnimatedWithChildren2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[11], "./AnimatedWithChildren")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[12], "invariant")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + /** + * Very handy helper to map input ranges to output ranges with an easing + * function and custom behavior outside of the ranges. + */ + function createNumericInterpolation(config) { + var outputRange = config.outputRange; + var inputRange = config.inputRange; + var easing = config.easing || _Easing.default.linear; + var extrapolateLeft = 'extend'; + if (config.extrapolateLeft !== undefined) { + extrapolateLeft = config.extrapolateLeft; + } else if (config.extrapolate !== undefined) { + extrapolateLeft = config.extrapolate; + } + var extrapolateRight = 'extend'; + if (config.extrapolateRight !== undefined) { + extrapolateRight = config.extrapolateRight; + } else if (config.extrapolate !== undefined) { + extrapolateRight = config.extrapolate; + } + return function (input) { + (0, _invariant.default)(typeof input === 'number', 'Cannot interpolation an input which is not a number'); + var range = findRange(input, inputRange); + return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight); + }; + } + function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight) { + var result = input; + + // Extrapolate + if (result < inputMin) { + if (extrapolateLeft === 'identity') { + return result; + } else if (extrapolateLeft === 'clamp') { + result = inputMin; + } else if (extrapolateLeft === 'extend') { + // noop + } + } + if (result > inputMax) { + if (extrapolateRight === 'identity') { + return result; + } else if (extrapolateRight === 'clamp') { + result = inputMax; + } else if (extrapolateRight === 'extend') { + // noop + } + } + if (outputMin === outputMax) { + return outputMin; + } + if (inputMin === inputMax) { + if (input <= inputMin) { + return outputMin; + } + return outputMax; + } + + // Input Range + if (inputMin === -Infinity) { + result = -result; + } else if (inputMax === Infinity) { + result = result - inputMin; + } else { + result = (result - inputMin) / (inputMax - inputMin); + } + + // Easing + result = easing(result); + + // Output Range + if (outputMin === -Infinity) { + result = -result; + } else if (outputMax === Infinity) { + result = result + outputMin; + } else { + result = result * (outputMax - outputMin) + outputMin; + } + return result; + } + var numericComponentRegex = /[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/g; + + // Maps string inputs an RGBA color or an array of numeric components + function mapStringToNumericComponents(input) { + var normalizedColor = (0, _normalizeColor.default)(input); + (0, _invariant.default)(normalizedColor == null || typeof normalizedColor !== 'object', 'PlatformColors are not supported'); + if (typeof normalizedColor === 'number') { + normalizedColor = normalizedColor || 0; + var r = (normalizedColor & 0xff000000) >>> 24; + var g = (normalizedColor & 0x00ff0000) >>> 16; + var b = (normalizedColor & 0x0000ff00) >>> 8; + var a = (normalizedColor & 0x000000ff) / 255; + return { + isColor: true, + components: [r, g, b, a] + }; + } else { + var components = []; + var lastMatchEnd = 0; + var match; + while ((match = numericComponentRegex.exec(input)) != null) { + if (match.index > lastMatchEnd) { + components.push(input.substring(lastMatchEnd, match.index)); + } + components.push(parseFloat(match[0])); + lastMatchEnd = match.index + match[0].length; + } + (0, _invariant.default)(components.length > 0, 'outputRange must contain color or value with numeric component'); + if (lastMatchEnd < input.length) { + components.push(input.substring(lastMatchEnd, input.length)); + } + return { + isColor: false, + components: components + }; + } + } + + /** + * Supports string shapes by extracting numbers so new values can be computed, + * and recombines those values into new strings of the same shape. Supports + * things like: + * + * rgba(123, 42, 99, 0.36) // colors + * -45deg // values with units + */ + function createStringInterpolation(config) { + (0, _invariant.default)(config.outputRange.length >= 2, 'Bad output range'); + var outputRange = config.outputRange.map(mapStringToNumericComponents); + var isColor = outputRange[0].isColor; + if (__DEV__) { + (0, _invariant.default)(outputRange.every(function (output) { + return output.isColor === isColor; + }), 'All elements of output range should either be a color or a string with numeric components'); + var firstOutput = outputRange[0].components; + (0, _invariant.default)(outputRange.every(function (output) { + return output.components.length === firstOutput.length; + }), 'All elements of output range should have the same number of components'); + (0, _invariant.default)(outputRange.every(function (output) { + return output.components.every(function (component, i) { + return ( + // $FlowIgnoreMe[invalid-compare] + typeof component === 'number' || component === firstOutput[i] + ); + }); + }), 'All elements of output range should have the same non-numeric components'); + } + var numericComponents = outputRange.map(function (output) { + return isColor ? + // $FlowIgnoreMe[incompatible-call] + output.components : + // $FlowIgnoreMe[incompatible-call] + output.components.filter(function (c) { + return typeof c === 'number'; + }); + }); + var interpolations = numericComponents[0].map(function (_, i) { + return createNumericInterpolation(Object.assign({}, config, { + outputRange: numericComponents.map(function (components) { + return components[i]; + }) + })); + }); + if (!isColor) { + return function (input) { + var values = interpolations.map(function (interpolation) { + return interpolation(input); + }); + var i = 0; + return outputRange[0].components.map(function (c) { + return typeof c === 'number' ? values[i++] : c; + }).join(''); + }; + } else { + return function (input) { + var result = interpolations.map(function (interpolation, i) { + var value = interpolation(input); + // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to + // round the opacity (4th column). + return i < 3 ? Math.round(value) : Math.round(value * 1000) / 1000; + }); + return `rgba(${result[0]}, ${result[1]}, ${result[2]}, ${result[3]})`; + }; + } + } + function findRange(input, inputRange) { + var i; + for (i = 1; i < inputRange.length - 1; ++i) { + if (inputRange[i] >= input) { + break; + } + } + return i - 1; + } + function checkValidRanges(inputRange, outputRange) { + checkInfiniteRange('outputRange', outputRange); + checkInfiniteRange('inputRange', inputRange); + checkValidInputRange(inputRange); + (0, _invariant.default)(inputRange.length === outputRange.length, 'inputRange (' + inputRange.length + ') and outputRange (' + outputRange.length + ') must have the same length'); + } + function checkValidInputRange(arr) { + (0, _invariant.default)(arr.length >= 2, 'inputRange must have at least 2 elements'); + var message = 'inputRange must be monotonically non-decreasing ' + String(arr); + for (var i = 1; i < arr.length; ++i) { + (0, _invariant.default)(arr[i] >= arr[i - 1], message); + } + } + function checkInfiniteRange(name, arr) { + (0, _invariant.default)(arr.length >= 2, name + ' must have at least 2 elements'); + (0, _invariant.default)(arr.length !== 2 || arr[0] !== -Infinity || arr[1] !== Infinity, + /* $FlowFixMe[incompatible-type] (>=0.13.0) - In the addition expression + * below this comment, one or both of the operands may be something that + * doesn't cleanly convert to a string, like undefined, null, and object, + * etc. If you really mean this implicit string conversion, you can do + * something like String(myThing) */ + // $FlowFixMe[unsafe-addition] + name + 'cannot be ]-infinity;+infinity[ ' + arr); + } + var AnimatedInterpolation = exports.default = /*#__PURE__*/function (_AnimatedWithChildren) { + function AnimatedInterpolation(parent, config) { + var _this; + (0, _classCallCheck2.default)(this, AnimatedInterpolation); + _this = _callSuper(this, AnimatedInterpolation); + _this._parent = parent; + _this._config = config; + if (__DEV__) { + checkValidRanges(config.inputRange, config.outputRange); + + // Create interpolation eagerly in dev, so we can signal errors faster + // even when using the native driver + _this._getInterpolation(); + } + return _this; + } + (0, _inherits2.default)(AnimatedInterpolation, _AnimatedWithChildren); + return (0, _createClass2.default)(AnimatedInterpolation, [{ + key: "_getInterpolation", + value: function _getInterpolation() { + if (!this._interpolation) { + var config = this._config; + if (config.outputRange && typeof config.outputRange[0] === 'string') { + this._interpolation = createStringInterpolation(config); + } else { + this._interpolation = createNumericInterpolation(config); + } + } + return this._interpolation; + } + }, { + key: "__makeNative", + value: function __makeNative(platformConfig) { + this._parent.__makeNative(platformConfig); + _superPropGet(AnimatedInterpolation, "__makeNative", this, 3)([platformConfig]); + } + }, { + key: "__getValue", + value: function __getValue() { + var parentValue = this._parent.__getValue(); + (0, _invariant.default)(typeof parentValue === 'number', 'Cannot interpolate an input which is not a number.'); + return this._getInterpolation()(parentValue); + } + }, { + key: "interpolate", + value: function interpolate(config) { + return new AnimatedInterpolation(this, config); + } + }, { + key: "__attach", + value: function __attach() { + this._parent.__addChild(this); + } + }, { + key: "__detach", + value: function __detach() { + this._parent.__removeChild(this); + _superPropGet(AnimatedInterpolation, "__detach", this, 3)([]); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + if (__DEV__) { + _NativeAnimatedHelper.default.validateInterpolation(this._config); + } + + // Only the `outputRange` can contain strings so we don't need to transform `inputRange` here + var outputRange = this._config.outputRange; + var outputType = null; + if (typeof outputRange[0] === 'string') { + // $FlowIgnoreMe[incompatible-cast] + outputRange = outputRange.map(function (value) { + var processedColor = (0, _processColor.default)(value); + if (typeof processedColor === 'number') { + outputType = 'color'; + return processedColor; + } else { + return _NativeAnimatedHelper.default.transformDataType(value); + } + }); + } + return { + inputRange: this._config.inputRange, + outputRange: outputRange, + outputType: outputType, + extrapolateLeft: this._config.extrapolateLeft || this._config.extrapolate || 'extend', + extrapolateRight: this._config.extrapolateRight || this._config.extrapolate || 'extend', + type: 'interpolation' + }; + } + }]); + }(_AnimatedWithChildren2.default); +},358,[6,18,19,23,25,26,28,190,189,359,349,361,37],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedInterpolation.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _ease; + + /** + * The `Easing` module implements common easing functions. This module is used + * by [Animate.timing()](docs/animate.html#timing) to convey physically + * believable motion in animations. + * + * You can find a visualization of some common easing functions at + * http://easings.net/ + * + * ### Predefined animations + * + * The `Easing` module provides several predefined animations through the + * following methods: + * + * - [`back`](docs/easing.html#back) provides a simple animation where the + * object goes slightly back before moving forward + * - [`bounce`](docs/easing.html#bounce) provides a bouncing animation + * - [`ease`](docs/easing.html#ease) provides a simple inertial animation + * - [`elastic`](docs/easing.html#elastic) provides a simple spring interaction + * + * ### Standard functions + * + * Three standard easing functions are provided: + * + * - [`linear`](docs/easing.html#linear) + * - [`quad`](docs/easing.html#quad) + * - [`cubic`](docs/easing.html#cubic) + * + * The [`poly`](docs/easing.html#poly) function can be used to implement + * quartic, quintic, and other higher power functions. + * + * ### Additional functions + * + * Additional mathematical functions are provided by the following methods: + * + * - [`bezier`](docs/easing.html#bezier) provides a cubic bezier curve + * - [`circle`](docs/easing.html#circle) provides a circular function + * - [`sin`](docs/easing.html#sin) provides a sinusoidal function + * - [`exp`](docs/easing.html#exp) provides an exponential function + * + * The following helpers are used to modify other easing functions. + * + * - [`in`](docs/easing.html#in) runs an easing function forwards + * - [`inOut`](docs/easing.html#inout) makes any easing function symmetrical + * - [`out`](docs/easing.html#out) runs an easing function backwards + */ + var Easing = { + /** + * A stepping function, returns 1 for any positive value of `n`. + */ + step0: function step0(n) { + return n > 0 ? 1 : 0; + }, + /** + * A stepping function, returns 1 if `n` is greater than or equal to 1. + */ + step1: function step1(n) { + return n >= 1 ? 1 : 0; + }, + /** + * A linear function, `f(t) = t`. Position correlates to elapsed time one to + * one. + * + * http://cubic-bezier.com/#0,0,1,1 + */ + linear: function linear(t) { + return t; + }, + /** + * A simple inertial interaction, similar to an object slowly accelerating to + * speed. + * + * http://cubic-bezier.com/#.42,0,1,1 + */ + ease: function ease(t) { + if (!_ease) { + _ease = Easing.bezier(0.42, 0, 1, 1); + } + return _ease(t); + }, + /** + * A quadratic function, `f(t) = t * t`. Position equals the square of elapsed + * time. + * + * http://easings.net/#easeInQuad + */ + quad: function quad(t) { + return t * t; + }, + /** + * A cubic function, `f(t) = t * t * t`. Position equals the cube of elapsed + * time. + * + * http://easings.net/#easeInCubic + */ + cubic: function cubic(t) { + return t * t * t; + }, + /** + * A power function. Position is equal to the Nth power of elapsed time. + * + * n = 4: http://easings.net/#easeInQuart + * n = 5: http://easings.net/#easeInQuint + */ + poly: function poly(n) { + return function (t) { + return Math.pow(t, n); + }; + }, + /** + * A sinusoidal function. + * + * http://easings.net/#easeInSine + */ + sin: function sin(t) { + return 1 - Math.cos(t * Math.PI / 2); + }, + /** + * A circular function. + * + * http://easings.net/#easeInCirc + */ + circle: function circle(t) { + return 1 - Math.sqrt(1 - t * t); + }, + /** + * An exponential function. + * + * http://easings.net/#easeInExpo + */ + exp: function exp(t) { + return Math.pow(2, 10 * (t - 1)); + }, + /** + * A simple elastic interaction, similar to a spring oscillating back and + * forth. + * + * Default bounciness is 1, which overshoots a little bit once. 0 bounciness + * doesn't overshoot at all, and bounciness of N > 1 will overshoot about N + * times. + * + * http://easings.net/#easeInElastic + */ + elastic: function elastic() { + var bounciness = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + var p = bounciness * Math.PI; + return function (t) { + return 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p); + }; + }, + /** + * Use with `Animated.parallel()` to create a simple effect where the object + * animates back slightly as the animation starts. + * + * https://easings.net/#easeInBack + */ + back: function back() { + var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1.70158; + return function (t) { + return t * t * ((s + 1) * t - s); + }; + }, + /** + * Provides a simple bouncing effect. + * + * http://easings.net/#easeInBounce + */ + bounce: function bounce(t) { + if (t < 1 / 2.75) { + return 7.5625 * t * t; + } + if (t < 2 / 2.75) { + var _t = t - 1.5 / 2.75; + return 7.5625 * _t * _t + 0.75; + } + if (t < 2.5 / 2.75) { + var _t2 = t - 2.25 / 2.75; + return 7.5625 * _t2 * _t2 + 0.9375; + } + var t2 = t - 2.625 / 2.75; + return 7.5625 * t2 * t2 + 0.984375; + }, + /** + * Provides a cubic bezier curve, equivalent to CSS Transitions' + * `transition-timing-function`. + * + * A useful tool to visualize cubic bezier curves can be found at + * http://cubic-bezier.com/ + */ + bezier: function bezier(x1, y1, x2, y2) { + var _bezier = _$$_REQUIRE(_dependencyMap[0], "./bezier").default; + return _bezier(x1, y1, x2, y2); + }, + /** + * Runs an easing function forwards. + */ + in: function _in(easing) { + return easing; + }, + /** + * Runs an easing function backwards. + */ + out: function out(easing) { + return function (t) { + return 1 - easing(1 - t); + }; + }, + /** + * Makes any easing function symmetrical. The easing function will run + * forwards for half of the duration, then backwards for the rest of the + * duration. + */ + inOut: function inOut(easing) { + return function (t) { + if (t < 0.5) { + return easing(t * 2) / 2; + } + return 1 - easing((1 - t) * 2) / 2; + }; + } + }; + var _default = exports.default = Easing; +},359,[360],"node_modules\\react-native\\Libraries\\Animated\\Easing.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Portions Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /** + * BezierEasing - use bezier curve for transition easing function + * https://github.com/gre/bezier-easing + * @copyright 2014-2015 Gaëtan Renaudeau. MIT License. + */ + + 'use strict'; + + // These values are established by empiricism with tests (tradeoff: performance VS precision) + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = bezier; + var NEWTON_ITERATIONS = 4; + var NEWTON_MIN_SLOPE = 0.001; + var SUBDIVISION_PRECISION = 0.0000001; + var SUBDIVISION_MAX_ITERATIONS = 10; + var kSplineTableSize = 11; + var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); + var float32ArraySupported = typeof Float32Array === 'function'; + function A(aA1, aA2) { + return 1.0 - 3.0 * aA2 + 3.0 * aA1; + } + function B(aA1, aA2) { + return 3.0 * aA2 - 6.0 * aA1; + } + function C(aA1) { + return 3.0 * aA1; + } + + // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. + function calcBezier(aT, aA1, aA2) { + return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; + } + + // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2. + function getSlope(aT, aA1, aA2) { + return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); + } + function binarySubdivide(aX, _aA, _aB, mX1, mX2) { + var currentX, + currentT, + i = 0, + aA = _aA, + aB = _aB; + do { + currentT = aA + (aB - aA) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - aX; + if (currentX > 0.0) { + aB = currentT; + } else { + aA = currentT; + } + } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); + return currentT; + } + function newtonRaphsonIterate(aX, _aGuessT, mX1, mX2) { + var aGuessT = _aGuessT; + for (var i = 0; i < NEWTON_ITERATIONS; ++i) { + var currentSlope = getSlope(aGuessT, mX1, mX2); + if (currentSlope === 0.0) { + return aGuessT; + } + var currentX = calcBezier(aGuessT, mX1, mX2) - aX; + aGuessT -= currentX / currentSlope; + } + return aGuessT; + } + function bezier(mX1, mY1, mX2, mY2) { + if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) { + throw new Error('bezier x values must be in [0, 1] range'); + } + + // Precompute samples table + var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); + if (mX1 !== mY1 || mX2 !== mY2) { + for (var i = 0; i < kSplineTableSize; ++i) { + sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); + } + } + function getTForX(aX) { + var intervalStart = 0.0; + var currentSample = 1; + var lastSample = kSplineTableSize - 1; + for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) { + intervalStart += kSampleStepSize; + } + --currentSample; + + // Interpolate to provide an initial guess for t + var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]); + var guessForT = intervalStart + dist * kSampleStepSize; + var initialSlope = getSlope(guessForT, mX1, mX2); + if (initialSlope >= NEWTON_MIN_SLOPE) { + return newtonRaphsonIterate(aX, guessForT, mX1, mX2); + } else if (initialSlope === 0.0) { + return guessForT; + } else { + return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); + } + } + return function BezierEasing(x) { + if (mX1 === mY1 && mX2 === mY2) { + return x; // linear + } + // Because JavaScript number are imprecise, we should guarantee the extremes are right. + if (x === 0) { + return 0; + } + if (x === 1) { + return 1; + } + return calcBezier(getTForX(x), mY1, mY2); + }; + } +},360,[],"node_modules\\react-native\\Libraries\\Animated\\bezier.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _NativeAnimatedHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../NativeAnimatedHelper")); + var _AnimatedNode2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./AnimatedNode")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var AnimatedWithChildren = exports.default = /*#__PURE__*/function (_AnimatedNode) { + function AnimatedWithChildren() { + var _this; + (0, _classCallCheck2.default)(this, AnimatedWithChildren); + _this = _callSuper(this, AnimatedWithChildren); + _this._children = []; + return _this; + } + (0, _inherits2.default)(AnimatedWithChildren, _AnimatedNode); + return (0, _createClass2.default)(AnimatedWithChildren, [{ + key: "__makeNative", + value: function __makeNative(platformConfig) { + if (!this.__isNative) { + this.__isNative = true; + for (var child of this._children) { + child.__makeNative(platformConfig); + _NativeAnimatedHelper.default.API.connectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag()); + } + } + _superPropGet(AnimatedWithChildren, "__makeNative", this, 3)([platformConfig]); + } + }, { + key: "__addChild", + value: function __addChild(child) { + if (this._children.length === 0) { + this.__attach(); + } + this._children.push(child); + if (this.__isNative) { + // Only accept "native" animated nodes as children + child.__makeNative(this.__getPlatformConfig()); + _NativeAnimatedHelper.default.API.connectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag()); + } + } + }, { + key: "__removeChild", + value: function __removeChild(child) { + var index = this._children.indexOf(child); + if (index === -1) { + console.warn("Trying to remove a child that doesn't exist"); + return; + } + if (this.__isNative && child.__isNative) { + _NativeAnimatedHelper.default.API.disconnectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag()); + } + this._children.splice(index, 1); + if (this._children.length === 0) { + this.__detach(); + } + } + }, { + key: "__getChildren", + value: function __getChildren() { + return this._children; + } + }, { + key: "__callListeners", + value: function __callListeners(value) { + _superPropGet(AnimatedWithChildren, "__callListeners", this, 3)([value]); + if (!this.__isNative) { + for (var child of this._children) { + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + if (child.__getValue) { + child.__callListeners(child.__getValue()); + } + } + } + } + }]); + }(_AnimatedNode2.default); +},361,[6,18,19,23,25,26,28,349,362],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedWithChildren.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _NativeAnimatedHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../NativeAnimatedHelper")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "invariant")); + var NativeAnimatedAPI = _NativeAnimatedHelper.default.API; + var _uniqueId = 1; + + // Note(vjeux): this would be better as an interface but flow doesn't + // support them yet + var AnimatedNode = exports.default = /*#__PURE__*/function () { + function AnimatedNode() { + (0, _classCallCheck2.default)(this, AnimatedNode); + this._listeners = {}; + } + return (0, _createClass2.default)(AnimatedNode, [{ + key: "__attach", + value: function __attach() {} + }, { + key: "__detach", + value: function __detach() { + this.removeAllListeners(); + if (this.__isNative && this.__nativeTag != null) { + _NativeAnimatedHelper.default.API.dropAnimatedNode(this.__nativeTag); + this.__nativeTag = undefined; + } + } + }, { + key: "__getValue", + value: function __getValue() {} + }, { + key: "__getAnimatedValue", + value: function __getAnimatedValue() { + return this.__getValue(); + } + }, { + key: "__addChild", + value: function __addChild(child) {} + }, { + key: "__removeChild", + value: function __removeChild(child) {} + }, { + key: "__getChildren", + value: function __getChildren() { + return []; + } + + /* Methods and props used by native Animated impl */ + }, { + key: "__makeNative", + value: function __makeNative(platformConfig) { + if (!this.__isNative) { + throw new Error('This node cannot be made a "native" animated node'); + } + this._platformConfig = platformConfig; + if (this.hasListeners()) { + this._startListeningToNativeValueUpdates(); + } + } + + /** + * Adds an asynchronous listener to the value so you can observe updates from + * animations. This is useful because there is no way to + * synchronously read the value because it might be driven natively. + * + * See https://reactnative.dev/docs/animatedvalue#addlistener + */ + }, { + key: "addListener", + value: function addListener(callback) { + var id = String(_uniqueId++); + this._listeners[id] = callback; + if (this.__isNative) { + this._startListeningToNativeValueUpdates(); + } + return id; + } + + /** + * Unregister a listener. The `id` param shall match the identifier + * previously returned by `addListener()`. + * + * See https://reactnative.dev/docs/animatedvalue#removelistener + */ + }, { + key: "removeListener", + value: function removeListener(id) { + delete this._listeners[id]; + if (this.__isNative && !this.hasListeners()) { + this._stopListeningForNativeValueUpdates(); + } + } + + /** + * Remove all registered listeners. + * + * See https://reactnative.dev/docs/animatedvalue#removealllisteners + */ + }, { + key: "removeAllListeners", + value: function removeAllListeners() { + this._listeners = {}; + if (this.__isNative) { + this._stopListeningForNativeValueUpdates(); + } + } + }, { + key: "hasListeners", + value: function hasListeners() { + return !!Object.keys(this._listeners).length; + } + }, { + key: "_startListeningToNativeValueUpdates", + value: function _startListeningToNativeValueUpdates() { + var _this = this; + if (this.__nativeAnimatedValueListener && !this.__shouldUpdateListenersForNewNativeTag) { + return; + } + if (this.__shouldUpdateListenersForNewNativeTag) { + this.__shouldUpdateListenersForNewNativeTag = false; + this._stopListeningForNativeValueUpdates(); + } + NativeAnimatedAPI.startListeningToAnimatedNodeValue(this.__getNativeTag()); + this.__nativeAnimatedValueListener = _NativeAnimatedHelper.default.nativeEventEmitter.addListener('onAnimatedValueUpdate', function (data) { + if (data.tag !== _this.__getNativeTag()) { + return; + } + _this.__onAnimatedValueUpdateReceived(data.value); + }); + } + }, { + key: "__onAnimatedValueUpdateReceived", + value: function __onAnimatedValueUpdateReceived(value) { + this.__callListeners(value); + } + }, { + key: "__callListeners", + value: function __callListeners(value) { + for (var _key in this._listeners) { + this._listeners[_key]({ + value: value + }); + } + } + }, { + key: "_stopListeningForNativeValueUpdates", + value: function _stopListeningForNativeValueUpdates() { + if (!this.__nativeAnimatedValueListener) { + return; + } + this.__nativeAnimatedValueListener.remove(); + this.__nativeAnimatedValueListener = null; + NativeAnimatedAPI.stopListeningToAnimatedNodeValue(this.__getNativeTag()); + } + }, { + key: "__getNativeTag", + value: function __getNativeTag() { + var _this$__nativeTag; + _NativeAnimatedHelper.default.assertNativeAnimatedModule(); + (0, _invariant.default)(this.__isNative, 'Attempt to get native tag from node not marked as "native"'); + var nativeTag = (_this$__nativeTag = this.__nativeTag) != null ? _this$__nativeTag : _NativeAnimatedHelper.default.generateNewNodeTag(); + if (this.__nativeTag == null) { + this.__nativeTag = nativeTag; + var config = this.__getNativeConfig(); + if (this._platformConfig) { + config.platformConfig = this._platformConfig; + } + _NativeAnimatedHelper.default.API.createAnimatedNode(nativeTag, config); + this.__shouldUpdateListenersForNewNativeTag = true; + } + return nativeTag; + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + throw new Error('This JS animated node type cannot be used as native animated node'); + } + }, { + key: "toJSON", + value: function toJSON() { + return this.__getValue(); + } + }, { + key: "__getPlatformConfig", + value: function __getPlatformConfig() { + return this._platformConfig; + } + }, { + key: "__setPlatformConfig", + value: function __setPlatformConfig(platformConfig) { + this._platformConfig = platformConfig; + } + }]); + }(); +},362,[6,18,19,349,37],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedNode.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _NativeAnimatedHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../NativeAnimatedHelper")); + var _AnimatedNode2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./AnimatedNode")); + var _AnimatedObject = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9], "./AnimatedObject")); + var _AnimatedStyle = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "./AnimatedStyle")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[11], "invariant")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + function createAnimatedProps(inputProps) { + var props = {}; + for (var key in inputProps) { + var value = inputProps[key]; + if (key === 'style') { + props[key] = new _AnimatedStyle.default(value); + } else if (value instanceof _AnimatedNode2.default) { + props[key] = value; + } else if ((0, _AnimatedObject.hasAnimatedNode)(value)) { + props[key] = new _AnimatedObject.default(value); + } else { + props[key] = value; + } + } + return props; + } + var AnimatedProps = exports.default = /*#__PURE__*/function (_AnimatedNode) { + function AnimatedProps(props, callback) { + var _this; + (0, _classCallCheck2.default)(this, AnimatedProps); + _this = _callSuper(this, AnimatedProps); + _this._props = createAnimatedProps(props); + _this._callback = callback; + return _this; + } + (0, _inherits2.default)(AnimatedProps, _AnimatedNode); + return (0, _createClass2.default)(AnimatedProps, [{ + key: "__getValue", + value: function __getValue() { + var props = {}; + for (var key in this._props) { + var value = this._props[key]; + if (value instanceof _AnimatedNode2.default) { + props[key] = value.__getValue(); + } else if (value instanceof _$$_REQUIRE(_dependencyMap[12], "../AnimatedEvent").AnimatedEvent) { + props[key] = value.__getHandler(); + } else { + props[key] = value; + } + } + return props; + } + }, { + key: "__getAnimatedValue", + value: function __getAnimatedValue() { + var props = {}; + for (var key in this._props) { + var value = this._props[key]; + if (value instanceof _AnimatedNode2.default) { + props[key] = value.__getAnimatedValue(); + } + } + return props; + } + }, { + key: "__attach", + value: function __attach() { + for (var key in this._props) { + var value = this._props[key]; + if (value instanceof _AnimatedNode2.default) { + value.__addChild(this); + } + } + } + }, { + key: "__detach", + value: function __detach() { + if (this.__isNative && this._animatedView) { + this.__disconnectAnimatedView(); + } + for (var key in this._props) { + var value = this._props[key]; + if (value instanceof _AnimatedNode2.default) { + value.__removeChild(this); + } + } + _superPropGet(AnimatedProps, "__detach", this, 3)([]); + } + }, { + key: "update", + value: function update() { + this._callback(); + } + }, { + key: "__makeNative", + value: function __makeNative(platformConfig) { + for (var key in this._props) { + var value = this._props[key]; + if (value instanceof _AnimatedNode2.default) { + value.__makeNative(platformConfig); + } + } + if (!this.__isNative) { + this.__isNative = true; + + // Since this does not call the super.__makeNative, we need to store the + // supplied platformConfig here, before calling __connectAnimatedView + // where it will be needed to traverse the graph of attached values. + _superPropGet(AnimatedProps, "__setPlatformConfig", this, 3)([platformConfig]); + if (this._animatedView) { + this.__connectAnimatedView(); + } + } + } + }, { + key: "setNativeView", + value: function setNativeView(animatedView) { + if (this._animatedView === animatedView) { + return; + } + this._animatedView = animatedView; + if (this.__isNative) { + this.__connectAnimatedView(); + } + } + }, { + key: "__connectAnimatedView", + value: function __connectAnimatedView() { + (0, _invariant.default)(this.__isNative, 'Expected node to be marked as "native"'); + var nativeViewTag = (0, _$$_REQUIRE(_dependencyMap[13], "../../ReactNative/RendererProxy").findNodeHandle)(this._animatedView); + (0, _invariant.default)(nativeViewTag != null, 'Unable to locate attached view in the native tree'); + _NativeAnimatedHelper.default.API.connectAnimatedNodeToView(this.__getNativeTag(), nativeViewTag); + } + }, { + key: "__disconnectAnimatedView", + value: function __disconnectAnimatedView() { + (0, _invariant.default)(this.__isNative, 'Expected node to be marked as "native"'); + var nativeViewTag = (0, _$$_REQUIRE(_dependencyMap[13], "../../ReactNative/RendererProxy").findNodeHandle)(this._animatedView); + (0, _invariant.default)(nativeViewTag != null, 'Unable to locate attached view in the native tree'); + _NativeAnimatedHelper.default.API.disconnectAnimatedNodeFromView(this.__getNativeTag(), nativeViewTag); + } + }, { + key: "__restoreDefaultValues", + value: function __restoreDefaultValues() { + // When using the native driver, view properties need to be restored to + // their default values manually since react no longer tracks them. This + // is needed to handle cases where a prop driven by native animated is removed + // after having been changed natively by an animation. + if (this.__isNative) { + _NativeAnimatedHelper.default.API.restoreDefaultValues(this.__getNativeTag()); + } + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + var propsConfig = {}; + for (var propKey in this._props) { + var value = this._props[propKey]; + if (value instanceof _AnimatedNode2.default) { + value.__makeNative(this.__getPlatformConfig()); + propsConfig[propKey] = value.__getNativeTag(); + } + } + return { + type: 'props', + props: propsConfig + }; + } + }]); + }(_AnimatedNode2.default); +},363,[6,18,19,23,25,26,28,349,362,364,365,37,367,61],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedProps.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + * @oncall react_native + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + exports.hasAnimatedNode = hasAnimatedNode; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _AnimatedNode = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./AnimatedNode")); + var _AnimatedWithChildren2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./AnimatedWithChildren")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var MAX_DEPTH = 5; + function isPlainObject(value) { + return value !== null && typeof value === 'object' && Object.getPrototypeOf(value).isPrototypeOf(Object); + } + + // Recurse through values, executing fn for any AnimatedNodes + function visit(value, fn) { + var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + if (depth >= MAX_DEPTH) { + return; + } + if (value instanceof _AnimatedNode.default) { + fn(value); + } else if (Array.isArray(value)) { + value.forEach(function (element) { + visit(element, fn, depth + 1); + }); + } else if (isPlainObject(value)) { + Object.values(value).forEach(function (element) { + visit(element, fn, depth + 1); + }); + } + } + + // Returns a copy of value with a transformation fn applied to any AnimatedNodes + function mapAnimatedNodes(value, fn) { + var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + if (depth >= MAX_DEPTH) { + return value; + } + if (value instanceof _AnimatedNode.default) { + return fn(value); + } else if (Array.isArray(value)) { + return value.map(function (element) { + return mapAnimatedNodes(element, fn, depth + 1); + }); + } else if (isPlainObject(value)) { + var result = {}; + for (var key in value) { + result[key] = mapAnimatedNodes(value[key], fn, depth + 1); + } + return result; + } else { + return value; + } + } + function hasAnimatedNode(value) { + var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + if (depth >= MAX_DEPTH) { + return false; + } + if (value instanceof _AnimatedNode.default) { + return true; + } else if (Array.isArray(value)) { + for (var element of value) { + if (hasAnimatedNode(element, depth + 1)) { + return true; + } + } + } else if (isPlainObject(value)) { + // Don't consider React elements + if (React.isValidElement(value)) { + return false; + } + for (var key in value) { + if (hasAnimatedNode(value[key], depth + 1)) { + return true; + } + } + } + return false; + } + var AnimatedObject = exports.default = /*#__PURE__*/function (_AnimatedWithChildren) { + function AnimatedObject(value) { + var _this; + (0, _classCallCheck2.default)(this, AnimatedObject); + _this = _callSuper(this, AnimatedObject); + _this._value = value; + return _this; + } + (0, _inherits2.default)(AnimatedObject, _AnimatedWithChildren); + return (0, _createClass2.default)(AnimatedObject, [{ + key: "__getValue", + value: function __getValue() { + return mapAnimatedNodes(this._value, function (node) { + return node.__getValue(); + }); + } + }, { + key: "__getAnimatedValue", + value: function __getAnimatedValue() { + return mapAnimatedNodes(this._value, function (node) { + return node.__getAnimatedValue(); + }); + } + }, { + key: "__attach", + value: function __attach() { + var _this2 = this; + _superPropGet(AnimatedObject, "__attach", this, 3)([]); + visit(this._value, function (node) { + node.__addChild(_this2); + }); + } + }, { + key: "__detach", + value: function __detach() { + var _this3 = this; + visit(this._value, function (node) { + node.__removeChild(_this3); + }); + _superPropGet(AnimatedObject, "__detach", this, 3)([]); + } + }, { + key: "__makeNative", + value: function __makeNative(platformConfig) { + visit(this._value, function (value) { + value.__makeNative(platformConfig); + }); + _superPropGet(AnimatedObject, "__makeNative", this, 3)([platformConfig]); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'object', + value: mapAnimatedNodes(this._value, function (node) { + return { + nodeTag: node.__getNativeTag() + }; + }) + }; + } + }]); + }(_AnimatedWithChildren2.default); +},364,[6,18,19,23,25,26,28,362,361,65],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedObject.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _ReactNativeFeatureFlags = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../../ReactNative/ReactNativeFeatureFlags")); + var _flattenStyle = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "../../StyleSheet/flattenStyle")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "../../Utilities/Platform")); + var _NativeAnimatedHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "../NativeAnimatedHelper")); + var _AnimatedNode = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[11], "./AnimatedNode")); + var _AnimatedObject = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12], "./AnimatedObject")); + var _AnimatedTransform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[13], "./AnimatedTransform")); + var _AnimatedWithChildren2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[14], "./AnimatedWithChildren")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + function createAnimatedStyle(inputStyle, keepUnanimatedValues) { + // $FlowFixMe[underconstrained-implicit-instantiation] + var style = (0, _flattenStyle.default)(inputStyle); + var animatedStyles = {}; + for (var key in style) { + var value = style[key]; + if (value != null && key === 'transform') { + animatedStyles[key] = _ReactNativeFeatureFlags.default.shouldUseAnimatedObjectForTransform() ? new _AnimatedObject.default(value) : new _AnimatedTransform.default(value); + } else if (value instanceof _AnimatedNode.default) { + animatedStyles[key] = value; + } else if ((0, _AnimatedObject.hasAnimatedNode)(value)) { + animatedStyles[key] = new _AnimatedObject.default(value); + } else if (keepUnanimatedValues) { + animatedStyles[key] = value; + } + } + return animatedStyles; + } + var AnimatedStyle = exports.default = /*#__PURE__*/function (_AnimatedWithChildren) { + function AnimatedStyle(style) { + var _this; + (0, _classCallCheck2.default)(this, AnimatedStyle); + _this = _callSuper(this, AnimatedStyle); + _this._inputStyle = style; + _this._style = createAnimatedStyle(style, _Platform.default.OS !== 'web'); + return _this; + } + (0, _inherits2.default)(AnimatedStyle, _AnimatedWithChildren); + return (0, _createClass2.default)(AnimatedStyle, [{ + key: "__getValue", + value: function __getValue() { + var result = {}; + for (var key in this._style) { + var value = this._style[key]; + if (value instanceof _AnimatedNode.default) { + result[key] = value.__getValue(); + } else { + result[key] = value; + } + } + return _Platform.default.OS === 'web' ? [this._inputStyle, result] : result; + } + }, { + key: "__getAnimatedValue", + value: function __getAnimatedValue() { + var result = {}; + for (var key in this._style) { + var value = this._style[key]; + if (value instanceof _AnimatedNode.default) { + result[key] = value.__getAnimatedValue(); + } + } + return result; + } + }, { + key: "__attach", + value: function __attach() { + for (var key in this._style) { + var value = this._style[key]; + if (value instanceof _AnimatedNode.default) { + value.__addChild(this); + } + } + } + }, { + key: "__detach", + value: function __detach() { + for (var key in this._style) { + var value = this._style[key]; + if (value instanceof _AnimatedNode.default) { + value.__removeChild(this); + } + } + _superPropGet(AnimatedStyle, "__detach", this, 3)([]); + } + }, { + key: "__makeNative", + value: function __makeNative(platformConfig) { + for (var key in this._style) { + var value = this._style[key]; + if (value instanceof _AnimatedNode.default) { + value.__makeNative(platformConfig); + } + } + _superPropGet(AnimatedStyle, "__makeNative", this, 3)([platformConfig]); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + var styleConfig = {}; + for (var styleKey in this._style) { + if (this._style[styleKey] instanceof _AnimatedNode.default) { + var style = this._style[styleKey]; + style.__makeNative(this.__getPlatformConfig()); + styleConfig[styleKey] = style.__getNativeTag(); + } + // Non-animated styles are set using `setNativeProps`, no need + // to pass those as a part of the node config + } + _NativeAnimatedHelper.default.validateStyles(styleConfig); + return { + type: 'style', + style: styleConfig + }; + } + }]); + }(_AnimatedWithChildren2.default); +},365,[6,18,19,23,25,26,28,157,222,34,349,362,364,366,361],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedStyle.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "@babel/runtime/helpers/inherits")); + var _NativeAnimatedHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "../NativeAnimatedHelper")); + var _AnimatedNode = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./AnimatedNode")); + var _AnimatedWithChildren2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "./AnimatedWithChildren")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var AnimatedTransform = exports.default = /*#__PURE__*/function (_AnimatedWithChildren) { + function AnimatedTransform(transforms) { + var _this; + (0, _classCallCheck2.default)(this, AnimatedTransform); + _this = _callSuper(this, AnimatedTransform); + _this._transforms = transforms; + return _this; + } + (0, _inherits2.default)(AnimatedTransform, _AnimatedWithChildren); + return (0, _createClass2.default)(AnimatedTransform, [{ + key: "__makeNative", + value: function __makeNative(platformConfig) { + this._transforms.forEach(function (transform) { + for (var key in transform) { + var value = transform[key]; + if (value instanceof _AnimatedNode.default) { + value.__makeNative(platformConfig); + } + } + }); + _superPropGet(AnimatedTransform, "__makeNative", this, 3)([platformConfig]); + } + }, { + key: "__getValue", + value: function __getValue() { + return this._get(function (animatedNode) { + return animatedNode.__getValue(); + }); + } + }, { + key: "__getAnimatedValue", + value: function __getAnimatedValue() { + return this._get(function (animatedNode) { + return animatedNode.__getAnimatedValue(); + }); + } + }, { + key: "__attach", + value: function __attach() { + var _this2 = this; + this._transforms.forEach(function (transform) { + for (var key in transform) { + var value = transform[key]; + if (value instanceof _AnimatedNode.default) { + value.__addChild(_this2); + } + } + }); + } + }, { + key: "__detach", + value: function __detach() { + var _this3 = this; + this._transforms.forEach(function (transform) { + for (var key in transform) { + var value = transform[key]; + if (value instanceof _AnimatedNode.default) { + value.__removeChild(_this3); + } + } + }); + _superPropGet(AnimatedTransform, "__detach", this, 3)([]); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + var transConfigs = []; + this._transforms.forEach(function (transform) { + for (var key in transform) { + var value = transform[key]; + if (value instanceof _AnimatedNode.default) { + transConfigs.push({ + type: 'animated', + property: key, + nodeTag: value.__getNativeTag() + }); + } else { + transConfigs.push({ + type: 'static', + property: key, + value: _NativeAnimatedHelper.default.transformDataType(value) + }); + } + } + }); + _NativeAnimatedHelper.default.validateTransform(transConfigs); + return { + type: 'transform', + transforms: transConfigs + }; + } + }, { + key: "_get", + value: function _get(getter) { + return this._transforms.map(function (transform) { + var result = {}; + for (var key in transform) { + var value = transform[key]; + if (value instanceof _AnimatedNode.default) { + result[key] = getter(value); + } else if (Array.isArray(value)) { + result[key] = value.map(function (element) { + if (element instanceof _AnimatedNode.default) { + return getter(element); + } else { + return element; + } + }); + } else if (typeof value === 'object') { + result[key] = {}; + for (var _ref of Object.entries(value)) { + var _ref2 = (0, _slicedToArray2.default)(_ref, 2); + var nestedKey = _ref2[0]; + var nestedValue = _ref2[1]; + if (nestedValue instanceof _AnimatedNode.default) { + result[key][nestedKey] = getter(nestedValue); + } else { + result[key][nestedKey] = nestedValue; + } + } + } else { + result[key] = value; + } + } + return result; + }); + } + }]); + }(_AnimatedWithChildren2.default); +},366,[6,7,18,19,23,25,26,28,349,362,361],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedTransform.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.AnimatedEvent = void 0; + exports.attachNativeEvent = attachNativeEvent; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _NativeAnimatedHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "./NativeAnimatedHelper")); + var _AnimatedValue = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "./nodes/AnimatedValue")); + var _AnimatedValueXY = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "./nodes/AnimatedValueXY")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "invariant")); + function attachNativeEvent(viewRef, eventName, argMapping, platformConfig) { + // Find animated values in `argMapping` and create an array representing their + // key path inside the `nativeEvent` object. Ex.: ['contentOffset', 'x']. + var eventMappings = []; + var _traverse = function traverse(value, path) { + if (value instanceof _AnimatedValue.default) { + value.__makeNative(platformConfig); + eventMappings.push({ + nativeEventPath: path, + animatedValueTag: value.__getNativeTag() + }); + } else if (value instanceof _AnimatedValueXY.default) { + _traverse(value.x, path.concat('x')); + _traverse(value.y, path.concat('y')); + } else if (typeof value === 'object') { + for (var _key in value) { + _traverse(value[_key], path.concat(_key)); + } + } + }; + (0, _invariant.default)(argMapping[0] && argMapping[0].nativeEvent, 'Native driven events only support animated values contained inside `nativeEvent`.'); + + // Assume that the event containing `nativeEvent` is always the first argument. + _traverse(argMapping[0].nativeEvent, []); + var viewTag = (0, _$$_REQUIRE(_dependencyMap[7], "../ReactNative/RendererProxy").findNodeHandle)(viewRef); + if (viewTag != null) { + eventMappings.forEach(function (mapping) { + _NativeAnimatedHelper.default.API.addAnimatedEventToView(viewTag, eventName, mapping); + }); + } + return { + detach: function detach() { + if (viewTag != null) { + eventMappings.forEach(function (mapping) { + _NativeAnimatedHelper.default.API.removeAnimatedEventFromView(viewTag, eventName, + // $FlowFixMe[incompatible-call] + mapping.animatedValueTag); + }); + } + } + }; + } + function validateMapping(argMapping, args) { + var _validate = function validate(recMapping, recEvt, key) { + if (recMapping instanceof _AnimatedValue.default) { + (0, _invariant.default)(typeof recEvt === 'number', 'Bad mapping of event key ' + key + ', should be number but got ' + typeof recEvt); + return; + } + if (recMapping instanceof _AnimatedValueXY.default) { + (0, _invariant.default)(typeof recEvt.x === 'number' && typeof recEvt.y === 'number', 'Bad mapping of event key ' + key + ', should be XY but got ' + recEvt); + return; + } + if (typeof recEvt === 'number') { + (0, _invariant.default)(recMapping instanceof _AnimatedValue.default, 'Bad mapping of type ' + typeof recMapping + ' for key ' + key + ', event value must map to AnimatedValue'); + return; + } + (0, _invariant.default)(typeof recMapping === 'object', 'Bad mapping of type ' + typeof recMapping + ' for key ' + key); + (0, _invariant.default)(typeof recEvt === 'object', 'Bad event of type ' + typeof recEvt + ' for key ' + key); + for (var mappingKey in recMapping) { + _validate(recMapping[mappingKey], recEvt[mappingKey], mappingKey); + } + }; + (0, _invariant.default)(args.length >= argMapping.length, 'Event has less arguments than mapping'); + argMapping.forEach(function (mapping, idx) { + _validate(mapping, args[idx], 'arg' + idx); + }); + } + var AnimatedEvent = exports.AnimatedEvent = /*#__PURE__*/function () { + function AnimatedEvent(argMapping, config) { + var _this = this; + (0, _classCallCheck2.default)(this, AnimatedEvent); + this._listeners = []; + this._callListeners = function () { + for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) { + args[_key2] = arguments[_key2]; + } + _this._listeners.forEach(function (listener) { + return listener.apply(void 0, args); + }); + }; + this._argMapping = argMapping; + if (config == null) { + console.warn('Animated.event now requires a second argument for options'); + config = { + useNativeDriver: false + }; + } + if (config.listener) { + this.__addListener(config.listener); + } + this._attachedEvent = null; + this.__isNative = _NativeAnimatedHelper.default.shouldUseNativeDriver(config); + this.__platformConfig = config.platformConfig; + } + return (0, _createClass2.default)(AnimatedEvent, [{ + key: "__addListener", + value: function __addListener(callback) { + this._listeners.push(callback); + } + }, { + key: "__removeListener", + value: function __removeListener(callback) { + this._listeners = this._listeners.filter(function (listener) { + return listener !== callback; + }); + } + }, { + key: "__attach", + value: function __attach(viewRef, eventName) { + (0, _invariant.default)(this.__isNative, 'Only native driven events need to be attached.'); + this._attachedEvent = attachNativeEvent(viewRef, eventName, this._argMapping, this.__platformConfig); + } + }, { + key: "__detach", + value: function __detach(viewTag, eventName) { + (0, _invariant.default)(this.__isNative, 'Only native driven events need to be detached.'); + this._attachedEvent && this._attachedEvent.detach(); + } + }, { + key: "__getHandler", + value: function __getHandler() { + var _this2 = this; + if (this.__isNative) { + if (__DEV__) { + var _validatedMapping = false; + return function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) { + args[_key3] = arguments[_key3]; + } + if (!_validatedMapping) { + validateMapping(_this2._argMapping, args); + _validatedMapping = true; + } + _this2._callListeners.apply(_this2, args); + }; + } else { + return this._callListeners; + } + } + var validatedMapping = false; + return function () { + for (var _len3 = arguments.length, args = new Array(_len3), _key4 = 0; _key4 < _len3; _key4++) { + args[_key4] = arguments[_key4]; + } + if (__DEV__ && !validatedMapping) { + validateMapping(_this2._argMapping, args); + validatedMapping = true; + } + var _traverse2 = function traverse(recMapping, recEvt) { + if (recMapping instanceof _AnimatedValue.default) { + if (typeof recEvt === 'number') { + recMapping.setValue(recEvt); + } + } else if (recMapping instanceof _AnimatedValueXY.default) { + if (typeof recEvt === 'object') { + _traverse2(recMapping.x, recEvt.x); + _traverse2(recMapping.y, recEvt.y); + } + } else if (typeof recMapping === 'object') { + for (var mappingKey in recMapping) { + /* $FlowFixMe[prop-missing] (>=0.120.0) This comment suppresses an + * error found when Flow v0.120 was deployed. To see the error, + * delete this comment and run Flow. */ + _traverse2(recMapping[mappingKey], recEvt[mappingKey]); + } + } + }; + _this2._argMapping.forEach(function (mapping, idx) { + _traverse2(mapping, args[idx]); + }); + _this2._callListeners.apply(_this2, args); + }; + } + }]); + }(); +},367,[6,18,19,349,355,368,37,61],"node_modules\\react-native\\Libraries\\Animated\\AnimatedEvent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _AnimatedValue = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./AnimatedValue")); + var _AnimatedWithChildren2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./AnimatedWithChildren")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "invariant")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var _uniqueId = 1; + + /** + * 2D Value for driving 2D animations, such as pan gestures. Almost identical + * API to normal `Animated.Value`, but multiplexed. + * + * See https://reactnative.dev/docs/animatedvaluexy + */ + var AnimatedValueXY = exports.default = /*#__PURE__*/function (_AnimatedWithChildren) { + function AnimatedValueXY(valueIn, config) { + var _this; + (0, _classCallCheck2.default)(this, AnimatedValueXY); + _this = _callSuper(this, AnimatedValueXY); + var value = valueIn || { + x: 0, + y: 0 + }; // fixme: shouldn't need `: any` + if (typeof value.x === 'number' && typeof value.y === 'number') { + _this.x = new _AnimatedValue.default(value.x); + _this.y = new _AnimatedValue.default(value.y); + } else { + (0, _invariant.default)(value.x instanceof _AnimatedValue.default && value.y instanceof _AnimatedValue.default, 'AnimatedValueXY must be initialized with an object of numbers or ' + 'AnimatedValues.'); + _this.x = value.x; + _this.y = value.y; + } + _this._listeners = {}; + if (config && config.useNativeDriver) { + _this.__makeNative(); + } + return _this; + } + + /** + * Directly set the value. This will stop any animations running on the value + * and update all the bound properties. + * + * See https://reactnative.dev/docs/animatedvaluexy#setvalue + */ + (0, _inherits2.default)(AnimatedValueXY, _AnimatedWithChildren); + return (0, _createClass2.default)(AnimatedValueXY, [{ + key: "setValue", + value: function setValue(value) { + this.x.setValue(value.x); + this.y.setValue(value.y); + } + + /** + * Sets an offset that is applied on top of whatever value is set, whether + * via `setValue`, an animation, or `Animated.event`. Useful for compensating + * things like the start of a pan gesture. + * + * See https://reactnative.dev/docs/animatedvaluexy#setoffset + */ + }, { + key: "setOffset", + value: function setOffset(offset) { + this.x.setOffset(offset.x); + this.y.setOffset(offset.y); + } + + /** + * Merges the offset value into the base value and resets the offset to zero. + * The final output of the value is unchanged. + * + * See https://reactnative.dev/docs/animatedvaluexy#flattenoffset + */ + }, { + key: "flattenOffset", + value: function flattenOffset() { + this.x.flattenOffset(); + this.y.flattenOffset(); + } + + /** + * Sets the offset value to the base value, and resets the base value to + * zero. The final output of the value is unchanged. + * + * See https://reactnative.dev/docs/animatedvaluexy#extractoffset + */ + }, { + key: "extractOffset", + value: function extractOffset() { + this.x.extractOffset(); + this.y.extractOffset(); + } + }, { + key: "__getValue", + value: function __getValue() { + return { + x: this.x.__getValue(), + y: this.y.__getValue() + }; + } + + /** + * Stops any animation and resets the value to its original. + * + * See https://reactnative.dev/docs/animatedvaluexy#resetanimation + */ + }, { + key: "resetAnimation", + value: function resetAnimation(callback) { + this.x.resetAnimation(); + this.y.resetAnimation(); + callback && callback(this.__getValue()); + } + + /** + * Stops any running animation or tracking. `callback` is invoked with the + * final value after stopping the animation, which is useful for updating + * state to match the animation position with layout. + * + * See https://reactnative.dev/docs/animatedvaluexy#stopanimation + */ + }, { + key: "stopAnimation", + value: function stopAnimation(callback) { + this.x.stopAnimation(); + this.y.stopAnimation(); + callback && callback(this.__getValue()); + } + + /** + * Adds an asynchronous listener to the value so you can observe updates from + * animations. This is useful because there is no way to synchronously read + * the value because it might be driven natively. + * + * Returns a string that serves as an identifier for the listener. + * + * See https://reactnative.dev/docs/animatedvaluexy#addlistener + */ + }, { + key: "addListener", + value: function addListener(callback) { + var _this2 = this; + var id = String(_uniqueId++); + var jointCallback = function jointCallback(_ref) { + var number = _ref.value; + callback(_this2.__getValue()); + }; + this._listeners[id] = { + x: this.x.addListener(jointCallback), + y: this.y.addListener(jointCallback) + }; + return id; + } + + /** + * Unregister a listener. The `id` param shall match the identifier + * previously returned by `addListener()`. + * + * See https://reactnative.dev/docs/animatedvaluexy#removelistener + */ + }, { + key: "removeListener", + value: function removeListener(id) { + this.x.removeListener(this._listeners[id].x); + this.y.removeListener(this._listeners[id].y); + delete this._listeners[id]; + } + + /** + * Remove all registered listeners. + * + * See https://reactnative.dev/docs/animatedvaluexy#removealllisteners + */ + }, { + key: "removeAllListeners", + value: function removeAllListeners() { + this.x.removeAllListeners(); + this.y.removeAllListeners(); + this._listeners = {}; + } + + /** + * Converts `{x, y}` into `{left, top}` for use in style. + * + * See https://reactnative.dev/docs/animatedvaluexy#getlayout + */ + }, { + key: "getLayout", + value: function getLayout() { + return { + left: this.x, + top: this.y + }; + } + + /** + * Converts `{x, y}` into a useable translation transform. + * + * See https://reactnative.dev/docs/animatedvaluexy#gettranslatetransform + */ + }, { + key: "getTranslateTransform", + value: function getTranslateTransform() { + return [{ + translateX: this.x + }, { + translateY: this.y + }]; + } + }, { + key: "__attach", + value: function __attach() { + this.x.__addChild(this); + this.y.__addChild(this); + _superPropGet(AnimatedValueXY, "__attach", this, 3)([]); + } + }, { + key: "__detach", + value: function __detach() { + this.x.__removeChild(this); + this.y.__removeChild(this); + _superPropGet(AnimatedValueXY, "__detach", this, 3)([]); + } + }, { + key: "__makeNative", + value: function __makeNative(platformConfig) { + this.x.__makeNative(platformConfig); + this.y.__makeNative(platformConfig); + _superPropGet(AnimatedValueXY, "__makeNative", this, 3)([platformConfig]); + } + }]); + }(_AnimatedWithChildren2.default); +},368,[6,18,19,23,25,26,28,355,361,37],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedValueXY.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _readOnlyError2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/readOnlyError")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "@babel/runtime/helpers/inherits")); + var _NativeAnimatedHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "../NativeAnimatedHelper")); + var _AnimatedColor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "../nodes/AnimatedColor")); + var SpringConfig = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10], "../SpringConfig")); + var _Animation2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[11], "./Animation")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[12], "invariant")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var SpringAnimation = exports.default = /*#__PURE__*/function (_Animation) { + function SpringAnimation(config) { + var _config$overshootClam, _config$restDisplacem, _config$restSpeedThre, _config$velocity, _config$velocity2, _config$delay, _config$isInteraction, _config$iterations; + var _this; + (0, _classCallCheck2.default)(this, SpringAnimation); + _this = _callSuper(this, SpringAnimation); + _this._overshootClamping = (_config$overshootClam = config.overshootClamping) != null ? _config$overshootClam : false; + _this._restDisplacementThreshold = (_config$restDisplacem = config.restDisplacementThreshold) != null ? _config$restDisplacem : 0.001; + _this._restSpeedThreshold = (_config$restSpeedThre = config.restSpeedThreshold) != null ? _config$restSpeedThre : 0.001; + _this._initialVelocity = (_config$velocity = config.velocity) != null ? _config$velocity : 0; + _this._lastVelocity = (_config$velocity2 = config.velocity) != null ? _config$velocity2 : 0; + _this._toValue = config.toValue; + _this._delay = (_config$delay = config.delay) != null ? _config$delay : 0; + _this._useNativeDriver = _NativeAnimatedHelper.default.shouldUseNativeDriver(config); + _this._platformConfig = config.platformConfig; + _this.__isInteraction = (_config$isInteraction = config.isInteraction) != null ? _config$isInteraction : !_this._useNativeDriver; + _this.__iterations = (_config$iterations = config.iterations) != null ? _config$iterations : 1; + if (config.stiffness !== undefined || config.damping !== undefined || config.mass !== undefined) { + var _config$stiffness, _config$damping, _config$mass; + (0, _invariant.default)(config.bounciness === undefined && config.speed === undefined && config.tension === undefined && config.friction === undefined, 'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one'); + _this._stiffness = (_config$stiffness = config.stiffness) != null ? _config$stiffness : 100; + _this._damping = (_config$damping = config.damping) != null ? _config$damping : 10; + _this._mass = (_config$mass = config.mass) != null ? _config$mass : 1; + } else if (config.bounciness !== undefined || config.speed !== undefined) { + var _config$bounciness, _config$speed; + // Convert the origami bounciness/speed values to stiffness/damping + // We assume mass is 1. + (0, _invariant.default)(config.tension === undefined && config.friction === undefined && config.stiffness === undefined && config.damping === undefined && config.mass === undefined, 'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one'); + var springConfig = SpringConfig.fromBouncinessAndSpeed((_config$bounciness = config.bounciness) != null ? _config$bounciness : 8, (_config$speed = config.speed) != null ? _config$speed : 12); + _this._stiffness = springConfig.stiffness; + _this._damping = springConfig.damping; + _this._mass = 1; + } else { + var _config$tension, _config$friction; + // Convert the origami tension/friction values to stiffness/damping + // We assume mass is 1. + var _springConfig = SpringConfig.fromOrigamiTensionAndFriction((_config$tension = config.tension) != null ? _config$tension : 40, (_config$friction = config.friction) != null ? _config$friction : 7); + _this._stiffness = _springConfig.stiffness; + _this._damping = _springConfig.damping; + _this._mass = 1; + } + (0, _invariant.default)(_this._stiffness > 0, 'Stiffness value must be greater than 0'); + (0, _invariant.default)(_this._damping > 0, 'Damping value must be greater than 0'); + (0, _invariant.default)(_this._mass > 0, 'Mass value must be greater than 0'); + return _this; + } + (0, _inherits2.default)(SpringAnimation, _Animation); + return (0, _createClass2.default)(SpringAnimation, [{ + key: "__getNativeAnimationConfig", + value: function __getNativeAnimationConfig() { + var _this$_initialVelocit; + return { + type: 'spring', + overshootClamping: this._overshootClamping, + restDisplacementThreshold: this._restDisplacementThreshold, + restSpeedThreshold: this._restSpeedThreshold, + stiffness: this._stiffness, + damping: this._damping, + mass: this._mass, + initialVelocity: (_this$_initialVelocit = this._initialVelocity) != null ? _this$_initialVelocit : this._lastVelocity, + toValue: this._toValue, + iterations: this.__iterations, + platformConfig: this._platformConfig + }; + } + }, { + key: "start", + value: function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) { + var _this2 = this; + this.__active = true; + this._startPosition = fromValue; + this._lastPosition = this._startPosition; + this._onUpdate = onUpdate; + this.__onEnd = onEnd; + this._lastTime = Date.now(); + this._frameTime = 0.0; + if (previousAnimation instanceof SpringAnimation) { + var internalState = previousAnimation.getInternalState(); + this._lastPosition = internalState.lastPosition; + this._lastVelocity = internalState.lastVelocity; + // Set the initial velocity to the last velocity + this._initialVelocity = this._lastVelocity; + this._lastTime = internalState.lastTime; + } + var start = function start() { + if (!_this2._useNativeDriver && animatedValue.__isNative === true) { + throw new Error('Attempting to run JS driven animation on animated node ' + 'that has been moved to "native" earlier by starting an ' + 'animation with `useNativeDriver: true`'); + } + if (_this2._useNativeDriver) { + _this2.__startNativeAnimation(animatedValue); + } else { + _this2.onUpdate(); + } + }; + + // If this._delay is more than 0, we start after the timeout. + if (this._delay) { + this._timeout = setTimeout(start, this._delay); + } else { + start(); + } + } + }, { + key: "getInternalState", + value: function getInternalState() { + return { + lastPosition: this._lastPosition, + lastVelocity: this._lastVelocity, + lastTime: this._lastTime + }; + } + + /** + * This spring model is based off of a damped harmonic oscillator + * (https://en.wikipedia.org/wiki/Harmonic_oscillator#Damped_harmonic_oscillator). + * + * We use the closed form of the second order differential equation: + * + * x'' + (2ζ⍵_0)x' + ⍵^2x = 0 + * + * where + * ⍵_0 = √(k / m) (undamped angular frequency of the oscillator), + * ζ = c / 2√mk (damping ratio), + * c = damping constant + * k = stiffness + * m = mass + * + * The derivation of the closed form is described in detail here: + * http://planetmath.org/sites/default/files/texpdf/39745.pdf + * + * This algorithm happens to match the algorithm used by CASpringAnimation, + * a QuartzCore (iOS) API that creates spring animations. + */ + }, { + key: "onUpdate", + value: function onUpdate() { + // If for some reason we lost a lot of frames (e.g. process large payload or + // stopped in the debugger), we only advance by 4 frames worth of + // computation and will continue on the next frame. It's better to have it + // running at faster speed than jumping to the end. + var MAX_STEPS = 64; + var now = Date.now(); + if (now > this._lastTime + MAX_STEPS) { + now = this._lastTime + MAX_STEPS; + } + var deltaTime = (now - this._lastTime) / 1000; + this._frameTime += deltaTime; + var c = this._damping; + var m = this._mass; + var k = this._stiffness; + var v0 = -this._initialVelocity; + var zeta = c / (2 * Math.sqrt(k * m)); // damping ratio + var omega0 = Math.sqrt(k / m); // undamped angular frequency of the oscillator (rad/ms) + var omega1 = omega0 * Math.sqrt(1.0 - zeta * zeta); // exponential decay + var x0 = this._toValue - this._startPosition; // calculate the oscillation from x0 = 1 to x = 0 + + var position = 0.0; + var velocity = 0.0; + var t = this._frameTime; + if (zeta < 1) { + // Under damped + var envelope = Math.exp(-zeta * omega0 * t); + position = this._toValue - envelope * ((v0 + zeta * omega0 * x0) / omega1 * Math.sin(omega1 * t) + x0 * Math.cos(omega1 * t)); + // This looks crazy -- it's actually just the derivative of the + // oscillation function + velocity = zeta * omega0 * envelope * (Math.sin(omega1 * t) * (v0 + zeta * omega0 * x0) / omega1 + x0 * Math.cos(omega1 * t)) - envelope * (Math.cos(omega1 * t) * (v0 + zeta * omega0 * x0) - omega1 * x0 * Math.sin(omega1 * t)); + } else { + // Critically damped + var _envelope = Math.exp(-omega0 * t); + position = this._toValue - _envelope * (x0 + (v0 + omega0 * x0) * t); + velocity = _envelope * (v0 * (t * omega0 - 1) + t * x0 * (omega0 * omega0)); + } + this._lastTime = now; + this._lastPosition = position; + this._lastVelocity = velocity; + this._onUpdate(position); + if (!this.__active) { + // a listener might have stopped us in _onUpdate + return; + } + + // Conditions for stopping the spring animation + var isOvershooting = false; + if (this._overshootClamping && this._stiffness !== 0) { + if (this._startPosition < this._toValue) { + isOvershooting = position > this._toValue; + } else { + isOvershooting = position < this._toValue; + } + } + var isVelocity = Math.abs(velocity) <= this._restSpeedThreshold; + var isDisplacement = true; + if (this._stiffness !== 0) { + isDisplacement = Math.abs(this._toValue - position) <= this._restDisplacementThreshold; + } + if (isOvershooting || isVelocity && isDisplacement) { + if (this._stiffness !== 0) { + // Ensure that we end up with a round value + this._lastPosition = this._toValue; + this._lastVelocity = 0; + this._onUpdate(this._toValue); + } + this.__debouncedOnEnd({ + finished: true + }); + return; + } + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); + } + }, { + key: "stop", + value: function stop() { + _superPropGet(SpringAnimation, "stop", this, 3)([]); + this.__active = false; + clearTimeout(this._timeout); + global.cancelAnimationFrame(this._animationFrame); + this.__debouncedOnEnd({ + finished: false + }); + } + }]); + }(_Animation2.default); +},369,[6,77,18,19,23,25,26,28,349,354,370,353,37],"node_modules\\react-native\\Libraries\\Animated\\animations\\SpringAnimation.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.fromBouncinessAndSpeed = fromBouncinessAndSpeed; + exports.fromOrigamiTensionAndFriction = fromOrigamiTensionAndFriction; + function stiffnessFromOrigamiValue(oValue) { + return (oValue - 30) * 3.62 + 194; + } + function dampingFromOrigamiValue(oValue) { + return (oValue - 8) * 3 + 25; + } + function fromOrigamiTensionAndFriction(tension, friction) { + return { + stiffness: stiffnessFromOrigamiValue(tension), + damping: dampingFromOrigamiValue(friction) + }; + } + function fromBouncinessAndSpeed(bounciness, speed) { + function normalize(value, startValue, endValue) { + return (value - startValue) / (endValue - startValue); + } + function projectNormal(n, start, end) { + return start + n * (end - start); + } + function linearInterpolation(t, start, end) { + return t * end + (1 - t) * start; + } + function quadraticOutInterpolation(t, start, end) { + return linearInterpolation(2 * t - t * t, start, end); + } + function b3Friction1(x) { + return 0.0007 * Math.pow(x, 3) - 0.031 * Math.pow(x, 2) + 0.64 * x + 1.28; + } + function b3Friction2(x) { + return 0.000044 * Math.pow(x, 3) - 0.006 * Math.pow(x, 2) + 0.36 * x + 2; + } + function b3Friction3(x) { + return 0.00000045 * Math.pow(x, 3) - 0.000332 * Math.pow(x, 2) + 0.1078 * x + 5.84; + } + function b3Nobounce(tension) { + if (tension <= 18) { + return b3Friction1(tension); + } else if (tension > 18 && tension <= 44) { + return b3Friction2(tension); + } else { + return b3Friction3(tension); + } + } + var b = normalize(bounciness / 1.7, 0, 20); + b = projectNormal(b, 0, 0.8); + var s = normalize(speed / 1.7, 0, 20); + var bouncyTension = projectNormal(s, 0.5, 200); + var bouncyFriction = quadraticOutInterpolation(b, b3Nobounce(bouncyTension), 0.01); + return { + stiffness: stiffnessFromOrigamiValue(bouncyTension), + damping: dampingFromOrigamiValue(bouncyFriction) + }; + } +},370,[],"node_modules\\react-native\\Libraries\\Animated\\SpringConfig.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _readOnlyError2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/readOnlyError")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "@babel/runtime/helpers/inherits")); + var _NativeAnimatedHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "../NativeAnimatedHelper")); + var _AnimatedColor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "../nodes/AnimatedColor")); + var _Animation2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "./Animation")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var _easeInOut; + function easeInOut() { + if (!_easeInOut) { + var Easing = _$$_REQUIRE(_dependencyMap[11], "../Easing").default; + _easeInOut = Easing.inOut(Easing.ease); + } + return _easeInOut; + } + var TimingAnimation = exports.default = /*#__PURE__*/function (_Animation) { + function TimingAnimation(config) { + var _config$easing, _config$duration, _config$delay, _config$iterations, _config$isInteraction; + var _this; + (0, _classCallCheck2.default)(this, TimingAnimation); + _this = _callSuper(this, TimingAnimation); + _this._toValue = config.toValue; + _this._easing = (_config$easing = config.easing) != null ? _config$easing : easeInOut(); + _this._duration = (_config$duration = config.duration) != null ? _config$duration : 500; + _this._delay = (_config$delay = config.delay) != null ? _config$delay : 0; + _this.__iterations = (_config$iterations = config.iterations) != null ? _config$iterations : 1; + _this._useNativeDriver = _NativeAnimatedHelper.default.shouldUseNativeDriver(config); + _this._platformConfig = config.platformConfig; + _this.__isInteraction = (_config$isInteraction = config.isInteraction) != null ? _config$isInteraction : !_this._useNativeDriver; + return _this; + } + (0, _inherits2.default)(TimingAnimation, _Animation); + return (0, _createClass2.default)(TimingAnimation, [{ + key: "__getNativeAnimationConfig", + value: function __getNativeAnimationConfig() { + var frameDuration = 1000.0 / 60.0; + var frames = []; + var numFrames = Math.round(this._duration / frameDuration); + for (var frame = 0; frame < numFrames; frame++) { + frames.push(this._easing(frame / numFrames)); + } + frames.push(this._easing(1)); + return { + type: 'frames', + frames: frames, + toValue: this._toValue, + iterations: this.__iterations, + platformConfig: this._platformConfig + }; + } + }, { + key: "start", + value: function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) { + var _this2 = this; + this.__active = true; + this._fromValue = fromValue; + this._onUpdate = onUpdate; + this.__onEnd = onEnd; + var start = function start() { + if (!_this2._useNativeDriver && animatedValue.__isNative === true) { + throw new Error('Attempting to run JS driven animation on animated node ' + 'that has been moved to "native" earlier by starting an ' + 'animation with `useNativeDriver: true`'); + } + + // Animations that sometimes have 0 duration and sometimes do not + // still need to use the native driver when duration is 0 so as to + // not cause intermixed JS and native animations. + if (_this2._duration === 0 && !_this2._useNativeDriver) { + _this2._onUpdate(_this2._toValue); + _this2.__debouncedOnEnd({ + finished: true + }); + } else { + _this2._startTime = Date.now(); + if (_this2._useNativeDriver) { + _this2.__startNativeAnimation(animatedValue); + } else { + _this2._animationFrame = requestAnimationFrame( + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + _this2.onUpdate.bind(_this2)); + } + } + }; + if (this._delay) { + this._timeout = setTimeout(start, this._delay); + } else { + start(); + } + } + }, { + key: "onUpdate", + value: function onUpdate() { + var now = Date.now(); + if (now >= this._startTime + this._duration) { + if (this._duration === 0) { + this._onUpdate(this._toValue); + } else { + this._onUpdate(this._fromValue + this._easing(1) * (this._toValue - this._fromValue)); + } + this.__debouncedOnEnd({ + finished: true + }); + return; + } + this._onUpdate(this._fromValue + this._easing((now - this._startTime) / this._duration) * (this._toValue - this._fromValue)); + if (this.__active) { + // $FlowFixMe[method-unbinding] added when improving typing for this parameters + this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); + } + } + }, { + key: "stop", + value: function stop() { + _superPropGet(TimingAnimation, "stop", this, 3)([]); + this.__active = false; + clearTimeout(this._timeout); + global.cancelAnimationFrame(this._animationFrame); + this.__debouncedOnEnd({ + finished: false + }); + } + }]); + }(_Animation2.default); +},371,[6,77,18,19,23,25,26,28,349,354,353,359],"node_modules\\react-native\\Libraries\\Animated\\animations\\TimingAnimation.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = createAnimatedComponent; + var _objectWithoutProperties2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/objectWithoutProperties")); + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/slicedToArray")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../Components/View/View")); + var _useMergeRefs = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../Utilities/useMergeRefs")); + var _useAnimatedProps3 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "./useAnimatedProps")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[7], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Animated\\createAnimatedComponent.js"; + var _excluded = ["style"]; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function createAnimatedComponent(Component) { + var _this = this; + return React.forwardRef(function (props, forwardedRef) { + var _useAnimatedProps = (0, _useAnimatedProps3.default)( + // $FlowFixMe[incompatible-call] + props), + _useAnimatedProps2 = (0, _slicedToArray2.default)(_useAnimatedProps, 2), + reducedProps = _useAnimatedProps2[0], + callbackRef = _useAnimatedProps2[1]; + // $FlowFixMe[incompatible-call] + var ref = (0, _useMergeRefs.default)(callbackRef, forwardedRef); + + // Some components require explicit passthrough values for animation + // to work properly. For example, if an animated component is + // transformed and Pressable, onPress will not work after transform + // without these passthrough values. + // $FlowFixMe[prop-missing] + var passthroughAnimatedPropExplicitValues = reducedProps.passthroughAnimatedPropExplicitValues, + style = reducedProps.style; + var _ref = passthroughAnimatedPropExplicitValues != null ? passthroughAnimatedPropExplicitValues : {}, + passthroughStyle = _ref.style, + passthroughProps = (0, _objectWithoutProperties2.default)(_ref, _excluded); + var mergedStyle = Object.assign({}, style, passthroughStyle); + return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, Object.assign({}, reducedProps, passthroughProps, { + style: mergedStyle, + ref: ref + })); + }); + } +},372,[6,166,7,241,373,374,65,106],"node_modules\\react-native\\Libraries\\Animated\\createAnimatedComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = useMergeRefs; + var _react = _$$_REQUIRE(_dependencyMap[0], "react"); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /** + * Constructs a new ref that forwards new values to each of the given refs. The + * given refs will always be invoked in the order that they are supplied. + * + * WARNING: A known problem of merging refs using this approach is that if any + * of the given refs change, the returned callback ref will also be changed. If + * the returned callback ref is supplied as a `ref` to a React element, this may + * lead to problems with the given refs being invoked more times than desired. + */ + function useMergeRefs() { + for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { + refs[_key] = arguments[_key]; + } + return (0, _react.useCallback)(function (current) { + for (var ref of refs) { + if (ref != null) { + if (typeof ref === 'function') { + ref(current); + } else { + ref.current = current; + } + } + } + }, [].concat(refs) // eslint-disable-line react-hooks/exhaustive-deps + ); + } +},373,[65],"node_modules\\react-native\\Libraries\\Utilities\\useMergeRefs.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = useAnimatedProps; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _ReactNativeFeatureFlags = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../ReactNative/ReactNativeFeatureFlags")); + var _useRefEffect = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../Utilities/useRefEffect")); + var _NativeAnimatedHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "./NativeAnimatedHelper")); + var _AnimatedProps = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "./nodes/AnimatedProps")); + var _react = _$$_REQUIRE(_dependencyMap[6], "react"); + function useAnimatedProps(props) { + var _useReducer = (0, _react.useReducer)(function (count) { + return count + 1; + }, 0), + _useReducer2 = (0, _slicedToArray2.default)(_useReducer, 2), + scheduleUpdate = _useReducer2[1]; + var onUpdateRef = (0, _react.useRef)(null); + + // TODO: Only invalidate `node` if animated props or `style` change. In the + // previous implementation, we permitted `style` to override props with the + // same name property name as styles, so we can probably continue doing that. + // The ordering of other props *should* not matter. + var node = (0, _react.useMemo)(function () { + return new _AnimatedProps.default(props, function () { + return onUpdateRef.current == null ? void 0 : onUpdateRef.current(); + }); + }, [props]); + var useNativePropsInFabric = _ReactNativeFeatureFlags.default.shouldUseSetNativePropsInFabric(); + useAnimatedPropsLifecycle(node); + + // TODO: This "effect" does three things: + // + // 1) Call `setNativeView`. + // 2) Update `onUpdateRef`. + // 3) Update listeners for `AnimatedEvent` props. + // + // Ideally, each of these would be separate "effects" so that they are not + // unnecessarily re-run when irrelevant dependencies change. For example, we + // should be able to hoist all `AnimatedEvent` props and only do #3 if either + // the `AnimatedEvent` props change or `instance` changes. + // + // But there is no way to transparently compose three separate callback refs, + // so we just combine them all into one for now. + var refEffect = (0, _react.useCallback)(function (instance) { + // NOTE: This may be called more often than necessary (e.g. when `props` + // changes), but `setNativeView` already optimizes for that. + node.setNativeView(instance); + + // NOTE: When using the JS animation driver, this callback is called on + // every animation frame. When using the native driver, this callback is + // called when the animation completes. + onUpdateRef.current = function () { + if (process.env.NODE_ENV === 'test' || typeof instance !== 'object' || typeof (instance == null ? void 0 : instance.setNativeProps) !== 'function' || isFabricInstance(instance) && !useNativePropsInFabric) { + // Schedule an update for this component to update `reducedProps`, + // but do not compute it immediately. If a parent also updated, we + // need to merge those new props in before updating. + scheduleUpdate(); + } else if (!node.__isNative) { + // $FlowIgnore[not-a-function] - Assume it's still a function. + // $FlowFixMe[incompatible-use] + instance.setNativeProps(node.__getAnimatedValue()); + } + }; + var target = getEventTarget(instance); + var events = []; + for (var propName in props) { + var propValue = props[propName]; + if (propValue instanceof _$$_REQUIRE(_dependencyMap[7], "./AnimatedEvent").AnimatedEvent && propValue.__isNative) { + propValue.__attach(target, propName); + events.push([propName, propValue]); + } + } + return function () { + onUpdateRef.current = null; + for (var _ref of events) { + var _ref2 = (0, _slicedToArray2.default)(_ref, 2); + var _propName = _ref2[0]; + var _propValue = _ref2[1]; + _propValue.__detach(target, _propName); + } + }; + }, [props, node, useNativePropsInFabric]); + var callbackRef = (0, _useRefEffect.default)(refEffect); + return [reduceAnimatedProps(node), callbackRef]; + } + function reduceAnimatedProps(node) { + // Force `collapsable` to be false so that the native view is not flattened. + // Flattened views cannot be accurately referenced by the native driver. + return Object.assign({}, node.__getValue(), { + collapsable: false + }); + } + + /** + * Manages the lifecycle of the supplied `AnimatedProps` by invoking `__attach` + * and `__detach`. However, this is more complicated because `AnimatedProps` + * uses reference counting to determine when to recursively detach its children + * nodes. So in order to optimize this, we avoid detaching until the next attach + * unless we are unmounting. + */ + function useAnimatedPropsLifecycle(node) { + var prevNodeRef = (0, _react.useRef)(null); + var isUnmountingRef = (0, _react.useRef)(false); + (0, _react.useEffect)(function () { + // It is ok for multiple components to call `flushQueue` because it noops + // if the queue is empty. When multiple animated components are mounted at + // the same time. Only first component flushes the queue and the others will noop. + _NativeAnimatedHelper.default.API.flushQueue(); + }); + (0, _react.useLayoutEffect)(function () { + isUnmountingRef.current = false; + return function () { + isUnmountingRef.current = true; + }; + }, []); + (0, _react.useLayoutEffect)(function () { + node.__attach(); + if (prevNodeRef.current != null) { + var prevNode = prevNodeRef.current; + // TODO: Stop restoring default values (unless `reset` is called). + prevNode.__restoreDefaultValues(); + prevNode.__detach(); + prevNodeRef.current = null; + } + return function () { + if (isUnmountingRef.current) { + // NOTE: Do not restore default values on unmount, see D18197735. + node.__detach(); + } else { + prevNodeRef.current = node; + } + }; + }, [node]); + } + function getEventTarget(instance) { + return typeof instance === 'object' && typeof (instance == null ? void 0 : instance.getScrollableNode) === 'function' ? + // $FlowFixMe[incompatible-use] - Legacy instance assumptions. + instance.getScrollableNode() : instance; + } + + // $FlowFixMe[unclear-type] - Legacy instance assumptions. + function isFabricInstance(instance) { + var _instance$getScrollRe; + return (0, _$$_REQUIRE(_dependencyMap[8], "../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils").isPublicInstance)(instance) || + // Some components have a setNativeProps function but aren't a host component + // such as lists like FlatList and SectionList. These should also use + // forceUpdate in Fabric since setNativeProps doesn't exist on the underlying + // host component. This crazy hack is essentially special casing those lists and + // ScrollView itself to use forceUpdate in Fabric. + // If these components end up using forwardRef then these hacks can go away + // as instance would actually be the underlying host component and the above check + // would be sufficient. + (0, _$$_REQUIRE(_dependencyMap[8], "../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils").isPublicInstance)(instance == null ? void 0 : instance.getNativeScrollRef == null ? void 0 : instance.getNativeScrollRef()) || (0, _$$_REQUIRE(_dependencyMap[8], "../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils").isPublicInstance)(instance == null ? void 0 : instance.getScrollResponder == null ? void 0 : (_instance$getScrollRe = instance.getScrollResponder()) == null ? void 0 : _instance$getScrollRe.getNativeScrollRef == null ? void 0 : _instance$getScrollRe.getNativeScrollRef()); + } +},374,[6,7,157,375,349,363,65,367,376],"node_modules\\react-native\\Libraries\\Animated\\useAnimatedProps.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = useRefEffect; + var _react = _$$_REQUIRE(_dependencyMap[0], "react"); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /** + * Constructs a callback ref that provides similar semantics as `useEffect`. The + * supplied `effect` callback will be called with non-null component instances. + * The `effect` callback can also optionally return a cleanup function. + * + * When a component is updated or unmounted, the cleanup function is called. The + * `effect` callback will then be called again, if applicable. + * + * When a new `effect` callback is supplied, the previously returned cleanup + * function will be called before the new `effect` callback is called with the + * same instance. + * + * WARNING: The `effect` callback should be stable (e.g. using `useCallback`). + */ + function useRefEffect(effect) { + var cleanupRef = (0, _react.useRef)(undefined); + return (0, _react.useCallback)(function (instance) { + if (cleanupRef.current) { + cleanupRef.current(); + cleanupRef.current = undefined; + } + if (instance != null) { + cleanupRef.current = effect(instance); + } + }, [effect]); + } +},375,[65],"node_modules\\react-native\\Libraries\\Utilities\\useRefEffect.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.isPublicInstance = isPublicInstance; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + /** + * IMPORTANT!! + * + * This module cannot import `ReactFabric` (directly or indirectly) + * because it can be used by apps only using the legacy renderer. + * In that case `nativeFabricUIManager` isn't defined and `ReactFabric` throws. + */ + + function isPublicInstance(maybeInstance) { + return maybeInstance != null && ( + // TODO: implement a better check when the instance is defined in the React Native repository. + maybeInstance.__nativeTag != null || + // TODO: remove this check when syncing the new version of the renderer from React to React Native. + isLegacyFabricInstance(maybeInstance)); + } + function isLegacyFabricInstance(maybeInstance) { + /* eslint-disable dot-notation */ + return maybeInstance != null && + // $FlowExpectedError[incompatible-use] + maybeInstance['_internalInstanceHandle'] != null && maybeInstance['_internalInstanceHandle'].stateNode != null && maybeInstance['_internalInstanceHandle'].stateNode.canonical != null; + } +},376,[],"node_modules\\react-native\\Libraries\\ReactNative\\ReactFabricPublicInstance\\ReactFabricPublicInstanceUtils.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _AnimatedInterpolation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./AnimatedInterpolation")); + var _AnimatedValue = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./AnimatedValue")); + var _AnimatedWithChildren2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./AnimatedWithChildren")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var AnimatedAddition = exports.default = /*#__PURE__*/function (_AnimatedWithChildren) { + function AnimatedAddition(a, b) { + var _this; + (0, _classCallCheck2.default)(this, AnimatedAddition); + _this = _callSuper(this, AnimatedAddition); + _this._a = typeof a === 'number' ? new _AnimatedValue.default(a) : a; + _this._b = typeof b === 'number' ? new _AnimatedValue.default(b) : b; + return _this; + } + (0, _inherits2.default)(AnimatedAddition, _AnimatedWithChildren); + return (0, _createClass2.default)(AnimatedAddition, [{ + key: "__makeNative", + value: function __makeNative(platformConfig) { + this._a.__makeNative(platformConfig); + this._b.__makeNative(platformConfig); + _superPropGet(AnimatedAddition, "__makeNative", this, 3)([platformConfig]); + } + }, { + key: "__getValue", + value: function __getValue() { + return this._a.__getValue() + this._b.__getValue(); + } + }, { + key: "interpolate", + value: function interpolate(config) { + return new _AnimatedInterpolation.default(this, config); + } + }, { + key: "__attach", + value: function __attach() { + this._a.__addChild(this); + this._b.__addChild(this); + } + }, { + key: "__detach", + value: function __detach() { + this._a.__removeChild(this); + this._b.__removeChild(this); + _superPropGet(AnimatedAddition, "__detach", this, 3)([]); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'addition', + input: [this._a.__getNativeTag(), this._b.__getNativeTag()] + }; + } + }]); + }(_AnimatedWithChildren2.default); +},377,[6,18,19,23,25,26,28,358,355,361],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedAddition.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _AnimatedInterpolation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./AnimatedInterpolation")); + var _AnimatedWithChildren2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./AnimatedWithChildren")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var AnimatedDiffClamp = exports.default = /*#__PURE__*/function (_AnimatedWithChildren) { + function AnimatedDiffClamp(a, min, max) { + var _this; + (0, _classCallCheck2.default)(this, AnimatedDiffClamp); + _this = _callSuper(this, AnimatedDiffClamp); + _this._a = a; + _this._min = min; + _this._max = max; + _this._value = _this._lastValue = _this._a.__getValue(); + return _this; + } + (0, _inherits2.default)(AnimatedDiffClamp, _AnimatedWithChildren); + return (0, _createClass2.default)(AnimatedDiffClamp, [{ + key: "__makeNative", + value: function __makeNative(platformConfig) { + this._a.__makeNative(platformConfig); + _superPropGet(AnimatedDiffClamp, "__makeNative", this, 3)([platformConfig]); + } + }, { + key: "interpolate", + value: function interpolate(config) { + return new _AnimatedInterpolation.default(this, config); + } + }, { + key: "__getValue", + value: function __getValue() { + var value = this._a.__getValue(); + var diff = value - this._lastValue; + this._lastValue = value; + this._value = Math.min(Math.max(this._value + diff, this._min), this._max); + return this._value; + } + }, { + key: "__attach", + value: function __attach() { + this._a.__addChild(this); + } + }, { + key: "__detach", + value: function __detach() { + this._a.__removeChild(this); + _superPropGet(AnimatedDiffClamp, "__detach", this, 3)([]); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'diffclamp', + input: this._a.__getNativeTag(), + min: this._min, + max: this._max + }; + } + }]); + }(_AnimatedWithChildren2.default); +},378,[6,18,19,23,25,26,28,358,361],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedDiffClamp.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _AnimatedInterpolation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./AnimatedInterpolation")); + var _AnimatedNode = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./AnimatedNode")); + var _AnimatedValue = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./AnimatedValue")); + var _AnimatedWithChildren2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "./AnimatedWithChildren")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var AnimatedDivision = exports.default = /*#__PURE__*/function (_AnimatedWithChildren) { + function AnimatedDivision(a, b) { + var _this; + (0, _classCallCheck2.default)(this, AnimatedDivision); + _this = _callSuper(this, AnimatedDivision); + _this._warnedAboutDivideByZero = false; + if (b === 0 || b instanceof _AnimatedNode.default && b.__getValue() === 0) { + console.error('Detected potential division by zero in AnimatedDivision'); + } + _this._a = typeof a === 'number' ? new _AnimatedValue.default(a) : a; + _this._b = typeof b === 'number' ? new _AnimatedValue.default(b) : b; + return _this; + } + (0, _inherits2.default)(AnimatedDivision, _AnimatedWithChildren); + return (0, _createClass2.default)(AnimatedDivision, [{ + key: "__makeNative", + value: function __makeNative(platformConfig) { + this._a.__makeNative(platformConfig); + this._b.__makeNative(platformConfig); + _superPropGet(AnimatedDivision, "__makeNative", this, 3)([platformConfig]); + } + }, { + key: "__getValue", + value: function __getValue() { + var a = this._a.__getValue(); + var b = this._b.__getValue(); + if (b === 0) { + // Prevent spamming the console/LogBox + if (!this._warnedAboutDivideByZero) { + console.error('Detected division by zero in AnimatedDivision'); + this._warnedAboutDivideByZero = true; + } + // Passing infinity/NaN to Fabric will cause a native crash + return 0; + } + this._warnedAboutDivideByZero = false; + return a / b; + } + }, { + key: "interpolate", + value: function interpolate(config) { + return new _AnimatedInterpolation.default(this, config); + } + }, { + key: "__attach", + value: function __attach() { + this._a.__addChild(this); + this._b.__addChild(this); + } + }, { + key: "__detach", + value: function __detach() { + this._a.__removeChild(this); + this._b.__removeChild(this); + _superPropGet(AnimatedDivision, "__detach", this, 3)([]); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'division', + input: [this._a.__getNativeTag(), this._b.__getNativeTag()] + }; + } + }]); + }(_AnimatedWithChildren2.default); +},379,[6,18,19,23,25,26,28,358,362,355,361],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedDivision.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _AnimatedInterpolation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./AnimatedInterpolation")); + var _AnimatedWithChildren2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./AnimatedWithChildren")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var AnimatedModulo = exports.default = /*#__PURE__*/function (_AnimatedWithChildren) { + function AnimatedModulo(a, modulus) { + var _this; + (0, _classCallCheck2.default)(this, AnimatedModulo); + _this = _callSuper(this, AnimatedModulo); + _this._a = a; + _this._modulus = modulus; + return _this; + } + (0, _inherits2.default)(AnimatedModulo, _AnimatedWithChildren); + return (0, _createClass2.default)(AnimatedModulo, [{ + key: "__makeNative", + value: function __makeNative(platformConfig) { + this._a.__makeNative(platformConfig); + _superPropGet(AnimatedModulo, "__makeNative", this, 3)([platformConfig]); + } + }, { + key: "__getValue", + value: function __getValue() { + return (this._a.__getValue() % this._modulus + this._modulus) % this._modulus; + } + }, { + key: "interpolate", + value: function interpolate(config) { + return new _AnimatedInterpolation.default(this, config); + } + }, { + key: "__attach", + value: function __attach() { + this._a.__addChild(this); + } + }, { + key: "__detach", + value: function __detach() { + this._a.__removeChild(this); + _superPropGet(AnimatedModulo, "__detach", this, 3)([]); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'modulus', + input: this._a.__getNativeTag(), + modulus: this._modulus + }; + } + }]); + }(_AnimatedWithChildren2.default); +},380,[6,18,19,23,25,26,28,358,361],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedModulo.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _AnimatedInterpolation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./AnimatedInterpolation")); + var _AnimatedValue = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./AnimatedValue")); + var _AnimatedWithChildren2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./AnimatedWithChildren")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var AnimatedMultiplication = exports.default = /*#__PURE__*/function (_AnimatedWithChildren) { + function AnimatedMultiplication(a, b) { + var _this; + (0, _classCallCheck2.default)(this, AnimatedMultiplication); + _this = _callSuper(this, AnimatedMultiplication); + _this._a = typeof a === 'number' ? new _AnimatedValue.default(a) : a; + _this._b = typeof b === 'number' ? new _AnimatedValue.default(b) : b; + return _this; + } + (0, _inherits2.default)(AnimatedMultiplication, _AnimatedWithChildren); + return (0, _createClass2.default)(AnimatedMultiplication, [{ + key: "__makeNative", + value: function __makeNative(platformConfig) { + this._a.__makeNative(platformConfig); + this._b.__makeNative(platformConfig); + _superPropGet(AnimatedMultiplication, "__makeNative", this, 3)([platformConfig]); + } + }, { + key: "__getValue", + value: function __getValue() { + return this._a.__getValue() * this._b.__getValue(); + } + }, { + key: "interpolate", + value: function interpolate(config) { + return new _AnimatedInterpolation.default(this, config); + } + }, { + key: "__attach", + value: function __attach() { + this._a.__addChild(this); + this._b.__addChild(this); + } + }, { + key: "__detach", + value: function __detach() { + this._a.__removeChild(this); + this._b.__removeChild(this); + _superPropGet(AnimatedMultiplication, "__detach", this, 3)([]); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'multiplication', + input: [this._a.__getNativeTag(), this._b.__getNativeTag()] + }; + } + }]); + }(_AnimatedWithChildren2.default); +},381,[6,18,19,23,25,26,28,358,355,361],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedMultiplication.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _AnimatedInterpolation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./AnimatedInterpolation")); + var _AnimatedValue = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./AnimatedValue")); + var _AnimatedWithChildren2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./AnimatedWithChildren")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var AnimatedSubtraction = exports.default = /*#__PURE__*/function (_AnimatedWithChildren) { + function AnimatedSubtraction(a, b) { + var _this; + (0, _classCallCheck2.default)(this, AnimatedSubtraction); + _this = _callSuper(this, AnimatedSubtraction); + _this._a = typeof a === 'number' ? new _AnimatedValue.default(a) : a; + _this._b = typeof b === 'number' ? new _AnimatedValue.default(b) : b; + return _this; + } + (0, _inherits2.default)(AnimatedSubtraction, _AnimatedWithChildren); + return (0, _createClass2.default)(AnimatedSubtraction, [{ + key: "__makeNative", + value: function __makeNative(platformConfig) { + this._a.__makeNative(platformConfig); + this._b.__makeNative(platformConfig); + _superPropGet(AnimatedSubtraction, "__makeNative", this, 3)([platformConfig]); + } + }, { + key: "__getValue", + value: function __getValue() { + return this._a.__getValue() - this._b.__getValue(); + } + }, { + key: "interpolate", + value: function interpolate(config) { + return new _AnimatedInterpolation.default(this, config); + } + }, { + key: "__attach", + value: function __attach() { + this._a.__addChild(this); + this._b.__addChild(this); + } + }, { + key: "__detach", + value: function __detach() { + this._a.__removeChild(this); + this._b.__removeChild(this); + _superPropGet(AnimatedSubtraction, "__detach", this, 3)([]); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'subtraction', + input: [this._a.__getNativeTag(), this._b.__getNativeTag()] + }; + } + }]); + }(_AnimatedWithChildren2.default); +},382,[6,18,19,23,25,26,28,358,355,361],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedSubtraction.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _NativeAnimatedHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../NativeAnimatedHelper")); + var _AnimatedNode2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./AnimatedNode")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } + var AnimatedTracking = exports.default = /*#__PURE__*/function (_AnimatedNode) { + function AnimatedTracking(value, parent, animationClass, animationConfig, callback) { + var _this; + (0, _classCallCheck2.default)(this, AnimatedTracking); + _this = _callSuper(this, AnimatedTracking); + _this._value = value; + _this._parent = parent; + _this._animationClass = animationClass; + _this._animationConfig = animationConfig; + _this._useNativeDriver = _NativeAnimatedHelper.default.shouldUseNativeDriver(animationConfig); + _this._callback = callback; + _this.__attach(); + return _this; + } + (0, _inherits2.default)(AnimatedTracking, _AnimatedNode); + return (0, _createClass2.default)(AnimatedTracking, [{ + key: "__makeNative", + value: function __makeNative(platformConfig) { + this.__isNative = true; + this._parent.__makeNative(platformConfig); + _superPropGet(AnimatedTracking, "__makeNative", this, 3)([platformConfig]); + this._value.__makeNative(platformConfig); + } + }, { + key: "__getValue", + value: function __getValue() { + return this._parent.__getValue(); + } + }, { + key: "__attach", + value: function __attach() { + this._parent.__addChild(this); + if (this._useNativeDriver) { + // when the tracking starts we need to convert this node to a "native node" + // so that the parent node will be made "native" too. This is necessary as + // if we don't do this `update` method will get called. At that point it + // may be too late as it would mean the JS driver has already started + // updating node values + var platformConfig = this._animationConfig.platformConfig; + this.__makeNative(platformConfig); + } + } + }, { + key: "__detach", + value: function __detach() { + this._parent.__removeChild(this); + _superPropGet(AnimatedTracking, "__detach", this, 3)([]); + } + }, { + key: "update", + value: function update() { + this._value.animate(new this._animationClass(Object.assign({}, this._animationConfig, { + toValue: this._animationConfig.toValue.__getValue() + })), this._callback); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + var animation = new this._animationClass(Object.assign({}, this._animationConfig, { + // remove toValue from the config as it's a ref to Animated.Value + toValue: undefined + })); + var animationConfig = animation.__getNativeAnimationConfig(); + return { + type: 'tracking', + animationId: _NativeAnimatedHelper.default.generateNewAnimationId(), + animationConfig: animationConfig, + toValue: this._parent.__getNativeTag(), + value: this._value.__getNativeTag() + }; + } + }]); + }(_AnimatedNode2.default); +},383,[6,18,19,23,25,26,28,349,362],"node_modules\\react-native\\Libraries\\Animated\\nodes\\AnimatedTracking.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _NativeFrameRateLogger = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./NativeFrameRateLogger")); /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + /** + * Flow API for native FrameRateLogger module. If the native module is not installed, function calls + * are just no-ops. + * + * Typical behavior is that `setContext` is called when a new screen is loaded (e.g. via a + * navigation integration), and then `beginScroll` is called by `ScrollResponder` at which point the + * native module then begins tracking frame drops. When `ScrollResponder` calls `endScroll`, the + * native module gathers up all it's frame drop data and reports it via an analytics pipeline for + * analysis. + * + * Note that `beginScroll` may be called multiple times by `ScrollResponder` - unclear if that's a + * bug, but the native module should be robust to that. + * + * In the future we may add support for tracking frame drops in other types of interactions beyond + * scrolling. + */ + var FrameRateLogger = { + /** + * Enable `debug` to see local logs of what's going on. `reportStackTraces` will grab stack traces + * during UI thread stalls and upload them if the native module supports it. + */ + setGlobalOptions: function setGlobalOptions(options) { + if (options.debug !== undefined) { + _$$_REQUIRE(_dependencyMap[2], "invariant")(_NativeFrameRateLogger.default, 'Trying to debug FrameRateLogger without the native module!'); + } + if (_NativeFrameRateLogger.default) { + // Needs to clone the object first to avoid modifying the argument. + var optionsClone = { + debug: !!options.debug, + reportStackTraces: !!options.reportStackTraces + }; + _NativeFrameRateLogger.default.setGlobalOptions(optionsClone); + } + }, + /** + * Must call `setContext` before any events can be properly tracked, which is done automatically + * in `AppRegistry`, but navigation is also a common place to hook in. + */ + setContext: function setContext(context) { + _NativeFrameRateLogger.default && _NativeFrameRateLogger.default.setContext(context); + }, + /** + * Called in `ScrollResponder` so any component that uses that module will handle this + * automatically. + */ + beginScroll: function beginScroll() { + _NativeFrameRateLogger.default && _NativeFrameRateLogger.default.beginScroll(); + }, + /** + * Called in `ScrollResponder` so any component that uses that module will handle this + * automatically. + */ + endScroll: function endScroll() { + _NativeFrameRateLogger.default && _NativeFrameRateLogger.default.endScroll(); + } + }; + module.exports = FrameRateLogger; +},384,[6,385,37],"node_modules\\react-native\\Libraries\\Interaction\\FrameRateLogger.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + var _default = exports.default = TurboModuleRegistry.get('FrameRateLogger'); +},385,[36],"node_modules\\react-native\\Libraries\\Interaction\\NativeFrameRateLogger.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = splitLayoutProps; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + function splitLayoutProps(props) { + var outer = null; + var inner = null; + if (props != null) { + // $FlowIgnore[incompatible-exact] Will contain a subset of keys from `props`. + outer = {}; + // $FlowIgnore[incompatible-exact] Will contain a subset of keys from `props`. + inner = {}; + for (var prop of Object.keys(props)) { + switch (prop) { + case 'margin': + case 'marginHorizontal': + case 'marginVertical': + case 'marginBottom': + case 'marginTop': + case 'marginLeft': + case 'marginRight': + case 'flex': + case 'flexGrow': + case 'flexShrink': + case 'flexBasis': + case 'alignSelf': + case 'height': + case 'minHeight': + case 'maxHeight': + case 'width': + case 'minWidth': + case 'maxWidth': + case 'position': + case 'left': + case 'right': + case 'bottom': + case 'top': + case 'transform': + case 'transformOrigin': + case 'rowGap': + case 'columnGap': + case 'gap': + // $FlowFixMe[cannot-write] + // $FlowFixMe[incompatible-use] + // $FlowFixMe[prop-missing] + outer[prop] = props[prop]; + break; + default: + // $FlowFixMe[cannot-write] + // $FlowFixMe[incompatible-use] + // $FlowFixMe[prop-missing] + inner[prop] = props[prop]; + break; + } + } + } + return { + outer: outer, + inner: inner + }; + } +},386,[],"node_modules\\react-native\\Libraries\\StyleSheet\\splitLayoutProps.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + // This function dismisses the currently-open keyboard, if any. + + 'use strict'; + + function dismissKeyboard() { + _$$_REQUIRE(_dependencyMap[0], "../Components/TextInput/TextInputState").blurTextInput(_$$_REQUIRE(_dependencyMap[0], "../Components/TextInput/TextInputState").currentlyFocusedInput()); + } + module.exports = dismissKeyboard; +},387,[281],"node_modules\\react-native\\Libraries\\Utilities\\dismissKeyboard.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _NativeEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../EventEmitter/NativeEventEmitter")); + var _LayoutAnimation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../LayoutAnimation/LayoutAnimation")); + var _dismissKeyboard = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../../Utilities/dismissKeyboard")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../../Utilities/Platform")); + var _NativeKeyboardObserver = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./NativeKeyboardObserver")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + /** + * `Keyboard` module to control keyboard events. + * + * ### Usage + * + * The Keyboard module allows you to listen for native events and react to them, as + * well as make changes to the keyboard, like dismissing it. + * + *``` + * import React, { Component } from 'react'; + * import { Keyboard, TextInput } from 'react-native'; + * + * class Example extends Component { + * componentWillMount () { + * this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow); + * this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide); + * } + * + * componentWillUnmount () { + * this.keyboardDidShowListener.remove(); + * this.keyboardDidHideListener.remove(); + * } + * + * _keyboardDidShow () { + * alert('Keyboard Shown'); + * } + * + * _keyboardDidHide () { + * alert('Keyboard Hidden'); + * } + * + * render() { + * return ( + * + * ); + * } + * } + *``` + */ + var Keyboard = /*#__PURE__*/function () { + function Keyboard() { + var _this = this; + (0, _classCallCheck2.default)(this, Keyboard); + this._emitter = new _NativeEventEmitter.default( + // T88715063: NativeEventEmitter only used this parameter on iOS. Now it uses it on all platforms, so this code was modified automatically to preserve its behavior + // If you want to use the native module on other platforms, please remove this condition and test its behavior + _Platform.default.OS !== 'ios' ? null : _NativeKeyboardObserver.default); + this.addListener('keyboardDidShow', function (ev) { + _this._currentlyShowing = ev; + }); + this.addListener('keyboardDidHide', function (_ev) { + _this._currentlyShowing = null; + }); + } + + /** + * The `addListener` function connects a JavaScript function to an identified native + * keyboard notification event. + * + * This function then returns the reference to the listener. + * + * @param {string} eventName The `nativeEvent` is the string that identifies the event you're listening for. This + *can be any of the following: + * + * - `keyboardWillShow` + * - `keyboardDidShow` + * - `keyboardWillHide` + * - `keyboardDidHide` + * - `keyboardWillChangeFrame` + * - `keyboardDidChangeFrame` + * + * Android versions prior to API 30 rely on observing layout changes when + * `android:windowSoftInputMode` is set to `adjustResize` or `adjustPan`. + * + * `keyboardWillShow` as well as `keyboardWillHide` are not available on Android since there is + * no native corresponding event. + * + * @param {function} callback function to be called when the event fires. + */ + return (0, _createClass2.default)(Keyboard, [{ + key: "addListener", + value: function addListener(eventType, listener, context) { + return this._emitter.addListener(eventType, listener); + } + + /** + * Removes all listeners for a specific event type. + * + * @param {string} eventType The native event string listeners are watching which will be removed. + */ + }, { + key: "removeAllListeners", + value: function removeAllListeners(eventType) { + this._emitter.removeAllListeners(eventType); + } + + /** + * Dismisses the active keyboard and removes focus. + */ + }, { + key: "dismiss", + value: function dismiss() { + (0, _dismissKeyboard.default)(); + } + + /** + * Whether the keyboard is last known to be visible. + */ + }, { + key: "isVisible", + value: function isVisible() { + return !!this._currentlyShowing; + } + + /** + * Return the metrics of the soft-keyboard if visible. + */ + }, { + key: "metrics", + value: function metrics() { + var _this$_currentlyShowi; + return (_this$_currentlyShowi = this._currentlyShowing) == null ? void 0 : _this$_currentlyShowi.endCoordinates; + } + + /** + * Useful for syncing TextInput (or other keyboard accessory view) size of + * position changes with keyboard movements. + */ + }, { + key: "scheduleLayoutAnimation", + value: function scheduleLayoutAnimation(event) { + var duration = event.duration, + easing = event.easing; + if (duration != null && duration !== 0) { + _LayoutAnimation.default.configureNext({ + duration: duration, + update: { + duration: duration, + type: easing != null && _LayoutAnimation.default.Types[easing] || 'keyboard' + } + }); + } + } + }]); + }(); + module.exports = new Keyboard(); +},388,[6,18,19,160,389,387,34,390],"node_modules\\react-native\\Libraries\\Components\\Keyboard\\Keyboard.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _ReactNativeFeatureFlags = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../ReactNative/ReactNativeFeatureFlags")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../Utilities/Platform")); + // Reexport type + + var isLayoutAnimationEnabled = _ReactNativeFeatureFlags.default.isLayoutAnimationEnabled(); + function setEnabled(value) { + isLayoutAnimationEnabled = isLayoutAnimationEnabled; + } + + /** + * Configures the next commit to be animated. + * + * onAnimationDidEnd is guaranteed to be called when the animation completes. + * onAnimationDidFail is *never* called in the classic, pre-Fabric renderer, + * and never has been. In the new renderer (Fabric) it is called only if configuration + * parsing fails. + */ + function configureNext(config, onAnimationDidEnd, onAnimationDidFail) { + var _config$duration; + if (_Platform.default.isDisableAnimations) { + return; + } + if (!isLayoutAnimationEnabled) { + return; + } + + // Since LayoutAnimations may possibly be disabled for now on iOS (Fabric), + // or Android (non-Fabric) we race a setTimeout with animation completion, + // in case onComplete is never called + // from native. Once LayoutAnimations+Fabric unconditionally ship everywhere, we can + // delete this mechanism at least in the Fabric branch. + var animationCompletionHasRun = false; + var onAnimationComplete = function onAnimationComplete() { + if (animationCompletionHasRun) { + return; + } + animationCompletionHasRun = true; + clearTimeout(raceWithAnimationId); + onAnimationDidEnd == null ? void 0 : onAnimationDidEnd(); + }; + var raceWithAnimationId = setTimeout(onAnimationComplete, ((_config$duration = config.duration) != null ? _config$duration : 0) + 17 /* one frame + 1ms */); + + // In Fabric, LayoutAnimations are unconditionally enabled for Android, and + // conditionally enabled on iOS (pending fully shipping; this is a temporary state). + var FabricUIManager = (0, _$$_REQUIRE(_dependencyMap[3], "../ReactNative/FabricUIManager").getFabricUIManager)(); + if (FabricUIManager != null && FabricUIManager.configureNextLayoutAnimation) { + var _global, _global$nativeFabricU; + (_global = global) == null ? void 0 : (_global$nativeFabricU = _global.nativeFabricUIManager) == null ? void 0 : _global$nativeFabricU.configureNextLayoutAnimation(config, onAnimationComplete, onAnimationDidFail != null ? onAnimationDidFail : function () {} /* this will only be called if configuration parsing fails */); + return; + } + + // This will only run if Fabric is *not* installed. + // If you have Fabric + non-Fabric running in the same VM, non-Fabric LayoutAnimations + // will not work. + if (_$$_REQUIRE(_dependencyMap[4], "../ReactNative/UIManager") != null && _$$_REQUIRE(_dependencyMap[4], "../ReactNative/UIManager").configureNextLayoutAnimation) { + _$$_REQUIRE(_dependencyMap[4], "../ReactNative/UIManager").configureNextLayoutAnimation(config, onAnimationComplete != null ? onAnimationComplete : function () {}, onAnimationDidFail != null ? onAnimationDidFail : function () {} /* this should never be called in Non-Fabric */); + } + } + function create(duration, type, property) { + return { + duration: duration, + create: { + type: type, + property: property + }, + update: { + type: type + }, + delete: { + type: type, + property: property + } + }; + } + var Presets = { + easeInEaseOut: create(300, 'easeInEaseOut', 'opacity'), + linear: create(500, 'linear', 'opacity'), + spring: { + duration: 700, + create: { + type: 'linear', + property: 'opacity' + }, + update: { + type: 'spring', + springDamping: 0.4 + }, + delete: { + type: 'linear', + property: 'opacity' + } + } + }; + + /** + * Automatically animates views to their new positions when the + * next layout happens. + * + * A common way to use this API is to call it before calling `setState`. + * + * Note that in order to get this to work on **Android** you need to set the following flags via `UIManager`: + * + * UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true); + */ + var LayoutAnimation = { + /** + * Schedules an animation to happen on the next layout. + * + * @param config Specifies animation properties: + * + * - `duration` in milliseconds + * - `create`, `AnimationConfig` for animating in new views + * - `update`, `AnimationConfig` for animating views that have been updated + * + * @param onAnimationDidEnd Called when the animation finished. + * Only supported on iOS. + * @param onError Called on error. Only supported on iOS. + */ + configureNext: configureNext, + /** + * Helper for creating a config for `configureNext`. + */ + create: create, + Types: Object.freeze({ + spring: 'spring', + linear: 'linear', + easeInEaseOut: 'easeInEaseOut', + easeIn: 'easeIn', + easeOut: 'easeOut', + keyboard: 'keyboard' + }), + Properties: Object.freeze({ + opacity: 'opacity', + scaleX: 'scaleX', + scaleY: 'scaleY', + scaleXY: 'scaleXY' + }), + checkConfig: function checkConfig() { + console.error('LayoutAnimation.checkConfig(...) has been disabled.'); + }, + Presets: Presets, + easeInEaseOut: configureNext.bind(null, Presets.easeInEaseOut), + linear: configureNext.bind(null, Presets.linear), + spring: configureNext.bind(null, Presets.spring), + setEnabled: setEnabled + }; + module.exports = LayoutAnimation; +},389,[6,157,34,58,51],"node_modules\\react-native\\Libraries\\LayoutAnimation\\LayoutAnimation.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('KeyboardObserver'); +},390,[36],"node_modules\\react-native\\Libraries\\Components\\Keyboard\\NativeKeyboardObserver.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.__INTERNAL_VIEW_CONFIG = void 0; + var _codegenNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Utilities/codegenNativeComponent")); /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var nativeComponentName = 'AndroidHorizontalScrollContentView'; + var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = { + uiViewClassName: 'AndroidHorizontalScrollContentView', + validAttributes: { + removeClippedSubviews: true + } + }; + var _default = exports.default = _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/NativeComponent/NativeComponentRegistry").get(nativeComponentName, function () { + return __INTERNAL_VIEW_CONFIG; + }); +},391,[6,276,244],"node_modules\\react-native\\Libraries\\Components\\ScrollView\\AndroidHorizontalScrollContentViewNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.__INTERNAL_VIEW_CONFIG = void 0; + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../NativeComponent/NativeComponentRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = { + uiViewClassName: 'AndroidHorizontalScrollView', + bubblingEventTypes: {}, + directEventTypes: {}, + validAttributes: { + decelerationRate: true, + disableIntervalMomentum: true, + endFillColor: { + process: _$$_REQUIRE(_dependencyMap[1], "../../StyleSheet/processColor").default + }, + fadingEdgeLength: true, + nestedScrollEnabled: true, + overScrollMode: true, + pagingEnabled: true, + persistentScrollbar: true, + scrollEnabled: true, + scrollPerfTag: true, + sendMomentumEvents: true, + showsHorizontalScrollIndicator: true, + snapToAlignment: true, + snapToEnd: true, + snapToInterval: true, + snapToStart: true, + snapToOffsets: true, + contentOffset: true, + borderBottomLeftRadius: true, + borderBottomRightRadius: true, + borderRadius: true, + borderStyle: true, + borderRightColor: { + process: _$$_REQUIRE(_dependencyMap[1], "../../StyleSheet/processColor").default + }, + borderColor: { + process: _$$_REQUIRE(_dependencyMap[1], "../../StyleSheet/processColor").default + }, + borderBottomColor: { + process: _$$_REQUIRE(_dependencyMap[1], "../../StyleSheet/processColor").default + }, + borderTopLeftRadius: true, + borderTopColor: { + process: _$$_REQUIRE(_dependencyMap[1], "../../StyleSheet/processColor").default + }, + removeClippedSubviews: true, + borderTopRightRadius: true, + borderLeftColor: { + process: _$$_REQUIRE(_dependencyMap[1], "../../StyleSheet/processColor").default + }, + pointerEvents: true + } + }; + var AndroidHorizontalScrollViewNativeComponent = NativeComponentRegistry.get('AndroidHorizontalScrollView', function () { + return __INTERNAL_VIEW_CONFIG; + }); + var _default = exports.default = AndroidHorizontalScrollViewNativeComponent; +},392,[244,189],"node_modules\\react-native\\Libraries\\Components\\ScrollView\\AndroidHorizontalScrollViewNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Utilities/Platform")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + function processDecelerationRate(decelerationRate) { + if (decelerationRate === 'normal') { + return _Platform.default.select({ + ios: 0.998, + android: 0.985 + }); + } else if (decelerationRate === 'fast') { + return _Platform.default.select({ + ios: 0.99, + android: 0.9 + }); + } + return decelerationRate; + } + module.exports = processDecelerationRate; +},393,[6,34],"node_modules\\react-native\\Libraries\\Components\\ScrollView\\processDecelerationRate.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.__INTERNAL_VIEW_CONFIG = void 0; + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../NativeComponent/NativeComponentRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = { + uiViewClassName: 'RCTScrollContentView', + bubblingEventTypes: {}, + directEventTypes: {}, + validAttributes: {} + }; + var ScrollContentViewNativeComponent = NativeComponentRegistry.get('RCTScrollContentView', function () { + return __INTERNAL_VIEW_CONFIG; + }); + var _default = exports.default = ScrollContentViewNativeComponent; +},394,[244],"node_modules\\react-native\\Libraries\\Components\\ScrollView\\ScrollContentViewNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _codegenNativeCommands = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Utilities/codegenNativeCommands")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + var _default = exports.default = (0, _codegenNativeCommands.default)({ + supportedCommands: ['flashScrollIndicators', 'scrollTo', 'scrollToEnd', 'zoomToRect'] + }); +},395,[6,265,65],"node_modules\\react-native\\Libraries\\Components\\ScrollView\\ScrollViewCommands.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.VERTICAL = exports.HORIZONTAL = void 0; + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var ScrollViewContext = React.createContext(null); + if (__DEV__) { + ScrollViewContext.displayName = 'ScrollViewContext'; + } + var _default = exports.default = ScrollViewContext; + var HORIZONTAL = exports.HORIZONTAL = Object.freeze({ + horizontal: true + }); + var VERTICAL = exports.VERTICAL = Object.freeze({ + horizontal: false + }); +},396,[65],"node_modules\\react-native\\Libraries\\Components\\ScrollView\\ScrollViewContext.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.__INTERNAL_VIEW_CONFIG = void 0; + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[1], "../../NativeComponent/NativeComponentRegistry")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Utilities/Platform")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = _Platform.default.OS === 'android' ? { + uiViewClassName: 'RCTScrollView', + bubblingEventTypes: {}, + directEventTypes: { + topMomentumScrollBegin: { + registrationName: 'onMomentumScrollBegin' + }, + topMomentumScrollEnd: { + registrationName: 'onMomentumScrollEnd' + }, + topScroll: { + registrationName: 'onScroll' + }, + topScrollBeginDrag: { + registrationName: 'onScrollBeginDrag' + }, + topScrollEndDrag: { + registrationName: 'onScrollEndDrag' + } + }, + validAttributes: { + contentOffset: { + diff: _$$_REQUIRE(_dependencyMap[3], "../../Utilities/differ/pointsDiffer") + }, + decelerationRate: true, + disableIntervalMomentum: true, + pagingEnabled: true, + scrollEnabled: true, + showsVerticalScrollIndicator: true, + snapToAlignment: true, + snapToEnd: true, + snapToInterval: true, + snapToOffsets: true, + snapToStart: true, + borderBottomLeftRadius: true, + borderBottomRightRadius: true, + sendMomentumEvents: true, + borderRadius: true, + nestedScrollEnabled: true, + borderStyle: true, + borderRightColor: { + process: _$$_REQUIRE(_dependencyMap[4], "../../StyleSheet/processColor").default + }, + borderColor: { + process: _$$_REQUIRE(_dependencyMap[4], "../../StyleSheet/processColor").default + }, + borderBottomColor: { + process: _$$_REQUIRE(_dependencyMap[4], "../../StyleSheet/processColor").default + }, + persistentScrollbar: true, + endFillColor: { + process: _$$_REQUIRE(_dependencyMap[4], "../../StyleSheet/processColor").default + }, + fadingEdgeLength: true, + overScrollMode: true, + borderTopLeftRadius: true, + scrollPerfTag: true, + borderTopColor: { + process: _$$_REQUIRE(_dependencyMap[4], "../../StyleSheet/processColor").default + }, + removeClippedSubviews: true, + borderTopRightRadius: true, + borderLeftColor: { + process: _$$_REQUIRE(_dependencyMap[4], "../../StyleSheet/processColor").default + }, + pointerEvents: true, + isInvertedVirtualizedList: true + } + } : { + uiViewClassName: 'RCTScrollView', + bubblingEventTypes: {}, + directEventTypes: { + topMomentumScrollBegin: { + registrationName: 'onMomentumScrollBegin' + }, + topMomentumScrollEnd: { + registrationName: 'onMomentumScrollEnd' + }, + topScroll: { + registrationName: 'onScroll' + }, + topScrollBeginDrag: { + registrationName: 'onScrollBeginDrag' + }, + topScrollEndDrag: { + registrationName: 'onScrollEndDrag' + }, + topScrollToTop: { + registrationName: 'onScrollToTop' + } + }, + validAttributes: Object.assign({ + alwaysBounceHorizontal: true, + alwaysBounceVertical: true, + automaticallyAdjustContentInsets: true, + automaticallyAdjustKeyboardInsets: true, + automaticallyAdjustsScrollIndicatorInsets: true, + bounces: true, + bouncesZoom: true, + canCancelContentTouches: true, + centerContent: true, + contentInset: { + diff: _$$_REQUIRE(_dependencyMap[5], "../../Utilities/differ/insetsDiffer") + }, + contentOffset: { + diff: _$$_REQUIRE(_dependencyMap[3], "../../Utilities/differ/pointsDiffer") + }, + contentInsetAdjustmentBehavior: true, + decelerationRate: true, + directionalLockEnabled: true, + disableIntervalMomentum: true, + indicatorStyle: true, + inverted: true, + keyboardDismissMode: true, + maintainVisibleContentPosition: true, + maximumZoomScale: true, + minimumZoomScale: true, + pagingEnabled: true, + pinchGestureEnabled: true, + scrollEnabled: true, + scrollEventThrottle: true, + scrollIndicatorInsets: { + diff: _$$_REQUIRE(_dependencyMap[5], "../../Utilities/differ/insetsDiffer") + }, + scrollToOverflowEnabled: true, + scrollsToTop: true, + showsHorizontalScrollIndicator: true, + showsVerticalScrollIndicator: true, + snapToAlignment: true, + snapToEnd: true, + snapToInterval: true, + snapToOffsets: true, + snapToStart: true, + zoomScale: true + }, (0, _$$_REQUIRE(_dependencyMap[6], "../../NativeComponent/ViewConfigIgnore").ConditionallyIgnoredEventHandlers)({ + onScrollBeginDrag: true, + onMomentumScrollEnd: true, + onScrollEndDrag: true, + onMomentumScrollBegin: true, + onScrollToTop: true, + onScroll: true + })) + }; + var ScrollViewNativeComponent = NativeComponentRegistry.get('RCTScrollView', function () { + return __INTERNAL_VIEW_CONFIG; + }); + var _default = exports.default = ScrollViewNativeComponent; +},397,[6,244,34,247,189,248,262],"node_modules\\react-native\\Libraries\\Components\\ScrollView\\ScrollViewNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _Animated = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Animated/Animated")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/StyleSheet")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../Utilities/Platform")); + var _useMergeRefs = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../../Utilities/useMergeRefs")); + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6], "react")); + var React = _react; + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[7], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Components\\ScrollView\\ScrollViewStickyHeader.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + var ScrollViewStickyHeaderWithForwardedRef = React.forwardRef(function ScrollViewStickyHeader(props, forwardedRef) { + var inverted = props.inverted, + scrollViewHeight = props.scrollViewHeight, + hiddenOnScroll = props.hiddenOnScroll, + scrollAnimatedValue = props.scrollAnimatedValue, + _nextHeaderLayoutY = props.nextHeaderLayoutY; + var _useState = (0, _react.useState)(false), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + measured = _useState2[0], + setMeasured = _useState2[1]; + var _useState3 = (0, _react.useState)(0), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + layoutY = _useState4[0], + setLayoutY = _useState4[1]; + var _useState5 = (0, _react.useState)(0), + _useState6 = (0, _slicedToArray2.default)(_useState5, 2), + layoutHeight = _useState6[0], + setLayoutHeight = _useState6[1]; + var _useState7 = (0, _react.useState)(null), + _useState8 = (0, _slicedToArray2.default)(_useState7, 2), + translateY = _useState8[0], + setTranslateY = _useState8[1]; + var _useState9 = (0, _react.useState)(_nextHeaderLayoutY), + _useState10 = (0, _slicedToArray2.default)(_useState9, 2), + nextHeaderLayoutY = _useState10[0], + setNextHeaderLayoutY = _useState10[1]; + var _useState11 = (0, _react.useState)(false), + _useState12 = (0, _slicedToArray2.default)(_useState11, 2), + isFabric = _useState12[0], + setIsFabric = _useState12[1]; + var callbackRef = (0, _react.useCallback)(function (ref) { + if (ref == null) { + return; + } + ref.setNextHeaderY = setNextHeaderLayoutY; + setIsFabric((0, _$$_REQUIRE(_dependencyMap[8], "../../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils").isPublicInstance)(ref)); + }, []); + var ref = + // $FlowFixMe[incompatible-type] - Ref is mutated by `callbackRef`. + // $FlowFixMe[incompatible-call] + (0, _useMergeRefs.default)(callbackRef, forwardedRef); + var offset = (0, _react.useMemo)(function () { + return hiddenOnScroll === true ? _Animated.default.diffClamp(scrollAnimatedValue.interpolate({ + extrapolateLeft: 'clamp', + inputRange: [layoutY, layoutY + 1], + outputRange: [0, 1] + }).interpolate({ + inputRange: [0, 1], + outputRange: [0, -1] + }), -layoutHeight, 0) : null; + }, [scrollAnimatedValue, layoutHeight, layoutY, hiddenOnScroll]); + var _useState13 = (0, _react.useState)(function () { + var inputRange = [-1, 0]; + var outputRange = [0, 0]; + var initialTranslateY = scrollAnimatedValue.interpolate({ + inputRange: inputRange, + outputRange: outputRange + }); + if (offset != null) { + return _Animated.default.add(initialTranslateY, offset); + } + return initialTranslateY; + }), + _useState14 = (0, _slicedToArray2.default)(_useState13, 2), + animatedTranslateY = _useState14[0], + setAnimatedTranslateY = _useState14[1]; + var haveReceivedInitialZeroTranslateY = (0, _react.useRef)(true); + var translateYDebounceTimer = (0, _react.useRef)(null); + (0, _react.useEffect)(function () { + if (translateY !== 0 && translateY != null) { + haveReceivedInitialZeroTranslateY.current = false; + } + }, [translateY]); + + // This is called whenever the (Interpolated) Animated Value + // updates, which is several times per frame during scrolling. + // To ensure that the Fabric ShadowTree has the most recent + // translate style of this node, we debounce the value and then + // pass it through to the underlying node during render. + // This is: + // 1. Only an issue in Fabric. + // 2. Worse in Android than iOS. In Android, but not iOS, you + // can touch and move your finger slightly and still trigger + // a "tap" event. In iOS, moving will cancel the tap in + // both Fabric and non-Fabric. On Android when you move + // your finger, the hit-detection moves from the Android + // platform to JS, so we need the ShadowTree to have knowledge + // of the current position. + var animatedValueListener = (0, _react.useCallback)(function (_ref) { + var value = _ref.value; + var debounceTimeout = _Platform.default.OS === 'android' ? 15 : 64; + // When the AnimatedInterpolation is recreated, it always initializes + // to a value of zero and emits a value change of 0 to its listeners. + if (value === 0 && !haveReceivedInitialZeroTranslateY.current) { + haveReceivedInitialZeroTranslateY.current = true; + return; + } + if (translateYDebounceTimer.current != null) { + clearTimeout(translateYDebounceTimer.current); + } + translateYDebounceTimer.current = setTimeout(function () { + return setTranslateY(value); + }, debounceTimeout); + }, []); + (0, _react.useEffect)(function () { + var inputRange = [-1, 0]; + var outputRange = [0, 0]; + if (measured) { + if (inverted === true) { + // The interpolation looks like: + // - Negative scroll: no translation + // - `stickStartPoint` is the point at which the header will start sticking. + // It is calculated using the ScrollView viewport height so it is a the bottom. + // - Headers that are in the initial viewport will never stick, `stickStartPoint` + // will be negative. + // - From 0 to `stickStartPoint` no translation. This will cause the header + // to scroll normally until it reaches the top of the scroll view. + // - From `stickStartPoint` to when the next header y hits the bottom edge of the header: translate + // equally to scroll. This will cause the header to stay at the top of the scroll view. + // - Past the collision with the next header y: no more translation. This will cause the + // header to continue scrolling up and make room for the next sticky header. + // In the case that there is no next header just translate equally to + // scroll indefinitely. + if (scrollViewHeight != null) { + var stickStartPoint = layoutY + layoutHeight - scrollViewHeight; + if (stickStartPoint > 0) { + inputRange.push(stickStartPoint); + outputRange.push(0); + inputRange.push(stickStartPoint + 1); + outputRange.push(1); + // If the next sticky header has not loaded yet (probably windowing) or is the last + // we can just keep it sticked forever. + var collisionPoint = (nextHeaderLayoutY || 0) - layoutHeight - scrollViewHeight; + if (collisionPoint > stickStartPoint) { + inputRange.push(collisionPoint, collisionPoint + 1); + outputRange.push(collisionPoint - stickStartPoint, collisionPoint - stickStartPoint); + } + } + } + } else { + // The interpolation looks like: + // - Negative scroll: no translation + // - From 0 to the y of the header: no translation. This will cause the header + // to scroll normally until it reaches the top of the scroll view. + // - From header y to when the next header y hits the bottom edge of the header: translate + // equally to scroll. This will cause the header to stay at the top of the scroll view. + // - Past the collision with the next header y: no more translation. This will cause the + // header to continue scrolling up and make room for the next sticky header. + // In the case that there is no next header just translate equally to + // scroll indefinitely. + inputRange.push(layoutY); + outputRange.push(0); + // If the next sticky header has not loaded yet (probably windowing) or is the last + // we can just keep it sticked forever. + var _collisionPoint = (nextHeaderLayoutY || 0) - layoutHeight; + if (_collisionPoint >= layoutY) { + inputRange.push(_collisionPoint, _collisionPoint + 1); + outputRange.push(_collisionPoint - layoutY, _collisionPoint - layoutY); + } else { + inputRange.push(layoutY + 1); + outputRange.push(1); + } + } + } + var newAnimatedTranslateY = scrollAnimatedValue.interpolate({ + inputRange: inputRange, + outputRange: outputRange + }); + if (offset != null) { + newAnimatedTranslateY = _Animated.default.add(newAnimatedTranslateY, offset); + } + + // add the event listener + var animatedListenerId; + if (isFabric) { + animatedListenerId = newAnimatedTranslateY.addListener(animatedValueListener); + } + setAnimatedTranslateY(newAnimatedTranslateY); + + // clean up the event listener and timer + return function () { + if (animatedListenerId) { + newAnimatedTranslateY.removeListener(animatedListenerId); + } + if (translateYDebounceTimer.current != null) { + clearTimeout(translateYDebounceTimer.current); + } + }; + }, [nextHeaderLayoutY, measured, layoutHeight, layoutY, scrollViewHeight, scrollAnimatedValue, inverted, offset, animatedValueListener, isFabric]); + var _onLayout = function _onLayout(event) { + setLayoutY(event.nativeEvent.layout.y); + setLayoutHeight(event.nativeEvent.layout.height); + setMeasured(true); + props.onLayout(event); + var child = React.Children.only(props.children); + if (child.props.onLayout) { + child.props.onLayout(event); + } + }; + var child = React.Children.only(props.children); + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, { + collapsable: false, + nativeID: props.nativeID, + onLayout: _onLayout, + ref: ref, + style: [child.props.style, styles.header, { + transform: [{ + translateY: animatedTranslateY + }] + }], + children: React.cloneElement(child, { + style: styles.fill, + // We transfer the child style to the wrapper. + onLayout: undefined // we call this manually through our this._onLayout + }) + }); + }); + var styles = _StyleSheet.default.create({ + header: { + zIndex: 10, + position: 'relative' + }, + fill: { + flex: 1 + } + }); + var _default = exports.default = ScrollViewStickyHeaderWithForwardedRef; +},398,[6,7,399,266,34,373,65,106,376],"node_modules\\react-native\\Libraries\\Components\\ScrollView\\ScrollViewStickyHeader.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../Utilities/Platform")); + var _AnimatedImplementation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "./AnimatedImplementation")); + var _AnimatedMock = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "./AnimatedMock")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var Animated = _Platform.default.isDisableAnimations ? _AnimatedMock.default : _AnimatedImplementation.default; + var _default = exports.default = Object.assign({ + get FlatList() { + return _$$_REQUIRE(_dependencyMap[4], "./components/AnimatedFlatList").default; + }, + get Image() { + return _$$_REQUIRE(_dependencyMap[5], "./components/AnimatedImage").default; + }, + get ScrollView() { + return _$$_REQUIRE(_dependencyMap[6], "./components/AnimatedScrollView").default; + }, + get SectionList() { + return _$$_REQUIRE(_dependencyMap[7], "./components/AnimatedSectionList").default; + }, + get Text() { + return _$$_REQUIRE(_dependencyMap[8], "./components/AnimatedText").default; + }, + get View() { + return _$$_REQUIRE(_dependencyMap[9], "./components/AnimatedView").default; + } + }, Animated); +},399,[6,34,347,400,401,420,429,433,435,436],"node_modules\\react-native\\Libraries\\Animated\\Animated.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _AnimatedImplementation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./AnimatedImplementation")); + var _createAnimatedComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "./createAnimatedComponent")); + var _AnimatedColor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "./nodes/AnimatedColor")); + var _AnimatedInterpolation = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "./nodes/AnimatedInterpolation")); + var _AnimatedNode = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "./nodes/AnimatedNode")); + var _AnimatedValue = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./nodes/AnimatedValue")); + var _AnimatedValueXY = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./nodes/AnimatedValueXY")); + /** + * Animations are a source of flakiness in snapshot testing. This mock replaces + * animation functions from AnimatedImplementation with empty animations for + * predictability in tests. When possible the animation will run immediately + * to the final state. + */ + + // Prevent any callback invocation from recursively triggering another + // callback, which may trigger another animation + var inAnimationCallback = false; + function mockAnimationStart(start) { + return function (callback) { + var guardedCallback = callback == null ? callback : function () { + if (inAnimationCallback) { + console.warn('Ignoring recursive animation callback when running mock animations'); + return; + } + inAnimationCallback = true; + try { + callback.apply(void 0, arguments); + } finally { + inAnimationCallback = false; + } + }; + start(guardedCallback); + }; + } + var emptyAnimation = { + start: function start() {}, + stop: function stop() {}, + reset: function reset() {}, + _startNativeLoop: function _startNativeLoop() {}, + _isUsingNativeDriver: function _isUsingNativeDriver() { + return false; + } + }; + var mockCompositeAnimation = function mockCompositeAnimation(animations) { + return Object.assign({}, emptyAnimation, { + start: mockAnimationStart(function (callback) { + animations.forEach(function (animation) { + return animation.start(); + }); + callback == null ? void 0 : callback({ + finished: true + }); + }) + }); + }; + var spring = function spring(value, config) { + var anyValue = value; + return Object.assign({}, emptyAnimation, { + start: mockAnimationStart(function (callback) { + anyValue.setValue(config.toValue); + callback == null ? void 0 : callback({ + finished: true + }); + }) + }); + }; + var timing = function timing(value, config) { + var anyValue = value; + return Object.assign({}, emptyAnimation, { + start: mockAnimationStart(function (callback) { + anyValue.setValue(config.toValue); + callback == null ? void 0 : callback({ + finished: true + }); + }) + }); + }; + var decay = function decay(value, config) { + return emptyAnimation; + }; + var sequence = function sequence(animations) { + return mockCompositeAnimation(animations); + }; + var parallel = function parallel(animations, config) { + return mockCompositeAnimation(animations); + }; + var delay = function delay(time) { + return emptyAnimation; + }; + var stagger = function stagger(time, animations) { + return mockCompositeAnimation(animations); + }; + var loop = function loop(animation) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$iterations = _ref.iterations, + iterations = _ref$iterations === void 0 ? -1 : _ref$iterations; + return emptyAnimation; + }; + var _default = exports.default = { + Value: _AnimatedValue.default, + ValueXY: _AnimatedValueXY.default, + Color: _AnimatedColor.default, + Interpolation: _AnimatedInterpolation.default, + Node: _AnimatedNode.default, + decay: decay, + timing: timing, + spring: spring, + add: _AnimatedImplementation.default.add, + subtract: _AnimatedImplementation.default.subtract, + divide: _AnimatedImplementation.default.divide, + multiply: _AnimatedImplementation.default.multiply, + modulo: _AnimatedImplementation.default.modulo, + diffClamp: _AnimatedImplementation.default.diffClamp, + delay: delay, + sequence: sequence, + parallel: parallel, + stagger: stagger, + loop: loop, + event: _AnimatedImplementation.default.event, + createAnimatedComponent: _createAnimatedComponent.default, + attachNativeEvent: _$$_REQUIRE(_dependencyMap[8], "./AnimatedEvent").attachNativeEvent, + forkEvent: _AnimatedImplementation.default.forkEvent, + unforkEvent: _AnimatedImplementation.default.unforkEvent, + Event: _$$_REQUIRE(_dependencyMap[8], "./AnimatedEvent").AnimatedEvent + }; +},400,[6,347,372,354,358,362,355,368,367],"node_modules\\react-native\\Libraries\\Animated\\AnimatedMock.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _FlatList = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Lists/FlatList")); + var _createAnimatedComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../createAnimatedComponent")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[4], "react/jsx-runtime"); + var _this = this, + _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Animated\\components\\AnimatedFlatList.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + /** + * @see https://github.com/facebook/react-native/commit/b8c8562 + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + var FlatListWithEventThrottle = React.forwardRef( + // $FlowFixMe[incompatible-call] + function (props, ref) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FlatList.default, Object.assign({}, props, { + ref: ref + })); + }); + var _default = exports.default = (0, _createAnimatedComponent.default)(FlatListWithEventThrottle); +},401,[6,402,372,65,106],"node_modules\\react-native\\Libraries\\Animated\\components\\AnimatedFlatList.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _objectWithoutProperties2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/objectWithoutProperties")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _memoizeOne = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "memoize-one")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[8], "react/jsx-runtime"); + var _excluded = ["numColumns", "columnWrapperStyle", "removeClippedSubviews", "strictMode"]; + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Lists\\FlatList.js"; + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var React = _$$_REQUIRE(_dependencyMap[9], "react"); + /** + * Default Props Helper Functions + * Use the following helper functions for default values + */ + + // removeClippedSubviewsOrDefault(this.props.removeClippedSubviews) + function removeClippedSubviewsOrDefault(removeClippedSubviews) { + return removeClippedSubviews != null ? removeClippedSubviews : "android" === 'android'; + } + + // numColumnsOrDefault(this.props.numColumns) + function numColumnsOrDefault(numColumns) { + return numColumns != null ? numColumns : 1; + } + function isArrayLike(data) { + // $FlowExpectedError[incompatible-use] + return typeof Object(data).length === 'number'; + } + /** + * A performant interface for rendering simple, flat lists, supporting the most handy features: + * + * - Fully cross-platform. + * - Optional horizontal mode. + * - Configurable viewability callbacks. + * - Header support. + * - Footer support. + * - Separator support. + * - Pull to Refresh. + * - Scroll loading. + * - ScrollToIndex support. + * + * If you need section support, use [``](docs/sectionlist.html). + * + * Minimal Example: + * + * {item.key}} + * /> + * + * More complex, multi-select example demonstrating `PureComponent` usage for perf optimization and avoiding bugs. + * + * - By binding the `onPressItem` handler, the props will remain `===` and `PureComponent` will + * prevent wasteful re-renders unless the actual `id`, `selected`, or `title` props change, even + * if the components rendered in `MyListItem` did not have such optimizations. + * - By passing `extraData={this.state}` to `FlatList` we make sure `FlatList` itself will re-render + * when the `state.selected` changes. Without setting this prop, `FlatList` would not know it + * needs to re-render any items because it is also a `PureComponent` and the prop comparison will + * not show any changes. + * - `keyExtractor` tells the list to use the `id`s for the react keys instead of the default `key` property. + * + * + * class MyListItem extends React.PureComponent { + * _onPress = () => { + * this.props.onPressItem(this.props.id); + * }; + * + * render() { + * const textColor = this.props.selected ? "red" : "black"; + * return ( + * + * + * + * {this.props.title} + * + * + * + * ); + * } + * } + * + * class MultiSelectList extends React.PureComponent { + * state = {selected: (new Map(): Map)}; + * + * _keyExtractor = (item, index) => item.id; + * + * _onPressItem = (id: string) => { + * // updater functions are preferred for transactional updates + * this.setState((state) => { + * // copy the map rather than modifying state. + * const selected = new Map(state.selected); + * selected.set(id, !selected.get(id)); // toggle + * return {selected}; + * }); + * }; + * + * _renderItem = ({item}) => ( + * + * ); + * + * render() { + * return ( + * + * ); + * } + * } + * + * This is a convenience wrapper around [``](docs/virtualizedlist.html), + * and thus inherits its props (as well as those of `ScrollView`) that aren't explicitly listed + * here, along with the following caveats: + * + * - Internal state is not preserved when content scrolls out of the render window. Make sure all + * your data is captured in the item data or external stores like Flux, Redux, or Relay. + * - This is a `PureComponent` which means that it will not re-render if `props` remain shallow- + * equal. Make sure that everything your `renderItem` function depends on is passed as a prop + * (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on + * changes. This includes the `data` prop and parent component state. + * - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously + * offscreen. This means it's possible to scroll faster than the fill rate ands momentarily see + * blank content. This is a tradeoff that can be adjusted to suit the needs of each application, + * and we are working on improving it behind the scenes. + * - By default, the list looks for a `key` prop on each item and uses that for the React key. + * Alternatively, you can provide a custom `keyExtractor` prop. + * + * Also inherits [ScrollView Props](docs/scrollview.html#props), unless it is nested in another FlatList of same orientation. + */ + var FlatList = /*#__PURE__*/function (_React$PureComponent) { + function FlatList(_props) { + var _this; + (0, _classCallCheck2.default)(this, FlatList); + _this = _callSuper(this, FlatList, [_props]); + _this._virtualizedListPairs = []; + _this._captureRef = function (ref) { + _this._listRef = ref; + }; + _this._getItem = function (data, index) { + var numColumns = numColumnsOrDefault(_this.props.numColumns); + if (numColumns > 1) { + var ret = []; + for (var kk = 0; kk < numColumns; kk++) { + var itemIndex = index * numColumns + kk; + if (itemIndex < data.length) { + var _item = data[itemIndex]; + ret.push(_item); + } + } + return ret; + } else { + return data[index]; + } + }; + _this._getItemCount = function (data) { + // Legacy behavior of FlatList was to forward "undefined" length if invalid + // data like a non-arraylike object is passed. VirtualizedList would then + // coerce this, and the math would work out to no-op. For compatibility, if + // invalid data is passed, we tell VirtualizedList there are zero items + // available to prevent it from trying to read from the invalid data + // (without propagating invalidly typed data). + if (data != null && isArrayLike(data)) { + var numColumns = numColumnsOrDefault(_this.props.numColumns); + return numColumns > 1 ? Math.ceil(data.length / numColumns) : data.length; + } else { + return 0; + } + }; + _this._keyExtractor = function (items, index) { + var _this$props$keyExtrac; + var numColumns = numColumnsOrDefault(_this.props.numColumns); + var keyExtractor = (_this$props$keyExtrac = _this.props.keyExtractor) != null ? _this$props$keyExtrac : _$$_REQUIRE(_dependencyMap[10], "@react-native/virtualized-lists").keyExtractor; + if (numColumns > 1) { + _$$_REQUIRE(_dependencyMap[11], "invariant")(Array.isArray(items), 'FlatList: Encountered internal consistency error, expected each item to consist of an ' + 'array with 1-%s columns; instead, received a single item.', numColumns); + return items.map(function (item, kk) { + return keyExtractor(item, index * numColumns + kk); + }).join(':'); + } + + // $FlowFixMe[incompatible-call] Can't call keyExtractor with an array + return keyExtractor(items, index); + }; + _this._renderer = function (ListItemComponent, renderItem, columnWrapperStyle, numColumns, extraData + // $FlowFixMe[missing-local-annot] + ) { + var cols = numColumnsOrDefault(numColumns); + var render = function render(props) { + if (ListItemComponent) { + // $FlowFixMe[not-a-component] Component isn't valid + // $FlowFixMe[incompatible-type-arg] Component isn't valid + // $FlowFixMe[incompatible-return] Component isn't valid + return /*#__PURE__*/(0, _jsxRuntime.jsx)(ListItemComponent, Object.assign({}, props)); + } else if (renderItem) { + // $FlowFixMe[incompatible-call] + return renderItem(props); + } else { + return null; + } + }; + var renderProp = function renderProp(info) { + if (cols > 1) { + var _item2 = info.item, + _index = info.index; + _$$_REQUIRE(_dependencyMap[11], "invariant")(Array.isArray(_item2), 'Expected array of items with numColumns > 1'); + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[12], "../Components/View/View"), { + style: _$$_REQUIRE(_dependencyMap[13], "../StyleSheet/StyleSheet").compose(styles.row, columnWrapperStyle), + children: _item2.map(function (it, kk) { + var element = render({ + // $FlowFixMe[incompatible-call] + item: it, + index: _index * cols + kk, + separators: info.separators + }); + return element != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, { + children: element + }, kk) : null; + }) + }); + } else { + return render(info); + } + }; + return ListItemComponent ? { + ListItemComponent: renderProp + } : { + renderItem: renderProp + }; + }; + // $FlowFixMe[missing-local-annot] + _this._memoizedRenderer = (0, _memoizeOne.default)(_this._renderer); + _this._checkProps(_this.props); + if (_this.props.viewabilityConfigCallbackPairs) { + _this._virtualizedListPairs = _this.props.viewabilityConfigCallbackPairs.map(function (pair) { + return { + viewabilityConfig: pair.viewabilityConfig, + onViewableItemsChanged: _this._createOnViewableItemsChanged(pair.onViewableItemsChanged) + }; + }); + } else if (_this.props.onViewableItemsChanged) { + _this._virtualizedListPairs.push({ + /* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This + * comment suppresses an error found when Flow v0.63 was deployed. To + * see the error delete this comment and run Flow. */ + viewabilityConfig: _this.props.viewabilityConfig, + onViewableItemsChanged: _this._createOnViewableItemsChanged( + // NOTE: we use a wrapper function to allow the actual callback to change + // while still keeping the function provided to native to be stable + function () { + var _this$props; + _$$_REQUIRE(_dependencyMap[11], "invariant")(_this.props.onViewableItemsChanged, 'Changing the nullability of onViewableItemsChanged is not supported. ' + 'Once a function or null is supplied that cannot be changed.'); + return (_this$props = _this.props).onViewableItemsChanged.apply(_this$props, arguments); + }) + }); + } + return _this; + } + + // $FlowFixMe[missing-local-annot] + (0, _inherits2.default)(FlatList, _React$PureComponent); + return (0, _createClass2.default)(FlatList, [{ + key: "scrollToEnd", + value: + /** + * Scrolls to the end of the content. May be janky without `getItemLayout` prop. + */ + function scrollToEnd(params) { + if (this._listRef) { + this._listRef.scrollToEnd(params); + } + } + + /** + * Scrolls to the item at the specified index such that it is positioned in the viewable area + * such that `viewPosition` 0 places it at the top, 1 at the bottom, and 0.5 centered in the + * middle. `viewOffset` is a fixed number of pixels to offset the final target position. + * + * Note: cannot scroll to locations outside the render window without specifying the + * `getItemLayout` prop. + */ + }, { + key: "scrollToIndex", + value: function scrollToIndex(params) { + if (this._listRef) { + this._listRef.scrollToIndex(params); + } + } + + /** + * Requires linear scan through data - use `scrollToIndex` instead if possible. + * + * Note: cannot scroll to locations outside the render window without specifying the + * `getItemLayout` prop. + */ + }, { + key: "scrollToItem", + value: function scrollToItem(params) { + if (this._listRef) { + this._listRef.scrollToItem(params); + } + } + + /** + * Scroll to a specific content pixel offset in the list. + * + * Check out [scrollToOffset](docs/virtualizedlist.html#scrolltooffset) of VirtualizedList + */ + }, { + key: "scrollToOffset", + value: function scrollToOffset(params) { + if (this._listRef) { + this._listRef.scrollToOffset(params); + } + } + + /** + * Tells the list an interaction has occurred, which should trigger viewability calculations, e.g. + * if `waitForInteractions` is true and the user has not scrolled. This is typically called by + * taps on items or by navigation actions. + */ + }, { + key: "recordInteraction", + value: function recordInteraction() { + if (this._listRef) { + this._listRef.recordInteraction(); + } + } + + /** + * Displays the scroll indicators momentarily. + * + * @platform ios + */ + }, { + key: "flashScrollIndicators", + value: function flashScrollIndicators() { + if (this._listRef) { + this._listRef.flashScrollIndicators(); + } + } + + /** + * Provides a handle to the underlying scroll responder. + */ + }, { + key: "getScrollResponder", + value: function getScrollResponder() { + if (this._listRef) { + return this._listRef.getScrollResponder(); + } + } + + /** + * Provides a reference to the underlying host component + */ + }, { + key: "getNativeScrollRef", + value: function getNativeScrollRef() { + if (this._listRef) { + /* $FlowFixMe[incompatible-return] Suppresses errors found when fixing + * TextInput typing */ + return this._listRef.getScrollRef(); + } + } + }, { + key: "getScrollableNode", + value: function getScrollableNode() { + if (this._listRef) { + return this._listRef.getScrollableNode(); + } + } + }, { + key: "setNativeProps", + value: function setNativeProps(props) { + if (this._listRef) { + this._listRef.setNativeProps(props); + } + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + _$$_REQUIRE(_dependencyMap[11], "invariant")(prevProps.numColumns === this.props.numColumns, 'Changing numColumns on the fly is not supported. Change the key prop on FlatList when ' + 'changing the number of columns to force a fresh render of the component.'); + _$$_REQUIRE(_dependencyMap[11], "invariant")(prevProps.onViewableItemsChanged == null === (this.props.onViewableItemsChanged == null), 'Changing onViewableItemsChanged nullability on the fly is not supported'); + _$$_REQUIRE(_dependencyMap[11], "invariant")(!_$$_REQUIRE(_dependencyMap[14], "../Utilities/differ/deepDiffer")(prevProps.viewabilityConfig, this.props.viewabilityConfig), 'Changing viewabilityConfig on the fly is not supported'); + _$$_REQUIRE(_dependencyMap[11], "invariant")(prevProps.viewabilityConfigCallbackPairs === this.props.viewabilityConfigCallbackPairs, 'Changing viewabilityConfigCallbackPairs on the fly is not supported'); + this._checkProps(this.props); + } + }, { + key: "_checkProps", + value: + // $FlowFixMe[missing-local-annot] + function _checkProps(props) { + var getItem = props.getItem, + getItemCount = props.getItemCount, + horizontal = props.horizontal, + columnWrapperStyle = props.columnWrapperStyle, + onViewableItemsChanged = props.onViewableItemsChanged, + viewabilityConfigCallbackPairs = props.viewabilityConfigCallbackPairs; + var numColumns = numColumnsOrDefault(this.props.numColumns); + _$$_REQUIRE(_dependencyMap[11], "invariant")(!getItem && !getItemCount, 'FlatList does not support custom data formats.'); + if (numColumns > 1) { + _$$_REQUIRE(_dependencyMap[11], "invariant")(!horizontal, 'numColumns does not support horizontal.'); + } else { + _$$_REQUIRE(_dependencyMap[11], "invariant")(!columnWrapperStyle, 'columnWrapperStyle not supported for single column lists'); + } + _$$_REQUIRE(_dependencyMap[11], "invariant")(!(onViewableItemsChanged && viewabilityConfigCallbackPairs), 'FlatList does not support setting both onViewableItemsChanged and ' + 'viewabilityConfigCallbackPairs.'); + } + }, { + key: "_pushMultiColumnViewable", + value: function _pushMultiColumnViewable(arr, v) { + var _this$props$keyExtrac2; + var numColumns = numColumnsOrDefault(this.props.numColumns); + var keyExtractor = (_this$props$keyExtrac2 = this.props.keyExtractor) != null ? _this$props$keyExtrac2 : _$$_REQUIRE(_dependencyMap[10], "@react-native/virtualized-lists").keyExtractor; + v.item.forEach(function (item, ii) { + _$$_REQUIRE(_dependencyMap[11], "invariant")(v.index != null, 'Missing index!'); + var index = v.index * numColumns + ii; + arr.push(Object.assign({}, v, { + item: item, + key: keyExtractor(item, index), + index: index + })); + }); + } + }, { + key: "_createOnViewableItemsChanged", + value: function _createOnViewableItemsChanged(onViewableItemsChanged + // $FlowFixMe[missing-local-annot] + ) { + var _this2 = this; + return function (info) { + var numColumns = numColumnsOrDefault(_this2.props.numColumns); + if (onViewableItemsChanged) { + if (numColumns > 1) { + var changed = []; + var viewableItems = []; + info.viewableItems.forEach(function (v) { + return _this2._pushMultiColumnViewable(viewableItems, v); + }); + info.changed.forEach(function (v) { + return _this2._pushMultiColumnViewable(changed, v); + }); + onViewableItemsChanged({ + viewableItems: viewableItems, + changed: changed + }); + } else { + onViewableItemsChanged(info); + } + } + }; + } + }, { + key: "render", + value: function render() { + var _this$props2 = this.props, + numColumns = _this$props2.numColumns, + columnWrapperStyle = _this$props2.columnWrapperStyle, + _removeClippedSubviews = _this$props2.removeClippedSubviews, + _this$props2$strictMo = _this$props2.strictMode, + strictMode = _this$props2$strictMo === void 0 ? false : _this$props2$strictMo, + restProps = (0, _objectWithoutProperties2.default)(_this$props2, _excluded); + var renderer = strictMode ? this._memoizedRenderer : this._renderer; + return ( + /*#__PURE__*/ + // $FlowFixMe[incompatible-exact] - `restProps` (`Props`) is inexact. + (0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[10], "@react-native/virtualized-lists").VirtualizedList, Object.assign({}, restProps, { + getItem: this._getItem, + getItemCount: this._getItemCount, + keyExtractor: this._keyExtractor, + ref: this._captureRef, + viewabilityConfigCallbackPairs: this._virtualizedListPairs, + removeClippedSubviews: removeClippedSubviewsOrDefault(_removeClippedSubviews) + }, renderer(this.props.ListItemComponent, this.props.renderItem, columnWrapperStyle, numColumns, this.props.extraData))) + ); + } + }]); + }(React.PureComponent); + var styles = _$$_REQUIRE(_dependencyMap[13], "../StyleSheet/StyleSheet").create({ + row: { + flexDirection: 'row' + } + }); + module.exports = FlatList; +},402,[6,166,18,19,23,25,28,403,106,65,404,37,241,266,285],"node_modules\\react-native\\Libraries\\Lists\\FlatList.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var safeIsNaN = Number.isNaN || function ponyfill(value) { + return typeof value === 'number' && value !== value; + }; + function isEqual(first, second) { + if (first === second) { + return true; + } + if (safeIsNaN(first) && safeIsNaN(second)) { + return true; + } + return false; + } + function areInputsEqual(newInputs, lastInputs) { + if (newInputs.length !== lastInputs.length) { + return false; + } + for (var i = 0; i < newInputs.length; i++) { + if (!isEqual(newInputs[i], lastInputs[i])) { + return false; + } + } + return true; + } + function memoizeOne(resultFn, isEqual) { + if (isEqual === void 0) { + isEqual = areInputsEqual; + } + var lastThis; + var lastArgs = []; + var lastResult; + var calledOnce = false; + function memoized() { + var newArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + newArgs[_i] = arguments[_i]; + } + if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) { + return lastResult; + } + lastResult = resultFn.apply(this, newArgs); + calledOnce = true; + lastThis = this; + lastArgs = newArgs; + return lastResult; + } + return memoized; + } + module.exports = memoizeOne; +},403,[],"node_modules\\memoize-one\\dist\\memoize-one.cjs.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + module.exports = { + keyExtractor: _$$_REQUIRE(_dependencyMap[0], "./Lists/VirtualizeUtils").keyExtractor, + get VirtualizedList() { + return _$$_REQUIRE(_dependencyMap[1], "./Lists/VirtualizedList"); + }, + get VirtualizedSectionList() { + return _$$_REQUIRE(_dependencyMap[2], "./Lists/VirtualizedSectionList"); + }, + get VirtualizedListContextResetter() { + var VirtualizedListContext = _$$_REQUIRE(_dependencyMap[3], "./Lists/VirtualizedListContext"); + return VirtualizedListContext.VirtualizedListContextResetter; + }, + get ViewabilityHelper() { + return _$$_REQUIRE(_dependencyMap[4], "./Lists/ViewabilityHelper"); + }, + get FillRateHelper() { + return _$$_REQUIRE(_dependencyMap[5], "./Lists/FillRateHelper"); + } + }; +},404,[405,406,419,416,414,411],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.computeWindowedRenderLimits = computeWindowedRenderLimits; + exports.elementsThatOverlapOffsets = elementsThatOverlapOffsets; + exports.keyExtractor = keyExtractor; + exports.newRangeCount = newRangeCount; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + /** + * Used to find the indices of the frames that overlap the given offsets. Useful for finding the + * items that bound different windows of content, such as the visible area or the buffered overscan + * area. + */ + function elementsThatOverlapOffsets(offsets, props, listMetrics) { + var zoomScale = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; + var itemCount = props.getItemCount(props.data); + var result = []; + for (var offsetIndex = 0; offsetIndex < offsets.length; offsetIndex++) { + var currentOffset = offsets[offsetIndex]; + var left = 0; + var right = itemCount - 1; + while (left <= right) { + var mid = left + Math.floor((right - left) / 2); + var frame = listMetrics.getCellMetricsApprox(mid, props); + var scaledOffsetStart = frame.offset * zoomScale; + var scaledOffsetEnd = (frame.offset + frame.length) * zoomScale; + + // We want the first frame that contains the offset, with inclusive bounds. Thus, for the + // first frame the scaledOffsetStart is inclusive, while for other frames it is exclusive. + if (mid === 0 && currentOffset < scaledOffsetStart || mid !== 0 && currentOffset <= scaledOffsetStart) { + right = mid - 1; + } else if (currentOffset > scaledOffsetEnd) { + left = mid + 1; + } else { + result[offsetIndex] = mid; + break; + } + } + } + return result; + } + + /** + * Computes the number of elements in the `next` range that are new compared to the `prev` range. + * Handy for calculating how many new items will be rendered when the render window changes so we + * can restrict the number of new items render at once so that content can appear on the screen + * faster. + */ + function newRangeCount(prev, next) { + return next.last - next.first + 1 - Math.max(0, 1 + Math.min(next.last, prev.last) - Math.max(next.first, prev.first)); + } + + /** + * Custom logic for determining which items should be rendered given the current frame and scroll + * metrics, as well as the previous render state. The algorithm may evolve over time, but generally + * prioritizes the visible area first, then expands that with overscan regions ahead and behind, + * biased in the direction of scroll. + */ + function computeWindowedRenderLimits(props, maxToRenderPerBatch, windowSize, prev, listMetrics, scrollMetrics) { + var itemCount = props.getItemCount(props.data); + if (itemCount === 0) { + return { + first: 0, + last: -1 + }; + } + var offset = scrollMetrics.offset, + velocity = scrollMetrics.velocity, + visibleLength = scrollMetrics.visibleLength, + _scrollMetrics$zoomSc = scrollMetrics.zoomScale, + zoomScale = _scrollMetrics$zoomSc === void 0 ? 1 : _scrollMetrics$zoomSc; + + // Start with visible area, then compute maximum overscan region by expanding from there, biased + // in the direction of scroll. Total overscan area is capped, which should cap memory consumption + // too. + var visibleBegin = Math.max(0, offset); + var visibleEnd = visibleBegin + visibleLength; + var overscanLength = (windowSize - 1) * visibleLength; + + // Considering velocity seems to introduce more churn than it's worth. + var leadFactor = 0.5; // Math.max(0, Math.min(1, velocity / 25 + 0.5)); + + var fillPreference = velocity > 1 ? 'after' : velocity < -1 ? 'before' : 'none'; + var overscanBegin = Math.max(0, visibleBegin - (1 - leadFactor) * overscanLength); + var overscanEnd = Math.max(0, visibleEnd + leadFactor * overscanLength); + var lastItemOffset = listMetrics.getCellMetricsApprox(itemCount - 1, props).offset * zoomScale; + if (lastItemOffset < overscanBegin) { + // Entire list is before our overscan window + return { + first: Math.max(0, itemCount - 1 - maxToRenderPerBatch), + last: itemCount - 1 + }; + } + + // Find the indices that correspond to the items at the render boundaries we're targeting. + var _elementsThatOverlapO = elementsThatOverlapOffsets([overscanBegin, visibleBegin, visibleEnd, overscanEnd], props, listMetrics, zoomScale), + _elementsThatOverlapO2 = (0, _slicedToArray2.default)(_elementsThatOverlapO, 4), + overscanFirst = _elementsThatOverlapO2[0], + first = _elementsThatOverlapO2[1], + last = _elementsThatOverlapO2[2], + overscanLast = _elementsThatOverlapO2[3]; + overscanFirst = overscanFirst == null ? 0 : overscanFirst; + first = first == null ? Math.max(0, overscanFirst) : first; + overscanLast = overscanLast == null ? itemCount - 1 : overscanLast; + last = last == null ? Math.min(overscanLast, first + maxToRenderPerBatch - 1) : last; + var visible = { + first: first, + last: last + }; + + // We want to limit the number of new cells we're rendering per batch so that we can fill the + // content on the screen quickly. If we rendered the entire overscan window at once, the user + // could be staring at white space for a long time waiting for a bunch of offscreen content to + // render. + var newCellCount = newRangeCount(prev, visible); + while (true) { + if (first <= overscanFirst && last >= overscanLast) { + // If we fill the entire overscan range, we're done. + break; + } + var maxNewCells = newCellCount >= maxToRenderPerBatch; + var firstWillAddMore = first <= prev.first || first > prev.last; + var firstShouldIncrement = first > overscanFirst && (!maxNewCells || !firstWillAddMore); + var lastWillAddMore = last >= prev.last || last < prev.first; + var lastShouldIncrement = last < overscanLast && (!maxNewCells || !lastWillAddMore); + if (maxNewCells && !firstShouldIncrement && !lastShouldIncrement) { + // We only want to stop if we've hit maxNewCells AND we cannot increment first or last + // without rendering new items. This let's us preserve as many already rendered items as + // possible, reducing render churn and keeping the rendered overscan range as large as + // possible. + break; + } + if (firstShouldIncrement && !(fillPreference === 'after' && lastShouldIncrement && lastWillAddMore)) { + if (firstWillAddMore) { + newCellCount++; + } + first--; + } + if (lastShouldIncrement && !(fillPreference === 'before' && firstShouldIncrement && firstWillAddMore)) { + if (lastWillAddMore) { + newCellCount++; + } + last++; + } + } + if (!(last >= first && first >= 0 && last < itemCount && first >= overscanFirst && last <= overscanLast && first <= visible.first && last >= visible.last)) { + throw new Error('Bad window calculation ' + JSON.stringify({ + first: first, + last: last, + itemCount: itemCount, + overscanFirst: overscanFirst, + overscanLast: overscanLast, + visible: visible + })); + } + return { + first: first, + last: last + }; + } + function keyExtractor(item, index) { + if (typeof item === 'object' && (item == null ? void 0 : item.key) != null) { + return item.key; + } + if (typeof item === 'object' && (item == null ? void 0 : item.id) != null) { + return item.id; + } + return String(index); + } +},405,[6,7],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\VirtualizeUtils.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _toConsumableArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/toConsumableArray")); + var _defineProperty2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/defineProperty")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "@babel/runtime/helpers/inherits")); + var _reactNative = _$$_REQUIRE(_dependencyMap[8], "react-native"); + var _Batchinator = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "../Interaction/Batchinator")); + var _clamp = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "../Utilities/clamp")); + var _infoLog = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[11], "../Utilities/infoLog")); + var _ChildListCollection = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[12], "./ChildListCollection")); + var _FillRateHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[13], "./FillRateHelper")); + var _ListMetricsAggregator = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[14], "./ListMetricsAggregator")); + var _StateSafePureComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[15], "./StateSafePureComponent")); + var _ViewabilityHelper = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[16], "./ViewabilityHelper")); + var _VirtualizedListCellRenderer = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[17], "./VirtualizedListCellRenderer")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[18], "invariant")); + var _nullthrows = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[19], "nullthrows")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[20], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[21], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\VirtualizedList.js"; + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var ON_EDGE_REACHED_EPSILON = 0.001; + var _usedIndexForKey = false; + var _keylessItemComponentName = ''; + function getScrollingThreshold(threshold, visibleLength) { + return threshold * visibleLength / 2; + } + + /** + * Base implementation for the more convenient [``](https://reactnative.dev/docs/flatlist) + * and [``](https://reactnative.dev/docs/sectionlist) components, which are also better + * documented. In general, this should only really be used if you need more flexibility than + * `FlatList` provides, e.g. for use with immutable data instead of plain arrays. + * + * Virtualization massively improves memory consumption and performance of large lists by + * maintaining a finite render window of active items and replacing all items outside of the render + * window with appropriately sized blank space. The window adapts to scrolling behavior, and items + * are rendered incrementally with low-pri (after any running interactions) if they are far from the + * visible area, or with hi-pri otherwise to minimize the potential of seeing blank space. + * + * Some caveats: + * + * - Internal state is not preserved when content scrolls out of the render window. Make sure all + * your data is captured in the item data or external stores like Flux, Redux, or Relay. + * - This is a `PureComponent` which means that it will not re-render if `props` remain shallow- + * equal. Make sure that everything your `renderItem` function depends on is passed as a prop + * (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on + * changes. This includes the `data` prop and parent component state. + * - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously + * offscreen. This means it's possible to scroll faster than the fill rate ands momentarily see + * blank content. This is a tradeoff that can be adjusted to suit the needs of each application, + * and we are working on improving it behind the scenes. + * - By default, the list looks for a `key` or `id` prop on each item and uses that for the React key. + * Alternatively, you can provide a custom `keyExtractor` prop. + * - As an effort to remove defaultProps, use helper functions when referencing certain props + * + */ + var VirtualizedList = /*#__PURE__*/function (_StateSafePureCompone) { + function VirtualizedList(_props) { + var _this$props$updateCel, _this$props$maintainV, _this$props$maintainV2; + var _this; + (0, _classCallCheck2.default)(this, VirtualizedList); + _this = _callSuper(this, VirtualizedList, [_props]); + // $FlowFixMe[missing-local-annot] + _this._getScrollMetrics = function () { + return _this._scrollMetrics; + }; + // $FlowFixMe[missing-local-annot] + _this._getOutermostParentListRef = function () { + if (_this._isNestedWithSameOrientation()) { + return _this.context.getOutermostParentListRef(); + } else { + return _this; + } + }; + _this._registerAsNestedChild = function (childList) { + _this._nestedChildLists.add(childList.ref, childList.cellKey); + if (_this._hasInteracted) { + childList.ref.recordInteraction(); + } + }; + _this._unregisterAsNestedChild = function (childList) { + _this._nestedChildLists.remove(childList.ref); + }; + _this._onUpdateSeparators = function (keys, newProps) { + keys.forEach(function (key) { + var ref = key != null && _this._cellRefs[key]; + ref && ref.updateSeparatorProps(newProps); + }); + }; + _this._getSpacerKey = function (isVertical) { + return isVertical ? 'height' : 'width'; + }; + _this._cellRefs = {}; + _this._listMetrics = new _ListMetricsAggregator.default(); + _this._footerLength = 0; + // Used for preventing scrollToIndex from being called multiple times for initialScrollIndex + _this._hasTriggeredInitialScrollToIndex = false; + _this._hasInteracted = false; + _this._hasMore = false; + _this._hasWarned = {}; + _this._headerLength = 0; + _this._hiPriInProgress = false; + // flag to prevent infinite hiPri cell limit update + _this._indicesToKeys = new Map(); + _this._lastFocusedCellKey = null; + _this._nestedChildLists = new _ChildListCollection.default(); + _this._offsetFromParentVirtualizedList = 0; + _this._pendingViewabilityUpdate = false; + _this._prevParentOffset = 0; + _this._scrollMetrics = { + dOffset: 0, + dt: 10, + offset: 0, + timestamp: 0, + velocity: 0, + visibleLength: 0, + zoomScale: 1 + }; + _this._scrollRef = null; + _this._sentStartForContentLength = 0; + _this._sentEndForContentLength = 0; + _this._viewabilityTuples = []; + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ + _this._captureScrollRef = function (ref) { + _this._scrollRef = ref; + }; + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ + _this._defaultRenderScrollComponent = function (props) { + var onRefresh = props.onRefresh; + if (_this._isNestedWithSameOrientation()) { + // $FlowFixMe[prop-missing] - Typing ReactNativeComponent revealed errors + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, Object.assign({}, props)); + } else if (onRefresh) { + var _props$refreshing; + (0, _invariant.default)(typeof props.refreshing === 'boolean', '`refreshing` prop must be set as a boolean in order to use `onRefresh`, but got `' + JSON.stringify((_props$refreshing = props.refreshing) != null ? _props$refreshing : 'undefined') + '`'); + return ( + /*#__PURE__*/ + // $FlowFixMe[prop-missing] Invalid prop usage + // $FlowFixMe[incompatible-use] + (0, _jsxRuntime.jsx)(_reactNative.ScrollView, Object.assign({}, props, { + refreshControl: props.refreshControl == null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.RefreshControl + // $FlowFixMe[incompatible-type] + , { + refreshing: props.refreshing, + onRefresh: onRefresh, + progressViewOffset: props.progressViewOffset + }) : props.refreshControl + })) + ); + } else { + // $FlowFixMe[prop-missing] Invalid prop usage + // $FlowFixMe[incompatible-use] + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, Object.assign({}, props)); + } + }; + _this._onCellLayout = function (e, cellKey, cellIndex) { + var layoutHasChanged = _this._listMetrics.notifyCellLayout({ + cellIndex: cellIndex, + cellKey: cellKey, + layout: e.nativeEvent.layout, + orientation: _this._orientation() + }); + if (layoutHasChanged) { + _this._scheduleCellsToRenderUpdate(); + } + _this._triggerRemeasureForChildListsInCell(cellKey); + _this._computeBlankness(); + _this._updateViewableItems(_this.props, _this.state.cellsAroundViewport); + }; + _this._onCellUnmount = function (cellKey) { + delete _this._cellRefs[cellKey]; + _this._listMetrics.notifyCellUnmounted(cellKey); + }; + _this._onLayout = function (e) { + if (_this._isNestedWithSameOrientation()) { + // Need to adjust our scroll metrics to be relative to our containing + // VirtualizedList before we can make claims about list item viewability + _this.measureLayoutRelativeToContainingList(); + } else { + _this._scrollMetrics.visibleLength = _this._selectLength(e.nativeEvent.layout); + } + _this.props.onLayout && _this.props.onLayout(e); + _this._scheduleCellsToRenderUpdate(); + _this._maybeCallOnEdgeReached(); + }; + _this._onLayoutEmpty = function (e) { + _this.props.onLayout && _this.props.onLayout(e); + }; + _this._onLayoutFooter = function (e) { + _this._triggerRemeasureForChildListsInCell(_this._getFooterCellKey()); + _this._footerLength = _this._selectLength(e.nativeEvent.layout); + }; + _this._onLayoutHeader = function (e) { + _this._headerLength = _this._selectLength(e.nativeEvent.layout); + }; + _this._onContentSizeChange = function (width, height) { + _this._listMetrics.notifyListContentLayout({ + layout: { + width: width, + height: height + }, + orientation: _this._orientation() + }); + _this._maybeScrollToInitialScrollIndex(width, height); + if (_this.props.onContentSizeChange) { + _this.props.onContentSizeChange(width, height); + } + _this._scheduleCellsToRenderUpdate(); + _this._maybeCallOnEdgeReached(); + }; + /* Translates metrics from a scroll event in a parent VirtualizedList into + * coordinates relative to the child list. + */ + _this._convertParentScrollMetrics = function (metrics) { + // Offset of the top of the nested list relative to the top of its parent's viewport + var offset = metrics.offset - _this._offsetFromParentVirtualizedList; + // Child's visible length is the same as its parent's + var visibleLength = metrics.visibleLength; + var dOffset = offset - _this._scrollMetrics.offset; + var contentLength = _this._listMetrics.getContentLength(); + return { + visibleLength: visibleLength, + contentLength: contentLength, + offset: offset, + dOffset: dOffset + }; + }; + _this._onScroll = function (e) { + _this._nestedChildLists.forEach(function (childList) { + childList._onScroll(e); + }); + if (_this.props.onScroll) { + _this.props.onScroll(e); + } + var timestamp = e.timeStamp; + var visibleLength = _this._selectLength(e.nativeEvent.layoutMeasurement); + var contentLength = _this._selectLength(e.nativeEvent.contentSize); + var offset = _this._offsetFromScrollEvent(e); + var dOffset = offset - _this._scrollMetrics.offset; + if (_this._isNestedWithSameOrientation()) { + if (_this._listMetrics.getContentLength() === 0) { + // Ignore scroll events until onLayout has been called and we + // know our offset from our offset from our parent + return; + } + var _this$_convertParentS = _this._convertParentScrollMetrics({ + visibleLength: visibleLength, + offset: offset + }); + visibleLength = _this$_convertParentS.visibleLength; + contentLength = _this$_convertParentS.contentLength; + offset = _this$_convertParentS.offset; + dOffset = _this$_convertParentS.dOffset; + } + var dt = _this._scrollMetrics.timestamp ? Math.max(1, timestamp - _this._scrollMetrics.timestamp) : 1; + var velocity = dOffset / dt; + if (dt > 500 && _this._scrollMetrics.dt > 500 && contentLength > 5 * visibleLength && !_this._hasWarned.perf) { + (0, _infoLog.default)('VirtualizedList: You have a large list that is slow to update - make sure your ' + 'renderItem function renders components that follow React performance best practices ' + 'like PureComponent, shouldComponentUpdate, etc.', { + dt: dt, + prevDt: _this._scrollMetrics.dt, + contentLength: contentLength + }); + _this._hasWarned.perf = true; + } + + // For invalid negative values (w/ RTL), set this to 1. + var zoomScale = e.nativeEvent.zoomScale < 0 ? 1 : e.nativeEvent.zoomScale; + _this._scrollMetrics = { + dt: dt, + dOffset: dOffset, + offset: offset, + timestamp: timestamp, + velocity: velocity, + visibleLength: visibleLength, + zoomScale: zoomScale + }; + if (_this.state.pendingScrollUpdateCount > 0) { + _this.setState(function (state) { + return { + pendingScrollUpdateCount: state.pendingScrollUpdateCount - 1 + }; + }); + } + _this._updateViewableItems(_this.props, _this.state.cellsAroundViewport); + if (!_this.props) { + return; + } + _this._maybeCallOnEdgeReached(); + if (velocity !== 0) { + _this._fillRateHelper.activate(); + } + _this._computeBlankness(); + _this._scheduleCellsToRenderUpdate(); + }; + _this._onScrollBeginDrag = function (e) { + _this._nestedChildLists.forEach(function (childList) { + childList._onScrollBeginDrag(e); + }); + _this._viewabilityTuples.forEach(function (tuple) { + tuple.viewabilityHelper.recordInteraction(); + }); + _this._hasInteracted = true; + _this.props.onScrollBeginDrag && _this.props.onScrollBeginDrag(e); + }; + _this._onScrollEndDrag = function (e) { + _this._nestedChildLists.forEach(function (childList) { + childList._onScrollEndDrag(e); + }); + var velocity = e.nativeEvent.velocity; + if (velocity) { + _this._scrollMetrics.velocity = _this._selectOffset(velocity); + } + _this._computeBlankness(); + _this.props.onScrollEndDrag && _this.props.onScrollEndDrag(e); + }; + _this._onMomentumScrollBegin = function (e) { + _this._nestedChildLists.forEach(function (childList) { + childList._onMomentumScrollBegin(e); + }); + _this.props.onMomentumScrollBegin && _this.props.onMomentumScrollBegin(e); + }; + _this._onMomentumScrollEnd = function (e) { + _this._nestedChildLists.forEach(function (childList) { + childList._onMomentumScrollEnd(e); + }); + _this._scrollMetrics.velocity = 0; + _this._computeBlankness(); + _this.props.onMomentumScrollEnd && _this.props.onMomentumScrollEnd(e); + }; + _this._updateCellsToRender = function () { + _this._updateViewableItems(_this.props, _this.state.cellsAroundViewport); + _this.setState(function (state, props) { + var cellsAroundViewport = _this._adjustCellsAroundViewport(props, state.cellsAroundViewport, state.pendingScrollUpdateCount); + var renderMask = VirtualizedList._createRenderMask(props, cellsAroundViewport, _this._getNonViewportRenderRegions(props)); + if (cellsAroundViewport.first === state.cellsAroundViewport.first && cellsAroundViewport.last === state.cellsAroundViewport.last && renderMask.equals(state.renderMask)) { + return null; + } + return { + cellsAroundViewport: cellsAroundViewport, + renderMask: renderMask + }; + }); + }; + _this._createViewToken = function (index, isViewable, props + // $FlowFixMe[missing-local-annot] + ) { + var data = props.data, + getItem = props.getItem; + var item = getItem(data, index); + return { + index: index, + item: item, + key: VirtualizedList._keyExtractor(item, index, props), + isViewable: isViewable + }; + }; + _this._getNonViewportRenderRegions = function (props) { + // Keep a viewport's worth of content around the last focused cell to allow + // random navigation around it without any blanking. E.g. tabbing from one + // focused item out of viewport to another. + if (!(_this._lastFocusedCellKey && _this._cellRefs[_this._lastFocusedCellKey])) { + return []; + } + var lastFocusedCellRenderer = _this._cellRefs[_this._lastFocusedCellKey]; + var focusedCellIndex = lastFocusedCellRenderer.props.index; + var itemCount = props.getItemCount(props.data); + + // The last cell we rendered may be at a new index. Bail if we don't know + // where it is. + if (focusedCellIndex >= itemCount || VirtualizedList._getItemKey(props, focusedCellIndex) !== _this._lastFocusedCellKey) { + return []; + } + var first = focusedCellIndex; + var heightOfCellsBeforeFocused = 0; + for (var i = first - 1; i >= 0 && heightOfCellsBeforeFocused < _this._scrollMetrics.visibleLength; i--) { + first--; + heightOfCellsBeforeFocused += _this._listMetrics.getCellMetricsApprox(i, props).length; + } + var last = focusedCellIndex; + var heightOfCellsAfterFocused = 0; + for (var _i = last + 1; _i < itemCount && heightOfCellsAfterFocused < _this._scrollMetrics.visibleLength; _i++) { + last++; + heightOfCellsAfterFocused += _this._listMetrics.getCellMetricsApprox(_i, props).length; + } + return [{ + first: first, + last: last + }]; + }; + _this._checkProps(_props); + _this._fillRateHelper = new _FillRateHelper.default(_this._listMetrics); + _this._updateCellsToRenderBatcher = new _Batchinator.default(_this._updateCellsToRender, (_this$props$updateCel = _this.props.updateCellsBatchingPeriod) != null ? _this$props$updateCel : 50); + if (_this.props.viewabilityConfigCallbackPairs) { + _this._viewabilityTuples = _this.props.viewabilityConfigCallbackPairs.map(function (pair) { + return { + viewabilityHelper: new _ViewabilityHelper.default(pair.viewabilityConfig), + onViewableItemsChanged: pair.onViewableItemsChanged + }; + }); + } else { + var _this$props = _this.props, + onViewableItemsChanged = _this$props.onViewableItemsChanged, + viewabilityConfig = _this$props.viewabilityConfig; + if (onViewableItemsChanged) { + _this._viewabilityTuples.push({ + viewabilityHelper: new _ViewabilityHelper.default(viewabilityConfig), + onViewableItemsChanged: onViewableItemsChanged + }); + } + } + var initialRenderRegion = VirtualizedList._initialRenderRegion(_props); + var minIndexForVisible = (_this$props$maintainV = (_this$props$maintainV2 = _this.props.maintainVisibleContentPosition) == null ? void 0 : _this$props$maintainV2.minIndexForVisible) != null ? _this$props$maintainV : 0; + _this.state = { + cellsAroundViewport: initialRenderRegion, + renderMask: VirtualizedList._createRenderMask(_props, initialRenderRegion), + firstVisibleItemKey: _this.props.getItemCount(_this.props.data) > minIndexForVisible ? VirtualizedList._getItemKey(_this.props, minIndexForVisible) : null, + // When we have a non-zero initialScrollIndex, we will receive a + // scroll event later so this will prevent the window from updating + // until we get a valid offset. + pendingScrollUpdateCount: _this.props.initialScrollIndex != null && _this.props.initialScrollIndex > 0 ? 1 : 0 + }; + return _this; + } + (0, _inherits2.default)(VirtualizedList, _StateSafePureCompone); + return (0, _createClass2.default)(VirtualizedList, [{ + key: "scrollToEnd", + value: + // scrollToEnd may be janky without getItemLayout prop + function scrollToEnd(params) { + var animated = params ? params.animated : true; + var veryLast = this.props.getItemCount(this.props.data) - 1; + if (veryLast < 0) { + return; + } + var frame = this._listMetrics.getCellMetricsApprox(veryLast, this.props); + var offset = Math.max(0, frame.offset + frame.length + this._footerLength - this._scrollMetrics.visibleLength); + + // TODO: consider using `ref.scrollToEnd` directly + this.scrollToOffset({ + animated: animated, + offset: offset + }); + } + + // scrollToIndex may be janky without getItemLayout prop + }, { + key: "scrollToIndex", + value: function scrollToIndex(params) { + var _this$props2 = this.props, + data = _this$props2.data, + getItemCount = _this$props2.getItemCount, + getItemLayout = _this$props2.getItemLayout, + onScrollToIndexFailed = _this$props2.onScrollToIndexFailed; + var animated = params.animated, + index = params.index, + viewOffset = params.viewOffset, + viewPosition = params.viewPosition; + (0, _invariant.default)(index >= 0, `scrollToIndex out of range: requested index ${index} but minimum is 0`); + (0, _invariant.default)(getItemCount(data) >= 1, `scrollToIndex out of range: item length ${getItemCount(data)} but minimum is 1`); + (0, _invariant.default)(index < getItemCount(data), `scrollToIndex out of range: requested index ${index} is out of 0 to ${getItemCount(data) - 1}`); + if (!getItemLayout && index > this._listMetrics.getHighestMeasuredCellIndex()) { + (0, _invariant.default)(!!onScrollToIndexFailed, 'scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, ' + 'otherwise there is no way to know the location of offscreen indices or handle failures.'); + onScrollToIndexFailed({ + averageItemLength: this._listMetrics.getAverageCellLength(), + highestMeasuredFrameIndex: this._listMetrics.getHighestMeasuredCellIndex(), + index: index + }); + return; + } + var frame = this._listMetrics.getCellMetricsApprox(Math.floor(index), this.props); + var offset = Math.max(0, this._listMetrics.getCellOffsetApprox(index, this.props) - (viewPosition || 0) * (this._scrollMetrics.visibleLength - frame.length)) - (viewOffset || 0); + this.scrollToOffset({ + offset: offset, + animated: animated + }); + } + + // scrollToItem may be janky without getItemLayout prop. Required linear scan through items - + // use scrollToIndex instead if possible. + }, { + key: "scrollToItem", + value: function scrollToItem(params) { + var item = params.item; + var _this$props3 = this.props, + data = _this$props3.data, + getItem = _this$props3.getItem, + getItemCount = _this$props3.getItemCount; + var itemCount = getItemCount(data); + for (var index = 0; index < itemCount; index++) { + if (getItem(data, index) === item) { + this.scrollToIndex(Object.assign({}, params, { + index: index + })); + break; + } + } + } + + /** + * Scroll to a specific content pixel offset in the list. + * + * Param `offset` expects the offset to scroll to. + * In case of `horizontal` is true, the offset is the x-value, + * in any other case the offset is the y-value. + * + * Param `animated` (`true` by default) defines whether the list + * should do an animation while scrolling. + */ + }, { + key: "scrollToOffset", + value: function scrollToOffset(params) { + var animated = params.animated, + offset = params.offset; + var scrollRef = this._scrollRef; + if (scrollRef == null) { + return; + } + if (scrollRef.scrollTo == null) { + console.warn('No scrollTo method provided. This may be because you have two nested ' + 'VirtualizedLists with the same orientation, or because you are ' + 'using a custom component that does not implement scrollTo.'); + return; + } + var _this$_orientation = this._orientation(), + horizontal = _this$_orientation.horizontal, + rtl = _this$_orientation.rtl; + if (horizontal && rtl && !this._listMetrics.hasContentLength()) { + console.warn('scrollToOffset may not be called in RTL before content is laid out'); + return; + } + scrollRef.scrollTo(Object.assign({ + animated: animated + }, this._scrollToParamsFromOffset(offset))); + } + }, { + key: "_scrollToParamsFromOffset", + value: function _scrollToParamsFromOffset(offset) { + var _this$_orientation2 = this._orientation(), + horizontal = _this$_orientation2.horizontal, + rtl = _this$_orientation2.rtl; + if (horizontal && rtl) { + // Add the visible length of the scrollview so that the offset is right-aligned + var cartOffset = this._listMetrics.cartesianOffset(offset + this._scrollMetrics.visibleLength); + return horizontal ? { + x: cartOffset + } : { + y: cartOffset + }; + } else { + return horizontal ? { + x: offset + } : { + y: offset + }; + } + } + }, { + key: "recordInteraction", + value: function recordInteraction() { + this._nestedChildLists.forEach(function (childList) { + childList.recordInteraction(); + }); + this._viewabilityTuples.forEach(function (t) { + t.viewabilityHelper.recordInteraction(); + }); + this._updateViewableItems(this.props, this.state.cellsAroundViewport); + } + }, { + key: "flashScrollIndicators", + value: function flashScrollIndicators() { + if (this._scrollRef == null) { + return; + } + this._scrollRef.flashScrollIndicators(); + } + + /** + * Provides a handle to the underlying scroll responder. + * Note that `this._scrollRef` might not be a `ScrollView`, so we + * need to check that it responds to `getScrollResponder` before calling it. + */ + }, { + key: "getScrollResponder", + value: function getScrollResponder() { + if (this._scrollRef && this._scrollRef.getScrollResponder) { + return this._scrollRef.getScrollResponder(); + } + } + }, { + key: "getScrollableNode", + value: function getScrollableNode() { + if (this._scrollRef && this._scrollRef.getScrollableNode) { + return this._scrollRef.getScrollableNode(); + } else { + return (0, _reactNative.findNodeHandle)(this._scrollRef); + } + } + }, { + key: "getScrollRef", + value: function getScrollRef() { + if (this._scrollRef && this._scrollRef.getScrollRef) { + return this._scrollRef.getScrollRef(); + } else { + return this._scrollRef; + } + } + }, { + key: "setNativeProps", + value: function setNativeProps(props) { + if (this._scrollRef) { + this._scrollRef.setNativeProps(props); + } + } + }, { + key: "_getCellKey", + value: function _getCellKey() { + var _this$context; + return ((_this$context = this.context) == null ? void 0 : _this$context.cellKey) || 'rootList'; + } + }, { + key: "hasMore", + value: function hasMore() { + return this._hasMore; + } + }, { + key: "_checkProps", + value: function _checkProps(props) { + var onScroll = props.onScroll, + windowSize = props.windowSize, + getItemCount = props.getItemCount, + data = props.data, + initialScrollIndex = props.initialScrollIndex; + (0, _invariant.default)( + // $FlowFixMe[prop-missing] + !onScroll || !onScroll.__isNative, 'Components based on VirtualizedList must be wrapped with Animated.createAnimatedComponent ' + 'to support native onScroll events with useNativeDriver'); + (0, _invariant.default)((0, _$$_REQUIRE(_dependencyMap[22], "./VirtualizedListProps").windowSizeOrDefault)(windowSize) > 0, 'VirtualizedList: The windowSize prop must be present and set to a value greater than 0.'); + (0, _invariant.default)(getItemCount, 'VirtualizedList: The "getItemCount" prop must be provided'); + var itemCount = getItemCount(data); + if (initialScrollIndex != null && !this._hasTriggeredInitialScrollToIndex && (initialScrollIndex < 0 || itemCount > 0 && initialScrollIndex >= itemCount) && !this._hasWarned.initialScrollIndex) { + console.warn(`initialScrollIndex "${initialScrollIndex}" is not valid (list has ${itemCount} items)`); + this._hasWarned.initialScrollIndex = true; + } + if (__DEV__ && !this._hasWarned.flexWrap) { + // $FlowFixMe[underconstrained-implicit-instantiation] + var flatStyles = _reactNative.StyleSheet.flatten(this.props.contentContainerStyle); + if (flatStyles != null && flatStyles.flexWrap === 'wrap') { + console.warn('`flexWrap: `wrap`` is not supported with the `VirtualizedList` components.' + 'Consider using `numColumns` with `FlatList` instead.'); + this._hasWarned.flexWrap = true; + } + } + } + }, { + key: "_adjustCellsAroundViewport", + value: function _adjustCellsAroundViewport(props, cellsAroundViewport, pendingScrollUpdateCount) { + var data = props.data, + getItemCount = props.getItemCount; + var onEndReachedThreshold = (0, _$$_REQUIRE(_dependencyMap[22], "./VirtualizedListProps").onEndReachedThresholdOrDefault)(props.onEndReachedThreshold); + var _this$_scrollMetrics = this._scrollMetrics, + offset = _this$_scrollMetrics.offset, + visibleLength = _this$_scrollMetrics.visibleLength; + var contentLength = this._listMetrics.getContentLength(); + var distanceFromEnd = contentLength - visibleLength - offset; + + // Wait until the scroll view metrics have been set up. And until then, + // we will trust the initialNumToRender suggestion + if (visibleLength <= 0 || contentLength <= 0) { + return cellsAroundViewport.last >= getItemCount(data) ? VirtualizedList._constrainToItemCount(cellsAroundViewport, props) : cellsAroundViewport; + } + var newCellsAroundViewport; + if (props.disableVirtualization) { + var renderAhead = distanceFromEnd < onEndReachedThreshold * visibleLength ? (0, _$$_REQUIRE(_dependencyMap[22], "./VirtualizedListProps").maxToRenderPerBatchOrDefault)(props.maxToRenderPerBatch) : 0; + newCellsAroundViewport = { + first: 0, + last: Math.min(cellsAroundViewport.last + renderAhead, getItemCount(data) - 1) + }; + } else { + // If we have a pending scroll update, we should not adjust the render window as it + // might override the correct window. + if (pendingScrollUpdateCount > 0) { + return cellsAroundViewport.last >= getItemCount(data) ? VirtualizedList._constrainToItemCount(cellsAroundViewport, props) : cellsAroundViewport; + } + newCellsAroundViewport = (0, _$$_REQUIRE(_dependencyMap[23], "./VirtualizeUtils").computeWindowedRenderLimits)(props, (0, _$$_REQUIRE(_dependencyMap[22], "./VirtualizedListProps").maxToRenderPerBatchOrDefault)(props.maxToRenderPerBatch), (0, _$$_REQUIRE(_dependencyMap[22], "./VirtualizedListProps").windowSizeOrDefault)(props.windowSize), cellsAroundViewport, this._listMetrics, this._scrollMetrics); + (0, _invariant.default)(newCellsAroundViewport.last < getItemCount(data), 'computeWindowedRenderLimits() should return range in-bounds'); + } + if (this._nestedChildLists.size() > 0) { + // If some cell in the new state has a child list in it, we should only render + // up through that item, so that we give that list a chance to render. + // Otherwise there's churn from multiple child lists mounting and un-mounting + // their items. + + // Will this prevent rendering if the nested list doesn't realize the end? + var childIdx = this._findFirstChildWithMore(newCellsAroundViewport.first, newCellsAroundViewport.last); + newCellsAroundViewport.last = childIdx != null ? childIdx : newCellsAroundViewport.last; + } + return newCellsAroundViewport; + } + }, { + key: "_findFirstChildWithMore", + value: function _findFirstChildWithMore(first, last) { + for (var ii = first; ii <= last; ii++) { + var cellKeyForIndex = this._indicesToKeys.get(ii); + if (cellKeyForIndex != null && this._nestedChildLists.anyInCell(cellKeyForIndex, function (childList) { + return childList.hasMore(); + })) { + return ii; + } + } + return null; + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + if (this._isNestedWithSameOrientation()) { + this.context.registerAsNestedChild({ + ref: this, + cellKey: this.context.cellKey + }); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this._isNestedWithSameOrientation()) { + this.context.unregisterAsNestedChild({ + ref: this + }); + } + this._updateCellsToRenderBatcher.dispose({ + abort: true + }); + this._viewabilityTuples.forEach(function (tuple) { + tuple.viewabilityHelper.dispose(); + }); + this._fillRateHelper.deactivateAndFlush(); + } + }, { + key: "_pushCells", + value: function _pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, first, last, inversionStyle) { + var _this2 = this; + var _this$props4 = this.props, + CellRendererComponent = _this$props4.CellRendererComponent, + ItemSeparatorComponent = _this$props4.ItemSeparatorComponent, + ListHeaderComponent = _this$props4.ListHeaderComponent, + ListItemComponent = _this$props4.ListItemComponent, + data = _this$props4.data, + debug = _this$props4.debug, + getItem = _this$props4.getItem, + getItemCount = _this$props4.getItemCount, + getItemLayout = _this$props4.getItemLayout, + horizontal = _this$props4.horizontal, + renderItem = _this$props4.renderItem; + var stickyOffset = ListHeaderComponent ? 1 : 0; + var end = getItemCount(data) - 1; + var prevCellKey; + last = Math.min(end, last); + var _loop = function _loop() { + var item = getItem(data, ii); + var key = VirtualizedList._keyExtractor(item, ii, _this2.props); + _this2._indicesToKeys.set(ii, key); + if (stickyIndicesFromProps.has(ii + stickyOffset)) { + stickyHeaderIndices.push(cells.length); + } + var shouldListenForLayout = getItemLayout == null || debug || _this2._fillRateHelper.enabled(); + cells.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_VirtualizedListCellRenderer.default, Object.assign({ + CellRendererComponent: CellRendererComponent, + ItemSeparatorComponent: ii < end ? ItemSeparatorComponent : undefined, + ListItemComponent: ListItemComponent, + cellKey: key, + horizontal: horizontal, + index: ii, + inversionStyle: inversionStyle, + item: item, + prevCellKey: prevCellKey, + onUpdateSeparators: _this2._onUpdateSeparators, + onCellFocusCapture: function onCellFocusCapture(e) { + return _this2._onCellFocusCapture(key); + }, + onUnmount: _this2._onCellUnmount, + ref: function ref(_ref) { + _this2._cellRefs[key] = _ref; + }, + renderItem: renderItem + }, shouldListenForLayout && { + onCellLayout: _this2._onCellLayout + }), key)); + prevCellKey = key; + }; + for (var ii = first; ii <= last; ii++) { + _loop(); + } + } + }, { + key: "_isNestedWithSameOrientation", + value: function _isNestedWithSameOrientation() { + var nestedContext = this.context; + return !!(nestedContext && !!nestedContext.horizontal === (0, _$$_REQUIRE(_dependencyMap[22], "./VirtualizedListProps").horizontalOrDefault)(this.props.horizontal)); + } + }, { + key: "render", + value: function render() { + var _this3 = this, + _this$props$scrollEve; + this._checkProps(this.props); + var _this$props5 = this.props, + ListEmptyComponent = _this$props5.ListEmptyComponent, + ListFooterComponent = _this$props5.ListFooterComponent, + ListHeaderComponent = _this$props5.ListHeaderComponent; + var _this$props6 = this.props, + data = _this$props6.data, + horizontal = _this$props6.horizontal; + var inversionStyle = this.props.inverted ? (0, _$$_REQUIRE(_dependencyMap[22], "./VirtualizedListProps").horizontalOrDefault)(this.props.horizontal) ? styles.horizontallyInverted : styles.verticallyInverted : null; + var cells = []; + var stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices); + var stickyHeaderIndices = []; + + // 1. Add cell for ListHeaderComponent + if (ListHeaderComponent) { + if (stickyIndicesFromProps.has(0)) { + stickyHeaderIndices.push(0); + } + var element = React.isValidElement(ListHeaderComponent) ? ListHeaderComponent : + /*#__PURE__*/ + // $FlowFixMe[not-a-component] + // $FlowFixMe[incompatible-type-arg] + (0, _jsxRuntime.jsx)(ListHeaderComponent, {}); + cells.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[24], "./VirtualizedListContext.js").VirtualizedListCellContextProvider, { + cellKey: this._getCellKey() + '-header', + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View + // We expect that header component will be a single native view so make it + // not collapsable to avoid this view being flattened and make this assumption + // no longer true. + , { + collapsable: false, + onLayout: this._onLayoutHeader, + style: _reactNative.StyleSheet.compose(inversionStyle, this.props.ListHeaderComponentStyle), + children: + // $FlowFixMe[incompatible-type] - Typing ReactNativeComponent revealed errors + element + }) + }, "$header")); + } + + // 2a. Add a cell for ListEmptyComponent if applicable + var itemCount = this.props.getItemCount(data); + if (itemCount === 0 && ListEmptyComponent) { + var _element = React.isValidElement(ListEmptyComponent) ? ListEmptyComponent : + /*#__PURE__*/ + // $FlowFixMe[not-a-component] + // $FlowFixMe[incompatible-type-arg] + (0, _jsxRuntime.jsx)(ListEmptyComponent, {}); + cells.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[24], "./VirtualizedListContext.js").VirtualizedListCellContextProvider, { + cellKey: this._getCellKey() + '-empty', + children: React.cloneElement(_element, { + onLayout: function onLayout(event) { + _this3._onLayoutEmpty(event); + if (_element.props.onLayout) { + _element.props.onLayout(event); + } + }, + style: _reactNative.StyleSheet.compose(inversionStyle, _element.props.style) + }) + }, "$empty")); + } + + // 2b. Add cells and spacers for each item + if (itemCount > 0) { + _usedIndexForKey = false; + _keylessItemComponentName = ''; + var spacerKey = this._getSpacerKey(!horizontal); + var renderRegions = this.state.renderMask.enumerateRegions(); + var lastRegion = renderRegions[renderRegions.length - 1]; + var lastSpacer = lastRegion != null && lastRegion.isSpacer ? lastRegion : null; + for (var section of renderRegions) { + if (section.isSpacer) { + // Legacy behavior is to avoid spacers when virtualization is + // disabled (including head spacers on initial render). + if (this.props.disableVirtualization) { + continue; + } + + // Without getItemLayout, we limit our tail spacer to the _highestMeasuredFrameIndex to + // prevent the user for hyperscrolling into un-measured area because otherwise content will + // likely jump around as it renders in above the viewport. + var isLastSpacer = section === lastSpacer; + var constrainToMeasured = isLastSpacer && !this.props.getItemLayout; + var last = constrainToMeasured ? (0, _clamp.default)(section.first - 1, section.last, this._listMetrics.getHighestMeasuredCellIndex()) : section.last; + var firstMetrics = this._listMetrics.getCellMetricsApprox(section.first, this.props); + var lastMetrics = this._listMetrics.getCellMetricsApprox(last, this.props); + var spacerSize = lastMetrics.offset + lastMetrics.length - firstMetrics.offset; + cells.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { + style: (0, _defineProperty2.default)({}, spacerKey, spacerSize) + }, `$spacer-${section.first}`)); + } else { + this._pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, section.first, section.last, inversionStyle); + } + } + if (!this._hasWarned.keys && _usedIndexForKey) { + console.warn('VirtualizedList: missing keys for items, make sure to specify a key or id property on each ' + 'item or provide a custom keyExtractor.', _keylessItemComponentName); + this._hasWarned.keys = true; + } + } + + // 3. Add cell for ListFooterComponent + if (ListFooterComponent) { + var _element2 = React.isValidElement(ListFooterComponent) ? ListFooterComponent : + /*#__PURE__*/ + // $FlowFixMe[not-a-component] + // $FlowFixMe[incompatible-type-arg] + (0, _jsxRuntime.jsx)(ListFooterComponent, {}); + cells.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[24], "./VirtualizedListContext.js").VirtualizedListCellContextProvider, { + cellKey: this._getFooterCellKey(), + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { + onLayout: this._onLayoutFooter, + style: _reactNative.StyleSheet.compose(inversionStyle, this.props.ListFooterComponentStyle), + children: + // $FlowFixMe[incompatible-type] - Typing ReactNativeComponent revealed errors + _element2 + }) + }, "$footer")); + } + + // 4. Render the ScrollView + var scrollProps = Object.assign({}, this.props, { + onContentSizeChange: this._onContentSizeChange, + onLayout: this._onLayout, + onScroll: this._onScroll, + onScrollBeginDrag: this._onScrollBeginDrag, + onScrollEndDrag: this._onScrollEndDrag, + onMomentumScrollBegin: this._onMomentumScrollBegin, + onMomentumScrollEnd: this._onMomentumScrollEnd, + // iOS/macOS requires a non-zero scrollEventThrottle to fire more than a + // single notification while scrolling. This will otherwise no-op. + scrollEventThrottle: (_this$props$scrollEve = this.props.scrollEventThrottle) != null ? _this$props$scrollEve : 0.0001, + invertStickyHeaders: this.props.invertStickyHeaders !== undefined ? this.props.invertStickyHeaders : this.props.inverted, + stickyHeaderIndices: stickyHeaderIndices, + style: inversionStyle ? [inversionStyle, this.props.style] : this.props.style, + isInvertedVirtualizedList: this.props.inverted, + maintainVisibleContentPosition: this.props.maintainVisibleContentPosition != null ? Object.assign({}, this.props.maintainVisibleContentPosition, { + // Adjust index to account for ListHeaderComponent. + minIndexForVisible: this.props.maintainVisibleContentPosition.minIndexForVisible + (this.props.ListHeaderComponent ? 1 : 0) + }) : undefined + }); + this._hasMore = this.state.cellsAroundViewport.last < itemCount - 1; + var innerRet = /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[24], "./VirtualizedListContext.js").VirtualizedListContextProvider, { + value: { + cellKey: null, + getScrollMetrics: this._getScrollMetrics, + horizontal: (0, _$$_REQUIRE(_dependencyMap[22], "./VirtualizedListProps").horizontalOrDefault)(this.props.horizontal), + getOutermostParentListRef: this._getOutermostParentListRef, + registerAsNestedChild: this._registerAsNestedChild, + unregisterAsNestedChild: this._unregisterAsNestedChild + }, + children: React.cloneElement((this.props.renderScrollComponent || this._defaultRenderScrollComponent)(scrollProps), { + ref: this._captureScrollRef + }, cells) + }); + var ret = innerRet; + if (__DEV__) { + ret = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView.Context.Consumer, { + children: function children(scrollContext) { + if (scrollContext != null && !scrollContext.horizontal === !(0, _$$_REQUIRE(_dependencyMap[22], "./VirtualizedListProps").horizontalOrDefault)(_this3.props.horizontal) && !_this3._hasWarned.nesting && _this3.context == null && _this3.props.scrollEnabled !== false) { + // TODO (T46547044): use React.warn once 16.9 is sync'd: https://github.com/facebook/react/pull/15170 + console.error('VirtualizedLists should never be nested inside plain ScrollViews with the same ' + 'orientation because it can break windowing and other functionality - use another ' + 'VirtualizedList-backed container instead.'); + _this3._hasWarned.nesting = true; + } + return innerRet; + } + }); + } + if (this.props.debug) { + return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { + style: styles.debug, + children: [ret, this._renderDebugOverlay()] + }); + } else { + return ret; + } + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + var _this$props7 = this.props, + data = _this$props7.data, + extraData = _this$props7.extraData; + if (data !== prevProps.data || extraData !== prevProps.extraData) { + // clear the viewableIndices cache to also trigger + // the onViewableItemsChanged callback with the new data + this._viewabilityTuples.forEach(function (tuple) { + tuple.viewabilityHelper.resetViewableIndices(); + }); + } + // The `this._hiPriInProgress` is guaranteeing a hiPri cell update will only happen + // once per fiber update. The `_scheduleCellsToRenderUpdate` will set it to true + // if a hiPri update needs to perform. If `componentDidUpdate` is triggered with + // `this._hiPriInProgress=true`, means it's triggered by the hiPri update. The + // `_scheduleCellsToRenderUpdate` will check this condition and not perform + // another hiPri update. + var hiPriInProgress = this._hiPriInProgress; + this._scheduleCellsToRenderUpdate(); + // Make sure setting `this._hiPriInProgress` back to false after `componentDidUpdate` + // is triggered with `this._hiPriInProgress = true` + if (hiPriInProgress) { + this._hiPriInProgress = false; + } + } + }, { + key: "_computeBlankness", + value: function _computeBlankness() { + this._fillRateHelper.computeBlankness(this.props, this.state.cellsAroundViewport, this._scrollMetrics); + } + }, { + key: "_onCellFocusCapture", + value: function _onCellFocusCapture(cellKey) { + this._lastFocusedCellKey = cellKey; + this._updateCellsToRender(); + } + }, { + key: "_triggerRemeasureForChildListsInCell", + value: function _triggerRemeasureForChildListsInCell(cellKey) { + this._nestedChildLists.forEachInCell(cellKey, function (childList) { + childList.measureLayoutRelativeToContainingList(); + }); + } + }, { + key: "measureLayoutRelativeToContainingList", + value: function measureLayoutRelativeToContainingList() { + var _this4 = this; + // TODO (T35574538): findNodeHandle sometimes crashes with "Unable to find + // node on an unmounted component" during scrolling + try { + if (!this._scrollRef) { + return; + } + // We are assuming that getOutermostParentListRef().getScrollRef() + // is a non-null reference to a ScrollView + this._scrollRef.measureLayout(this.context.getOutermostParentListRef().getScrollRef(), function (x, y, width, height) { + _this4._offsetFromParentVirtualizedList = _this4._selectOffset({ + x: x, + y: y + }); + _this4._listMetrics.notifyListContentLayout({ + layout: { + width: width, + height: height + }, + orientation: _this4._orientation() + }); + var scrollMetrics = _this4._convertParentScrollMetrics(_this4.context.getScrollMetrics()); + var metricsChanged = _this4._scrollMetrics.visibleLength !== scrollMetrics.visibleLength || _this4._scrollMetrics.offset !== scrollMetrics.offset; + if (metricsChanged) { + _this4._scrollMetrics.visibleLength = scrollMetrics.visibleLength; + _this4._scrollMetrics.offset = scrollMetrics.offset; + + // If metrics of the scrollView changed, then we triggered remeasure for child list + // to ensure VirtualizedList has the right information. + _this4._nestedChildLists.forEach(function (childList) { + childList.measureLayoutRelativeToContainingList(); + }); + } + }, function (error) { + console.warn("VirtualizedList: Encountered an error while measuring a list's" + ' offset from its containing VirtualizedList.'); + }); + } catch (error) { + console.warn('measureLayoutRelativeToContainingList threw an error', error.stack); + } + } + }, { + key: "_getFooterCellKey", + value: function _getFooterCellKey() { + return this._getCellKey() + '-footer'; + } + }, { + key: "_renderDebugOverlay", + value: + // $FlowFixMe[missing-local-annot] + function _renderDebugOverlay() { + var _this5 = this; + var normalize = this._scrollMetrics.visibleLength / (this._listMetrics.getContentLength() || 1); + var framesInLayout = []; + var itemCount = this.props.getItemCount(this.props.data); + for (var ii = 0; ii < itemCount; ii++) { + var frame = this._listMetrics.getCellMetricsApprox(ii, this.props); + if (frame.isMounted) { + framesInLayout.push(frame); + } + } + var windowTop = this._listMetrics.getCellMetricsApprox(this.state.cellsAroundViewport.first, this.props).offset; + var frameLast = this._listMetrics.getCellMetricsApprox(this.state.cellsAroundViewport.last, this.props); + var windowLen = frameLast.offset + frameLast.length - windowTop; + var visTop = this._scrollMetrics.offset; + var visLen = this._scrollMetrics.visibleLength; + return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { + style: [styles.debugOverlayBase, styles.debugOverlay], + children: [framesInLayout.map(function (f, ii) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { + style: [styles.debugOverlayBase, styles.debugOverlayFrame, { + top: f.offset * normalize, + height: f.length * normalize + }] + }, 'f' + ii); + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { + style: [styles.debugOverlayBase, styles.debugOverlayFrameLast, { + top: windowTop * normalize, + height: windowLen * normalize + }] + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { + style: [styles.debugOverlayBase, styles.debugOverlayFrameVis, { + top: visTop * normalize, + height: visLen * normalize + }] + })] + }); + } + }, { + key: "_selectLength", + value: function _selectLength(metrics) { + return !(0, _$$_REQUIRE(_dependencyMap[22], "./VirtualizedListProps").horizontalOrDefault)(this.props.horizontal) ? metrics.height : metrics.width; + } + }, { + key: "_selectOffset", + value: function _selectOffset(_ref3) { + var x = _ref3.x, + y = _ref3.y; + return this._orientation().horizontal ? x : y; + } + }, { + key: "_orientation", + value: function _orientation() { + return { + horizontal: (0, _$$_REQUIRE(_dependencyMap[22], "./VirtualizedListProps").horizontalOrDefault)(this.props.horizontal), + rtl: _reactNative.I18nManager.isRTL + }; + } + }, { + key: "_maybeCallOnEdgeReached", + value: function _maybeCallOnEdgeReached() { + var _this$props8 = this.props, + data = _this$props8.data, + getItemCount = _this$props8.getItemCount, + onStartReached = _this$props8.onStartReached, + onStartReachedThreshold = _this$props8.onStartReachedThreshold, + onEndReached = _this$props8.onEndReached, + onEndReachedThreshold = _this$props8.onEndReachedThreshold; + // If we have any pending scroll updates it means that the scroll metrics + // are out of date and we should not call any of the edge reached callbacks. + if (this.state.pendingScrollUpdateCount > 0) { + return; + } + var _this$_scrollMetrics2 = this._scrollMetrics, + visibleLength = _this$_scrollMetrics2.visibleLength, + offset = _this$_scrollMetrics2.offset; + var distanceFromStart = offset; + var distanceFromEnd = this._listMetrics.getContentLength() - visibleLength - offset; + + // Especially when oERT is zero it's necessary to 'floor' very small distance values to be 0 + // since debouncing causes us to not fire this event for every single "pixel" we scroll and can thus + // be at the edge of the list with a distance approximating 0 but not quite there. + if (distanceFromStart < ON_EDGE_REACHED_EPSILON) { + distanceFromStart = 0; + } + if (distanceFromEnd < ON_EDGE_REACHED_EPSILON) { + distanceFromEnd = 0; + } + + // TODO: T121172172 Look into why we're "defaulting" to a threshold of 2px + // when oERT is not present (different from 2 viewports used elsewhere) + var DEFAULT_THRESHOLD_PX = 2; + var startThreshold = onStartReachedThreshold != null ? onStartReachedThreshold * visibleLength : DEFAULT_THRESHOLD_PX; + var endThreshold = onEndReachedThreshold != null ? onEndReachedThreshold * visibleLength : DEFAULT_THRESHOLD_PX; + var isWithinStartThreshold = distanceFromStart <= startThreshold; + var isWithinEndThreshold = distanceFromEnd <= endThreshold; + + // First check if the user just scrolled within the end threshold + // and call onEndReached only once for a given content length, + // and only if onStartReached is not being executed + if (onEndReached && this.state.cellsAroundViewport.last === getItemCount(data) - 1 && isWithinEndThreshold && this._listMetrics.getContentLength() !== this._sentEndForContentLength) { + this._sentEndForContentLength = this._listMetrics.getContentLength(); + onEndReached({ + distanceFromEnd: distanceFromEnd + }); + } + + // Next check if the user just scrolled within the start threshold + // and call onStartReached only once for a given content length, + // and only if onEndReached is not being executed + else if (onStartReached != null && this.state.cellsAroundViewport.first === 0 && isWithinStartThreshold && this._listMetrics.getContentLength() !== this._sentStartForContentLength) { + this._sentStartForContentLength = this._listMetrics.getContentLength(); + onStartReached({ + distanceFromStart: distanceFromStart + }); + } + + // If the user scrolls away from the start or end and back again, + // cause onStartReached or onEndReached to be triggered again + else { + this._sentStartForContentLength = isWithinStartThreshold ? this._sentStartForContentLength : 0; + this._sentEndForContentLength = isWithinEndThreshold ? this._sentEndForContentLength : 0; + } + } + }, { + key: "_maybeScrollToInitialScrollIndex", + value: + /** + * Scroll to a specified `initialScrollIndex` prop after the ScrollView + * content has been laid out, if it is still valid. Only a single scroll is + * triggered throughout the lifetime of the list. + */ + function _maybeScrollToInitialScrollIndex(contentWidth, contentHeight) { + if (contentWidth > 0 && contentHeight > 0 && this.props.initialScrollIndex != null && this.props.initialScrollIndex > 0 && !this._hasTriggeredInitialScrollToIndex) { + if (this.props.contentOffset == null) { + if (this.props.initialScrollIndex < this.props.getItemCount(this.props.data)) { + this.scrollToIndex({ + animated: false, + index: (0, _nullthrows.default)(this.props.initialScrollIndex) + }); + } else { + this.scrollToEnd({ + animated: false + }); + } + } + this._hasTriggeredInitialScrollToIndex = true; + } + } + }, { + key: "_offsetFromScrollEvent", + value: function _offsetFromScrollEvent(e) { + var _e$nativeEvent = e.nativeEvent, + contentOffset = _e$nativeEvent.contentOffset, + contentSize = _e$nativeEvent.contentSize, + layoutMeasurement = _e$nativeEvent.layoutMeasurement; + var _this$_orientation3 = this._orientation(), + horizontal = _this$_orientation3.horizontal, + rtl = _this$_orientation3.rtl; + if (horizontal && rtl) { + return this._selectLength(contentSize) - (this._selectOffset(contentOffset) + this._selectLength(layoutMeasurement)); + } else { + return this._selectOffset(contentOffset); + } + } + }, { + key: "_scheduleCellsToRenderUpdate", + value: function _scheduleCellsToRenderUpdate() { + // Only trigger high-priority updates if we've actually rendered cells, + // and with that size estimate, accurately compute how many cells we should render. + // Otherwise, it would just render as many cells as it can (of zero dimension), + // each time through attempting to render more (limited by maxToRenderPerBatch), + // starving the renderer from actually laying out the objects and computing _averageCellLength. + // If this is triggered in an `componentDidUpdate` followed by a hiPri cellToRenderUpdate + // We shouldn't do another hipri cellToRenderUpdate + if ((this._listMetrics.getAverageCellLength() > 0 || this.props.getItemLayout != null) && this._shouldRenderWithPriority() && !this._hiPriInProgress) { + this._hiPriInProgress = true; + // Don't worry about interactions when scrolling quickly; focus on filling content as fast + // as possible. + this._updateCellsToRenderBatcher.dispose({ + abort: true + }); + this._updateCellsToRender(); + return; + } else { + this._updateCellsToRenderBatcher.schedule(); + } + } + }, { + key: "_shouldRenderWithPriority", + value: function _shouldRenderWithPriority() { + var _this$state$cellsArou = this.state.cellsAroundViewport, + first = _this$state$cellsArou.first, + last = _this$state$cellsArou.last; + var _this$_scrollMetrics3 = this._scrollMetrics, + offset = _this$_scrollMetrics3.offset, + visibleLength = _this$_scrollMetrics3.visibleLength, + velocity = _this$_scrollMetrics3.velocity; + var itemCount = this.props.getItemCount(this.props.data); + var hiPri = false; + var onStartReachedThreshold = (0, _$$_REQUIRE(_dependencyMap[22], "./VirtualizedListProps").onStartReachedThresholdOrDefault)(this.props.onStartReachedThreshold); + var onEndReachedThreshold = (0, _$$_REQUIRE(_dependencyMap[22], "./VirtualizedListProps").onEndReachedThresholdOrDefault)(this.props.onEndReachedThreshold); + // Mark as high priority if we're close to the start of the first item + // But only if there are items before the first rendered item + if (first > 0) { + var distTop = offset - this._listMetrics.getCellMetricsApprox(first, this.props).offset; + hiPri = distTop < 0 || velocity < -2 && distTop < getScrollingThreshold(onStartReachedThreshold, visibleLength); + } + // Mark as high priority if we're close to the end of the last item + // But only if there are items after the last rendered item + if (!hiPri && last >= 0 && last < itemCount - 1) { + var distBottom = this._listMetrics.getCellMetricsApprox(last, this.props).offset - (offset + visibleLength); + hiPri = distBottom < 0 || velocity > 2 && distBottom < getScrollingThreshold(onEndReachedThreshold, visibleLength); + } + return hiPri; + } + }, { + key: "__getListMetrics", + value: function __getListMetrics() { + return this._listMetrics; + } + }, { + key: "_updateViewableItems", + value: function _updateViewableItems(props, cellsAroundViewport) { + var _this6 = this; + // If we have any pending scroll updates it means that the scroll metrics + // are out of date and we should not call any of the visibility callbacks. + if (this.state.pendingScrollUpdateCount > 0) { + return; + } + this._viewabilityTuples.forEach(function (tuple) { + tuple.viewabilityHelper.onUpdate(props, _this6._scrollMetrics.offset, _this6._scrollMetrics.visibleLength, _this6._listMetrics, _this6._createViewToken, tuple.onViewableItemsChanged, cellsAroundViewport); + }); + } + }], [{ + key: "_findItemIndexWithKey", + value: function _findItemIndexWithKey(props, key, hint) { + var itemCount = props.getItemCount(props.data); + if (hint != null && hint >= 0 && hint < itemCount) { + var curKey = VirtualizedList._getItemKey(props, hint); + if (curKey === key) { + return hint; + } + } + for (var ii = 0; ii < itemCount; ii++) { + var _curKey = VirtualizedList._getItemKey(props, ii); + if (_curKey === key) { + return ii; + } + } + return null; + } + }, { + key: "_getItemKey", + value: function _getItemKey(props, index) { + var item = props.getItem(props.data, index); + return VirtualizedList._keyExtractor(item, index, props); + } + }, { + key: "_createRenderMask", + value: function _createRenderMask(props, cellsAroundViewport, additionalRegions) { + var itemCount = props.getItemCount(props.data); + (0, _invariant.default)(cellsAroundViewport.first >= 0 && cellsAroundViewport.last >= cellsAroundViewport.first - 1 && cellsAroundViewport.last < itemCount, `Invalid cells around viewport "[${cellsAroundViewport.first}, ${cellsAroundViewport.last}]" was passed to VirtualizedList._createRenderMask`); + var renderMask = new (_$$_REQUIRE(_dependencyMap[25], "./CellRenderMask").CellRenderMask)(itemCount); + if (itemCount > 0) { + var allRegions = [cellsAroundViewport].concat((0, _toConsumableArray2.default)(additionalRegions != null ? additionalRegions : [])); + for (var region of allRegions) { + renderMask.addCells(region); + } + + // The initially rendered cells are retained as part of the + // "scroll-to-top" optimization + if (props.initialScrollIndex == null || props.initialScrollIndex <= 0) { + var initialRegion = VirtualizedList._initialRenderRegion(props); + renderMask.addCells(initialRegion); + } + + // The layout coordinates of sticker headers may be off-screen while the + // actual header is on-screen. Keep the most recent before the viewport + // rendered, even if its layout coordinates are not in viewport. + var stickyIndicesSet = new Set(props.stickyHeaderIndices); + VirtualizedList._ensureClosestStickyHeader(props, stickyIndicesSet, renderMask, cellsAroundViewport.first); + } + return renderMask; + } + }, { + key: "_initialRenderRegion", + value: function _initialRenderRegion(props) { + var _props$initialScrollI; + var itemCount = props.getItemCount(props.data); + var firstCellIndex = Math.max(0, Math.min(itemCount - 1, Math.floor((_props$initialScrollI = props.initialScrollIndex) != null ? _props$initialScrollI : 0))); + var lastCellIndex = Math.min(itemCount, firstCellIndex + (0, _$$_REQUIRE(_dependencyMap[22], "./VirtualizedListProps").initialNumToRenderOrDefault)(props.initialNumToRender)) - 1; + return { + first: firstCellIndex, + last: lastCellIndex + }; + } + }, { + key: "_ensureClosestStickyHeader", + value: function _ensureClosestStickyHeader(props, stickyIndicesSet, renderMask, cellIdx) { + var stickyOffset = props.ListHeaderComponent ? 1 : 0; + for (var itemIdx = cellIdx - 1; itemIdx >= 0; itemIdx--) { + if (stickyIndicesSet.has(itemIdx + stickyOffset)) { + renderMask.addCells({ + first: itemIdx, + last: itemIdx + }); + break; + } + } + } + }, { + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(newProps, prevState) { + var _newProps$maintainVis, _newProps$maintainVis2; + // first and last could be stale (e.g. if a new, shorter items props is passed in), so we make + // sure we're rendering a reasonable range here. + var itemCount = newProps.getItemCount(newProps.data); + if (itemCount === prevState.renderMask.numCells()) { + return prevState; + } + var maintainVisibleContentPositionAdjustment = null; + var prevFirstVisibleItemKey = prevState.firstVisibleItemKey; + var minIndexForVisible = (_newProps$maintainVis = (_newProps$maintainVis2 = newProps.maintainVisibleContentPosition) == null ? void 0 : _newProps$maintainVis2.minIndexForVisible) != null ? _newProps$maintainVis : 0; + var newFirstVisibleItemKey = newProps.getItemCount(newProps.data) > minIndexForVisible ? VirtualizedList._getItemKey(newProps, minIndexForVisible) : null; + if (newProps.maintainVisibleContentPosition != null && prevFirstVisibleItemKey != null && newFirstVisibleItemKey != null) { + if (newFirstVisibleItemKey !== prevFirstVisibleItemKey) { + // Fast path if items were added at the start of the list. + var hint = itemCount - prevState.renderMask.numCells() + minIndexForVisible; + var firstVisibleItemIndex = VirtualizedList._findItemIndexWithKey(newProps, prevFirstVisibleItemKey, hint); + maintainVisibleContentPositionAdjustment = firstVisibleItemIndex != null ? firstVisibleItemIndex - minIndexForVisible : null; + } else { + maintainVisibleContentPositionAdjustment = null; + } + } + var constrainedCells = VirtualizedList._constrainToItemCount(maintainVisibleContentPositionAdjustment != null ? { + first: prevState.cellsAroundViewport.first + maintainVisibleContentPositionAdjustment, + last: prevState.cellsAroundViewport.last + maintainVisibleContentPositionAdjustment + } : prevState.cellsAroundViewport, newProps); + return { + cellsAroundViewport: constrainedCells, + renderMask: VirtualizedList._createRenderMask(newProps, constrainedCells), + firstVisibleItemKey: newFirstVisibleItemKey, + pendingScrollUpdateCount: maintainVisibleContentPositionAdjustment != null ? prevState.pendingScrollUpdateCount + 1 : prevState.pendingScrollUpdateCount + }; + } + }, { + key: "_constrainToItemCount", + value: function _constrainToItemCount(cells, props) { + var itemCount = props.getItemCount(props.data); + var lastPossibleCellIndex = itemCount - 1; + + // Constraining `last` may significantly shrink the window. Adjust `first` + // to expand the window if the new `last` results in a new window smaller + // than the number of cells rendered per batch. + var maxToRenderPerBatch = (0, _$$_REQUIRE(_dependencyMap[22], "./VirtualizedListProps").maxToRenderPerBatchOrDefault)(props.maxToRenderPerBatch); + var maxFirst = Math.max(0, lastPossibleCellIndex - maxToRenderPerBatch); + return { + first: (0, _clamp.default)(0, cells.first, maxFirst), + last: Math.min(lastPossibleCellIndex, cells.last) + }; + } + }, { + key: "_keyExtractor", + value: function _keyExtractor(item, index, props) { + if (props.keyExtractor != null) { + return props.keyExtractor(item, index); + } + var key = (0, _$$_REQUIRE(_dependencyMap[23], "./VirtualizeUtils").keyExtractor)(item, index); + if (key === String(index)) { + _usedIndexForKey = true; + if (item.type && item.type.displayName) { + _keylessItemComponentName = item.type.displayName; + } + } + return key; + } + }]); + }(_StateSafePureComponent.default); + VirtualizedList.contextType = _$$_REQUIRE(_dependencyMap[24], "./VirtualizedListContext.js").VirtualizedListContext; + var styles = _reactNative.StyleSheet.create({ + verticallyInverted: _reactNative.Platform.OS === 'android' ? { + transform: [{ + scale: -1 + }] + } : { + transform: [{ + scaleY: -1 + }] + }, + horizontallyInverted: { + transform: [{ + scaleX: -1 + }] + }, + debug: { + flex: 1 + }, + debugOverlayBase: { + position: 'absolute', + top: 0, + right: 0 + }, + debugOverlay: { + bottom: 0, + width: 20, + borderColor: 'blue', + borderWidth: 1 + }, + debugOverlayFrame: { + left: 0, + backgroundColor: 'orange' + }, + debugOverlayFrameLast: { + left: 0, + borderColor: 'green', + borderWidth: 2 + }, + debugOverlayFrameVis: { + left: 0, + borderColor: 'red', + borderWidth: 2 + } + }); + module.exports = VirtualizedList; +},406,[6,41,217,18,19,23,25,28,15,407,408,409,410,411,412,413,414,415,37,52,65,106,417,405,416,418],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\VirtualizedList.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _classCallCheck = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/createClass"); + var _require = _$$_REQUIRE(_dependencyMap[2], "react-native"), + InteractionManager = _require.InteractionManager; + + /** + * A simple class for batching up invocations of a low-pri callback. A timeout is set to run the + * callback once after a delay, no matter how many times it's scheduled. Once the delay is reached, + * InteractionManager.runAfterInteractions is used to invoke the callback after any hi-pri + * interactions are done running. + * + * Make sure to cleanup with dispose(). Example: + * + * class Widget extends React.Component { + * _batchedSave: new Batchinator(() => this._saveState, 1000); + * _saveSate() { + * // save this.state to disk + * } + * componentDidUpdate() { + * this._batchedSave.schedule(); + * } + * componentWillUnmount() { + * this._batchedSave.dispose(); + * } + * ... + * } + */ + var Batchinator = /*#__PURE__*/function () { + function Batchinator(callback, delayMS) { + _classCallCheck(this, Batchinator); + this._delay = delayMS; + this._callback = callback; + } + /* + * Cleanup any pending tasks. + * + * By default, if there is a pending task the callback is run immediately. Set the option abort to + * true to not call the callback if it was pending. + */ + return _createClass(Batchinator, [{ + key: "dispose", + value: function dispose() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + abort: false + }; + if (this._taskHandle) { + this._taskHandle.cancel(); + if (!options.abort) { + this._callback(); + } + this._taskHandle = null; + } + } + }, { + key: "schedule", + value: function schedule() { + var _this = this; + if (this._taskHandle) { + return; + } + var timeoutHandle = setTimeout(function () { + _this._taskHandle = InteractionManager.runAfterInteractions(function () { + // Note that we clear the handle before invoking the callback so that if the callback calls + // schedule again, it will actually schedule another task. + _this._taskHandle = null; + _this._callback(); + }); + }, this._delay); + this._taskHandle = { + cancel: function cancel() { + return clearTimeout(timeoutHandle); + } + }; + } + }]); + }(); + module.exports = Batchinator; +},407,[18,19,15],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Interaction\\Batchinator.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + function clamp(min, value, max) { + if (value < min) { + return min; + } + if (value > max) { + return max; + } + return value; + } + module.exports = clamp; +},408,[],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Utilities\\clamp.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + /** + * Intentional info-level logging for clear separation from ad-hoc console debug logging. + */ + function infoLog() { + var _console; + return (_console = console).log.apply(_console, arguments); + } + module.exports = infoLog; +},409,[],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Utilities\\infoLog.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "invariant")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var ChildListCollection = exports.default = /*#__PURE__*/function () { + function ChildListCollection() { + (0, _classCallCheck2.default)(this, ChildListCollection); + this._cellKeyToChildren = new Map(); + this._childrenToCellKey = new Map(); + } + return (0, _createClass2.default)(ChildListCollection, [{ + key: "add", + value: function add(list, cellKey) { + var _this$_cellKeyToChild; + (0, _invariant.default)(!this._childrenToCellKey.has(list), 'Trying to add already present child list'); + var cellLists = (_this$_cellKeyToChild = this._cellKeyToChildren.get(cellKey)) != null ? _this$_cellKeyToChild : new Set(); + cellLists.add(list); + this._cellKeyToChildren.set(cellKey, cellLists); + this._childrenToCellKey.set(list, cellKey); + } + }, { + key: "remove", + value: function remove(list) { + var cellKey = this._childrenToCellKey.get(list); + (0, _invariant.default)(cellKey != null, 'Trying to remove non-present child list'); + this._childrenToCellKey.delete(list); + var cellLists = this._cellKeyToChildren.get(cellKey); + (0, _invariant.default)(cellLists, '_cellKeyToChildren should contain cellKey'); + cellLists.delete(list); + if (cellLists.size === 0) { + this._cellKeyToChildren.delete(cellKey); + } + } + }, { + key: "forEach", + value: function forEach(fn) { + for (var listSet of this._cellKeyToChildren.values()) { + for (var list of listSet) { + fn(list); + } + } + } + }, { + key: "forEachInCell", + value: function forEachInCell(cellKey, fn) { + var _this$_cellKeyToChild2; + var listSet = (_this$_cellKeyToChild2 = this._cellKeyToChildren.get(cellKey)) != null ? _this$_cellKeyToChild2 : []; + for (var list of listSet) { + fn(list); + } + } + }, { + key: "anyInCell", + value: function anyInCell(cellKey, fn) { + var _this$_cellKeyToChild3; + var listSet = (_this$_cellKeyToChild3 = this._cellKeyToChildren.get(cellKey)) != null ? _this$_cellKeyToChild3 : []; + for (var list of listSet) { + if (fn(list)) { + return true; + } + } + return false; + } + }, { + key: "size", + value: function size() { + return this._childrenToCellKey.size; + } + }]); + }(); +},410,[6,18,19,37],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\ChildListCollection.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/createClass")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _ListMetricsAggregator = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "./ListMetricsAggregator")); + var Info = /*#__PURE__*/(0, _createClass2.default)(function Info() { + (0, _classCallCheck2.default)(this, Info); + this.any_blank_count = 0; + this.any_blank_ms = 0; + this.any_blank_speed_sum = 0; + this.mostly_blank_count = 0; + this.mostly_blank_ms = 0; + this.pixels_blank = 0; + this.pixels_sampled = 0; + this.pixels_scrolled = 0; + this.total_time_spent = 0; + this.sample_count = 0; + }); + var DEBUG = false; + var _listeners = []; + var _minSampleCount = 10; + var _sampleRate = DEBUG ? 1 : null; + + /** + * A helper class for detecting when the maximem fill rate of `VirtualizedList` is exceeded. + * By default the sampling rate is set to zero and this will do nothing. If you want to collect + * samples (e.g. to log them), make sure to call `FillRateHelper.setSampleRate(0.0-1.0)`. + * + * Listeners and sample rate are global for all `VirtualizedList`s - typical usage will combine with + * `SceneTracker.getActiveScene` to determine the context of the events. + */ + var FillRateHelper = /*#__PURE__*/function () { + function FillRateHelper(listMetrics) { + (0, _classCallCheck2.default)(this, FillRateHelper); + this._anyBlankStartTime = null; + this._enabled = false; + this._info = new Info(); + this._mostlyBlankStartTime = null; + this._samplesStartTime = null; + this._listMetrics = listMetrics; + this._enabled = (_sampleRate || 0) > Math.random(); + this._resetData(); + } + return (0, _createClass2.default)(FillRateHelper, [{ + key: "activate", + value: function activate() { + if (this._enabled && this._samplesStartTime == null) { + DEBUG && console.debug('FillRateHelper: activate'); + this._samplesStartTime = global.performance.now(); + } + } + }, { + key: "deactivateAndFlush", + value: function deactivateAndFlush() { + if (!this._enabled) { + return; + } + var start = this._samplesStartTime; // const for flow + if (start == null) { + DEBUG && console.debug('FillRateHelper: bail on deactivate with no start time'); + return; + } + if (this._info.sample_count < _minSampleCount) { + // Don't bother with under-sampled events. + this._resetData(); + return; + } + var total_time_spent = global.performance.now() - start; + var info = Object.assign({}, this._info, { + total_time_spent: total_time_spent + }); + if (DEBUG) { + var derived = { + avg_blankness: this._info.pixels_blank / this._info.pixels_sampled, + avg_speed: this._info.pixels_scrolled / (total_time_spent / 1000), + avg_speed_when_any_blank: this._info.any_blank_speed_sum / this._info.any_blank_count, + any_blank_per_min: this._info.any_blank_count / (total_time_spent / 1000 / 60), + any_blank_time_frac: this._info.any_blank_ms / total_time_spent, + mostly_blank_per_min: this._info.mostly_blank_count / (total_time_spent / 1000 / 60), + mostly_blank_time_frac: this._info.mostly_blank_ms / total_time_spent + }; + for (var key in derived) { + // $FlowFixMe[prop-missing] + derived[key] = Math.round(1000 * derived[key]) / 1000; + } + console.debug('FillRateHelper deactivateAndFlush: ', { + derived: derived, + info: info + }); + } + _listeners.forEach(function (listener) { + return listener(info); + }); + this._resetData(); + } + }, { + key: "computeBlankness", + value: function computeBlankness(props, cellsAroundViewport, scrollMetrics) { + if (!this._enabled || props.getItemCount(props.data) === 0 || cellsAroundViewport.last < cellsAroundViewport.first || this._samplesStartTime == null) { + return 0; + } + var dOffset = scrollMetrics.dOffset, + offset = scrollMetrics.offset, + velocity = scrollMetrics.velocity, + visibleLength = scrollMetrics.visibleLength; + + // Denominator metrics that we track for all events - most of the time there is no blankness and + // we want to capture that. + this._info.sample_count++; + this._info.pixels_sampled += Math.round(visibleLength); + this._info.pixels_scrolled += Math.round(Math.abs(dOffset)); + var scrollSpeed = Math.round(Math.abs(velocity) * 1000); // px / sec + + // Whether blank now or not, record the elapsed time blank if we were blank last time. + var now = global.performance.now(); + if (this._anyBlankStartTime != null) { + this._info.any_blank_ms += now - this._anyBlankStartTime; + } + this._anyBlankStartTime = null; + if (this._mostlyBlankStartTime != null) { + this._info.mostly_blank_ms += now - this._mostlyBlankStartTime; + } + this._mostlyBlankStartTime = null; + var blankTop = 0; + var first = cellsAroundViewport.first; + var firstFrame = this._listMetrics.getCellMetrics(first, props); + while (first <= cellsAroundViewport.last && (!firstFrame || !firstFrame.isMounted)) { + firstFrame = this._listMetrics.getCellMetrics(first, props); + first++; + } + // Only count blankTop if we aren't rendering the first item, otherwise we will count the header + // as blank. + if (firstFrame && first > 0) { + blankTop = Math.min(visibleLength, Math.max(0, firstFrame.offset - offset)); + } + var blankBottom = 0; + var last = cellsAroundViewport.last; + var lastFrame = this._listMetrics.getCellMetrics(last, props); + while (last >= cellsAroundViewport.first && (!lastFrame || !lastFrame.isMounted)) { + lastFrame = this._listMetrics.getCellMetrics(last, props); + last--; + } + // Only count blankBottom if we aren't rendering the last item, otherwise we will count the + // footer as blank. + if (lastFrame && last < props.getItemCount(props.data) - 1) { + var bottomEdge = lastFrame.offset + lastFrame.length; + blankBottom = Math.min(visibleLength, Math.max(0, offset + visibleLength - bottomEdge)); + } + var pixels_blank = Math.round(blankTop + blankBottom); + var blankness = pixels_blank / visibleLength; + if (blankness > 0) { + this._anyBlankStartTime = now; + this._info.any_blank_speed_sum += scrollSpeed; + this._info.any_blank_count++; + this._info.pixels_blank += pixels_blank; + if (blankness > 0.5) { + this._mostlyBlankStartTime = now; + this._info.mostly_blank_count++; + } + } else if (scrollSpeed < 0.01 || Math.abs(dOffset) < 1) { + this.deactivateAndFlush(); + } + return blankness; + } + }, { + key: "enabled", + value: function enabled() { + return this._enabled; + } + }, { + key: "_resetData", + value: function _resetData() { + this._anyBlankStartTime = null; + this._info = new Info(); + this._mostlyBlankStartTime = null; + this._samplesStartTime = null; + } + }], [{ + key: "addListener", + value: function addListener(callback) { + if (_sampleRate === null) { + console.warn('Call `FillRateHelper.setSampleRate` before `addListener`.'); + } + _listeners.push(callback); + return { + remove: function remove() { + _listeners = _listeners.filter(function (listener) { + return callback !== listener; + }); + } + }; + } + }, { + key: "setSampleRate", + value: function setSampleRate(sampleRate) { + _sampleRate = sampleRate; + } + }, { + key: "setMinSampleCount", + value: function setMinSampleCount(minSampleCount) { + _minSampleCount = minSampleCount; + } + }]); + }(); + module.exports = FillRateHelper; +},411,[6,19,18,412],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\FillRateHelper.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "invariant")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + // TODO: `inverted` can be incorporated here if it is moved to an order + // based implementation instead of transform. + /** + * Subset of VirtualizedList props needed to calculate cell metrics + */ + /** + * Provides an interface to query information about the metrics of a list and its cells. + */ + var ListMetricsAggregator = exports.default = /*#__PURE__*/function () { + function ListMetricsAggregator() { + (0, _classCallCheck2.default)(this, ListMetricsAggregator); + this._averageCellLength = 0; + this._cellMetrics = new Map(); + this._highestMeasuredCellIndex = 0; + this._measuredCellsLength = 0; + this._measuredCellsCount = 0; + this._orientation = { + horizontal: false, + rtl: false + }; + } + return (0, _createClass2.default)(ListMetricsAggregator, [{ + key: "notifyCellLayout", + value: + /** + * Notify the ListMetricsAggregator that a cell has been laid out. + * + * @returns whether the cell layout has changed since last notification + */ + function notifyCellLayout(_ref) { + var cellIndex = _ref.cellIndex, + cellKey = _ref.cellKey, + orientation = _ref.orientation, + layout = _ref.layout; + this._invalidateIfOrientationChanged(orientation); + var next = { + index: cellIndex, + length: this._selectLength(layout), + isMounted: true, + offset: this.flowRelativeOffset(layout) + }; + var curr = this._cellMetrics.get(cellKey); + if (!curr || next.offset !== curr.offset || next.length !== curr.length) { + if (curr) { + var dLength = next.length - curr.length; + this._measuredCellsLength += dLength; + } else { + this._measuredCellsLength += next.length; + this._measuredCellsCount += 1; + } + this._averageCellLength = this._measuredCellsLength / this._measuredCellsCount; + this._cellMetrics.set(cellKey, next); + this._highestMeasuredCellIndex = Math.max(this._highestMeasuredCellIndex, cellIndex); + return true; + } else { + curr.isMounted = true; + return false; + } + } + + /** + * Notify ListMetricsAggregator that a cell has been unmounted. + */ + }, { + key: "notifyCellUnmounted", + value: function notifyCellUnmounted(cellKey) { + var curr = this._cellMetrics.get(cellKey); + if (curr) { + curr.isMounted = false; + } + } + + /** + * Notify ListMetricsAggregator that the lists content container has been laid out. + */ + }, { + key: "notifyListContentLayout", + value: function notifyListContentLayout(_ref2) { + var orientation = _ref2.orientation, + layout = _ref2.layout; + this._invalidateIfOrientationChanged(orientation); + this._contentLength = this._selectLength(layout); + } + + /** + * Return the average length of the cells which have been measured + */ + }, { + key: "getAverageCellLength", + value: function getAverageCellLength() { + return this._averageCellLength; + } + + /** + * Return the highest measured cell index (or 0 if nothing has been measured + * yet) + */ + }, { + key: "getHighestMeasuredCellIndex", + value: function getHighestMeasuredCellIndex() { + return this._highestMeasuredCellIndex; + } + + /** + * Returns the exact metrics of a cell if it has already been laid out, + * otherwise an estimate based on the average length of previously measured + * cells + */ + }, { + key: "getCellMetricsApprox", + value: function getCellMetricsApprox(index, props) { + var frame = this.getCellMetrics(index, props); + if (frame && frame.index === index) { + // check for invalid frames due to row re-ordering + return frame; + } else { + var data = props.data, + getItemCount = props.getItemCount; + (0, _invariant.default)(index >= 0 && index < getItemCount(data), 'Tried to get frame for out of range index ' + index); + return { + length: this._averageCellLength, + offset: this._averageCellLength * index, + index: index, + isMounted: false + }; + } + } + + /** + * Returns the exact metrics of a cell if it has already been laid out + */ + }, { + key: "getCellMetrics", + value: function getCellMetrics(index, props) { + var _props$keyExtractor; + var data = props.data, + getItem = props.getItem, + getItemCount = props.getItemCount, + getItemLayout = props.getItemLayout; + (0, _invariant.default)(index >= 0 && index < getItemCount(data), 'Tried to get metrics for out of range cell index ' + index); + var keyExtractor = (_props$keyExtractor = props.keyExtractor) != null ? _props$keyExtractor : _$$_REQUIRE(_dependencyMap[4], "./VirtualizeUtils").keyExtractor; + var frame = this._cellMetrics.get(keyExtractor(getItem(data, index), index)); + if (frame && frame.index === index) { + return frame; + } + if (getItemLayout) { + var _getItemLayout = getItemLayout(data, index), + length = _getItemLayout.length, + offset = _getItemLayout.offset; + // TODO: `isMounted` is used for both "is exact layout" and "has been + // unmounted". Should be refactored. + return { + index: index, + length: length, + offset: offset, + isMounted: true + }; + } + return null; + } + + /** + * Gets an approximate offset to an item at a given index. Supports + * fractional indices. + */ + }, { + key: "getCellOffsetApprox", + value: function getCellOffsetApprox(index, props) { + if (Number.isInteger(index)) { + return this.getCellMetricsApprox(index, props).offset; + } else { + var frameMetrics = this.getCellMetricsApprox(Math.floor(index), props); + var remainder = index - Math.floor(index); + return frameMetrics.offset + remainder * frameMetrics.length; + } + } + + /** + * Returns the length of all ScrollView content along the scrolling axis. + */ + }, { + key: "getContentLength", + value: function getContentLength() { + var _this$_contentLength; + return (_this$_contentLength = this._contentLength) != null ? _this$_contentLength : 0; + } + + /** + * Whether a content length has been observed + */ + }, { + key: "hasContentLength", + value: function hasContentLength() { + return this._contentLength != null; + } + + /** + * Finds the flow-relative offset (e.g. starting from the left in LTR, but + * right in RTL) from a layout box. + */ + }, { + key: "flowRelativeOffset", + value: function flowRelativeOffset(layout, referenceContentLength) { + var _this$_orientation = this._orientation, + horizontal = _this$_orientation.horizontal, + rtl = _this$_orientation.rtl; + if (horizontal && rtl) { + var contentLength = referenceContentLength != null ? referenceContentLength : this._contentLength; + (0, _invariant.default)(contentLength != null, 'ListMetricsAggregator must be notified of list content layout before resolving offsets'); + return contentLength - (this._selectOffset(layout) + this._selectLength(layout)); + } else { + return this._selectOffset(layout); + } + } + + /** + * Converts a flow-relative offset to a cartesian offset + */ + }, { + key: "cartesianOffset", + value: function cartesianOffset(flowRelativeOffset) { + var _this$_orientation2 = this._orientation, + horizontal = _this$_orientation2.horizontal, + rtl = _this$_orientation2.rtl; + if (horizontal && rtl) { + (0, _invariant.default)(this._contentLength != null, 'ListMetricsAggregator must be notified of list content layout before resolving offsets'); + return this._contentLength - flowRelativeOffset; + } else { + return flowRelativeOffset; + } + } + }, { + key: "_invalidateIfOrientationChanged", + value: function _invalidateIfOrientationChanged(orientation) { + if (orientation.rtl !== this._orientation.rtl) { + this._cellMetrics.clear(); + } + if (orientation.horizontal !== this._orientation.horizontal) { + this._averageCellLength = 0; + this._highestMeasuredCellIndex = 0; + this._measuredCellsLength = 0; + this._measuredCellsCount = 0; + } + this._orientation = orientation; + } + }, { + key: "_selectLength", + value: function _selectLength(_ref3) { + var width = _ref3.width, + height = _ref3.height; + return this._orientation.horizontal ? width : height; + } + }, { + key: "_selectOffset", + value: function _selectOffset(_ref4) { + var x = _ref4.x, + y = _ref4.y; + return this._orientation.horizontal ? x : y; + } + }]); + }(); +},412,[6,18,19,37,405],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\ListMetricsAggregator.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _get2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/get")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "invariant")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + /** + * `setState` is called asynchronously, and should not rely on the value of + * `this.props` or `this.state`: + * https://react.dev/docs/state-and-lifecycle.html#state-updates-may-be-asynchronous + * + * SafePureComponent adds runtime enforcement, to catch cases where these + * variables are read in a state updater function, instead of the ones passed + * in. + */ + var StateSafePureComponent = exports.default = /*#__PURE__*/function (_React$PureComponent) { + function StateSafePureComponent(props) { + var _this; + (0, _classCallCheck2.default)(this, StateSafePureComponent); + _this = _callSuper(this, StateSafePureComponent, [props]); + _this._inAsyncStateUpdate = false; + _this._installSetStateHooks(); + return _this; + } + (0, _inherits2.default)(StateSafePureComponent, _React$PureComponent); + return (0, _createClass2.default)(StateSafePureComponent, [{ + key: "setState", + value: function setState(partialState, callback) { + var _this2 = this; + if (typeof partialState === 'function') { + _superPropGet(StateSafePureComponent, "setState", this, 3)([function (state, props) { + _this2._inAsyncStateUpdate = true; + var ret; + try { + ret = partialState(state, props); + } catch (err) { + throw err; + } finally { + _this2._inAsyncStateUpdate = false; + } + return ret; + }, callback]); + } else { + _superPropGet(StateSafePureComponent, "setState", this, 3)([partialState, callback]); + } + } + }, { + key: "_installSetStateHooks", + value: function _installSetStateHooks() { + var that = this; + var props = this.props, + state = this.state; + Object.defineProperty(this, 'props', { + get: function get() { + (0, _invariant.default)(!that._inAsyncStateUpdate, '"this.props" should not be accessed during state updates'); + return props; + }, + set: function set(newProps) { + props = newProps; + } + }); + Object.defineProperty(this, 'state', { + get: function get() { + (0, _invariant.default)(!that._inAsyncStateUpdate, '"this.state" should not be acceessed during state updates'); + return state; + }, + set: function set(newState) { + state = newState; + } + }); + } + }]); + }(React.PureComponent); +},413,[6,18,19,23,25,26,28,37,65],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\StateSafePureComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/createClass")); + var _ListMetricsAggregator = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "./ListMetricsAggregator")); + /** + * A Utility class for calculating viewable items based on current metrics like scroll position and + * layout. + * + * An item is said to be in a "viewable" state when any of the following + * is true for longer than `minimumViewTime` milliseconds (after an interaction if `waitForInteraction` + * is true): + * + * - Occupying >= `viewAreaCoveragePercentThreshold` of the view area XOR fraction of the item + * visible in the view area >= `itemVisiblePercentThreshold`. + * - Entirely visible on screen + */ + var ViewabilityHelper = /*#__PURE__*/function () { + function ViewabilityHelper() { + var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + viewAreaCoveragePercentThreshold: 0 + }; + (0, _classCallCheck2.default)(this, ViewabilityHelper); + this._hasInteracted = false; + this._timers = new Set(); + this._viewableIndices = []; + this._viewableItems = new Map(); + this._config = config; + } + + /** + * Cleanup, e.g. on unmount. Clears any pending timers. + */ + return (0, _createClass2.default)(ViewabilityHelper, [{ + key: "dispose", + value: function dispose() { + /* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This + * comment suppresses an error found when Flow v0.63 was deployed. To see + * the error delete this comment and run Flow. */ + this._timers.forEach(clearTimeout); + } + + /** + * Determines which items are viewable based on the current metrics and config. + */ + }, { + key: "computeViewableItems", + value: function computeViewableItems(props, scrollOffset, viewportHeight, listMetrics, + // Optional optimization to reduce the scan size + renderRange) { + var itemCount = props.getItemCount(props.data); + var _this$_config = this._config, + itemVisiblePercentThreshold = _this$_config.itemVisiblePercentThreshold, + viewAreaCoveragePercentThreshold = _this$_config.viewAreaCoveragePercentThreshold; + var viewAreaMode = viewAreaCoveragePercentThreshold != null; + var viewablePercentThreshold = viewAreaMode ? viewAreaCoveragePercentThreshold : itemVisiblePercentThreshold; + _$$_REQUIRE(_dependencyMap[5], "invariant")(viewablePercentThreshold != null && itemVisiblePercentThreshold != null !== (viewAreaCoveragePercentThreshold != null), 'Must set exactly one of itemVisiblePercentThreshold or viewAreaCoveragePercentThreshold'); + var viewableIndices = []; + if (itemCount === 0) { + return viewableIndices; + } + var firstVisible = -1; + var _ref = renderRange || { + first: 0, + last: itemCount - 1 + }, + first = _ref.first, + last = _ref.last; + if (last >= itemCount) { + console.warn('Invalid render range computing viewability ' + JSON.stringify({ + renderRange: renderRange, + itemCount: itemCount + })); + return []; + } + for (var idx = first; idx <= last; idx++) { + var metrics = listMetrics.getCellMetrics(idx, props); + if (!metrics) { + continue; + } + var top = Math.floor(metrics.offset - scrollOffset); + var bottom = Math.floor(top + metrics.length); + if (top < viewportHeight && bottom > 0) { + firstVisible = idx; + if (_isViewable(viewAreaMode, viewablePercentThreshold, top, bottom, viewportHeight, metrics.length)) { + viewableIndices.push(idx); + } + } else if (firstVisible >= 0) { + break; + } + } + return viewableIndices; + } + + /** + * Figures out which items are viewable and how that has changed from before and calls + * `onViewableItemsChanged` as appropriate. + */ + }, { + key: "onUpdate", + value: function onUpdate(props, scrollOffset, viewportHeight, listMetrics, createViewToken, onViewableItemsChanged, + // Optional optimization to reduce the scan size + renderRange) { + var _this = this; + var itemCount = props.getItemCount(props.data); + if (this._config.waitForInteraction && !this._hasInteracted || itemCount === 0 || !listMetrics.getCellMetrics(0, props)) { + return; + } + var viewableIndices = []; + if (itemCount) { + viewableIndices = this.computeViewableItems(props, scrollOffset, viewportHeight, listMetrics, renderRange); + } + if (this._viewableIndices.length === viewableIndices.length && this._viewableIndices.every(function (v, ii) { + return v === viewableIndices[ii]; + })) { + // We might get a lot of scroll events where visibility doesn't change and we don't want to do + // extra work in those cases. + return; + } + this._viewableIndices = viewableIndices; + if (this._config.minimumViewTime) { + var handle = setTimeout(function () { + /* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This + * comment suppresses an error found when Flow v0.63 was deployed. To + * see the error delete this comment and run Flow. */ + _this._timers.delete(handle); + _this._onUpdateSync(props, viewableIndices, onViewableItemsChanged, createViewToken); + }, this._config.minimumViewTime); + /* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This + * comment suppresses an error found when Flow v0.63 was deployed. To see + * the error delete this comment and run Flow. */ + this._timers.add(handle); + } else { + this._onUpdateSync(props, viewableIndices, onViewableItemsChanged, createViewToken); + } + } + + /** + * clean-up cached _viewableIndices to evaluate changed items on next update + */ + }, { + key: "resetViewableIndices", + value: function resetViewableIndices() { + this._viewableIndices = []; + } + + /** + * Records that an interaction has happened even if there has been no scroll. + */ + }, { + key: "recordInteraction", + value: function recordInteraction() { + this._hasInteracted = true; + } + }, { + key: "_onUpdateSync", + value: function _onUpdateSync(props, viewableIndicesToCheck, onViewableItemsChanged, createViewToken) { + var _this2 = this; + // Filter out indices that have gone out of view since this call was scheduled. + viewableIndicesToCheck = viewableIndicesToCheck.filter(function (ii) { + return _this2._viewableIndices.includes(ii); + }); + var prevItems = this._viewableItems; + var nextItems = new Map(viewableIndicesToCheck.map(function (ii) { + var viewable = createViewToken(ii, true, props); + return [viewable.key, viewable]; + })); + var changed = []; + for (var _ref2 of nextItems) { + var _ref3 = (0, _slicedToArray2.default)(_ref2, 2); + var key = _ref3[0]; + var viewable = _ref3[1]; + if (!prevItems.has(key)) { + changed.push(viewable); + } + } + for (var _ref4 of prevItems) { + var _ref5 = (0, _slicedToArray2.default)(_ref4, 2); + var _key = _ref5[0]; + var _viewable = _ref5[1]; + if (!nextItems.has(_key)) { + changed.push(Object.assign({}, _viewable, { + isViewable: false + })); + } + } + if (changed.length > 0) { + this._viewableItems = nextItems; + onViewableItemsChanged({ + viewableItems: Array.from(nextItems.values()), + changed: changed, + viewabilityConfig: this._config + }); + } + } + }]); + }(); + function _isViewable(viewAreaMode, viewablePercentThreshold, top, bottom, viewportHeight, itemLength) { + if (_isEntirelyVisible(top, bottom, viewportHeight)) { + return true; + } else { + var pixels = _getPixelsVisible(top, bottom, viewportHeight); + var percent = 100 * (viewAreaMode ? pixels / viewportHeight : pixels / itemLength); + return percent >= viewablePercentThreshold; + } + } + function _getPixelsVisible(top, bottom, viewportHeight) { + var visibleHeight = Math.min(bottom, viewportHeight) - Math.max(top, 0); + return Math.max(0, visibleHeight); + } + function _isEntirelyVisible(top, bottom, viewportHeight) { + return top >= 0 && bottom <= viewportHeight && bottom > top; + } + module.exports = ViewabilityHelper; +},414,[6,7,18,19,412,37],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\ViewabilityHelper.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _reactNative = _$$_REQUIRE(_dependencyMap[6], "react-native"); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "invariant")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[9], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\VirtualizedListCellRenderer.js"; + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var CellRenderer = exports.default = /*#__PURE__*/function (_React$Component) { + function CellRenderer() { + var _this; + (0, _classCallCheck2.default)(this, CellRenderer); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, CellRenderer, [].concat(args)); + _this.state = { + separatorProps: { + highlighted: false, + leadingItem: _this.props.item + } + }; + // TODO: consider factoring separator stuff out of VirtualizedList into FlatList since it's not + // reused by SectionList and we can keep VirtualizedList simpler. + // $FlowFixMe[missing-local-annot] + _this._separators = { + highlight: function highlight() { + var _this$props = _this.props, + cellKey = _this$props.cellKey, + prevCellKey = _this$props.prevCellKey; + _this.props.onUpdateSeparators([cellKey, prevCellKey], { + highlighted: true + }); + }, + unhighlight: function unhighlight() { + var _this$props2 = _this.props, + cellKey = _this$props2.cellKey, + prevCellKey = _this$props2.prevCellKey; + _this.props.onUpdateSeparators([cellKey, prevCellKey], { + highlighted: false + }); + }, + updateProps: function updateProps(select, newProps) { + var _this$props3 = _this.props, + cellKey = _this$props3.cellKey, + prevCellKey = _this$props3.prevCellKey; + _this.props.onUpdateSeparators([select === 'leading' ? prevCellKey : cellKey], newProps); + } + }; + _this._onLayout = function (nativeEvent) { + _this.props.onCellLayout && _this.props.onCellLayout(nativeEvent, _this.props.cellKey, _this.props.index); + }; + return _this; + } + (0, _inherits2.default)(CellRenderer, _React$Component); + return (0, _createClass2.default)(CellRenderer, [{ + key: "updateSeparatorProps", + value: function updateSeparatorProps(newProps) { + this.setState(function (state) { + return { + separatorProps: Object.assign({}, state.separatorProps, newProps) + }; + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.props.onUnmount(this.props.cellKey); + } + }, { + key: "_renderElement", + value: function _renderElement(renderItem, ListItemComponent, item, index) { + if (renderItem && ListItemComponent) { + console.warn('VirtualizedList: Both ListItemComponent and renderItem props are present. ListItemComponent will take' + ' precedence over renderItem.'); + } + if (ListItemComponent) { + /* $FlowFixMe[not-a-component] (>=0.108.0 site=react_native_fb) This + * comment suppresses an error found when Flow v0.108 was deployed. To + * see the error, delete this comment and run Flow. */ + /* $FlowFixMe[incompatible-type-arg] (>=0.108.0 site=react_native_fb) + * This comment suppresses an error found when Flow v0.108 was deployed. + * To see the error, delete this comment and run Flow. */ + return React.createElement(ListItemComponent, { + item: item, + index: index, + separators: this._separators + }); + } + if (renderItem) { + return renderItem({ + item: item, + index: index, + separators: this._separators + }); + } + (0, _invariant.default)(false, 'VirtualizedList: Either ListItemComponent or renderItem props are required but none were found.'); + } + }, { + key: "render", + value: function render() { + var _this$props4 = this.props, + CellRendererComponent = _this$props4.CellRendererComponent, + ItemSeparatorComponent = _this$props4.ItemSeparatorComponent, + ListItemComponent = _this$props4.ListItemComponent, + cellKey = _this$props4.cellKey, + horizontal = _this$props4.horizontal, + item = _this$props4.item, + index = _this$props4.index, + inversionStyle = _this$props4.inversionStyle, + onCellFocusCapture = _this$props4.onCellFocusCapture, + onCellLayout = _this$props4.onCellLayout, + renderItem = _this$props4.renderItem; + var element = this._renderElement(renderItem, ListItemComponent, item, index); + + // NOTE: that when this is a sticky header, `onLayout` will get automatically extracted and + // called explicitly by `ScrollViewStickyHeader`. + var itemSeparator = React.isValidElement(ItemSeparatorComponent) ? + // $FlowFixMe[incompatible-type] + ItemSeparatorComponent : + // $FlowFixMe[incompatible-type] + ItemSeparatorComponent && /*#__PURE__*/(0, _jsxRuntime.jsx)(ItemSeparatorComponent, Object.assign({}, this.state.separatorProps)); + var cellStyle = inversionStyle ? horizontal ? [styles.rowReverse, inversionStyle] : [styles.columnReverse, inversionStyle] : horizontal ? [styles.row, inversionStyle] : inversionStyle; + var result = !CellRendererComponent ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, Object.assign({ + style: cellStyle, + onFocusCapture: onCellFocusCapture + }, onCellLayout && { + onLayout: this._onLayout + }, { + children: [element, itemSeparator] + })) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(CellRendererComponent, Object.assign({ + cellKey: cellKey, + index: index, + item: item, + style: cellStyle, + onFocusCapture: onCellFocusCapture + }, onCellLayout && { + onLayout: this._onLayout + }, { + children: [element, itemSeparator] + })); + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[10], "./VirtualizedListContext.js").VirtualizedListCellContextProvider, { + cellKey: this.props.cellKey, + children: result + }); + } + }], [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(props, prevState) { + return { + separatorProps: Object.assign({}, prevState.separatorProps, { + leadingItem: props.item + }) + }; + } + }]); + }(React.Component); + var styles = _reactNative.StyleSheet.create({ + row: { + flexDirection: 'row' + }, + rowReverse: { + flexDirection: 'row-reverse' + }, + columnReverse: { + flexDirection: 'column-reverse' + } + }); +},415,[6,18,19,23,25,28,15,37,65,106,416],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\VirtualizedListCellRenderer.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.VirtualizedListCellContextProvider = VirtualizedListCellContextProvider; + exports.VirtualizedListContext = void 0; + exports.VirtualizedListContextProvider = VirtualizedListContextProvider; + exports.VirtualizedListContextResetter = VirtualizedListContextResetter; + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "react")); + var React = _react; + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[1], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\VirtualizedListContext.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + var VirtualizedListContext = exports.VirtualizedListContext = React.createContext(null); + if (__DEV__) { + VirtualizedListContext.displayName = 'VirtualizedListContext'; + } + + /** + * Resets the context. Intended for use by portal-like components (e.g. Modal). + */ + function VirtualizedListContextResetter(_ref) { + var children = _ref.children; + return /*#__PURE__*/(0, _jsxRuntime.jsx)(VirtualizedListContext.Provider, { + value: null, + children: children + }); + } + + /** + * Sets the context with memoization. Intended to be used by `VirtualizedList`. + */ + function VirtualizedListContextProvider(_ref2) { + var children = _ref2.children, + value = _ref2.value; + // Avoid setting a newly created context object if the values are identical. + var context = (0, _react.useMemo)(function () { + return { + cellKey: null, + getScrollMetrics: value.getScrollMetrics, + horizontal: value.horizontal, + getOutermostParentListRef: value.getOutermostParentListRef, + registerAsNestedChild: value.registerAsNestedChild, + unregisterAsNestedChild: value.unregisterAsNestedChild + }; + }, [value.getScrollMetrics, value.horizontal, value.getOutermostParentListRef, value.registerAsNestedChild, value.unregisterAsNestedChild]); + return /*#__PURE__*/(0, _jsxRuntime.jsx)(VirtualizedListContext.Provider, { + value: context, + children: children + }); + } + + /** + * Sets the `cellKey`. Intended to be used by `VirtualizedList` for each cell. + */ + function VirtualizedListCellContextProvider(_ref3) { + var cellKey = _ref3.cellKey, + children = _ref3.children; + // Avoid setting a newly created context object if the values are identical. + var currContext = (0, _react.useContext)(VirtualizedListContext); + var context = (0, _react.useMemo)(function () { + return currContext == null ? null : Object.assign({}, currContext, { + cellKey: cellKey + }); + }, [currContext, cellKey]); + return /*#__PURE__*/(0, _jsxRuntime.jsx)(VirtualizedListContext.Provider, { + value: context, + children: children + }); + } +},416,[65,106],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\VirtualizedListContext.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.horizontalOrDefault = horizontalOrDefault; + exports.initialNumToRenderOrDefault = initialNumToRenderOrDefault; + exports.maxToRenderPerBatchOrDefault = maxToRenderPerBatchOrDefault; + exports.onEndReachedThresholdOrDefault = onEndReachedThresholdOrDefault; + exports.onStartReachedThresholdOrDefault = onStartReachedThresholdOrDefault; + exports.windowSizeOrDefault = windowSizeOrDefault; + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /** + * Default Props Helper Functions + * Use the following helper functions for default values + */ + + // horizontalOrDefault(this.props.horizontal) + function horizontalOrDefault(horizontal) { + return horizontal != null ? horizontal : false; + } + + // initialNumToRenderOrDefault(this.props.initialNumToRender) + function initialNumToRenderOrDefault(initialNumToRender) { + return initialNumToRender != null ? initialNumToRender : 10; + } + + // maxToRenderPerBatchOrDefault(this.props.maxToRenderPerBatch) + function maxToRenderPerBatchOrDefault(maxToRenderPerBatch) { + return maxToRenderPerBatch != null ? maxToRenderPerBatch : 10; + } + + // onStartReachedThresholdOrDefault(this.props.onStartReachedThreshold) + function onStartReachedThresholdOrDefault(onStartReachedThreshold) { + return onStartReachedThreshold != null ? onStartReachedThreshold : 2; + } + + // onEndReachedThresholdOrDefault(this.props.onEndReachedThreshold) + function onEndReachedThresholdOrDefault(onEndReachedThreshold) { + return onEndReachedThreshold != null ? onEndReachedThreshold : 2; + } + + // windowSizeOrDefault(this.props.windowSize) + function windowSizeOrDefault(windowSize) { + return windowSize != null ? windowSize : 21; + } +},417,[65],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\VirtualizedListProps.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.CellRenderMask = void 0; + var _toConsumableArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/toConsumableArray")); + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/slicedToArray")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/createClass")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "invariant")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var CellRenderMask = exports.CellRenderMask = /*#__PURE__*/function () { + function CellRenderMask(numCells) { + (0, _classCallCheck2.default)(this, CellRenderMask); + (0, _invariant.default)(numCells >= 0, 'CellRenderMask must contain a non-negative number os cells'); + this._numCells = numCells; + if (numCells === 0) { + this._regions = []; + } else { + this._regions = [{ + first: 0, + last: numCells - 1, + isSpacer: true + }]; + } + } + return (0, _createClass2.default)(CellRenderMask, [{ + key: "enumerateRegions", + value: function enumerateRegions() { + return this._regions; + } + }, { + key: "addCells", + value: function addCells(cells) { + var _this$_regions; + (0, _invariant.default)(cells.first >= 0 && cells.first < this._numCells && cells.last >= -1 && cells.last < this._numCells && cells.last >= cells.first - 1, 'CellRenderMask.addCells called with invalid cell range'); + + // VirtualizedList uses inclusive ranges, where zero-count states are + // possible. E.g. [0, -1] for no cells, starting at 0. + if (cells.last < cells.first) { + return; + } + var _this$_findRegion = this._findRegion(cells.first), + _this$_findRegion2 = (0, _slicedToArray2.default)(_this$_findRegion, 2), + firstIntersect = _this$_findRegion2[0], + firstIntersectIdx = _this$_findRegion2[1]; + var _this$_findRegion3 = this._findRegion(cells.last), + _this$_findRegion4 = (0, _slicedToArray2.default)(_this$_findRegion3, 2), + lastIntersect = _this$_findRegion4[0], + lastIntersectIdx = _this$_findRegion4[1]; + + // Fast-path if the cells to add are already all present in the mask. We + // will otherwise need to do some mutation. + if (firstIntersectIdx === lastIntersectIdx && !firstIntersect.isSpacer) { + return; + } + + // We need to replace the existing covered regions with 1-3 new regions + // depending whether we need to split spacers out of overlapping regions. + var newLeadRegion = []; + var newTailRegion = []; + var newMainRegion = Object.assign({}, cells, { + isSpacer: false + }); + if (firstIntersect.first < newMainRegion.first) { + if (firstIntersect.isSpacer) { + newLeadRegion.push({ + first: firstIntersect.first, + last: newMainRegion.first - 1, + isSpacer: true + }); + } else { + newMainRegion.first = firstIntersect.first; + } + } + if (lastIntersect.last > newMainRegion.last) { + if (lastIntersect.isSpacer) { + newTailRegion.push({ + first: newMainRegion.last + 1, + last: lastIntersect.last, + isSpacer: true + }); + } else { + newMainRegion.last = lastIntersect.last; + } + } + var replacementRegions = [].concat(newLeadRegion, [newMainRegion], newTailRegion); + var numRegionsToDelete = lastIntersectIdx - firstIntersectIdx + 1; + (_this$_regions = this._regions).splice.apply(_this$_regions, [firstIntersectIdx, numRegionsToDelete].concat((0, _toConsumableArray2.default)(replacementRegions))); + } + }, { + key: "numCells", + value: function numCells() { + return this._numCells; + } + }, { + key: "equals", + value: function equals(other) { + return this._numCells === other._numCells && this._regions.length === other._regions.length && this._regions.every(function (region, i) { + return region.first === other._regions[i].first && region.last === other._regions[i].last && region.isSpacer === other._regions[i].isSpacer; + }); + } + }, { + key: "_findRegion", + value: function _findRegion(cellIdx) { + var firstIdx = 0; + var lastIdx = this._regions.length - 1; + while (firstIdx <= lastIdx) { + var middleIdx = Math.floor((firstIdx + lastIdx) / 2); + var middleRegion = this._regions[middleIdx]; + if (cellIdx >= middleRegion.first && cellIdx <= middleRegion.last) { + return [middleRegion, middleIdx]; + } else if (cellIdx < middleRegion.first) { + lastIdx = middleIdx - 1; + } else if (cellIdx > middleRegion.last) { + firstIdx = middleIdx + 1; + } + } + (0, _invariant.default)(false, `A region was not found containing cellIdx ${cellIdx}`); + } + }]); + }(); +},418,[6,41,7,18,19,37],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\CellRenderMask.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _objectWithoutProperties2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/objectWithoutProperties")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "@babel/runtime/helpers/inherits")); + var _reactNative = _$$_REQUIRE(_dependencyMap[8], "react-native"); + var _VirtualizedList = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./VirtualizedList")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "invariant")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[12], "react/jsx-runtime"); + var _excluded = ["ItemSeparatorComponent", "SectionSeparatorComponent", "renderItem", "renderSectionFooter", "renderSectionHeader", "sections", "stickySectionHeadersEnabled"]; + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\VirtualizedSectionList.js"; + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + /** + * Right now this just flattens everything into one list and uses VirtualizedList under the + * hood. The only operation that might not scale well is concatting the data arrays of all the + * sections when new props are received, which should be plenty fast for up to ~10,000 items. + */ + var VirtualizedSectionList = /*#__PURE__*/function (_React$PureComponent) { + function VirtualizedSectionList() { + var _this; + (0, _classCallCheck2.default)(this, VirtualizedSectionList); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, VirtualizedSectionList, [].concat(args)); + // $FlowFixMe[missing-local-annot] + _this._keyExtractor = function (item, index) { + var info = _this._subExtractor(index); + return info && info.key || String(index); + }; + _this._convertViewable = function (viewable) { + var _info$index; + (0, _invariant.default)(viewable.index != null, 'Received a broken ViewToken'); + var info = _this._subExtractor(viewable.index); + if (!info) { + return null; + } + var keyExtractorWithNullableIndex = info.section.keyExtractor; + var keyExtractorWithNonNullableIndex = _this.props.keyExtractor || _$$_REQUIRE(_dependencyMap[13], "./VirtualizeUtils").keyExtractor; + var key = keyExtractorWithNullableIndex != null ? keyExtractorWithNullableIndex(viewable.item, info.index) : keyExtractorWithNonNullableIndex(viewable.item, (_info$index = info.index) != null ? _info$index : 0); + return Object.assign({}, viewable, { + index: info.index, + key: key, + section: info.section + }); + }; + _this._onViewableItemsChanged = function (_ref) { + var viewableItems = _ref.viewableItems, + changed = _ref.changed; + var onViewableItemsChanged = _this.props.onViewableItemsChanged; + if (onViewableItemsChanged != null) { + onViewableItemsChanged({ + viewableItems: viewableItems.map(_this._convertViewable, _this).filter(Boolean), + changed: changed.map(_this._convertViewable, _this).filter(Boolean) + }); + } + }; + _this._renderItem = function (listItemCount) { + return ( + // eslint-disable-next-line react/no-unstable-nested-components + function (_ref2) { + var item = _ref2.item, + index = _ref2.index; + var info = _this._subExtractor(index); + if (!info) { + return null; + } + var infoIndex = info.index; + if (infoIndex == null) { + var section = info.section; + if (info.header === true) { + var renderSectionHeader = _this.props.renderSectionHeader; + return renderSectionHeader ? renderSectionHeader({ + section: section + }) : null; + } else { + var renderSectionFooter = _this.props.renderSectionFooter; + return renderSectionFooter ? renderSectionFooter({ + section: section + }) : null; + } + } else { + var renderItem = info.section.renderItem || _this.props.renderItem; + var SeparatorComponent = _this._getSeparatorComponent(index, info, listItemCount); + (0, _invariant.default)(renderItem, 'no renderItem!'); + return /*#__PURE__*/(0, _jsxRuntime.jsx)(ItemWithSeparator, { + SeparatorComponent: SeparatorComponent, + LeadingSeparatorComponent: infoIndex === 0 ? _this.props.SectionSeparatorComponent : undefined, + cellKey: info.key, + index: infoIndex, + item: item, + leadingItem: info.leadingItem, + leadingSection: info.leadingSection, + prevCellKey: (_this._subExtractor(index - 1) || {}).key + // Callback to provide updateHighlight for this item + , + setSelfHighlightCallback: _this._setUpdateHighlightFor, + setSelfUpdatePropsCallback: _this._setUpdatePropsFor + // Provide child ability to set highlight/updateProps for previous item using prevCellKey + , + updateHighlightFor: _this._updateHighlightFor, + updatePropsFor: _this._updatePropsFor, + renderItem: renderItem, + section: info.section, + trailingItem: info.trailingItem, + trailingSection: info.trailingSection, + inverted: !!_this.props.inverted + }); + } + } + ); + }; + _this._updatePropsFor = function (cellKey, value) { + var updateProps = _this._updatePropsMap[cellKey]; + if (updateProps != null) { + updateProps(value); + } + }; + _this._updateHighlightFor = function (cellKey, value) { + var updateHighlight = _this._updateHighlightMap[cellKey]; + if (updateHighlight != null) { + updateHighlight(value); + } + }; + _this._setUpdateHighlightFor = function (cellKey, updateHighlightFn) { + if (updateHighlightFn != null) { + _this._updateHighlightMap[cellKey] = updateHighlightFn; + } else { + // $FlowFixMe[prop-missing] + delete _this._updateHighlightFor[cellKey]; + } + }; + _this._setUpdatePropsFor = function (cellKey, updatePropsFn) { + if (updatePropsFn != null) { + _this._updatePropsMap[cellKey] = updatePropsFn; + } else { + delete _this._updatePropsMap[cellKey]; + } + }; + _this._updateHighlightMap = {}; + _this._updatePropsMap = {}; + _this._captureRef = function (ref) { + _this._listRef = ref; + }; + return _this; + } + (0, _inherits2.default)(VirtualizedSectionList, _React$PureComponent); + return (0, _createClass2.default)(VirtualizedSectionList, [{ + key: "scrollToLocation", + value: function scrollToLocation(params) { + var index = params.itemIndex; + for (var i = 0; i < params.sectionIndex; i++) { + index += this.props.getItemCount(this.props.sections[i].data) + 2; + } + var viewOffset = params.viewOffset || 0; + if (this._listRef == null) { + return; + } + var listRef = this._listRef; + if (params.itemIndex > 0 && this.props.stickySectionHeadersEnabled) { + var frame = listRef.__getListMetrics().getCellMetricsApprox(index - params.itemIndex, listRef.props); + viewOffset += frame.length; + } + var toIndexParams = Object.assign({}, params, { + viewOffset: viewOffset, + index: index + }); + // $FlowFixMe[incompatible-use] + this._listRef.scrollToIndex(toIndexParams); + } + }, { + key: "getListRef", + value: function getListRef() { + return this._listRef; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + var _this$props = this.props, + ItemSeparatorComponent = _this$props.ItemSeparatorComponent, + SectionSeparatorComponent = _this$props.SectionSeparatorComponent, + _renderItem = _this$props.renderItem, + renderSectionFooter = _this$props.renderSectionFooter, + renderSectionHeader = _this$props.renderSectionHeader, + _sections = _this$props.sections, + stickySectionHeadersEnabled = _this$props.stickySectionHeadersEnabled, + passThroughProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded); + var listHeaderOffset = this.props.ListHeaderComponent ? 1 : 0; + var stickyHeaderIndices = this.props.stickySectionHeadersEnabled ? [] : undefined; + var itemCount = 0; + for (var section of this.props.sections) { + // Track the section header indices + if (stickyHeaderIndices != null) { + stickyHeaderIndices.push(itemCount + listHeaderOffset); + } + + // Add two for the section header and footer. + itemCount += 2; + itemCount += this.props.getItemCount(section.data); + } + var renderItem = this._renderItem(itemCount); + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_VirtualizedList.default, Object.assign({}, passThroughProps, { + keyExtractor: this._keyExtractor, + stickyHeaderIndices: stickyHeaderIndices, + renderItem: renderItem, + data: this.props.sections, + getItem: function getItem(sections, index) { + return _this2._getItem(_this2.props, sections, index); + }, + getItemCount: function getItemCount() { + return itemCount; + }, + onViewableItemsChanged: this.props.onViewableItemsChanged ? this._onViewableItemsChanged : undefined, + ref: this._captureRef + })); + } + }, { + key: "_getItem", + value: function _getItem(props, sections, index) { + if (!sections) { + return null; + } + var itemIdx = index - 1; + for (var i = 0; i < sections.length; i++) { + var section = sections[i]; + var sectionData = section.data; + var itemCount = props.getItemCount(sectionData); + if (itemIdx === -1 || itemIdx === itemCount) { + // We intend for there to be overflow by one on both ends of the list. + // This will be for headers and footers. When returning a header or footer + // item the section itself is the item. + return section; + } else if (itemIdx < itemCount) { + // If we are in the bounds of the list's data then return the item. + return props.getItem(sectionData, itemIdx); + } else { + itemIdx -= itemCount + 2; // Add two for the header and footer + } + } + return null; + } + }, { + key: "_subExtractor", + value: function _subExtractor(index) { + var itemIndex = index; + var _this$props2 = this.props, + getItem = _this$props2.getItem, + getItemCount = _this$props2.getItemCount, + keyExtractor = _this$props2.keyExtractor, + sections = _this$props2.sections; + for (var i = 0; i < sections.length; i++) { + var section = sections[i]; + var sectionData = section.data; + var key = section.key || String(i); + itemIndex -= 1; // The section adds an item for the header + if (itemIndex >= getItemCount(sectionData) + 1) { + itemIndex -= getItemCount(sectionData) + 1; // The section adds an item for the footer. + } else if (itemIndex === -1) { + return { + section: section, + key: key + ':header', + index: null, + header: true, + trailingSection: sections[i + 1] + }; + } else if (itemIndex === getItemCount(sectionData)) { + return { + section: section, + key: key + ':footer', + index: null, + header: false, + trailingSection: sections[i + 1] + }; + } else { + var extractor = section.keyExtractor || keyExtractor || _$$_REQUIRE(_dependencyMap[13], "./VirtualizeUtils").keyExtractor; + return { + section: section, + key: key + ':' + extractor(getItem(sectionData, itemIndex), itemIndex), + index: itemIndex, + leadingItem: getItem(sectionData, itemIndex - 1), + leadingSection: sections[i - 1], + trailingItem: getItem(sectionData, itemIndex + 1), + trailingSection: sections[i + 1] + }; + } + } + } + }, { + key: "_getSeparatorComponent", + value: function _getSeparatorComponent(index, info, listItemCount) { + info = info || this._subExtractor(index); + if (!info) { + return null; + } + var ItemSeparatorComponent = info.section.ItemSeparatorComponent || this.props.ItemSeparatorComponent; + var SectionSeparatorComponent = this.props.SectionSeparatorComponent; + var isLastItemInList = index === listItemCount - 1; + var isLastItemInSection = info.index === this.props.getItemCount(info.section.data) - 1; + if (SectionSeparatorComponent && isLastItemInSection) { + return SectionSeparatorComponent; + } + if (ItemSeparatorComponent && !isLastItemInSection && !isLastItemInList) { + return ItemSeparatorComponent; + } + return null; + } + }]); + }(React.PureComponent); + function ItemWithSeparator(props) { + var LeadingSeparatorComponent = props.LeadingSeparatorComponent, + SeparatorComponent = props.SeparatorComponent, + cellKey = props.cellKey, + prevCellKey = props.prevCellKey, + setSelfHighlightCallback = props.setSelfHighlightCallback, + updateHighlightFor = props.updateHighlightFor, + setSelfUpdatePropsCallback = props.setSelfUpdatePropsCallback, + updatePropsFor = props.updatePropsFor, + item = props.item, + index = props.index, + section = props.section, + inverted = props.inverted; + var _React$useState = React.useState(false), + _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2), + leadingSeparatorHiglighted = _React$useState2[0], + setLeadingSeparatorHighlighted = _React$useState2[1]; + var _React$useState3 = React.useState(false), + _React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2), + separatorHighlighted = _React$useState4[0], + setSeparatorHighlighted = _React$useState4[1]; + var _React$useState5 = React.useState({ + leadingItem: props.leadingItem, + leadingSection: props.leadingSection, + section: props.section, + trailingItem: props.item, + trailingSection: props.trailingSection + }), + _React$useState6 = (0, _slicedToArray2.default)(_React$useState5, 2), + leadingSeparatorProps = _React$useState6[0], + setLeadingSeparatorProps = _React$useState6[1]; + var _React$useState7 = React.useState({ + leadingItem: props.item, + leadingSection: props.leadingSection, + section: props.section, + trailingItem: props.trailingItem, + trailingSection: props.trailingSection + }), + _React$useState8 = (0, _slicedToArray2.default)(_React$useState7, 2), + separatorProps = _React$useState8[0], + setSeparatorProps = _React$useState8[1]; + React.useEffect(function () { + setSelfHighlightCallback(cellKey, setSeparatorHighlighted); + // $FlowFixMe[incompatible-call] + setSelfUpdatePropsCallback(cellKey, setSeparatorProps); + return function () { + setSelfUpdatePropsCallback(cellKey, null); + setSelfHighlightCallback(cellKey, null); + }; + }, [cellKey, setSelfHighlightCallback, setSeparatorProps, setSelfUpdatePropsCallback]); + var separators = { + highlight: function highlight() { + setLeadingSeparatorHighlighted(true); + setSeparatorHighlighted(true); + if (prevCellKey != null) { + updateHighlightFor(prevCellKey, true); + } + }, + unhighlight: function unhighlight() { + setLeadingSeparatorHighlighted(false); + setSeparatorHighlighted(false); + if (prevCellKey != null) { + updateHighlightFor(prevCellKey, false); + } + }, + updateProps: function updateProps(select, newProps) { + if (select === 'leading') { + if (LeadingSeparatorComponent != null) { + setLeadingSeparatorProps(Object.assign({}, leadingSeparatorProps, newProps)); + } else if (prevCellKey != null) { + // update the previous item's separator + updatePropsFor(prevCellKey, Object.assign({}, leadingSeparatorProps, newProps)); + } + } else if (select === 'trailing' && SeparatorComponent != null) { + setSeparatorProps(Object.assign({}, separatorProps, newProps)); + } + } + }; + var element = props.renderItem({ + item: item, + index: index, + section: section, + separators: separators + }); + var leadingSeparator = LeadingSeparatorComponent != null && /*#__PURE__*/(0, _jsxRuntime.jsx)(LeadingSeparatorComponent, Object.assign({ + highlighted: leadingSeparatorHiglighted + }, leadingSeparatorProps)); + var separator = SeparatorComponent != null && /*#__PURE__*/(0, _jsxRuntime.jsx)(SeparatorComponent, Object.assign({ + highlighted: separatorHighlighted + }, separatorProps)); + return leadingSeparator || separator ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { + children: [inverted === false ? leadingSeparator : separator, element, inverted === false ? separator : leadingSeparator] + }) : element; + } + + /* $FlowFixMe[class-object-subtyping] added when improving typing for this + * parameters */ + // $FlowFixMe[method-unbinding] + module.exports = VirtualizedSectionList; +},419,[6,7,166,18,19,23,25,28,15,406,37,65,106,405],"node_modules\\react-native\\node_modules\\@react-native\\virtualized-lists\\Lists\\VirtualizedSectionList.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _Image = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Image/Image")); + var _createAnimatedComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../createAnimatedComponent")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = (0, _createAnimatedComponent.default)(_Image.default); +},420,[6,421,372,65],"node_modules\\react-native\\Libraries\\Animated\\components\\AnimatedImage.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _objectWithoutProperties2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/objectWithoutProperties")); + var _asyncToGenerator2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/asyncToGenerator")); + var _flattenStyle = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../StyleSheet/flattenStyle")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../StyleSheet/StyleSheet")); + var _TextAncestor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../Text/TextAncestor")); + var _ImageAnalyticsTagContext = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./ImageAnalyticsTagContext")); + var _ImageInjection = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./ImageInjection")); + var _ImageViewNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./ImageViewNativeComponent")); + var _NativeImageLoaderAndroid = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./NativeImageLoaderAndroid")); + var _resolveAssetSource = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "./resolveAssetSource")); + var _TextInlineImageNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[11], "./TextInlineImageNativeComponent")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[13], "react/jsx-runtime"); + var _excluded = ["height", "width"]; + var _this = this, + _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Image\\Image.android.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + var _requestId = 1; + function generateRequestId() { + return _requestId++; + } + + /** + * Retrieve the width and height (in pixels) of an image prior to displaying it + * + * See https://reactnative.dev/docs/image#getsize + */ + function getSize(url, success, failure) { + return _NativeImageLoaderAndroid.default.getSize(url).then(function (sizes) { + success(sizes.width, sizes.height); + }).catch(failure || function () { + console.warn('Failed to get size for image: ' + url); + }); + } + + /** + * Retrieve the width and height (in pixels) of an image prior to displaying it + * with the ability to provide the headers for the request + * + * See https://reactnative.dev/docs/image#getsizewithheaders + */ + function getSizeWithHeaders(url, headers, success, failure) { + return _NativeImageLoaderAndroid.default.getSizeWithHeaders(url, headers).then(function (sizes) { + success(sizes.width, sizes.height); + }).catch(failure || function () { + console.warn('Failed to get size for image: ' + url); + }); + } + function prefetchWithMetadata(url, queryRootName, rootTag, callback) { + // TODO: T79192300 Log queryRootName and rootTag + prefetch(url, callback); + } + function prefetch(url, callback) { + var requestId = generateRequestId(); + callback && callback(requestId); + return _NativeImageLoaderAndroid.default.prefetchImage(url, requestId); + } + function abortPrefetch(requestId) { + _NativeImageLoaderAndroid.default.abortRequest(requestId); + } + + /** + * Perform cache interrogation. + * + * See https://reactnative.dev/docs/image#querycache + */ + function queryCache(_x) { + return _queryCache.apply(this, arguments); + } + function _queryCache() { + _queryCache = (0, _asyncToGenerator2.default)(function* (urls) { + return yield _NativeImageLoaderAndroid.default.queryCache(urls); + }); + return _queryCache.apply(this, arguments); + } + /** + * A React component for displaying different types of images, + * including network images, static resources, temporary local images, and + * images from local disk, such as the camera roll. + * + * See https://reactnative.dev/docs/image + */ + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ + var BaseImage = function BaseImage(props, forwardedRef) { + var _source$, _ref, _props$ariaLabel, _props$ariaLabelledb, _props$ariaBusy, _props$accessibilityS, _props$ariaChecked, _props$accessibilityS2, _props$ariaDisabled, _props$accessibilityS3, _props$ariaExpanded, _props$accessibilityS4, _props$ariaSelected, _props$accessibilityS5; + var source = (0, _$$_REQUIRE(_dependencyMap[14], "./ImageSourceUtils").getImageSourcesFromImageProps)(props) || { + uri: undefined, + width: undefined, + height: undefined + }; + var defaultSource = (0, _resolveAssetSource.default)(props.defaultSource); + var loadingIndicatorSource = (0, _resolveAssetSource.default)(props.loadingIndicatorSource); + if (props.children) { + throw new Error('The component cannot contain children. If you want to render content on top of the image, consider using the component or absolute positioning.'); + } + if (props.defaultSource && props.loadingIndicatorSource) { + throw new Error('The component cannot have defaultSource and loadingIndicatorSource at the same time. Please use either defaultSource or loadingIndicatorSource.'); + } + var style; + var sources; + if (Array.isArray(source)) { + // $FlowFixMe[underconstrained-implicit-instantiation] + style = (0, _flattenStyle.default)([styles.base, props.style]); + sources = source; + } else { + // $FlowFixMe[incompatible-type] + var _source$width = source.width, + _width = _source$width === void 0 ? props.width : _source$width, + _source$height = source.height, + _height = _source$height === void 0 ? props.height : _source$height, + uri = source.uri; + // $FlowFixMe[underconstrained-implicit-instantiation] + style = (0, _flattenStyle.default)([{ + width: _width, + height: _height + }, styles.base, props.style]); + sources = [source]; + if (uri === '') { + console.warn('source.uri should not be an empty string'); + } + } + var height = props.height, + width = props.width, + restProps = (0, _objectWithoutProperties2.default)(props, _excluded); + var onLoadStart = props.onLoadStart, + onLoad = props.onLoad, + onLoadEnd = props.onLoadEnd, + onError = props.onError; + var nativeProps = Object.assign({}, restProps, { + style: style, + shouldNotifyLoadEvents: !!(onLoadStart || onLoad || onLoadEnd || onError), + src: sources, + /* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found + * when making Flow check .android.js files. */ + headers: (source == null ? void 0 : (_source$ = source[0]) == null ? void 0 : _source$.headers) || (source == null ? void 0 : source.headers), + defaultSrc: defaultSource ? defaultSource.uri : null, + loadingIndicatorSrc: loadingIndicatorSource ? loadingIndicatorSource.uri : null, + ref: forwardedRef, + accessibilityLabel: (_ref = (_props$ariaLabel = props['aria-label']) != null ? _props$ariaLabel : props.accessibilityLabel) != null ? _ref : props.alt, + accessibilityLabelledBy: (_props$ariaLabelledb = props == null ? void 0 : props['aria-labelledby']) != null ? _props$ariaLabelledb : props == null ? void 0 : props.accessibilityLabelledBy, + accessible: props.alt !== undefined ? true : props.accessible, + accessibilityState: { + busy: (_props$ariaBusy = props['aria-busy']) != null ? _props$ariaBusy : (_props$accessibilityS = props.accessibilityState) == null ? void 0 : _props$accessibilityS.busy, + checked: (_props$ariaChecked = props['aria-checked']) != null ? _props$ariaChecked : (_props$accessibilityS2 = props.accessibilityState) == null ? void 0 : _props$accessibilityS2.checked, + disabled: (_props$ariaDisabled = props['aria-disabled']) != null ? _props$ariaDisabled : (_props$accessibilityS3 = props.accessibilityState) == null ? void 0 : _props$accessibilityS3.disabled, + expanded: (_props$ariaExpanded = props['aria-expanded']) != null ? _props$ariaExpanded : (_props$accessibilityS4 = props.accessibilityState) == null ? void 0 : _props$accessibilityS4.expanded, + selected: (_props$ariaSelected = props['aria-selected']) != null ? _props$ariaSelected : (_props$accessibilityS5 = props.accessibilityState) == null ? void 0 : _props$accessibilityS5.selected + } + }); + var objectFit = + // $FlowFixMe[prop-missing] + style && style.objectFit ? + // $FlowFixMe[incompatible-call] + (0, _$$_REQUIRE(_dependencyMap[15], "./ImageUtils").convertObjectFitToResizeMode)(style.objectFit) : null; + // $FlowFixMe[prop-missing] + var resizeMode = + // $FlowFixMe[prop-missing] + objectFit || props.resizeMode || style && style.resizeMode || 'cover'; + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageAnalyticsTagContext.default.Consumer, { + children: function children(analyticTag) { + var nativePropsWithAnalytics = analyticTag !== null ? Object.assign({}, nativeProps, { + internal_analyticTag: analyticTag + }) : nativeProps; + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextAncestor.default.Consumer, { + children: function children(hasTextAncestor) { + if (hasTextAncestor) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextInlineImageNativeComponent.default + // $FlowFixMe[incompatible-type] + , { + style: style + // $FlowFixMe[incompatible-type] + , + resizeMode: resizeMode, + headers: nativeProps.headers, + src: sources, + ref: forwardedRef + }); + } + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageViewNativeComponent.default, Object.assign({}, nativePropsWithAnalytics, { + // $FlowFixMe[incompatible-type] + resizeMode: resizeMode + })); + } + }); + } + }); + }; + var Image = React.forwardRef(BaseImage); + if (_ImageInjection.default.unstable_createImageComponent != null) { + Image = _ImageInjection.default.unstable_createImageComponent(Image); + } + Image.displayName = 'Image'; + + /** + * Retrieve the width and height (in pixels) of an image prior to displaying it + * + * See https://reactnative.dev/docs/image#getsize + */ + /* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ + Image.getSize = getSize; + + /** + * Retrieve the width and height (in pixels) of an image prior to displaying it + * with the ability to provide the headers for the request + * + * See https://reactnative.dev/docs/image#getsizewithheaders + */ + /* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ + Image.getSizeWithHeaders = getSizeWithHeaders; + + /** + * Prefetches a remote image for later use by downloading it to the disk + * cache + * + * See https://reactnative.dev/docs/image#prefetch + */ + /* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ + Image.prefetch = prefetch; + + /** + * Prefetches a remote image for later use by downloading it to the disk + * cache, and adds metadata for queryRootName and rootTag. + * + * See https://reactnative.dev/docs/image#prefetch + */ + /* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ + Image.prefetchWithMetadata = prefetchWithMetadata; + + /** + * Abort prefetch request. + * + * See https://reactnative.dev/docs/image#abortprefetch + */ + /* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ + Image.abortPrefetch = abortPrefetch; + + /** + * Perform cache interrogation. + * + * See https://reactnative.dev/docs/image#querycache + */ + /* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ + Image.queryCache = queryCache; + + /** + * Resolves an asset reference into an object. + * + * See https://reactnative.dev/docs/image#resolveassetsource + */ + /* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ + Image.resolveAssetSource = _resolveAssetSource.default; + + /** + * Switch to `deprecated-react-native-prop-types` for compatibility with future + * releases. This is deprecated and will be removed in the future. + */ + Image.propTypes = _$$_REQUIRE(_dependencyMap[16], "deprecated-react-native-prop-types").ImagePropTypes; + var styles = _StyleSheet.default.create({ + base: { + overflow: 'hidden' + } + }); + module.exports = Image; +},421,[6,166,13,222,266,242,422,423,424,426,250,425,65,106,427,428,318],"node_modules\\react-native\\Libraries\\Image\\Image.android.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var Context = React.createContext(null); + if (__DEV__) { + Context.displayName = 'ImageAnalyticsTagContext'; + } + var _default = exports.default = Context; +},422,[65],"node_modules\\react-native\\Libraries\\Image\\ImageAnalyticsTagContext.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _ImageViewNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./ImageViewNativeComponent")); + var _TextInlineImageNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "./TextInlineImageNativeComponent")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format strict-local + * + */ + var _default = exports.default = { + unstable_createImageComponent: null + }; +},423,[6,424,425,65],"node_modules\\react-native\\Libraries\\Image\\ImageInjection.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.__INTERNAL_VIEW_CONFIG = void 0; + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[1], "../NativeComponent/NativeComponentRegistry")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../Utilities/Platform")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = _Platform.default.OS === 'android' ? { + uiViewClassName: 'RCTImageView', + bubblingEventTypes: {}, + directEventTypes: { + topLoadStart: { + registrationName: 'onLoadStart' + }, + topProgress: { + registrationName: 'onProgress' + }, + topError: { + registrationName: 'onError' + }, + topLoad: { + registrationName: 'onLoad' + }, + topLoadEnd: { + registrationName: 'onLoadEnd' + } + }, + validAttributes: { + blurRadius: true, + internal_analyticTag: true, + resizeMode: true, + tintColor: { + process: _$$_REQUIRE(_dependencyMap[3], "../StyleSheet/processColor").default + }, + borderBottomLeftRadius: true, + borderTopLeftRadius: true, + resizeMethod: true, + src: true, + borderRadius: true, + headers: true, + shouldNotifyLoadEvents: true, + defaultSrc: true, + overlayColor: { + process: _$$_REQUIRE(_dependencyMap[3], "../StyleSheet/processColor").default + }, + borderColor: { + process: _$$_REQUIRE(_dependencyMap[3], "../StyleSheet/processColor").default + }, + accessible: true, + progressiveRenderingEnabled: true, + fadeDuration: true, + borderBottomRightRadius: true, + borderTopRightRadius: true, + loadingIndicatorSrc: true + } + } : { + uiViewClassName: 'RCTImageView', + bubblingEventTypes: {}, + directEventTypes: { + topLoadStart: { + registrationName: 'onLoadStart' + }, + topProgress: { + registrationName: 'onProgress' + }, + topError: { + registrationName: 'onError' + }, + topPartialLoad: { + registrationName: 'onPartialLoad' + }, + topLoad: { + registrationName: 'onLoad' + }, + topLoadEnd: { + registrationName: 'onLoadEnd' + } + }, + validAttributes: Object.assign({ + blurRadius: true, + capInsets: { + diff: _$$_REQUIRE(_dependencyMap[4], "../Utilities/differ/insetsDiffer") + }, + defaultSource: { + process: _$$_REQUIRE(_dependencyMap[5], "./resolveAssetSource") + }, + internal_analyticTag: true, + resizeMode: true, + source: true, + tintColor: { + process: _$$_REQUIRE(_dependencyMap[3], "../StyleSheet/processColor").default + } + }, (0, _$$_REQUIRE(_dependencyMap[6], "../NativeComponent/ViewConfigIgnore").ConditionallyIgnoredEventHandlers)({ + onLoadStart: true, + onLoad: true, + onLoadEnd: true, + onProgress: true, + onError: true, + onPartialLoad: true + })) + }; + var ImageViewNativeComponent = NativeComponentRegistry.get('RCTImageView', function () { + return __INTERNAL_VIEW_CONFIG; + }); + var _default = exports.default = ImageViewNativeComponent; +},424,[6,244,34,189,248,250,262],"node_modules\\react-native\\Libraries\\Image\\ImageViewNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.__INTERNAL_VIEW_CONFIG = void 0; + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../NativeComponent/NativeComponentRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = { + uiViewClassName: 'RCTTextInlineImage', + bubblingEventTypes: {}, + directEventTypes: {}, + validAttributes: { + resizeMode: true, + src: true, + tintColor: { + process: _$$_REQUIRE(_dependencyMap[1], "../StyleSheet/processColor").default + }, + headers: true + } + }; + var TextInlineImage = NativeComponentRegistry.get('RCTTextInlineImage', function () { + return __INTERNAL_VIEW_CONFIG; + }); + var _default = exports.default = TextInlineImage; +},425,[244,189],"node_modules\\react-native\\Libraries\\Image\\TextInlineImageNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.getEnforcing('ImageLoader'); +},426,[36],"node_modules\\react-native\\Libraries\\Image\\NativeImageLoaderAndroid.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getImageSourcesFromImageProps = getImageSourcesFromImageProps; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _resolveAssetSource = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "./resolveAssetSource")); + /** + * A function which returns the appropriate value for image source + * by resolving the `source`, `src` and `srcSet` props. + */ + function getImageSourcesFromImageProps(imageProps) { + var source = (0, _resolveAssetSource.default)(imageProps.source); + var sources; + var crossOrigin = imageProps.crossOrigin, + referrerPolicy = imageProps.referrerPolicy, + src = imageProps.src, + srcSet = imageProps.srcSet, + width = imageProps.width, + height = imageProps.height; + var headers = {}; + if (crossOrigin === 'use-credentials') { + headers['Access-Control-Allow-Credentials'] = 'true'; + } + if (referrerPolicy != null) { + headers['Referrer-Policy'] = referrerPolicy; + } + if (srcSet != null) { + var sourceList = []; + var srcSetList = srcSet.split(', '); + // `src` prop should be used with default scale if `srcSet` does not have 1x scale. + var shouldUseSrcForDefaultScale = true; + srcSetList.forEach(function (imageSrc) { + var _imageSrc$split = imageSrc.split(' '), + _imageSrc$split2 = (0, _slicedToArray2.default)(_imageSrc$split, 2), + uri = _imageSrc$split2[0], + _imageSrc$split2$ = _imageSrc$split2[1], + xScale = _imageSrc$split2$ === void 0 ? '1x' : _imageSrc$split2$; + if (!xScale.endsWith('x')) { + console.warn('The provided format for scale is not supported yet. Please use scales like 1x, 2x, etc.'); + } else { + var scale = parseInt(xScale.split('x')[0], 10); + if (!isNaN(scale)) { + // 1x scale is provided in `srcSet` prop so ignore the `src` prop if provided. + shouldUseSrcForDefaultScale = scale === 1 ? false : shouldUseSrcForDefaultScale; + sourceList.push({ + headers: headers, + scale: scale, + uri: uri, + width: width, + height: height + }); + } + } + }); + if (shouldUseSrcForDefaultScale && src != null) { + sourceList.push({ + headers: headers, + scale: 1, + uri: src, + width: width, + height: height + }); + } + if (sourceList.length === 0) { + console.warn('The provided value for srcSet is not valid.'); + } + sources = sourceList; + } else if (src != null) { + sources = [{ + uri: src, + headers: headers, + width: width, + height: height + }]; + } else { + sources = source; + } + return sources; + } +},427,[6,7,250],"node_modules\\react-native\\Libraries\\Image\\ImageSourceUtils.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.convertObjectFitToResizeMode = convertObjectFitToResizeMode; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + function convertObjectFitToResizeMode(objectFit) { + var objectFitMap = { + contain: 'contain', + cover: 'cover', + fill: 'stretch', + 'scale-down': 'contain' + }; + return objectFitMap[objectFit]; + } +},428,[],"node_modules\\react-native\\Libraries\\Image\\ImageUtils.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _RefreshControl = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Components/RefreshControl/RefreshControl")); + var _ScrollView = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Components/ScrollView/ScrollView")); + var _flattenStyle = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../StyleSheet/flattenStyle")); + var _splitLayoutProps2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../../StyleSheet/splitLayoutProps")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../../StyleSheet/StyleSheet")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../../Utilities/Platform")); + var _useMergeRefs = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "../../Utilities/useMergeRefs")); + var _createAnimatedComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "../createAnimatedComponent")); + var _useAnimatedProps5 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "../useAnimatedProps")); + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11], "react")); + var React = _react; + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[12], "react/jsx-runtime"); + var _this = this, + _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Animated\\components\\AnimatedScrollView.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * @see https://github.com/facebook/react-native/commit/b8c8562 + */ + var AnimatedScrollView = React.forwardRef(function (props, forwardedRef) { + // (Android only) When a ScrollView has a RefreshControl and + // any `style` property set with an Animated.Value, the CSS + // gets incorrectly applied twice. This is because ScrollView + // swaps the parent/child relationship of itself and the + // RefreshControl component (see ScrollView.js for more details). + if (_Platform.default.OS === 'android' && props.refreshControl != null && props.style != null) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedScrollViewWithInvertedRefreshControl, Object.assign({ + scrollEventThrottle: 0.0001 + }, props, { + ref: forwardedRef, + refreshControl: props.refreshControl + })); + } else { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedScrollViewWithoutInvertedRefreshControl, Object.assign({ + scrollEventThrottle: 0.0001 + }, props, { + ref: forwardedRef + })); + } + }); + var AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef( + // $FlowFixMe[incompatible-call] + function (props, forwardedRef) { + // Split `props` into the animate-able props for the parent (RefreshControl) + // and child (ScrollView). + var _useMemo = (0, _react.useMemo)(function () { + // $FlowFixMe[underconstrained-implicit-instantiation] + // $FlowFixMe[incompatible-call] + var _splitLayoutProps = (0, _splitLayoutProps2.default)((0, _flattenStyle.default)(props.style)), + outer = _splitLayoutProps.outer, + inner = _splitLayoutProps.inner; + return { + intermediatePropsForRefreshControl: { + style: outer + }, + intermediatePropsForScrollView: Object.assign({}, props, { + style: inner + }) + }; + }, [props]), + intermediatePropsForRefreshControl = _useMemo.intermediatePropsForRefreshControl, + intermediatePropsForScrollView = _useMemo.intermediatePropsForScrollView; + + // Handle animated props on `refreshControl`. + var _useAnimatedProps = (0, _useAnimatedProps5.default)(intermediatePropsForRefreshControl), + _useAnimatedProps2 = (0, _slicedToArray2.default)(_useAnimatedProps, 2), + refreshControlAnimatedProps = _useAnimatedProps2[0], + refreshControlRef = _useAnimatedProps2[1]; + // NOTE: Assumes that refreshControl.ref` and `refreshControl.style` can be + // safely clobbered. + var refreshControl = React.cloneElement(props.refreshControl, Object.assign({}, refreshControlAnimatedProps, { + ref: refreshControlRef + })); + + // Handle animated props on `NativeDirectionalScrollView`. + var _useAnimatedProps3 = (0, _useAnimatedProps5.default)(intermediatePropsForScrollView), + _useAnimatedProps4 = (0, _slicedToArray2.default)(_useAnimatedProps3, 2), + scrollViewAnimatedProps = _useAnimatedProps4[0], + scrollViewRef = _useAnimatedProps4[1]; + var ref = (0, _useMergeRefs.default)(scrollViewRef, forwardedRef); + return ( + /*#__PURE__*/ + // $FlowFixMe[incompatible-use] Investigate useAnimatedProps return value + (0, _jsxRuntime.jsx)(_ScrollView.default, Object.assign({}, scrollViewAnimatedProps, { + ref: ref, + refreshControl: refreshControl + // Because `refreshControl` is a clone of `props.refreshControl` with + // `refreshControlAnimatedProps` added, we need to pass ScrollView.js + // the combined styles since it also splits the outer/inner styles for + // its parent/child, respectively. Without this, the refreshControl + // styles would be ignored. + , + style: _StyleSheet.default.compose(scrollViewAnimatedProps.style, refreshControlAnimatedProps.style) + })) + ); + }); + var AnimatedScrollViewWithoutInvertedRefreshControl = (0, _createAnimatedComponent.default)(_ScrollView.default); + var _default = exports.default = AnimatedScrollView; +},429,[6,7,430,346,222,386,266,34,373,372,374,65,106],"node_modules\\react-native\\Libraries\\Animated\\components\\AnimatedScrollView.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _objectWithoutProperties2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/objectWithoutProperties")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _AndroidSwipeRefreshLayoutNativeComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7], "./AndroidSwipeRefreshLayoutNativeComponent")); + var _PullToRefreshViewNativeComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8], "./PullToRefreshViewNativeComponent")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[9], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Components\\RefreshControl\\RefreshControl.js"; + var _excluded = ["enabled", "colors", "progressBackgroundColor", "size"], + _excluded2 = ["tintColor", "titleColor", "title"]; + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + var React = _$$_REQUIRE(_dependencyMap[10], "react"); + /** + * This component is used inside a ScrollView or ListView to add pull to refresh + * functionality. When the ScrollView is at `scrollY: 0`, swiping down + * triggers an `onRefresh` event. + * + * ### Usage example + * + * ``` js + * class RefreshableList extends Component { + * constructor(props) { + * super(props); + * this.state = { + * refreshing: false, + * }; + * } + * + * _onRefresh() { + * this.setState({refreshing: true}); + * fetchData().then(() => { + * this.setState({refreshing: false}); + * }); + * } + * + * render() { + * return ( + * + * } + * ... + * > + * ... + * + * ); + * } + * ... + * } + * ``` + * + * __Note:__ `refreshing` is a controlled prop, this is why it needs to be set to true + * in the `onRefresh` function otherwise the refresh indicator will stop immediately. + */ + var RefreshControl = /*#__PURE__*/function (_React$Component) { + function RefreshControl() { + var _this; + (0, _classCallCheck2.default)(this, RefreshControl); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, RefreshControl, [].concat(args)); + _this._lastNativeRefreshing = false; + _this._onRefresh = function () { + _this._lastNativeRefreshing = true; + + // $FlowFixMe[unused-promise] + _this.props.onRefresh && _this.props.onRefresh(); + + // The native component will start refreshing so force an update to + // make sure it stays in sync with the js component. + _this.forceUpdate(); + }; + _this._setNativeRef = function (ref) { + _this._nativeRef = ref; + }; + return _this; + } + (0, _inherits2.default)(RefreshControl, _React$Component); + return (0, _createClass2.default)(RefreshControl, [{ + key: "componentDidMount", + value: function componentDidMount() { + this._lastNativeRefreshing = this.props.refreshing; + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + // RefreshControl is a controlled component so if the native refreshing + // value doesn't match the current js refreshing prop update it to + // the js value. + if (this.props.refreshing !== prevProps.refreshing) { + this._lastNativeRefreshing = this.props.refreshing; + } else if (this.props.refreshing !== this._lastNativeRefreshing && this._nativeRef) { + if ("android" === 'android') { + _AndroidSwipeRefreshLayoutNativeComponent.Commands.setNativeRefreshing(this._nativeRef, this.props.refreshing); + } else { + _PullToRefreshViewNativeComponent.Commands.setNativeRefreshing(this._nativeRef, this.props.refreshing); + } + this._lastNativeRefreshing = this.props.refreshing; + } + } + }, { + key: "render", + value: function render() { + if ("android" === 'ios') { + var _this$props = this.props, + enabled = _this$props.enabled, + colors = _this$props.colors, + progressBackgroundColor = _this$props.progressBackgroundColor, + size = _this$props.size, + props = (0, _objectWithoutProperties2.default)(_this$props, _excluded); + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PullToRefreshViewNativeComponent.default, Object.assign({}, props, { + ref: this._setNativeRef, + onRefresh: this._onRefresh + })); + } else { + var _this$props2 = this.props, + tintColor = _this$props2.tintColor, + titleColor = _this$props2.titleColor, + title = _this$props2.title, + _props = (0, _objectWithoutProperties2.default)(_this$props2, _excluded2); + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AndroidSwipeRefreshLayoutNativeComponent.default, Object.assign({}, _props, { + ref: this._setNativeRef, + onRefresh: this._onRefresh + })); + } + } + }]); + }(React.Component); + module.exports = RefreshControl; +},430,[6,166,18,19,23,25,28,431,432,106,65],"node_modules\\react-native\\Libraries\\Components\\RefreshControl\\RefreshControl.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.__INTERNAL_VIEW_CONFIG = exports.Commands = void 0; + var _codegenNativeCommands = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Utilities/codegenNativeCommands")); + var _codegenNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Utilities/codegenNativeComponent")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + var nativeComponentName = 'AndroidSwipeRefreshLayout'; + var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = { + uiViewClassName: 'AndroidSwipeRefreshLayout', + directEventTypes: { + topRefresh: { + registrationName: 'onRefresh' + } + }, + validAttributes: Object.assign({ + enabled: true, + colors: { + process: _$$_REQUIRE(_dependencyMap[4], "react-native/Libraries/StyleSheet/processColorArray") + }, + progressBackgroundColor: { + process: _$$_REQUIRE(_dependencyMap[5], "react-native/Libraries/StyleSheet/processColor").default + }, + size: true, + progressViewOffset: true, + refreshing: true + }, _$$_REQUIRE(_dependencyMap[6], "react-native/Libraries/NativeComponent/ViewConfigIgnore").ConditionallyIgnoredEventHandlers({ + onRefresh: true + })) + }; + var _default = exports.default = _$$_REQUIRE(_dependencyMap[7], "react-native/Libraries/NativeComponent/NativeComponentRegistry").get(nativeComponentName, function () { + return __INTERNAL_VIEW_CONFIG; + }); + var Commands = exports.Commands = { + setNativeRefreshing: function setNativeRefreshing(ref, value) { + _$$_REQUIRE(_dependencyMap[8], "react-native/Libraries/ReactNative/RendererProxy").dispatchCommand(ref, "setNativeRefreshing", [value]); + } + }; +},431,[6,265,276,65,249,189,262,244,61],"node_modules\\react-native\\Libraries\\Components\\RefreshControl\\AndroidSwipeRefreshLayoutNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.__INTERNAL_VIEW_CONFIG = exports.Commands = void 0; + var _codegenNativeCommands = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Utilities/codegenNativeCommands")); + var _codegenNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Utilities/codegenNativeComponent")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + var nativeComponentName = 'RCTRefreshControl'; + var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = { + uiViewClassName: 'RCTRefreshControl', + directEventTypes: { + topRefresh: { + registrationName: 'onRefresh' + } + }, + validAttributes: Object.assign({ + tintColor: { + process: _$$_REQUIRE(_dependencyMap[4], "react-native/Libraries/StyleSheet/processColor").default + }, + titleColor: { + process: _$$_REQUIRE(_dependencyMap[4], "react-native/Libraries/StyleSheet/processColor").default + }, + title: true, + progressViewOffset: true, + refreshing: true + }, _$$_REQUIRE(_dependencyMap[5], "react-native/Libraries/NativeComponent/ViewConfigIgnore").ConditionallyIgnoredEventHandlers({ + onRefresh: true + })) + }; + var _default = exports.default = _$$_REQUIRE(_dependencyMap[6], "react-native/Libraries/NativeComponent/NativeComponentRegistry").get(nativeComponentName, function () { + return __INTERNAL_VIEW_CONFIG; + }); + var Commands = exports.Commands = { + setNativeRefreshing: function setNativeRefreshing(ref, refreshing) { + _$$_REQUIRE(_dependencyMap[7], "react-native/Libraries/ReactNative/RendererProxy").dispatchCommand(ref, "setNativeRefreshing", [refreshing]); + } + }; +},432,[6,265,276,65,189,262,244,61],"node_modules\\react-native\\Libraries\\Components\\RefreshControl\\PullToRefreshViewNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _SectionList = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Lists/SectionList")); + var _createAnimatedComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../createAnimatedComponent")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[4], "react/jsx-runtime"); + var _this = this, + _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Animated\\components\\AnimatedSectionList.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + /** + * @see https://github.com/facebook/react-native/commit/b8c8562 + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + var SectionListWithEventThrottle = React.forwardRef( + // $FlowFixMe[incompatible-call] + function (props, ref) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionList.default, Object.assign({}, props, { + ref: ref + })); + }); + var _default = exports.default = (0, _createAnimatedComponent.default)(SectionListWithEventThrottle); +},433,[6,434,372,65,106],"node_modules\\react-native\\Libraries\\Animated\\components\\AnimatedSectionList.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _objectWithoutProperties2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/objectWithoutProperties")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../Utilities/Platform")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[9], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Lists\\SectionList.js"; + var _excluded = ["stickySectionHeadersEnabled"]; + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + /** + * A performant interface for rendering sectioned lists, supporting the most handy features: + * + * - Fully cross-platform. + * - Configurable viewability callbacks. + * - List header support. + * - List footer support. + * - Item separator support. + * - Section header support. + * - Section separator support. + * - Heterogeneous data and item rendering support. + * - Pull to Refresh. + * - Scroll loading. + * + * If you don't need section support and want a simpler interface, use + * [``](https://reactnative.dev/docs/flatlist). + * + * Simple Examples: + * + * } + * renderSectionHeader={({section}) =>
} + * sections={[ // homogeneous rendering between sections + * {data: [...], title: ...}, + * {data: [...], title: ...}, + * {data: [...], title: ...}, + * ]} + * /> + * + * + * + * This is a convenience wrapper around [``](docs/virtualizedlist), + * and thus inherits its props (as well as those of `ScrollView`) that aren't explicitly listed + * here, along with the following caveats: + * + * - Internal state is not preserved when content scrolls out of the render window. Make sure all + * your data is captured in the item data or external stores like Flux, Redux, or Relay. + * - This is a `PureComponent` which means that it will not re-render if `props` remain shallow- + * equal. Make sure that everything your `renderItem` function depends on is passed as a prop + * (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on + * changes. This includes the `data` prop and parent component state. + * - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously + * offscreen. This means it's possible to scroll faster than the fill rate and momentarily see + * blank content. This is a tradeoff that can be adjusted to suit the needs of each application, + * and we are working on improving it behind the scenes. + * - By default, the list looks for a `key` prop on each item and uses that for the React key. + * Alternatively, you can provide a custom `keyExtractor` prop. + * + */ + var SectionList = exports.default = /*#__PURE__*/function (_React$PureComponent) { + function SectionList() { + var _this; + (0, _classCallCheck2.default)(this, SectionList); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, SectionList, [].concat(args)); + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ + _this._captureRef = function (ref) { + _this._wrapperListRef = ref; + }; + return _this; + } + (0, _inherits2.default)(SectionList, _React$PureComponent); + return (0, _createClass2.default)(SectionList, [{ + key: "scrollToLocation", + value: + /** + * Scrolls to the item at the specified `sectionIndex` and `itemIndex` (within the section) + * positioned in the viewable area such that `viewPosition` 0 places it at the top (and may be + * covered by a sticky header), 1 at the bottom, and 0.5 centered in the middle. `viewOffset` is a + * fixed number of pixels to offset the final target position, e.g. to compensate for sticky + * headers. + * + * Note: cannot scroll to locations outside the render window without specifying the + * `getItemLayout` prop. + */ + function scrollToLocation(params) { + if (this._wrapperListRef != null) { + this._wrapperListRef.scrollToLocation(params); + } + } + + /** + * Tells the list an interaction has occurred, which should trigger viewability calculations, e.g. + * if `waitForInteractions` is true and the user has not scrolled. This is typically called by + * taps on items or by navigation actions. + */ + }, { + key: "recordInteraction", + value: function recordInteraction() { + var listRef = this._wrapperListRef && this._wrapperListRef.getListRef(); + listRef && listRef.recordInteraction(); + } + + /** + * Displays the scroll indicators momentarily. + * + * @platform ios + */ + }, { + key: "flashScrollIndicators", + value: function flashScrollIndicators() { + var listRef = this._wrapperListRef && this._wrapperListRef.getListRef(); + listRef && listRef.flashScrollIndicators(); + } + + /** + * Provides a handle to the underlying scroll responder. + */ + }, { + key: "getScrollResponder", + value: function getScrollResponder() { + var listRef = this._wrapperListRef && this._wrapperListRef.getListRef(); + if (listRef) { + return listRef.getScrollResponder(); + } + } + }, { + key: "getScrollableNode", + value: function getScrollableNode() { + var listRef = this._wrapperListRef && this._wrapperListRef.getListRef(); + if (listRef) { + return listRef.getScrollableNode(); + } + } + }, { + key: "setNativeProps", + value: function setNativeProps(props) { + var listRef = this._wrapperListRef && this._wrapperListRef.getListRef(); + if (listRef) { + listRef.setNativeProps(props); + } + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + _stickySectionHeadersEnabled = _this$props.stickySectionHeadersEnabled, + restProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded); + var stickySectionHeadersEnabled = _stickySectionHeadersEnabled != null ? _stickySectionHeadersEnabled : _Platform.default.OS === 'ios'; + return ( + /*#__PURE__*/ + /* $FlowFixMe[incompatible-type] Error revealed after improved builtin + * React utility types */ + /* $FlowFixMe[incompatible-type] Error revealed after improved builtin + * React utility types */ + (0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[10], "@react-native/virtualized-lists").VirtualizedSectionList, Object.assign({}, restProps, { + stickySectionHeadersEnabled: stickySectionHeadersEnabled, + ref: this._captureRef + // $FlowFixMe[missing-local-annot] + , + getItemCount: function getItemCount(items) { + return items.length; + } + // $FlowFixMe[missing-local-annot] + , + getItem: function getItem(items, index) { + return items[index]; + } + })) + ); + } + }]); + }(React.PureComponent); +},434,[6,166,18,19,23,25,28,34,65,106,404],"node_modules\\react-native\\Libraries\\Lists\\SectionList.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _Text = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Text/Text")); + var _createAnimatedComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../createAnimatedComponent")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = (0, _createAnimatedComponent.default)(_Text.default); +},435,[6,310,372,65],"node_modules\\react-native\\Libraries\\Animated\\components\\AnimatedText.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Components/View/View")); + var _createAnimatedComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../createAnimatedComponent")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = (0, _createAnimatedComponent.default)(_View.default); +},436,[6,241,372,65],"node_modules\\react-native\\Libraries\\Animated\\components\\AnimatedView.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @noformat + * + * @nolint + * @generated SignedSource<<0debd6e5a17dc037cb4661315a886de6>> + */ + + 'use strict'; + + var ReactNative; + if (__DEV__) { + ReactNative = _$$_REQUIRE(_dependencyMap[0], "../implementations/ReactNativeRenderer-dev"); + } else { + ReactNative = _$$_REQUIRE(_dependencyMap[1], "../implementations/ReactNativeRenderer-prod"); + } + module.exports = ReactNative; +},437,[438,442],"node_modules\\react-native\\Libraries\\Renderer\\shims\\ReactNative.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * 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. + * + * + * @nolint + * @providesModule ReactNativeRenderer-dev + * @preventMunge + * @generated SignedSource<> + */ + + 'use strict'; + + if (__DEV__) { + (function () { + 'use strict'; + + /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === 'function') { + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); + } + "use strict"; + var React = _$$_REQUIRE(_dependencyMap[0], "react"); + _$$_REQUIRE(_dependencyMap[1], "react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore"); + var ReactNativePrivateInterface = _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface"); + var Scheduler = _$$_REQUIRE(_dependencyMap[3], "scheduler"); + var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + + // by calls to these methods by a Babel plugin. + // + // In PROD (or in packages without access to React internals), + // they are left as they are instead. + + function warn(format) { + { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + printWarning("warn", format, args); + } + } + } + function error(format) { + { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + printWarning("error", format, args); + } + } + } + function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + if (stack !== "") { + format += "%s"; + args = args.concat([stack]); + } // eslint-disable-next-line react-internal/safe-string-coercion + + var argsWithFormat = args.map(function (item) { + return String(item); + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift("Warning: " + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } + } + function invokeGuardedCallbackProd(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 invokeGuardedCallbackImpl = invokeGuardedCallbackProd; + { + // In DEV mode, we swap out invokeGuardedCallback for a special version + // that plays more nicely with the browser's DevTools. The idea is to preserve + // "Pause on exceptions" behavior. Because React wraps all user-provided + // functions in invokeGuardedCallback, and the production version of + // invokeGuardedCallback uses a try-catch, all user exceptions are treated + // like caught exceptions, and the DevTools won't pause unless the developer + // takes the extra step of enabling pause on caught exceptions. This is + // unintuitive, though, because even though React has caught the error, from + // the developer's perspective, the error is uncaught. + // + // To preserve the expected "Pause on exceptions" behavior, we don't use a + // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake + // DOM node, and call the user-provided callback from inside an event handler + // for that fake event. If the callback throws, the error is "captured" using + // a global event handler. But because the error happens in a different + // event loop context, it does not interrupt the normal program flow. + // Effectively, this gives us try-catch behavior without actually using + // try-catch. Neat! + // Check that the browser supports the APIs we need to implement our special + // DEV version of invokeGuardedCallback + if (typeof window !== "undefined" && typeof window.dispatchEvent === "function" && typeof document !== "undefined" && typeof document.createEvent === "function") { + var fakeNode = document.createElement("react"); + invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) { + // If document doesn't exist we know for sure we will crash in this method + // when we call document.createEvent(). However this can cause confusing + // errors: https://github.com/facebook/create-react-app/issues/3482 + // So we preemptively throw with a better message instead. + if (typeof document === "undefined" || document === null) { + throw new Error("The `document` global was defined when React was initialized, but is not " + "defined anymore. This can happen in a test environment if a component " + "schedules an update from an asynchronous callback, but the test has already " + "finished running. To solve this, you can either unmount the component at " + "the end of your test (and ensure that any asynchronous operations get " + "canceled in `componentWillUnmount`), or you can change the test itself " + "to be asynchronous."); + } + var evt = document.createEvent("Event"); + var didCall = false; // Keeps track of whether the user-provided callback threw an error. We + // set this to true at the beginning, then set it to false right after + // calling the function. If the function errors, `didError` will never be + // set to false. This strategy works even if the browser is flaky and + // fails to call our global error handler, because it doesn't rely on + // the error event at all. + + var didError = true; // Keeps track of the value of window.event so that we can reset it + // during the callback to let user code access window.event in the + // browsers that support it. + + var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event + // dispatching: https://github.com/facebook/react/issues/13688 + + var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, "event"); + function restoreAfterDispatch() { + // We immediately remove the callback from event listeners so that + // nested `invokeGuardedCallback` calls do not clash. Otherwise, a + // nested call would trigger the fake event handlers of any call higher + // in the stack. + fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the + // window.event assignment in both IE <= 10 as they throw an error + // "Member not found" in strict mode, and in Firefox which does not + // support window.event. + + if (typeof window.event !== "undefined" && window.hasOwnProperty("event")) { + window.event = windowEvent; + } + } // Create an event handler for our fake event. We will synchronously + // dispatch our fake event using `dispatchEvent`. Inside the handler, we + // call the user-provided callback. + + var funcArgs = Array.prototype.slice.call(arguments, 3); + function callCallback() { + didCall = true; + restoreAfterDispatch(); + func.apply(context, funcArgs); + didError = false; + } // Create a global error event handler. We use this to capture the value + // that was thrown. It's possible that this error handler will fire more + // than once; for example, if non-React code also calls `dispatchEvent` + // and a handler for that event throws. We should be resilient to most of + // those cases. Even if our error event handler fires more than once, the + // last error event is always used. If the callback actually does error, + // we know that the last error event is the correct one, because it's not + // possible for anything else to have happened in between our callback + // erroring and the code that follows the `dispatchEvent` call below. If + // the callback doesn't error, but the error event was fired, we know to + // ignore it because `didError` will be false, as described above. + + var error; // Use this to track whether the error event is ever called. + + var didSetError = false; + var isCrossOriginError = false; + function handleWindowError(event) { + error = event.error; + didSetError = true; + if (error === null && event.colno === 0 && event.lineno === 0) { + isCrossOriginError = true; + } + if (event.defaultPrevented) { + // Some other error handler has prevented default. + // Browsers silence the error report if this happens. + // We'll remember this to later decide whether to log it or not. + if (error != null && typeof error === "object") { + try { + error._suppressLogging = true; + } catch (inner) { + // Ignore. + } + } + } + } // Create a fake event type. + + var evtType = "react-" + (name ? name : "invokeguardedcallback"); // Attach our event handlers + + window.addEventListener("error", handleWindowError); + fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function + // errors, it will trigger our global error handler. + + evt.initEvent(evtType, false, false); + fakeNode.dispatchEvent(evt); + if (windowEventDescriptor) { + Object.defineProperty(window, "event", windowEventDescriptor); + } + if (didCall && didError) { + if (!didSetError) { + // The callback errored, but the error event never fired. + // eslint-disable-next-line react-internal/prod-error-codes + error = new Error("An error was thrown inside one of your components, but React " + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + "your browser. Try triggering the error in production mode, " + "or switching to a modern browser. If you suspect that this is " + "actually an issue with React, please file an issue."); + } else if (isCrossOriginError) { + // eslint-disable-next-line react-internal/prod-error-codes + error = new Error("A cross-origin error was thrown. React doesn't have access to " + "the actual error object in development. " + "See https://react.dev/link/crossorigin-error for more information."); + } + this.onError(error); + } // Remove our event listeners + + window.removeEventListener("error", handleWindowError); + if (!didCall) { + // Something went really wrong, and our event was not dispatched. + // https://github.com/facebook/react/issues/16734 + // https://github.com/facebook/react/issues/16585 + // Fall back to the production implementation. + restoreAfterDispatch(); + return invokeGuardedCallbackProd.apply(this, arguments); + } + }; + } + } + var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl; + var hasError = false; + var caughtError = null; // Used by event system to capture/rethrow the first error. + + var hasRethrowError = false; + var rethrowError = null; + var reporter = { + onError: function onError(error) { + hasError = true; + caughtError = error; + } + }; + /** + * Call a function while guarding against errors that happens within it. + * Returns an error if it throws, otherwise null. + * + * In production, this is implemented using a try-catch. The reason we don't + * use a try-catch directly is so that we can swap out a different + * implementation in DEV mode. + * + * @param {String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} context The context to use when calling the function + * @param {...*} args Arguments for function + */ + + function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { + hasError = false; + caughtError = null; + invokeGuardedCallbackImpl$1.apply(reporter, arguments); + } + /** + * Same as invokeGuardedCallback, but instead of returning an error, it stores + * it in a global so it can be rethrown by `rethrowCaughtError` later. + * TODO: See if caughtError and rethrowError can be unified. + * + * @param {String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} context The context to use when calling the function + * @param {...*} args Arguments for function + */ + + function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) { + invokeGuardedCallback.apply(this, arguments); + if (hasError) { + var error = clearCaughtError(); + if (!hasRethrowError) { + hasRethrowError = true; + rethrowError = error; + } + } + } + /** + * During execution of guarded functions we will capture the first error which + * we will rethrow to be handled by the top level error handler. + */ + + function rethrowCaughtError() { + if (hasRethrowError) { + var error = rethrowError; + hasRethrowError = false; + rethrowError = null; + throw error; + } + } + function hasCaughtError() { + return hasError; + } + function clearCaughtError() { + if (hasError) { + var error = caughtError; + hasError = false; + caughtError = null; + return error; + } else { + throw new Error("clearCaughtError was called but no error was captured. This error " + "is likely caused by a bug in React. Please file an issue."); + } + } + var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare + + function isArray(a) { + return isArrayImpl(a); + } + var getFiberCurrentPropsFromNode = null; + var getInstanceFromNode = null; + var getNodeFromInstance = null; + function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) { + getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl; + getInstanceFromNode = getInstanceFromNodeImpl; + getNodeFromInstance = getNodeFromInstanceImpl; + { + if (!getNodeFromInstance || !getInstanceFromNode) { + error("EventPluginUtils.setComponentTree(...): Injected " + "module is missing getNodeFromInstance or getInstanceFromNode."); + } + } + } + var validateEventDispatches; + { + validateEventDispatches = function validateEventDispatches(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + var listenersIsArr = isArray(dispatchListeners); + var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; + var instancesIsArr = isArray(dispatchInstances); + var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; + if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) { + error("EventPluginUtils: Invalid `event`."); + } + }; + } + /** + * Dispatch the event to the listener. + * @param {SyntheticEvent} event SyntheticEvent to handle + * @param {function} listener Application-level callback + * @param {*} inst Internal component instance + */ + + function executeDispatch(event, listener, inst) { + var type = event.type || "unknown-event"; + event.currentTarget = getNodeFromInstance(inst); + invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); + event.currentTarget = null; + } + /** + * Standard/simple iteration through an event's collected dispatches. + */ + + function executeDispatchesInOrder(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + { + validateEventDispatches(event); + } + if (isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } // Listeners and Instances are two parallel arrays that are always in sync. + + executeDispatch(event, dispatchListeners[i], dispatchInstances[i]); + } + } else if (dispatchListeners) { + executeDispatch(event, dispatchListeners, dispatchInstances); + } + event._dispatchListeners = null; + event._dispatchInstances = null; + } + /** + * Standard/simple iteration through an event's collected dispatches, but stops + * at the first dispatch execution returning true, and returns that id. + * + * @return {?string} id of the first dispatch execution who's listener returns + * true, or null if no listener returned true. + */ + + function executeDispatchesInOrderStopAtTrueImpl(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchInstances = event._dispatchInstances; + { + validateEventDispatches(event); + } + if (isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } // Listeners and Instances are two parallel arrays that are always in sync. + + if (dispatchListeners[i](event, dispatchInstances[i])) { + return dispatchInstances[i]; + } + } + } else if (dispatchListeners) { + if (dispatchListeners(event, dispatchInstances)) { + return dispatchInstances; + } + } + return null; + } + /** + * @see executeDispatchesInOrderStopAtTrueImpl + */ + + function executeDispatchesInOrderStopAtTrue(event) { + var ret = executeDispatchesInOrderStopAtTrueImpl(event); + event._dispatchInstances = null; + event._dispatchListeners = null; + return ret; + } + /** + * Execution of a "direct" dispatch - there must be at most one dispatch + * accumulated on the event or it is considered an error. It doesn't really make + * sense for an event with multiple dispatches (bubbled) to keep track of the + * return values at each dispatch execution, but it does tend to make sense when + * dealing with "direct" dispatches. + * + * @return {*} The return value of executing the single dispatch. + */ + + function executeDirectDispatch(event) { + { + validateEventDispatches(event); + } + var dispatchListener = event._dispatchListeners; + var dispatchInstance = event._dispatchInstances; + if (isArray(dispatchListener)) { + throw new Error("executeDirectDispatch(...): Invalid `event`."); + } + event.currentTarget = dispatchListener ? getNodeFromInstance(dispatchInstance) : null; + var res = dispatchListener ? dispatchListener(event) : null; + event.currentTarget = null; + event._dispatchListeners = null; + event._dispatchInstances = null; + return res; + } + /** + * @param {SyntheticEvent} event + * @return {boolean} True iff number of dispatches accumulated is greater than 0. + */ + + function hasDispatches(event) { + return !!event._dispatchListeners; + } + var assign = Object.assign; + var EVENT_POOL_SIZE = 10; + /** + * @interface Event + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ + + var EventInterface = { + type: null, + target: null, + // currentTarget is set when dispatching; no use in copying it here + currentTarget: function currentTarget() { + return null; + }, + eventPhase: null, + bubbles: null, + cancelable: null, + timeStamp: function timeStamp(event) { + return event.timeStamp || Date.now(); + }, + defaultPrevented: null, + isTrusted: null + }; + function functionThatReturnsTrue() { + return true; + } + function functionThatReturnsFalse() { + return false; + } + /** + * Synthetic events are dispatched by event plugins, typically in response to a + * top-level event delegation handler. + * + * These systems should generally use pooling to reduce the frequency of garbage + * collection. The system should check `isPersistent` to determine whether the + * event should be released into the pool after being dispatched. Users that + * need a persisted event should invoke `persist`. + * + * Synthetic events (and subclasses) implement the DOM Level 3 Events API by + * normalizing browser quirks. Subclasses do not necessarily have to implement a + * DOM interface; custom application-specific events can also subclass this. + * + * @param {object} dispatchConfig Configuration used to dispatch this event. + * @param {*} targetInst Marker identifying the event target. + * @param {object} nativeEvent Native browser event. + * @param {DOMEventTarget} nativeEventTarget Target node. + */ + + function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { + { + // these have a getter/setter for warnings + delete this.nativeEvent; + delete this.preventDefault; + delete this.stopPropagation; + delete this.isDefaultPrevented; + delete this.isPropagationStopped; + } + this.dispatchConfig = dispatchConfig; + this._targetInst = targetInst; + this.nativeEvent = nativeEvent; + this._dispatchListeners = null; + this._dispatchInstances = null; + var Interface = this.constructor.Interface; + for (var propName in Interface) { + if (!Interface.hasOwnProperty(propName)) { + continue; + } + { + delete this[propName]; // this has a getter/setter for warnings + } + var normalize = Interface[propName]; + if (normalize) { + this[propName] = normalize(nativeEvent); + } else { + if (propName === "target") { + this.target = nativeEventTarget; + } else { + this[propName] = nativeEvent[propName]; + } + } + } + var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false; + if (defaultPrevented) { + this.isDefaultPrevented = functionThatReturnsTrue; + } else { + this.isDefaultPrevented = functionThatReturnsFalse; + } + this.isPropagationStopped = functionThatReturnsFalse; + return this; + } + assign(SyntheticEvent.prototype, { + preventDefault: function preventDefault() { + this.defaultPrevented = true; + var event = this.nativeEvent; + if (!event) { + return; + } + if (event.preventDefault) { + event.preventDefault(); + } else if (typeof event.returnValue !== "unknown") { + event.returnValue = false; + } + this.isDefaultPrevented = functionThatReturnsTrue; + }, + stopPropagation: function stopPropagation() { + var event = this.nativeEvent; + if (!event) { + return; + } + if (event.stopPropagation) { + event.stopPropagation(); + } else if (typeof event.cancelBubble !== "unknown") { + // The ChangeEventPlugin registers a "propertychange" event for + // IE. This event does not support bubbling or cancelling, and + // any references to cancelBubble throw "Member not found". A + // typeof check of "unknown" circumvents this issue (and is also + // IE specific). + event.cancelBubble = true; + } + this.isPropagationStopped = functionThatReturnsTrue; + }, + /** + * We release all dispatched `SyntheticEvent`s after each event loop, adding + * them back into the pool. This allows a way to hold onto a reference that + * won't be added back into the pool. + */ + persist: function persist() { + this.isPersistent = functionThatReturnsTrue; + }, + /** + * Checks if this event should be released back into the pool. + * + * @return {boolean} True if this should not be released, false otherwise. + */ + isPersistent: functionThatReturnsFalse, + /** + * `PooledClass` looks for `destructor` on each instance it releases. + */ + destructor: function destructor() { + var Interface = this.constructor.Interface; + for (var propName in Interface) { + { + Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); + } + } + this.dispatchConfig = null; + this._targetInst = null; + this.nativeEvent = null; + this.isDefaultPrevented = functionThatReturnsFalse; + this.isPropagationStopped = functionThatReturnsFalse; + this._dispatchListeners = null; + this._dispatchInstances = null; + { + Object.defineProperty(this, "nativeEvent", getPooledWarningPropertyDefinition("nativeEvent", null)); + Object.defineProperty(this, "isDefaultPrevented", getPooledWarningPropertyDefinition("isDefaultPrevented", functionThatReturnsFalse)); + Object.defineProperty(this, "isPropagationStopped", getPooledWarningPropertyDefinition("isPropagationStopped", functionThatReturnsFalse)); + Object.defineProperty(this, "preventDefault", getPooledWarningPropertyDefinition("preventDefault", function () {})); + Object.defineProperty(this, "stopPropagation", getPooledWarningPropertyDefinition("stopPropagation", function () {})); + } + } + }); + SyntheticEvent.Interface = EventInterface; + /** + * Helper to reduce boilerplate when creating subclasses. + */ + + SyntheticEvent.extend = function (Interface) { + var Super = this; + var E = function E() {}; + E.prototype = Super.prototype; + var prototype = new E(); + function Class() { + return Super.apply(this, arguments); + } + assign(prototype, Class.prototype); + Class.prototype = prototype; + Class.prototype.constructor = Class; + Class.Interface = assign({}, Super.Interface, Interface); + Class.extend = Super.extend; + addEventPoolingTo(Class); + return Class; + }; + addEventPoolingTo(SyntheticEvent); + /** + * Helper to nullify syntheticEvent instance properties when destructing + * + * @param {String} propName + * @param {?object} getVal + * @return {object} defineProperty object + */ + + function getPooledWarningPropertyDefinition(propName, getVal) { + function set(val) { + var action = isFunction ? "setting the method" : "setting the property"; + warn(action, "This is effectively a no-op"); + return val; + } + function get() { + var action = isFunction ? "accessing the method" : "accessing the property"; + var result = isFunction ? "This is a no-op function" : "This is set to null"; + warn(action, result); + return getVal; + } + function warn(action, result) { + { + error("This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + "If you must keep the original synthetic event around, use event.persist(). " + "See https://react.dev/link/event-pooling for more information.", action, propName, result); + } + } + var isFunction = typeof getVal === "function"; + return { + configurable: true, + set: set, + get: get + }; + } + function createOrGetPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) { + var EventConstructor = this; + if (EventConstructor.eventPool.length) { + var instance = EventConstructor.eventPool.pop(); + EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst); + return instance; + } + return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst); + } + function releasePooledEvent(event) { + var EventConstructor = this; + if (!(event instanceof EventConstructor)) { + throw new Error("Trying to release an event instance into a pool of a different type."); + } + event.destructor(); + if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) { + EventConstructor.eventPool.push(event); + } + } + function addEventPoolingTo(EventConstructor) { + EventConstructor.getPooled = createOrGetPooledEvent; + EventConstructor.eventPool = []; + EventConstructor.release = releasePooledEvent; + } + + /** + * `touchHistory` isn't actually on the native event, but putting it in the + * interface will ensure that it is cleaned up when pooled/destroyed. The + * `ResponderEventPlugin` will populate it appropriately. + */ + + var ResponderSyntheticEvent = SyntheticEvent.extend({ + touchHistory: function touchHistory(nativeEvent) { + return null; // Actually doesn't even look at the native event. + } + }); + var TOP_TOUCH_START = "topTouchStart"; + var TOP_TOUCH_MOVE = "topTouchMove"; + var TOP_TOUCH_END = "topTouchEnd"; + var TOP_TOUCH_CANCEL = "topTouchCancel"; + var TOP_SCROLL = "topScroll"; + var TOP_SELECTION_CHANGE = "topSelectionChange"; + function isStartish(topLevelType) { + return topLevelType === TOP_TOUCH_START; + } + function isMoveish(topLevelType) { + return topLevelType === TOP_TOUCH_MOVE; + } + function isEndish(topLevelType) { + return topLevelType === TOP_TOUCH_END || topLevelType === TOP_TOUCH_CANCEL; + } + var startDependencies = [TOP_TOUCH_START]; + var moveDependencies = [TOP_TOUCH_MOVE]; + var endDependencies = [TOP_TOUCH_CANCEL, TOP_TOUCH_END]; + + /** + * Tracks the position and time of each active touch by `touch.identifier`. We + * should typically only see IDs in the range of 1-20 because IDs get recycled + * when touches end and start again. + */ + + var MAX_TOUCH_BANK = 20; + var touchBank = []; + var touchHistory = { + touchBank: touchBank, + numberActiveTouches: 0, + // If there is only one active touch, we remember its location. This prevents + // us having to loop through all of the touches all the time in the most + // common case. + indexOfSingleActiveTouch: -1, + mostRecentTimeStamp: 0 + }; + function timestampForTouch(touch) { + // The legacy internal implementation provides "timeStamp", which has been + // renamed to "timestamp". Let both work for now while we iron it out + // TODO (evv): rename timeStamp to timestamp in internal code + return touch.timeStamp || touch.timestamp; + } + /** + * TODO: Instead of making gestures recompute filtered velocity, we could + * include a built in velocity computation that can be reused globally. + */ + + function createTouchRecord(touch) { + return { + touchActive: true, + 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) + }; + } + function resetTouchRecord(touchRecord, touch) { + touchRecord.touchActive = true; + 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); + } + function getTouchIdentifier(_ref) { + var identifier = _ref.identifier; + if (identifier == null) { + throw new Error("Touch object is missing identifier."); + } + { + if (identifier > MAX_TOUCH_BANK) { + error("Touch identifier %s is greater than maximum supported %s which causes " + "performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK); + } + } + return identifier; + } + function recordTouchStart(touch) { + var identifier = getTouchIdentifier(touch); + var touchRecord = touchBank[identifier]; + if (touchRecord) { + resetTouchRecord(touchRecord, touch); + } else { + touchBank[identifier] = createTouchRecord(touch); + } + touchHistory.mostRecentTimeStamp = timestampForTouch(touch); + } + function recordTouchMove(touch) { + var touchRecord = touchBank[getTouchIdentifier(touch)]; + if (touchRecord) { + touchRecord.touchActive = true; + 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); + } else { + { + warn("Cannot record touch move without a touch start.\n" + "Touch Move: %s\n" + "Touch Bank: %s", printTouch(touch), printTouchBank()); + } + } + } + function recordTouchEnd(touch) { + var touchRecord = touchBank[getTouchIdentifier(touch)]; + if (touchRecord) { + touchRecord.touchActive = false; + 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); + } else { + { + warn("Cannot record touch end without a touch start.\n" + "Touch End: %s\n" + "Touch Bank: %s", printTouch(touch), printTouchBank()); + } + } + } + function printTouch(touch) { + return JSON.stringify({ + identifier: touch.identifier, + pageX: touch.pageX, + pageY: touch.pageY, + timestamp: timestampForTouch(touch) + }); + } + function printTouchBank() { + var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK)); + if (touchBank.length > MAX_TOUCH_BANK) { + printed += " (original size: " + touchBank.length + ")"; + } + return printed; + } + var instrumentationCallback; + var ResponderTouchHistoryStore = { + /** + * Registers a listener which can be used to instrument every touch event. + */ + instrument: function instrument(callback) { + instrumentationCallback = callback; + }, + recordTouchTrack: function recordTouchTrack(topLevelType, nativeEvent) { + if (instrumentationCallback != null) { + instrumentationCallback(topLevelType, nativeEvent); + } + if (isMoveish(topLevelType)) { + nativeEvent.changedTouches.forEach(recordTouchMove); + } else if (isStartish(topLevelType)) { + nativeEvent.changedTouches.forEach(recordTouchStart); + touchHistory.numberActiveTouches = nativeEvent.touches.length; + if (touchHistory.numberActiveTouches === 1) { + touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier; + } + } else if (isEndish(topLevelType)) { + nativeEvent.changedTouches.forEach(recordTouchEnd); + touchHistory.numberActiveTouches = nativeEvent.touches.length; + if (touchHistory.numberActiveTouches === 1) { + for (var i = 0; i < touchBank.length; i++) { + var touchTrackToCheck = touchBank[i]; + if (touchTrackToCheck != null && touchTrackToCheck.touchActive) { + touchHistory.indexOfSingleActiveTouch = i; + break; + } + } + { + var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch]; + if (activeRecord == null || !activeRecord.touchActive) { + error("Cannot find single active touch."); + } + } + } + } + }, + touchHistory: touchHistory + }; + + /** + * Accumulates items that must not be null or undefined. + * + * This is used to conserve memory by avoiding array allocations. + * + * @return {*|array<*>} An accumulation of items. + */ + + function accumulate(current, next) { + if (next == null) { + throw new Error("accumulate(...): Accumulated items must not be null or undefined."); + } + if (current == null) { + return next; + } // Both are not empty. Warning: Never call x.concat(y) when you are not + // certain that x is an Array (x could be a string with concat method). + + if (isArray(current)) { + return current.concat(next); + } + if (isArray(next)) { + return [current].concat(next); + } + return [current, next]; + } + + /** + * Accumulates items that must not be null or undefined into the first one. This + * is used to conserve memory by avoiding array allocations, and thus sacrifices + * API cleanness. Since `current` can be null before being passed in and not + * null after this function, make sure to assign it back to `current`: + * + * `a = accumulateInto(a, b);` + * + * This API should be sparingly used. Try `accumulate` for something cleaner. + * + * @return {*|array<*>} An accumulation of items. + */ + + function accumulateInto(current, next) { + if (next == null) { + throw new Error("accumulateInto(...): Accumulated items must not be null or undefined."); + } + if (current == null) { + return next; + } // Both are not empty. Warning: Never call x.concat(y) when you are not + // certain that x is an Array (x could be a string with concat method). + + if (isArray(current)) { + if (isArray(next)) { + current.push.apply(current, next); + return current; + } + current.push(next); + return current; + } + if (isArray(next)) { + // A bit too dangerous to mutate `next`. + return [current].concat(next); + } + return [current, next]; + } + + /** + * @param {array} arr an "accumulation" of items which is either an Array or + * a single item. Useful when paired with the `accumulate` module. This is a + * simple utility that allows us to reason about a collection of items, but + * handling the case when there is exactly one item (and we do not need to + * allocate an array). + * @param {function} cb Callback invoked with each element or a collection. + * @param {?} [scope] Scope used as `this` in a callback. + */ + function forEachAccumulated(arr, cb, scope) { + if (Array.isArray(arr)) { + arr.forEach(cb, scope); + } else if (arr) { + cb.call(scope, arr); + } + } + var FunctionComponent = 0; + var ClassComponent = 1; + var IndeterminateComponent = 2; // Before we know whether it is function or class + + var HostRoot = 3; // Root of a host tree. Could be nested inside another node. + + var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. + + var HostComponent = 5; + var HostText = 6; + var Fragment = 7; + var Mode = 8; + var ContextConsumer = 9; + var ContextProvider = 10; + var ForwardRef = 11; + var Profiler = 12; + var SuspenseComponent = 13; + var MemoComponent = 14; + var SimpleMemoComponent = 15; + var LazyComponent = 16; + var IncompleteClassComponent = 17; + var DehydratedFragment = 18; + var SuspenseListComponent = 19; + var ScopeComponent = 21; + var OffscreenComponent = 22; + var LegacyHiddenComponent = 23; + var CacheComponent = 24; + var TracingMarkerComponent = 25; + + /** + * Instance of element that should respond to touch/move types of interactions, + * as indicated explicitly by relevant callbacks. + */ + + var responderInst = null; + /** + * Count of current touches. A textInput should become responder iff the + * selection changes while there is a touch on the screen. + */ + + var trackedTouchCount = 0; + var changeResponder = function changeResponder(nextResponderInst, blockHostResponder) { + var oldResponderInst = responderInst; + responderInst = nextResponderInst; + if (ResponderEventPlugin.GlobalResponderHandler !== null) { + ResponderEventPlugin.GlobalResponderHandler.onChange(oldResponderInst, nextResponderInst, blockHostResponder); + } + }; + var eventTypes = { + /** + * On a `touchStart`/`mouseDown`, is it desired that this element become the + * responder? + */ + startShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onStartShouldSetResponder", + captured: "onStartShouldSetResponderCapture" + }, + dependencies: startDependencies + }, + /** + * On a `scroll`, is it desired that this element become the responder? This + * is usually not needed, but should be used to retroactively infer that a + * `touchStart` had occurred during momentum scroll. During a momentum scroll, + * a touch start will be immediately followed by a scroll event if the view is + * currently scrolling. + * + * TODO: This shouldn't bubble. + */ + scrollShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onScrollShouldSetResponder", + captured: "onScrollShouldSetResponderCapture" + }, + dependencies: [TOP_SCROLL] + }, + /** + * On text selection change, should this element become the responder? This + * is needed for text inputs or other views with native selection, so the + * JS view can claim the responder. + * + * TODO: This shouldn't bubble. + */ + selectionChangeShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onSelectionChangeShouldSetResponder", + captured: "onSelectionChangeShouldSetResponderCapture" + }, + dependencies: [TOP_SELECTION_CHANGE] + }, + /** + * On a `touchMove`/`mouseMove`, is it desired that this element become the + * responder? + */ + moveShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onMoveShouldSetResponder", + captured: "onMoveShouldSetResponderCapture" + }, + dependencies: moveDependencies + }, + /** + * Direct responder events dispatched directly to responder. Do not bubble. + */ + 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: [] + } + }; // Start of inline: the below functions were inlined from + // EventPropagator.js, as they deviated from ReactDOM's newer + // implementations. + + function getParent(inst) { + do { + inst = inst.return; // TODO: If this is a HostRoot we might want to bail out. + // That is depending on if we want nested subtrees (layers) to bubble + // events to their parent. We could also go through parentNode on the + // host node but that wouldn't work for React Native and doesn't let us + // do the portal feature. + } while (inst && inst.tag !== HostComponent); + if (inst) { + return inst; + } + return null; + } + /** + * Return the lowest common ancestor of A and B, or null if they are in + * different trees. + */ + + function getLowestCommonAncestor(instA, instB) { + var depthA = 0; + for (var tempA = instA; tempA; tempA = getParent(tempA)) { + depthA++; + } + var depthB = 0; + for (var tempB = instB; tempB; tempB = getParent(tempB)) { + depthB++; + } // If A is deeper, crawl up. + + while (depthA - depthB > 0) { + instA = getParent(instA); + depthA--; + } // If B is deeper, crawl up. + + while (depthB - depthA > 0) { + instB = getParent(instB); + depthB--; + } // Walk in lockstep until we find a match. + + var depth = depthA; + while (depth--) { + if (instA === instB || instA === instB.alternate) { + return instA; + } + instA = getParent(instA); + instB = getParent(instB); + } + return null; + } + /** + * Return if A is an ancestor of B. + */ + + function isAncestor(instA, instB) { + while (instB) { + if (instA === instB || instA === instB.alternate) { + return true; + } + instB = getParent(instB); + } + return false; + } + /** + * Simulates the traversal of a two-phase, capture/bubble event dispatch. + */ + + function traverseTwoPhase(inst, fn, arg) { + var path = []; + while (inst) { + path.push(inst); + inst = getParent(inst); + } + var i; + for (i = path.length; i-- > 0;) { + fn(path[i], "captured", arg); + } + for (i = 0; i < path.length; i++) { + fn(path[i], "bubbled", arg); + } + } + function getListener(inst, registrationName) { + var stateNode = inst.stateNode; + if (stateNode === null) { + // Work in progress (ex: onload events in incremental mode). + return null; + } + var props = getFiberCurrentPropsFromNode(stateNode); + if (props === null) { + // Work in progress. + return null; + } + var listener = props[registrationName]; + if (listener && typeof listener !== "function") { + throw new Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type."); + } + return listener; + } + function listenerAtPhase(inst, event, propagationPhase) { + var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; + return getListener(inst, registrationName); + } + function accumulateDirectionalDispatches(inst, phase, event) { + { + if (!inst) { + error("Dispatching inst must not be null"); + } + } + var listener = listenerAtPhase(inst, event, phase); + if (listener) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); + event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } + } + /** + * Accumulates without regard to direction, does not look for phased + * registration names. Same as `accumulateDirectDispatchesSingle` but without + * requiring that the `dispatchMarker` be the same as the dispatched ID. + */ + + function accumulateDispatches(inst, ignoredDirection, event) { + if (inst && event && event.dispatchConfig.registrationName) { + var registrationName = event.dispatchConfig.registrationName; + var listener = getListener(inst, registrationName); + if (listener) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); + event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } + } + } + /** + * Accumulates dispatches on an `SyntheticEvent`, but only for the + * `dispatchMarker`. + * @param {SyntheticEvent} event + */ + + function accumulateDirectDispatchesSingle(event) { + if (event && event.dispatchConfig.registrationName) { + accumulateDispatches(event._targetInst, null, event); + } + } + function accumulateDirectDispatches(events) { + forEachAccumulated(events, accumulateDirectDispatchesSingle); + } + function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + var targetInst = event._targetInst; + var parentInst = targetInst ? getParent(targetInst) : null; + traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event); + } + } + function accumulateTwoPhaseDispatchesSkipTarget(events) { + forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget); + } + function accumulateTwoPhaseDispatchesSingle(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); + } + } + function accumulateTwoPhaseDispatches(events) { + forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle); + } // End of inline + + /** + * + * Responder System: + * ---------------- + * + * - A global, solitary "interaction lock" on a view. + * - If a node becomes the responder, it should convey visual feedback + * immediately to indicate so, either by highlighting or moving accordingly. + * - To be the responder means, that touches are exclusively important to that + * responder view, and no other view. + * - While touches are still occurring, the responder lock can be transferred to + * a new view, but only to increasingly "higher" views (meaning ancestors of + * the current responder). + * + * Responder being granted: + * ------------------------ + * + * - Touch starts, moves, and scrolls can cause an ID to become the responder. + * - We capture/bubble `startShouldSetResponder`/`moveShouldSetResponder` to + * the "appropriate place". + * - If nothing is currently the responder, the "appropriate place" is the + * initiating event's `targetID`. + * - If something *is* already the responder, the "appropriate place" is the + * first common ancestor of the event target and the current `responderInst`. + * - Some negotiation happens: See the timing diagram below. + * - Scrolled views automatically become responder. The reasoning is that a + * platform scroll view that isn't built on top of the responder system has + * began scrolling, and the active responder must now be notified that the + * interaction is no longer locked to it - the system has taken over. + * + * - Responder being released: + * As soon as no more touches that *started* inside of descendants of the + * *current* responderInst, an `onResponderRelease` event is dispatched to the + * current responder, and the responder lock is released. + * + * TODO: + * - on "end", a callback hook for `onResponderEndShouldRemainResponder` that + * determines if the responder lock should remain. + * - If a view shouldn't "remain" the responder, any active touches should by + * default be considered "dead" and do not influence future negotiations or + * bubble paths. It should be as if those touches do not exist. + * -- For multitouch: Usually a translate-z will choose to "remain" responder + * after one out of many touches ended. For translate-y, usually the view + * doesn't wish to "remain" responder after one of many touches end. + * - Consider building this on top of a `stopPropagation` model similar to + * `W3C` events. + * - Ensure that `onResponderTerminate` is called on touch cancels, whether or + * not `onResponderTerminationRequest` returns `true` or `false`. + * + */ + + /* Negotiation Performed + +-----------------------+ + / \ + Process low level events to + Current Responder + wantsResponderID + determine who to perform negot-| (if any exists at all) | + iation/transition | Otherwise just pass through| + -------------------------------+----------------------------+------------------+ + Bubble to find first ID | | + to return true:wantsResponderID| | + | | + +-------------+ | | + | onTouchStart| | | + +------+------+ none | | + | return| | + +-----------v-------------+true| +------------------------+ | + |onStartShouldSetResponder|----->|onResponderStart (cur) |<-----------+ + +-----------+-------------+ | +------------------------+ | | + | | | +--------+-------+ + | returned true for| false:REJECT +-------->|onResponderReject + | wantsResponderID | | | +----------------+ + | (now attempt | +------------------+-----+ | + | handoff) | | onResponder | | + +------------------->| TerminationRequest| | + | +------------------+-----+ | + | | | +----------------+ + | true:GRANT +-------->|onResponderGrant| + | | +--------+-------+ + | +------------------------+ | | + | | onResponderTerminate |<-----------+ + | +------------------+-----+ | + | | | +----------------+ + | +-------->|onResponderStart| + | | +----------------+ + Bubble to find first ID | | + to return true:wantsResponderID| | + | | + +-------------+ | | + | onTouchMove | | | + +------+------+ none | | + | return| | + +-----------v-------------+true| +------------------------+ | + |onMoveShouldSetResponder |----->|onResponderMove (cur) |<-----------+ + +-----------+-------------+ | +------------------------+ | | + | | | +--------+-------+ + | returned true for| false:REJECT +-------->|onResponderRejec| + | wantsResponderID | | | +----------------+ + | (now attempt | +------------------+-----+ | + | handoff) | | onResponder | | + +------------------->| TerminationRequest| | + | +------------------+-----+ | + | | | +----------------+ + | true:GRANT +-------->|onResponderGrant| + | | +--------+-------+ + | +------------------------+ | | + | | onResponderTerminate |<-----------+ + | +------------------+-----+ | + | | | +----------------+ + | +-------->|onResponderMove | + | | +----------------+ + | | + | | + Some active touch started| | + inside current responder | +------------------------+ | + +------------------------->| onResponderEnd | | + | | +------------------------+ | + +---+---------+ | | + | onTouchEnd | | | + +---+---------+ | | + | | +------------------------+ | + +------------------------->| onResponderEnd | | + No active touches started| +-----------+------------+ | + inside current responder | | | + | v | + | +------------------------+ | + | | onResponderRelease | | + | +------------------------+ | + | | + + + */ + + /** + * A note about event ordering in the `EventPluginRegistry`. + * + * Suppose plugins are injected in the following order: + * + * `[R, S, C]` + * + * To help illustrate the example, assume `S` is `SimpleEventPlugin` (for + * `onClick` etc) and `R` is `ResponderEventPlugin`. + * + * "Deferred-Dispatched Events": + * + * - The current event plugin system will traverse the list of injected plugins, + * in order, and extract events by collecting the plugin's return value of + * `extractEvents()`. + * - These events that are returned from `extractEvents` are "deferred + * dispatched events". + * - When returned from `extractEvents`, deferred-dispatched events contain an + * "accumulation" of deferred dispatches. + * - These deferred dispatches are accumulated/collected before they are + * returned, but processed at a later time by the `EventPluginRegistry` (hence the + * name deferred). + * + * In the process of returning their deferred-dispatched events, event plugins + * themselves can dispatch events on-demand without returning them from + * `extractEvents`. Plugins might want to do this, so that they can use event + * dispatching as a tool that helps them decide which events should be extracted + * in the first place. + * + * "On-Demand-Dispatched Events": + * + * - On-demand-dispatched events are not returned from `extractEvents`. + * - On-demand-dispatched events are dispatched during the process of returning + * the deferred-dispatched events. + * - They should not have side effects. + * - They should be avoided, and/or eventually be replaced with another + * abstraction that allows event plugins to perform multiple "rounds" of event + * extraction. + * + * Therefore, the sequence of event dispatches becomes: + * + * - `R`s on-demand events (if any) (dispatched by `R` on-demand) + * - `S`s on-demand events (if any) (dispatched by `S` on-demand) + * - `C`s on-demand events (if any) (dispatched by `C` on-demand) + * - `R`s extracted events (if any) (dispatched by `EventPluginRegistry`) + * - `S`s extracted events (if any) (dispatched by `EventPluginRegistry`) + * - `C`s extracted events (if any) (dispatched by `EventPluginRegistry`) + * + * In the case of `ResponderEventPlugin`: If the `startShouldSetResponder` + * on-demand dispatch returns `true` (and some other details are satisfied) the + * `onResponderGrant` deferred dispatched event is returned from + * `extractEvents`. The sequence of dispatch executions in this case + * will appear as follows: + * + * - `startShouldSetResponder` (`ResponderEventPlugin` dispatches on-demand) + * - `touchStartCapture` (`EventPluginRegistry` dispatches as usual) + * - `touchStart` (`EventPluginRegistry` dispatches as usual) + * - `responderGrant/Reject` (`EventPluginRegistry` dispatches as usual) + */ + + function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var shouldSetEventType = isStartish(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish(topLevelType) ? eventTypes.moveShouldSetResponder : topLevelType === TOP_SELECTION_CHANGE ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder; // TODO: stop one short of the current responder. + + var bubbleShouldSetFrom = !responderInst ? targetInst : getLowestCommonAncestor(responderInst, targetInst); // When capturing/bubbling the "shouldSet" event, we want to skip the target + // (deepest ID) if it happens to be the current responder. The reasoning: + // It's strange to get an `onMoveShouldSetResponder` when you're *already* + // the responder. + + var skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst; + var shouldSetEvent = ResponderSyntheticEvent.getPooled(shouldSetEventType, bubbleShouldSetFrom, nativeEvent, nativeEventTarget); + shouldSetEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + if (skipOverBubbleShouldSetFrom) { + accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent); + } else { + accumulateTwoPhaseDispatches(shouldSetEvent); + } + var wantsResponderInst = executeDispatchesInOrderStopAtTrue(shouldSetEvent); + if (!shouldSetEvent.isPersistent()) { + shouldSetEvent.constructor.release(shouldSetEvent); + } + if (!wantsResponderInst || wantsResponderInst === responderInst) { + return null; + } + var extracted; + var grantEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderGrant, wantsResponderInst, nativeEvent, nativeEventTarget); + grantEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + accumulateDirectDispatches(grantEvent); + var blockHostResponder = executeDirectDispatch(grantEvent) === true; + if (responderInst) { + var terminationRequestEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget); + terminationRequestEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + accumulateDirectDispatches(terminationRequestEvent); + var shouldSwitch = !hasDispatches(terminationRequestEvent) || executeDirectDispatch(terminationRequestEvent); + if (!terminationRequestEvent.isPersistent()) { + terminationRequestEvent.constructor.release(terminationRequestEvent); + } + if (shouldSwitch) { + var terminateEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget); + terminateEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + accumulateDirectDispatches(terminateEvent); + extracted = accumulate(extracted, [grantEvent, terminateEvent]); + changeResponder(wantsResponderInst, blockHostResponder); + } else { + var rejectEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderReject, wantsResponderInst, nativeEvent, nativeEventTarget); + rejectEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + accumulateDirectDispatches(rejectEvent); + extracted = accumulate(extracted, rejectEvent); + } + } else { + extracted = accumulate(extracted, grantEvent); + changeResponder(wantsResponderInst, blockHostResponder); + } + return extracted; + } + /** + * A transfer is a negotiation between a currently set responder and the next + * element to claim responder status. Any start event could trigger a transfer + * of responderInst. Any move event could trigger a transfer. + * + * @param {string} topLevelType Record from `BrowserEventConstants`. + * @return {boolean} True if a transfer of responder could possibly occur. + */ + + function canTriggerTransfer(topLevelType, topLevelInst, nativeEvent) { + return topLevelInst && ( + // responderIgnoreScroll: We are trying to migrate away from specifically + // tracking native scroll events here and responderIgnoreScroll indicates we + // will send topTouchCancel to handle canceling touch events instead + topLevelType === TOP_SCROLL && !nativeEvent.responderIgnoreScroll || trackedTouchCount > 0 && topLevelType === TOP_SELECTION_CHANGE || isStartish(topLevelType) || isMoveish(topLevelType)); + } + /** + * Returns whether or not this touch end event makes it such that there are no + * longer any touches that started inside of the current `responderInst`. + * + * @param {NativeEvent} nativeEvent Native touch end event. + * @return {boolean} Whether or not this touch end event ends the responder. + */ + + function noResponderTouches(nativeEvent) { + var touches = nativeEvent.touches; + if (!touches || touches.length === 0) { + return true; + } + for (var i = 0; i < touches.length; i++) { + var activeTouch = touches[i]; + var target = activeTouch.target; + if (target !== null && target !== undefined && target !== 0) { + // Is the original touch location inside of the current responder? + var targetInst = getInstanceFromNode(target); + if (isAncestor(responderInst, targetInst)) { + return false; + } + } + } + return true; + } + var ResponderEventPlugin = { + /* For unit testing only */ + _getResponder: function _getResponder() { + return responderInst; + }, + eventTypes: eventTypes, + /** + * We must be resilient to `targetInst` being `null` on `touchMove` or + * `touchEnd`. On certain platforms, this means that a native scroll has + * assumed control and the original touch targets are destroyed. + */ + extractEvents: function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) { + if (isStartish(topLevelType)) { + trackedTouchCount += 1; + } else if (isEndish(topLevelType)) { + if (trackedTouchCount >= 0) { + trackedTouchCount -= 1; + } else { + { + warn("Ended a touch event which was not counted in `trackedTouchCount`."); + } + return null; + } + } + ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent); + var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent) ? setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) : null; // Responder may or may not have transferred on a new touch start/move. + // Regardless, whoever is the responder after any potential transfer, we + // direct all touch start/move/ends to them in the form of + // `onResponderMove/Start/End`. These will be called for *every* additional + // finger that move/start/end, dispatched directly to whoever is the + // current responder at that moment, until the responder is "released". + // + // These multiple individual change touch events are are always bookended + // by `onResponderGrant`, and one of + // (`onResponderRelease/onResponderTerminate`). + + var isResponderTouchStart = responderInst && isStartish(topLevelType); + var isResponderTouchMove = responderInst && isMoveish(topLevelType); + var isResponderTouchEnd = responderInst && isEndish(topLevelType); + var incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove ? eventTypes.responderMove : isResponderTouchEnd ? eventTypes.responderEnd : null; + if (incrementalTouch) { + var gesture = ResponderSyntheticEvent.getPooled(incrementalTouch, responderInst, nativeEvent, nativeEventTarget); + gesture.touchHistory = ResponderTouchHistoryStore.touchHistory; + accumulateDirectDispatches(gesture); + extracted = accumulate(extracted, gesture); + } + var isResponderTerminate = responderInst && topLevelType === TOP_TOUCH_CANCEL; + var isResponderRelease = responderInst && !isResponderTerminate && isEndish(topLevelType) && noResponderTouches(nativeEvent); + var finalTouch = isResponderTerminate ? eventTypes.responderTerminate : isResponderRelease ? eventTypes.responderRelease : null; + if (finalTouch) { + var finalEvent = ResponderSyntheticEvent.getPooled(finalTouch, responderInst, nativeEvent, nativeEventTarget); + finalEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; + accumulateDirectDispatches(finalEvent); + extracted = accumulate(extracted, finalEvent); + changeResponder(null); + } + return extracted; + }, + GlobalResponderHandler: null, + injection: { + /** + * @param {{onChange: (ReactID, ReactID) => void} GlobalResponderHandler + * Object that handles any change in responder. Use this to inject + * integration with an existing touch handling system etc. + */ + injectGlobalResponderHandler: function injectGlobalResponderHandler(GlobalResponderHandler) { + ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler; + } + } + }; + + /** + * Injectable ordering of event plugins. + */ + var eventPluginOrder = null; + /** + * Injectable mapping from names to event plugin modules. + */ + + var namesToPlugins = {}; + /** + * Recomputes the plugin list using the injected plugins and plugin ordering. + * + * @private + */ + + function recomputePluginOrdering() { + if (!eventPluginOrder) { + // Wait until an `eventPluginOrder` is injected. + return; + } + for (var pluginName in namesToPlugins) { + var pluginModule = namesToPlugins[pluginName]; + var pluginIndex = eventPluginOrder.indexOf(pluginName); + if (pluginIndex <= -1) { + throw new Error("EventPluginRegistry: Cannot inject event plugins that do not exist in " + ("the plugin ordering, `" + pluginName + "`.")); + } + if (plugins[pluginIndex]) { + continue; + } + if (!pluginModule.extractEvents) { + throw new Error("EventPluginRegistry: Event plugins must implement an `extractEvents` " + ("method, but `" + pluginName + "` does not.")); + } + plugins[pluginIndex] = pluginModule; + var publishedEvents = pluginModule.eventTypes; + for (var eventName in publishedEvents) { + if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) { + throw new Error("EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`."); + } + } + } + } + /** + * Publishes an event so that it can be dispatched by the supplied plugin. + * + * @param {object} dispatchConfig Dispatch configuration for the event. + * @param {object} PluginModule Plugin publishing the event. + * @return {boolean} True if the event was successfully published. + * @private + */ + + function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { + if (eventNameDispatchConfigs.hasOwnProperty(eventName)) { + throw new Error("EventPluginRegistry: More than one plugin attempted to publish the same " + ("event name, `" + eventName + "`.")); + } + eventNameDispatchConfigs[eventName] = dispatchConfig; + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + if (phasedRegistrationNames) { + for (var phaseName in phasedRegistrationNames) { + if (phasedRegistrationNames.hasOwnProperty(phaseName)) { + var phasedRegistrationName = phasedRegistrationNames[phaseName]; + publishRegistrationName(phasedRegistrationName, pluginModule, eventName); + } + } + return true; + } else if (dispatchConfig.registrationName) { + publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); + return true; + } + return false; + } + /** + * Publishes a registration name that is used to identify dispatched events. + * + * @param {string} registrationName Registration name to add. + * @param {object} PluginModule Plugin publishing the event. + * @private + */ + + function publishRegistrationName(registrationName, pluginModule, eventName) { + if (registrationNameModules[registrationName]) { + throw new Error("EventPluginRegistry: More than one plugin attempted to publish the same " + ("registration name, `" + registrationName + "`.")); + } + registrationNameModules[registrationName] = pluginModule; + registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; + { + var lowerCasedName = registrationName.toLowerCase(); + } + } + /** + * Registers plugins so that they can extract and dispatch events. + */ + + /** + * Ordered list of injected plugins. + */ + + var plugins = []; + /** + * Mapping from event name to dispatch config + */ + + var eventNameDispatchConfigs = {}; + /** + * Mapping from registration name to plugin module + */ + + var registrationNameModules = {}; + /** + * Mapping from registration name to event name + */ + + var registrationNameDependencies = {}; + + /** + * Injects an ordering of plugins (by plugin name). This allows the ordering + * to be decoupled from injection of the actual plugins so that ordering is + * always deterministic regardless of packaging, on-the-fly injection, etc. + * + * @param {array} InjectedEventPluginOrder + * @internal + */ + + function injectEventPluginOrder(injectedEventPluginOrder) { + if (eventPluginOrder) { + throw new Error("EventPluginRegistry: Cannot inject event plugin ordering more than " + "once. You are likely trying to load more than one copy of React."); + } // Clone the ordering so it cannot be dynamically mutated. + + eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); + recomputePluginOrdering(); + } + /** + * Injects plugins to be used by plugin event system. The plugin names must be + * in the ordering injected by `injectEventPluginOrder`. + * + * Plugins can be injected as part of page initialization or on-the-fly. + * + * @param {object} injectedNamesToPlugins Map from names to plugin modules. + * @internal + */ + + function injectEventPluginsByName(injectedNamesToPlugins) { + var isOrderingDirty = false; + for (var pluginName in injectedNamesToPlugins) { + if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { + continue; + } + var pluginModule = injectedNamesToPlugins[pluginName]; + if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { + if (namesToPlugins[pluginName]) { + throw new Error("EventPluginRegistry: Cannot inject two different event plugins " + ("using the same name, `" + pluginName + "`.")); + } + namesToPlugins[pluginName] = pluginModule; + isOrderingDirty = true; + } + } + if (isOrderingDirty) { + recomputePluginOrdering(); + } + } + + /** + * Get a list of listeners for a specific event, in-order. + * For React Native we treat the props-based function handlers + * as the first-class citizens, and they are always executed first + * for both capture and bubbling phase. + * + * We need "phase" propagated to this point to support the HostComponent + * EventEmitter API, which does not mutate the name of the handler based + * on phase (whereas prop handlers are registered as `onMyEvent` and `onMyEvent_Capture`). + * + * Native system events emitted into React Native + * will be emitted both to the prop handler function and to imperative event + * listeners. + * + * This will either return null, a single Function without an array, or + * an array of 2+ items. + */ + + function getListeners(inst, registrationName, phase, dispatchToImperativeListeners) { + var stateNode = inst.stateNode; + if (stateNode === null) { + return null; + } // If null: Work in progress (ex: onload events in incremental mode). + + var props = getFiberCurrentPropsFromNode(stateNode); + if (props === null) { + // Work in progress. + return null; + } + var listener = props[registrationName]; + if (listener && typeof listener !== "function") { + throw new Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type."); + } // If there are no imperative listeners, early exit. + + if (!(dispatchToImperativeListeners && stateNode.canonical && stateNode.canonical._eventListeners)) { + return listener; + } // Below this is the de-optimized path. + // If you are using _eventListeners, we do not (yet) + // expect this to be as performant as the props-only path. + // If/when this becomes a bottleneck, it can be refactored + // to avoid unnecessary closures and array allocations. + // + // Previously, there was only one possible listener for an event: + // the onEventName property in props. + // Now, it is also possible to have N listeners + // for a specific event on a node. Thus, we accumulate all of the listeners, + // including the props listener, and return a function that calls them all in + // order, starting with the handler prop and then the listeners in order. + // We return either a non-empty array or null. + + var listeners = []; + if (listener) { + listeners.push(listener); + } // TODO: for now, all of these events get an `rn:` prefix to enforce + // that the user knows they're only getting non-W3C-compliant events + // through this imperative event API. + // Events might not necessarily be noncompliant, but we currently have + // no verification that /any/ events are compliant. + // Thus, we prefix to ensure no collision with W3C event names. + + var requestedPhaseIsCapture = phase === "captured"; + var mangledImperativeRegistrationName = requestedPhaseIsCapture ? "rn:" + registrationName.replace(/Capture$/, "") : "rn:" + registrationName; // Get imperative event listeners for this event + + if (stateNode.canonical._eventListeners[mangledImperativeRegistrationName] && stateNode.canonical._eventListeners[mangledImperativeRegistrationName].length > 0) { + var eventListeners = stateNode.canonical._eventListeners[mangledImperativeRegistrationName]; + eventListeners.forEach(function (listenerObj) { + // Make sure phase of listener matches requested phase + var isCaptureEvent = listenerObj.options.capture != null && listenerObj.options.capture; + if (isCaptureEvent !== requestedPhaseIsCapture) { + return; + } // For now (this is an area of future optimization) we must wrap + // all imperative event listeners in a function to unwrap the SyntheticEvent + // and pass them an Event. + // When this API is more stable and used more frequently, we can revisit. + + var listenerFnWrapper = function listenerFnWrapper(syntheticEvent) { + var eventInst = new ReactNativePrivateInterface.CustomEvent(mangledImperativeRegistrationName, { + detail: syntheticEvent.nativeEvent + }); + eventInst.isTrusted = true; // setSyntheticEvent is present on the React Native Event shim. + // It is used to forward method calls on Event to the underlying SyntheticEvent. + // $FlowFixMe + + eventInst.setSyntheticEvent(syntheticEvent); + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + listenerObj.listener.apply(listenerObj, [eventInst].concat(args)); + }; // Only call once? + // If so, we ensure that it's only called once by setting a flag + // and by removing it from eventListeners once it is called (but only + // when it's actually been executed). + + if (listenerObj.options.once) { + listeners.push(function () { + // Remove from the event listener once it's been called + stateNode.canonical.removeEventListener_unstable(mangledImperativeRegistrationName, listenerObj.listener, listenerObj.capture); // Guard against function being called more than once in + // case there are somehow multiple in-flight references to + // it being processed + + if (!listenerObj.invalidated) { + listenerObj.invalidated = true; + listenerObj.listener.apply(listenerObj, arguments); + } + }); + } else { + listeners.push(listenerFnWrapper); + } + }); + } + if (listeners.length === 0) { + return null; + } + if (listeners.length === 1) { + return listeners[0]; + } + return listeners; + } + var customBubblingEventTypes = ReactNativePrivateInterface.ReactNativeViewConfigRegistry.customBubblingEventTypes, + customDirectEventTypes = ReactNativePrivateInterface.ReactNativeViewConfigRegistry.customDirectEventTypes; // Start of inline: the below functions were inlined from + // EventPropagator.js, as they deviated from ReactDOM's newer + // implementations. + + function listenersAtPhase(inst, event, propagationPhase) { + var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; + return getListeners(inst, registrationName, propagationPhase, true); + } + function accumulateListenersAndInstances(inst, event, listeners) { + var listenersLength = listeners ? isArray(listeners) ? listeners.length : 1 : 0; + if (listenersLength > 0) { + event._dispatchListeners = accumulateInto(event._dispatchListeners, listeners); // Avoid allocating additional arrays here + + if (event._dispatchInstances == null && listenersLength === 1) { + event._dispatchInstances = inst; + } else { + event._dispatchInstances = event._dispatchInstances || []; + if (!isArray(event._dispatchInstances)) { + event._dispatchInstances = [event._dispatchInstances]; + } + for (var i = 0; i < listenersLength; i++) { + event._dispatchInstances.push(inst); + } + } + } + } + function accumulateDirectionalDispatches$1(inst, phase, event) { + { + if (!inst) { + error("Dispatching inst must not be null"); + } + } + var listeners = listenersAtPhase(inst, event, phase); + accumulateListenersAndInstances(inst, event, listeners); + } + function getParent$1(inst) { + do { + inst = inst.return; // TODO: If this is a HostRoot we might want to bail out. + // That is depending on if we want nested subtrees (layers) to bubble + // events to their parent. We could also go through parentNode on the + // host node but that wouldn't work for React Native and doesn't let us + // do the portal feature. + } while (inst && inst.tag !== HostComponent); + if (inst) { + return inst; + } + return null; + } + /** + * Simulates the traversal of a two-phase, capture/bubble event dispatch. + */ + + function traverseTwoPhase$1(inst, fn, arg, skipBubbling) { + var path = []; + while (inst) { + path.push(inst); + inst = getParent$1(inst); + } + var i; + for (i = path.length; i-- > 0;) { + fn(path[i], "captured", arg); + } + if (skipBubbling) { + // Dispatch on target only + fn(path[0], "bubbled", arg); + } else { + for (i = 0; i < path.length; i++) { + fn(path[i], "bubbled", arg); + } + } + } + function accumulateTwoPhaseDispatchesSingle$1(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + traverseTwoPhase$1(event._targetInst, accumulateDirectionalDispatches$1, event, false); + } + } + function accumulateTwoPhaseDispatches$1(events) { + forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle$1); + } + function accumulateCapturePhaseDispatches(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + traverseTwoPhase$1(event._targetInst, accumulateDirectionalDispatches$1, event, true); + } + } + /** + * Accumulates without regard to direction, does not look for phased + * registration names. Same as `accumulateDirectDispatchesSingle` but without + * requiring that the `dispatchMarker` be the same as the dispatched ID. + */ + + function accumulateDispatches$1(inst, ignoredDirection, event) { + if (inst && event && event.dispatchConfig.registrationName) { + var registrationName = event.dispatchConfig.registrationName; + var listeners = getListeners(inst, registrationName, "bubbled", false); + accumulateListenersAndInstances(inst, event, listeners); + } + } + /** + * Accumulates dispatches on an `SyntheticEvent`, but only for the + * `dispatchMarker`. + * @param {SyntheticEvent} event + */ + + function accumulateDirectDispatchesSingle$1(event) { + if (event && event.dispatchConfig.registrationName) { + accumulateDispatches$1(event._targetInst, null, event); + } + } + function accumulateDirectDispatches$1(events) { + forEachAccumulated(events, accumulateDirectDispatchesSingle$1); + } // End of inline + + var ReactNativeBridgeEventPlugin = { + eventTypes: {}, + extractEvents: function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + if (targetInst == null) { + // Probably a node belonging to another renderer's tree. + return null; + } + var bubbleDispatchConfig = customBubblingEventTypes[topLevelType]; + var directDispatchConfig = customDirectEventTypes[topLevelType]; + if (!bubbleDispatchConfig && !directDispatchConfig) { + throw new Error( + // $FlowFixMe - Flow doesn't like this string coercion because DOMTopLevelEventType is opaque + 'Unsupported top level event type "' + topLevelType + '" dispatched'); + } + var event = SyntheticEvent.getPooled(bubbleDispatchConfig || directDispatchConfig, targetInst, nativeEvent, nativeEventTarget); + if (bubbleDispatchConfig) { + var skipBubbling = event != null && event.dispatchConfig.phasedRegistrationNames != null && event.dispatchConfig.phasedRegistrationNames.skipBubbling; + if (skipBubbling) { + accumulateCapturePhaseDispatches(event); + } else { + accumulateTwoPhaseDispatches$1(event); + } + } else if (directDispatchConfig) { + accumulateDirectDispatches$1(event); + } else { + return null; + } + return event; + } + }; + var ReactNativeEventPluginOrder = ["ResponderEventPlugin", "ReactNativeBridgeEventPlugin"]; + + /** + * Make sure essential globals are available and are patched correctly. Please don't remove this + * line. Bundles created by react-packager `require` it before executing any application code. This + * ensures it exists in the dependency graph and can be `require`d. + * TODO: require this in packager, not in React #10932517 + */ + /** + * Inject module for resolving DOM hierarchy and plugin ordering. + */ + + injectEventPluginOrder(ReactNativeEventPluginOrder); + /** + * Some important event plugins included by default (without having to require + * them). + */ + + injectEventPluginsByName({ + ResponderEventPlugin: ResponderEventPlugin, + ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin + }); + var instanceCache = new Map(); + var instanceProps = new Map(); + function precacheFiberNode(hostInst, tag) { + instanceCache.set(tag, hostInst); + } + function uncacheFiberNode(tag) { + instanceCache.delete(tag); + instanceProps.delete(tag); + } + function getInstanceFromTag(tag) { + return instanceCache.get(tag) || null; + } + function getTagFromInstance(inst) { + var nativeInstance = inst.stateNode; + var tag = nativeInstance._nativeTag; + if (tag === undefined) { + nativeInstance = nativeInstance.canonical; + tag = nativeInstance._nativeTag; + } + if (!tag) { + throw new Error("All native instances should have a tag."); + } + return nativeInstance; + } + function getFiberCurrentPropsFromNode$1(stateNode) { + return instanceProps.get(stateNode._nativeTag) || null; + } + function updateFiberProps(tag, props) { + instanceProps.set(tag, props); + } + + // Used as a way to call batchedUpdates when we don't have a reference to + // the renderer. Such as when we're dispatching events or if third party + // libraries need to call batchedUpdates. Eventually, this API will go away when + // everything is batched by default. We'll then have a similar API to opt-out of + // scheduled work and instead do synchronous work. + // Defaults + var batchedUpdatesImpl = function batchedUpdatesImpl(fn, bookkeeping) { + return fn(bookkeeping); + }; + var isInsideEventHandler = false; + function batchedUpdates(fn, bookkeeping) { + if (isInsideEventHandler) { + // If we are currently inside another batch, we need to wait until it + // fully completes before restoring state. + return fn(bookkeeping); + } + isInsideEventHandler = true; + try { + return batchedUpdatesImpl(fn, bookkeeping); + } finally { + isInsideEventHandler = false; + } + } + function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl) { + batchedUpdatesImpl = _batchedUpdatesImpl; + } + + /** + * Internal queue of events that have accumulated their dispatches and are + * waiting to have their dispatches executed. + */ + + var eventQueue = null; + /** + * Dispatches an event and releases it back into the pool, unless persistent. + * + * @param {?object} event Synthetic event to be dispatched. + * @private + */ + + var executeDispatchesAndRelease = function executeDispatchesAndRelease(event) { + if (event) { + executeDispatchesInOrder(event); + if (!event.isPersistent()) { + event.constructor.release(event); + } + } + }; + var executeDispatchesAndReleaseTopLevel = function executeDispatchesAndReleaseTopLevel(e) { + return executeDispatchesAndRelease(e); + }; + function runEventsInBatch(events) { + if (events !== null) { + eventQueue = accumulateInto(eventQueue, events); + } // Set `eventQueue` to null before processing it so that we can tell if more + // events get enqueued while processing. + + var processingEventQueue = eventQueue; + eventQueue = null; + if (!processingEventQueue) { + return; + } + forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); + if (eventQueue) { + throw new Error("processEventQueue(): Additional events were enqueued while processing " + "an event queue. Support for this has not yet been implemented."); + } // This would be a good time to rethrow if any of the event handlers threw. + + rethrowCaughtError(); + } + + /** + * Version of `ReactBrowserEventEmitter` that works on the receiving side of a + * serialized worker boundary. + */ + // Shared default empty native event - conserve memory. + + var EMPTY_NATIVE_EVENT = {}; + /** + * Selects a subsequence of `Touch`es, without destroying `touches`. + * + * @param {Array} touches Deserialized touch objects. + * @param {Array} indices Indices by which to pull subsequence. + * @return {Array} Subsequence of touch objects. + */ + + var touchSubsequence = function touchSubsequence(touches, indices) { + var ret = []; + for (var i = 0; i < indices.length; i++) { + ret.push(touches[indices[i]]); + } + return ret; + }; + /** + * TODO: Pool all of this. + * + * Destroys `touches` by removing touch objects at indices `indices`. This is + * to maintain compatibility with W3C touch "end" events, where the active + * touches don't include the set that has just been "ended". + * + * @param {Array} touches Deserialized touch objects. + * @param {Array} indices Indices to remove from `touches`. + * @return {Array} Subsequence of removed touch objects. + */ + + var removeTouchesAtIndices = function removeTouchesAtIndices(touches, indices) { + var rippedOut = []; // use an unsafe downcast to alias to nullable elements, + // so we can delete and then compact. + + var temp = touches; + for (var i = 0; i < indices.length; i++) { + var index = indices[i]; + rippedOut.push(touches[index]); + temp[index] = null; + } + var fillAt = 0; + for (var j = 0; j < temp.length; j++) { + var cur = temp[j]; + if (cur !== null) { + temp[fillAt++] = cur; + } + } + temp.length = fillAt; + return rippedOut; + }; + /** + * Internal version of `receiveEvent` in terms of normalized (non-tag) + * `rootNodeID`. + * + * @see receiveEvent. + * + * @param {rootNodeID} rootNodeID React root node ID that event occurred on. + * @param {TopLevelType} topLevelType Top level type of event. + * @param {?object} nativeEventParam Object passed from native. + */ + + function _receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam) { + var nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT; + var inst = getInstanceFromTag(rootNodeID); + var target = null; + if (inst != null) { + target = inst.stateNode; + } + batchedUpdates(function () { + runExtractedPluginEventsInBatch(topLevelType, inst, nativeEvent, target); + }); // React Native doesn't use ReactControlledComponent but if it did, here's + // where it would do it. + } + /** + * Allows registered plugins an opportunity to extract events from top-level + * native browser events. + * + * @return {*} An accumulation of synthetic events. + * @internal + */ + + function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var events = null; + var legacyPlugins = plugins; + for (var i = 0; i < legacyPlugins.length; i++) { + // Not every plugin in the ordering may be loaded at runtime. + var possiblePlugin = legacyPlugins[i]; + if (possiblePlugin) { + var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + if (extractedEvents) { + events = accumulateInto(events, extractedEvents); + } + } + } + return events; + } + function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + runEventsInBatch(events); + } + /** + * Publicly exposed method on module for native objc to invoke when a top + * level event is extracted. + * @param {rootNodeID} rootNodeID React root node ID that event occurred on. + * @param {TopLevelType} topLevelType Top level type of event. + * @param {object} nativeEventParam Object passed from native. + */ + + function receiveEvent(rootNodeID, topLevelType, nativeEventParam) { + _receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam); + } + /** + * Simple multi-wrapper around `receiveEvent` that is intended to receive an + * efficient representation of `Touch` objects, and other information that + * can be used to construct W3C compliant `Event` and `Touch` lists. + * + * This may create dispatch behavior that differs than web touch handling. We + * loop through each of the changed touches and receive it as a single event. + * So two `touchStart`/`touchMove`s that occur simultaneously are received as + * two separate touch event dispatches - when they arguably should be one. + * + * This implementation reuses the `Touch` objects themselves as the `Event`s + * since we dispatch an event for each touch (though that might not be spec + * compliant). The main purpose of reusing them is to save allocations. + * + * TODO: Dispatch multiple changed touches in one event. The bubble path + * could be the first common ancestor of all the `changedTouches`. + * + * One difference between this behavior and W3C spec: cancelled touches will + * not appear in `.touches`, or in any future `.touches`, though they may + * still be "actively touching the surface". + * + * Web desktop polyfills only need to construct a fake touch event with + * identifier 0, also abandoning traditional click handlers. + */ + + function receiveTouches(eventTopLevelType, touches, changedIndices) { + var changedTouches = eventTopLevelType === "topTouchEnd" || eventTopLevelType === "topTouchCancel" ? removeTouchesAtIndices(touches, changedIndices) : touchSubsequence(touches, changedIndices); + for (var jj = 0; jj < changedTouches.length; jj++) { + var touch = changedTouches[jj]; // Touch objects can fulfill the role of `DOM` `Event` objects if we set + // the `changedTouches`/`touches`. This saves allocations. + + touch.changedTouches = changedTouches; + touch.touches = touches; + var nativeEvent = touch; + var rootNodeID = null; + var target = nativeEvent.target; + if (target !== null && target !== undefined) { + if (target < 1) { + { + error("A view is reporting that a touch occurred on tag zero."); + } + } else { + rootNodeID = target; + } + } // $FlowFixMe Shouldn't we *not* call it if rootNodeID is null? + + _receiveRootNodeIDEvent(rootNodeID, eventTopLevelType, nativeEvent); + } + } + + // Module provided by RN: + var ReactNativeGlobalResponderHandler = { + onChange: function onChange(from, to, blockNativeResponder) { + if (to !== null) { + var tag = to.stateNode._nativeTag; + ReactNativePrivateInterface.UIManager.setJSResponder(tag, blockNativeResponder); + } else { + ReactNativePrivateInterface.UIManager.clearJSResponder(); + } + } + }; + + /** + * Register the event emitter with the native bridge + */ + + ReactNativePrivateInterface.RCTEventEmitter.register({ + receiveEvent: receiveEvent, + receiveTouches: receiveTouches + }); + setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromTag, getTagFromInstance); + ResponderEventPlugin.injection.injectGlobalResponderHandler(ReactNativeGlobalResponderHandler); + + /** + * `ReactInstanceMap` maintains a mapping from a public facing stateful + * instance (key) and the internal representation (value). This allows public + * methods to accept the user facing instance as an argument and map them back + * to internal methods. + * + * Note that this module is currently shared and assumed to be stateless. + * If this becomes an actual Map, that will break. + */ + function get(key) { + return key._reactInternals; + } + function set(key, value) { + key._reactInternals = value; + } + var enableSchedulingProfiler = false; + var enableProfilerTimer = true; + var enableProfilerCommitHooks = true; + var warnAboutStringRefs = false; + var enableSuspenseAvoidThisFallback = false; + var enableNewReconciler = false; + var enableLazyContextPropagation = false; + var enableLegacyHidden = false; + + // ATTENTION + // When adding new symbols to this file, + // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' + // The Symbol used to tag the ReactElement-like types. + var REACT_ELEMENT_TYPE = Symbol.for("react.element"); + var REACT_PORTAL_TYPE = Symbol.for("react.portal"); + var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); + var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); + var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); + var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); + var REACT_CONTEXT_TYPE = Symbol.for("react.context"); + var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); + var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); + var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); + var REACT_MEMO_TYPE = Symbol.for("react.memo"); + var REACT_LAZY_TYPE = Symbol.for("react.lazy"); + var REACT_SCOPE_TYPE = Symbol.for("react.scope"); + var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); + var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); + var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); + var REACT_CACHE_TYPE = Symbol.for("react.cache"); + var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); + var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = "@@iterator"; + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== "object") { + return null; + } + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + if (typeof maybeIterator === "function") { + return maybeIterator; + } + return null; + } + function getWrappedName(outerType, innerType, wrapperName) { + var displayName = outerType.displayName; + if (displayName) { + return displayName; + } + var functionName = innerType.displayName || innerType.name || ""; + return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; + } // Keep in sync with react-reconciler/getComponentNameFromFiber + + function getContextName(type) { + return type.displayName || "Context"; + } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. + + function getComponentNameFromType(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + { + if (typeof type.tag === "number") { + error("Received an unexpected object in getComponentNameFromType(). " + "This is likely a bug in React. Please file an issue."); + } + } + if (typeof type === "function") { + return type.displayName || type.name || null; + } + if (typeof type === "string") { + 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"; + } + if (typeof type === "object") { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + var context = type; + return getContextName(context) + ".Consumer"; + case REACT_PROVIDER_TYPE: + var provider = type; + return getContextName(provider._context) + ".Provider"; + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, "ForwardRef"); + case REACT_MEMO_TYPE: + var outerName = type.displayName || null; + if (outerName !== null) { + return outerName; + } + return getComponentNameFromType(type.type) || "Memo"; + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + return getComponentNameFromType(init(payload)); + } catch (x) { + return null; + } + } + + // eslint-disable-next-line no-fallthrough + } + } + return null; + } + function getWrappedName$1(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ""; + return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName); + } // Keep in sync with shared/getComponentNameFromType + + function getContextName$1(type) { + return type.displayName || "Context"; + } + function getComponentNameFromFiber(fiber) { + var tag = fiber.tag, + type = fiber.type; + switch (tag) { + case CacheComponent: + return "Cache"; + case ContextConsumer: + var context = type; + return getContextName$1(context) + ".Consumer"; + case ContextProvider: + var provider = type; + return getContextName$1(provider._context) + ".Provider"; + case DehydratedFragment: + return "DehydratedFragment"; + case ForwardRef: + return getWrappedName$1(type, type.render, "ForwardRef"); + case Fragment: + return "Fragment"; + case HostComponent: + // Host component type is the display name (e.g. "div", "View") + return type; + case HostPortal: + return "Portal"; + case HostRoot: + return "Root"; + case HostText: + return "Text"; + case LazyComponent: + // Name comes from the type in this case; we don't have a tag. + return getComponentNameFromType(type); + case Mode: + if (type === REACT_STRICT_MODE_TYPE) { + // Don't be less specific than shared/getComponentNameFromType + return "StrictMode"; + } + return "Mode"; + case OffscreenComponent: + return "Offscreen"; + case Profiler: + return "Profiler"; + case ScopeComponent: + return "Scope"; + case SuspenseComponent: + return "Suspense"; + case SuspenseListComponent: + return "SuspenseList"; + case TracingMarkerComponent: + return "TracingMarker"; + // The display name for this tags come from the user-provided type: + + case ClassComponent: + case FunctionComponent: + case IncompleteClassComponent: + case IndeterminateComponent: + case MemoComponent: + case SimpleMemoComponent: + if (typeof type === "function") { + return type.displayName || type.name || null; + } + if (typeof type === "string") { + return type; + } + break; + } + return null; + } + + // Don't change these two values. They're used by React Dev Tools. + var NoFlags = /* */ + 0; + var PerformedWork = /* */ + 1; // You can change the rest (and add more). + + var Placement = /* */ + 2; + var Update = /* */ + 4; + var ChildDeletion = /* */ + 16; + var ContentReset = /* */ + 32; + var Callback = /* */ + 64; + var DidCapture = /* */ + 128; + var ForceClientRender = /* */ + 256; + var Ref = /* */ + 512; + var Snapshot = /* */ + 1024; + var Passive = /* */ + 2048; + var Hydrating = /* */ + 4096; + var Visibility = /* */ + 8192; + var StoreConsistency = /* */ + 16384; + var LifecycleEffectMask = Passive | Update | Callback | Ref | Snapshot | StoreConsistency; // Union of all commit flags (flags with the lifetime of a particular commit) + + var HostEffectMask = /* */ + 32767; // These are not really side effects, but we still reuse this field. + + var Incomplete = /* */ + 32768; + var ShouldCapture = /* */ + 65536; + var ForceUpdateForLegacySuspense = /* */ + 131072; + var Forked = /* */ + 1048576; // Static tags describe aspects of a fiber that are not specific to a render, + // e.g. a fiber uses a passive effect (even if there are no updates on this particular render). + // This enables us to defer more work in the unmount case, + // since we can defer traversing the tree during layout to look for Passive effects, + // and instead rely on the static flag as a signal that there may be cleanup work. + + var RefStatic = /* */ + 2097152; + var LayoutStatic = /* */ + 4194304; + var PassiveStatic = /* */ + 8388608; // These flags allow us to traverse to fibers that have effects on mount + // don't contain effects, by checking subtreeFlags. + + var BeforeMutationMask = + // TODO: Remove Update flag from before mutation phase by re-landing Visibility + // flag logic (see #20043) + Update | Snapshot | 0; + var MutationMask = Placement | Update | ChildDeletion | ContentReset | Ref | Hydrating | Visibility; + var LayoutMask = Update | Callback | Ref | Visibility; // TODO: Split into PassiveMountMask and PassiveUnmountMask + + var PassiveMask = Passive | ChildDeletion; // Union of tags that don't get reset on clones. + // This allows certain concepts to persist without recalculating them, + // e.g. whether a subtree contains passive effects or portals. + + var StaticMask = LayoutStatic | PassiveStatic | RefStatic; + var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; + function getNearestMountedFiber(fiber) { + var node = fiber; + var nearestMounted = fiber; + if (!fiber.alternate) { + // If there is no alternate, this might be a new tree that isn't inserted + // yet. If it is, then it will have a pending insertion effect on it. + var nextNode = node; + do { + node = nextNode; + if ((node.flags & (Placement | Hydrating)) !== NoFlags) { + // This is an insertion or in-progress hydration. The nearest possible + // mounted fiber is the parent but we need to continue to figure out + // if that one is still mounted. + nearestMounted = node.return; + } + nextNode = node.return; + } while (nextNode); + } else { + while (node.return) { + node = node.return; + } + } + if (node.tag === HostRoot) { + // TODO: Check if this was a nested HostRoot when used with + // renderContainerIntoSubtree. + return nearestMounted; + } // If we didn't hit the root, that means that we're in an disconnected tree + // that has been unmounted. + + return null; + } + function isFiberMounted(fiber) { + return getNearestMountedFiber(fiber) === fiber; + } + function isMounted(component) { + { + var owner = ReactCurrentOwner.current; + if (owner !== null && owner.tag === ClassComponent) { + var ownerFiber = owner; + var instance = ownerFiber.stateNode; + if (!instance._warnedAboutRefsInRender) { + error("%s is accessing isMounted inside its render() function. " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", getComponentNameFromFiber(ownerFiber) || "A component"); + } + instance._warnedAboutRefsInRender = true; + } + } + var fiber = get(component); + if (!fiber) { + return false; + } + return getNearestMountedFiber(fiber) === fiber; + } + function assertIsMounted(fiber) { + if (getNearestMountedFiber(fiber) !== fiber) { + throw new Error("Unable to find node on an unmounted component."); + } + } + function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + if (!alternate) { + // If there is no alternate, then we only need to check if it is mounted. + var nearestMounted = getNearestMountedFiber(fiber); + if (nearestMounted === null) { + throw new Error("Unable to find node on an unmounted component."); + } + if (nearestMounted !== fiber) { + return null; + } + return fiber; + } // If we have two possible branches, we'll walk backwards up to the root + // to see what path the root points to. On the way we may hit one of the + // special cases and we'll deal with them. + + var a = fiber; + var b = alternate; + while (true) { + var parentA = a.return; + if (parentA === null) { + // We're at the root. + break; + } + var parentB = parentA.alternate; + if (parentB === null) { + // There is no alternate. This is an unusual case. Currently, it only + // happens when a Suspense component is hidden. An extra fragment fiber + // is inserted in between the Suspense fiber and its children. Skip + // over this extra fragment fiber and proceed to the next parent. + var nextParent = parentA.return; + if (nextParent !== null) { + a = b = nextParent; + continue; + } // If there's no parent, we're at the root. + + break; + } // If both copies of the parent fiber point to the same child, we can + // assume that the child is current. This happens when we bailout on low + // priority: the bailed out fiber's child reuses the current child. + + if (parentA.child === parentB.child) { + var child = parentA.child; + while (child) { + if (child === a) { + // We've determined that A is the current branch. + assertIsMounted(parentA); + return fiber; + } + if (child === b) { + // We've determined that B is the current branch. + assertIsMounted(parentA); + return alternate; + } + child = child.sibling; + } // We should never have an alternate for any mounting node. So the only + // way this could possibly happen is if this was unmounted, if at all. + + throw new Error("Unable to find node on an unmounted component."); + } + if (a.return !== b.return) { + // The return pointer of A and the return pointer of B point to different + // fibers. We assume that return pointers never criss-cross, so A must + // belong to the child set of A.return, and B must belong to the child + // set of B.return. + a = parentA; + b = parentB; + } else { + // The return pointers point to the same fiber. We'll have to use the + // default, slow path: scan the child sets of each parent alternate to see + // which child belongs to which set. + // + // Search parent A's child set + var didFindChild = false; + var _child = parentA.child; + while (_child) { + if (_child === a) { + didFindChild = true; + a = parentA; + b = parentB; + break; + } + if (_child === b) { + didFindChild = true; + b = parentA; + a = parentB; + break; + } + _child = _child.sibling; + } + if (!didFindChild) { + // Search parent B's child set + _child = parentB.child; + while (_child) { + if (_child === a) { + didFindChild = true; + a = parentB; + b = parentA; + break; + } + if (_child === b) { + didFindChild = true; + b = parentB; + a = parentA; + break; + } + _child = _child.sibling; + } + if (!didFindChild) { + throw new 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 new Error("Return fibers should always be each others' alternates. " + "This error is likely caused by a bug in React. Please file an issue."); + } + } // If the root is not a host container, we're in a disconnected tree. I.e. + // unmounted. + + if (a.tag !== HostRoot) { + throw new Error("Unable to find node on an unmounted component."); + } + if (a.stateNode.current === a) { + // We've determined that A is the current branch. + return fiber; + } // Otherwise B has to be current branch. + + return alternate; + } + function findCurrentHostFiber(parent) { + var currentParent = findCurrentFiberUsingSlowPath(parent); + return currentParent !== null ? findCurrentHostFiberImpl(currentParent) : null; + } + function findCurrentHostFiberImpl(node) { + // Next we'll drill down this component to find the first HostComponent/Text. + if (node.tag === HostComponent || node.tag === HostText) { + return node; + } + var child = node.child; + while (child !== null) { + var match = findCurrentHostFiberImpl(child); + if (match !== null) { + return match; + } + child = child.sibling; + } + return null; + } + + // Modules provided by RN: + var emptyObject = {}; + /** + * Create a payload that contains all the updates between two sets of props. + * + * These helpers are all encapsulated into a single module, because they use + * mutation as a performance optimization which leads to subtle shared + * dependencies between the code paths. To avoid this mutable state leaking + * across modules, I've kept them isolated to this module. + */ + + // Tracks removed keys + var removedKeys = null; + var removedKeyCount = 0; + var deepDifferOptions = { + unsafelyIgnoreFunctions: true + }; + function defaultDiffer(prevProp, nextProp) { + if (typeof nextProp !== "object" || nextProp === null) { + // Scalars have already been checked for equality + return true; + } else { + // For objects and arrays, the default diffing algorithm is a deep compare + return ReactNativePrivateInterface.deepDiffer(prevProp, nextProp, deepDifferOptions); + } + } + function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) { + if (isArray(node)) { + var i = node.length; + while (i-- && removedKeyCount > 0) { + restoreDeletedValuesInNestedArray(updatePayload, node[i], validAttributes); + } + } else if (node && removedKeyCount > 0) { + var obj = node; + for (var propKey in removedKeys) { + if (!removedKeys[propKey]) { + continue; + } + var nextProp = obj[propKey]; + if (nextProp === undefined) { + continue; + } + var attributeConfig = validAttributes[propKey]; + if (!attributeConfig) { + continue; // not a valid native prop + } + if (typeof nextProp === "function") { + nextProp = true; + } + if (typeof nextProp === "undefined") { + nextProp = null; + } + if (typeof attributeConfig !== "object") { + // case: !Object is the default case + updatePayload[propKey] = nextProp; + } else if (typeof attributeConfig.diff === "function" || typeof attributeConfig.process === "function") { + // case: CustomAttributeConfiguration + var nextValue = typeof attributeConfig.process === "function" ? attributeConfig.process(nextProp) : nextProp; + updatePayload[propKey] = nextValue; + } + removedKeys[propKey] = false; + removedKeyCount--; + } + } + } + function diffNestedArrayProperty(updatePayload, prevArray, nextArray, validAttributes) { + var minLength = prevArray.length < nextArray.length ? prevArray.length : nextArray.length; + var i; + for (i = 0; i < minLength; i++) { + // Diff any items in the array in the forward direction. Repeated keys + // will be overwritten by later values. + updatePayload = diffNestedProperty(updatePayload, prevArray[i], nextArray[i], validAttributes); + } + for (; i < prevArray.length; i++) { + // Clear out all remaining properties. + updatePayload = clearNestedProperty(updatePayload, prevArray[i], validAttributes); + } + for (; i < nextArray.length; i++) { + // Add all remaining properties. + updatePayload = addNestedProperty(updatePayload, nextArray[i], validAttributes); + } + return updatePayload; + } + function diffNestedProperty(updatePayload, prevProp, nextProp, validAttributes) { + if (!updatePayload && prevProp === nextProp) { + // If no properties have been added, then we can bail out quickly on object + // equality. + return updatePayload; + } + if (!prevProp || !nextProp) { + if (nextProp) { + return addNestedProperty(updatePayload, nextProp, validAttributes); + } + if (prevProp) { + return clearNestedProperty(updatePayload, prevProp, validAttributes); + } + return updatePayload; + } + if (!isArray(prevProp) && !isArray(nextProp)) { + // Both are leaves, we can diff the leaves. + return diffProperties(updatePayload, prevProp, nextProp, validAttributes); + } + if (isArray(prevProp) && isArray(nextProp)) { + // Both are arrays, we can diff the arrays. + return diffNestedArrayProperty(updatePayload, prevProp, nextProp, validAttributes); + } + if (isArray(prevProp)) { + return diffProperties(updatePayload, + // $FlowFixMe - We know that this is always an object when the input is. + ReactNativePrivateInterface.flattenStyle(prevProp), + // $FlowFixMe - We know that this isn't an array because of above flow. + nextProp, validAttributes); + } + return diffProperties(updatePayload, prevProp, + // $FlowFixMe - We know that this is always an object when the input is. + ReactNativePrivateInterface.flattenStyle(nextProp), validAttributes); + } + /** + * addNestedProperty takes a single set of props and valid attribute + * attribute configurations. It processes each prop and adds it to the + * updatePayload. + */ + + function addNestedProperty(updatePayload, nextProp, validAttributes) { + if (!nextProp) { + return updatePayload; + } + if (!isArray(nextProp)) { + // Add each property of the leaf. + return addProperties(updatePayload, nextProp, validAttributes); + } + for (var i = 0; i < nextProp.length; i++) { + // Add all the properties of the array. + updatePayload = addNestedProperty(updatePayload, nextProp[i], validAttributes); + } + return updatePayload; + } + /** + * clearNestedProperty takes a single set of props and valid attributes. It + * adds a null sentinel to the updatePayload, for each prop key. + */ + + function clearNestedProperty(updatePayload, prevProp, validAttributes) { + if (!prevProp) { + return updatePayload; + } + if (!isArray(prevProp)) { + // Add each property of the leaf. + return clearProperties(updatePayload, prevProp, validAttributes); + } + for (var i = 0; i < prevProp.length; i++) { + // Add all the properties of the array. + updatePayload = clearNestedProperty(updatePayload, prevProp[i], validAttributes); + } + return updatePayload; + } + /** + * diffProperties takes two sets of props and a set of valid attributes + * and write to updatePayload the values that changed or were deleted. + * If no updatePayload is provided, a new one is created and returned if + * anything changed. + */ + + function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { + var attributeConfig; + var nextProp; + var prevProp; + for (var propKey in nextProps) { + attributeConfig = validAttributes[propKey]; + if (!attributeConfig) { + continue; // not a valid native prop + } + prevProp = prevProps[propKey]; + nextProp = nextProps[propKey]; // functions are converted to booleans as markers that the associated + // events should be sent from native. + + if (typeof nextProp === "function") { + nextProp = true; // If nextProp is not a function, then don't bother changing prevProp + // since nextProp will win and go into the updatePayload regardless. + + if (typeof prevProp === "function") { + prevProp = true; + } + } // An explicit value of undefined is treated as a null because it overrides + // any other preceding value. + + if (typeof nextProp === "undefined") { + nextProp = null; + if (typeof prevProp === "undefined") { + prevProp = null; + } + } + if (removedKeys) { + removedKeys[propKey] = false; + } + if (updatePayload && updatePayload[propKey] !== undefined) { + // Something else already triggered an update to this key because another + // value diffed. Since we're now later in the nested arrays our value is + // more important so we need to calculate it and override the existing + // value. It doesn't matter if nothing changed, we'll set it anyway. + // Pattern match on: attributeConfig + if (typeof attributeConfig !== "object") { + // case: !Object is the default case + updatePayload[propKey] = nextProp; + } else if (typeof attributeConfig.diff === "function" || typeof attributeConfig.process === "function") { + // case: CustomAttributeConfiguration + var nextValue = typeof attributeConfig.process === "function" ? attributeConfig.process(nextProp) : nextProp; + updatePayload[propKey] = nextValue; + } + continue; + } + if (prevProp === nextProp) { + continue; // nothing changed + } // Pattern match on: attributeConfig + + if (typeof attributeConfig !== "object") { + // case: !Object is the default case + if (defaultDiffer(prevProp, nextProp)) { + // a normal leaf has changed + (updatePayload || (updatePayload = {}))[propKey] = nextProp; + } + } else if (typeof attributeConfig.diff === "function" || typeof attributeConfig.process === "function") { + // case: CustomAttributeConfiguration + var shouldUpdate = prevProp === undefined || (typeof attributeConfig.diff === "function" ? attributeConfig.diff(prevProp, nextProp) : defaultDiffer(prevProp, nextProp)); + if (shouldUpdate) { + var _nextValue = typeof attributeConfig.process === "function" ? attributeConfig.process(nextProp) : nextProp; + (updatePayload || (updatePayload = {}))[propKey] = _nextValue; + } + } else { + // default: fallthrough case when nested properties are defined + removedKeys = null; + removedKeyCount = 0; // We think that attributeConfig is not CustomAttributeConfiguration at + // this point so we assume it must be AttributeConfiguration. + + updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig); + if (removedKeyCount > 0 && updatePayload) { + restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig); + removedKeys = null; + } + } + } // Also iterate through all the previous props to catch any that have been + // removed and make sure native gets the signal so it can reset them to the + // default. + + for (var _propKey in prevProps) { + if (nextProps[_propKey] !== undefined) { + continue; // we've already covered this key in the previous pass + } + attributeConfig = validAttributes[_propKey]; + if (!attributeConfig) { + continue; // not a valid native prop + } + if (updatePayload && updatePayload[_propKey] !== undefined) { + // This was already updated to a diff result earlier. + continue; + } + prevProp = prevProps[_propKey]; + if (prevProp === undefined) { + continue; // was already empty anyway + } // Pattern match on: attributeConfig + + if (typeof attributeConfig !== "object" || typeof attributeConfig.diff === "function" || typeof attributeConfig.process === "function") { + // case: CustomAttributeConfiguration | !Object + // Flag the leaf property for removal by sending a sentinel. + (updatePayload || (updatePayload = {}))[_propKey] = null; + if (!removedKeys) { + removedKeys = {}; + } + if (!removedKeys[_propKey]) { + removedKeys[_propKey] = true; + removedKeyCount++; + } + } else { + // default: + // This is a nested attribute configuration where all the properties + // were removed so we need to go through and clear out all of them. + updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig); + } + } + return updatePayload; + } + /** + * addProperties adds all the valid props to the payload after being processed. + */ + + function addProperties(updatePayload, props, validAttributes) { + // TODO: Fast path + return diffProperties(updatePayload, emptyObject, props, validAttributes); + } + /** + * clearProperties clears all the previous props by adding a null sentinel + * to the payload for each valid key. + */ + + function clearProperties(updatePayload, prevProps, validAttributes) { + // TODO: Fast path + return diffProperties(updatePayload, prevProps, emptyObject, validAttributes); + } + function create(props, validAttributes) { + return addProperties(null, + // updatePayload + props, validAttributes); + } + function diff(prevProps, nextProps, validAttributes) { + return diffProperties(null, + // updatePayload + prevProps, nextProps, validAttributes); + } + + /** + * In the future, we should cleanup callbacks by cancelling them instead of + * using this. + */ + function mountSafeCallback_NOT_REALLY_SAFE(context, callback) { + return function () { + if (!callback) { + return undefined; + } // This protects against createClass() components. + // We don't know if there is code depending on it. + // We intentionally don't use isMounted() because even accessing + // isMounted property on a React ES6 class will trigger a warning. + + if (typeof context.__isMounted === "boolean") { + if (!context.__isMounted) { + return undefined; + } + } // FIXME: there used to be other branches that protected + // against unmounted host components. But RN host components don't + // define isMounted() anymore, so those checks didn't do anything. + // They caused false positive warning noise so we removed them: + // https://github.com/facebook/react-native/issues/18868#issuecomment-413579095 + // However, this means that the callback is NOT guaranteed to be safe + // for host components. The solution we should implement is to make + // UIManager.measure() and similar calls truly cancelable. Then we + // can change our own code calling them to cancel when something unmounts. + + return callback.apply(context, arguments); + }; + } + function warnForStyleProps(props, validAttributes) { + { + for (var key in validAttributes.style) { + if (!(validAttributes[key] || props[key] === undefined)) { + error("You are setting the style `{ %s" + ": ... }` as a prop. You " + "should nest it in a style object. " + "E.g. `{ style: { %s" + ": ... } }`", key, key); + } + } + } + } + var ReactNativeFiberHostComponent = /*#__PURE__*/function () { + function ReactNativeFiberHostComponent(tag, viewConfig, internalInstanceHandleDEV) { + this._nativeTag = tag; + this._children = []; + this.viewConfig = viewConfig; + { + this._internalFiberInstanceHandleDEV = internalInstanceHandleDEV; + } + } + var _proto = ReactNativeFiberHostComponent.prototype; + _proto.blur = function blur() { + ReactNativePrivateInterface.TextInputState.blurTextInput(this); + }; + _proto.focus = function focus() { + ReactNativePrivateInterface.TextInputState.focusTextInput(this); + }; + _proto.measure = function measure(callback) { + ReactNativePrivateInterface.UIManager.measure(this._nativeTag, mountSafeCallback_NOT_REALLY_SAFE(this, callback)); + }; + _proto.measureInWindow = function measureInWindow(callback) { + ReactNativePrivateInterface.UIManager.measureInWindow(this._nativeTag, mountSafeCallback_NOT_REALLY_SAFE(this, callback)); + }; + _proto.measureLayout = function measureLayout(relativeToNativeNode, onSuccess, onFail) /* currently unused */ + { + var relativeNode; + if (typeof relativeToNativeNode === "number") { + // Already a node handle + relativeNode = relativeToNativeNode; + } else { + var nativeNode = relativeToNativeNode; + if (nativeNode._nativeTag) { + relativeNode = nativeNode._nativeTag; + } + } + if (relativeNode == null) { + { + error("Warning: ref.measureLayout must be called with a node handle or a ref to a native component."); + } + return; + } + ReactNativePrivateInterface.UIManager.measureLayout(this._nativeTag, relativeNode, mountSafeCallback_NOT_REALLY_SAFE(this, onFail), mountSafeCallback_NOT_REALLY_SAFE(this, onSuccess)); + }; + _proto.setNativeProps = function setNativeProps(nativeProps) { + { + warnForStyleProps(nativeProps, this.viewConfig.validAttributes); + } + var updatePayload = create(nativeProps, this.viewConfig.validAttributes); // Avoid the overhead of bridge calls if there's no update. + // This is an expensive no-op for Android, and causes an unnecessary + // view invalidation for certain components (eg RCTTextInput) on iOS. + + if (updatePayload != null) { + ReactNativePrivateInterface.UIManager.updateView(this._nativeTag, this.viewConfig.uiViewClassName, updatePayload); + } + }; + return ReactNativeFiberHostComponent; + }(); // eslint-disable-next-line no-unused-expressions + + // This module only exists as an ESM wrapper around the external CommonJS + var scheduleCallback = Scheduler.unstable_scheduleCallback; + var cancelCallback = Scheduler.unstable_cancelCallback; + var shouldYield = Scheduler.unstable_shouldYield; + var requestPaint = Scheduler.unstable_requestPaint; + var now = Scheduler.unstable_now; + var ImmediatePriority = Scheduler.unstable_ImmediatePriority; + var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority; + var NormalPriority = Scheduler.unstable_NormalPriority; + var IdlePriority = Scheduler.unstable_IdlePriority; + var rendererID = null; + var injectedHook = null; + var hasLoggedError = false; + var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined"; + function injectInternals(internals) { + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined") { + // No DevTools + return false; + } + var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; + if (hook.isDisabled) { + // This isn't a real property on the hook, but it can be set to opt out + // of DevTools integration and associated warnings and logs. + // https://github.com/facebook/react/issues/3877 + return true; + } + if (!hook.supportsFiber) { + { + error("The installed version of React DevTools is too old and will not work " + "with the current version of React. Please update React DevTools. " + "https://react.dev/link/react-devtools"); + } // DevTools exists, even though it doesn't support Fiber. + + return true; + } + try { + if (enableSchedulingProfiler) { + // Conditionally inject these hooks only if Timeline profiler is supported by this build. + // This gives DevTools a way to feature detect that isn't tied to version number + // (since profiling and timeline are controlled by different feature flags). + internals = assign({}, internals, { + getLaneLabelMap: getLaneLabelMap, + injectProfilingHooks: injectProfilingHooks + }); + } + rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks. + + injectedHook = hook; + } catch (err) { + // Catch all errors because it is unsafe to throw during initialization. + { + error("React instrumentation encountered an error: %s.", err); + } + } + if (hook.checkDCE) { + // This is the real DevTools. + return true; + } else { + // This is likely a hook installed by Fast Refresh runtime. + return false; + } + } + function onScheduleRoot(root, children) { + { + if (injectedHook && typeof injectedHook.onScheduleFiberRoot === "function") { + try { + injectedHook.onScheduleFiberRoot(rendererID, root, children); + } catch (err) { + if (!hasLoggedError) { + hasLoggedError = true; + error("React instrumentation encountered an error: %s", err); + } + } + } + } + } + function onCommitRoot(root, eventPriority) { + if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") { + try { + var didError = (root.current.flags & DidCapture) === DidCapture; + if (enableProfilerTimer) { + var schedulerPriority; + switch (eventPriority) { + case DiscreteEventPriority: + schedulerPriority = ImmediatePriority; + break; + case ContinuousEventPriority: + schedulerPriority = UserBlockingPriority; + break; + case DefaultEventPriority: + schedulerPriority = NormalPriority; + break; + case IdleEventPriority: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority; + break; + } + injectedHook.onCommitFiberRoot(rendererID, root, schedulerPriority, didError); + } else { + injectedHook.onCommitFiberRoot(rendererID, root, undefined, didError); + } + } catch (err) { + { + if (!hasLoggedError) { + hasLoggedError = true; + error("React instrumentation encountered an error: %s", err); + } + } + } + } + } + function onPostCommitRoot(root) { + if (injectedHook && typeof injectedHook.onPostCommitFiberRoot === "function") { + try { + injectedHook.onPostCommitFiberRoot(rendererID, root); + } catch (err) { + { + if (!hasLoggedError) { + hasLoggedError = true; + error("React instrumentation encountered an error: %s", err); + } + } + } + } + } + function onCommitUnmount(fiber) { + if (injectedHook && typeof injectedHook.onCommitFiberUnmount === "function") { + try { + injectedHook.onCommitFiberUnmount(rendererID, fiber); + } catch (err) { + { + if (!hasLoggedError) { + hasLoggedError = true; + error("React instrumentation encountered an error: %s", err); + } + } + } + } + } + function injectProfilingHooks(profilingHooks) {} + function getLaneLabelMap() { + { + return null; + } + } + function markComponentRenderStopped() {} + function markComponentErrored(fiber, thrownValue, lanes) {} + function markComponentSuspended(fiber, wakeable, lanes) {} + var NoMode = /* */ + 0; // TODO: Remove ConcurrentMode by reading from the root tag instead + + var ConcurrentMode = /* */ + 1; + var ProfileMode = /* */ + 2; + var StrictLegacyMode = /* */ + 8; + + // TODO: This is pretty well supported by browsers. Maybe we can drop it. + var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; // Count leading zeros. + // Based on: + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32 + + var log = Math.log; + var LN2 = Math.LN2; + function clz32Fallback(x) { + var asUint = x >>> 0; + if (asUint === 0) { + return 32; + } + return 31 - (log(asUint) / LN2 | 0) | 0; + } + + // If those values are changed that package should be rebuilt and redeployed. + + var TotalLanes = 31; + var NoLanes = /* */ + 0; + var NoLane = /* */ + 0; + var SyncLane = /* */ + 1; + var InputContinuousHydrationLane = /* */ + 2; + var InputContinuousLane = /* */ + 4; + var DefaultHydrationLane = /* */ + 8; + var DefaultLane = /* */ + 16; + var TransitionHydrationLane = /* */ + 32; + var TransitionLanes = /* */ + 4194240; + var TransitionLane1 = /* */ + 64; + var TransitionLane2 = /* */ + 128; + var TransitionLane3 = /* */ + 256; + var TransitionLane4 = /* */ + 512; + var TransitionLane5 = /* */ + 1024; + var TransitionLane6 = /* */ + 2048; + var TransitionLane7 = /* */ + 4096; + var TransitionLane8 = /* */ + 8192; + var TransitionLane9 = /* */ + 16384; + var TransitionLane10 = /* */ + 32768; + var TransitionLane11 = /* */ + 65536; + var TransitionLane12 = /* */ + 131072; + var TransitionLane13 = /* */ + 262144; + var TransitionLane14 = /* */ + 524288; + var TransitionLane15 = /* */ + 1048576; + var TransitionLane16 = /* */ + 2097152; + var RetryLanes = /* */ + 130023424; + var RetryLane1 = /* */ + 4194304; + var RetryLane2 = /* */ + 8388608; + var RetryLane3 = /* */ + 16777216; + var RetryLane4 = /* */ + 33554432; + var RetryLane5 = /* */ + 67108864; + var SomeRetryLane = RetryLane1; + var SelectiveHydrationLane = /* */ + 134217728; + var NonIdleLanes = /* */ + 268435455; + var IdleHydrationLane = /* */ + 268435456; + var IdleLane = /* */ + 536870912; + var OffscreenLane = /* */ + 1073741824; // This function is used for the experimental timeline (react-devtools-timeline) + var NoTimestamp = -1; + var nextTransitionLane = TransitionLane1; + var nextRetryLane = RetryLane1; + function getHighestPriorityLanes(lanes) { + switch (getHighestPriorityLane(lanes)) { + case SyncLane: + return SyncLane; + case InputContinuousHydrationLane: + return InputContinuousHydrationLane; + case InputContinuousLane: + return InputContinuousLane; + case DefaultHydrationLane: + return DefaultHydrationLane; + case DefaultLane: + return DefaultLane; + case TransitionHydrationLane: + return TransitionHydrationLane; + case TransitionLane1: + case TransitionLane2: + case TransitionLane3: + case TransitionLane4: + case TransitionLane5: + case TransitionLane6: + case TransitionLane7: + case TransitionLane8: + case TransitionLane9: + case TransitionLane10: + case TransitionLane11: + case TransitionLane12: + case TransitionLane13: + case TransitionLane14: + case TransitionLane15: + case TransitionLane16: + return lanes & TransitionLanes; + case RetryLane1: + case RetryLane2: + case RetryLane3: + case RetryLane4: + case RetryLane5: + return lanes & RetryLanes; + case SelectiveHydrationLane: + return SelectiveHydrationLane; + case IdleHydrationLane: + return IdleHydrationLane; + case IdleLane: + return IdleLane; + case OffscreenLane: + return OffscreenLane; + default: + { + error("Should have found matching lanes. This is a bug in React."); + } // This shouldn't be reachable, but as a fallback, return the entire bitmask. + + return lanes; + } + } + function getNextLanes(root, wipLanes) { + // Early bailout if there's no pending work left. + var pendingLanes = root.pendingLanes; + if (pendingLanes === NoLanes) { + return NoLanes; + } + var nextLanes = NoLanes; + var suspendedLanes = root.suspendedLanes; + var pingedLanes = root.pingedLanes; // Do not work on any idle work until all the non-idle work has finished, + // even if the work is suspended. + + var nonIdlePendingLanes = pendingLanes & NonIdleLanes; + if (nonIdlePendingLanes !== NoLanes) { + var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes; + if (nonIdleUnblockedLanes !== NoLanes) { + nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes); + } else { + var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes; + if (nonIdlePingedLanes !== NoLanes) { + nextLanes = getHighestPriorityLanes(nonIdlePingedLanes); + } + } + } else { + // The only remaining work is Idle. + var unblockedLanes = pendingLanes & ~suspendedLanes; + if (unblockedLanes !== NoLanes) { + nextLanes = getHighestPriorityLanes(unblockedLanes); + } else { + if (pingedLanes !== NoLanes) { + nextLanes = getHighestPriorityLanes(pingedLanes); + } + } + } + if (nextLanes === NoLanes) { + // This should only be reachable if we're suspended + // TODO: Consider warning in this path if a fallback timer is not scheduled. + return NoLanes; + } // If we're already in the middle of a render, switching lanes will interrupt + // it and we'll lose our progress. We should only do this if the new lanes are + // higher priority. + + if (wipLanes !== NoLanes && wipLanes !== nextLanes && + // If we already suspended with a delay, then interrupting is fine. Don't + // bother waiting until the root is complete. + (wipLanes & suspendedLanes) === NoLanes) { + var nextLane = getHighestPriorityLane(nextLanes); + var wipLane = getHighestPriorityLane(wipLanes); + if ( + // Tests whether the next lane is equal or lower priority than the wip + // one. This works because the bits decrease in priority as you go left. + nextLane >= wipLane || + // Default priority updates should not interrupt transition updates. The + // only difference between default updates and transition updates is that + // default updates do not support refresh transitions. + nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes) { + // Keep working on the existing in-progress tree. Do not interrupt. + return wipLanes; + } + } + if ((nextLanes & InputContinuousLane) !== NoLanes) { + // When updates are sync by default, we entangle continuous priority updates + // and default updates, so they render in the same batch. The only reason + // they use separate lanes is because continuous updates should interrupt + // transitions, but default updates should not. + nextLanes |= pendingLanes & DefaultLane; + } // Check for entangled lanes and add them to the batch. + // + // A lane is said to be entangled with another when it's not allowed to render + // in a batch that does not also include the other lane. Typically we do this + // when multiple updates have the same source, and we only want to respond to + // the most recent event from that source. + // + // Note that we apply entanglements *after* checking for partial work above. + // This means that if a lane is entangled during an interleaved event while + // it's already rendering, we won't interrupt it. This is intentional, since + // entanglement is usually "best effort": we'll try our best to render the + // lanes in the same batch, but it's not worth throwing out partially + // completed work in order to do it. + // TODO: Reconsider this. The counter-argument is that the partial work + // represents an intermediate state, which we don't want to show to the user. + // And by spending extra time finishing it, we're increasing the amount of + // time it takes to show the final state, which is what they are actually + // waiting for. + // + // For those exceptions where entanglement is semantically important, like + // useMutableSource, we should ensure that there is no partial work at the + // time we apply the entanglement. + + var entangledLanes = root.entangledLanes; + if (entangledLanes !== NoLanes) { + var entanglements = root.entanglements; + var lanes = nextLanes & entangledLanes; + while (lanes > 0) { + var index = pickArbitraryLaneIndex(lanes); + var lane = 1 << index; + nextLanes |= entanglements[index]; + lanes &= ~lane; + } + } + return nextLanes; + } + function getMostRecentEventTime(root, lanes) { + var eventTimes = root.eventTimes; + var mostRecentEventTime = NoTimestamp; + while (lanes > 0) { + var index = pickArbitraryLaneIndex(lanes); + var lane = 1 << index; + var eventTime = eventTimes[index]; + if (eventTime > mostRecentEventTime) { + mostRecentEventTime = eventTime; + } + lanes &= ~lane; + } + return mostRecentEventTime; + } + function computeExpirationTime(lane, currentTime) { + switch (lane) { + case SyncLane: + case InputContinuousHydrationLane: + case InputContinuousLane: + // User interactions should expire slightly more quickly. + // + // NOTE: This is set to the corresponding constant as in Scheduler.js. + // When we made it larger, a product metric in www regressed, suggesting + // there's a user interaction that's being starved by a series of + // synchronous updates. If that theory is correct, the proper solution is + // to fix the starvation. However, this scenario supports the idea that + // expiration times are an important safeguard when starvation + // does happen. + return currentTime + 250; + case DefaultHydrationLane: + case DefaultLane: + case TransitionHydrationLane: + case TransitionLane1: + case TransitionLane2: + case TransitionLane3: + case TransitionLane4: + case TransitionLane5: + case TransitionLane6: + case TransitionLane7: + case TransitionLane8: + case TransitionLane9: + case TransitionLane10: + case TransitionLane11: + case TransitionLane12: + case TransitionLane13: + case TransitionLane14: + case TransitionLane15: + case TransitionLane16: + return currentTime + 5000; + case RetryLane1: + case RetryLane2: + case RetryLane3: + case RetryLane4: + case RetryLane5: + // TODO: Retries should be allowed to expire if they are CPU bound for + // too long, but when I made this change it caused a spike in browser + // crashes. There must be some other underlying bug; not super urgent but + // ideally should figure out why and fix it. Unfortunately we don't have + // a repro for the crashes, only detected via production metrics. + return NoTimestamp; + case SelectiveHydrationLane: + case IdleHydrationLane: + case IdleLane: + case OffscreenLane: + // Anything idle priority or lower should never expire. + return NoTimestamp; + default: + { + error("Should have found matching lanes. This is a bug in React."); + } + return NoTimestamp; + } + } + function markStarvedLanesAsExpired(root, currentTime) { + // TODO: This gets called every time we yield. We can optimize by storing + // the earliest expiration time on the root. Then use that to quickly bail out + // of this function. + var pendingLanes = root.pendingLanes; + var suspendedLanes = root.suspendedLanes; + var pingedLanes = root.pingedLanes; + var expirationTimes = root.expirationTimes; // Iterate through the pending lanes and check if we've reached their + // expiration time. If so, we'll assume the update is being starved and mark + // it as expired to force it to finish. + + var lanes = pendingLanes; + while (lanes > 0) { + var index = pickArbitraryLaneIndex(lanes); + var lane = 1 << index; + var expirationTime = expirationTimes[index]; + if (expirationTime === NoTimestamp) { + // Found a pending lane with no expiration time. If it's not suspended, or + // if it's pinged, assume it's CPU-bound. Compute a new expiration time + // using the current time. + if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) { + // Assumes timestamps are monotonically increasing. + expirationTimes[index] = computeExpirationTime(lane, currentTime); + } + } else if (expirationTime <= currentTime) { + // This lane expired + root.expiredLanes |= lane; + } + lanes &= ~lane; + } + } // This returns the highest priority pending lanes regardless of whether they + function getLanesToRetrySynchronouslyOnError(root) { + var everythingButOffscreen = root.pendingLanes & ~OffscreenLane; + if (everythingButOffscreen !== NoLanes) { + return everythingButOffscreen; + } + if (everythingButOffscreen & OffscreenLane) { + return OffscreenLane; + } + return NoLanes; + } + function includesSyncLane(lanes) { + return (lanes & SyncLane) !== NoLanes; + } + function includesNonIdleWork(lanes) { + return (lanes & NonIdleLanes) !== NoLanes; + } + function includesOnlyRetries(lanes) { + return (lanes & RetryLanes) === lanes; + } + function includesOnlyNonUrgentLanes(lanes) { + var UrgentLanes = SyncLane | InputContinuousLane | DefaultLane; + return (lanes & UrgentLanes) === NoLanes; + } + function includesOnlyTransitions(lanes) { + return (lanes & TransitionLanes) === lanes; + } + function includesBlockingLane(root, lanes) { + var SyncDefaultLanes = InputContinuousHydrationLane | InputContinuousLane | DefaultHydrationLane | DefaultLane; + return (lanes & SyncDefaultLanes) !== NoLanes; + } + function includesExpiredLane(root, lanes) { + // This is a separate check from includesBlockingLane because a lane can + // expire after a render has already started. + return (lanes & root.expiredLanes) !== NoLanes; + } + function isTransitionLane(lane) { + return (lane & TransitionLanes) !== NoLanes; + } + function claimNextTransitionLane() { + // Cycle through the lanes, assigning each new transition to the next lane. + // In most cases, this means every transition gets its own lane, until we + // run out of lanes and cycle back to the beginning. + var lane = nextTransitionLane; + nextTransitionLane <<= 1; + if ((nextTransitionLane & TransitionLanes) === NoLanes) { + nextTransitionLane = TransitionLane1; + } + return lane; + } + function claimNextRetryLane() { + var lane = nextRetryLane; + nextRetryLane <<= 1; + if ((nextRetryLane & RetryLanes) === NoLanes) { + nextRetryLane = RetryLane1; + } + return lane; + } + function getHighestPriorityLane(lanes) { + return lanes & -lanes; + } + function pickArbitraryLane(lanes) { + // This wrapper function gets inlined. Only exists so to communicate that it + // doesn't matter which bit is selected; you can pick any bit without + // affecting the algorithms where its used. Here I'm using + // getHighestPriorityLane because it requires the fewest operations. + return getHighestPriorityLane(lanes); + } + function pickArbitraryLaneIndex(lanes) { + return 31 - clz32(lanes); + } + function laneToIndex(lane) { + return pickArbitraryLaneIndex(lane); + } + function includesSomeLane(a, b) { + return (a & b) !== NoLanes; + } + function isSubsetOfLanes(set, subset) { + return (set & subset) === subset; + } + function mergeLanes(a, b) { + return a | b; + } + function removeLanes(set, subset) { + return set & ~subset; + } + function intersectLanes(a, b) { + return a & b; + } // Seems redundant, but it changes the type from a single lane (used for + // updates) to a group of lanes (used for flushing work). + + function laneToLanes(lane) { + return lane; + } + function createLaneMap(initial) { + // Intentionally pushing one by one. + // https://v8.dev/blog/elements-kinds#avoid-creating-holes + var laneMap = []; + for (var i = 0; i < TotalLanes; i++) { + laneMap.push(initial); + } + return laneMap; + } + function markRootUpdated(root, updateLane, eventTime) { + root.pendingLanes |= updateLane; // If there are any suspended transitions, it's possible this new update + // could unblock them. Clear the suspended lanes so that we can try rendering + // them again. + // + // TODO: We really only need to unsuspend only lanes that are in the + // `subtreeLanes` of the updated fiber, or the update lanes of the return + // path. This would exclude suspended updates in an unrelated sibling tree, + // since there's no way for this update to unblock it. + // + // We don't do this if the incoming update is idle, because we never process + // idle updates until after all the regular updates have finished; there's no + // way it could unblock a transition. + + if (updateLane !== IdleLane) { + root.suspendedLanes = NoLanes; + root.pingedLanes = NoLanes; + } + var eventTimes = root.eventTimes; + var index = laneToIndex(updateLane); // We can always overwrite an existing timestamp because we prefer the most + // recent event, and we assume time is monotonically increasing. + + eventTimes[index] = eventTime; + } + function markRootSuspended(root, suspendedLanes) { + root.suspendedLanes |= suspendedLanes; + root.pingedLanes &= ~suspendedLanes; // The suspended lanes are no longer CPU-bound. Clear their expiration times. + + var expirationTimes = root.expirationTimes; + var lanes = suspendedLanes; + while (lanes > 0) { + var index = pickArbitraryLaneIndex(lanes); + var lane = 1 << index; + expirationTimes[index] = NoTimestamp; + lanes &= ~lane; + } + } + function markRootPinged(root, pingedLanes, eventTime) { + root.pingedLanes |= root.suspendedLanes & pingedLanes; + } + function markRootFinished(root, remainingLanes) { + var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; + root.pendingLanes = remainingLanes; // Let's try everything again + + root.suspendedLanes = NoLanes; + root.pingedLanes = NoLanes; + root.expiredLanes &= remainingLanes; + root.mutableReadLanes &= remainingLanes; + root.entangledLanes &= remainingLanes; + var entanglements = root.entanglements; + var eventTimes = root.eventTimes; + var expirationTimes = root.expirationTimes; // Clear the lanes that no longer have pending work + + var lanes = noLongerPendingLanes; + while (lanes > 0) { + var index = pickArbitraryLaneIndex(lanes); + var lane = 1 << index; + entanglements[index] = NoLanes; + eventTimes[index] = NoTimestamp; + expirationTimes[index] = NoTimestamp; + lanes &= ~lane; + } + } + function markRootEntangled(root, entangledLanes) { + // In addition to entangling each of the given lanes with each other, we also + // have to consider _transitive_ entanglements. For each lane that is already + // entangled with *any* of the given lanes, that lane is now transitively + // entangled with *all* the given lanes. + // + // Translated: If C is entangled with A, then entangling A with B also + // entangles C with B. + // + // If this is hard to grasp, it might help to intentionally break this + // function and look at the tests that fail in ReactTransition-test.js. Try + // commenting out one of the conditions below. + var rootEntangledLanes = root.entangledLanes |= entangledLanes; + var entanglements = root.entanglements; + var lanes = rootEntangledLanes; + while (lanes) { + var index = pickArbitraryLaneIndex(lanes); + var lane = 1 << index; + if ( + // Is this one of the newly entangled lanes? + lane & entangledLanes | + // Is this lane transitively entangled with the newly entangled lanes? + entanglements[index] & entangledLanes) { + entanglements[index] |= entangledLanes; + } + lanes &= ~lane; + } + } + function getBumpedLaneForHydration(root, renderLanes) { + var renderLane = getHighestPriorityLane(renderLanes); + var lane; + switch (renderLane) { + case InputContinuousLane: + lane = InputContinuousHydrationLane; + break; + case DefaultLane: + lane = DefaultHydrationLane; + break; + case TransitionLane1: + case TransitionLane2: + case TransitionLane3: + case TransitionLane4: + case TransitionLane5: + case TransitionLane6: + case TransitionLane7: + case TransitionLane8: + case TransitionLane9: + case TransitionLane10: + case TransitionLane11: + case TransitionLane12: + case TransitionLane13: + case TransitionLane14: + case TransitionLane15: + case TransitionLane16: + case RetryLane1: + case RetryLane2: + case RetryLane3: + case RetryLane4: + case RetryLane5: + lane = TransitionHydrationLane; + break; + case IdleLane: + lane = IdleHydrationLane; + break; + default: + // Everything else is already either a hydration lane, or shouldn't + // be retried at a hydration lane. + lane = NoLane; + break; + } // Check if the lane we chose is suspended. If so, that indicates that we + // already attempted and failed to hydrate at that level. Also check if we're + // already rendering that lane, which is rare but could happen. + + if ((lane & (root.suspendedLanes | renderLanes)) !== NoLane) { + // Give up trying to hydrate and fall back to client render. + return NoLane; + } + return lane; + } + function addFiberToLanesMap(root, fiber, lanes) { + if (!isDevToolsPresent) { + return; + } + var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap; + while (lanes > 0) { + var index = laneToIndex(lanes); + var lane = 1 << index; + var updaters = pendingUpdatersLaneMap[index]; + updaters.add(fiber); + lanes &= ~lane; + } + } + function movePendingFibersToMemoized(root, lanes) { + if (!isDevToolsPresent) { + return; + } + var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap; + var memoizedUpdaters = root.memoizedUpdaters; + while (lanes > 0) { + var index = laneToIndex(lanes); + var lane = 1 << index; + var updaters = pendingUpdatersLaneMap[index]; + if (updaters.size > 0) { + updaters.forEach(function (fiber) { + var alternate = fiber.alternate; + if (alternate === null || !memoizedUpdaters.has(alternate)) { + memoizedUpdaters.add(fiber); + } + }); + updaters.clear(); + } + lanes &= ~lane; + } + } + function getTransitionsForLanes(root, lanes) { + { + return null; + } + } + var DiscreteEventPriority = SyncLane; + var ContinuousEventPriority = InputContinuousLane; + var DefaultEventPriority = DefaultLane; + var IdleEventPriority = IdleLane; + var currentUpdatePriority = NoLane; + function getCurrentUpdatePriority() { + return currentUpdatePriority; + } + function setCurrentUpdatePriority(newPriority) { + currentUpdatePriority = newPriority; + } + function higherEventPriority(a, b) { + return a !== 0 && a < b ? a : b; + } + function lowerEventPriority(a, b) { + return a === 0 || a > b ? a : b; + } + function isHigherEventPriority(a, b) { + return a !== 0 && a < b; + } + function lanesToEventPriority(lanes) { + var lane = getHighestPriorityLane(lanes); + if (!isHigherEventPriority(DiscreteEventPriority, lane)) { + return DiscreteEventPriority; + } + if (!isHigherEventPriority(ContinuousEventPriority, lane)) { + return ContinuousEventPriority; + } + if (includesNonIdleWork(lane)) { + return DefaultEventPriority; + } + return IdleEventPriority; + } + + // Renderers that don't support hydration + // can re-export everything from this module. + function shim() { + throw new Error("The current renderer does not support hydration. " + "This error is likely caused by a bug in React. " + "Please file an issue."); + } // Hydration (when unsupported) + var isSuspenseInstancePending = shim; + var isSuspenseInstanceFallback = shim; + var getSuspenseInstanceFallbackErrorDetails = shim; + var registerSuspenseInstanceRetry = shim; + var hydrateTextInstance = shim; + var clearSuspenseBoundary = shim; + var clearSuspenseBoundaryFromContainer = shim; + var errorHydratingContainer = shim; + var getViewConfigForType = ReactNativePrivateInterface.ReactNativeViewConfigRegistry.get; + var UPDATE_SIGNAL = {}; + { + Object.freeze(UPDATE_SIGNAL); + } // Counter for uniquely identifying views. + // % 10 === 1 means it is a rootTag. + // % 2 === 0 means it is a Fabric tag. + + var nextReactTag = 3; + function allocateTag() { + var tag = nextReactTag; + if (tag % 10 === 1) { + tag += 2; + } + nextReactTag = tag + 2; + return tag; + } + function recursivelyUncacheFiberNode(node) { + if (typeof node === "number") { + // Leaf node (eg text) + uncacheFiberNode(node); + } else { + uncacheFiberNode(node._nativeTag); + node._children.forEach(recursivelyUncacheFiberNode); + } + } + function appendInitialChild(parentInstance, child) { + parentInstance._children.push(child); + } + function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) { + var tag = allocateTag(); + var viewConfig = getViewConfigForType(type); + { + for (var key in viewConfig.validAttributes) { + if (props.hasOwnProperty(key)) { + ReactNativePrivateInterface.deepFreezeAndThrowOnMutationInDev(props[key]); + } + } + } + var updatePayload = create(props, viewConfig.validAttributes); + ReactNativePrivateInterface.UIManager.createView(tag, + // reactTag + viewConfig.uiViewClassName, + // viewName + rootContainerInstance, + // rootTag + updatePayload // props + ); + var component = new ReactNativeFiberHostComponent(tag, viewConfig, internalInstanceHandle); + precacheFiberNode(internalInstanceHandle, tag); + updateFiberProps(tag, props); // Not sure how to avoid this cast. Flow is okay if the component is defined + // in the same file but if it's external it can't see the types. + + return component; + } + function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) { + if (!hostContext.isInAParentText) { + throw new Error("Text strings must be rendered within a component."); + } + var tag = allocateTag(); + ReactNativePrivateInterface.UIManager.createView(tag, + // reactTag + "RCTRawText", + // viewName + rootContainerInstance, + // rootTag + { + text: text + } // props + ); + precacheFiberNode(internalInstanceHandle, tag); + return tag; + } + function finalizeInitialChildren(parentInstance, type, props, rootContainerInstance, hostContext) { + // Don't send a no-op message over the bridge. + if (parentInstance._children.length === 0) { + return false; + } // Map from child objects to native tags. + // Either way we need to pass a copy of the Array to prevent it from being frozen. + + var nativeTags = parentInstance._children.map(function (child) { + return typeof child === "number" ? child // Leaf node (eg text) + : child._nativeTag; + }); + ReactNativePrivateInterface.UIManager.setChildren(parentInstance._nativeTag, + // containerTag + nativeTags // reactTags + ); + return false; + } + function getRootHostContext(rootContainerInstance) { + return { + isInAParentText: false + }; + } + function getChildHostContext(parentHostContext, type, rootContainerInstance) { + var prevIsInAParentText = parentHostContext.isInAParentText; + var isInAParentText = type === "AndroidTextInput" || + // Android + type === "RCTMultilineTextInputView" || + // iOS + type === "RCTSinglelineTextInputView" || + // iOS + type === "RCTText" || type === "RCTVirtualText"; + if (prevIsInAParentText !== isInAParentText) { + return { + isInAParentText: isInAParentText + }; + } else { + return parentHostContext; + } + } + function getPublicInstance(instance) { + return instance; + } + function prepareForCommit(containerInfo) { + // Noop + return null; + } + function prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, hostContext) { + return UPDATE_SIGNAL; + } + function resetAfterCommit(containerInfo) { + // Noop + } + var scheduleTimeout = setTimeout; + var cancelTimeout = clearTimeout; + var noTimeout = -1; + function shouldSetTextContent(type, props) { + // TODO (bvaughn) Revisit this decision. + // Always returning false simplifies the createInstance() implementation, + // But creates an additional child Fiber for raw text children. + // No additional native views are created though. + // It's not clear to me which is better so I'm deferring for now. + // More context @ github.com/facebook/react/pull/8560#discussion_r92111303 + return false; + } + function getCurrentEventPriority() { + return DefaultEventPriority; + } // ------------------- + function appendChild(parentInstance, child) { + var childTag = typeof child === "number" ? child : child._nativeTag; + var children = parentInstance._children; + var index = children.indexOf(child); + if (index >= 0) { + children.splice(index, 1); + children.push(child); + ReactNativePrivateInterface.UIManager.manageChildren(parentInstance._nativeTag, + // containerTag + [index], + // moveFromIndices + [children.length - 1], + // moveToIndices + [], + // addChildReactTags + [], + // addAtIndices + [] // removeAtIndices + ); + } else { + children.push(child); + ReactNativePrivateInterface.UIManager.manageChildren(parentInstance._nativeTag, + // containerTag + [], + // moveFromIndices + [], + // moveToIndices + [childTag], + // addChildReactTags + [children.length - 1], + // addAtIndices + [] // removeAtIndices + ); + } + } + function appendChildToContainer(parentInstance, child) { + var childTag = typeof child === "number" ? child : child._nativeTag; + ReactNativePrivateInterface.UIManager.setChildren(parentInstance, + // containerTag + [childTag] // reactTags + ); + } + function commitTextUpdate(textInstance, oldText, newText) { + ReactNativePrivateInterface.UIManager.updateView(textInstance, + // reactTag + "RCTRawText", + // viewName + { + text: newText + } // props + ); + } + function commitUpdate(instance, updatePayloadTODO, type, oldProps, newProps, internalInstanceHandle) { + var viewConfig = instance.viewConfig; + updateFiberProps(instance._nativeTag, newProps); + var updatePayload = diff(oldProps, newProps, viewConfig.validAttributes); // Avoid the overhead of bridge calls if there's no update. + // This is an expensive no-op for Android, and causes an unnecessary + // view invalidation for certain components (eg RCTTextInput) on iOS. + + if (updatePayload != null) { + ReactNativePrivateInterface.UIManager.updateView(instance._nativeTag, + // reactTag + viewConfig.uiViewClassName, + // viewName + updatePayload // props + ); + } + } + function insertBefore(parentInstance, child, beforeChild) { + var children = parentInstance._children; + var index = children.indexOf(child); // Move existing child or add new child? + + if (index >= 0) { + children.splice(index, 1); + var beforeChildIndex = children.indexOf(beforeChild); + children.splice(beforeChildIndex, 0, child); + ReactNativePrivateInterface.UIManager.manageChildren(parentInstance._nativeTag, + // containerID + [index], + // moveFromIndices + [beforeChildIndex], + // moveToIndices + [], + // addChildReactTags + [], + // addAtIndices + [] // removeAtIndices + ); + } else { + var _beforeChildIndex = children.indexOf(beforeChild); + children.splice(_beforeChildIndex, 0, child); + var childTag = typeof child === "number" ? child : child._nativeTag; + ReactNativePrivateInterface.UIManager.manageChildren(parentInstance._nativeTag, + // containerID + [], + // moveFromIndices + [], + // moveToIndices + [childTag], + // addChildReactTags + [_beforeChildIndex], + // addAtIndices + [] // removeAtIndices + ); + } + } + function insertInContainerBefore(parentInstance, child, beforeChild) { + // TODO (bvaughn): Remove this check when... + // We create a wrapper object for the container in ReactNative render() + // Or we refactor to remove wrapper objects entirely. + // For more info on pros/cons see PR #8560 description. + if (typeof parentInstance === "number") { + throw new Error("Container does not support insertBefore operation"); + } + } + function removeChild(parentInstance, child) { + recursivelyUncacheFiberNode(child); + var children = parentInstance._children; + var index = children.indexOf(child); + children.splice(index, 1); + ReactNativePrivateInterface.UIManager.manageChildren(parentInstance._nativeTag, + // containerID + [], + // moveFromIndices + [], + // moveToIndices + [], + // addChildReactTags + [], + // addAtIndices + [index] // removeAtIndices + ); + } + function removeChildFromContainer(parentInstance, child) { + recursivelyUncacheFiberNode(child); + ReactNativePrivateInterface.UIManager.manageChildren(parentInstance, + // containerID + [], + // moveFromIndices + [], + // moveToIndices + [], + // addChildReactTags + [], + // addAtIndices + [0] // removeAtIndices + ); + } + function resetTextContent(instance) { + // Noop + } + function hideInstance(instance) { + var viewConfig = instance.viewConfig; + var updatePayload = create({ + style: { + display: "none" + } + }, viewConfig.validAttributes); + ReactNativePrivateInterface.UIManager.updateView(instance._nativeTag, viewConfig.uiViewClassName, updatePayload); + } + function hideTextInstance(textInstance) { + throw new Error("Not yet implemented."); + } + function unhideInstance(instance, props) { + var viewConfig = instance.viewConfig; + var updatePayload = diff(assign({}, props, { + style: [props.style, { + display: "none" + }] + }), props, viewConfig.validAttributes); + ReactNativePrivateInterface.UIManager.updateView(instance._nativeTag, viewConfig.uiViewClassName, updatePayload); + } + function clearContainer(container) { + // TODO Implement this for React Native + // UIManager does not expose a "remove all" type method. + } + function unhideTextInstance(textInstance, text) { + throw new Error("Not yet implemented."); + } + function preparePortalMount(portalInstance) { + // noop + } + var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; + function describeBuiltInComponentFrame(name, source, ownerFn) { + { + var ownerName = null; + if (ownerFn) { + ownerName = ownerFn.displayName || ownerFn.name || null; + } + return describeComponentFrame(name, source, ownerName); + } + } + var componentFrameCache; + { + var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap(); + } + var BEFORE_SLASH_RE = /^(.*)[\\\/]/; + function describeComponentFrame(name, source, ownerName) { + var sourceInfo = ""; + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ""); // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + if (match) { + var pathBeforeSlash = match[1]; + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ""); + fileName = folderName + "/" + fileName; + } + } + } + sourceInfo = " (at " + fileName + ":" + source.lineNumber + ")"; + } else if (ownerName) { + sourceInfo = " (created by " + ownerName + ")"; + } + return "\n in " + (name || "Unknown") + sourceInfo; + } + function describeClassComponentFrame(ctor, source, ownerFn) { + { + return describeFunctionComponentFrame(ctor, source, ownerFn); + } + } + function describeFunctionComponentFrame(fn, source, ownerFn) { + { + if (!fn) { + return ""; + } + var name = fn.displayName || fn.name || null; + var ownerName = null; + if (ownerFn) { + ownerName = ownerFn.displayName || ownerFn.name || null; + } + return describeComponentFrame(name, source, ownerName); + } + } + function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { + if (type == null) { + return ""; + } + if (typeof type === "function") { + { + return describeFunctionComponentFrame(type, source, ownerFn); + } + } + if (typeof type === "string") { + return describeBuiltInComponentFrame(type, source, ownerFn); + } + switch (type) { + case REACT_SUSPENSE_TYPE: + return describeBuiltInComponentFrame("Suspense", source, ownerFn); + case REACT_SUSPENSE_LIST_TYPE: + return describeBuiltInComponentFrame("SuspenseList", source, ownerFn); + } + if (typeof type === "object") { + switch (type.$$typeof) { + case REACT_FORWARD_REF_TYPE: + return describeFunctionComponentFrame(type.render, source, ownerFn); + case REACT_MEMO_TYPE: + // Memo may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + case REACT_LAZY_TYPE: + { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + // Lazy may contain any component type so we recursively resolve it. + return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); + } catch (x) {} + } + } + } + return ""; + } + var hasOwnProperty = Object.prototype.hasOwnProperty; + var loggedTypeFailures = {}; + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + function setCurrentlyValidatingElement(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame.setExtraStackFrame(null); + } + } + } + function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + // $FlowFixMe This is okay but Flow doesn't know it. + var has = Function.call.bind(hasOwnProperty); + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== "function") { + // eslint-disable-next-line react-internal/prod-error-codes + var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; " + "it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`." + "This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); + err.name = "Invariant Violation"; + throw err; + } + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); + } catch (ex) { + error$1 = ex; + } + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + error("%s: type specification of %s" + " `%s` is invalid; the type checker " + "function must return `null` or an `Error` but returned a %s. " + "You may have forgotten to pass an argument to the type checker " + "creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and " + "shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1); + setCurrentlyValidatingElement(null); + } + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + error("Failed %s type: %s", location, error$1.message); + setCurrentlyValidatingElement(null); + } + } + } + } + } + var valueStack = []; + var fiberStack; + { + fiberStack = []; + } + var index = -1; + function createCursor(defaultValue) { + return { + current: defaultValue + }; + } + function pop(cursor, fiber) { + if (index < 0) { + { + error("Unexpected pop."); + } + return; + } + { + if (fiber !== fiberStack[index]) { + error("Unexpected Fiber popped."); + } + } + cursor.current = valueStack[index]; + valueStack[index] = null; + { + fiberStack[index] = null; + } + index--; + } + function push(cursor, value, fiber) { + index++; + valueStack[index] = cursor.current; + { + fiberStack[index] = fiber; + } + cursor.current = value; + } + var warnedAboutMissingGetChildContext; + { + warnedAboutMissingGetChildContext = {}; + } + var emptyContextObject = {}; + { + Object.freeze(emptyContextObject); + } // A cursor to the current merged context object on the stack. + + var contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed. + + var didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack. + // We use this to get access to the parent context after we have already + // pushed the next context provider, and now need to merge their contexts. + + var previousContext = emptyContextObject; + function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) { + { + if (didPushOwnContextIfProvider && isContextProvider(Component)) { + // If the fiber is a context provider itself, when we read its context + // we may have already pushed its own child context on the stack. A context + // provider should not "see" its own child context. Therefore we read the + // previous (parent) context instead for a context provider. + return previousContext; + } + return contextStackCursor.current; + } + } + function cacheContext(workInProgress, unmaskedContext, maskedContext) { + { + var instance = workInProgress.stateNode; + instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext; + instance.__reactInternalMemoizedMaskedChildContext = maskedContext; + } + } + function getMaskedContext(workInProgress, unmaskedContext) { + { + var type = workInProgress.type; + var contextTypes = type.contextTypes; + if (!contextTypes) { + return emptyContextObject; + } // Avoid recreating masked context unless unmasked context has changed. + // Failing to do this will result in unnecessary calls to componentWillReceiveProps. + // This may trigger infinite loops if componentWillReceiveProps calls setState. + + var instance = workInProgress.stateNode; + if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) { + return instance.__reactInternalMemoizedMaskedChildContext; + } + var context = {}; + for (var key in contextTypes) { + context[key] = unmaskedContext[key]; + } + { + var name = getComponentNameFromFiber(workInProgress) || "Unknown"; + checkPropTypes(contextTypes, context, "context", name); + } // Cache unmasked context so we can avoid recreating masked context unless necessary. + // Context is created before the class component is instantiated so check for instance. + + if (instance) { + cacheContext(workInProgress, unmaskedContext, context); + } + return context; + } + } + function hasContextChanged() { + { + return didPerformWorkStackCursor.current; + } + } + function isContextProvider(type) { + { + var childContextTypes = type.childContextTypes; + return childContextTypes !== null && childContextTypes !== undefined; + } + } + function popContext(fiber) { + { + pop(didPerformWorkStackCursor, fiber); + pop(contextStackCursor, fiber); + } + } + function popTopLevelContextObject(fiber) { + { + pop(didPerformWorkStackCursor, fiber); + pop(contextStackCursor, fiber); + } + } + function pushTopLevelContextObject(fiber, context, didChange) { + { + if (contextStackCursor.current !== emptyContextObject) { + throw new Error("Unexpected context found on stack. " + "This error is likely caused by a bug in React. Please file an issue."); + } + push(contextStackCursor, context, fiber); + push(didPerformWorkStackCursor, didChange, fiber); + } + } + function processChildContext(fiber, type, parentContext) { + { + var instance = fiber.stateNode; + var childContextTypes = type.childContextTypes; // TODO (bvaughn) Replace this behavior with an invariant() in the future. + // It has only been added in Fiber to match the (unintentional) behavior in Stack. + + if (typeof instance.getChildContext !== "function") { + { + var componentName = getComponentNameFromFiber(fiber) || "Unknown"; + if (!warnedAboutMissingGetChildContext[componentName]) { + warnedAboutMissingGetChildContext[componentName] = true; + error("%s.childContextTypes is specified but there is no getChildContext() method " + "on the instance. You can either define getChildContext() on %s or remove " + "childContextTypes from it.", componentName, componentName); + } + } + return parentContext; + } + var childContext = instance.getChildContext(); + for (var contextKey in childContext) { + if (!(contextKey in childContextTypes)) { + throw new Error((getComponentNameFromFiber(fiber) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.'); + } + } + { + var name = getComponentNameFromFiber(fiber) || "Unknown"; + checkPropTypes(childContextTypes, childContext, "child context", name); + } + return assign({}, parentContext, childContext); + } + } + function pushContextProvider(workInProgress) { + { + var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity. + // If the instance does not exist yet, we will push null at first, + // and replace it on the stack later when invalidating the context. + + var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later. + // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates. + + previousContext = contextStackCursor.current; + push(contextStackCursor, memoizedMergedChildContext, workInProgress); + push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress); + return true; + } + } + function invalidateContextProvider(workInProgress, type, didChange) { + { + var instance = workInProgress.stateNode; + if (!instance) { + throw new Error("Expected to have an instance by this point. " + "This error is likely caused by a bug in React. Please file an issue."); + } + if (didChange) { + // Merge parent and own context. + // Skip this if we're not updating due to sCU. + // This avoids unnecessarily recomputing memoized values. + var mergedContext = processChildContext(workInProgress, type, previousContext); + instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one. + // It is important to unwind the context in the reverse order. + + pop(didPerformWorkStackCursor, workInProgress); + pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed. + + push(contextStackCursor, mergedContext, workInProgress); + push(didPerformWorkStackCursor, didChange, workInProgress); + } else { + pop(didPerformWorkStackCursor, workInProgress); + push(didPerformWorkStackCursor, didChange, workInProgress); + } + } + } + function findCurrentUnmaskedContext(fiber) { + { + // Currently this is only used with renderSubtreeIntoContainer; not sure if it + // makes sense elsewhere + if (!isFiberMounted(fiber) || fiber.tag !== ClassComponent) { + throw new 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 node = fiber; + do { + switch (node.tag) { + case HostRoot: + return node.stateNode.context; + case ClassComponent: + { + var Component = node.type; + if (isContextProvider(Component)) { + return node.stateNode.__reactInternalMemoizedMergedChildContext; + } + break; + } + } + node = node.return; + } while (node !== null); + throw new Error("Found unexpected detached subtree parent. " + "This error is likely caused by a bug in React. Please file an issue."); + } + } + var LegacyRoot = 0; + var ConcurrentRoot = 1; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + function is(x, y) { + return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare + ; + } + var objectIs = typeof Object.is === "function" ? Object.is : is; + var syncQueue = null; + var includesLegacySyncCallbacks = false; + var isFlushingSyncQueue = false; + function scheduleSyncCallback(callback) { + // Push this callback into an internal queue. We'll flush these either in + // the next tick, or earlier if something calls `flushSyncCallbackQueue`. + if (syncQueue === null) { + syncQueue = [callback]; + } else { + // Push onto existing queue. Don't need to schedule a callback because + // we already scheduled one when we created the queue. + syncQueue.push(callback); + } + } + function scheduleLegacySyncCallback(callback) { + includesLegacySyncCallbacks = true; + scheduleSyncCallback(callback); + } + function flushSyncCallbacksOnlyInLegacyMode() { + // Only flushes the queue if there's a legacy sync callback scheduled. + // TODO: There's only a single type of callback: performSyncOnWorkOnRoot. So + // it might make more sense for the queue to be a list of roots instead of a + // list of generic callbacks. Then we can have two: one for legacy roots, one + // for concurrent roots. And this method would only flush the legacy ones. + if (includesLegacySyncCallbacks) { + flushSyncCallbacks(); + } + } + function flushSyncCallbacks() { + if (!isFlushingSyncQueue && syncQueue !== null) { + // Prevent re-entrance. + isFlushingSyncQueue = true; + var i = 0; + var previousUpdatePriority = getCurrentUpdatePriority(); + try { + var isSync = true; + var queue = syncQueue; // TODO: Is this necessary anymore? The only user code that runs in this + // queue is in the render or commit phases. + + setCurrentUpdatePriority(DiscreteEventPriority); + for (; i < queue.length; i++) { + var callback = queue[i]; + do { + callback = callback(isSync); + } while (callback !== null); + } + syncQueue = null; + includesLegacySyncCallbacks = false; + } catch (error) { + // If something throws, leave the remaining callbacks on the queue. + if (syncQueue !== null) { + syncQueue = syncQueue.slice(i + 1); + } // Resume flushing in the next tick + + scheduleCallback(ImmediatePriority, flushSyncCallbacks); + throw error; + } finally { + setCurrentUpdatePriority(previousUpdatePriority); + isFlushingSyncQueue = false; + } + } + return null; + } + + // This is imported by the event replaying implementation in React DOM. It's + // in a separate file to break a circular dependency between the renderer and + // the reconciler. + function isRootDehydrated(root) { + var currentState = root.current.memoizedState; + return currentState.isDehydrated; + } + + // TODO: Use the unified fiber stack module instead of this local one? + // Intentionally not using it yet to derisk the initial implementation, because + // the way we push/pop these values is a bit unusual. If there's a mistake, I'd + // rather the ids be wrong than crash the whole reconciler. + var forkStack = []; + var forkStackIndex = 0; + var treeForkProvider = null; + var treeForkCount = 0; + var idStack = []; + var idStackIndex = 0; + var treeContextProvider = null; + var treeContextId = 1; + var treeContextOverflow = ""; + function popTreeContext(workInProgress) { + // Restore the previous values. + // This is a bit more complicated than other context-like modules in Fiber + // because the same Fiber may appear on the stack multiple times and for + // different reasons. We have to keep popping until the work-in-progress is + // no longer at the top of the stack. + while (workInProgress === treeForkProvider) { + treeForkProvider = forkStack[--forkStackIndex]; + forkStack[forkStackIndex] = null; + treeForkCount = forkStack[--forkStackIndex]; + forkStack[forkStackIndex] = null; + } + while (workInProgress === treeContextProvider) { + treeContextProvider = idStack[--idStackIndex]; + idStack[idStackIndex] = null; + treeContextOverflow = idStack[--idStackIndex]; + idStack[idStackIndex] = null; + treeContextId = idStack[--idStackIndex]; + idStack[idStackIndex] = null; + } + } + var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches + // due to earlier mismatches or a suspended fiber. + + var didSuspendOrErrorDEV = false; // Hydration errors that were thrown inside this boundary + + var hydrationErrors = null; + function didSuspendOrErrorWhileHydratingDEV() { + { + return didSuspendOrErrorDEV; + } + } + function reenterHydrationStateFromDehydratedSuspenseInstance(fiber, suspenseInstance, treeContext) { + { + return false; + } + } + function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) { + { + throw new Error("Expected prepareToHydrateHostInstance() to never be called. " + "This error is likely caused by a bug in React. Please file an issue."); + } + } + function prepareToHydrateHostTextInstance(fiber) { + { + throw new Error("Expected prepareToHydrateHostTextInstance() to never be called. " + "This error is likely caused by a bug in React. Please file an issue."); + } + var shouldUpdate = hydrateTextInstance(); + } + function prepareToHydrateHostSuspenseInstance(fiber) { + { + throw new Error("Expected prepareToHydrateHostSuspenseInstance() to never be called. " + "This error is likely caused by a bug in React. Please file an issue."); + } + } + function popHydrationState(fiber) { + { + return false; + } + } + function upgradeHydrationErrorsToRecoverable() { + if (hydrationErrors !== null) { + // Successfully completed a forced client render. The errors that occurred + // during the hydration attempt are now recovered. We will log them in + // commit phase, once the entire tree has finished. + queueRecoverableErrors(hydrationErrors); + hydrationErrors = null; + } + } + function getIsHydrating() { + return isHydrating; + } + function queueHydrationError(error) { + if (hydrationErrors === null) { + hydrationErrors = [error]; + } else { + hydrationErrors.push(error); + } + } + var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; + var NoTransition = null; + function requestCurrentTransition() { + return ReactCurrentBatchConfig.transition; + } + + /** + * Performs equality by iterating through keys on an object and returning false + * when any key has values which are not strictly equal between the arguments. + * Returns true when the values of all keys are strictly equal. + */ + + function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) { + return true; + } + if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { + return false; + } + var keysA = Object.keys(objA); + var keysB = Object.keys(objB); + if (keysA.length !== keysB.length) { + return false; + } // Test for A's keys different from B. + + for (var i = 0; i < keysA.length; i++) { + var currentKey = keysA[i]; + if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey])) { + return false; + } + } + return true; + } + function describeFiber(fiber) { + var owner = fiber._debugOwner ? fiber._debugOwner.type : null; + var source = fiber._debugSource; + switch (fiber.tag) { + case HostComponent: + return describeBuiltInComponentFrame(fiber.type, source, owner); + case LazyComponent: + return describeBuiltInComponentFrame("Lazy", source, owner); + case SuspenseComponent: + return describeBuiltInComponentFrame("Suspense", source, owner); + case SuspenseListComponent: + return describeBuiltInComponentFrame("SuspenseList", source, owner); + case FunctionComponent: + case IndeterminateComponent: + case SimpleMemoComponent: + return describeFunctionComponentFrame(fiber.type, source, owner); + case ForwardRef: + return describeFunctionComponentFrame(fiber.type.render, source, owner); + case ClassComponent: + return describeClassComponentFrame(fiber.type, source, owner); + default: + return ""; + } + } + function getStackByFiberInDevAndProd(workInProgress) { + try { + var info = ""; + var node = workInProgress; + do { + info += describeFiber(node); + node = node.return; + } while (node); + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } + } + var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + var current = null; + var isRendering = false; + function getCurrentFiberOwnerNameInDevOrNull() { + { + if (current === null) { + return null; + } + var owner = current._debugOwner; + if (owner !== null && typeof owner !== "undefined") { + return getComponentNameFromFiber(owner); + } + } + return null; + } + function getCurrentFiberStackInDev() { + { + if (current === null) { + return ""; + } // Safe because if current fiber exists, we are reconciling, + // and it is guaranteed to be the work-in-progress version. + + return getStackByFiberInDevAndProd(current); + } + } + function resetCurrentFiber() { + { + ReactDebugCurrentFrame$1.getCurrentStack = null; + current = null; + isRendering = false; + } + } + function setCurrentFiber(fiber) { + { + ReactDebugCurrentFrame$1.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev; + current = fiber; + isRendering = false; + } + } + function getCurrentFiber() { + { + return current; + } + } + function setIsRendering(rendering) { + { + isRendering = rendering; + } + } + var ReactStrictModeWarnings = { + recordUnsafeLifecycleWarnings: function recordUnsafeLifecycleWarnings(fiber, instance) {}, + flushPendingUnsafeLifecycleWarnings: function flushPendingUnsafeLifecycleWarnings() {}, + recordLegacyContextWarning: function recordLegacyContextWarning(fiber, instance) {}, + flushLegacyContextWarning: function flushLegacyContextWarning() {}, + discardPendingWarnings: function discardPendingWarnings() {} + }; + { + var findStrictRoot = function findStrictRoot(fiber) { + var maybeStrictRoot = null; + var node = fiber; + while (node !== null) { + if (node.mode & StrictLegacyMode) { + maybeStrictRoot = node; + } + node = node.return; + } + return maybeStrictRoot; + }; + var setToSortedString = function setToSortedString(set) { + var array = []; + set.forEach(function (value) { + array.push(value); + }); + return array.sort().join(", "); + }; + var pendingComponentWillMountWarnings = []; + var pendingUNSAFE_ComponentWillMountWarnings = []; + var pendingComponentWillReceivePropsWarnings = []; + var pendingUNSAFE_ComponentWillReceivePropsWarnings = []; + var pendingComponentWillUpdateWarnings = []; + var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about. + + var didWarnAboutUnsafeLifecycles = new Set(); + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) { + // Dedupe strategy: Warn once per component. + if (didWarnAboutUnsafeLifecycles.has(fiber.type)) { + return; + } + if (typeof instance.componentWillMount === "function" && + // Don't warn about react-lifecycles-compat polyfilled components. + instance.componentWillMount.__suppressDeprecationWarning !== true) { + pendingComponentWillMountWarnings.push(fiber); + } + if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillMount === "function") { + pendingUNSAFE_ComponentWillMountWarnings.push(fiber); + } + if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { + pendingComponentWillReceivePropsWarnings.push(fiber); + } + if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillReceiveProps === "function") { + pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber); + } + if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { + pendingComponentWillUpdateWarnings.push(fiber); + } + if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillUpdate === "function") { + pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber); + } + }; + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () { + // We do an initial pass to gather component names + var componentWillMountUniqueNames = new Set(); + if (pendingComponentWillMountWarnings.length > 0) { + pendingComponentWillMountWarnings.forEach(function (fiber) { + componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingComponentWillMountWarnings = []; + } + var UNSAFE_componentWillMountUniqueNames = new Set(); + if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) { + pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) { + UNSAFE_componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingUNSAFE_ComponentWillMountWarnings = []; + } + var componentWillReceivePropsUniqueNames = new Set(); + if (pendingComponentWillReceivePropsWarnings.length > 0) { + pendingComponentWillReceivePropsWarnings.forEach(function (fiber) { + componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingComponentWillReceivePropsWarnings = []; + } + var UNSAFE_componentWillReceivePropsUniqueNames = new Set(); + if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) { + pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) { + UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingUNSAFE_ComponentWillReceivePropsWarnings = []; + } + var componentWillUpdateUniqueNames = new Set(); + if (pendingComponentWillUpdateWarnings.length > 0) { + pendingComponentWillUpdateWarnings.forEach(function (fiber) { + componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingComponentWillUpdateWarnings = []; + } + var UNSAFE_componentWillUpdateUniqueNames = new Set(); + if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) { + pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) { + UNSAFE_componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingUNSAFE_ComponentWillUpdateWarnings = []; + } // Finally, we flush all the warnings + // UNSAFE_ ones before the deprecated ones, since they'll be 'louder' + + if (UNSAFE_componentWillMountUniqueNames.size > 0) { + var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames); + error("Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. " + "See https://react.dev/link/unsafe-component-lifecycles for details.\n\n" + "* Move code with side effects to componentDidMount, and set initial state in the constructor.\n" + "\nPlease update the following components: %s", sortedNames); + } + if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) { + var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames); + error("Using UNSAFE_componentWillReceiveProps in strict mode is not recommended " + "and may indicate bugs in your code. " + "See https://react.dev/link/unsafe-component-lifecycles for details.\n\n" + "* Move data fetching code or side effects to componentDidUpdate.\n" + "* If you're updating state whenever props change, " + "refactor your code to use memoization techniques or move it to " + "static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state\n" + "\nPlease update the following components: %s", _sortedNames); + } + if (UNSAFE_componentWillUpdateUniqueNames.size > 0) { + var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames); + error("Using UNSAFE_componentWillUpdate in strict mode is not recommended " + "and may indicate bugs in your code. " + "See https://react.dev/link/unsafe-component-lifecycles for details.\n\n" + "* Move data fetching code or side effects to componentDidUpdate.\n" + "\nPlease update the following components: %s", _sortedNames2); + } + if (componentWillMountUniqueNames.size > 0) { + var _sortedNames3 = setToSortedString(componentWillMountUniqueNames); + warn("componentWillMount has been renamed, and is not recommended for use. " + "See https://react.dev/link/unsafe-component-lifecycles for details.\n\n" + "* Move code with side effects to componentDidMount, and set initial state in the constructor.\n" + "* Rename componentWillMount to UNSAFE_componentWillMount to suppress " + "this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. " + "To rename all deprecated lifecycles to their new names, you can run " + "`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n" + "\nPlease update the following components: %s", _sortedNames3); + } + if (componentWillReceivePropsUniqueNames.size > 0) { + var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames); + warn("componentWillReceiveProps has been renamed, and is not recommended for use. " + "See https://react.dev/link/unsafe-component-lifecycles for details.\n\n" + "* Move data fetching code or side effects to componentDidUpdate.\n" + "* If you're updating state whenever props change, refactor your " + "code to use memoization techniques or move it to " + "static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state\n" + "* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress " + "this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. " + "To rename all deprecated lifecycles to their new names, you can run " + "`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n" + "\nPlease update the following components: %s", _sortedNames4); + } + if (componentWillUpdateUniqueNames.size > 0) { + var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames); + warn("componentWillUpdate has been renamed, and is not recommended for use. " + "See https://react.dev/link/unsafe-component-lifecycles for details.\n\n" + "* Move data fetching code or side effects to componentDidUpdate.\n" + "* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress " + "this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. " + "To rename all deprecated lifecycles to their new names, you can run " + "`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n" + "\nPlease update the following components: %s", _sortedNames5); + } + }; + var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about. + + var didWarnAboutLegacyContext = new Set(); + ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) { + var strictRoot = findStrictRoot(fiber); + if (strictRoot === null) { + error("Expected to find a StrictMode component in a strict mode tree. " + "This error is likely caused by a bug in React. Please file an issue."); + return; + } // Dedup strategy: Warn once per component. + + if (didWarnAboutLegacyContext.has(fiber.type)) { + return; + } + var warningsForRoot = pendingLegacyContextWarning.get(strictRoot); + if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === "function") { + if (warningsForRoot === undefined) { + warningsForRoot = []; + pendingLegacyContextWarning.set(strictRoot, warningsForRoot); + } + warningsForRoot.push(fiber); + } + }; + ReactStrictModeWarnings.flushLegacyContextWarning = function () { + pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) { + if (fiberArray.length === 0) { + return; + } + var firstFiber = fiberArray[0]; + var uniqueNames = new Set(); + fiberArray.forEach(function (fiber) { + uniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); + didWarnAboutLegacyContext.add(fiber.type); + }); + var sortedNames = setToSortedString(uniqueNames); + try { + setCurrentFiber(firstFiber); + error("Legacy context API has been detected within a strict-mode tree." + "\n\nThe old API will be supported in all 16.x releases, but applications " + "using it should migrate to the new version." + "\n\nPlease update the following components: %s" + "\n\nLearn more about this warning here: https://react.dev/link/legacy-context", sortedNames); + } finally { + resetCurrentFiber(); + } + }); + }; + ReactStrictModeWarnings.discardPendingWarnings = function () { + pendingComponentWillMountWarnings = []; + pendingUNSAFE_ComponentWillMountWarnings = []; + pendingComponentWillReceivePropsWarnings = []; + pendingUNSAFE_ComponentWillReceivePropsWarnings = []; + pendingComponentWillUpdateWarnings = []; + pendingUNSAFE_ComponentWillUpdateWarnings = []; + pendingLegacyContextWarning = new Map(); + }; + } + + /* + * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol + * and Temporal.* types. See https://github.com/facebook/react/pull/22064. + * + * The functions in this module will throw an easier-to-understand, + * easier-to-debug exception with a clear errors message message explaining the + * problem. (Instead of a confusing exception thrown inside the implementation + * of the `value` object). + */ + // $FlowFixMe only called in DEV, so void return is not possible. + function typeName(value) { + { + // toStringTag is needed for namespaced types like Temporal.Instant + var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; + var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; + return type; + } + } // $FlowFixMe only called in DEV, so void return is not possible. + + function willCoercionThrow(value) { + { + try { + testStringCoercion(value); + return false; + } catch (e) { + return true; + } + } + } + function testStringCoercion(value) { + // If you ended up here by following an exception call stack, here's what's + // happened: you supplied an object or symbol value to React (as a prop, key, + // DOM attribute, CSS property, string ref, etc.) and when React tried to + // coerce it to a string using `'' + value`, an exception was thrown. + // + // The most common types that will cause this exception are `Symbol` instances + // and Temporal objects like `Temporal.Instant`. But any object that has a + // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this + // exception. (Library authors do this to prevent users from using built-in + // numeric operators like `+` or comparison operators like `>=` because custom + // methods are needed to perform accurate arithmetic or comparison.) + // + // To fix the problem, coerce this object or symbol value to a string before + // passing it to React. The most reliable way is usually `String(value)`. + // + // To find which value is throwing, check the browser or debugger console. + // Before this exception was thrown, there should be `console.error` output + // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the + // problem and how that type was used: key, atrribute, input value prop, etc. + // In most cases, this console output also shows the component and its + // ancestor components where the exception happened. + // + // eslint-disable-next-line react-internal/safe-string-coercion + return "" + value; + } + function checkKeyStringCoercion(value) { + { + if (willCoercionThrow(value)) { + error("The provided key is an unsupported type %s." + " This value must be coerced to a string before before using it here.", typeName(value)); + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + function checkPropStringCoercion(value, propName) { + { + if (willCoercionThrow(value)) { + error("The provided `%s` prop is an unsupported type %s." + " This value must be coerced to a string before before using it here.", propName, typeName(value)); + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + function resolveDefaultProps(Component, baseProps) { + if (Component && Component.defaultProps) { + // Resolve default props. Taken from ReactElement + var props = assign({}, baseProps); + var defaultProps = Component.defaultProps; + for (var propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + return props; + } + return baseProps; + } + var valueCursor = createCursor(null); + var rendererSigil; + { + // Use this to detect multiple renderers using the same context + rendererSigil = {}; + } + var currentlyRenderingFiber = null; + var lastContextDependency = null; + var lastFullyObservedContext = null; + var isDisallowedContextReadInDEV = false; + function resetContextDependencies() { + // This is called right before React yields execution, to ensure `readContext` + // cannot be called outside the render phase. + currentlyRenderingFiber = null; + lastContextDependency = null; + lastFullyObservedContext = null; + { + isDisallowedContextReadInDEV = false; + } + } + function enterDisallowedContextReadInDEV() { + { + isDisallowedContextReadInDEV = true; + } + } + function exitDisallowedContextReadInDEV() { + { + isDisallowedContextReadInDEV = false; + } + } + function pushProvider(providerFiber, context, nextValue) { + { + push(valueCursor, context._currentValue, providerFiber); + context._currentValue = nextValue; + { + if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) { + error("Detected multiple renderers concurrently rendering the " + "same context provider. This is currently unsupported."); + } + context._currentRenderer = rendererSigil; + } + } + } + function popProvider(context, providerFiber) { + var currentValue = valueCursor.current; + pop(valueCursor, providerFiber); + { + { + context._currentValue = currentValue; + } + } + } + function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { + // Update the child lanes of all the ancestors, including the alternates. + var node = parent; + while (node !== null) { + var alternate = node.alternate; + if (!isSubsetOfLanes(node.childLanes, renderLanes)) { + node.childLanes = mergeLanes(node.childLanes, renderLanes); + if (alternate !== null) { + alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes); + } + } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes)) { + alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes); + } + if (node === propagationRoot) { + break; + } + node = node.return; + } + { + if (node !== propagationRoot) { + error("Expected to find the propagation root when scheduling context work. " + "This error is likely caused by a bug in React. Please file an issue."); + } + } + } + function propagateContextChange(workInProgress, context, renderLanes) { + { + propagateContextChange_eager(workInProgress, context, renderLanes); + } + } + function propagateContextChange_eager(workInProgress, context, renderLanes) { + var fiber = workInProgress.child; + if (fiber !== null) { + // Set the return pointer of the child to the work-in-progress fiber. + fiber.return = workInProgress; + } + while (fiber !== null) { + var nextFiber = void 0; // Visit this fiber. + + var list = fiber.dependencies; + if (list !== null) { + nextFiber = fiber.child; + var dependency = list.firstContext; + while (dependency !== null) { + // Check if the context matches. + if (dependency.context === context) { + // Match! Schedule an update on this fiber. + if (fiber.tag === ClassComponent) { + // Schedule a force update on the work-in-progress. + var lane = pickArbitraryLane(renderLanes); + var update = createUpdate(NoTimestamp, lane); + update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the + // update to the current fiber, too, which means it will persist even if + // this render is thrown away. Since it's a race condition, not sure it's + // worth fixing. + // Inlined `enqueueUpdate` to remove interleaved update check + + var updateQueue = fiber.updateQueue; + if (updateQueue === null) ;else { + var sharedQueue = updateQueue.shared; + var pending = sharedQueue.pending; + if (pending === null) { + // This is the first update. Create a circular list. + update.next = update; + } else { + update.next = pending.next; + pending.next = update; + } + sharedQueue.pending = update; + } + } + fiber.lanes = mergeLanes(fiber.lanes, renderLanes); + var alternate = fiber.alternate; + if (alternate !== null) { + alternate.lanes = mergeLanes(alternate.lanes, renderLanes); + } + scheduleContextWorkOnParentPath(fiber.return, renderLanes, workInProgress); // Mark the updated lanes on the list, too. + + list.lanes = mergeLanes(list.lanes, renderLanes); // Since we already found a match, we can stop traversing the + // dependency list. + + break; + } + dependency = dependency.next; + } + } else if (fiber.tag === ContextProvider) { + // Don't scan deeper if this is a matching provider + nextFiber = fiber.type === workInProgress.type ? null : fiber.child; + } else if (fiber.tag === DehydratedFragment) { + // If a dehydrated suspense boundary is in this subtree, we don't know + // if it will have any context consumers in it. The best we can do is + // mark it as having updates. + var parentSuspense = fiber.return; + if (parentSuspense === null) { + throw new Error("We just came from a parent so we must have had a parent. This is a bug in React."); + } + parentSuspense.lanes = mergeLanes(parentSuspense.lanes, renderLanes); + var _alternate = parentSuspense.alternate; + if (_alternate !== null) { + _alternate.lanes = mergeLanes(_alternate.lanes, renderLanes); + } // This is intentionally passing this fiber as the parent + // because we want to schedule this fiber as having work + // on its children. We'll use the childLanes on + // this fiber to indicate that a context has changed. + + scheduleContextWorkOnParentPath(parentSuspense, renderLanes, workInProgress); + nextFiber = fiber.sibling; + } else { + // Traverse down. + nextFiber = fiber.child; + } + if (nextFiber !== null) { + // Set the return pointer of the child to the work-in-progress fiber. + nextFiber.return = fiber; + } else { + // No child. Traverse to next sibling. + nextFiber = fiber; + while (nextFiber !== null) { + if (nextFiber === workInProgress) { + // We're back to the root of this subtree. Exit. + nextFiber = null; + break; + } + var sibling = nextFiber.sibling; + if (sibling !== null) { + // Set the return pointer of the sibling to the work-in-progress fiber. + sibling.return = nextFiber.return; + nextFiber = sibling; + break; + } // No more siblings. Traverse up. + + nextFiber = nextFiber.return; + } + } + fiber = nextFiber; + } + } + function prepareToReadContext(workInProgress, renderLanes) { + currentlyRenderingFiber = workInProgress; + lastContextDependency = null; + lastFullyObservedContext = null; + var dependencies = workInProgress.dependencies; + if (dependencies !== null) { + { + var firstContext = dependencies.firstContext; + if (firstContext !== null) { + if (includesSomeLane(dependencies.lanes, renderLanes)) { + // Context list has a pending update. Mark that this fiber performed work. + markWorkInProgressReceivedUpdate(); + } // Reset the work-in-progress list + + dependencies.firstContext = null; + } + } + } + } + function _readContext(context) { + { + // This warning would fire if you read context inside a Hook like useMemo. + // Unlike the class check below, it's not enforced in production for perf. + if (isDisallowedContextReadInDEV) { + 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()."); + } + } + var value = context._currentValue; + if (lastFullyObservedContext === context) ;else { + var contextItem = { + context: context, + memoizedValue: value, + next: null + }; + if (lastContextDependency === null) { + if (currentlyRenderingFiber === null) { + throw new 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()."); + } // This is the first dependency for this component. Create a new list. + + lastContextDependency = contextItem; + currentlyRenderingFiber.dependencies = { + lanes: NoLanes, + firstContext: contextItem + }; + } else { + // Append a new context item. + lastContextDependency = lastContextDependency.next = contextItem; + } + } + return value; + } + + // render. When this render exits, either because it finishes or because it is + // interrupted, the interleaved updates will be transferred onto the main part + // of the queue. + + var concurrentQueues = null; + function pushConcurrentUpdateQueue(queue) { + if (concurrentQueues === null) { + concurrentQueues = [queue]; + } else { + concurrentQueues.push(queue); + } + } + function finishQueueingConcurrentUpdates() { + // Transfer the interleaved updates onto the main queue. Each queue has a + // `pending` field and an `interleaved` field. When they are not null, they + // point to the last node in a circular linked list. We need to append the + // interleaved list to the end of the pending list by joining them into a + // single, circular list. + if (concurrentQueues !== null) { + for (var i = 0; i < concurrentQueues.length; i++) { + var queue = concurrentQueues[i]; + var lastInterleavedUpdate = queue.interleaved; + if (lastInterleavedUpdate !== null) { + queue.interleaved = null; + var firstInterleavedUpdate = lastInterleavedUpdate.next; + var lastPendingUpdate = queue.pending; + if (lastPendingUpdate !== null) { + var firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = firstInterleavedUpdate; + lastInterleavedUpdate.next = firstPendingUpdate; + } + queue.pending = lastInterleavedUpdate; + } + } + concurrentQueues = null; + } + } + function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { + var interleaved = queue.interleaved; + if (interleaved === null) { + // This is the first update. Create a circular list. + update.next = update; // At the end of the current render, this queue's interleaved updates will + // be transferred to the pending queue. + + pushConcurrentUpdateQueue(queue); + } else { + update.next = interleaved.next; + interleaved.next = update; + } + queue.interleaved = update; + return markUpdateLaneFromFiberToRoot(fiber, lane); + } + function enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane) { + var interleaved = queue.interleaved; + if (interleaved === null) { + // This is the first update. Create a circular list. + update.next = update; // At the end of the current render, this queue's interleaved updates will + // be transferred to the pending queue. + + pushConcurrentUpdateQueue(queue); + } else { + update.next = interleaved.next; + interleaved.next = update; + } + queue.interleaved = update; + } + function enqueueConcurrentClassUpdate(fiber, queue, update, lane) { + var interleaved = queue.interleaved; + if (interleaved === null) { + // This is the first update. Create a circular list. + update.next = update; // At the end of the current render, this queue's interleaved updates will + // be transferred to the pending queue. + + pushConcurrentUpdateQueue(queue); + } else { + update.next = interleaved.next; + interleaved.next = update; + } + queue.interleaved = update; + return markUpdateLaneFromFiberToRoot(fiber, lane); + } + function enqueueConcurrentRenderForLane(fiber, lane) { + return markUpdateLaneFromFiberToRoot(fiber, lane); + } // Calling this function outside this module should only be done for backwards + // compatibility and should always be accompanied by a warning. + + var unsafe_markUpdateLaneFromFiberToRoot = markUpdateLaneFromFiberToRoot; + function markUpdateLaneFromFiberToRoot(sourceFiber, lane) { + // Update the source fiber's lanes + sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane); + var alternate = sourceFiber.alternate; + if (alternate !== null) { + alternate.lanes = mergeLanes(alternate.lanes, lane); + } + { + if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) { + warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); + } + } // Walk the parent path to the root and update the child lanes. + + var node = sourceFiber; + var parent = sourceFiber.return; + while (parent !== null) { + parent.childLanes = mergeLanes(parent.childLanes, lane); + alternate = parent.alternate; + if (alternate !== null) { + alternate.childLanes = mergeLanes(alternate.childLanes, lane); + } else { + { + if ((parent.flags & (Placement | Hydrating)) !== NoFlags) { + warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); + } + } + } + node = parent; + parent = parent.return; + } + if (node.tag === HostRoot) { + var root = node.stateNode; + return root; + } else { + return null; + } + } + var UpdateState = 0; + var ReplaceState = 1; + var ForceUpdate = 2; + var CaptureUpdate = 3; // Global state that is reset at the beginning of calling `processUpdateQueue`. + // It should only be read right after calling `processUpdateQueue`, via + // `checkHasForceUpdateAfterProcessing`. + + var hasForceUpdate = false; + var didWarnUpdateInsideUpdate; + var currentlyProcessingQueue; + { + didWarnUpdateInsideUpdate = false; + currentlyProcessingQueue = null; + } + function initializeUpdateQueue(fiber) { + var queue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { + pending: null, + interleaved: null, + lanes: NoLanes + }, + effects: null + }; + fiber.updateQueue = queue; + } + function cloneUpdateQueue(current, workInProgress) { + // Clone the update queue from current. Unless it's already a clone. + var queue = workInProgress.updateQueue; + var currentQueue = current.updateQueue; + if (queue === currentQueue) { + var clone = { + baseState: currentQueue.baseState, + firstBaseUpdate: currentQueue.firstBaseUpdate, + lastBaseUpdate: currentQueue.lastBaseUpdate, + shared: currentQueue.shared, + effects: currentQueue.effects + }; + workInProgress.updateQueue = clone; + } + } + function createUpdate(eventTime, lane) { + var update = { + eventTime: eventTime, + lane: lane, + tag: UpdateState, + payload: null, + callback: null, + next: null + }; + return update; + } + function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (updateQueue === null) { + // Only occurs if the fiber has been unmounted. + return null; + } + var sharedQueue = updateQueue.shared; + { + if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) { + error("An update (setState, replaceState, or forceUpdate) was scheduled " + "from inside an update function. Update functions should be pure, " + "with zero side-effects. Consider using componentDidUpdate or a " + "callback."); + didWarnUpdateInsideUpdate = true; + } + } + if (isUnsafeClassRenderPhaseUpdate()) { + // This is an unsafe render phase update. Add directly to the update + // queue so we can process it immediately during the current render. + var pending = sharedQueue.pending; + if (pending === null) { + // This is the first update. Create a circular list. + update.next = update; + } else { + update.next = pending.next; + pending.next = update; + } + sharedQueue.pending = update; // Update the childLanes even though we're most likely already rendering + // this fiber. This is for backwards compatibility in the case where you + // update a different component during render phase than the one that is + // currently renderings (a pattern that is accompanied by a warning). + + return unsafe_markUpdateLaneFromFiberToRoot(fiber, lane); + } else { + return enqueueConcurrentClassUpdate(fiber, sharedQueue, update, lane); + } + } + function entangleTransitions(root, fiber, lane) { + var updateQueue = fiber.updateQueue; + if (updateQueue === null) { + // Only occurs if the fiber has been unmounted. + return; + } + var sharedQueue = updateQueue.shared; + if (isTransitionLane(lane)) { + var queueLanes = sharedQueue.lanes; // If any entangled lanes are no longer pending on the root, then they must + // have finished. We can remove them from the shared queue, which represents + // a superset of the actually pending lanes. In some cases we may entangle + // more than we need to, but that's OK. In fact it's worse if we *don't* + // entangle when we should. + + queueLanes = intersectLanes(queueLanes, root.pendingLanes); // Entangle the new transition lane with the other transition lanes. + + var newQueueLanes = mergeLanes(queueLanes, lane); + sharedQueue.lanes = newQueueLanes; // Even if queue.lanes already include lane, we don't know for certain if + // the lane finished since the last time we entangled it. So we need to + // entangle it again, just to be sure. + + markRootEntangled(root, newQueueLanes); + } + } + function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + // Captured updates are updates that are thrown by a child during the render + // phase. They should be discarded if the render is aborted. Therefore, + // we should only put them on the work-in-progress queue, not the current one. + var queue = workInProgress.updateQueue; // Check if the work-in-progress queue is a clone. + + var current = workInProgress.alternate; + if (current !== null) { + var currentQueue = current.updateQueue; + if (queue === currentQueue) { + // The work-in-progress queue is the same as current. This happens when + // we bail out on a parent fiber that then captures an error thrown by + // a child. Since we want to append the update only to the work-in + // -progress queue, we need to clone the updates. We usually clone during + // processUpdateQueue, but that didn't happen in this case because we + // skipped over the parent when we bailed out. + var newFirst = null; + var newLast = null; + var firstBaseUpdate = queue.firstBaseUpdate; + if (firstBaseUpdate !== null) { + // Loop through the updates and clone them. + var update = firstBaseUpdate; + do { + var clone = { + eventTime: update.eventTime, + lane: update.lane, + tag: update.tag, + payload: update.payload, + callback: update.callback, + next: null + }; + if (newLast === null) { + newFirst = newLast = clone; + } else { + newLast.next = clone; + newLast = clone; + } + update = update.next; + } while (update !== null); // Append the captured update the end of the cloned list. + + if (newLast === null) { + newFirst = newLast = capturedUpdate; + } else { + newLast.next = capturedUpdate; + newLast = capturedUpdate; + } + } else { + // There are no base updates. + newFirst = newLast = capturedUpdate; + } + queue = { + baseState: currentQueue.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: currentQueue.shared, + effects: currentQueue.effects + }; + workInProgress.updateQueue = queue; + return; + } + } // Append the update to the end of the list. + + var lastBaseUpdate = queue.lastBaseUpdate; + if (lastBaseUpdate === null) { + queue.firstBaseUpdate = capturedUpdate; + } else { + lastBaseUpdate.next = capturedUpdate; + } + queue.lastBaseUpdate = capturedUpdate; + } + function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) { + switch (update.tag) { + case ReplaceState: + { + var payload = update.payload; + if (typeof payload === "function") { + // Updater function + { + enterDisallowedContextReadInDEV(); + } + var nextState = payload.call(instance, prevState, nextProps); + { + exitDisallowedContextReadInDEV(); + } + return nextState; + } // State object + + return payload; + } + case CaptureUpdate: + { + workInProgress.flags = workInProgress.flags & ~ShouldCapture | DidCapture; + } + // Intentional fallthrough + + case UpdateState: + { + var _payload = update.payload; + var partialState; + if (typeof _payload === "function") { + // Updater function + { + enterDisallowedContextReadInDEV(); + } + partialState = _payload.call(instance, prevState, nextProps); + { + exitDisallowedContextReadInDEV(); + } + } else { + // Partial state object + partialState = _payload; + } + if (partialState === null || partialState === undefined) { + // Null and undefined are treated as no-ops. + return prevState; + } // Merge the partial state and the previous state. + + return assign({}, prevState, partialState); + } + case ForceUpdate: + { + hasForceUpdate = true; + return prevState; + } + } + return prevState; + } + function processUpdateQueue(workInProgress, props, instance, renderLanes) { + // This is always non-null on a ClassComponent or HostRoot + var queue = workInProgress.updateQueue; + hasForceUpdate = false; + { + currentlyProcessingQueue = queue.shared; + } + var firstBaseUpdate = queue.firstBaseUpdate; + var lastBaseUpdate = queue.lastBaseUpdate; // Check if there are pending updates. If so, transfer them to the base queue. + + var pendingQueue = queue.shared.pending; + if (pendingQueue !== null) { + queue.shared.pending = null; // The pending queue is circular. Disconnect the pointer between first + // and last so that it's non-circular. + + var lastPendingUpdate = pendingQueue; + var firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; // Append pending updates to base queue + + if (lastBaseUpdate === null) { + firstBaseUpdate = firstPendingUpdate; + } else { + lastBaseUpdate.next = firstPendingUpdate; + } + lastBaseUpdate = lastPendingUpdate; // If there's a current queue, and it's different from the base queue, then + // we need to transfer the updates to that queue, too. Because the base + // queue is a singly-linked list with no cycles, we can append to both + // lists and take advantage of structural sharing. + // TODO: Pass `current` as argument + + var current = workInProgress.alternate; + if (current !== null) { + // This is always non-null on a ClassComponent or HostRoot + var currentQueue = current.updateQueue; + var currentLastBaseUpdate = currentQueue.lastBaseUpdate; + if (currentLastBaseUpdate !== lastBaseUpdate) { + if (currentLastBaseUpdate === null) { + currentQueue.firstBaseUpdate = firstPendingUpdate; + } else { + currentLastBaseUpdate.next = firstPendingUpdate; + } + currentQueue.lastBaseUpdate = lastPendingUpdate; + } + } + } // These values may change as we process the queue. + + if (firstBaseUpdate !== null) { + // Iterate through the list of updates to compute the result. + var newState = queue.baseState; // TODO: Don't need to accumulate this. Instead, we can remove renderLanes + // from the original lanes. + + var newLanes = NoLanes; + var newBaseState = null; + var newFirstBaseUpdate = null; + var newLastBaseUpdate = null; + var update = firstBaseUpdate; + do { + var updateLane = update.lane; + var updateEventTime = update.eventTime; + if (!isSubsetOfLanes(renderLanes, updateLane)) { + // Priority is insufficient. Skip this update. If this is the first + // skipped update, the previous update/state is the new base + // update/state. + var clone = { + eventTime: updateEventTime, + lane: updateLane, + tag: update.tag, + payload: update.payload, + callback: update.callback, + next: null + }; + if (newLastBaseUpdate === null) { + newFirstBaseUpdate = newLastBaseUpdate = clone; + newBaseState = newState; + } else { + newLastBaseUpdate = newLastBaseUpdate.next = clone; + } // Update the remaining priority in the queue. + + newLanes = mergeLanes(newLanes, updateLane); + } else { + // This update does have sufficient priority. + if (newLastBaseUpdate !== null) { + var _clone = { + eventTime: updateEventTime, + // This update is going to be committed so we never want uncommit + // it. Using NoLane works because 0 is a subset of all bitmasks, so + // this will never be skipped by the check above. + lane: NoLane, + tag: update.tag, + payload: update.payload, + callback: update.callback, + next: null + }; + newLastBaseUpdate = newLastBaseUpdate.next = _clone; + } // Process this update. + + newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance); + var callback = update.callback; + if (callback !== null && + // If the update was already committed, we should not queue its + // callback again. + update.lane !== NoLane) { + workInProgress.flags |= Callback; + var effects = queue.effects; + if (effects === null) { + queue.effects = [update]; + } else { + effects.push(update); + } + } + } + update = update.next; + if (update === null) { + pendingQueue = queue.shared.pending; + if (pendingQueue === null) { + break; + } else { + // An update was scheduled from inside a reducer. Add the new + // pending updates to the end of the list and keep processing. + var _lastPendingUpdate = pendingQueue; // Intentionally unsound. Pending updates form a circular list, but we + // unravel them when transferring them to the base queue. + + var _firstPendingUpdate = _lastPendingUpdate.next; + _lastPendingUpdate.next = null; + update = _firstPendingUpdate; + queue.lastBaseUpdate = _lastPendingUpdate; + queue.shared.pending = null; + } + } + } while (true); + if (newLastBaseUpdate === null) { + newBaseState = newState; + } + queue.baseState = newBaseState; + queue.firstBaseUpdate = newFirstBaseUpdate; + queue.lastBaseUpdate = newLastBaseUpdate; // Interleaved updates are stored on a separate queue. We aren't going to + // process them during this render, but we do need to track which lanes + // are remaining. + + var lastInterleaved = queue.shared.interleaved; + if (lastInterleaved !== null) { + var interleaved = lastInterleaved; + do { + newLanes = mergeLanes(newLanes, interleaved.lane); + interleaved = interleaved.next; + } while (interleaved !== lastInterleaved); + } else if (firstBaseUpdate === null) { + // `queue.lanes` is used for entangling transitions. We can set it back to + // zero once the queue is empty. + queue.shared.lanes = NoLanes; + } // Set the remaining expiration time to be whatever is remaining in the queue. + // This should be fine because the only two other things that contribute to + // expiration time are props and context. We're already in the middle of the + // begin phase by the time we start processing the queue, so we've already + // dealt with the props. Context in components that specify + // shouldComponentUpdate is tricky; but we'll have to account for + // that regardless. + + markSkippedUpdateLanes(newLanes); + workInProgress.lanes = newLanes; + workInProgress.memoizedState = newState; + } + { + currentlyProcessingQueue = null; + } + } + function callCallback(callback, context) { + if (typeof callback !== "function") { + throw new Error("Invalid argument passed as callback. Expected a function. Instead " + ("received: " + callback)); + } + callback.call(context); + } + function resetHasForceUpdateBeforeProcessing() { + hasForceUpdate = false; + } + function checkHasForceUpdateAfterProcessing() { + return hasForceUpdate; + } + function commitUpdateQueue(finishedWork, finishedQueue, instance) { + // Commit the effects + var effects = finishedQueue.effects; + finishedQueue.effects = null; + if (effects !== null) { + for (var i = 0; i < effects.length; i++) { + var effect = effects[i]; + var callback = effect.callback; + if (callback !== null) { + effect.callback = null; + callCallback(callback, instance); + } + } + } + } + var fakeInternalInstance = {}; // React.Component uses a shared frozen object by default. + // We'll use it to determine whether we need to initialize legacy refs. + + var emptyRefsObject = new React.Component().refs; + var didWarnAboutStateAssignmentForComponent; + var didWarnAboutUninitializedState; + var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate; + var didWarnAboutLegacyLifecyclesAndDerivedState; + var didWarnAboutUndefinedDerivedState; + var warnOnUndefinedDerivedState; + var warnOnInvalidCallback; + var didWarnAboutDirectlyAssigningPropsToState; + var didWarnAboutContextTypeAndContextTypes; + var didWarnAboutInvalidateContextType; + { + didWarnAboutStateAssignmentForComponent = new Set(); + didWarnAboutUninitializedState = new Set(); + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); + didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); + didWarnAboutDirectlyAssigningPropsToState = new Set(); + didWarnAboutUndefinedDerivedState = new Set(); + didWarnAboutContextTypeAndContextTypes = new Set(); + didWarnAboutInvalidateContextType = new Set(); + var didWarnOnInvalidCallback = new Set(); + warnOnInvalidCallback = function warnOnInvalidCallback(callback, callerName) { + if (callback === null || typeof callback === "function") { + return; + } + var key = callerName + "_" + callback; + if (!didWarnOnInvalidCallback.has(key)) { + didWarnOnInvalidCallback.add(key); + error("%s(...): Expected the last optional `callback` argument to be a " + "function. Instead received: %s.", callerName, callback); + } + }; + warnOnUndefinedDerivedState = function warnOnUndefinedDerivedState(type, partialState) { + if (partialState === undefined) { + var componentName = getComponentNameFromType(type) || "Component"; + if (!didWarnAboutUndefinedDerivedState.has(componentName)) { + didWarnAboutUndefinedDerivedState.add(componentName); + error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. " + "You have returned undefined.", componentName); + } + } + }; // This is so gross but it's at least non-critical and can be removed if + // it causes problems. This is meant to give a nicer error message for + // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component, + // ...)) which otherwise throws a "_processChildContext is not a function" + // exception. + + Object.defineProperty(fakeInternalInstance, "_processChildContext", { + enumerable: false, + value: function value() { + throw new Error("_processChildContext is not available in React 16+. This likely " + "means you have multiple copies of React and are attempting to nest " + "a React 15 tree inside a React 16 tree using " + "unstable_renderSubtreeIntoContainer, which isn't supported. Try " + "to make sure you have only one copy of React (and ideally, switch " + "to ReactDOM.createPortal)."); + } + }); + Object.freeze(fakeInternalInstance); + } + function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) { + var prevState = workInProgress.memoizedState; + var partialState = getDerivedStateFromProps(nextProps, prevState); + { + warnOnUndefinedDerivedState(ctor, partialState); + } // Merge the partial state and the previous state. + + var memoizedState = partialState === null || partialState === undefined ? prevState : assign({}, prevState, partialState); + workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the + // base state. + + if (workInProgress.lanes === NoLanes) { + // Queue is always non-null for classes + var updateQueue = workInProgress.updateQueue; + updateQueue.baseState = memoizedState; + } + } + var classComponentUpdater = { + isMounted: isMounted, + enqueueSetState: function enqueueSetState(inst, payload, callback) { + var fiber = get(inst); + var eventTime = requestEventTime(); + var lane = requestUpdateLane(fiber); + var update = createUpdate(eventTime, lane); + update.payload = payload; + if (callback !== undefined && callback !== null) { + { + warnOnInvalidCallback(callback, "setState"); + } + update.callback = callback; + } + var root = enqueueUpdate(fiber, update, lane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, lane, eventTime); + entangleTransitions(root, fiber, lane); + } + }, + enqueueReplaceState: function enqueueReplaceState(inst, payload, callback) { + var fiber = get(inst); + var eventTime = requestEventTime(); + var lane = requestUpdateLane(fiber); + var update = createUpdate(eventTime, lane); + update.tag = ReplaceState; + update.payload = payload; + if (callback !== undefined && callback !== null) { + { + warnOnInvalidCallback(callback, "replaceState"); + } + update.callback = callback; + } + var root = enqueueUpdate(fiber, update, lane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, lane, eventTime); + entangleTransitions(root, fiber, lane); + } + }, + enqueueForceUpdate: function enqueueForceUpdate(inst, callback) { + var fiber = get(inst); + var eventTime = requestEventTime(); + var lane = requestUpdateLane(fiber); + var update = createUpdate(eventTime, lane); + update.tag = ForceUpdate; + if (callback !== undefined && callback !== null) { + { + warnOnInvalidCallback(callback, "forceUpdate"); + } + update.callback = callback; + } + var root = enqueueUpdate(fiber, update, lane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, lane, eventTime); + entangleTransitions(root, fiber, lane); + } + } + }; + function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { + var instance = workInProgress.stateNode; + if (typeof instance.shouldComponentUpdate === "function") { + var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); + { + if (shouldUpdate === undefined) { + error("%s.shouldComponentUpdate(): Returned undefined instead of a " + "boolean value. Make sure to return true or false.", getComponentNameFromType(ctor) || "Component"); + } + } + return shouldUpdate; + } + if (ctor.prototype && ctor.prototype.isPureReactComponent) { + return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); + } + return true; + } + function checkClassInstance(workInProgress, ctor, newProps) { + var instance = workInProgress.stateNode; + { + var name = getComponentNameFromType(ctor) || "Component"; + var renderPresent = instance.render; + if (!renderPresent) { + if (ctor.prototype && typeof ctor.prototype.render === "function") { + error("%s(...): No `render` method found on the returned component " + "instance: did you accidentally return an object from the constructor?", name); + } else { + error("%s(...): No `render` method found on the returned component " + "instance: you may have forgotten to define `render`.", name); + } + } + if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) { + error("getInitialState was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Did you mean to define a state property instead?", name); + } + if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) { + error("getDefaultProps was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Use a static property to define defaultProps instead.", name); + } + if (instance.propTypes) { + error("propTypes was defined as an instance property on %s. Use a static " + "property to define propTypes instead.", name); + } + if (instance.contextType) { + error("contextType was defined as an instance property on %s. Use a static " + "property to define contextType instead.", name); + } + { + if (instance.contextTypes) { + error("contextTypes was defined as an instance property on %s. Use a static " + "property to define contextTypes instead.", name); + } + if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) { + didWarnAboutContextTypeAndContextTypes.add(ctor); + error("%s declares both contextTypes and contextType static properties. " + "The legacy contextTypes property will be ignored.", name); + } + } + if (typeof instance.componentShouldUpdate === "function") { + error("%s has a method called " + "componentShouldUpdate(). Did you mean shouldComponentUpdate()? " + "The name is phrased as a question because the function is " + "expected to return a value.", name); + } + if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== "undefined") { + error("%s has a method called shouldComponentUpdate(). " + "shouldComponentUpdate should not be used when extending React.PureComponent. " + "Please extend React.Component if shouldComponentUpdate is used.", getComponentNameFromType(ctor) || "A pure component"); + } + if (typeof instance.componentDidUnmount === "function") { + error("%s has a method called " + "componentDidUnmount(). But there is no such lifecycle method. " + "Did you mean componentWillUnmount()?", name); + } + if (typeof instance.componentDidReceiveProps === "function") { + error("%s has a method called " + "componentDidReceiveProps(). But there is no such lifecycle method. " + "If you meant to update the state in response to changing props, " + "use componentWillReceiveProps(). If you meant to fetch data or " + "run side-effects or mutations after React has updated the UI, use componentDidUpdate().", name); + } + if (typeof instance.componentWillRecieveProps === "function") { + error("%s has a method called " + "componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", name); + } + if (typeof instance.UNSAFE_componentWillRecieveProps === "function") { + error("%s has a method called " + "UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", name); + } + var hasMutatedProps = instance.props !== newProps; + if (instance.props !== undefined && hasMutatedProps) { + error("%s(...): When calling super() in `%s`, make sure to pass " + "up the same props that your component's constructor was passed.", name, name); + } + if (instance.defaultProps) { + error("Setting defaultProps as an instance property on %s is not supported and will be ignored." + " Instead, define defaultProps as a static property on %s.", name, name); + } + if (typeof instance.getSnapshotBeforeUpdate === "function" && typeof instance.componentDidUpdate !== "function" && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) { + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor); + error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). " + "This component defines getSnapshotBeforeUpdate() only.", getComponentNameFromType(ctor)); + } + if (typeof instance.getDerivedStateFromProps === "function") { + error("%s: getDerivedStateFromProps() is defined as an instance method " + "and will be ignored. Instead, declare it as a static method.", name); + } + if (typeof instance.getDerivedStateFromError === "function") { + error("%s: getDerivedStateFromError() is defined as an instance method " + "and will be ignored. Instead, declare it as a static method.", name); + } + if (typeof ctor.getSnapshotBeforeUpdate === "function") { + error("%s: getSnapshotBeforeUpdate() is defined as a static method " + "and will be ignored. Instead, declare it as an instance method.", name); + } + var _state = instance.state; + if (_state && (typeof _state !== "object" || isArray(_state))) { + error("%s.state: must be set to an object or null", name); + } + if (typeof instance.getChildContext === "function" && typeof ctor.childContextTypes !== "object") { + error("%s.getChildContext(): childContextTypes must be defined in order to " + "use getChildContext().", name); + } + } + } + function adoptClassInstance(workInProgress, instance) { + instance.updater = classComponentUpdater; + workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates + + set(instance, workInProgress); + { + instance._reactInternalInstance = fakeInternalInstance; + } + } + function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = false; + var unmaskedContext = emptyContextObject; + var context = emptyContextObject; + var contextType = ctor.contextType; + { + if ("contextType" in ctor) { + var isValid = + // Allow null for conditional declaration + contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a + + if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) { + didWarnAboutInvalidateContextType.add(ctor); + var addendum = ""; + if (contextType === undefined) { + addendum = " However, it is set to undefined. " + "This can be caused by a typo or by mixing up named and default imports. " + "This can also happen due to a circular dependency, so " + "try moving the createContext() call to a separate file."; + } else if (typeof contextType !== "object") { + addendum = " However, it is set to a " + typeof contextType + "."; + } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) { + addendum = " Did you accidentally pass the Context.Provider instead?"; + } else if (contextType._context !== undefined) { + // + addendum = " Did you accidentally pass the Context.Consumer instead?"; + } else { + addendum = " However, it is set to an object with keys {" + Object.keys(contextType).join(", ") + "}."; + } + error("%s defines an invalid contextType. " + "contextType should point to the Context object returned by React.createContext().%s", getComponentNameFromType(ctor) || "Component", addendum); + } + } + } + if (typeof contextType === "object" && contextType !== null) { + context = _readContext(contextType); + } else { + unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + var contextTypes = ctor.contextTypes; + isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined; + context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject; + } + var instance = new ctor(props, context); // Instantiate twice to help detect side-effects. + + var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null; + adoptClassInstance(workInProgress, instance); + { + if (typeof ctor.getDerivedStateFromProps === "function" && state === null) { + var componentName = getComponentNameFromType(ctor) || "Component"; + if (!didWarnAboutUninitializedState.has(componentName)) { + didWarnAboutUninitializedState.add(componentName); + error("`%s` uses `getDerivedStateFromProps` but its initial state is " + "%s. This is not recommended. Instead, define the initial state by " + "assigning an object to `this.state` in the constructor of `%s`. " + "This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", componentName, instance.state === null ? "null" : "undefined", componentName); + } + } // If new component APIs are defined, "unsafe" lifecycles won't be called. + // Warn about these lifecycles if they are present. + // Don't warn about react-lifecycles-compat polyfilled methods though. + + if (typeof ctor.getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function") { + var foundWillMountName = null; + var foundWillReceivePropsName = null; + var foundWillUpdateName = null; + if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) { + foundWillMountName = "componentWillMount"; + } else if (typeof instance.UNSAFE_componentWillMount === "function") { + foundWillMountName = "UNSAFE_componentWillMount"; + } + if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { + foundWillReceivePropsName = "componentWillReceiveProps"; + } else if (typeof instance.UNSAFE_componentWillReceiveProps === "function") { + foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"; + } + if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { + foundWillUpdateName = "componentWillUpdate"; + } else if (typeof instance.UNSAFE_componentWillUpdate === "function") { + foundWillUpdateName = "UNSAFE_componentWillUpdate"; + } + if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) { + var _componentName = getComponentNameFromType(ctor) || "Component"; + var newApiName = typeof ctor.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()"; + if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) { + didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName); + error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n" + "%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n" + "The above lifecycles should be removed. Learn more about this warning here:\n" + "https://react.dev/link/unsafe-component-lifecycles", _componentName, newApiName, foundWillMountName !== null ? "\n " + foundWillMountName : "", foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : "", foundWillUpdateName !== null ? "\n " + foundWillUpdateName : ""); + } + } + } + } // Cache unmasked context so we can avoid recreating masked context unless necessary. + // ReactFiberContext usually updates this cache but can't for newly-created instances. + + if (isLegacyContextConsumer) { + cacheContext(workInProgress, unmaskedContext, context); + } + return instance; + } + function callComponentWillMount(workInProgress, instance) { + var oldState = instance.state; + if (typeof instance.componentWillMount === "function") { + instance.componentWillMount(); + } + if (typeof instance.UNSAFE_componentWillMount === "function") { + instance.UNSAFE_componentWillMount(); + } + if (oldState !== instance.state) { + { + error("%s.componentWillMount(): Assigning directly to this.state is " + "deprecated (except inside a component's " + "constructor). Use setState instead.", getComponentNameFromFiber(workInProgress) || "Component"); + } + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); + } + } + function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) { + var oldState = instance.state; + if (typeof instance.componentWillReceiveProps === "function") { + instance.componentWillReceiveProps(newProps, nextContext); + } + if (typeof instance.UNSAFE_componentWillReceiveProps === "function") { + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + } + if (instance.state !== oldState) { + { + var componentName = getComponentNameFromFiber(workInProgress) || "Component"; + if (!didWarnAboutStateAssignmentForComponent.has(componentName)) { + didWarnAboutStateAssignmentForComponent.add(componentName); + error("%s.componentWillReceiveProps(): Assigning directly to " + "this.state is deprecated (except inside a component's " + "constructor). Use setState instead.", componentName); + } + } + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); + } + } // Invokes the mount life-cycles on a previously never rendered instance. + + function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { + { + checkClassInstance(workInProgress, ctor, newProps); + } + var instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = emptyRefsObject; + initializeUpdateQueue(workInProgress); + var contextType = ctor.contextType; + if (typeof contextType === "object" && contextType !== null) { + instance.context = _readContext(contextType); + } else { + var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + instance.context = getMaskedContext(workInProgress, unmaskedContext); + } + { + if (instance.state === newProps) { + var componentName = getComponentNameFromType(ctor) || "Component"; + if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) { + didWarnAboutDirectlyAssigningPropsToState.add(componentName); + error("%s: It is not recommended to assign props directly to state " + "because updates to props won't be reflected in state. " + "In most cases, it is better to use props directly.", componentName); + } + } + if (workInProgress.mode & StrictLegacyMode) { + ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance); + } + { + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance); + } + } + instance.state = workInProgress.memoizedState; + var getDerivedStateFromProps = ctor.getDerivedStateFromProps; + if (typeof getDerivedStateFromProps === "function") { + applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); + instance.state = workInProgress.memoizedState; + } // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + + if (typeof ctor.getDerivedStateFromProps !== "function" && typeof instance.getSnapshotBeforeUpdate !== "function" && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) { + callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's + // process them now. + + processUpdateQueue(workInProgress, newProps, instance, renderLanes); + instance.state = workInProgress.memoizedState; + } + if (typeof instance.componentDidMount === "function") { + var fiberFlags = Update; + workInProgress.flags |= fiberFlags; + } + } + function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode; + var oldProps = workInProgress.memoizedProps; + instance.props = oldProps; + var oldContext = instance.context; + var contextType = ctor.contextType; + var nextContext = emptyContextObject; + if (typeof contextType === "object" && contextType !== null) { + nextContext = _readContext(contextType); + } else { + var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext); + } + var getDerivedStateFromProps = ctor.getDerivedStateFromProps; + var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function"; // Note: During these life-cycles, instance.props/instance.state are what + // ever the previously attempted to render - not the "current". However, + // during componentDidUpdate we pass the "current" props. + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) { + if (oldProps !== newProps || oldContext !== nextContext) { + callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); + } + } + resetHasForceUpdateBeforeProcessing(); + var oldState = workInProgress.memoizedState; + var newState = instance.state = oldState; + processUpdateQueue(workInProgress, newProps, instance, renderLanes); + newState = workInProgress.memoizedState; + if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidMount === "function") { + var fiberFlags = Update; + workInProgress.flags |= fiberFlags; + } + return false; + } + if (typeof getDerivedStateFromProps === "function") { + applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); + newState = workInProgress.memoizedState; + } + var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext); + if (shouldUpdate) { + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) { + if (typeof instance.componentWillMount === "function") { + instance.componentWillMount(); + } + if (typeof instance.UNSAFE_componentWillMount === "function") { + instance.UNSAFE_componentWillMount(); + } + } + if (typeof instance.componentDidMount === "function") { + var _fiberFlags = Update; + workInProgress.flags |= _fiberFlags; + } + } else { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidMount === "function") { + var _fiberFlags2 = Update; + workInProgress.flags |= _fiberFlags2; + } // If shouldComponentUpdate returned false, we should still update the + // memoized state to indicate that this work can be reused. + + workInProgress.memoizedProps = newProps; + workInProgress.memoizedState = newState; + } // Update the existing instance's state, props, and context pointers even + // if shouldComponentUpdate returns false. + + instance.props = newProps; + instance.state = newState; + instance.context = nextContext; + return shouldUpdate; + } // Invokes the update life-cycles and returns false if it shouldn't rerender. + + function updateClassInstance(current, workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + var unresolvedOldProps = workInProgress.memoizedProps; + var oldProps = workInProgress.type === workInProgress.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress.type, unresolvedOldProps); + instance.props = oldProps; + var unresolvedNewProps = workInProgress.pendingProps; + var oldContext = instance.context; + var contextType = ctor.contextType; + var nextContext = emptyContextObject; + if (typeof contextType === "object" && contextType !== null) { + nextContext = _readContext(contextType); + } else { + var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + nextContext = getMaskedContext(workInProgress, nextUnmaskedContext); + } + var getDerivedStateFromProps = ctor.getDerivedStateFromProps; + var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function"; // Note: During these life-cycles, instance.props/instance.state are what + // ever the previously attempted to render - not the "current". However, + // during componentDidUpdate we pass the "current" props. + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) { + if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) { + callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); + } + } + resetHasForceUpdateBeforeProcessing(); + var oldState = workInProgress.memoizedState; + var newState = instance.state = oldState; + processUpdateQueue(workInProgress, newProps, instance, renderLanes); + newState = workInProgress.memoizedState; + if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing() && !enableLazyContextPropagation) { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidUpdate === "function") { + if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.flags |= Update; + } + } + if (typeof instance.getSnapshotBeforeUpdate === "function") { + if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.flags |= Snapshot; + } + } + return false; + } + if (typeof getDerivedStateFromProps === "function") { + applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); + newState = workInProgress.memoizedState; + } + var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) || + // TODO: In some cases, we'll end up checking if context has changed twice, + // both before and after `shouldComponentUpdate` has been called. Not ideal, + // but I'm loath to refactor this function. This only happens for memoized + // components so it's not that common. + enableLazyContextPropagation; + if (shouldUpdate) { + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === "function" || typeof instance.componentWillUpdate === "function")) { + if (typeof instance.componentWillUpdate === "function") { + instance.componentWillUpdate(newProps, newState, nextContext); + } + if (typeof instance.UNSAFE_componentWillUpdate === "function") { + instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext); + } + } + if (typeof instance.componentDidUpdate === "function") { + workInProgress.flags |= Update; + } + if (typeof instance.getSnapshotBeforeUpdate === "function") { + workInProgress.flags |= Snapshot; + } + } else { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidUpdate === "function") { + if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.flags |= Update; + } + } + if (typeof instance.getSnapshotBeforeUpdate === "function") { + if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.flags |= Snapshot; + } + } // If shouldComponentUpdate returned false, we should still update the + // memoized props/state to indicate that this work can be reused. + + workInProgress.memoizedProps = newProps; + workInProgress.memoizedState = newState; + } // Update the existing instance's state, props, and context pointers even + // if shouldComponentUpdate returns false. + + instance.props = newProps; + instance.state = newState; + instance.context = nextContext; + return shouldUpdate; + } + var didWarnAboutMaps; + var didWarnAboutGenerators; + var didWarnAboutStringRefs; + var ownerHasKeyUseWarning; + var ownerHasFunctionTypeWarning; + var warnForMissingKey = function warnForMissingKey(child, returnFiber) {}; + { + didWarnAboutMaps = false; + didWarnAboutGenerators = false; + didWarnAboutStringRefs = {}; + /** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + + ownerHasKeyUseWarning = {}; + ownerHasFunctionTypeWarning = {}; + warnForMissingKey = function warnForMissingKey(child, returnFiber) { + if (child === null || typeof child !== "object") { + return; + } + if (!child._store || child._store.validated || child.key != null) { + return; + } + if (typeof child._store !== "object") { + throw new Error("React Component in warnForMissingKey should have a _store. " + "This error is likely caused by a bug in React. Please file an issue."); + } + child._store.validated = true; + var componentName = getComponentNameFromFiber(returnFiber) || "Component"; + if (ownerHasKeyUseWarning[componentName]) { + return; + } + ownerHasKeyUseWarning[componentName] = true; + error("Each child in a list should have a unique " + '"key" prop. See https://react.dev/link/warning-keys for ' + "more information."); + }; + } + function coerceRef(returnFiber, current, element) { + var mixedRef = element.ref; + if (mixedRef !== null && typeof mixedRef !== "function" && typeof mixedRef !== "object") { + { + // TODO: Clean this up once we turn on the string ref warning for + // everyone, because the strict mode case will no longer be relevant + if ((returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && + // We warn in ReactElement.js if owner and self are equal for string refs + // because these cannot be automatically converted to an arrow function + // using a codemod. Therefore, we don't have to warn about string refs again. + !(element._owner && element._self && element._owner.stateNode !== element._self)) { + var componentName = getComponentNameFromFiber(returnFiber) || "Component"; + if (!didWarnAboutStringRefs[componentName]) { + { + error('A string ref, "%s", has been found within a strict mode tree. ' + "String refs are a source of potential bugs and should be avoided. " + "We recommend using useRef() or createRef() instead. " + "Learn more about using refs safely here: " + "https://react.dev/link/strict-mode-string-ref", mixedRef); + } + didWarnAboutStringRefs[componentName] = true; + } + } + } + if (element._owner) { + var owner = element._owner; + var inst; + if (owner) { + var ownerFiber = owner; + if (ownerFiber.tag !== ClassComponent) { + throw new Error("Function components cannot have string refs. " + "We recommend using useRef() instead. " + "Learn more about using refs safely here: " + "https://react.dev/link/strict-mode-string-ref"); + } + inst = ownerFiber.stateNode; + } + if (!inst) { + throw new Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a " + "bug in React. Please file an issue."); + } // Assigning this to a const so Flow knows it won't change in the closure + + var resolvedInst = inst; + { + checkPropStringCoercion(mixedRef, "ref"); + } + var stringRef = "" + mixedRef; // Check if previous string ref matches new string ref + + if (current !== null && current.ref !== null && typeof current.ref === "function" && current.ref._stringRef === stringRef) { + return current.ref; + } + var ref = function ref(value) { + var refs = resolvedInst.refs; + if (refs === emptyRefsObject) { + // This is a lazy pooled frozen object, so we need to initialize. + refs = resolvedInst.refs = {}; + } + if (value === null) { + delete refs[stringRef]; + } else { + refs[stringRef] = value; + } + }; + ref._stringRef = stringRef; + return ref; + } else { + if (typeof mixedRef !== "string") { + throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null."); + } + if (!element._owner) { + throw new Error("Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of" + " the following reasons:\n" + "1. You may be adding a ref to a function component\n" + "2. You may be adding a ref to a component that was not created inside a component's render method\n" + "3. You have multiple copies of React loaded\n" + "See https://react.dev/link/refs-must-have-owner for more information."); + } + } + } + return mixedRef; + } + function throwOnInvalidObjectType(returnFiber, newChild) { + var childString = Object.prototype.toString.call(newChild); + throw new Error("Objects are not valid as a React child (found: " + (childString === "[object Object]" ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : childString) + "). " + "If you meant to render a collection of children, use an array " + "instead."); + } + function warnOnFunctionType(returnFiber) { + { + var componentName = getComponentNameFromFiber(returnFiber) || "Component"; + if (ownerHasFunctionTypeWarning[componentName]) { + return; + } + ownerHasFunctionTypeWarning[componentName] = true; + error("Functions are not valid as a React child. This may happen if " + "you return a Component instead of from render. " + "Or maybe you meant to call this function rather than return it."); + } + } + function resolveLazy(lazyType) { + var payload = lazyType._payload; + var init = lazyType._init; + return init(payload); + } // This wrapper function exists because I expect to clone the code in each path + // to be able to optimize each path individually by branching early. This needs + // a compiler or we can do it manually. Helpers that don't need this branching + // live outside of this function. + + function ChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (!shouldTrackSideEffects) { + // Noop. + return; + } + var deletions = returnFiber.deletions; + if (deletions === null) { + returnFiber.deletions = [childToDelete]; + returnFiber.flags |= ChildDeletion; + } else { + deletions.push(childToDelete); + } + } + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) { + // Noop. + return null; + } // TODO: For the shouldClone case, this could be micro-optimized a bit by + // assuming that after the first child we've already added everything. + + var childToDelete = currentFirstChild; + while (childToDelete !== null) { + deleteChild(returnFiber, childToDelete); + childToDelete = childToDelete.sibling; + } + return null; + } + function mapRemainingChildren(returnFiber, currentFirstChild) { + // Add the remaining children to a temporary map so that we can find them by + // keys quickly. Implicit (null) keys get added to this set with their index + // instead. + var existingChildren = new Map(); + var existingChild = currentFirstChild; + while (existingChild !== null) { + if (existingChild.key !== null) { + existingChildren.set(existingChild.key, existingChild); + } else { + existingChildren.set(existingChild.index, existingChild); + } + existingChild = existingChild.sibling; + } + return existingChildren; + } + function useFiber(fiber, pendingProps) { + // We currently set sibling to null and index to 0 here because it is easy + // to forget to do before returning it. E.g. for the single child case. + var clone = createWorkInProgress(fiber, pendingProps); + clone.index = 0; + clone.sibling = null; + return clone; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) { + // During hydration, the useId algorithm needs to know which fibers are + // part of a list of children (arrays, iterators). + newFiber.flags |= Forked; + return lastPlacedIndex; + } + var current = newFiber.alternate; + if (current !== null) { + var oldIndex = current.index; + if (oldIndex < lastPlacedIndex) { + // This is a move. + newFiber.flags |= Placement; + return lastPlacedIndex; + } else { + // This item can stay in place. + return oldIndex; + } + } else { + // This is an insertion. + newFiber.flags |= Placement; + return lastPlacedIndex; + } + } + function placeSingleChild(newFiber) { + // This is simpler for the single child case. We only need to do a + // placement for inserting new children. + if (shouldTrackSideEffects && newFiber.alternate === null) { + newFiber.flags |= Placement; + } + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (current === null || current.tag !== HostText) { + // Insert + var created = createFiberFromText(textContent, returnFiber.mode, lanes); + created.return = returnFiber; + return created; + } else { + // Update + var existing = useFiber(current, textContent); + existing.return = returnFiber; + return existing; + } + } + 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 (current !== null) { + if (current.elementType === elementType || + // Keep this check inline so it only runs on the false path: + isCompatibleFamilyForHotReloading(current, element) || + // Lazy types should reconcile their resolved type. + // We need to do this after the Hot Reloading check above, + // because hot reloading has different semantics than prod because + // it doesn't resuspend. So we can't let the call below suspend. + typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current.type) { + // Move based on index + var existing = useFiber(current, element.props); + existing.ref = coerceRef(returnFiber, current, element); + existing.return = returnFiber; + { + existing._debugSource = element._source; + existing._debugOwner = element._owner; + } + return existing; + } + } // Insert + + var created = createFiberFromElement(element, returnFiber.mode, lanes); + created.ref = coerceRef(returnFiber, current, element); + created.return = returnFiber; + return created; + } + function updatePortal(returnFiber, current, portal, lanes) { + if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) { + // Insert + var created = createFiberFromPortal(portal, returnFiber.mode, lanes); + created.return = returnFiber; + return created; + } else { + // Update + var existing = useFiber(current, portal.children || []); + existing.return = returnFiber; + return existing; + } + } + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (current === null || current.tag !== Fragment) { + // Insert + var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key); + created.return = returnFiber; + return created; + } else { + // Update + var existing = useFiber(current, fragment); + existing.return = returnFiber; + return existing; + } + } + function createChild(returnFiber, newChild, lanes) { + if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") { + // Text nodes don't have keys. If the previous node is implicitly keyed + // we can continue to replace it without aborting even if it is not a text + // node. + var created = createFiberFromText("" + newChild, returnFiber.mode, lanes); + created.return = returnFiber; + return created; + } + if (typeof newChild === "object" && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + { + var _created = createFiberFromElement(newChild, returnFiber.mode, lanes); + _created.ref = coerceRef(returnFiber, null, newChild); + _created.return = returnFiber; + return _created; + } + case REACT_PORTAL_TYPE: + { + var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes); + _created2.return = returnFiber; + return _created2; + } + case REACT_LAZY_TYPE: + { + var payload = newChild._payload; + var init = newChild._init; + return createChild(returnFiber, init(payload), lanes); + } + } + if (isArray(newChild) || getIteratorFn(newChild)) { + var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null); + _created3.return = returnFiber; + return _created3; + } + throwOnInvalidObjectType(returnFiber, newChild); + } + { + if (typeof newChild === "function") { + warnOnFunctionType(returnFiber); + } + } + return null; + } + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + // Update the fiber if the keys match, otherwise return null. + var key = oldFiber !== null ? oldFiber.key : null; + if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") { + // Text nodes don't have keys. If the previous node is implicitly keyed + // we can continue to replace it without aborting even if it is not a text + // node. + if (key !== null) { + return null; + } + return updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + } + if (typeof newChild === "object" && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + { + if (newChild.key === key) { + return updateElement(returnFiber, oldFiber, newChild, lanes); + } else { + return null; + } + } + case REACT_PORTAL_TYPE: + { + if (newChild.key === key) { + return updatePortal(returnFiber, oldFiber, newChild, lanes); + } else { + return null; + } + } + case REACT_LAZY_TYPE: + { + var payload = newChild._payload; + var init = newChild._init; + return updateSlot(returnFiber, oldFiber, init(payload), lanes); + } + } + if (isArray(newChild) || getIteratorFn(newChild)) { + if (key !== null) { + return null; + } + return updateFragment(returnFiber, oldFiber, newChild, lanes, null); + } + throwOnInvalidObjectType(returnFiber, newChild); + } + { + if (typeof newChild === "function") { + warnOnFunctionType(returnFiber); + } + } + return null; + } + function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) { + if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") { + // Text nodes don't have keys, so we neither have to check the old nor + // new node for the key. If both are text nodes, they match. + var matchedFiber = existingChildren.get(newIdx) || null; + return updateTextNode(returnFiber, matchedFiber, "" + newChild, lanes); + } + if (typeof newChild === "object" && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + { + var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; + return updateElement(returnFiber, _matchedFiber, newChild, lanes); + } + case REACT_PORTAL_TYPE: + { + var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; + return updatePortal(returnFiber, _matchedFiber2, newChild, lanes); + } + case REACT_LAZY_TYPE: + var payload = newChild._payload; + var init = newChild._init; + return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes); + } + if (isArray(newChild) || getIteratorFn(newChild)) { + var _matchedFiber3 = existingChildren.get(newIdx) || null; + return updateFragment(returnFiber, _matchedFiber3, newChild, lanes, null); + } + throwOnInvalidObjectType(returnFiber, newChild); + } + { + if (typeof newChild === "function") { + warnOnFunctionType(returnFiber); + } + } + return null; + } + /** + * Warns if there is a duplicate or missing key + */ + + function warnOnInvalidKey(child, knownKeys, returnFiber) { + { + if (typeof child !== "object" || child === null) { + return knownKeys; + } + switch (child.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + warnForMissingKey(child, returnFiber); + var key = child.key; + if (typeof key !== "string") { + break; + } + if (knownKeys === null) { + knownKeys = new Set(); + knownKeys.add(key); + break; + } + if (!knownKeys.has(key)) { + knownKeys.add(key); + break; + } + error("Encountered two children with the same key, `%s`. " + "Keys should be unique so that components maintain their identity " + "across updates. Non-unique keys may cause children to be " + "duplicated and/or omitted — the behavior is unsupported and " + "could change in a future version.", key); + break; + case REACT_LAZY_TYPE: + var payload = child._payload; + var init = child._init; + warnOnInvalidKey(init(payload), knownKeys, returnFiber); + break; + } + } + return knownKeys; + } + function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) { + // This algorithm can't optimize by searching from both ends since we + // don't have backpointers on fibers. I'm trying to see how far we can get + // with that model. If it ends up not being worth the tradeoffs, we can + // add it later. + // Even with a two ended optimization, we'd want to optimize for the case + // where there are few changes and brute force the comparison instead of + // going for the Map. It'd like to explore hitting that path first in + // forward-only mode and only go for the Map once we notice that we need + // lots of look ahead. This doesn't handle reversal as well as two ended + // search but that's unusual. Besides, for the two ended optimization to + // work on Iterables, we'd need to copy the whole set. + // In this first iteration, we'll just live with hitting the bad case + // (adding everything to a Map) in for every insert/move. + // If you change this code, also update reconcileChildrenIterator() which + // uses the same algorithm. + { + // First, validate keys. + var knownKeys = null; + for (var i = 0; i < newChildren.length; i++) { + var child = newChildren[i]; + knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber); + } + } + var resultingFirstChild = null; + var previousNewFiber = null; + var oldFiber = currentFirstChild; + var lastPlacedIndex = 0; + var newIdx = 0; + var nextOldFiber = null; + for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) { + if (oldFiber.index > newIdx) { + nextOldFiber = oldFiber; + oldFiber = null; + } else { + nextOldFiber = oldFiber.sibling; + } + var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes); + if (newFiber === null) { + // TODO: This breaks on empty slots like null children. That's + // unfortunate because it triggers the slow path all the time. We need + // a better way to communicate whether this was a miss or null, + // boolean, undefined, etc. + if (oldFiber === null) { + oldFiber = nextOldFiber; + } + break; + } + if (shouldTrackSideEffects) { + if (oldFiber && newFiber.alternate === null) { + // We matched the slot, but we didn't reuse the existing fiber, so we + // need to delete the existing child. + deleteChild(returnFiber, oldFiber); + } + } + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = newFiber; + } else { + // TODO: Defer siblings if we're not at the right index for this slot. + // I.e. if we had null values before, then we want to defer this + // for each null value. However, we also don't want to call updateSlot + // with the previous one. + previousNewFiber.sibling = newFiber; + } + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (newIdx === newChildren.length) { + // We've reached the end of the new children. We can delete the rest. + deleteRemainingChildren(returnFiber, oldFiber); + return resultingFirstChild; + } + if (oldFiber === null) { + // If we don't have any more existing children we can choose a fast path + // since the rest will all be insertions. + for (; newIdx < newChildren.length; newIdx++) { + var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes); + if (_newFiber === null) { + continue; + } + lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = _newFiber; + } else { + previousNewFiber.sibling = _newFiber; + } + previousNewFiber = _newFiber; + } + return resultingFirstChild; + } // Add all children to a key map for quick lookups. + + var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves. + + for (; newIdx < newChildren.length; newIdx++) { + var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes); + if (_newFiber2 !== null) { + if (shouldTrackSideEffects) { + if (_newFiber2.alternate !== null) { + // The new fiber is a work in progress, but if there exists a + // current, that means that we reused the fiber. We need to delete + // it from the child list so that we don't add it to the deletion + // list. + existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key); + } + } + lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + resultingFirstChild = _newFiber2; + } else { + previousNewFiber.sibling = _newFiber2; + } + previousNewFiber = _newFiber2; + } + } + if (shouldTrackSideEffects) { + // Any existing children that weren't consumed above were deleted. We need + // to add them to the deletion list. + existingChildren.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + } + return resultingFirstChild; + } + function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) { + // This is the same implementation as reconcileChildrenArray(), + // but using the iterator instead. + var iteratorFn = getIteratorFn(newChildrenIterable); + if (typeof iteratorFn !== "function") { + throw new Error("An object is not an iterable. This error is likely caused by a bug in " + "React. Please file an issue."); + } + { + // We don't support rendering Generators because it's a mutation. + // See https://github.com/facebook/react/issues/12995 + if (typeof Symbol === "function" && + // $FlowFixMe Flow doesn't know about toStringTag + newChildrenIterable[Symbol.toStringTag] === "Generator") { + if (!didWarnAboutGenerators) { + error("Using Generators as children is unsupported and will likely yield " + "unexpected results because enumerating a generator mutates it. " + "You may convert it to an array with `Array.from()` or the " + "`[...spread]` operator before rendering. Keep in mind " + "you might need to polyfill these features for older browsers."); + } + didWarnAboutGenerators = true; + } // Warn about using Maps as children + + if (newChildrenIterable.entries === iteratorFn) { + if (!didWarnAboutMaps) { + error("Using Maps as children is not supported. " + "Use an array of keyed ReactElements instead."); + } + didWarnAboutMaps = true; + } // First, validate keys. + // We'll get a different iterator later for the main pass. + + var _newChildren = iteratorFn.call(newChildrenIterable); + if (_newChildren) { + var knownKeys = null; + var _step = _newChildren.next(); + for (; !_step.done; _step = _newChildren.next()) { + var child = _step.value; + knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber); + } + } + } + var newChildren = iteratorFn.call(newChildrenIterable); + if (newChildren == null) { + throw new Error("An iterable object provided no iterator."); + } + var resultingFirstChild = null; + var previousNewFiber = null; + var oldFiber = currentFirstChild; + var lastPlacedIndex = 0; + var newIdx = 0; + var nextOldFiber = null; + var step = newChildren.next(); + for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) { + if (oldFiber.index > newIdx) { + nextOldFiber = oldFiber; + oldFiber = null; + } else { + nextOldFiber = oldFiber.sibling; + } + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (newFiber === null) { + // TODO: This breaks on empty slots like null children. That's + // unfortunate because it triggers the slow path all the time. We need + // a better way to communicate whether this was a miss or null, + // boolean, undefined, etc. + if (oldFiber === null) { + oldFiber = nextOldFiber; + } + break; + } + if (shouldTrackSideEffects) { + if (oldFiber && newFiber.alternate === null) { + // We matched the slot, but we didn't reuse the existing fiber, so we + // need to delete the existing child. + deleteChild(returnFiber, oldFiber); + } + } + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = newFiber; + } else { + // TODO: Defer siblings if we're not at the right index for this slot. + // I.e. if we had null values before, then we want to defer this + // for each null value. However, we also don't want to call updateSlot + // with the previous one. + previousNewFiber.sibling = newFiber; + } + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (step.done) { + // We've reached the end of the new children. We can delete the rest. + deleteRemainingChildren(returnFiber, oldFiber); + return resultingFirstChild; + } + if (oldFiber === null) { + // If we don't have any more existing children we can choose a fast path + // since the rest will all be insertions. + for (; !step.done; newIdx++, step = newChildren.next()) { + var _newFiber3 = createChild(returnFiber, step.value, lanes); + if (_newFiber3 === null) { + continue; + } + lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = _newFiber3; + } else { + previousNewFiber.sibling = _newFiber3; + } + previousNewFiber = _newFiber3; + } + return resultingFirstChild; + } // Add all children to a key map for quick lookups. + + var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves. + + for (; !step.done; newIdx++, step = newChildren.next()) { + var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes); + if (_newFiber4 !== null) { + if (shouldTrackSideEffects) { + if (_newFiber4.alternate !== null) { + // The new fiber is a work in progress, but if there exists a + // current, that means that we reused the fiber. We need to delete + // it from the child list so that we don't add it to the deletion + // list. + existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key); + } + } + lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + resultingFirstChild = _newFiber4; + } else { + previousNewFiber.sibling = _newFiber4; + } + previousNewFiber = _newFiber4; + } + } + if (shouldTrackSideEffects) { + // Any existing children that weren't consumed above were deleted. We need + // to add them to the deletion list. + existingChildren.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + } + return resultingFirstChild; + } + function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) { + // There's no need to check for keys on text nodes since we don't have a + // way to define them. + if (currentFirstChild !== null && currentFirstChild.tag === HostText) { + // We already have an existing node so let's just update it and delete + // the rest. + deleteRemainingChildren(returnFiber, currentFirstChild.sibling); + var existing = useFiber(currentFirstChild, textContent); + existing.return = returnFiber; + return existing; + } // The existing first child is not a text node so we need to create one + // and delete the existing ones. + + deleteRemainingChildren(returnFiber, currentFirstChild); + var created = createFiberFromText(textContent, returnFiber.mode, lanes); + created.return = returnFiber; + return created; + } + function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) { + var key = element.key; + var child = currentFirstChild; + while (child !== null) { + // TODO: If key === null and child.key === null, then this only applies to + // the first item in the list. + if (child.key === key) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) { + if (child.tag === Fragment) { + deleteRemainingChildren(returnFiber, child.sibling); + var existing = useFiber(child, element.props.children); + existing.return = returnFiber; + { + existing._debugSource = element._source; + existing._debugOwner = element._owner; + } + return existing; + } + } else { + if (child.elementType === elementType || + // Keep this check inline so it only runs on the false path: + isCompatibleFamilyForHotReloading(child, element) || + // Lazy types should reconcile their resolved type. + // We need to do this after the Hot Reloading check above, + // because hot reloading has different semantics than prod because + // it doesn't resuspend. So we can't let the call below suspend. + typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === child.type) { + deleteRemainingChildren(returnFiber, child.sibling); + var _existing = useFiber(child, element.props); + _existing.ref = coerceRef(returnFiber, child, element); + _existing.return = returnFiber; + { + _existing._debugSource = element._source; + _existing._debugOwner = element._owner; + } + return _existing; + } + } // Didn't match. + + deleteRemainingChildren(returnFiber, child); + break; + } else { + deleteChild(returnFiber, child); + } + child = child.sibling; + } + if (element.type === REACT_FRAGMENT_TYPE) { + var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key); + created.return = returnFiber; + return created; + } else { + var _created4 = createFiberFromElement(element, returnFiber.mode, lanes); + _created4.ref = coerceRef(returnFiber, currentFirstChild, element); + _created4.return = returnFiber; + return _created4; + } + } + function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) { + var key = portal.key; + var child = currentFirstChild; + while (child !== null) { + // TODO: If key === null and child.key === null, then this only applies to + // the first item in the list. + if (child.key === key) { + if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { + deleteRemainingChildren(returnFiber, child.sibling); + var existing = useFiber(child, portal.children || []); + existing.return = returnFiber; + return existing; + } else { + deleteRemainingChildren(returnFiber, child); + break; + } + } else { + deleteChild(returnFiber, child); + } + child = child.sibling; + } + var created = createFiberFromPortal(portal, returnFiber.mode, lanes); + created.return = returnFiber; + return created; + } // This API will tag the children with the side-effect of the reconciliation + // itself. They will be added to the side-effect list as we pass through the + // children and the parent. + + function reconcileChildFibers(returnFiber, currentFirstChild, newChild, lanes) { + // This function is not recursive. + // If the top level item is an array, we treat it as a set of children, + // not as a fragment. Nested arrays on the other hand will be treated as + // fragment nodes. Recursion happens at the normal flow. + // Handle top level unkeyed fragments as if they were arrays. + // This leads to an ambiguity between <>{[...]} and <>.... + // We treat the ambiguous cases above the same. + var isUnkeyedTopLevelFragment = typeof newChild === "object" && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null; + if (isUnkeyedTopLevelFragment) { + newChild = newChild.props.children; + } // Handle object types + + if (typeof newChild === "object" && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes)); + case REACT_PORTAL_TYPE: + return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes)); + case REACT_LAZY_TYPE: + var payload = newChild._payload; + var init = newChild._init; // TODO: This function is supposed to be non-recursive. + + return reconcileChildFibers(returnFiber, currentFirstChild, init(payload), lanes); + } + if (isArray(newChild)) { + return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes); + } + if (getIteratorFn(newChild)) { + return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes); + } + throwOnInvalidObjectType(returnFiber, newChild); + } + if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") { + return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, lanes)); + } + { + if (typeof newChild === "function") { + warnOnFunctionType(returnFiber); + } + } // Remaining cases are all treated as empty. + + return deleteRemainingChildren(returnFiber, currentFirstChild); + } + return reconcileChildFibers; + } + var reconcileChildFibers = ChildReconciler(true); + var mountChildFibers = ChildReconciler(false); + function cloneChildFibers(current, workInProgress) { + if (current !== null && workInProgress.child !== current.child) { + throw new Error("Resuming work not yet implemented."); + } + if (workInProgress.child === null) { + return; + } + var currentChild = workInProgress.child; + var newChild = createWorkInProgress(currentChild, currentChild.pendingProps); + workInProgress.child = newChild; + newChild.return = workInProgress; + while (currentChild.sibling !== null) { + currentChild = currentChild.sibling; + newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps); + newChild.return = workInProgress; + } + newChild.sibling = null; + } // Reset a workInProgress child set to prepare it for a second pass. + + function resetChildFibers(workInProgress, lanes) { + var child = workInProgress.child; + while (child !== null) { + resetWorkInProgress(child, lanes); + child = child.sibling; + } + } + var NO_CONTEXT = {}; + var contextStackCursor$1 = createCursor(NO_CONTEXT); + var contextFiberStackCursor = createCursor(NO_CONTEXT); + var rootInstanceStackCursor = createCursor(NO_CONTEXT); + function requiredContext(c) { + if (c === NO_CONTEXT) { + throw new Error("Expected host context to exist. This error is likely caused by a bug " + "in React. Please file an issue."); + } + return c; + } + function getRootHostContainer() { + var rootInstance = requiredContext(rootInstanceStackCursor.current); + return rootInstance; + } + function pushHostContainer(fiber, nextRootInstance) { + // Push current root instance onto the stack; + // This allows us to reset root when portals are popped. + push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + + push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack. + // However, we can't just call getRootHostContext() and push it because + // we'd have a different number of entries on the stack depending on + // whether getRootHostContext() throws somewhere in renderer code or not. + // So we push an empty value first. This lets us safely unwind on errors. + + push(contextStackCursor$1, NO_CONTEXT, fiber); + var nextRootContext = getRootHostContext(); // Now that we know this function doesn't throw, replace it. + + pop(contextStackCursor$1, fiber); + push(contextStackCursor$1, nextRootContext, fiber); + } + function popHostContainer(fiber) { + pop(contextStackCursor$1, fiber); + pop(contextFiberStackCursor, fiber); + pop(rootInstanceStackCursor, fiber); + } + function getHostContext() { + var context = requiredContext(contextStackCursor$1.current); + return context; + } + function pushHostContext(fiber) { + var rootInstance = requiredContext(rootInstanceStackCursor.current); + var context = requiredContext(contextStackCursor$1.current); + var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique. + + if (context === nextContext) { + return; + } // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor$1, nextContext, fiber); + } + function popHostContext(fiber) { + // Do not pop unless this Fiber provided the current context. + // pushHostContext() only pushes Fibers that provide unique contexts. + if (contextFiberStackCursor.current !== fiber) { + return; + } + pop(contextStackCursor$1, fiber); + pop(contextFiberStackCursor, fiber); + } + var DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is + // inherited deeply down the subtree. The upper bits only affect + // this immediate suspense boundary and gets reset each new + // boundary or suspense list. + + var SubtreeSuspenseContextMask = 1; // Subtree Flags: + // InvisibleParentSuspenseContext indicates that one of our parent Suspense + // boundaries is not currently showing visible main content. + // Either because it is already showing a fallback or is not mounted at all. + // We can use this to determine if it is desirable to trigger a fallback at + // the parent. If not, then we might need to trigger undesirable boundaries + // and/or suspend the commit to avoid hiding the parent content. + + var InvisibleParentSuspenseContext = 1; // Shallow Flags: + // ForceSuspenseFallback can be used by SuspenseList to force newly added + // items into their fallback state during one of the render passes. + + var ForceSuspenseFallback = 2; + var suspenseStackCursor = createCursor(DefaultSuspenseContext); + function hasSuspenseContext(parentContext, flag) { + return (parentContext & flag) !== 0; + } + function setDefaultShallowSuspenseContext(parentContext) { + return parentContext & SubtreeSuspenseContextMask; + } + function setShallowSuspenseContext(parentContext, shallowContext) { + return parentContext & SubtreeSuspenseContextMask | shallowContext; + } + function addSubtreeSuspenseContext(parentContext, subtreeContext) { + return parentContext | subtreeContext; + } + function pushSuspenseContext(fiber, newContext) { + push(suspenseStackCursor, newContext, fiber); + } + function popSuspenseContext(fiber) { + pop(suspenseStackCursor, fiber); + } + function shouldCaptureSuspense(workInProgress, hasInvisibleParent) { + // If it was the primary children that just suspended, capture and render the + // fallback. Otherwise, don't capture and bubble to the next boundary. + var nextState = workInProgress.memoizedState; + if (nextState !== null) { + if (nextState.dehydrated !== null) { + // A dehydrated boundary always captures. + return true; + } + return false; + } + var props = workInProgress.memoizedProps; // Regular boundaries always capture. + + { + return true; + } // If it's a boundary we should avoid, then we prefer to bubble up to the + } + function findFirstSuspended(row) { + var node = row; + while (node !== null) { + if (node.tag === SuspenseComponent) { + var state = node.memoizedState; + if (state !== null) { + var dehydrated = state.dehydrated; + if (dehydrated === null || isSuspenseInstancePending() || isSuspenseInstanceFallback()) { + return node; + } + } + } else if (node.tag === SuspenseListComponent && + // revealOrder undefined can't be trusted because it don't + // keep track of whether it suspended or not. + node.memoizedProps.revealOrder !== undefined) { + var didSuspend = (node.flags & DidCapture) !== NoFlags; + if (didSuspend) { + return node; + } + } else if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) { + return null; + } + while (node.sibling === null) { + if (node.return === null || node.return === row) { + return null; + } + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + return null; + } + var NoFlags$1 = /* */ + 0; // Represents whether effect should fire. + + var HasEffect = /* */ + 1; // Represents the phase in which the effect (not the clean-up) fires. + + var Insertion = /* */ + 2; + var Layout = /* */ + 4; + var Passive$1 = /* */ + 8; + + // and should be reset before starting a new render. + // This tracks which mutable sources need to be reset after a render. + + var workInProgressSources = []; + function resetWorkInProgressVersions() { + for (var i = 0; i < workInProgressSources.length; i++) { + var mutableSource = workInProgressSources[i]; + { + mutableSource._workInProgressVersionPrimary = null; + } + } + workInProgressSources.length = 0; + } + var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, + ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig; + var didWarnAboutMismatchedHooksForComponent; + var didWarnUncachedGetSnapshot; + { + didWarnAboutMismatchedHooksForComponent = new Set(); + } + + // These are set right before calling the component. + var renderLanes = NoLanes; // The work-in-progress fiber. I've named it differently to distinguish it from + // the work-in-progress hook. + + var currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The + // current hook list is the list that belongs to the current fiber. The + // work-in-progress hook list is a new list that will be added to the + // work-in-progress fiber. + + var currentHook = null; + var workInProgressHook = null; // Whether an update was scheduled at any point during the render phase. This + // does not get reset if we do another render pass; only when we're completely + // finished evaluating this component. This is an optimization so we know + // whether we need to clear render phase updates after a throw. + + var didScheduleRenderPhaseUpdate = false; // Where an update was scheduled only during the current render pass. This + // gets reset after each attempt. + // TODO: Maybe there's some way to consolidate this with + // `didScheduleRenderPhaseUpdate`. Or with `numberOfReRenders`. + + var didScheduleRenderPhaseUpdateDuringThisPass = false; // Counts the number of useId hooks in this component. + // hydration). This counter is global, so client ids are not stable across + // render attempts. + + var globalClientIdCounter = 0; + var RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook + + var currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders. + // The list stores the order of hooks used during the initial render (mount). + // Subsequent renders (updates) reference this list. + + var hookTypesDev = null; + var hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore + // the dependencies for Hooks that need them (e.g. useEffect or useMemo). + // When true, such Hooks will always be "remounted". Only used during hot reload. + + var ignorePreviousDependencies = false; + function mountHookTypesDev() { + { + var hookName = currentHookNameInDev; + if (hookTypesDev === null) { + hookTypesDev = [hookName]; + } else { + hookTypesDev.push(hookName); + } + } + } + function updateHookTypesDev() { + { + var hookName = currentHookNameInDev; + if (hookTypesDev !== null) { + hookTypesUpdateIndexDev++; + if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) { + warnOnHookMismatchInDev(hookName); + } + } + } + } + function checkDepsAreArrayDev(deps) { + { + if (deps !== undefined && deps !== null && !isArray(deps)) { + // Verify deps, but only on mount to avoid extra checks. + // It's unlikely their type would change as usually you define them inline. + error("%s received a final argument that is not an array (instead, received `%s`). When " + "specified, the final argument must be an array.", currentHookNameInDev, typeof deps); + } + } + } + function warnOnHookMismatchInDev(currentHookName) { + { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); + if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) { + didWarnAboutMismatchedHooksForComponent.add(componentName); + if (hookTypesDev !== null) { + var table = ""; + var secondColumnStart = 30; + for (var i = 0; i <= hookTypesUpdateIndexDev; i++) { + var oldHookName = hookTypesDev[i]; + var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName; + var row = i + 1 + ". " + oldHookName; // Extra space so second column lines up + // lol @ IE not supporting String#repeat + + while (row.length < secondColumnStart) { + row += " "; + } + row += newHookName + "\n"; + table += row; + } + error("React has detected a change in the order of Hooks called by %s. " + "This will lead to bugs and errors if not fixed. " + "For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n" + " Previous render Next render\n" + " ------------------------------------------------------\n" + "%s" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", componentName, table); + } + } + } + } + function throwInvalidHookError() { + throw new 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:\n" + "1. You might have mismatching versions of React and the renderer (such as React DOM)\n" + "2. You might be breaking the Rules of Hooks\n" + "3. You might have more than one copy of React in the same app\n" + "See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."); + } + function areHookInputsEqual(nextDeps, prevDeps) { + { + if (ignorePreviousDependencies) { + // Only true when this component is being hot reloaded. + return false; + } + } + if (prevDeps === null) { + { + error("%s received a final argument during this render, but not during " + "the previous render. Even though the final argument is optional, " + "its type cannot change between renders.", currentHookNameInDev); + } + return false; + } + { + // Don't bother comparing lengths in prod because these arrays should be + // passed inline. + if (nextDeps.length !== prevDeps.length) { + error("The final argument passed to %s changed size between renders. The " + "order and size of this array must remain constant.\n\n" + "Previous: %s\n" + "Incoming: %s", currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + nextDeps.join(", ") + "]"); + } + } + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) { + if (objectIs(nextDeps[i], prevDeps[i])) { + continue; + } + return false; + } + return true; + } + function renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderLanes) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber$1 = workInProgress; + { + hookTypesDev = current !== null ? current._debugHookTypes : null; + hookTypesUpdateIndexDev = -1; // Used for hot reloading: + + ignorePreviousDependencies = current !== null && current.type !== workInProgress.type; + } + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = NoLanes; // The following should have already been reset + // currentHook = null; + // workInProgressHook = null; + // didScheduleRenderPhaseUpdate = false; + // localIdCounter = 0; + // TODO Warn if no hooks are used at all during mount, then some are used during update. + // Currently we will identify the update render as a mount because memoizedState === null. + // This is tricky because it's valid for certain types of components (e.g. React.lazy) + // Using memoizedState to differentiate between mount/update only works if at least one stateful hook is used. + // Non-stateful hooks (e.g. context) don't get added to memoizedState, + // so memoizedState would be null during updates and mounts. + + { + if (current !== null && current.memoizedState !== null) { + ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV; + } else if (hookTypesDev !== null) { + // This dispatcher handles an edge case where a component is updating, + // but no stateful hooks have been used. + // We want to match the production code behavior (which will use HooksDispatcherOnMount), + // but with the extra DEV validation to ensure hooks ordering hasn't changed. + // This dispatcher does that. + ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV; + } else { + ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV; + } + } + var children = Component(props, secondArg); // Check if there was a render phase update + + if (didScheduleRenderPhaseUpdateDuringThisPass) { + // Keep rendering in a loop for as long as render phase updates continue to + // be scheduled. Use a counter to prevent infinite loops. + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass = false; + if (numberOfReRenders >= RE_RENDER_LIMIT) { + throw new Error("Too many re-renders. React limits the number of renders to prevent " + "an infinite loop."); + } + numberOfReRenders += 1; + { + // Even when hot reloading, allow dependencies to stabilize + // after first render to prevent infinite render phase updates. + ignorePreviousDependencies = false; + } // Start over from the beginning of the list + + currentHook = null; + workInProgressHook = null; + workInProgress.updateQueue = null; + { + // Also validate hook order for cascading updates. + hookTypesUpdateIndexDev = -1; + } + ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV; + children = Component(props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + } // We can assume the previous dispatcher is always this one, since we set it + // at the beginning of the render phase and there's no re-entrance. + + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; + { + workInProgress._debugHookTypes = hookTypesDev; + } // This check uses currentHook so that it works the same in DEV and prod bundles. + // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles. + + var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null; + renderLanes = NoLanes; + currentlyRenderingFiber$1 = null; + currentHook = null; + workInProgressHook = null; + { + currentHookNameInDev = null; + hookTypesDev = null; + hookTypesUpdateIndexDev = -1; // Confirm that a static flag was not added or removed since the last + // render. If this fires, it suggests that we incorrectly reset the static + // flags in some other part of the codebase. This has happened before, for + // example, in the SuspenseList implementation. + + if (current !== null && (current.flags & StaticMask) !== (workInProgress.flags & StaticMask) && + // Disable this warning in legacy mode, because legacy Suspense is weird + // and creates false positives. To make this work in legacy mode, we'd + // need to mark fibers that commit in an incomplete state, somehow. For + // now I'll disable the warning that most of the bugs that would trigger + // it are either exclusive to concurrent mode or exist in both. + (current.mode & ConcurrentMode) !== NoMode) { + error("Internal React error: Expected static flag was missing. Please " + "notify the React team."); + } + } + didScheduleRenderPhaseUpdate = false; // This is reset by checkDidRenderIdHook + // localIdCounter = 0; + + if (didRenderTooFewHooks) { + throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental " + "early return statement."); + } + return children; + } + function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; // TODO: Don't need to reset the flags here, because they're reset in the + // complete phase (bubbleProperties). + + { + workInProgress.flags &= ~(Passive | Update); + } + current.lanes = removeLanes(current.lanes, lanes); + } + function resetHooksAfterThrow() { + // We can assume the previous dispatcher is always this one, since we set it + // at the beginning of the render phase and there's no re-entrance. + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; + if (didScheduleRenderPhaseUpdate) { + // There were render phase updates. These are only valid for this render + // phase, which we are now aborting. Remove the updates from the queues so + // they do not persist to the next render. Do not remove updates from hooks + // that weren't processed. + // + // Only reset the updates from the queue if it has a clone. If it does + // not have a clone, that means it wasn't processed, and the updates were + // scheduled before we entered the render phase. + var hook = currentlyRenderingFiber$1.memoizedState; + while (hook !== null) { + var queue = hook.queue; + if (queue !== null) { + queue.pending = null; + } + hook = hook.next; + } + didScheduleRenderPhaseUpdate = false; + } + renderLanes = NoLanes; + currentlyRenderingFiber$1 = null; + currentHook = null; + workInProgressHook = null; + { + hookTypesDev = null; + hookTypesUpdateIndexDev = -1; + currentHookNameInDev = null; + isUpdatingOpaqueValueInRenderPhase = false; + } + didScheduleRenderPhaseUpdateDuringThisPass = false; + } + function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, + baseQueue: null, + queue: null, + next: null + }; + if (workInProgressHook === null) { + // This is the first hook in the list + currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook; + } else { + // Append to the end of the list + workInProgressHook = workInProgressHook.next = hook; + } + return workInProgressHook; + } + function updateWorkInProgressHook() { + // This function is used both for updates and for re-renders triggered by a + // render phase update. It assumes there is either a current hook we can + // clone, or a work-in-progress hook from a previous render pass that we can + // use as a base. When we reach the end of the base list, we must switch to + // the dispatcher used for mounts. + var nextCurrentHook; + if (currentHook === null) { + var current = currentlyRenderingFiber$1.alternate; + if (current !== null) { + nextCurrentHook = current.memoizedState; + } else { + nextCurrentHook = null; + } + } else { + nextCurrentHook = currentHook.next; + } + var nextWorkInProgressHook; + if (workInProgressHook === null) { + nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState; + } else { + nextWorkInProgressHook = workInProgressHook.next; + } + if (nextWorkInProgressHook !== null) { + // There's already a work-in-progress. Reuse it. + workInProgressHook = nextWorkInProgressHook; + nextWorkInProgressHook = workInProgressHook.next; + currentHook = nextCurrentHook; + } else { + // Clone from the current hook. + if (nextCurrentHook === null) { + throw new Error("Rendered more hooks than during the previous render."); + } + currentHook = nextCurrentHook; + var newHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + if (workInProgressHook === null) { + // This is the first hook in the list. + currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook; + } else { + // Append to the end of the list. + workInProgressHook = workInProgressHook.next = newHook; + } + } + return workInProgressHook; + } + function createFunctionComponentUpdateQueue() { + return { + lastEffect: null, + stores: null + }; + } + function basicStateReducer(state, action) { + // $FlowFixMe: Flow doesn't like mixed types + return typeof action === "function" ? action(state) : action; + } + function mountReducer(reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + var initialState; + if (init !== undefined) { + initialState = init(initialArg); + } else { + initialState = initialArg; + } + hook.memoizedState = hook.baseState = initialState; + var queue = { + pending: null, + interleaved: null, + lanes: NoLanes, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = queue; + var dispatch = queue.dispatch = dispatchReducerAction.bind(null, currentlyRenderingFiber$1, queue); + return [hook.memoizedState, dispatch]; + } + function updateReducer(reducer, initialArg, init) { + var hook = updateWorkInProgressHook(); + var queue = hook.queue; + if (queue === null) { + throw new Error("Should have a queue. This is likely a bug in React. Please file an issue."); + } + queue.lastRenderedReducer = reducer; + var current = currentHook; // The last rebase update that is NOT part of the base state. + + var baseQueue = current.baseQueue; // The last pending update that hasn't been processed yet. + + var pendingQueue = queue.pending; + if (pendingQueue !== null) { + // We have new updates that haven't been processed yet. + // We'll add them to the base queue. + if (baseQueue !== null) { + // Merge the pending queue and the base queue. + var baseFirst = baseQueue.next; + var pendingFirst = pendingQueue.next; + baseQueue.next = pendingFirst; + pendingQueue.next = baseFirst; + } + { + if (current.baseQueue !== baseQueue) { + // Internal invariant that should never happen, but feasibly could in + // the future if we implement resuming, or some form of that. + error("Internal error: Expected work-in-progress queue to be a clone. " + "This is a bug in React."); + } + } + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; + } + if (baseQueue !== null) { + // We have a queue to process. + var first = baseQueue.next; + var newState = current.baseState; + var newBaseState = null; + var newBaseQueueFirst = null; + var newBaseQueueLast = null; + var update = first; + do { + var updateLane = update.lane; + if (!isSubsetOfLanes(renderLanes, updateLane)) { + // Priority is insufficient. Skip this update. If this is the first + // skipped update, the previous update/state is the new base + // update/state. + var clone = { + lane: updateLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }; + if (newBaseQueueLast === null) { + newBaseQueueFirst = newBaseQueueLast = clone; + newBaseState = newState; + } else { + newBaseQueueLast = newBaseQueueLast.next = clone; + } // Update the remaining priority in the queue. + // TODO: Don't need to accumulate this. Instead, we can remove + // renderLanes from the original lanes. + + currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane); + markSkippedUpdateLanes(updateLane); + } else { + // This update does have sufficient priority. + if (newBaseQueueLast !== null) { + var _clone = { + // This update is going to be committed so we never want uncommit + // it. Using NoLane works because 0 is a subset of all bitmasks, so + // this will never be skipped by the check above. + lane: NoLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }; + newBaseQueueLast = newBaseQueueLast.next = _clone; + } // Process this update. + + if (update.hasEagerState) { + // If this update is a state update (not a reducer) and was processed eagerly, + // we can use the eagerly computed state + newState = update.eagerState; + } else { + var action = update.action; + newState = reducer(newState, action); + } + } + update = update.next; + } while (update !== null && update !== first); + if (newBaseQueueLast === null) { + newBaseState = newState; + } else { + newBaseQueueLast.next = newBaseQueueFirst; + } // Mark that the fiber performed work, but only if the new state is + // different from the current state. + + if (!objectIs(newState, hook.memoizedState)) { + markWorkInProgressReceivedUpdate(); + } + hook.memoizedState = newState; + hook.baseState = newBaseState; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = newState; + } // Interleaved updates are stored on a separate queue. We aren't going to + // process them during this render, but we do need to track which lanes + // are remaining. + + var lastInterleaved = queue.interleaved; + if (lastInterleaved !== null) { + var interleaved = lastInterleaved; + do { + var interleavedLane = interleaved.lane; + currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, interleavedLane); + markSkippedUpdateLanes(interleavedLane); + interleaved = interleaved.next; + } while (interleaved !== lastInterleaved); + } else if (baseQueue === null) { + // `queue.lanes` is used for entangling transitions. We can set it back to + // zero once the queue is empty. + queue.lanes = NoLanes; + } + var dispatch = queue.dispatch; + return [hook.memoizedState, dispatch]; + } + function rerenderReducer(reducer, initialArg, init) { + var hook = updateWorkInProgressHook(); + var queue = hook.queue; + if (queue === null) { + throw new Error("Should have a queue. This is likely a bug in React. Please file an issue."); + } + queue.lastRenderedReducer = reducer; // This is a re-render. Apply the new render phase updates to the previous + // work-in-progress hook. + + var dispatch = queue.dispatch; + var lastRenderPhaseUpdate = queue.pending; + var newState = hook.memoizedState; + if (lastRenderPhaseUpdate !== null) { + // The queue doesn't persist past this render pass. + queue.pending = null; + var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next; + var update = firstRenderPhaseUpdate; + do { + // Process this render phase update. We don't have to check the + // priority because it will always be the same as the current + // render's. + var action = update.action; + newState = reducer(newState, action); + update = update.next; + } while (update !== firstRenderPhaseUpdate); // Mark that the fiber performed work, but only if the new state is + // different from the current state. + + if (!objectIs(newState, hook.memoizedState)) { + markWorkInProgressReceivedUpdate(); + } + hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to + // the base state unless the queue is empty. + // TODO: Not sure if this is the desired semantics, but it's what we + // do for gDSFP. I can't remember why. + + if (hook.baseQueue === null) { + hook.baseState = newState; + } + queue.lastRenderedState = newState; + } + return [newState, dispatch]; + } + function mountMutableSource(source, getSnapshot, subscribe) { + { + return undefined; + } + } + function updateMutableSource(source, getSnapshot, subscribe) { + { + return undefined; + } + } + function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber$1; + var hook = mountWorkInProgressHook(); + var nextSnapshot; + { + nextSnapshot = getSnapshot(); + { + if (!didWarnUncachedGetSnapshot) { + var cachedSnapshot = getSnapshot(); + if (!objectIs(nextSnapshot, cachedSnapshot)) { + error("The result of getSnapshot should be cached to avoid an infinite loop"); + didWarnUncachedGetSnapshot = true; + } + } + } // Unless we're rendering a blocking lane, schedule a consistency check. + // Right before committing, we will walk the tree and check if any of the + // stores were mutated. + // + // We won't do this if we're hydrating server-rendered content, because if + // the content is stale, it's already visible anyway. Instead we'll patch + // it up in a passive effect. + + var root = getWorkInProgressRoot(); + if (root === null) { + throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue."); + } + if (!includesBlockingLane(root, renderLanes)) { + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + } + } // Read the current snapshot from the store on every render. This breaks the + // normal rules of React, and only works because store updates are + // always synchronous. + + hook.memoizedState = nextSnapshot; + var inst = { + value: nextSnapshot, + getSnapshot: getSnapshot + }; + hook.queue = inst; // Schedule an effect to subscribe to the store. + + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]); // Schedule an effect to update the mutable instance fields. We will update + // this whenever subscribe, getSnapshot, or value changes. Because there's no + // clean-up function, and we track the deps correctly, we can call pushEffect + // directly, without storing any additional state. For the same reason, we + // don't need to set a static flag, either. + // TODO: We can move this to the passive phase once we add a pre-commit + // consistency check. See the next comment. + + fiber.flags |= Passive; + pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), undefined, null); + return nextSnapshot; + } + function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber$1; + var hook = updateWorkInProgressHook(); // Read the current snapshot from the store on every render. This breaks the + // normal rules of React, and only works because store updates are + // always synchronous. + + var nextSnapshot = getSnapshot(); + { + if (!didWarnUncachedGetSnapshot) { + var cachedSnapshot = getSnapshot(); + if (!objectIs(nextSnapshot, cachedSnapshot)) { + error("The result of getSnapshot should be cached to avoid an infinite loop"); + didWarnUncachedGetSnapshot = true; + } + } + } + var prevSnapshot = hook.memoizedState; + var snapshotChanged = !objectIs(prevSnapshot, nextSnapshot); + if (snapshotChanged) { + hook.memoizedState = nextSnapshot; + markWorkInProgressReceivedUpdate(); + } + var inst = hook.queue; + updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]); // Whenever getSnapshot or subscribe changes, we need to check in the + // commit phase if there was an interleaved mutation. In concurrent mode + // this can happen all the time, but even in synchronous mode, an earlier + // effect may have mutated the store. + + if (inst.getSnapshot !== getSnapshot || snapshotChanged || + // Check if the susbcribe function changed. We can save some memory by + // checking whether we scheduled a subscription effect above. + workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) { + fiber.flags |= Passive; + pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), undefined, null); // Unless we're rendering a blocking lane, schedule a consistency check. + // Right before committing, we will walk the tree and check if any of the + // stores were mutated. + + var root = getWorkInProgressRoot(); + if (root === null) { + throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue."); + } + if (!includesBlockingLane(root, renderLanes)) { + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + } + } + return nextSnapshot; + } + function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= StoreConsistency; + var check = { + getSnapshot: getSnapshot, + value: renderedSnapshot + }; + var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; + if (componentUpdateQueue === null) { + componentUpdateQueue = createFunctionComponentUpdateQueue(); + currentlyRenderingFiber$1.updateQueue = componentUpdateQueue; + componentUpdateQueue.stores = [check]; + } else { + var stores = componentUpdateQueue.stores; + if (stores === null) { + componentUpdateQueue.stores = [check]; + } else { + stores.push(check); + } + } + } + function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + // These are updated in the passive phase + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; // Something may have been mutated in between render and commit. This could + // have been in an event that fired before the passive effects, or it could + // have been in a layout effect. In that case, we would have used the old + // snapsho and getSnapshot values to bail out. We need to check one more time. + + if (checkIfSnapshotChanged(inst)) { + // Force a re-render. + forceStoreRerender(fiber); + } + } + function subscribeToStore(fiber, inst, subscribe) { + var handleStoreChange = function handleStoreChange() { + // The store changed. Check if the snapshot changed since the last time we + // read from the store. + if (checkIfSnapshotChanged(inst)) { + // Force a re-render. + forceStoreRerender(fiber); + } + }; // Subscribe to the store and return a clean-up function. + + return subscribe(handleStoreChange); + } + function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + var prevValue = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(prevValue, nextValue); + } catch (error) { + return true; + } + } + function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + } + function mountState(initialState) { + var hook = mountWorkInProgressHook(); + if (typeof initialState === "function") { + // $FlowFixMe: Flow doesn't like mixed types + initialState = initialState(); + } + hook.memoizedState = hook.baseState = initialState; + var queue = { + pending: null, + interleaved: null, + lanes: NoLanes, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + hook.queue = queue; + var dispatch = queue.dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); + return [hook.memoizedState, dispatch]; + } + function updateState(initialState) { + return updateReducer(basicStateReducer); + } + function rerenderState(initialState) { + return rerenderReducer(basicStateReducer); + } + function pushEffect(tag, create, destroy, deps) { + var effect = { + tag: tag, + create: create, + destroy: destroy, + deps: deps, + // Circular + next: null + }; + var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; + if (componentUpdateQueue === null) { + componentUpdateQueue = createFunctionComponentUpdateQueue(); + currentlyRenderingFiber$1.updateQueue = componentUpdateQueue; + componentUpdateQueue.lastEffect = effect.next = effect; + } else { + var lastEffect = componentUpdateQueue.lastEffect; + if (lastEffect === null) { + componentUpdateQueue.lastEffect = effect.next = effect; + } else { + var firstEffect = lastEffect.next; + lastEffect.next = effect; + effect.next = firstEffect; + componentUpdateQueue.lastEffect = effect; + } + } + return effect; + } + function mountRef(initialValue) { + var hook = mountWorkInProgressHook(); + { + var _ref2 = { + current: initialValue + }; + hook.memoizedState = _ref2; + return _ref2; + } + } + function updateRef(initialValue) { + var hook = updateWorkInProgressHook(); + return hook.memoizedState; + } + function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + currentlyRenderingFiber$1.flags |= fiberFlags; + hook.memoizedState = pushEffect(HasEffect | hookFlags, create, undefined, nextDeps); + } + function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var destroy = undefined; + if (currentHook !== null) { + var prevEffect = currentHook.memoizedState; + destroy = prevEffect.destroy; + if (nextDeps !== null) { + var prevDeps = prevEffect.deps; + if (areHookInputsEqual(nextDeps, prevDeps)) { + hook.memoizedState = pushEffect(hookFlags, create, destroy, nextDeps); + return; + } + } + } + currentlyRenderingFiber$1.flags |= fiberFlags; + hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps); + } + function mountEffect(create, deps) { + { + return mountEffectImpl(Passive | PassiveStatic, Passive$1, create, deps); + } + } + function updateEffect(create, deps) { + return updateEffectImpl(Passive, Passive$1, create, deps); + } + function mountInsertionEffect(create, deps) { + return mountEffectImpl(Update, Insertion, create, deps); + } + function updateInsertionEffect(create, deps) { + return updateEffectImpl(Update, Insertion, create, deps); + } + function mountLayoutEffect(create, deps) { + var fiberFlags = Update; + return mountEffectImpl(fiberFlags, Layout, create, deps); + } + function updateLayoutEffect(create, deps) { + return updateEffectImpl(Update, Layout, create, deps); + } + function imperativeHandleEffect(create, ref) { + if (typeof ref === "function") { + var refCallback = ref; + var _inst = create(); + refCallback(_inst); + return function () { + refCallback(null); + }; + } else if (ref !== null && ref !== undefined) { + var refObject = ref; + { + if (!refObject.hasOwnProperty("current")) { + error("Expected useImperativeHandle() first argument to either be a " + "ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(refObject).join(", ") + "}"); + } + } + var _inst2 = create(); + refObject.current = _inst2; + return function () { + refObject.current = null; + }; + } + } + function mountImperativeHandle(ref, create, deps) { + { + if (typeof create !== "function") { + error("Expected useImperativeHandle() second argument to be a function " + "that creates a handle. Instead received: %s.", create !== null ? typeof create : "null"); + } + } // TODO: If deps are provided, should we skip comparing the ref itself? + + var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; + var fiberFlags = Update; + return mountEffectImpl(fiberFlags, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps); + } + function updateImperativeHandle(ref, create, deps) { + { + if (typeof create !== "function") { + error("Expected useImperativeHandle() second argument to be a function " + "that creates a handle. Instead received: %s.", create !== null ? typeof create : "null"); + } + } // TODO: If deps are provided, should we skip comparing the ref itself? + + var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; + return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps); + } + function mountDebugValue(value, formatterFn) { + // This hook is normally a no-op. + // The react-debug-hooks package injects its own implementation + // so that e.g. DevTools can display custom hook values. + } + var updateDebugValue = mountDebugValue; + function mountCallback(callback, deps) { + var hook = mountWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + hook.memoizedState = [callback, nextDeps]; + return callback; + } + function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var prevState = hook.memoizedState; + if (prevState !== null) { + if (nextDeps !== null) { + var prevDeps = prevState[1]; + if (areHookInputsEqual(nextDeps, prevDeps)) { + return prevState[0]; + } + } + } + hook.memoizedState = [callback, nextDeps]; + return callback; + } + function mountMemo(nextCreate, deps) { + var hook = mountWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var nextValue = nextCreate(); + hook.memoizedState = [nextValue, nextDeps]; + return nextValue; + } + function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var prevState = hook.memoizedState; + if (prevState !== null) { + // Assume these are defined. If they're not, areHookInputsEqual will warn. + if (nextDeps !== null) { + var prevDeps = prevState[1]; + if (areHookInputsEqual(nextDeps, prevDeps)) { + return prevState[0]; + } + } + } + var nextValue = nextCreate(); + hook.memoizedState = [nextValue, nextDeps]; + return nextValue; + } + function mountDeferredValue(value) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = value; + return value; + } + function updateDeferredValue(value) { + var hook = updateWorkInProgressHook(); + var resolvedCurrentHook = currentHook; + var prevValue = resolvedCurrentHook.memoizedState; + return updateDeferredValueImpl(hook, prevValue, value); + } + function rerenderDeferredValue(value) { + var hook = updateWorkInProgressHook(); + if (currentHook === null) { + // This is a rerender during a mount. + hook.memoizedState = value; + return value; + } else { + // This is a rerender during an update. + var prevValue = currentHook.memoizedState; + return updateDeferredValueImpl(hook, prevValue, value); + } + } + function updateDeferredValueImpl(hook, prevValue, value) { + var shouldDeferValue = !includesOnlyNonUrgentLanes(renderLanes); + if (shouldDeferValue) { + // This is an urgent update. If the value has changed, keep using the + // previous value and spawn a deferred render to update it later. + if (!objectIs(value, prevValue)) { + // Schedule a deferred render + var deferredLane = claimNextTransitionLane(); + currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, deferredLane); + markSkippedUpdateLanes(deferredLane); // Set this to true to indicate that the rendered value is inconsistent + // from the latest value. The name "baseState" doesn't really match how we + // use it because we're reusing a state hook field instead of creating a + // new one. + + hook.baseState = true; + } // Reuse the previous value + + return prevValue; + } else { + // This is not an urgent update, so we can use the latest value regardless + // of what it is. No need to defer it. + // However, if we're currently inside a spawned render, then we need to mark + // this as an update to prevent the fiber from bailing out. + // + // `baseState` is true when the current value is different from the rendered + // value. The name doesn't really match how we use it because we're reusing + // a state hook field instead of creating a new one. + if (hook.baseState) { + // Flip this back to false. + hook.baseState = false; + markWorkInProgressReceivedUpdate(); + } + hook.memoizedState = value; + return value; + } + } + function startTransition(setPending, callback, options) { + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(higherEventPriority(previousPriority, ContinuousEventPriority)); + setPending(true); + var prevTransition = ReactCurrentBatchConfig$1.transition; + ReactCurrentBatchConfig$1.transition = {}; + var currentTransition = ReactCurrentBatchConfig$1.transition; + { + ReactCurrentBatchConfig$1.transition._updatedFibers = new Set(); + } + try { + setPending(false); + callback(); + } finally { + setCurrentUpdatePriority(previousPriority); + ReactCurrentBatchConfig$1.transition = prevTransition; + { + if (prevTransition === null && currentTransition._updatedFibers) { + var updatedFibersCount = currentTransition._updatedFibers.size; + if (updatedFibersCount > 10) { + warn("Detected a large number of updates inside startTransition. " + "If this is due to a subscription please re-write it to use React provided hooks. " + "Otherwise concurrent mode guarantees are off the table."); + } + currentTransition._updatedFibers.clear(); + } + } + } + } + function mountTransition() { + var _mountState = mountState(false), + isPending = _mountState[0], + setPending = _mountState[1]; // The `start` method never changes. + + var start = startTransition.bind(null, setPending); + var hook = mountWorkInProgressHook(); + hook.memoizedState = start; + return [isPending, start]; + } + function updateTransition() { + var _updateState = updateState(), + isPending = _updateState[0]; + var hook = updateWorkInProgressHook(); + var start = hook.memoizedState; + return [isPending, start]; + } + function rerenderTransition() { + var _rerenderState = rerenderState(), + isPending = _rerenderState[0]; + var hook = updateWorkInProgressHook(); + var start = hook.memoizedState; + return [isPending, start]; + } + var isUpdatingOpaqueValueInRenderPhase = false; + function getIsUpdatingOpaqueValueInRenderPhaseInDEV() { + { + return isUpdatingOpaqueValueInRenderPhase; + } + } + function mountId() { + var hook = mountWorkInProgressHook(); + var root = getWorkInProgressRoot(); // TODO: In Fizz, id generation is specific to each server config. Maybe we + // should do this in Fiber, too? Deferring this decision for now because + // there's no other place to store the prefix except for an internal field on + // the public createRoot object, which the fiber tree does not currently have + // a reference to. + + var identifierPrefix = root.identifierPrefix; + var id; + { + // Use a lowercase r prefix for client-generated ids. + var globalClientId = globalClientIdCounter++; + id = ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; + } + hook.memoizedState = id; + return id; + } + function updateId() { + var hook = updateWorkInProgressHook(); + var id = hook.memoizedState; + return id; + } + function dispatchReducerAction(fiber, queue, action) { + { + if (typeof arguments[3] === "function") { + error("State updates from the useState() and useReducer() Hooks don't support the " + "second callback argument. To execute a side effect after " + "rendering, declare it in the component body with useEffect()."); + } + } + var lane = requestUpdateLane(fiber); + var update = { + lane: lane, + action: action, + hasEagerState: false, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + enqueueRenderPhaseUpdate(queue, update); + } else { + var root = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (root !== null) { + var eventTime = requestEventTime(); + scheduleUpdateOnFiber(root, fiber, lane, eventTime); + entangleTransitionUpdate(root, queue, lane); + } + } + } + function dispatchSetState(fiber, queue, action) { + { + if (typeof arguments[3] === "function") { + error("State updates from the useState() and useReducer() Hooks don't support the " + "second callback argument. To execute a side effect after " + "rendering, declare it in the component body with useEffect()."); + } + } + var lane = requestUpdateLane(fiber); + var update = { + lane: lane, + action: action, + hasEagerState: false, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + enqueueRenderPhaseUpdate(queue, update); + } else { + var alternate = fiber.alternate; + if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) { + // The queue is currently empty, which means we can eagerly compute the + // next state before entering the render phase. If the new state is the + // same as the current state, we may be able to bail out entirely. + var lastRenderedReducer = queue.lastRenderedReducer; + if (lastRenderedReducer !== null) { + var prevDispatcher; + { + prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + } + try { + var currentState = queue.lastRenderedState; + var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute + // it, on the update object. If the reducer hasn't changed by the + // time we enter the render phase, then the eager state can be used + // without calling the reducer again. + + update.hasEagerState = true; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) { + // Fast path. We can bail out without scheduling React to re-render. + // It's still possible that we'll need to rebase this update later, + // if the component re-renders for a different reason and by that + // time the reducer has changed. + // TODO: Do we still need to entangle transitions in this case? + enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane); + return; + } + } catch (error) { + // Suppress the error. It will throw again in the render phase. + } finally { + { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + } + } + } + var root = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (root !== null) { + var eventTime = requestEventTime(); + scheduleUpdateOnFiber(root, fiber, lane, eventTime); + entangleTransitionUpdate(root, queue, lane); + } + } + } + function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1; + } + function enqueueRenderPhaseUpdate(queue, update) { + // This is a render phase update. Stash it in a lazily-created map of + // queue -> linked list of updates. After this render pass, we'll restart + // and apply the stashed updates on top of the work-in-progress hook. + didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true; + var pending = queue.pending; + if (pending === null) { + // This is the first update. Create a circular list. + update.next = update; + } else { + update.next = pending.next; + pending.next = update; + } + queue.pending = update; + } // TODO: Move to ReactFiberConcurrentUpdates? + + function entangleTransitionUpdate(root, queue, lane) { + if (isTransitionLane(lane)) { + var queueLanes = queue.lanes; // If any entangled lanes are no longer pending on the root, then they + // must have finished. We can remove them from the shared queue, which + // represents a superset of the actually pending lanes. In some cases we + // may entangle more than we need to, but that's OK. In fact it's worse if + // we *don't* entangle when we should. + + queueLanes = intersectLanes(queueLanes, root.pendingLanes); // Entangle the new transition lane with the other transition lanes. + + var newQueueLanes = mergeLanes(queueLanes, lane); + queue.lanes = newQueueLanes; // Even if queue.lanes already include lane, we don't know for certain if + // the lane finished since the last time we entangled it. So we need to + // entangle it again, just to be sure. + + markRootEntangled(root, newQueueLanes); + } + } + var ContextOnlyDispatcher = { + readContext: _readContext, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useMutableSource: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + unstable_isNewReconciler: enableNewReconciler + }; + var HooksDispatcherOnMountInDEV = null; + var HooksDispatcherOnMountWithHookTypesInDEV = null; + var HooksDispatcherOnUpdateInDEV = null; + var HooksDispatcherOnRerenderInDEV = null; + var InvalidNestedHooksDispatcherOnMountInDEV = null; + var InvalidNestedHooksDispatcherOnUpdateInDEV = null; + var InvalidNestedHooksDispatcherOnRerenderInDEV = null; + { + var warnInvalidContextAccess = function warnInvalidContextAccess() { + 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()."); + }; + var warnInvalidHookAccess = function warnInvalidHookAccess() { + error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. " + "You can only call Hooks at the top level of your React function. " + "For more information, see " + "https://react.dev/link/rules-of-hooks"); + }; + HooksDispatcherOnMountInDEV = { + readContext: function readContext(context) { + return _readContext(context); + }, + useCallback: function useCallback(callback, deps) { + currentHookNameInDev = "useCallback"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountCallback(callback, deps); + }, + useContext: function useContext(context) { + currentHookNameInDev = "useContext"; + mountHookTypesDev(); + return _readContext(context); + }, + useEffect: function useEffect(create, deps) { + currentHookNameInDev = "useEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountEffect(create, deps); + }, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + currentHookNameInDev = "useInsertionEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountInsertionEffect(create, deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + currentHookNameInDev = "useLayoutEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountLayoutEffect(create, deps); + }, + useMemo: function useMemo(create, deps) { + currentHookNameInDev = "useMemo"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function useReducer(reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function useRef(initialValue) { + currentHookNameInDev = "useRef"; + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function useState(initialState) { + currentHookNameInDev = "useState"; + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function useDebugValue(value, formatterFn) { + currentHookNameInDev = "useDebugValue"; + mountHookTypesDev(); + return mountDebugValue(); + }, + useDeferredValue: function useDeferredValue(value) { + currentHookNameInDev = "useDeferredValue"; + mountHookTypesDev(); + return mountDeferredValue(value); + }, + useTransition: function useTransition() { + currentHookNameInDev = "useTransition"; + mountHookTypesDev(); + return mountTransition(); + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + currentHookNameInDev = "useMutableSource"; + mountHookTypesDev(); + return mountMutableSource(); + }, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + mountHookTypesDev(); + return mountSyncExternalStore(subscribe, getSnapshot); + }, + useId: function useId() { + currentHookNameInDev = "useId"; + mountHookTypesDev(); + return mountId(); + }, + unstable_isNewReconciler: enableNewReconciler + }; + HooksDispatcherOnMountWithHookTypesInDEV = { + readContext: function readContext(context) { + return _readContext(context); + }, + useCallback: function useCallback(callback, deps) { + currentHookNameInDev = "useCallback"; + updateHookTypesDev(); + return mountCallback(callback, deps); + }, + useContext: function useContext(context) { + currentHookNameInDev = "useContext"; + updateHookTypesDev(); + return _readContext(context); + }, + useEffect: function useEffect(create, deps) { + currentHookNameInDev = "useEffect"; + updateHookTypesDev(); + return mountEffect(create, deps); + }, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + updateHookTypesDev(); + return mountImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + currentHookNameInDev = "useInsertionEffect"; + updateHookTypesDev(); + return mountInsertionEffect(create, deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + currentHookNameInDev = "useLayoutEffect"; + updateHookTypesDev(); + return mountLayoutEffect(create, deps); + }, + useMemo: function useMemo(create, deps) { + currentHookNameInDev = "useMemo"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function useReducer(reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function useRef(initialValue) { + currentHookNameInDev = "useRef"; + updateHookTypesDev(); + return mountRef(initialValue); + }, + useState: function useState(initialState) { + currentHookNameInDev = "useState"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function useDebugValue(value, formatterFn) { + currentHookNameInDev = "useDebugValue"; + updateHookTypesDev(); + return mountDebugValue(); + }, + useDeferredValue: function useDeferredValue(value) { + currentHookNameInDev = "useDeferredValue"; + updateHookTypesDev(); + return mountDeferredValue(value); + }, + useTransition: function useTransition() { + currentHookNameInDev = "useTransition"; + updateHookTypesDev(); + return mountTransition(); + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + currentHookNameInDev = "useMutableSource"; + updateHookTypesDev(); + return mountMutableSource(); + }, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + updateHookTypesDev(); + return mountSyncExternalStore(subscribe, getSnapshot); + }, + useId: function useId() { + currentHookNameInDev = "useId"; + updateHookTypesDev(); + return mountId(); + }, + unstable_isNewReconciler: enableNewReconciler + }; + HooksDispatcherOnUpdateInDEV = { + readContext: function readContext(context) { + return _readContext(context); + }, + useCallback: function useCallback(callback, deps) { + currentHookNameInDev = "useCallback"; + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function useContext(context) { + currentHookNameInDev = "useContext"; + updateHookTypesDev(); + return _readContext(context); + }, + useEffect: function useEffect(create, deps) { + currentHookNameInDev = "useEffect"; + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + currentHookNameInDev = "useInsertionEffect"; + updateHookTypesDev(); + return updateInsertionEffect(create, deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + currentHookNameInDev = "useLayoutEffect"; + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function useMemo(create, deps) { + currentHookNameInDev = "useMemo"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function useReducer(reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function useRef(initialValue) { + currentHookNameInDev = "useRef"; + updateHookTypesDev(); + return updateRef(); + }, + useState: function useState(initialState) { + currentHookNameInDev = "useState"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function useDebugValue(value, formatterFn) { + currentHookNameInDev = "useDebugValue"; + updateHookTypesDev(); + return updateDebugValue(); + }, + useDeferredValue: function useDeferredValue(value) { + currentHookNameInDev = "useDeferredValue"; + updateHookTypesDev(); + return updateDeferredValue(value); + }, + useTransition: function useTransition() { + currentHookNameInDev = "useTransition"; + updateHookTypesDev(); + return updateTransition(); + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + currentHookNameInDev = "useMutableSource"; + updateHookTypesDev(); + return updateMutableSource(); + }, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + updateHookTypesDev(); + return updateSyncExternalStore(subscribe, getSnapshot); + }, + useId: function useId() { + currentHookNameInDev = "useId"; + updateHookTypesDev(); + return updateId(); + }, + unstable_isNewReconciler: enableNewReconciler + }; + HooksDispatcherOnRerenderInDEV = { + readContext: function readContext(context) { + return _readContext(context); + }, + useCallback: function useCallback(callback, deps) { + currentHookNameInDev = "useCallback"; + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function useContext(context) { + currentHookNameInDev = "useContext"; + updateHookTypesDev(); + return _readContext(context); + }, + useEffect: function useEffect(create, deps) { + currentHookNameInDev = "useEffect"; + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + currentHookNameInDev = "useInsertionEffect"; + updateHookTypesDev(); + return updateInsertionEffect(create, deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + currentHookNameInDev = "useLayoutEffect"; + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function useMemo(create, deps) { + currentHookNameInDev = "useMemo"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV; + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function useReducer(reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV; + try { + return rerenderReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function useRef(initialValue) { + currentHookNameInDev = "useRef"; + updateHookTypesDev(); + return updateRef(); + }, + useState: function useState(initialState) { + currentHookNameInDev = "useState"; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV; + try { + return rerenderState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function useDebugValue(value, formatterFn) { + currentHookNameInDev = "useDebugValue"; + updateHookTypesDev(); + return updateDebugValue(); + }, + useDeferredValue: function useDeferredValue(value) { + currentHookNameInDev = "useDeferredValue"; + updateHookTypesDev(); + return rerenderDeferredValue(value); + }, + useTransition: function useTransition() { + currentHookNameInDev = "useTransition"; + updateHookTypesDev(); + return rerenderTransition(); + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + currentHookNameInDev = "useMutableSource"; + updateHookTypesDev(); + return updateMutableSource(); + }, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + updateHookTypesDev(); + return updateSyncExternalStore(subscribe, getSnapshot); + }, + useId: function useId() { + currentHookNameInDev = "useId"; + updateHookTypesDev(); + return updateId(); + }, + unstable_isNewReconciler: enableNewReconciler + }; + InvalidNestedHooksDispatcherOnMountInDEV = { + readContext: function readContext(context) { + warnInvalidContextAccess(); + return _readContext(context); + }, + useCallback: function useCallback(callback, deps) { + currentHookNameInDev = "useCallback"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountCallback(callback, deps); + }, + useContext: function useContext(context) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return _readContext(context); + }, + useEffect: function useEffect(create, deps) { + currentHookNameInDev = "useEffect"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountEffect(create, deps); + }, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + currentHookNameInDev = "useInsertionEffect"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountInsertionEffect(create, deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + currentHookNameInDev = "useLayoutEffect"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountLayoutEffect(create, deps); + }, + useMemo: function useMemo(create, deps) { + currentHookNameInDev = "useMemo"; + warnInvalidHookAccess(); + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function useReducer(reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + warnInvalidHookAccess(); + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function useRef(initialValue) { + currentHookNameInDev = "useRef"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function useState(initialState) { + currentHookNameInDev = "useState"; + warnInvalidHookAccess(); + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function useDebugValue(value, formatterFn) { + currentHookNameInDev = "useDebugValue"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountDebugValue(); + }, + useDeferredValue: function useDeferredValue(value) { + currentHookNameInDev = "useDeferredValue"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountDeferredValue(value); + }, + useTransition: function useTransition() { + currentHookNameInDev = "useTransition"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountTransition(); + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + currentHookNameInDev = "useMutableSource"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountMutableSource(); + }, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountSyncExternalStore(subscribe, getSnapshot); + }, + useId: function useId() { + currentHookNameInDev = "useId"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountId(); + }, + unstable_isNewReconciler: enableNewReconciler + }; + InvalidNestedHooksDispatcherOnUpdateInDEV = { + readContext: function readContext(context) { + warnInvalidContextAccess(); + return _readContext(context); + }, + useCallback: function useCallback(callback, deps) { + currentHookNameInDev = "useCallback"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function useContext(context) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return _readContext(context); + }, + useEffect: function useEffect(create, deps) { + currentHookNameInDev = "useEffect"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + currentHookNameInDev = "useInsertionEffect"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateInsertionEffect(create, deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + currentHookNameInDev = "useLayoutEffect"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function useMemo(create, deps) { + currentHookNameInDev = "useMemo"; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function useReducer(reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function useRef(initialValue) { + currentHookNameInDev = "useRef"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateRef(); + }, + useState: function useState(initialState) { + currentHookNameInDev = "useState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function useDebugValue(value, formatterFn) { + currentHookNameInDev = "useDebugValue"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateDebugValue(); + }, + useDeferredValue: function useDeferredValue(value) { + currentHookNameInDev = "useDeferredValue"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateDeferredValue(value); + }, + useTransition: function useTransition() { + currentHookNameInDev = "useTransition"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateTransition(); + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + currentHookNameInDev = "useMutableSource"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateMutableSource(); + }, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateSyncExternalStore(subscribe, getSnapshot); + }, + useId: function useId() { + currentHookNameInDev = "useId"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateId(); + }, + unstable_isNewReconciler: enableNewReconciler + }; + InvalidNestedHooksDispatcherOnRerenderInDEV = { + readContext: function readContext(context) { + warnInvalidContextAccess(); + return _readContext(context); + }, + useCallback: function useCallback(callback, deps) { + currentHookNameInDev = "useCallback"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function useContext(context) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return _readContext(context); + }, + useEffect: function useEffect(create, deps) { + currentHookNameInDev = "useEffect"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + currentHookNameInDev = "useInsertionEffect"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateInsertionEffect(create, deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + currentHookNameInDev = "useLayoutEffect"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function useMemo(create, deps) { + currentHookNameInDev = "useMemo"; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function useReducer(reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return rerenderReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function useRef(initialValue) { + currentHookNameInDev = "useRef"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateRef(); + }, + useState: function useState(initialState) { + currentHookNameInDev = "useState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return rerenderState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function useDebugValue(value, formatterFn) { + currentHookNameInDev = "useDebugValue"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateDebugValue(); + }, + useDeferredValue: function useDeferredValue(value) { + currentHookNameInDev = "useDeferredValue"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderDeferredValue(value); + }, + useTransition: function useTransition() { + currentHookNameInDev = "useTransition"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderTransition(); + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + currentHookNameInDev = "useMutableSource"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateMutableSource(); + }, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateSyncExternalStore(subscribe, getSnapshot); + }, + useId: function useId() { + currentHookNameInDev = "useId"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateId(); + }, + unstable_isNewReconciler: enableNewReconciler + }; + } + var now$1 = Scheduler.unstable_now; + var commitTime = 0; + var layoutEffectStartTime = -1; + var profilerStartTime = -1; + var passiveEffectStartTime = -1; + /** + * Tracks whether the current update was a nested/cascading update (scheduled from a layout effect). + * + * The overall sequence is: + * 1. render + * 2. commit (and call `onRender`, `onCommit`) + * 3. check for nested updates + * 4. flush passive effects (and call `onPostCommit`) + * + * Nested updates are identified in step 3 above, + * but step 4 still applies to the work that was just committed. + * We use two flags to track nested updates then: + * one tracks whether the upcoming update is a nested update, + * and the other tracks whether the current update was a nested update. + * The first value gets synced to the second at the start of the render phase. + */ + + var currentUpdateIsNested = false; + var nestedUpdateScheduled = false; + function isCurrentUpdateNested() { + return currentUpdateIsNested; + } + function markNestedUpdateScheduled() { + { + nestedUpdateScheduled = true; + } + } + function resetNestedUpdateFlag() { + { + currentUpdateIsNested = false; + nestedUpdateScheduled = false; + } + } + function syncNestedUpdateFlag() { + { + currentUpdateIsNested = nestedUpdateScheduled; + nestedUpdateScheduled = false; + } + } + function getCommitTime() { + return commitTime; + } + function recordCommitTime() { + commitTime = now$1(); + } + function startProfilerTimer(fiber) { + profilerStartTime = now$1(); + if (fiber.actualStartTime < 0) { + fiber.actualStartTime = now$1(); + } + } + function stopProfilerTimerIfRunning(fiber) { + profilerStartTime = -1; + } + function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (profilerStartTime >= 0) { + var elapsedTime = now$1() - profilerStartTime; + fiber.actualDuration += elapsedTime; + if (overrideBaseTime) { + fiber.selfBaseDuration = elapsedTime; + } + profilerStartTime = -1; + } + } + function recordLayoutEffectDuration(fiber) { + if (layoutEffectStartTime >= 0) { + var elapsedTime = now$1() - layoutEffectStartTime; + layoutEffectStartTime = -1; // Store duration on the next nearest Profiler ancestor + // Or the root (for the DevTools Profiler to read) + + var parentFiber = fiber.return; + while (parentFiber !== null) { + switch (parentFiber.tag) { + case HostRoot: + var root = parentFiber.stateNode; + root.effectDuration += elapsedTime; + return; + case Profiler: + var parentStateNode = parentFiber.stateNode; + parentStateNode.effectDuration += elapsedTime; + return; + } + parentFiber = parentFiber.return; + } + } + } + function recordPassiveEffectDuration(fiber) { + if (passiveEffectStartTime >= 0) { + var elapsedTime = now$1() - passiveEffectStartTime; + passiveEffectStartTime = -1; // Store duration on the next nearest Profiler ancestor + // Or the root (for the DevTools Profiler to read) + + var parentFiber = fiber.return; + while (parentFiber !== null) { + switch (parentFiber.tag) { + case HostRoot: + var root = parentFiber.stateNode; + if (root !== null) { + root.passiveEffectDuration += elapsedTime; + } + return; + case Profiler: + var parentStateNode = parentFiber.stateNode; + if (parentStateNode !== null) { + // Detached fibers have their state node cleared out. + // In this case, the return pointer is also cleared out, + // so we won't be able to report the time spent in this Profiler's subtree. + parentStateNode.passiveEffectDuration += elapsedTime; + } + return; + } + parentFiber = parentFiber.return; + } + } + } + function startLayoutEffectTimer() { + layoutEffectStartTime = now$1(); + } + function startPassiveEffectTimer() { + passiveEffectStartTime = now$1(); + } + function transferActualDuration(fiber) { + // Transfer time spent rendering these children so we don't lose it + // after we rerender. This is used as a helper in special cases + // where we should count the work of multiple passes. + var child = fiber.child; + while (child) { + fiber.actualDuration += child.actualDuration; + child = child.sibling; + } + } + function createCapturedValueAtFiber(value, source) { + // If the value is an error, call this function immediately after it is thrown + // so the stack is accurate. + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source), + digest: null + }; + } + function createCapturedValue(value, digest, stack) { + return { + value: value, + source: null, + stack: stack != null ? stack : null, + digest: digest != null ? digest : null + }; + } + if (typeof ReactNativePrivateInterface.ReactFiberErrorDialog.showErrorDialog !== "function") { + throw new Error("Expected ReactFiberErrorDialog.showErrorDialog to be a function."); + } + function showErrorDialog(boundary, errorInfo) { + var capturedError = { + componentStack: errorInfo.stack !== null ? errorInfo.stack : "", + error: errorInfo.value, + errorBoundary: boundary !== null && boundary.tag === ClassComponent ? boundary.stateNode : null + }; + return ReactNativePrivateInterface.ReactFiberErrorDialog.showErrorDialog(capturedError); + } + function logCapturedError(boundary, errorInfo) { + try { + var logError = showErrorDialog(boundary, errorInfo); // Allow injected showErrorDialog() to prevent default console.error logging. + // This enables renderers like ReactNative to better manage redbox behavior. + + if (logError === false) { + return; + } + var error = errorInfo.value; + if (true) { + var source = errorInfo.source; + var stack = errorInfo.stack; + var componentStack = stack !== null ? stack : ""; // Browsers support silencing uncaught errors by calling + // `preventDefault()` in window `error` handler. + // We record this information as an expando on the error. + + if (error != null && error._suppressLogging) { + if (boundary.tag === ClassComponent) { + // The error is recoverable and was silenced. + // Ignore it and don't print the stack addendum. + // This is handy for testing error boundaries without noise. + return; + } // The error is fatal. Since the silencing might have + // been accidental, we'll surface it anyway. + // However, the browser would have silenced the original error + // so we'll print it first, and then print the stack addendum. + + console["error"](error); // Don't transform to our wrapper + // For a more detailed description of this block, see: + // https://github.com/facebook/react/pull/13384 + } + var componentName = source ? getComponentNameFromFiber(source) : null; + var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:"; + var errorBoundaryMessage; + if (boundary.tag === HostRoot) { + errorBoundaryMessage = "Consider adding an error boundary to your tree to customize error handling behavior.\n" + "Visit https://react.dev/link/error-boundaries to learn more about error boundaries."; + } else { + var errorBoundaryName = getComponentNameFromFiber(boundary) || "Anonymous"; + errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + "."); + } + var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage); // In development, we provide our own message with just the component stack. + // We don't include the original error message and JS stack because the browser + // has already printed it. Even if the application swallows the error, it is still + // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils. + + console["error"](combinedMessage); // Don't transform to our wrapper + } else { + // In production, we print the error directly. + // This will include the message, the JS stack, and anything the browser wants to show. + // We pass the error object instead of custom message so that the browser displays the error natively. + console["error"](error); // Don't transform to our wrapper + } + } catch (e) { + // This method must not throw, or React internal state will get messed up. + // If console.error is overridden, or logCapturedError() shows a dialog that throws, + // we want to report this error outside of the normal stack as a last resort. + // https://github.com/facebook/react/issues/13188 + setTimeout(function () { + throw e; + }); + } + } + var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map; + function createRootErrorUpdate(fiber, errorInfo, lane) { + var update = createUpdate(NoTimestamp, lane); // Unmount the root by rendering null. + + update.tag = CaptureUpdate; // Caution: React DevTools currently depends on this property + // being called "element". + + update.payload = { + element: null + }; + var error = errorInfo.value; + update.callback = function () { + onUncaughtError(error); + logCapturedError(fiber, errorInfo); + }; + return update; + } + function createClassErrorUpdate(fiber, errorInfo, lane) { + var update = createUpdate(NoTimestamp, lane); + update.tag = CaptureUpdate; + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if (typeof getDerivedStateFromError === "function") { + var error$1 = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error$1); + }; + update.callback = function () { + { + markFailedErrorBoundaryForHotReloading(fiber); + } + logCapturedError(fiber, errorInfo); + }; + } + var inst = fiber.stateNode; + if (inst !== null && typeof inst.componentDidCatch === "function") { + update.callback = function callback() { + { + markFailedErrorBoundaryForHotReloading(fiber); + } + logCapturedError(fiber, errorInfo); + if (typeof getDerivedStateFromError !== "function") { + // To preserve the preexisting retry behavior of error boundaries, + // we keep track of which ones already failed during this batch. + // This gets reset before we yield back to the browser. + // TODO: Warn in strict mode if getDerivedStateFromError is + // not defined. + markLegacyErrorBoundaryAsFailed(this); + } + var error$1 = errorInfo.value; + var stack = errorInfo.stack; + this.componentDidCatch(error$1, { + componentStack: stack !== null ? stack : "" + }); + { + if (typeof getDerivedStateFromError !== "function") { + // If componentDidCatch is the only error boundary method defined, + // then it needs to call setState to recover from errors. + // If no state update is scheduled then the boundary will swallow the error. + if (!includesSomeLane(fiber.lanes, SyncLane)) { + error("%s: Error boundaries should implement getDerivedStateFromError(). " + "In that method, return a state update to display an error message or fallback UI.", getComponentNameFromFiber(fiber) || "Unknown"); + } + } + } + }; + } + return update; + } + function attachPingListener(root, wakeable, lanes) { + // Attach a ping listener + // + // The data might resolve before we have a chance to commit the fallback. Or, + // in the case of a refresh, we'll never commit a fallback. So we need to + // attach a listener now. When it resolves ("pings"), we can decide whether to + // try rendering the tree again. + // + // Only attach a listener if one does not already exist for the lanes + // we're currently rendering (which acts like a "thread ID" here). + // + // We only need to do this in concurrent mode. Legacy Suspense always + // commits fallbacks synchronously, so there are no pings. + var pingCache = root.pingCache; + var threadIDs; + if (pingCache === null) { + pingCache = root.pingCache = new PossiblyWeakMap$1(); + threadIDs = new Set(); + pingCache.set(wakeable, threadIDs); + } else { + threadIDs = pingCache.get(wakeable); + if (threadIDs === undefined) { + threadIDs = new Set(); + pingCache.set(wakeable, threadIDs); + } + } + if (!threadIDs.has(lanes)) { + // Memoize using the thread ID to prevent redundant listeners. + threadIDs.add(lanes); + var ping = pingSuspendedRoot.bind(null, root, wakeable, lanes); + { + if (isDevToolsPresent) { + // If we have pending work still, restore the original updaters + restorePendingUpdaters(root, lanes); + } + } + wakeable.then(ping, ping); + } + } + function attachRetryListener(suspenseBoundary, root, wakeable, lanes) { + // Retry listener + // + // If the fallback does commit, we need to attach a different type of + // listener. This one schedules an update on the Suspense boundary to turn + // the fallback state off. + // + // Stash the wakeable on the boundary fiber so we can access it in the + // commit phase. + // + // When the wakeable resolves, we'll attempt to render the boundary + // again ("retry"). + var wakeables = suspenseBoundary.updateQueue; + if (wakeables === null) { + var updateQueue = new Set(); + updateQueue.add(wakeable); + suspenseBoundary.updateQueue = updateQueue; + } else { + wakeables.add(wakeable); + } + } + function resetSuspendedComponent(sourceFiber, rootRenderLanes) { + // A legacy mode Suspense quirk, only relevant to hook components. + + var tag = sourceFiber.tag; + if ((sourceFiber.mode & ConcurrentMode) === NoMode && (tag === FunctionComponent || tag === ForwardRef || tag === SimpleMemoComponent)) { + var currentSource = sourceFiber.alternate; + if (currentSource) { + sourceFiber.updateQueue = currentSource.updateQueue; + sourceFiber.memoizedState = currentSource.memoizedState; + sourceFiber.lanes = currentSource.lanes; + } else { + sourceFiber.updateQueue = null; + sourceFiber.memoizedState = null; + } + } + } + function getNearestSuspenseBoundaryToCapture(returnFiber) { + var node = returnFiber; + do { + if (node.tag === SuspenseComponent && shouldCaptureSuspense(node)) { + return node; + } // This boundary already captured during this render. Continue to the next + // boundary. + + node = node.return; + } while (node !== null); + return null; + } + function markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes) { + // This marks a Suspense boundary so that when we're unwinding the stack, + // it captures the suspended "exception" and does a second (fallback) pass. + if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) { + // Legacy Mode Suspense + // + // If the boundary is in legacy mode, we should *not* + // suspend the commit. Pretend as if the suspended component rendered + // null and keep rendering. When the Suspense boundary completes, + // we'll do a second pass to render the fallback. + if (suspenseBoundary === returnFiber) { + // Special case where we suspended while reconciling the children of + // a Suspense boundary's inner Offscreen wrapper fiber. This happens + // when a React.lazy component is a direct child of a + // Suspense boundary. + // + // Suspense boundaries are implemented as multiple fibers, but they + // are a single conceptual unit. The legacy mode behavior where we + // pretend the suspended fiber committed as `null` won't work, + // because in this case the "suspended" fiber is the inner + // Offscreen wrapper. + // + // Because the contents of the boundary haven't started rendering + // yet (i.e. nothing in the tree has partially rendered) we can + // switch to the regular, concurrent mode behavior: mark the + // boundary with ShouldCapture and enter the unwind phase. + suspenseBoundary.flags |= ShouldCapture; + } else { + suspenseBoundary.flags |= DidCapture; + sourceFiber.flags |= ForceUpdateForLegacySuspense; // We're going to commit this fiber even though it didn't complete. + // But we shouldn't call any lifecycle methods or callbacks. Remove + // all lifecycle effect tags. + + sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete); + if (sourceFiber.tag === ClassComponent) { + var currentSourceFiber = sourceFiber.alternate; + if (currentSourceFiber === null) { + // This is a new mount. Change the tag so it's not mistaken for a + // completed class component. For example, we should not call + // componentWillUnmount if it is deleted. + sourceFiber.tag = IncompleteClassComponent; + } else { + // When we try rendering again, we should not reuse the current fiber, + // since it's known to be in an inconsistent state. Use a force update to + // prevent a bail out. + var update = createUpdate(NoTimestamp, SyncLane); + update.tag = ForceUpdate; + enqueueUpdate(sourceFiber, update, SyncLane); + } + } // The source fiber did not complete. Mark it with Sync priority to + // indicate that it still has pending work. + + sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane); + } + return suspenseBoundary; + } // Confirmed that the boundary is in a concurrent mode tree. Continue + // with the normal suspend path. + // + // After this we'll use a set of heuristics to determine whether this + // render pass will run to completion or restart or "suspend" the commit. + // The actual logic for this is spread out in different places. + // + // This first principle is that if we're going to suspend when we complete + // a root, then we should also restart if we get an update or ping that + // might unsuspend it, and vice versa. The only reason to suspend is + // because you think you might want to restart before committing. However, + // it doesn't make sense to restart only while in the period we're suspended. + // + // Restarting too aggressively is also not good because it starves out any + // intermediate loading state. So we use heuristics to determine when. + // Suspense Heuristics + // + // If nothing threw a Promise or all the same fallbacks are already showing, + // then don't suspend/restart. + // + // If this is an initial render of a new tree of Suspense boundaries and + // those trigger a fallback, then don't suspend/restart. We want to ensure + // that we can show the initial loading state as quickly as possible. + // + // If we hit a "Delayed" case, such as when we'd switch from content back into + // a fallback, then we should always suspend/restart. Transitions apply + // to this case. If none is defined, JND is used instead. + // + // If we're already showing a fallback and it gets "retried", allowing us to show + // another level, but there's still an inner boundary that would show a fallback, + // then we suspend/restart for 500ms since the last time we showed a fallback + // anywhere in the tree. This effectively throttles progressive loading into a + // consistent train of commits. This also gives us an opportunity to restart to + // get to the completed state slightly earlier. + // + // If there's ambiguity due to batching it's resolved in preference of: + // 1) "delayed", 2) "initial render", 3) "retry". + // + // We want to ensure that a "busy" state doesn't get force committed. We want to + // ensure that new initial loading states can commit as soon as possible. + + suspenseBoundary.flags |= ShouldCapture; // TODO: I think we can remove this, since we now use `DidCapture` in + // the begin phase to prevent an early bailout. + + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; + } + function throwException(root, returnFiber, sourceFiber, value, rootRenderLanes) { + // The source fiber did not complete. + sourceFiber.flags |= Incomplete; + { + if (isDevToolsPresent) { + // If we have pending work still, restore the original updaters + restorePendingUpdaters(root, rootRenderLanes); + } + } + if (value !== null && typeof value === "object" && typeof value.then === "function") { + // This is a wakeable. The component suspended. + var wakeable = value; + resetSuspendedComponent(sourceFiber); + var suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber); + if (suspenseBoundary !== null) { + suspenseBoundary.flags &= ~ForceClientRender; + markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes); // We only attach ping listeners in concurrent mode. Legacy Suspense always + // commits fallbacks synchronously, so there are no pings. + + if (suspenseBoundary.mode & ConcurrentMode) { + attachPingListener(root, wakeable, rootRenderLanes); + } + attachRetryListener(suspenseBoundary, root, wakeable); + return; + } else { + // No boundary was found. Unless this is a sync update, this is OK. + // We can suspend and wait for more data to arrive. + if (!includesSyncLane(rootRenderLanes)) { + // This is not a sync update. Suspend. Since we're not activating a + // Suspense boundary, this will unwind all the way to the root without + // performing a second pass to render a fallback. (This is arguably how + // refresh transitions should work, too, since we're not going to commit + // the fallbacks anyway.) + // + // This case also applies to initial hydration. + attachPingListener(root, wakeable, rootRenderLanes); + renderDidSuspendDelayIfPossible(); + return; + } // This is a sync/discrete update. We treat this case like an error + // because discrete renders are expected to produce a complete tree + // synchronously to maintain consistency with external state. + + var uncaughtSuspenseError = new Error("A component suspended while responding to synchronous input. This " + "will cause the UI to be replaced with a loading indicator. To " + "fix, updates that suspend should be wrapped " + "with startTransition."); // If we're outside a transition, fall through to the regular error path. + // The error will be caught by the nearest suspense boundary. + + value = uncaughtSuspenseError; + } + } + value = createCapturedValueAtFiber(value, sourceFiber); + renderDidError(value); // We didn't find a boundary that could handle this type of exception. Start + // over and traverse parent path again, this time treating the exception + // as an error. + + var workInProgress = returnFiber; + do { + switch (workInProgress.tag) { + case HostRoot: + { + var _errorInfo = value; + workInProgress.flags |= ShouldCapture; + var lane = pickArbitraryLane(rootRenderLanes); + workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); + var update = createRootErrorUpdate(workInProgress, _errorInfo, lane); + enqueueCapturedUpdate(workInProgress, update); + return; + } + case ClassComponent: + // Capture and retry + var errorInfo = value; + var ctor = workInProgress.type; + var instance = workInProgress.stateNode; + if ((workInProgress.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === "function" || instance !== null && typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance))) { + workInProgress.flags |= ShouldCapture; + var _lane = pickArbitraryLane(rootRenderLanes); + workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state + + var _update = createClassErrorUpdate(workInProgress, errorInfo, _lane); + enqueueCapturedUpdate(workInProgress, _update); + return; + } + break; + } + workInProgress = workInProgress.return; + } while (workInProgress !== null); + } + function getSuspendedCache() { + { + return null; + } // This function is called when a Suspense boundary suspends. It returns the + } + var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; + var didReceiveUpdate = false; + var didWarnAboutBadClass; + var didWarnAboutModulePatternComponent; + var didWarnAboutContextTypeOnFunctionComponent; + var didWarnAboutGetDerivedStateOnFunctionComponent; + var didWarnAboutFunctionRefs; + var didWarnAboutReassigningProps; + var didWarnAboutRevealOrder; + var didWarnAboutTailOptions; + { + didWarnAboutBadClass = {}; + didWarnAboutModulePatternComponent = {}; + didWarnAboutContextTypeOnFunctionComponent = {}; + didWarnAboutGetDerivedStateOnFunctionComponent = {}; + didWarnAboutFunctionRefs = {}; + didWarnAboutReassigningProps = false; + didWarnAboutRevealOrder = {}; + didWarnAboutTailOptions = {}; + } + function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { + if (current === null) { + // If this is a fresh new component that hasn't been rendered yet, we + // won't update its child set by applying minimal side-effects. Instead, + // we will add them all to the child before it gets rendered. That means + // we can optimize this reconciliation pass by not tracking side-effects. + workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderLanes); + } else { + // If the current child is the same as the work in progress, it means that + // we haven't yet started any work on these children. Therefore, we use + // the clone algorithm to create a copy of all the current children. + // If we had any progressed work already, that is invalid at this point so + // let's throw it out. + workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderLanes); + } + } + function forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes) { + // This function is fork of reconcileChildren. It's used in cases where we + // want to reconcile without matching against the existing set. This has the + // effect of all current children being unmounted; even if the type and key + // are the same, the old child is unmounted and a new child is created. + // + // To do this, we're going to go through the reconcile algorithm twice. In + // the first pass, we schedule a deletion for all the current children by + // passing null. + workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderLanes); // In the second pass, we mount the new children. The trick here is that we + // pass null in place of where we usually pass the current child set. This has + // the effect of remounting all children regardless of whether their + // identities match. + + workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes); + } + function updateForwardRef(current, workInProgress, Component, nextProps, renderLanes) { + // TODO: current can be non-null here even if the component + // hasn't yet mounted. This happens after the first render suspends. + // We'll need to figure out if this is fine or can cause issues. + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var innerPropTypes = Component.propTypes; + if (innerPropTypes) { + checkPropTypes(innerPropTypes, nextProps, + // Resolved props + "prop", getComponentNameFromType(Component)); + } + } + } + var render = Component.render; + var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent + + var nextChildren; + prepareToReadContext(workInProgress, renderLanes); + { + ReactCurrentOwner$1.current = workInProgress; + setIsRendering(true); + nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes); + setIsRendering(false); + } + if (current !== null && !didReceiveUpdate) { + bailoutHooks(current, workInProgress, renderLanes); + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + workInProgress.flags |= PerformedWork; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function updateMemoComponent(current, workInProgress, Component, nextProps, renderLanes) { + if (current === null) { + var type = Component.type; + if (isSimpleFunctionComponent(type) && Component.compare === null && + // SimpleMemoComponent codepath doesn't resolve outer props either. + Component.defaultProps === undefined) { + var resolvedType = type; + { + resolvedType = resolveFunctionForHotReloading(type); + } // If this is a plain function component without default props, + // and with only the default shallow comparison, we upgrade it + // to a SimpleMemoComponent to allow fast path updates. + + workInProgress.tag = SimpleMemoComponent; + workInProgress.type = resolvedType; + { + validateFunctionComponentInDev(workInProgress, type); + } + return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, renderLanes); + } + { + var innerPropTypes = type.propTypes; + if (innerPropTypes) { + // Inner memo component props aren't currently validated in createElement. + // We could move it there, but we'd still need this for lazy code path. + checkPropTypes(innerPropTypes, nextProps, + // Resolved props + "prop", getComponentNameFromType(type)); + } + } + var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress, workInProgress.mode, renderLanes); + child.ref = workInProgress.ref; + child.return = workInProgress; + workInProgress.child = child; + return child; + } + { + var _type = Component.type; + var _innerPropTypes = _type.propTypes; + if (_innerPropTypes) { + // Inner memo component props aren't currently validated in createElement. + // We could move it there, but we'd still need this for lazy code path. + checkPropTypes(_innerPropTypes, nextProps, + // Resolved props + "prop", getComponentNameFromType(_type)); + } + } + var currentChild = current.child; // This is always exactly one child + + var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current, renderLanes); + if (!hasScheduledUpdateOrContext) { + // This will be the props with resolved defaultProps, + // unlike current.memoizedProps which will be the unresolved ones. + var prevProps = currentChild.memoizedProps; // Default to shallow comparison + + var compare = Component.compare; + compare = compare !== null ? compare : shallowEqual; + if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) { + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + } // React DevTools reads this flag. + + workInProgress.flags |= PerformedWork; + var newChild = createWorkInProgress(currentChild, nextProps); + newChild.ref = workInProgress.ref; + newChild.return = workInProgress; + workInProgress.child = newChild; + return newChild; + } + function updateSimpleMemoComponent(current, workInProgress, Component, nextProps, renderLanes) { + // TODO: current can be non-null here even if the component + // hasn't yet mounted. This happens when the inner render suspends. + // We'll need to figure out if this is fine or can cause issues. + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var outerMemoType = workInProgress.elementType; + if (outerMemoType.$$typeof === REACT_LAZY_TYPE) { + // We warn when you define propTypes on lazy() + // so let's just skip over it to find memo() outer wrapper. + // Inner props for memo are validated later. + var lazyComponent = outerMemoType; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + outerMemoType = init(payload); + } catch (x) { + outerMemoType = null; + } // Inner propTypes will be validated in the function component path. + + var outerPropTypes = outerMemoType && outerMemoType.propTypes; + if (outerPropTypes) { + checkPropTypes(outerPropTypes, nextProps, + // Resolved (SimpleMemoComponent has no defaultProps) + "prop", getComponentNameFromType(outerMemoType)); + } + } + } + } + if (current !== null) { + var prevProps = current.memoizedProps; + if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && + // Prevent bailout if the implementation changed due to hot reload. + workInProgress.type === current.type) { + didReceiveUpdate = false; // The props are shallowly equal. Reuse the previous props object, like we + // would during a normal fiber bailout. + // + // We don't have strong guarantees that the props object is referentially + // equal during updates where we can't bail out anyway — like if the props + // are shallowly equal, but there's a local state or context update in the + // same batch. + // + // However, as a principle, we should aim to make the behavior consistent + // across different ways of memoizing a component. For example, React.memo + // has a different internal Fiber layout if you pass a normal function + // component (SimpleMemoComponent) versus if you pass a different type + // like forwardRef (MemoComponent). But this is an implementation detail. + // Wrapping a component in forwardRef (or React.lazy, etc) shouldn't + // affect whether the props object is reused during a bailout. + + workInProgress.pendingProps = nextProps = prevProps; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + // The pending lanes were cleared at the beginning of beginWork. We're + // about to bail out, but there might be other lanes that weren't + // included in the current render. Usually, the priority level of the + // remaining updates is accumulated during the evaluation of the + // component (i.e. when processing the update queue). But since since + // we're bailing out early *without* evaluating the component, we need + // to account for it here, too. Reset to the value of the current fiber. + // NOTE: This only applies to SimpleMemoComponent, not MemoComponent, + // because a MemoComponent fiber does not have hooks or an update queue; + // rather, it wraps around an inner component, which may or may not + // contains hooks. + // TODO: Move the reset at in beginWork out of the common path so that + // this is no longer necessary. + workInProgress.lanes = current.lanes; + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } else if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) { + // This is a special case that only exists for legacy mode. + // See https://github.com/facebook/react/pull/19216. + didReceiveUpdate = true; + } + } + } + return updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes); + } + function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps; + var nextChildren = nextProps.children; + var prevState = current !== null ? current.memoizedState : null; + if (nextProps.mode === "hidden" || enableLegacyHidden) { + // Rendering a hidden tree. + if ((workInProgress.mode & ConcurrentMode) === NoMode) { + // In legacy sync mode, don't defer the subtree. Render it now. + // TODO: Consider how Offscreen should work with transitions in the future + var nextState = { + baseLanes: NoLanes, + cachePool: null, + transitions: null + }; + workInProgress.memoizedState = nextState; + pushRenderLanes(workInProgress, renderLanes); + } else if (!includesSomeLane(renderLanes, OffscreenLane)) { + var spawnedCachePool = null; // We're hidden, and we're not rendering at Offscreen. We will bail out + // and resume this tree later. + + var nextBaseLanes; + if (prevState !== null) { + var prevBaseLanes = prevState.baseLanes; + nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes); + } else { + nextBaseLanes = renderLanes; + } // Schedule this fiber to re-render at offscreen priority. Then bailout. + + workInProgress.lanes = workInProgress.childLanes = laneToLanes(OffscreenLane); + var _nextState = { + baseLanes: nextBaseLanes, + cachePool: spawnedCachePool, + transitions: null + }; + workInProgress.memoizedState = _nextState; + workInProgress.updateQueue = null; + // to avoid a push/pop misalignment. + + pushRenderLanes(workInProgress, nextBaseLanes); + return null; + } else { + // This is the second render. The surrounding visible content has already + // committed. Now we resume rendering the hidden tree. + // Rendering at offscreen, so we can clear the base lanes. + var _nextState2 = { + baseLanes: NoLanes, + cachePool: null, + transitions: null + }; + workInProgress.memoizedState = _nextState2; // Push the lanes that were skipped when we bailed out. + + var subtreeRenderLanes = prevState !== null ? prevState.baseLanes : renderLanes; + pushRenderLanes(workInProgress, subtreeRenderLanes); + } + } else { + // Rendering a visible tree. + var _subtreeRenderLanes; + if (prevState !== null) { + // We're going from hidden -> visible. + _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes); + workInProgress.memoizedState = null; + } else { + // We weren't previously hidden, and we still aren't, so there's nothing + // special to do. Need to push to the stack regardless, though, to avoid + // a push/pop misalignment. + _subtreeRenderLanes = renderLanes; + } + pushRenderLanes(workInProgress, _subtreeRenderLanes); + } + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } // Note: These happen to have identical begin phases, for now. We shouldn't hold + + function updateFragment(current, workInProgress, renderLanes) { + var nextChildren = workInProgress.pendingProps; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function updateMode(current, workInProgress, renderLanes) { + var nextChildren = workInProgress.pendingProps.children; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function updateProfiler(current, workInProgress, renderLanes) { + { + workInProgress.flags |= Update; + { + // Reset effect durations for the next eventual effect phase. + // These are reset during render to allow the DevTools commit hook a chance to read them, + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = 0; + stateNode.passiveEffectDuration = 0; + } + } + var nextProps = workInProgress.pendingProps; + var nextChildren = nextProps.children; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (current === null && ref !== null || current !== null && current.ref !== ref) { + // Schedule a Ref effect + workInProgress.flags |= Ref; + } + } + function updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes) { + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var innerPropTypes = Component.propTypes; + if (innerPropTypes) { + checkPropTypes(innerPropTypes, nextProps, + // Resolved props + "prop", getComponentNameFromType(Component)); + } + } + } + var context; + { + var unmaskedContext = getUnmaskedContext(workInProgress, Component, true); + context = getMaskedContext(workInProgress, unmaskedContext); + } + var nextChildren; + prepareToReadContext(workInProgress, renderLanes); + { + ReactCurrentOwner$1.current = workInProgress; + setIsRendering(true); + nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes); + setIsRendering(false); + } + if (current !== null && !didReceiveUpdate) { + bailoutHooks(current, workInProgress, renderLanes); + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + workInProgress.flags |= PerformedWork; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function updateClassComponent(current, workInProgress, Component, nextProps, renderLanes) { + { + // This is used by DevTools to force a boundary to error. + switch (shouldError(workInProgress)) { + case false: + { + var _instance = workInProgress.stateNode; + var ctor = workInProgress.type; // TODO This way of resetting the error boundary state is a hack. + // Is there a better way to do this? + + var tempInstance = new ctor(workInProgress.memoizedProps, _instance.context); + var state = tempInstance.state; + _instance.updater.enqueueSetState(_instance, state, null); + break; + } + case true: + { + workInProgress.flags |= DidCapture; + workInProgress.flags |= ShouldCapture; // eslint-disable-next-line react-internal/prod-error-codes + + var error$1 = new Error("Simulated error coming from DevTools"); + var lane = pickArbitraryLane(renderLanes); + workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); // Schedule the error boundary to re-render using updated state + + var update = createClassErrorUpdate(workInProgress, createCapturedValueAtFiber(error$1, workInProgress), lane); + enqueueCapturedUpdate(workInProgress, update); + break; + } + } + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var innerPropTypes = Component.propTypes; + if (innerPropTypes) { + checkPropTypes(innerPropTypes, nextProps, + // Resolved props + "prop", getComponentNameFromType(Component)); + } + } + } // Push context providers early to prevent context stack mismatches. + // During mounting we don't know the child context yet as the instance doesn't exist. + // We will invalidate the child context in finishClassComponent() right after rendering. + + var hasContext; + if (isContextProvider(Component)) { + hasContext = true; + pushContextProvider(workInProgress); + } else { + hasContext = false; + } + prepareToReadContext(workInProgress, renderLanes); + var instance = workInProgress.stateNode; + var shouldUpdate; + if (instance === null) { + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); // In the initial pass we might need to construct the instance. + + constructClassInstance(workInProgress, Component, nextProps); + mountClassInstance(workInProgress, Component, nextProps, renderLanes); + shouldUpdate = true; + } else if (current === null) { + // In a resume, we'll already have an instance we can reuse. + shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderLanes); + } else { + shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderLanes); + } + var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes); + { + var inst = workInProgress.stateNode; + if (shouldUpdate && inst.props !== nextProps) { + if (!didWarnAboutReassigningProps) { + error("It looks like %s is reassigning its own `this.props` while rendering. " + "This is not supported and can lead to confusing bugs.", getComponentNameFromFiber(workInProgress) || "a component"); + } + didWarnAboutReassigningProps = true; + } + } + return nextUnitOfWork; + } + function finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes) { + // Refs should update even if shouldComponentUpdate returns false + markRef(current, workInProgress); + var didCaptureError = (workInProgress.flags & DidCapture) !== NoFlags; + if (!shouldUpdate && !didCaptureError) { + // Context providers should defer to sCU for rendering + if (hasContext) { + invalidateContextProvider(workInProgress, Component, false); + } + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + var instance = workInProgress.stateNode; // Rerender + + ReactCurrentOwner$1.current = workInProgress; + var nextChildren; + if (didCaptureError && typeof Component.getDerivedStateFromError !== "function") { + // If we captured an error, but getDerivedStateFromError is not defined, + // unmount all the children. componentDidCatch will schedule an update to + // re-render a fallback. This is temporary until we migrate everyone to + // the new API. + // TODO: Warn in a future release. + nextChildren = null; + { + stopProfilerTimerIfRunning(); + } + } else { + { + setIsRendering(true); + nextChildren = instance.render(); + setIsRendering(false); + } + } // React DevTools reads this flag. + + workInProgress.flags |= PerformedWork; + if (current !== null && didCaptureError) { + // If we're recovering from an error, reconcile without reusing any of + // the existing children. Conceptually, the normal children and the children + // that are shown on error are two different sets, so we shouldn't reuse + // normal children even if their identities match. + forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes); + } else { + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + } // Memoize state using the values we just used to render. + // TODO: Restructure so we never read values from the instance. + + workInProgress.memoizedState = instance.state; // The context might have changed so we need to recalculate it. + + if (hasContext) { + invalidateContextProvider(workInProgress, Component, true); + } + return workInProgress.child; + } + function pushHostRootContext(workInProgress) { + var root = workInProgress.stateNode; + if (root.pendingContext) { + pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context); + } else if (root.context) { + // Should always be set + pushTopLevelContextObject(workInProgress, root.context, false); + } + pushHostContainer(workInProgress, root.containerInfo); + } + function updateHostRoot(current, workInProgress, renderLanes) { + pushHostRootContext(workInProgress); + if (current === null) { + throw new Error("Should have a current fiber. This is a bug in React."); + } + var nextProps = workInProgress.pendingProps; + var prevState = workInProgress.memoizedState; + var prevChildren = prevState.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + var nextState = workInProgress.memoizedState; + var root = workInProgress.stateNode; + // being called "element". + + var nextChildren = nextState.element; + { + if (nextChildren === prevChildren) { + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + } + return workInProgress.child; + } + function updateHostComponent(current, workInProgress, renderLanes) { + pushHostContext(workInProgress); + var type = workInProgress.type; + var nextProps = workInProgress.pendingProps; + var prevProps = current !== null ? current.memoizedProps : null; + var nextChildren = nextProps.children; + if (prevProps !== null && shouldSetTextContent()) { + // If we're switching from a direct text child to a normal child, or to + // empty, we need to schedule the text content to be reset. + workInProgress.flags |= ContentReset; + } + markRef(current, workInProgress); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function updateHostText(current, workInProgress) { + // immediately after. + + return null; + } + function mountLazyComponent(_current, workInProgress, elementType, renderLanes) { + resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); + var props = workInProgress.pendingProps; + var lazyComponent = elementType; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + var Component = init(payload); // Store the unwrapped component in the type. + + workInProgress.type = Component; + var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component); + var resolvedProps = resolveDefaultProps(Component, props); + var child; + switch (resolvedTag) { + case FunctionComponent: + { + { + validateFunctionComponentInDev(workInProgress, Component); + workInProgress.type = Component = resolveFunctionForHotReloading(Component); + } + child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderLanes); + return child; + } + case ClassComponent: + { + { + workInProgress.type = Component = resolveClassForHotReloading(Component); + } + child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderLanes); + return child; + } + case ForwardRef: + { + { + workInProgress.type = Component = resolveForwardRefForHotReloading(Component); + } + child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderLanes); + return child; + } + case MemoComponent: + { + { + if (workInProgress.type !== workInProgress.elementType) { + var outerPropTypes = Component.propTypes; + if (outerPropTypes) { + checkPropTypes(outerPropTypes, resolvedProps, + // Resolved for outer only + "prop", getComponentNameFromType(Component)); + } + } + } + child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), + // The inner type can have defaults too + renderLanes); + return child; + } + } + var hint = ""; + { + if (Component !== null && typeof Component === "object" && Component.$$typeof === REACT_LAZY_TYPE) { + hint = " Did you wrap a component in React.lazy() more than once?"; + } + } // This message intentionally doesn't mention ForwardRef or MemoComponent + // because the fact that it's a separate type of work is an + // implementation detail. + + throw new Error("Element type is invalid. Received a promise that resolves to: " + Component + ". " + ("Lazy element type must resolve to a class or function." + hint)); + } + function mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderLanes) { + resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); // Promote the fiber to a class and try rendering again. + + workInProgress.tag = ClassComponent; // The rest of this function is a fork of `updateClassComponent` + // Push context providers early to prevent context stack mismatches. + // During mounting we don't know the child context yet as the instance doesn't exist. + // We will invalidate the child context in finishClassComponent() right after rendering. + + var hasContext; + if (isContextProvider(Component)) { + hasContext = true; + pushContextProvider(workInProgress); + } else { + hasContext = false; + } + prepareToReadContext(workInProgress, renderLanes); + constructClassInstance(workInProgress, Component, nextProps); + mountClassInstance(workInProgress, Component, nextProps, renderLanes); + return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes); + } + function mountIndeterminateComponent(_current, workInProgress, Component, renderLanes) { + resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); + var props = workInProgress.pendingProps; + var context; + { + var unmaskedContext = getUnmaskedContext(workInProgress, Component, false); + context = getMaskedContext(workInProgress, unmaskedContext); + } + prepareToReadContext(workInProgress, renderLanes); + var value; + { + if (Component.prototype && typeof Component.prototype.render === "function") { + var componentName = getComponentNameFromType(Component) || "Unknown"; + if (!didWarnAboutBadClass[componentName]) { + error("The <%s /> component appears to have a render method, but doesn't extend React.Component. " + "This is likely to cause errors. Change %s to extend React.Component instead.", componentName, componentName); + didWarnAboutBadClass[componentName] = true; + } + } + if (workInProgress.mode & StrictLegacyMode) { + ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null); + } + setIsRendering(true); + ReactCurrentOwner$1.current = workInProgress; + value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes); + setIsRendering(false); + } + workInProgress.flags |= PerformedWork; + { + // Support for module components is deprecated and is removed behind a flag. + // Whether or not it would crash later, we want to show a good message in DEV first. + if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === undefined) { + var _componentName = getComponentNameFromType(Component) || "Unknown"; + if (!didWarnAboutModulePatternComponent[_componentName]) { + error("The <%s /> component appears to be a function component that returns a class instance. " + "Change %s to a class that extends React.Component instead. " + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + "cannot be called with `new` by React.", _componentName, _componentName, _componentName); + didWarnAboutModulePatternComponent[_componentName] = true; + } + } + } + if ( + // Run these checks in production only if the flag is off. + // Eventually we'll delete this branch altogether. + typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === undefined) { + { + var _componentName2 = getComponentNameFromType(Component) || "Unknown"; + if (!didWarnAboutModulePatternComponent[_componentName2]) { + error("The <%s /> component appears to be a function component that returns a class instance. " + "Change %s to a class that extends React.Component instead. " + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + "cannot be called with `new` by React.", _componentName2, _componentName2, _componentName2); + didWarnAboutModulePatternComponent[_componentName2] = true; + } + } // Proceed under the assumption that this is a class instance + + workInProgress.tag = ClassComponent; // Throw out any hooks that were used. + + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; // Push context providers early to prevent context stack mismatches. + // During mounting we don't know the child context yet as the instance doesn't exist. + // We will invalidate the child context in finishClassComponent() right after rendering. + + var hasContext = false; + if (isContextProvider(Component)) { + hasContext = true; + pushContextProvider(workInProgress); + } else { + hasContext = false; + } + workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null; + initializeUpdateQueue(workInProgress); + adoptClassInstance(workInProgress, value); + mountClassInstance(workInProgress, Component, props, renderLanes); + return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes); + } else { + // Proceed under the assumption that this is a function component + workInProgress.tag = FunctionComponent; + reconcileChildren(null, workInProgress, value, renderLanes); + { + validateFunctionComponentInDev(workInProgress, Component); + } + return workInProgress.child; + } + } + function validateFunctionComponentInDev(workInProgress, Component) { + { + if (Component) { + if (Component.childContextTypes) { + error("%s(...): childContextTypes cannot be defined on a function component.", Component.displayName || Component.name || "Component"); + } + } + if (workInProgress.ref !== null) { + var info = ""; + var ownerName = getCurrentFiberOwnerNameInDevOrNull(); + if (ownerName) { + info += "\n\nCheck the render method of `" + ownerName + "`."; + } + var warningKey = ownerName || ""; + var debugSource = workInProgress._debugSource; + if (debugSource) { + warningKey = debugSource.fileName + ":" + debugSource.lineNumber; + } + if (!didWarnAboutFunctionRefs[warningKey]) { + didWarnAboutFunctionRefs[warningKey] = true; + error("Function components cannot be given refs. " + "Attempts to access this ref will fail. " + "Did you mean to use React.forwardRef()?%s", info); + } + } + if (typeof Component.getDerivedStateFromProps === "function") { + var _componentName3 = getComponentNameFromType(Component) || "Unknown"; + if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) { + error("%s: Function components do not support getDerivedStateFromProps.", _componentName3); + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true; + } + } + if (typeof Component.contextType === "object" && Component.contextType !== null) { + var _componentName4 = getComponentNameFromType(Component) || "Unknown"; + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) { + error("%s: Function components do not support contextType.", _componentName4); + didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true; + } + } + } + } + var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: NoLane + }; + function mountSuspenseOffscreenState(renderLanes) { + return { + baseLanes: renderLanes, + cachePool: getSuspendedCache(), + transitions: null + }; + } + function updateSuspenseOffscreenState(prevOffscreenState, renderLanes) { + var cachePool = null; + return { + baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes), + cachePool: cachePool, + transitions: prevOffscreenState.transitions + }; + } // TODO: Probably should inline this back + + function shouldRemainOnFallback(suspenseContext, current, workInProgress, renderLanes) { + // If we're already showing a fallback, there are cases where we need to + // remain on that fallback regardless of whether the content has resolved. + // For example, SuspenseList coordinates when nested content appears. + if (current !== null) { + var suspenseState = current.memoizedState; + if (suspenseState === null) { + // Currently showing content. Don't hide it, even if ForceSuspenseFallback + // is true. More precise name might be "ForceRemainSuspenseFallback". + // Note: This is a factoring smell. Can't remain on a fallback if there's + // no fallback to remain on. + return false; + } + } // Not currently showing content. Consult the Suspense context. + + return hasSuspenseContext(suspenseContext, ForceSuspenseFallback); + } + function getRemainingWorkInPrimaryTree(current, renderLanes) { + // TODO: Should not remove render lanes that were pinged during this render + return removeLanes(current.childLanes, renderLanes); + } + function updateSuspenseComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps; // This is used by DevTools to force a boundary to suspend. + + { + if (shouldSuspend(workInProgress)) { + workInProgress.flags |= DidCapture; + } + } + var suspenseContext = suspenseStackCursor.current; + var showFallback = false; + var didSuspend = (workInProgress.flags & DidCapture) !== NoFlags; + if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) { + // Something in this boundary's subtree already suspended. Switch to + // rendering the fallback children. + showFallback = true; + workInProgress.flags &= ~DidCapture; + } else { + // Attempting the main content + if (current === null || current.memoizedState !== null) { + // This is a new mount or this boundary is already showing a fallback state. + // Mark this subtree context as having at least one invisible parent that could + // handle the fallback state. + // Avoided boundaries are not considered since they cannot handle preferred fallback states. + { + suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext); + } + } + } + suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); + pushSuspenseContext(workInProgress, suspenseContext); // OK, the next part is confusing. We're about to reconcile the Suspense + // boundary's children. This involves some custom reconciliation logic. Two + // main reasons this is so complicated. + // + // First, Legacy Mode has different semantics for backwards compatibility. The + // primary tree will commit in an inconsistent state, so when we do the + // second pass to render the fallback, we do some exceedingly, uh, clever + // hacks to make that not totally break. Like transferring effects and + // deletions from hidden tree. In Concurrent Mode, it's much simpler, + // because we bailout on the primary tree completely and leave it in its old + // state, no effects. Same as what we do for Offscreen (except that + // Offscreen doesn't have the first render pass). + // + // Second is hydration. During hydration, the Suspense fiber has a slightly + // different layout, where the child points to a dehydrated fragment, which + // contains the DOM rendered by the server. + // + // Third, even if you set all that aside, Suspense is like error boundaries in + // that we first we try to render one tree, and if that fails, we render again + // and switch to a different tree. Like a try/catch block. So we have to track + // which branch we're currently rendering. Ideally we would model this using + // a stack. + + if (current === null) { + var suspenseState = workInProgress.memoizedState; + if (suspenseState !== null) { + var dehydrated = suspenseState.dehydrated; + if (dehydrated !== null) { + return mountDehydratedSuspenseComponent(workInProgress); + } + } + var nextPrimaryChildren = nextProps.children; + var nextFallbackChildren = nextProps.fallback; + if (showFallback) { + var fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes); + var primaryChildFragment = workInProgress.child; + primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes); + workInProgress.memoizedState = SUSPENDED_MARKER; + return fallbackFragment; + } else { + return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren); + } + } else { + // This is an update. + // Special path for hydration + var prevState = current.memoizedState; + if (prevState !== null) { + var _dehydrated = prevState.dehydrated; + if (_dehydrated !== null) { + return updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, _dehydrated, prevState, renderLanes); + } + } + if (showFallback) { + var _nextFallbackChildren = nextProps.fallback; + var _nextPrimaryChildren = nextProps.children; + var fallbackChildFragment = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren, _nextFallbackChildren, renderLanes); + var _primaryChildFragment2 = workInProgress.child; + var prevOffscreenState = current.child.memoizedState; + _primaryChildFragment2.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes); + _primaryChildFragment2.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes); + workInProgress.memoizedState = SUSPENDED_MARKER; + return fallbackChildFragment; + } else { + var _nextPrimaryChildren2 = nextProps.children; + var _primaryChildFragment3 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren2, renderLanes); + workInProgress.memoizedState = null; + return _primaryChildFragment3; + } + } + } + function mountSuspensePrimaryChildren(workInProgress, primaryChildren, renderLanes) { + var mode = workInProgress.mode; + var primaryChildProps = { + mode: "visible", + children: primaryChildren + }; + var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode); + primaryChildFragment.return = workInProgress; + workInProgress.child = primaryChildFragment; + return primaryChildFragment; + } + function mountSuspenseFallbackChildren(workInProgress, primaryChildren, fallbackChildren, renderLanes) { + var mode = workInProgress.mode; + var progressedPrimaryFragment = workInProgress.child; + var primaryChildProps = { + mode: "hidden", + children: primaryChildren + }; + var primaryChildFragment; + var fallbackChildFragment; + if ((mode & ConcurrentMode) === NoMode && progressedPrimaryFragment !== null) { + // In legacy mode, we commit the primary tree as if it successfully + // completed, even though it's in an inconsistent state. + primaryChildFragment = progressedPrimaryFragment; + primaryChildFragment.childLanes = NoLanes; + primaryChildFragment.pendingProps = primaryChildProps; + if (workInProgress.mode & ProfileMode) { + // Reset the durations from the first pass so they aren't included in the + // final amounts. This seems counterintuitive, since we're intentionally + // not measuring part of the render phase, but this makes it match what we + // do in Concurrent Mode. + primaryChildFragment.actualDuration = 0; + primaryChildFragment.actualStartTime = -1; + primaryChildFragment.selfBaseDuration = 0; + primaryChildFragment.treeBaseDuration = 0; + } + fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); + } else { + primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode); + fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); + } + primaryChildFragment.return = workInProgress; + fallbackChildFragment.return = workInProgress; + primaryChildFragment.sibling = fallbackChildFragment; + workInProgress.child = primaryChildFragment; + return fallbackChildFragment; + } + function mountWorkInProgressOffscreenFiber(offscreenProps, mode, renderLanes) { + // The props argument to `createFiberFromOffscreen` is `any` typed, so we use + // this wrapper function to constrain it. + return createFiberFromOffscreen(offscreenProps, mode, NoLanes, null); + } + function updateWorkInProgressOffscreenFiber(current, offscreenProps) { + // The props argument to `createWorkInProgress` is `any` typed, so we use this + // wrapper function to constrain it. + return createWorkInProgress(current, offscreenProps); + } + function updateSuspensePrimaryChildren(current, workInProgress, primaryChildren, renderLanes) { + var currentPrimaryChildFragment = current.child; + var currentFallbackChildFragment = currentPrimaryChildFragment.sibling; + var primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, { + mode: "visible", + children: primaryChildren + }); + if ((workInProgress.mode & ConcurrentMode) === NoMode) { + primaryChildFragment.lanes = renderLanes; + } + primaryChildFragment.return = workInProgress; + primaryChildFragment.sibling = null; + if (currentFallbackChildFragment !== null) { + // Delete the fallback child fragment + var deletions = workInProgress.deletions; + if (deletions === null) { + workInProgress.deletions = [currentFallbackChildFragment]; + workInProgress.flags |= ChildDeletion; + } else { + deletions.push(currentFallbackChildFragment); + } + } + workInProgress.child = primaryChildFragment; + return primaryChildFragment; + } + function updateSuspenseFallbackChildren(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) { + var mode = workInProgress.mode; + var currentPrimaryChildFragment = current.child; + var currentFallbackChildFragment = currentPrimaryChildFragment.sibling; + var primaryChildProps = { + mode: "hidden", + children: primaryChildren + }; + var primaryChildFragment; + if ( + // In legacy mode, we commit the primary tree as if it successfully + // completed, even though it's in an inconsistent state. + (mode & ConcurrentMode) === NoMode && + // Make sure we're on the second pass, i.e. the primary child fragment was + // already cloned. In legacy mode, the only case where this isn't true is + // when DevTools forces us to display a fallback; we skip the first render + // pass entirely and go straight to rendering the fallback. (In Concurrent + // Mode, SuspenseList can also trigger this scenario, but this is a legacy- + // only codepath.) + workInProgress.child !== currentPrimaryChildFragment) { + var progressedPrimaryFragment = workInProgress.child; + primaryChildFragment = progressedPrimaryFragment; + primaryChildFragment.childLanes = NoLanes; + primaryChildFragment.pendingProps = primaryChildProps; + if (workInProgress.mode & ProfileMode) { + // Reset the durations from the first pass so they aren't included in the + // final amounts. This seems counterintuitive, since we're intentionally + // not measuring part of the render phase, but this makes it match what we + // do in Concurrent Mode. + primaryChildFragment.actualDuration = 0; + primaryChildFragment.actualStartTime = -1; + primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration; + primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration; + } // The fallback fiber was added as a deletion during the first pass. + // However, since we're going to remain on the fallback, we no longer want + // to delete it. + + workInProgress.deletions = null; + } else { + primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps); // Since we're reusing a current tree, we need to reuse the flags, too. + // (We don't do this in legacy mode, because in legacy mode we don't re-use + // the current tree; see previous branch.) + + primaryChildFragment.subtreeFlags = currentPrimaryChildFragment.subtreeFlags & StaticMask; + } + var fallbackChildFragment; + if (currentFallbackChildFragment !== null) { + fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren); + } else { + fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); // Needs a placement effect because the parent (the Suspense boundary) already + // mounted but this is a new fiber. + + fallbackChildFragment.flags |= Placement; + } + fallbackChildFragment.return = workInProgress; + primaryChildFragment.return = workInProgress; + primaryChildFragment.sibling = fallbackChildFragment; + workInProgress.child = primaryChildFragment; + return fallbackChildFragment; + } + function retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, recoverableError) { + // Falling back to client rendering. Because this has performance + // implications, it's considered a recoverable error, even though the user + // likely won't observe anything wrong with the UI. + // + // The error is passed in as an argument to enforce that every caller provide + // a custom message, or explicitly opt out (currently the only path that opts + // out is legacy mode; every concurrent path provides an error). + if (recoverableError !== null) { + queueHydrationError(recoverableError); + } // This will add the old fiber to the deletion list + + reconcileChildFibers(workInProgress, current.child, null, renderLanes); // We're now not suspended nor dehydrated. + + var nextProps = workInProgress.pendingProps; + var primaryChildren = nextProps.children; + var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress, primaryChildren); // Needs a placement effect because the parent (the Suspense boundary) already + // mounted but this is a new fiber. + + primaryChildFragment.flags |= Placement; + workInProgress.memoizedState = null; + return primaryChildFragment; + } + function mountSuspenseFallbackAfterRetryWithoutHydrating(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) { + var fiberMode = workInProgress.mode; + var primaryChildProps = { + mode: "visible", + children: primaryChildren + }; + var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, fiberMode); + var fallbackChildFragment = createFiberFromFragment(fallbackChildren, fiberMode, renderLanes, null); // Needs a placement effect because the parent (the Suspense + // boundary) already mounted but this is a new fiber. + + fallbackChildFragment.flags |= Placement; + primaryChildFragment.return = workInProgress; + fallbackChildFragment.return = workInProgress; + primaryChildFragment.sibling = fallbackChildFragment; + workInProgress.child = primaryChildFragment; + if ((workInProgress.mode & ConcurrentMode) !== NoMode) { + // We will have dropped the effect list which contains the + // deletion. We need to reconcile to delete the current child. + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + } + return fallbackChildFragment; + } + function mountDehydratedSuspenseComponent(workInProgress, suspenseInstance, renderLanes) { + // During the first pass, we'll bail out and not drill into the children. + // Instead, we'll leave the content in place and try to hydrate it later. + if ((workInProgress.mode & ConcurrentMode) === NoMode) { + { + error("Cannot hydrate Suspense in legacy mode. Switch from " + "ReactDOM.hydrate(element, container) to " + "ReactDOMClient.hydrateRoot(container, )" + ".render(element) or remove the Suspense components from " + "the server rendered components."); + } + workInProgress.lanes = laneToLanes(SyncLane); + } else if (isSuspenseInstanceFallback()) { + // This is a client-only boundary. Since we won't get any content from the server + // for this, we need to schedule that at a higher priority based on when it would + // have timed out. In theory we could render it in this pass but it would have the + // wrong priority associated with it and will prevent hydration of parent path. + // Instead, we'll leave work left on it to render it in a separate commit. + // TODO This time should be the time at which the server rendered response that is + // a parent to this boundary was displayed. However, since we currently don't have + // a protocol to transfer that time, we'll just estimate it by using the current + // time. This will mean that Suspense timeouts are slightly shifted to later than + // they should be. + // Schedule a normal pri update to render this content. + workInProgress.lanes = laneToLanes(DefaultHydrationLane); + } else { + // We'll continue hydrating the rest at offscreen priority since we'll already + // be showing the right content coming from the server, it is no rush. + workInProgress.lanes = laneToLanes(OffscreenLane); + } + return null; + } + function updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, suspenseInstance, suspenseState, renderLanes) { + if (!didSuspend) { + if ((workInProgress.mode & ConcurrentMode) === NoMode) { + return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, + // TODO: When we delete legacy mode, we should make this error argument + // required — every concurrent mode path that causes hydration to + // de-opt to client rendering should have an error message. + null); + } + if (isSuspenseInstanceFallback()) { + // This boundary is in a permanent fallback state. In this case, we'll never + // get an update and we'll never be able to hydrate the final content. Let's just try the + // client side render instead. + var digest, message, stack; + { + var _getSuspenseInstanceF = getSuspenseInstanceFallbackErrorDetails(); + digest = _getSuspenseInstanceF.digest; + message = _getSuspenseInstanceF.message; + stack = _getSuspenseInstanceF.stack; + } + var error; + if (message) { + // eslint-disable-next-line react-internal/prod-error-codes + error = new Error(message); + } else { + error = new Error("The server could not finish this Suspense boundary, likely " + "due to an error during server rendering. Switched to " + "client rendering."); + } + var capturedValue = createCapturedValue(error, digest, stack); + return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, capturedValue); + } + // any context has changed, we need to treat is as if the input might have changed. + + var hasContextChanged = includesSomeLane(renderLanes, current.childLanes); + if (didReceiveUpdate || hasContextChanged) { + // This boundary has changed since the first render. This means that we are now unable to + // hydrate it. We might still be able to hydrate it using a higher priority lane. + var root = getWorkInProgressRoot(); + if (root !== null) { + var attemptHydrationAtLane = getBumpedLaneForHydration(root, renderLanes); + if (attemptHydrationAtLane !== NoLane && attemptHydrationAtLane !== suspenseState.retryLane) { + // Intentionally mutating since this render will get interrupted. This + // is one of the very rare times where we mutate the current tree + // during the render phase. + suspenseState.retryLane = attemptHydrationAtLane; // TODO: Ideally this would inherit the event time of the current render + + var eventTime = NoTimestamp; + enqueueConcurrentRenderForLane(current, attemptHydrationAtLane); + scheduleUpdateOnFiber(root, current, attemptHydrationAtLane, eventTime); + } + } // If we have scheduled higher pri work above, this will probably just abort the render + // since we now have higher priority work, but in case it doesn't, we need to prepare to + // render something, if we time out. Even if that requires us to delete everything and + // skip hydration. + // Delay having to do this as long as the suspense timeout allows us. + + renderDidSuspendDelayIfPossible(); + var _capturedValue = createCapturedValue(new Error("This Suspense boundary received an update before it finished " + "hydrating. This caused the boundary to switch to client rendering. " + "The usual way to fix this is to wrap the original update " + "in startTransition.")); + return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, _capturedValue); + } else if (isSuspenseInstancePending()) { + // This component is still pending more data from the server, so we can't hydrate its + // content. We treat it as if this component suspended itself. It might seem as if + // we could just try to render it client-side instead. However, this will perform a + // lot of unnecessary work and is unlikely to complete since it often will suspend + // on missing data anyway. Additionally, the server might be able to render more + // than we can on the client yet. In that case we'd end up with more fallback states + // on the client than if we just leave it alone. If the server times out or errors + // these should update this boundary to the permanent Fallback state instead. + // Mark it as having captured (i.e. suspended). + workInProgress.flags |= DidCapture; // Leave the child in place. I.e. the dehydrated fragment. + + workInProgress.child = current.child; // Register a callback to retry this boundary once the server has sent the result. + + var retry = retryDehydratedSuspenseBoundary.bind(null, current); + registerSuspenseInstanceRetry(); + return null; + } else { + // This is the first attempt. + reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress, suspenseInstance, suspenseState.treeContext); + var primaryChildren = nextProps.children; + var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress, primaryChildren); // Mark the children as hydrating. This is a fast path to know whether this + // tree is part of a hydrating tree. This is used to determine if a child + // node has fully mounted yet, and for scheduling event replaying. + // Conceptually this is similar to Placement in that a new subtree is + // inserted into the React tree here. It just happens to not need DOM + // mutations because it already exists. + + primaryChildFragment.flags |= Hydrating; + return primaryChildFragment; + } + } else { + // This is the second render pass. We already attempted to hydrated, but + // something either suspended or errored. + if (workInProgress.flags & ForceClientRender) { + // Something errored during hydration. Try again without hydrating. + workInProgress.flags &= ~ForceClientRender; + var _capturedValue2 = createCapturedValue(new Error("There was an error while hydrating this Suspense boundary. " + "Switched to client rendering.")); + return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, _capturedValue2); + } else if (workInProgress.memoizedState !== null) { + // Something suspended and we should still be in dehydrated mode. + // Leave the existing child in place. + workInProgress.child = current.child; // The dehydrated completion pass expects this flag to be there + // but the normal suspense pass doesn't. + + workInProgress.flags |= DidCapture; + return null; + } else { + // Suspended but we should no longer be in dehydrated mode. + // Therefore we now have to render the fallback. + var nextPrimaryChildren = nextProps.children; + var nextFallbackChildren = nextProps.fallback; + var fallbackChildFragment = mountSuspenseFallbackAfterRetryWithoutHydrating(current, workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes); + var _primaryChildFragment4 = workInProgress.child; + _primaryChildFragment4.memoizedState = mountSuspenseOffscreenState(renderLanes); + workInProgress.memoizedState = SUSPENDED_MARKER; + return fallbackChildFragment; + } + } + } + function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes = mergeLanes(fiber.lanes, renderLanes); + var alternate = fiber.alternate; + if (alternate !== null) { + alternate.lanes = mergeLanes(alternate.lanes, renderLanes); + } + scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); + } + function propagateSuspenseContextChange(workInProgress, firstChild, renderLanes) { + // Mark any Suspense boundaries with fallbacks as having work to do. + // If they were previously forced into fallbacks, they may now be able + // to unblock. + var node = firstChild; + while (node !== null) { + if (node.tag === SuspenseComponent) { + var state = node.memoizedState; + if (state !== null) { + scheduleSuspenseWorkOnFiber(node, renderLanes, workInProgress); + } + } else if (node.tag === SuspenseListComponent) { + // If the tail is hidden there might not be an Suspense boundaries + // to schedule work on. In this case we have to schedule it on the + // list itself. + // We don't have to traverse to the children of the list since + // the list will propagate the change when it rerenders. + scheduleSuspenseWorkOnFiber(node, renderLanes, workInProgress); + } else if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } + if (node === workInProgress) { + return; + } + while (node.sibling === null) { + if (node.return === null || node.return === workInProgress) { + return; + } + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + } + function findLastContentRow(firstChild) { + // This is going to find the last row among these children that is already + // showing content on the screen, as opposed to being in fallback state or + // new. If a row has multiple Suspense boundaries, any of them being in the + // fallback state, counts as the whole row being in a fallback state. + // Note that the "rows" will be workInProgress, but any nested children + // will still be current since we haven't rendered them yet. The mounted + // order may not be the same as the new order. We use the new order. + var row = firstChild; + var lastContentRow = null; + while (row !== null) { + var currentRow = row.alternate; // New rows can't be content rows. + + if (currentRow !== null && findFirstSuspended(currentRow) === null) { + lastContentRow = row; + } + row = row.sibling; + } + return lastContentRow; + } + function validateRevealOrder(revealOrder) { + { + if (revealOrder !== undefined && revealOrder !== "forwards" && revealOrder !== "backwards" && revealOrder !== "together" && !didWarnAboutRevealOrder[revealOrder]) { + didWarnAboutRevealOrder[revealOrder] = true; + if (typeof revealOrder === "string") { + switch (revealOrder.toLowerCase()) { + case "together": + case "forwards": + case "backwards": + { + error('"%s" is not a valid value for revealOrder on . ' + 'Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase()); + break; + } + case "forward": + case "backward": + { + error('"%s" is not a valid value for revealOrder on . ' + 'React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase()); + break; + } + default: + error('"%s" is not a supported revealOrder on . ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder); + break; + } + } else { + error("%s is not a supported value for revealOrder on . " + 'Did you mean "together", "forwards" or "backwards"?', revealOrder); + } + } + } + } + function validateTailOptions(tailMode, revealOrder) { + { + if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) { + if (tailMode !== "collapsed" && tailMode !== "hidden") { + didWarnAboutTailOptions[tailMode] = true; + error('"%s" is not a supported value for tail on . ' + 'Did you mean "collapsed" or "hidden"?', tailMode); + } else if (revealOrder !== "forwards" && revealOrder !== "backwards") { + didWarnAboutTailOptions[tailMode] = true; + error(' is only valid if revealOrder is ' + '"forwards" or "backwards". ' + 'Did you mean to specify revealOrder="forwards"?', tailMode); + } + } + } + } + function validateSuspenseListNestedChild(childSlot, index) { + { + var isAnArray = isArray(childSlot); + var isIterable = !isAnArray && typeof getIteratorFn(childSlot) === "function"; + if (isAnArray || isIterable) { + var type = isAnArray ? "array" : "iterable"; + error("A nested %s was passed to row #%s in . Wrap it in " + "an additional SuspenseList to configure its revealOrder: " + " ... " + "{%s} ... " + "", type, index, type); + return false; + } + } + return true; + } + function validateSuspenseListChildren(children, revealOrder) { + { + if ((revealOrder === "forwards" || revealOrder === "backwards") && children !== undefined && children !== null && children !== false) { + if (isArray(children)) { + for (var i = 0; i < children.length; i++) { + if (!validateSuspenseListNestedChild(children[i], i)) { + return; + } + } + } else { + var iteratorFn = getIteratorFn(children); + if (typeof iteratorFn === "function") { + var childrenIterator = iteratorFn.call(children); + if (childrenIterator) { + var step = childrenIterator.next(); + var _i = 0; + for (; !step.done; step = childrenIterator.next()) { + if (!validateSuspenseListNestedChild(step.value, _i)) { + return; + } + _i++; + } + } + } else { + error('A single row was passed to a . ' + "This is not useful since it needs multiple rows. " + "Did you mean to pass multiple children or an array?", revealOrder); + } + } + } + } + } + function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode) { + var renderState = workInProgress.memoizedState; + if (renderState === null) { + workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + }; + } else { + // We can reuse the existing object from previous renders. + renderState.isBackwards = isBackwards; + renderState.rendering = null; + renderState.renderingStartTime = 0; + renderState.last = lastContentRow; + renderState.tail = tail; + renderState.tailMode = tailMode; + } + } // This can end up rendering this component multiple passes. + // The first pass splits the children fibers into two sets. A head and tail. + // We first render the head. If anything is in fallback state, we do another + // pass through beginWork to rerender all children (including the tail) with + // the force suspend context. If the first render didn't have anything in + // in fallback state. Then we render each row in the tail one-by-one. + // That happens in the completeWork phase without going back to beginWork. + + function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps; + var revealOrder = nextProps.revealOrder; + var tailMode = nextProps.tail; + var newChildren = nextProps.children; + validateRevealOrder(revealOrder); + validateTailOptions(tailMode, revealOrder); + validateSuspenseListChildren(newChildren, revealOrder); + reconcileChildren(current, workInProgress, newChildren, renderLanes); + var suspenseContext = suspenseStackCursor.current; + var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback); + if (shouldForceFallback) { + suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback); + workInProgress.flags |= DidCapture; + } else { + var didSuspendBefore = current !== null && (current.flags & DidCapture) !== NoFlags; + if (didSuspendBefore) { + // If we previously forced a fallback, we need to schedule work + // on any nested boundaries to let them know to try to render + // again. This is the same as context updating. + propagateSuspenseContextChange(workInProgress, workInProgress.child, renderLanes); + } + suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); + } + pushSuspenseContext(workInProgress, suspenseContext); + if ((workInProgress.mode & ConcurrentMode) === NoMode) { + // In legacy mode, SuspenseList doesn't work so we just + // use make it a noop by treating it as the default revealOrder. + workInProgress.memoizedState = null; + } else { + switch (revealOrder) { + case "forwards": + { + var lastContentRow = findLastContentRow(workInProgress.child); + var tail; + if (lastContentRow === null) { + // The whole list is part of the tail. + // TODO: We could fast path by just rendering the tail now. + tail = workInProgress.child; + workInProgress.child = null; + } else { + // Disconnect the tail rows after the content row. + // We're going to render them separately later. + tail = lastContentRow.sibling; + lastContentRow.sibling = null; + } + initSuspenseListRenderState(workInProgress, false, + // isBackwards + tail, lastContentRow, tailMode); + break; + } + case "backwards": + { + // We're going to find the first row that has existing content. + // At the same time we're going to reverse the list of everything + // we pass in the meantime. That's going to be our tail in reverse + // order. + var _tail = null; + var row = workInProgress.child; + workInProgress.child = null; + while (row !== null) { + var currentRow = row.alternate; // New rows can't be content rows. + + if (currentRow !== null && findFirstSuspended(currentRow) === null) { + // This is the beginning of the main content. + workInProgress.child = row; + break; + } + var nextRow = row.sibling; + row.sibling = _tail; + _tail = row; + row = nextRow; + } // TODO: If workInProgress.child is null, we can continue on the tail immediately. + + initSuspenseListRenderState(workInProgress, true, + // isBackwards + _tail, null, + // last + tailMode); + break; + } + case "together": + { + initSuspenseListRenderState(workInProgress, false, + // isBackwards + null, + // tail + null, + // last + undefined); + break; + } + default: + { + // The default reveal order is the same as not having + // a boundary. + workInProgress.memoizedState = null; + } + } + } + return workInProgress.child; + } + function updatePortalComponent(current, workInProgress, renderLanes) { + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + var nextChildren = workInProgress.pendingProps; + if (current === null) { + // Portals are special because we don't append the children during mount + // but at commit. Therefore we need to track insertions which the normal + // flow doesn't do during mount. This doesn't happen at the root because + // the root always starts with a "current" with a null child. + // TODO: Consider unifying this with how the root works. + workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes); + } else { + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + } + return workInProgress.child; + } + var hasWarnedAboutUsingNoValuePropOnContextProvider = false; + function updateContextProvider(current, workInProgress, renderLanes) { + var providerType = workInProgress.type; + var context = providerType._context; + var newProps = workInProgress.pendingProps; + var oldProps = workInProgress.memoizedProps; + var newValue = newProps.value; + { + if (!("value" in newProps)) { + if (!hasWarnedAboutUsingNoValuePropOnContextProvider) { + hasWarnedAboutUsingNoValuePropOnContextProvider = true; + error("The `value` prop is required for the ``. Did you misspell it or forget to pass it?"); + } + } + var providerPropTypes = workInProgress.type.propTypes; + if (providerPropTypes) { + checkPropTypes(providerPropTypes, newProps, "prop", "Context.Provider"); + } + } + pushProvider(workInProgress, context, newValue); + { + if (oldProps !== null) { + var oldValue = oldProps.value; + if (objectIs(oldValue, newValue)) { + // No change. Bailout early if children are the same. + if (oldProps.children === newProps.children && !hasContextChanged()) { + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + } else { + // The context value changed. Search for matching consumers and schedule + // them to update. + propagateContextChange(workInProgress, context, renderLanes); + } + } + } + var newChildren = newProps.children; + reconcileChildren(current, workInProgress, newChildren, renderLanes); + return workInProgress.child; + } + var hasWarnedAboutUsingContextAsConsumer = false; + function updateContextConsumer(current, workInProgress, renderLanes) { + var context = workInProgress.type; // The logic below for Context differs depending on PROD or DEV mode. In + // DEV mode, we create a separate object for Context.Consumer that acts + // like a proxy to Context. This proxy object adds unnecessary code in PROD + // so we use the old behaviour (Context.Consumer references Context) to + // reduce size and overhead. The separate object references context via + // a property called "_context", which also gives us the ability to check + // in DEV mode if this property exists or not and warn if it does not. + + { + if (context._context === undefined) { + // This may be because it's a Context (rather than a Consumer). + // Or it may be because it's older React where they're the same thing. + // We only want to warn if we're sure it's a new React. + if (context !== context.Consumer) { + if (!hasWarnedAboutUsingContextAsConsumer) { + hasWarnedAboutUsingContextAsConsumer = true; + error("Rendering directly is not supported and will be removed in " + "a future major release. Did you mean to render instead?"); + } + } + } else { + context = context._context; + } + } + var newProps = workInProgress.pendingProps; + var render = newProps.children; + { + if (typeof render !== "function") { + error("A context consumer was rendered with multiple children, or a child " + "that isn't a function. A context consumer expects a single child " + "that is a function. If you did pass a function, make sure there " + "is no trailing or leading whitespace around it."); + } + } + prepareToReadContext(workInProgress, renderLanes); + var newValue = _readContext(context); + var newChildren; + { + ReactCurrentOwner$1.current = workInProgress; + setIsRendering(true); + newChildren = render(newValue); + setIsRendering(false); + } + workInProgress.flags |= PerformedWork; + reconcileChildren(current, workInProgress, newChildren, renderLanes); + return workInProgress.child; + } + function markWorkInProgressReceivedUpdate() { + didReceiveUpdate = true; + } + function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + if ((workInProgress.mode & ConcurrentMode) === NoMode) { + if (current !== null) { + // A lazy component only mounts if it suspended inside a non- + // concurrent tree, in an inconsistent state. We want to treat it like + // a new mount, even though an empty version of it already committed. + // Disconnect the alternate pointers. + current.alternate = null; + workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect + + workInProgress.flags |= Placement; + } + } + } + function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { + if (current !== null) { + // Reuse previous dependencies + workInProgress.dependencies = current.dependencies; + } + { + // Don't update "base" render times for bailouts. + stopProfilerTimerIfRunning(); + } + markSkippedUpdateLanes(workInProgress.lanes); // Check if the children have any pending work. + + if (!includesSomeLane(renderLanes, workInProgress.childLanes)) { + // The children don't have any work either. We can skip them. + // TODO: Once we add back resuming, we should check if the children are + // a work-in-progress set. If so, we need to transfer their effects. + { + return null; + } + } // This fiber doesn't have work, but its subtree does. Clone the child + // fibers and continue. + + cloneChildFibers(current, workInProgress); + return workInProgress.child; + } + function remountFiber(current, oldWorkInProgress, newWorkInProgress) { + { + var returnFiber = oldWorkInProgress.return; + if (returnFiber === null) { + // eslint-disable-next-line react-internal/prod-error-codes + throw new Error("Cannot swap the root fiber."); + } // Disconnect from the old current. + // It will get deleted. + + current.alternate = null; + oldWorkInProgress.alternate = null; // Connect to the new tree. + + newWorkInProgress.index = oldWorkInProgress.index; + newWorkInProgress.sibling = oldWorkInProgress.sibling; + newWorkInProgress.return = oldWorkInProgress.return; + newWorkInProgress.ref = oldWorkInProgress.ref; // Replace the child/sibling pointers above it. + + if (oldWorkInProgress === returnFiber.child) { + returnFiber.child = newWorkInProgress; + } else { + var prevSibling = returnFiber.child; + if (prevSibling === null) { + // eslint-disable-next-line react-internal/prod-error-codes + throw new Error("Expected parent to have a child."); + } + while (prevSibling.sibling !== oldWorkInProgress) { + prevSibling = prevSibling.sibling; + if (prevSibling === null) { + // eslint-disable-next-line react-internal/prod-error-codes + throw new Error("Expected to find the previous sibling."); + } + } + prevSibling.sibling = newWorkInProgress; + } // Delete the old fiber and place the new one. + // Since the old fiber is disconnected, we have to schedule it manually. + + var deletions = returnFiber.deletions; + if (deletions === null) { + returnFiber.deletions = [current]; + returnFiber.flags |= ChildDeletion; + } else { + deletions.push(current); + } + newWorkInProgress.flags |= Placement; // Restart work from the new fiber. + + return newWorkInProgress; + } + } + function checkScheduledUpdateOrContext(current, renderLanes) { + // Before performing an early bailout, we must check if there are pending + // updates or context. + var updateLanes = current.lanes; + if (includesSomeLane(updateLanes, renderLanes)) { + return true; + } // No pending update, but because context is propagated lazily, we need + + return false; + } + function attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes) { + // This fiber does not have any pending work. Bailout without entering + // the begin phase. There's still some bookkeeping we that needs to be done + // in this optimized path, mostly pushing stuff onto the stack. + switch (workInProgress.tag) { + case HostRoot: + pushHostRootContext(workInProgress); + var root = workInProgress.stateNode; + break; + case HostComponent: + pushHostContext(workInProgress); + break; + case ClassComponent: + { + var Component = workInProgress.type; + if (isContextProvider(Component)) { + pushContextProvider(workInProgress); + } + break; + } + case HostPortal: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + break; + case ContextProvider: + { + var newValue = workInProgress.memoizedProps.value; + var context = workInProgress.type._context; + pushProvider(workInProgress, context, newValue); + break; + } + case Profiler: + { + // Profiler should only call onRender when one of its descendants actually rendered. + var hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes); + if (hasChildWork) { + workInProgress.flags |= Update; + } + { + // Reset effect durations for the next eventual effect phase. + // These are reset during render to allow the DevTools commit hook a chance to read them, + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = 0; + stateNode.passiveEffectDuration = 0; + } + } + break; + case SuspenseComponent: + { + var state = workInProgress.memoizedState; + if (state !== null) { + if (state.dehydrated !== null) { + pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // We know that this component will suspend again because if it has + // been unsuspended it has committed as a resolved Suspense component. + // If it needs to be retried, it should have work scheduled on it. + + workInProgress.flags |= DidCapture; // We should never render the children of a dehydrated boundary until we + // upgrade it. We return null instead of bailoutOnAlreadyFinishedWork. + + return null; + } // If this boundary is currently timed out, we need to decide + // whether to retry the primary children, or to skip over it and + // go straight to the fallback. Check the priority of the primary + // child fragment. + + var primaryChildFragment = workInProgress.child; + var primaryChildLanes = primaryChildFragment.childLanes; + if (includesSomeLane(renderLanes, primaryChildLanes)) { + // The primary children have pending work. Use the normal path + // to attempt to render the primary children again. + return updateSuspenseComponent(current, workInProgress, renderLanes); + } else { + // The primary child fragment does not have pending work marked + // on it + pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // The primary children do not have pending work with sufficient + // priority. Bailout. + + var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + if (child !== null) { + // The fallback children have pending work. Skip over the + // primary children and work on the fallback. + return child.sibling; + } else { + // Note: We can return `null` here because we already checked + // whether there were nested context consumers, via the call to + // `bailoutOnAlreadyFinishedWork` above. + return null; + } + } + } else { + pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); + } + break; + } + case SuspenseListComponent: + { + var didSuspendBefore = (current.flags & DidCapture) !== NoFlags; + var _hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes); + if (didSuspendBefore) { + if (_hasChildWork) { + // If something was in fallback state last time, and we have all the + // same children then we're still in progressive loading state. + // Something might get unblocked by state updates or retries in the + // tree which will affect the tail. So we need to use the normal + // path to compute the correct tail. + return updateSuspenseListComponent(current, workInProgress, renderLanes); + } // If none of the children had any work, that means that none of + // them got retried so they'll still be blocked in the same way + // as before. We can fast bail out. + + workInProgress.flags |= DidCapture; + } // If nothing suspended before and we're rendering the same children, + // then the tail doesn't matter. Anything new that suspends will work + // in the "together" mode, so we can continue from the state we had. + + var renderState = workInProgress.memoizedState; + if (renderState !== null) { + // Reset to the "together" mode in case we've started a different + // update in the past but didn't complete it. + renderState.rendering = null; + renderState.tail = null; + renderState.lastEffect = null; + } + pushSuspenseContext(workInProgress, suspenseStackCursor.current); + if (_hasChildWork) { + break; + } else { + // If none of the children had any work, that means that none of + // them got retried so they'll still be blocked in the same way + // as before. We can fast bail out. + return null; + } + } + case OffscreenComponent: + case LegacyHiddenComponent: + { + // Need to check if the tree still needs to be deferred. This is + // almost identical to the logic used in the normal update path, + // so we'll just enter that. The only difference is we'll bail out + // at the next level instead of this one, because the child props + // have not changed. Which is fine. + // TODO: Probably should refactor `beginWork` to split the bailout + // path from the normal path. I'm tempted to do a labeled break here + // but I won't :) + workInProgress.lanes = NoLanes; + return updateOffscreenComponent(current, workInProgress, renderLanes); + } + } + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + function beginWork(current, workInProgress, renderLanes) { + { + if (workInProgress._debugNeedsRemount && current !== null) { + // This will restart the begin phase with a new fiber. + return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.lanes)); + } + } + if (current !== null) { + var oldProps = current.memoizedProps; + var newProps = workInProgress.pendingProps; + if (oldProps !== newProps || hasContextChanged() || + // Force a re-render if the implementation changed due to hot reload: + workInProgress.type !== current.type) { + // If props or context changed, mark the fiber as having performed work. + // This may be unset if the props are determined to be equal later (memo). + didReceiveUpdate = true; + } else { + // Neither props nor legacy context changes. Check if there's a pending + // update or context change. + var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current, renderLanes); + if (!hasScheduledUpdateOrContext && + // If this is the second pass of an error or suspense boundary, there + // may not be work scheduled on `current`, so we check for this flag. + (workInProgress.flags & DidCapture) === NoFlags) { + // No pending updates or context. Bail out now. + didReceiveUpdate = false; + return attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes); + } + if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) { + // This is a special case that only exists for legacy mode. + // See https://github.com/facebook/react/pull/19216. + didReceiveUpdate = true; + } else { + // An update was scheduled on this fiber, but there are no new props + // nor legacy context. Set this to false. If an update queue or context + // consumer produces a changed value, it will set this to true. Otherwise, + // the component will assume the children have not changed and bail out. + didReceiveUpdate = false; + } + } + } else { + didReceiveUpdate = false; + } // Before entering the begin phase, clear pending update priority. + // TODO: This assumes that we're about to evaluate the component and process + // the update queue. However, there's an exception: SimpleMemoComponent + // sometimes bails out later in the begin phase. This indicates that we should + // move this assignment out of the common path and into each branch. + + workInProgress.lanes = NoLanes; + switch (workInProgress.tag) { + case IndeterminateComponent: + { + return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderLanes); + } + case LazyComponent: + { + var elementType = workInProgress.elementType; + return mountLazyComponent(current, workInProgress, elementType, renderLanes); + } + case FunctionComponent: + { + var Component = workInProgress.type; + var unresolvedProps = workInProgress.pendingProps; + var resolvedProps = workInProgress.elementType === Component ? unresolvedProps : resolveDefaultProps(Component, unresolvedProps); + return updateFunctionComponent(current, workInProgress, Component, resolvedProps, renderLanes); + } + case ClassComponent: + { + var _Component = workInProgress.type; + var _unresolvedProps = workInProgress.pendingProps; + var _resolvedProps = workInProgress.elementType === _Component ? _unresolvedProps : resolveDefaultProps(_Component, _unresolvedProps); + return updateClassComponent(current, workInProgress, _Component, _resolvedProps, renderLanes); + } + case HostRoot: + return updateHostRoot(current, workInProgress, renderLanes); + case HostComponent: + return updateHostComponent(current, workInProgress, renderLanes); + case HostText: + return updateHostText(); + case SuspenseComponent: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case HostPortal: + return updatePortalComponent(current, workInProgress, renderLanes); + case ForwardRef: + { + var type = workInProgress.type; + var _unresolvedProps2 = workInProgress.pendingProps; + var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2); + return updateForwardRef(current, workInProgress, type, _resolvedProps2, renderLanes); + } + case Fragment: + return updateFragment(current, workInProgress, renderLanes); + case Mode: + return updateMode(current, workInProgress, renderLanes); + case Profiler: + return updateProfiler(current, workInProgress, renderLanes); + case ContextProvider: + return updateContextProvider(current, workInProgress, renderLanes); + case ContextConsumer: + return updateContextConsumer(current, workInProgress, renderLanes); + case MemoComponent: + { + var _type2 = workInProgress.type; + var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props. + + var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3); + { + if (workInProgress.type !== workInProgress.elementType) { + var outerPropTypes = _type2.propTypes; + if (outerPropTypes) { + checkPropTypes(outerPropTypes, _resolvedProps3, + // Resolved for outer only + "prop", getComponentNameFromType(_type2)); + } + } + } + _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3); + return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, renderLanes); + } + case SimpleMemoComponent: + { + return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, renderLanes); + } + case IncompleteClassComponent: + { + var _Component2 = workInProgress.type; + var _unresolvedProps4 = workInProgress.pendingProps; + var _resolvedProps4 = workInProgress.elementType === _Component2 ? _unresolvedProps4 : resolveDefaultProps(_Component2, _unresolvedProps4); + return mountIncompleteClassComponent(current, workInProgress, _Component2, _resolvedProps4, renderLanes); + } + case SuspenseListComponent: + { + return updateSuspenseListComponent(current, workInProgress, renderLanes); + } + case ScopeComponent: + { + break; + } + case OffscreenComponent: + { + return updateOffscreenComponent(current, workInProgress, renderLanes); + } + } + throw new Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in " + "React. Please file an issue."); + } + function markUpdate(workInProgress) { + // Tag the fiber with an update effect. This turns a Placement into + // a PlacementAndUpdate. + workInProgress.flags |= Update; + } + function markRef$1(workInProgress) { + workInProgress.flags |= Ref; + } + var appendAllChildren; + var updateHostContainer; + var updateHostComponent$1; + var updateHostText$1; + { + // Mutation mode + appendAllChildren = function appendAllChildren(parent, workInProgress, needsVisibilityToggle, isHidden) { + // We only have the top Fiber that was created but we need recurse down its + // children to find all the terminal nodes. + var node = workInProgress.child; + while (node !== null) { + if (node.tag === HostComponent || node.tag === HostText) { + appendInitialChild(parent, node.stateNode); + } else if (node.tag === HostPortal) ;else if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } + if (node === workInProgress) { + return; + } + while (node.sibling === null) { + if (node.return === null || node.return === workInProgress) { + return; + } + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + }; + updateHostContainer = function updateHostContainer(current, workInProgress) { + // Noop + }; + updateHostComponent$1 = function updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance) { + // If we have an alternate, that means this is an update and we need to + // schedule a side-effect to do the updates. + var oldProps = current.memoizedProps; + if (oldProps === newProps) { + // In mutation mode, this is sufficient for a bailout because + // we won't touch this node even if children changed. + return; + } // If we get updated because one of our children updated, we don't + // have newProps so we'll have to reuse them. + // TODO: Split the update API as separate for the props vs. children. + // Even better would be if children weren't special cased at all tho. + + var instance = workInProgress.stateNode; + var currentHostContext = getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host + // component is hitting the resume path. Figure out why. Possibly + // related to `hidden`. + + var updatePayload = prepareUpdate(); // TODO: Type this specific to this type of component. + + workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there + // is a new ref we mark this as an update. All the work is done in commitWork. + + if (updatePayload) { + markUpdate(workInProgress); + } + }; + updateHostText$1 = function updateHostText$1(current, workInProgress, oldText, newText) { + // If the text differs, mark it as an update. All the work in done in commitWork. + if (oldText !== newText) { + markUpdate(workInProgress); + } + }; + } + function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { + switch (renderState.tailMode) { + case "hidden": + { + // Any insertions at the end of the tail list after this point + // should be invisible. If there are already mounted boundaries + // anything before them are not considered for collapsing. + // Therefore we need to go through the whole tail to find if + // there are any. + var tailNode = renderState.tail; + var lastTailNode = null; + while (tailNode !== null) { + if (tailNode.alternate !== null) { + lastTailNode = tailNode; + } + tailNode = tailNode.sibling; + } // Next we're simply going to delete all insertions after the + // last rendered item. + + if (lastTailNode === null) { + // All remaining items in the tail are insertions. + renderState.tail = null; + } else { + // Detach the insertion after the last node that was already + // inserted. + lastTailNode.sibling = null; + } + break; + } + case "collapsed": + { + // Any insertions at the end of the tail list after this point + // should be invisible. If there are already mounted boundaries + // anything before them are not considered for collapsing. + // Therefore we need to go through the whole tail to find if + // there are any. + var _tailNode = renderState.tail; + var _lastTailNode = null; + while (_tailNode !== null) { + if (_tailNode.alternate !== null) { + _lastTailNode = _tailNode; + } + _tailNode = _tailNode.sibling; + } // Next we're simply going to delete all insertions after the + // last rendered item. + + if (_lastTailNode === null) { + // All remaining items in the tail are insertions. + if (!hasRenderedATailFallback && renderState.tail !== null) { + // We suspended during the head. We want to show at least one + // row at the tail. So we'll keep on and cut off the rest. + renderState.tail.sibling = null; + } else { + renderState.tail = null; + } + } else { + // Detach the insertion after the last node that was already + // inserted. + _lastTailNode.sibling = null; + } + break; + } + } + } + function bubbleProperties(completedWork) { + var didBailout = completedWork.alternate !== null && completedWork.alternate.child === completedWork.child; + var newChildLanes = NoLanes; + var subtreeFlags = NoFlags; + if (!didBailout) { + // Bubble up the earliest expiration time. + if ((completedWork.mode & ProfileMode) !== NoMode) { + // In profiling mode, resetChildExpirationTime is also used to reset + // profiler durations. + var actualDuration = completedWork.actualDuration; + var treeBaseDuration = completedWork.selfBaseDuration; + var child = completedWork.child; + while (child !== null) { + newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes)); + subtreeFlags |= child.subtreeFlags; + subtreeFlags |= child.flags; // When a fiber is cloned, its actualDuration is reset to 0. This value will + // only be updated if work is done on the fiber (i.e. it doesn't bailout). + // When work is done, it should bubble to the parent's actualDuration. If + // the fiber has not been cloned though, (meaning no work was done), then + // this value will reflect the amount of time spent working on a previous + // render. In that case it should not bubble. We determine whether it was + // cloned by comparing the child pointer. + + actualDuration += child.actualDuration; + treeBaseDuration += child.treeBaseDuration; + child = child.sibling; + } + completedWork.actualDuration = actualDuration; + completedWork.treeBaseDuration = treeBaseDuration; + } else { + var _child = completedWork.child; + while (_child !== null) { + newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes)); + subtreeFlags |= _child.subtreeFlags; + subtreeFlags |= _child.flags; // Update the return pointer so the tree is consistent. This is a code + // smell because it assumes the commit phase is never concurrent with + // the render phase. Will address during refactor to alternate model. + + _child.return = completedWork; + _child = _child.sibling; + } + } + completedWork.subtreeFlags |= subtreeFlags; + } else { + // Bubble up the earliest expiration time. + if ((completedWork.mode & ProfileMode) !== NoMode) { + // In profiling mode, resetChildExpirationTime is also used to reset + // profiler durations. + var _treeBaseDuration = completedWork.selfBaseDuration; + var _child2 = completedWork.child; + while (_child2 !== null) { + newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child2.lanes, _child2.childLanes)); // "Static" flags share the lifetime of the fiber/hook they belong to, + // so we should bubble those up even during a bailout. All the other + // flags have a lifetime only of a single render + commit, so we should + // ignore them. + + subtreeFlags |= _child2.subtreeFlags & StaticMask; + subtreeFlags |= _child2.flags & StaticMask; + _treeBaseDuration += _child2.treeBaseDuration; + _child2 = _child2.sibling; + } + completedWork.treeBaseDuration = _treeBaseDuration; + } else { + var _child3 = completedWork.child; + while (_child3 !== null) { + newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child3.lanes, _child3.childLanes)); // "Static" flags share the lifetime of the fiber/hook they belong to, + // so we should bubble those up even during a bailout. All the other + // flags have a lifetime only of a single render + commit, so we should + // ignore them. + + subtreeFlags |= _child3.subtreeFlags & StaticMask; + subtreeFlags |= _child3.flags & StaticMask; // Update the return pointer so the tree is consistent. This is a code + // smell because it assumes the commit phase is never concurrent with + // the render phase. Will address during refactor to alternate model. + + _child3.return = completedWork; + _child3 = _child3.sibling; + } + } + completedWork.subtreeFlags |= subtreeFlags; + } + completedWork.childLanes = newChildLanes; + return didBailout; + } + function completeDehydratedSuspenseBoundary(current, workInProgress, nextState) { + var wasHydrated = popHydrationState(); + if (nextState !== null && nextState.dehydrated !== null) { + // We might be inside a hydration state the first time we're picking up this + // Suspense boundary, and also after we've reentered it for further hydration. + if (current === null) { + if (!wasHydrated) { + throw new Error("A dehydrated suspense component was completed without a hydrated node. " + "This is probably a bug in React."); + } + prepareToHydrateHostSuspenseInstance(); + bubbleProperties(workInProgress); + { + if ((workInProgress.mode & ProfileMode) !== NoMode) { + var isTimedOutSuspense = nextState !== null; + if (isTimedOutSuspense) { + // Don't count time spent in a timed out Suspense subtree as part of the base duration. + var primaryChildFragment = workInProgress.child; + if (primaryChildFragment !== null) { + // $FlowFixMe Flow doesn't support type casting in combination with the -= operator + workInProgress.treeBaseDuration -= primaryChildFragment.treeBaseDuration; + } + } + } + } + return false; + } else { + if ((workInProgress.flags & DidCapture) === NoFlags) { + // This boundary did not suspend so it's now hydrated and unsuspended. + workInProgress.memoizedState = null; + } // If nothing suspended, we need to schedule an effect to mark this boundary + // as having hydrated so events know that they're free to be invoked. + // It's also a signal to replay events and the suspense callback. + // If something suspended, schedule an effect to attach retry listeners. + // So we might as well always mark this. + + workInProgress.flags |= Update; + bubbleProperties(workInProgress); + { + if ((workInProgress.mode & ProfileMode) !== NoMode) { + var _isTimedOutSuspense = nextState !== null; + if (_isTimedOutSuspense) { + // Don't count time spent in a timed out Suspense subtree as part of the base duration. + var _primaryChildFragment = workInProgress.child; + if (_primaryChildFragment !== null) { + // $FlowFixMe Flow doesn't support type casting in combination with the -= operator + workInProgress.treeBaseDuration -= _primaryChildFragment.treeBaseDuration; + } + } + } + } + return false; + } + } else { + // Successfully completed this tree. If this was a forced client render, + // there may have been recoverable errors during first hydration + // attempt. If so, add them to a queue so we can log them in the + // commit phase. + upgradeHydrationErrorsToRecoverable(); // Fall through to normal Suspense path + + return true; + } + } + function completeWork(current, workInProgress, renderLanes) { + var newProps = workInProgress.pendingProps; // Note: This intentionally doesn't check if we're hydrating because comparing + // to the current tree provider fiber is just as fast and less error-prone. + // Ideally we would have a special version of the work loop only + // for hydration. + + popTreeContext(workInProgress); + switch (workInProgress.tag) { + case IndeterminateComponent: + case LazyComponent: + case SimpleMemoComponent: + case FunctionComponent: + case ForwardRef: + case Fragment: + case Mode: + case Profiler: + case ContextConsumer: + case MemoComponent: + bubbleProperties(workInProgress); + return null; + case ClassComponent: + { + var Component = workInProgress.type; + if (isContextProvider(Component)) { + popContext(workInProgress); + } + bubbleProperties(workInProgress); + return null; + } + case HostRoot: + { + var fiberRoot = workInProgress.stateNode; + popHostContainer(workInProgress); + popTopLevelContextObject(workInProgress); + resetWorkInProgressVersions(); + if (fiberRoot.pendingContext) { + fiberRoot.context = fiberRoot.pendingContext; + fiberRoot.pendingContext = null; + } + if (current === null || current.child === null) { + // If we hydrated, pop so that we can delete any remaining children + // that weren't hydrated. + var wasHydrated = popHydrationState(); + if (wasHydrated) { + // If we hydrated, then we'll need to schedule an update for + // the commit side-effects on the root. + markUpdate(workInProgress); + } else { + if (current !== null) { + var prevState = current.memoizedState; + if ( + // Check if this is a client root + !prevState.isDehydrated || + // Check if we reverted to client rendering (e.g. due to an error) + (workInProgress.flags & ForceClientRender) !== NoFlags) { + // Schedule an effect to clear this container at the start of the + // next commit. This handles the case of React rendering into a + // container with previous children. It's also safe to do for + // updates too, because current.child would only be null if the + // previous render was null (so the container would already + // be empty). + workInProgress.flags |= Snapshot; // If this was a forced client render, there may have been + // recoverable errors during first hydration attempt. If so, add + // them to a queue so we can log them in the commit phase. + + upgradeHydrationErrorsToRecoverable(); + } + } + } + } + updateHostContainer(current, workInProgress); + bubbleProperties(workInProgress); + return null; + } + case HostComponent: + { + popHostContext(workInProgress); + var rootContainerInstance = getRootHostContainer(); + var type = workInProgress.type; + if (current !== null && workInProgress.stateNode != null) { + updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance); + if (current.ref !== workInProgress.ref) { + markRef$1(workInProgress); + } + } else { + if (!newProps) { + if (workInProgress.stateNode === null) { + throw new Error("We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."); + } // This can happen when we abort work. + + bubbleProperties(workInProgress); + return null; + } + var currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context + // "stack" as the parent. Then append children as we go in beginWork + // or completeWork depending on whether we want to add them top->down or + // bottom->up. Top->down is faster in IE11. + + var _wasHydrated = popHydrationState(); + if (_wasHydrated) { + // TODO: Move this and createInstance step into the beginPhase + // to consolidate. + if (prepareToHydrateHostInstance()) { + // If changes to the hydrated node need to be applied at the + // commit-phase we mark this as such. + markUpdate(workInProgress); + } + } else { + var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress); + appendAllChildren(instance, workInProgress, false, false); + workInProgress.stateNode = instance; // Certain renderers require commit-time effects for initial mount. + // (eg DOM renderer supports auto-focus for certain elements). + // Make sure such renderers get scheduled for later work. + + if (finalizeInitialChildren(instance)) { + markUpdate(workInProgress); + } + } + if (workInProgress.ref !== null) { + // If there is a ref on a host node we need to schedule a callback + markRef$1(workInProgress); + } + } + bubbleProperties(workInProgress); + return null; + } + case HostText: + { + var newText = newProps; + if (current && workInProgress.stateNode != null) { + var oldText = current.memoizedProps; // If we have an alternate, that means this is an update and we need + // to schedule a side-effect to do the updates. + + updateHostText$1(current, workInProgress, oldText, newText); + } else { + if (typeof newText !== "string") { + if (workInProgress.stateNode === null) { + throw new Error("We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."); + } // This can happen when we abort work. + } + var _rootContainerInstance = getRootHostContainer(); + var _currentHostContext = getHostContext(); + var _wasHydrated2 = popHydrationState(); + if (_wasHydrated2) { + if (prepareToHydrateHostTextInstance()) { + markUpdate(workInProgress); + } + } else { + workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress); + } + } + bubbleProperties(workInProgress); + return null; + } + case SuspenseComponent: + { + popSuspenseContext(workInProgress); + var nextState = workInProgress.memoizedState; // Special path for dehydrated boundaries. We may eventually move this + // to its own fiber type so that we can add other kinds of hydration + // boundaries that aren't associated with a Suspense tree. In anticipation + // of such a refactor, all the hydration logic is contained in + // this branch. + + if (current === null || current.memoizedState !== null && current.memoizedState.dehydrated !== null) { + var fallthroughToNormalSuspensePath = completeDehydratedSuspenseBoundary(current, workInProgress, nextState); + if (!fallthroughToNormalSuspensePath) { + if (workInProgress.flags & ShouldCapture) { + // Special case. There were remaining unhydrated nodes. We treat + // this as a mismatch. Revert to client rendering. + return workInProgress; + } else { + // Did not finish hydrating, either because this is the initial + // render or because something suspended. + return null; + } + } // Continue with the normal Suspense path. + } + if ((workInProgress.flags & DidCapture) !== NoFlags) { + // Something suspended. Re-render with the fallback children. + workInProgress.lanes = renderLanes; // Do not reset the effect list. + + if ((workInProgress.mode & ProfileMode) !== NoMode) { + transferActualDuration(workInProgress); + } // Don't bubble properties in this case. + + return workInProgress; + } + var nextDidTimeout = nextState !== null; + var prevDidTimeout = current !== null && current.memoizedState !== null; + // a passive effect, which is when we process the transitions + + if (nextDidTimeout !== prevDidTimeout) { + // an effect to toggle the subtree's visibility. When we switch from + // fallback -> primary, the inner Offscreen fiber schedules this effect + // as part of its normal complete phase. But when we switch from + // primary -> fallback, the inner Offscreen fiber does not have a complete + // phase. So we need to schedule its effect here. + // + // We also use this flag to connect/disconnect the effects, but the same + // logic applies: when re-connecting, the Offscreen fiber's complete + // phase will handle scheduling the effect. It's only when the fallback + // is active that we have to do anything special. + + if (nextDidTimeout) { + var _offscreenFiber2 = workInProgress.child; + _offscreenFiber2.flags |= Visibility; // TODO: This will still suspend a synchronous tree if anything + // in the concurrent tree already suspended during this render. + // This is a known bug. + + if ((workInProgress.mode & ConcurrentMode) !== NoMode) { + // TODO: Move this back to throwException because this is too late + // if this is a large tree which is common for initial loads. We + // don't know if we should restart a render or not until we get + // this marker, and this is too late. + // If this render already had a ping or lower pri updates, + // and this is the first time we know we're going to suspend we + // should be able to immediately restart from within throwException. + var hasInvisibleChildContext = current === null && (workInProgress.memoizedProps.unstable_avoidThisFallback !== true || !enableSuspenseAvoidThisFallback); + if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) { + // If this was in an invisible tree or a new render, then showing + // this boundary is ok. + renderDidSuspend(); + } else { + // Otherwise, we're going to have to hide content so we should + // suspend for longer if possible. + renderDidSuspendDelayIfPossible(); + } + } + } + } + var wakeables = workInProgress.updateQueue; + if (wakeables !== null) { + // Schedule an effect to attach a retry listener to the promise. + // TODO: Move to passive phase + workInProgress.flags |= Update; + } + bubbleProperties(workInProgress); + { + if ((workInProgress.mode & ProfileMode) !== NoMode) { + if (nextDidTimeout) { + // Don't count time spent in a timed out Suspense subtree as part of the base duration. + var primaryChildFragment = workInProgress.child; + if (primaryChildFragment !== null) { + // $FlowFixMe Flow doesn't support type casting in combination with the -= operator + workInProgress.treeBaseDuration -= primaryChildFragment.treeBaseDuration; + } + } + } + } + return null; + } + case HostPortal: + popHostContainer(workInProgress); + updateHostContainer(current, workInProgress); + if (current === null) { + preparePortalMount(workInProgress.stateNode.containerInfo); + } + bubbleProperties(workInProgress); + return null; + case ContextProvider: + // Pop provider fiber + var context = workInProgress.type._context; + popProvider(context, workInProgress); + bubbleProperties(workInProgress); + return null; + case IncompleteClassComponent: + { + // Same as class component case. I put it down here so that the tags are + // sequential to ensure this switch is compiled to a jump table. + var _Component = workInProgress.type; + if (isContextProvider(_Component)) { + popContext(workInProgress); + } + bubbleProperties(workInProgress); + return null; + } + case SuspenseListComponent: + { + popSuspenseContext(workInProgress); + var renderState = workInProgress.memoizedState; + if (renderState === null) { + // We're running in the default, "independent" mode. + // We don't do anything in this mode. + bubbleProperties(workInProgress); + return null; + } + var didSuspendAlready = (workInProgress.flags & DidCapture) !== NoFlags; + var renderedTail = renderState.rendering; + if (renderedTail === null) { + // We just rendered the head. + if (!didSuspendAlready) { + // This is the first pass. We need to figure out if anything is still + // suspended in the rendered set. + // If new content unsuspended, but there's still some content that + // didn't. Then we need to do a second pass that forces everything + // to keep showing their fallbacks. + // We might be suspended if something in this render pass suspended, or + // something in the previous committed pass suspended. Otherwise, + // there's no chance so we can skip the expensive call to + // findFirstSuspended. + var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.flags & DidCapture) === NoFlags); + if (!cannotBeSuspended) { + var row = workInProgress.child; + while (row !== null) { + var suspended = findFirstSuspended(row); + if (suspended !== null) { + didSuspendAlready = true; + workInProgress.flags |= DidCapture; + cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as + // part of the second pass. In that case nothing will subscribe to + // its thenables. Instead, we'll transfer its thenables to the + // SuspenseList so that it can retry if they resolve. + // There might be multiple of these in the list but since we're + // going to wait for all of them anyway, it doesn't really matter + // which ones gets to ping. In theory we could get clever and keep + // track of how many dependencies remain but it gets tricky because + // in the meantime, we can add/remove/change items and dependencies. + // We might bail out of the loop before finding any but that + // doesn't matter since that means that the other boundaries that + // we did find already has their listeners attached. + + var newThenables = suspended.updateQueue; + if (newThenables !== null) { + workInProgress.updateQueue = newThenables; + workInProgress.flags |= Update; + } // Rerender the whole list, but this time, we'll force fallbacks + // to stay in place. + // Reset the effect flags before doing the second pass since that's now invalid. + // Reset the child fibers to their original state. + + workInProgress.subtreeFlags = NoFlags; + resetChildFibers(workInProgress, renderLanes); // Set up the Suspense Context to force suspense and immediately + // rerender the children. + + pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback)); // Don't bubble properties in this case. + + return workInProgress.child; + } + row = row.sibling; + } + } + if (renderState.tail !== null && now() > getRenderTargetTime()) { + // We have already passed our CPU deadline but we still have rows + // left in the tail. We'll just give up further attempts to render + // the main content and only render fallbacks. + workInProgress.flags |= DidCapture; + didSuspendAlready = true; + cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this + // to get it started back up to attempt the next item. While in terms + // of priority this work has the same priority as this current render, + // it's not part of the same transition once the transition has + // committed. If it's sync, we still want to yield so that it can be + // painted. Conceptually, this is really the same as pinging. + // We can use any RetryLane even if it's the one currently rendering + // since we're leaving it behind on this node. + + workInProgress.lanes = SomeRetryLane; + } + } else { + cutOffTailIfNeeded(renderState, false); + } // Next we're going to render the tail. + } else { + // Append the rendered row to the child list. + if (!didSuspendAlready) { + var _suspended = findFirstSuspended(renderedTail); + if (_suspended !== null) { + workInProgress.flags |= DidCapture; + didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't + // get lost if this row ends up dropped during a second pass. + + var _newThenables = _suspended.updateQueue; + if (_newThenables !== null) { + workInProgress.updateQueue = _newThenables; + workInProgress.flags |= Update; + } + cutOffTailIfNeeded(renderState, true); // This might have been modified. + + if (renderState.tail === null && renderState.tailMode === "hidden" && !renderedTail.alternate && !getIsHydrating() // We don't cut it if we're hydrating. + ) { + // We're done. + bubbleProperties(workInProgress); + return null; + } + } else if ( + // The time it took to render last row is greater than the remaining + // time we have to render. So rendering one more row would likely + // exceed it. + now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes !== OffscreenLane) { + // We have now passed our CPU deadline and we'll just give up further + // attempts to render the main content and only render fallbacks. + // The assumption is that this is usually faster. + workInProgress.flags |= DidCapture; + didSuspendAlready = true; + cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this + // to get it started back up to attempt the next item. While in terms + // of priority this work has the same priority as this current render, + // it's not part of the same transition once the transition has + // committed. If it's sync, we still want to yield so that it can be + // painted. Conceptually, this is really the same as pinging. + // We can use any RetryLane even if it's the one currently rendering + // since we're leaving it behind on this node. + + workInProgress.lanes = SomeRetryLane; + } + } + if (renderState.isBackwards) { + // The effect list of the backwards tail will have been added + // to the end. This breaks the guarantee that life-cycles fire in + // sibling order but that isn't a strong guarantee promised by React. + // Especially since these might also just pop in during future commits. + // Append to the beginning of the list. + renderedTail.sibling = workInProgress.child; + workInProgress.child = renderedTail; + } else { + var previousSibling = renderState.last; + if (previousSibling !== null) { + previousSibling.sibling = renderedTail; + } else { + workInProgress.child = renderedTail; + } + renderState.last = renderedTail; + } + } + if (renderState.tail !== null) { + // We still have tail rows to render. + // Pop a row. + var next = renderState.tail; + renderState.rendering = next; + renderState.tail = next.sibling; + renderState.renderingStartTime = now(); + next.sibling = null; // Restore the context. + // TODO: We can probably just avoid popping it instead and only + // setting it the first time we go from not suspended to suspended. + + var suspenseContext = suspenseStackCursor.current; + if (didSuspendAlready) { + suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback); + } else { + suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); + } + pushSuspenseContext(workInProgress, suspenseContext); // Do a pass over the next row. + // Don't bubble properties in this case. + + return next; + } + bubbleProperties(workInProgress); + return null; + } + case ScopeComponent: + { + break; + } + case OffscreenComponent: + case LegacyHiddenComponent: + { + popRenderLanes(workInProgress); + var _nextState = workInProgress.memoizedState; + var nextIsHidden = _nextState !== null; + if (current !== null) { + var _prevState = current.memoizedState; + var prevIsHidden = _prevState !== null; + if (prevIsHidden !== nextIsHidden && + // LegacyHidden doesn't do any hiding — it only pre-renders. + !enableLegacyHidden) { + workInProgress.flags |= Visibility; + } + } + if (!nextIsHidden || (workInProgress.mode & ConcurrentMode) === NoMode) { + bubbleProperties(workInProgress); + } else { + // Don't bubble properties for hidden children unless we're rendering + // at offscreen priority. + if (includesSomeLane(subtreeRenderLanes, OffscreenLane)) { + bubbleProperties(workInProgress); + { + // Check if there was an insertion or update in the hidden subtree. + // If so, we need to hide those nodes in the commit phase, so + // schedule a visibility effect. + if (workInProgress.subtreeFlags & (Placement | Update)) { + workInProgress.flags |= Visibility; + } + } + } + } + return null; + } + case CacheComponent: + { + return null; + } + case TracingMarkerComponent: + { + return null; + } + } + throw new Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in " + "React. Please file an issue."); + } + function unwindWork(current, workInProgress, renderLanes) { + // Note: This intentionally doesn't check if we're hydrating because comparing + // to the current tree provider fiber is just as fast and less error-prone. + // Ideally we would have a special version of the work loop only + // for hydration. + popTreeContext(workInProgress); + switch (workInProgress.tag) { + case ClassComponent: + { + var Component = workInProgress.type; + if (isContextProvider(Component)) { + popContext(workInProgress); + } + var flags = workInProgress.flags; + if (flags & ShouldCapture) { + workInProgress.flags = flags & ~ShouldCapture | DidCapture; + if ((workInProgress.mode & ProfileMode) !== NoMode) { + transferActualDuration(workInProgress); + } + return workInProgress; + } + return null; + } + case HostRoot: + { + var root = workInProgress.stateNode; + popHostContainer(workInProgress); + popTopLevelContextObject(workInProgress); + resetWorkInProgressVersions(); + var _flags = workInProgress.flags; + if ((_flags & ShouldCapture) !== NoFlags && (_flags & DidCapture) === NoFlags) { + // There was an error during render that wasn't captured by a suspense + // boundary. Do a second pass on the root to unmount the children. + workInProgress.flags = _flags & ~ShouldCapture | DidCapture; + return workInProgress; + } // We unwound to the root without completing it. Exit. + + return null; + } + case HostComponent: + { + // TODO: popHydrationState + popHostContext(workInProgress); + return null; + } + case SuspenseComponent: + { + popSuspenseContext(workInProgress); + var suspenseState = workInProgress.memoizedState; + if (suspenseState !== null && suspenseState.dehydrated !== null) { + if (workInProgress.alternate === null) { + throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in " + "React. Please file an issue."); + } + } + var _flags2 = workInProgress.flags; + if (_flags2 & ShouldCapture) { + workInProgress.flags = _flags2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary. + + if ((workInProgress.mode & ProfileMode) !== NoMode) { + transferActualDuration(workInProgress); + } + return workInProgress; + } + return null; + } + case SuspenseListComponent: + { + popSuspenseContext(workInProgress); // SuspenseList doesn't actually catch anything. It should've been + // caught by a nested boundary. If not, it should bubble through. + + return null; + } + case HostPortal: + popHostContainer(workInProgress); + return null; + case ContextProvider: + var context = workInProgress.type._context; + popProvider(context, workInProgress); + return null; + case OffscreenComponent: + case LegacyHiddenComponent: + popRenderLanes(workInProgress); + return null; + case CacheComponent: + return null; + default: + return null; + } + } + function unwindInterruptedWork(current, interruptedWork, renderLanes) { + // Note: This intentionally doesn't check if we're hydrating because comparing + // to the current tree provider fiber is just as fast and less error-prone. + // Ideally we would have a special version of the work loop only + // for hydration. + popTreeContext(interruptedWork); + switch (interruptedWork.tag) { + case ClassComponent: + { + var childContextTypes = interruptedWork.type.childContextTypes; + if (childContextTypes !== null && childContextTypes !== undefined) { + popContext(interruptedWork); + } + break; + } + case HostRoot: + { + var root = interruptedWork.stateNode; + popHostContainer(interruptedWork); + popTopLevelContextObject(interruptedWork); + resetWorkInProgressVersions(); + break; + } + case HostComponent: + { + popHostContext(interruptedWork); + break; + } + case HostPortal: + popHostContainer(interruptedWork); + break; + case SuspenseComponent: + popSuspenseContext(interruptedWork); + break; + case SuspenseListComponent: + popSuspenseContext(interruptedWork); + break; + case ContextProvider: + var context = interruptedWork.type._context; + popProvider(context, interruptedWork); + break; + case OffscreenComponent: + case LegacyHiddenComponent: + popRenderLanes(interruptedWork); + break; + } + } + var didWarnAboutUndefinedSnapshotBeforeUpdate = null; + { + didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); + } // Used during the commit phase to track the state of the Offscreen component stack. + var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set; + var nextEffect = null; // Used for Profiling builds to track updaters. + + var inProgressLanes = null; + var inProgressRoot = null; + function reportUncaughtErrorInDEV(error) { + // Wrapping each small part of the commit phase into a guarded + // callback is a bit too slow (https://github.com/facebook/react/pull/21666). + // But we rely on it to surface errors to DEV tools like overlays + // (https://github.com/facebook/react/issues/21712). + // As a compromise, rethrow only caught errors in a guard. + { + invokeGuardedCallback(null, function () { + throw error; + }); + clearCaughtError(); + } + } + var callComponentWillUnmountWithTimer = function callComponentWillUnmountWithTimer(current, instance) { + instance.props = current.memoizedProps; + instance.state = current.memoizedState; + if (current.mode & ProfileMode) { + try { + startLayoutEffectTimer(); + instance.componentWillUnmount(); + } finally { + recordLayoutEffectDuration(current); + } + } else { + instance.componentWillUnmount(); + } + }; // Capture errors so they don't interrupt mounting. + + function safelyCallComponentWillUnmount(current, nearestMountedAncestor, instance) { + try { + callComponentWillUnmountWithTimer(current, instance); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } // Capture errors so they don't interrupt mounting. + + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref; + if (ref !== null) { + if (typeof ref === "function") { + var retVal; + try { + if (enableProfilerTimer && enableProfilerCommitHooks && current.mode & ProfileMode) { + try { + startLayoutEffectTimer(); + retVal = ref(null); + } finally { + recordLayoutEffectDuration(current); + } + } else { + retVal = ref(null); + } + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + { + if (typeof retVal === "function") { + error("Unexpected return value from a callback ref in %s. " + "A callback ref should not return a function.", getComponentNameFromFiber(current)); + } + } + } else { + ref.current = null; + } + } + } + function safelyCallDestroy(current, nearestMountedAncestor, destroy) { + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + var focusedInstanceHandle = null; + var shouldFireAfterActiveInstanceBlur = false; + function commitBeforeMutationEffects(root, firstChild) { + focusedInstanceHandle = prepareForCommit(root.containerInfo); + nextEffect = firstChild; + commitBeforeMutationEffects_begin(); // We no longer need to track the active instance fiber + + var shouldFire = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = false; + focusedInstanceHandle = null; + return shouldFire; + } + function commitBeforeMutationEffects_begin() { + while (nextEffect !== null) { + var fiber = nextEffect; // This phase is only used for beforeActiveInstanceBlur. + + var child = fiber.child; + if ((fiber.subtreeFlags & BeforeMutationMask) !== NoFlags && child !== null) { + child.return = fiber; + nextEffect = child; + } else { + commitBeforeMutationEffects_complete(); + } + } + } + function commitBeforeMutationEffects_complete() { + while (nextEffect !== null) { + var fiber = nextEffect; + setCurrentFiber(fiber); + try { + commitBeforeMutationEffectsOnFiber(fiber); + } catch (error) { + captureCommitPhaseError(fiber, fiber.return, error); + } + resetCurrentFiber(); + var sibling = fiber.sibling; + if (sibling !== null) { + sibling.return = fiber.return; + nextEffect = sibling; + return; + } + nextEffect = fiber.return; + } + } + function commitBeforeMutationEffectsOnFiber(finishedWork) { + var current = finishedWork.alternate; + var flags = finishedWork.flags; + if ((flags & Snapshot) !== NoFlags) { + setCurrentFiber(finishedWork); + switch (finishedWork.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + { + break; + } + case ClassComponent: + { + if (current !== null) { + var prevProps = current.memoizedProps; + var prevState = current.memoizedState; + var instance = finishedWork.stateNode; // We could update instance props and state here, + // but instead we rely on them being set during last render. + // TODO: revisit this when we implement resuming. + + { + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + if (instance.props !== finishedWork.memoizedProps) { + error("Expected %s props to match memoized props before " + "getSnapshotBeforeUpdate. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.props`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + if (instance.state !== finishedWork.memoizedState) { + error("Expected %s state to match memoized state before " + "getSnapshotBeforeUpdate. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.state`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + } + } + var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState); + { + var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate; + if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) { + didWarnSet.add(finishedWork.type); + error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) " + "must be returned. You have returned undefined.", getComponentNameFromFiber(finishedWork)); + } + } + instance.__reactInternalSnapshotBeforeUpdate = snapshot; + } + break; + } + case HostRoot: + { + { + var root = finishedWork.stateNode; + clearContainer(root.containerInfo); + } + break; + } + case HostComponent: + case HostText: + case HostPortal: + case IncompleteClassComponent: + // Nothing to do for these component types + break; + default: + { + throw new 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."); + } + } + resetCurrentFiber(); + } + } + function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) { + var updateQueue = finishedWork.updateQueue; + var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null; + if (lastEffect !== null) { + var firstEffect = lastEffect.next; + var effect = firstEffect; + do { + if ((effect.tag & flags) === flags) { + // Unmount + var destroy = effect.destroy; + effect.destroy = undefined; + if (destroy !== undefined) { + { + if ((flags & Insertion) !== NoFlags$1) { + setIsRunningInsertionEffect(true); + } + } + safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy); + { + if ((flags & Insertion) !== NoFlags$1) { + setIsRunningInsertionEffect(false); + } + } + } + } + effect = effect.next; + } while (effect !== firstEffect); + } + } + function commitHookEffectListMount(flags, finishedWork) { + var updateQueue = finishedWork.updateQueue; + var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null; + if (lastEffect !== null) { + var firstEffect = lastEffect.next; + var effect = firstEffect; + do { + if ((effect.tag & flags) === flags) { + var create = effect.create; + { + if ((flags & Insertion) !== NoFlags$1) { + setIsRunningInsertionEffect(true); + } + } + effect.destroy = create(); + { + if ((flags & Insertion) !== NoFlags$1) { + setIsRunningInsertionEffect(false); + } + } + { + var destroy = effect.destroy; + if (destroy !== undefined && typeof destroy !== "function") { + var hookName = void 0; + if ((effect.tag & Layout) !== NoFlags) { + hookName = "useLayoutEffect"; + } else if ((effect.tag & Insertion) !== NoFlags) { + hookName = "useInsertionEffect"; + } else { + hookName = "useEffect"; + } + var addendum = void 0; + if (destroy === null) { + addendum = " You returned null. If your effect does not require clean " + "up, return undefined (or nothing)."; + } else if (typeof destroy.then === "function") { + addendum = "\n\nIt looks like you wrote " + hookName + "(async () => ...) or returned a Promise. " + "Instead, write the async function inside your effect " + "and call it immediately:\n\n" + hookName + "(() => {\n" + " async function fetchData() {\n" + " // You can await here\n" + " const response = await MyAPI.getData(someId);\n" + " // ...\n" + " }\n" + " fetchData();\n" + "}, [someId]); // Or [] if effect doesn't need props or state\n\n" + "Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching"; + } else { + addendum = " You returned: " + destroy; + } + error("%s must not return anything besides a function, " + "which is used for clean-up.%s", hookName, addendum); + } + } + } + effect = effect.next; + } while (effect !== firstEffect); + } + } + function commitPassiveEffectDurations(finishedRoot, finishedWork) { + { + // Only Profilers with work in their subtree will have an Update effect scheduled. + if ((finishedWork.flags & Update) !== NoFlags) { + switch (finishedWork.tag) { + case Profiler: + { + var passiveEffectDuration = finishedWork.stateNode.passiveEffectDuration; + var _finishedWork$memoize = finishedWork.memoizedProps, + id = _finishedWork$memoize.id, + onPostCommit = _finishedWork$memoize.onPostCommit; // This value will still reflect the previous commit phase. + // It does not get reset until the start of the next commit phase. + + var commitTime = getCommitTime(); + var phase = finishedWork.alternate === null ? "mount" : "update"; + { + if (isCurrentUpdateNested()) { + phase = "nested-update"; + } + } + if (typeof onPostCommit === "function") { + onPostCommit(id, phase, passiveEffectDuration, commitTime); + } // Bubble times to the next nearest ancestor Profiler. + // After we process that Profiler, we'll bubble further up. + + var parentFiber = finishedWork.return; + outer: while (parentFiber !== null) { + switch (parentFiber.tag) { + case HostRoot: + var root = parentFiber.stateNode; + root.passiveEffectDuration += passiveEffectDuration; + break outer; + case Profiler: + var parentStateNode = parentFiber.stateNode; + parentStateNode.passiveEffectDuration += passiveEffectDuration; + break outer; + } + parentFiber = parentFiber.return; + } + break; + } + } + } + } + } + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork, committedLanes) { + if ((finishedWork.flags & LayoutMask) !== NoFlags) { + switch (finishedWork.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + { + { + // At this point layout effects have already been destroyed (during mutation phase). + // This is done to prevent sibling component effects from interfering with each other, + // e.g. a destroy function in one component should never override a ref set + // by a create function in another component during the same commit. + if (finishedWork.mode & ProfileMode) { + try { + startLayoutEffectTimer(); + commitHookEffectListMount(Layout | HasEffect, finishedWork); + } finally { + recordLayoutEffectDuration(finishedWork); + } + } else { + commitHookEffectListMount(Layout | HasEffect, finishedWork); + } + } + break; + } + case ClassComponent: + { + var instance = finishedWork.stateNode; + if (finishedWork.flags & Update) { + { + if (current === null) { + // We could update instance props and state here, + // but instead we rely on them being set during last render. + // TODO: revisit this when we implement resuming. + { + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + if (instance.props !== finishedWork.memoizedProps) { + error("Expected %s props to match memoized props before " + "componentDidMount. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.props`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + if (instance.state !== finishedWork.memoizedState) { + error("Expected %s state to match memoized state before " + "componentDidMount. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.state`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + } + } + if (finishedWork.mode & ProfileMode) { + try { + startLayoutEffectTimer(); + instance.componentDidMount(); + } finally { + recordLayoutEffectDuration(finishedWork); + } + } else { + instance.componentDidMount(); + } + } else { + var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps); + var prevState = current.memoizedState; // We could update instance props and state here, + // but instead we rely on them being set during last render. + // TODO: revisit this when we implement resuming. + + { + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + if (instance.props !== finishedWork.memoizedProps) { + error("Expected %s props to match memoized props before " + "componentDidUpdate. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.props`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + if (instance.state !== finishedWork.memoizedState) { + error("Expected %s state to match memoized state before " + "componentDidUpdate. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.state`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + } + } + if (finishedWork.mode & ProfileMode) { + try { + startLayoutEffectTimer(); + instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate); + } finally { + recordLayoutEffectDuration(finishedWork); + } + } else { + instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate); + } + } + } + } // TODO: I think this is now always non-null by the time it reaches the + // commit phase. Consider removing the type check. + + var updateQueue = finishedWork.updateQueue; + if (updateQueue !== null) { + { + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + if (instance.props !== finishedWork.memoizedProps) { + error("Expected %s props to match memoized props before " + "processing the update queue. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.props`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + if (instance.state !== finishedWork.memoizedState) { + error("Expected %s state to match memoized state before " + "processing the update queue. " + "This might either be because of a bug in React, or because " + "a component reassigns its own `this.state`. " + "Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); + } + } + } // We could update instance props and state here, + // but instead we rely on them being set during last render. + // TODO: revisit this when we implement resuming. + + commitUpdateQueue(finishedWork, updateQueue, instance); + } + break; + } + case HostRoot: + { + // TODO: I think this is now always non-null by the time it reaches the + // commit phase. Consider removing the type check. + var _updateQueue = finishedWork.updateQueue; + if (_updateQueue !== null) { + var _instance = null; + if (finishedWork.child !== null) { + switch (finishedWork.child.tag) { + case HostComponent: + _instance = getPublicInstance(finishedWork.child.stateNode); + break; + case ClassComponent: + _instance = finishedWork.child.stateNode; + break; + } + } + commitUpdateQueue(finishedWork, _updateQueue, _instance); + } + break; + } + case HostComponent: + { + var _instance2 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted + // (eg DOM renderer may schedule auto-focus for inputs and form controls). + // These effects should only be committed when components are first mounted, + // aka when there is no current/alternate. + + if (current === null && finishedWork.flags & Update) { + var type = finishedWork.type; + var props = finishedWork.memoizedProps; + } + break; + } + case HostText: + { + // We have no life-cycles associated with text. + break; + } + case HostPortal: + { + // We have no life-cycles associated with portals. + break; + } + case Profiler: + { + { + var _finishedWork$memoize2 = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize2.onCommit, + onRender = _finishedWork$memoize2.onRender; + var effectDuration = finishedWork.stateNode.effectDuration; + var commitTime = getCommitTime(); + var phase = current === null ? "mount" : "update"; + { + if (isCurrentUpdateNested()) { + phase = "nested-update"; + } + } + if (typeof onRender === "function") { + onRender(finishedWork.memoizedProps.id, phase, finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime); + } + { + if (typeof onCommit === "function") { + onCommit(finishedWork.memoizedProps.id, phase, effectDuration, commitTime); + } // Schedule a passive effect for this Profiler to call onPostCommit hooks. + // This effect should be scheduled even if there is no onPostCommit callback for this Profiler, + // because the effect is also where times bubble to parent Profilers. + + enqueuePendingPassiveProfilerEffect(finishedWork); // Propagate layout effect durations to the next nearest Profiler ancestor. + // Do not reset these values until the next render so DevTools has a chance to read them first. + + var parentFiber = finishedWork.return; + outer: while (parentFiber !== null) { + switch (parentFiber.tag) { + case HostRoot: + var root = parentFiber.stateNode; + root.effectDuration += effectDuration; + break outer; + case Profiler: + var parentStateNode = parentFiber.stateNode; + parentStateNode.effectDuration += effectDuration; + break outer; + } + parentFiber = parentFiber.return; + } + } + } + break; + } + case SuspenseComponent: + { + break; + } + case SuspenseListComponent: + case IncompleteClassComponent: + case ScopeComponent: + case OffscreenComponent: + case LegacyHiddenComponent: + case TracingMarkerComponent: + { + break; + } + default: + throw new 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 (finishedWork.flags & Ref) { + commitAttachRef(finishedWork); + } + } + } + } + function hideOrUnhideAllChildren(finishedWork, isHidden) { + // Only hide or unhide the top-most host nodes. + var hostSubtreeRoot = null; + { + // We only have the top Fiber that was inserted but we need to recurse down its + // children to find all the terminal nodes. + var node = finishedWork; + while (true) { + if (node.tag === HostComponent) { + if (hostSubtreeRoot === null) { + hostSubtreeRoot = node; + try { + var instance = node.stateNode; + if (isHidden) { + hideInstance(instance); + } else { + unhideInstance(node.stateNode, node.memoizedProps); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } else if (node.tag === HostText) { + if (hostSubtreeRoot === null) { + try { + var _instance3 = node.stateNode; + if (isHidden) { + hideTextInstance(_instance3); + } else { + unhideTextInstance(_instance3, node.memoizedProps); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork) ;else if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } + if (node === finishedWork) { + return; + } + while (node.sibling === null) { + if (node.return === null || node.return === finishedWork) { + return; + } + if (hostSubtreeRoot === node) { + hostSubtreeRoot = null; + } + node = node.return; + } + if (hostSubtreeRoot === node) { + hostSubtreeRoot = null; + } + node.sibling.return = node.return; + node = node.sibling; + } + } + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (ref !== null) { + var instance = finishedWork.stateNode; + var instanceToUse; + switch (finishedWork.tag) { + case HostComponent: + instanceToUse = getPublicInstance(instance); + break; + default: + instanceToUse = instance; + } // Moved outside to ensure DCE works with this flag + + if (typeof ref === "function") { + var retVal; + if (finishedWork.mode & ProfileMode) { + try { + startLayoutEffectTimer(); + retVal = ref(instanceToUse); + } finally { + recordLayoutEffectDuration(finishedWork); + } + } else { + retVal = ref(instanceToUse); + } + { + if (typeof retVal === "function") { + error("Unexpected return value from a callback ref in %s. " + "A callback ref should not return a function.", getComponentNameFromFiber(finishedWork)); + } + } + } else { + { + if (!ref.hasOwnProperty("current")) { + error("Unexpected ref object provided for %s. " + "Use either a ref-setter function or React.createRef().", getComponentNameFromFiber(finishedWork)); + } + } + ref.current = instanceToUse; + } + } + } + function detachFiberMutation(fiber) { + // Cut off the return pointer to disconnect it from the tree. + // This enables us to detect and warn against state updates on an unmounted component. + // It also prevents events from bubbling from within disconnected components. + // + // Ideally, we should also clear the child pointer of the parent alternate to let this + // get GC:ed but we don't know which for sure which parent is the current + // one so we'll settle for GC:ing the subtree of this child. + // This child itself will be GC:ed when the parent updates the next time. + // + // Note that we can't clear child or sibling pointers yet. + // They're needed for passive effects and for findDOMNode. + // We defer those fields, and all other cleanup, to the passive phase (see detachFiberAfterEffects). + // + // Don't reset the alternate yet, either. We need that so we can detach the + // alternate's fields in the passive phase. Clearing the return pointer is + // sufficient for findDOMNode semantics. + var alternate = fiber.alternate; + if (alternate !== null) { + alternate.return = null; + } + fiber.return = null; + } + function detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + if (alternate !== null) { + fiber.alternate = null; + detachFiberAfterEffects(alternate); + } // Note: Defensively using negation instead of < in case + // `deletedTreeCleanUpLevel` is undefined. + + { + // Clear cyclical Fiber fields. This level alone is designed to roughly + // approximate the planned Fiber refactor. In that world, `setState` will be + // bound to a special "instance" object instead of a Fiber. The Instance + // object will not have any of these fields. It will only be connected to + // the fiber tree via a single link at the root. So if this level alone is + // sufficient to fix memory issues, that bodes well for our plans. + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host + // tree, which has its own pointers to children, parents, and siblings. + // The other host nodes also point back to fibers, so we should detach that + // one, too. + + if (fiber.tag === HostComponent) { + var hostInstance = fiber.stateNode; + } + fiber.stateNode = null; // I'm intentionally not clearing the `return` field in this level. We + // already disconnect the `return` pointer at the root of the deleted + // subtree (in `detachFiberMutation`). Besides, `return` by itself is not + // cyclical — it's only cyclical when combined with `child`, `sibling`, and + // `alternate`. But we'll clear it in the next level anyway, just in case. + + { + fiber._debugOwner = null; + } + { + // Theoretically, nothing in here should be necessary, because we already + // disconnected the fiber from the tree. So even if something leaks this + // particular fiber, it won't leak anything else + // + // The purpose of this branch is to be super aggressive so we can measure + // if there's any difference in memory impact. If there is, that could + // indicate a React leak we don't know about. + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead. + + fiber.updateQueue = null; + } + } + } + function getHostParentFiber(fiber) { + var parent = fiber.return; + while (parent !== null) { + if (isHostParent(parent)) { + return parent; + } + parent = parent.return; + } + throw new Error("Expected to find a host parent. This error is likely caused by a bug " + "in React. Please file an issue."); + } + function isHostParent(fiber) { + return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal; + } + function getHostSibling(fiber) { + // We're going to search forward into the tree until we find a sibling host + // node. Unfortunately, if multiple insertions are done in a row we have to + // search past them. This leads to exponential search for the next sibling. + // TODO: Find a more efficient way to do this. + var node = fiber; + siblings: while (true) { + // If we didn't find anything, let's try the next sibling. + while (node.sibling === null) { + if (node.return === null || isHostParent(node.return)) { + // If we pop out of the root or hit the parent the fiber we are the + // last sibling. + return null; + } + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) { + // If it is not host node and, we might have a host node inside it. + // Try to search down until we find one. + if (node.flags & Placement) { + // If we don't have a child, try the siblings instead. + continue siblings; + } // If we don't have a child, try the siblings instead. + // We also skip portals because they are not part of this host tree. + + if (node.child === null || node.tag === HostPortal) { + continue siblings; + } else { + node.child.return = node; + node = node.child; + } + } // Check if this host node is stable or about to be placed. + + if (!(node.flags & Placement)) { + // Found it! + return node.stateNode; + } + } + } + function commitPlacement(finishedWork) { + var parentFiber = getHostParentFiber(finishedWork); // Note: these two variables *must* always be updated together. + + switch (parentFiber.tag) { + case HostComponent: + { + var parent = parentFiber.stateNode; + if (parentFiber.flags & ContentReset) { + parentFiber.flags &= ~ContentReset; + } + var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its + // children to find all the terminal nodes. + + insertOrAppendPlacementNode(finishedWork, before, parent); + break; + } + case HostRoot: + case HostPortal: + { + var _parent = parentFiber.stateNode.containerInfo; + var _before = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer(finishedWork, _before, _parent); + break; + } + // eslint-disable-next-line-no-fallthrough + + default: + throw new Error("Invalid host parent fiber. This error is likely caused by a bug " + "in React. Please file an issue."); + } + } + function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + var isHost = tag === HostComponent || tag === HostText; + if (isHost) { + var stateNode = node.stateNode; + if (before) { + insertInContainerBefore(parent); + } else { + appendChildToContainer(parent, stateNode); + } + } else if (tag === HostPortal) ;else { + var child = node.child; + if (child !== null) { + insertOrAppendPlacementNodeIntoContainer(child, before, parent); + var sibling = child.sibling; + while (sibling !== null) { + insertOrAppendPlacementNodeIntoContainer(sibling, before, parent); + sibling = sibling.sibling; + } + } + } + } + function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + var isHost = tag === HostComponent || tag === HostText; + if (isHost) { + var stateNode = node.stateNode; + if (before) { + insertBefore(parent, stateNode, before); + } else { + appendChild(parent, stateNode); + } + } else if (tag === HostPortal) ;else { + var child = node.child; + if (child !== null) { + insertOrAppendPlacementNode(child, before, parent); + var sibling = child.sibling; + while (sibling !== null) { + insertOrAppendPlacementNode(sibling, before, parent); + sibling = sibling.sibling; + } + } + } + } // These are tracked on the stack as we recursively traverse a + // deleted subtree. + // TODO: Update these during the whole mutation phase, not just during + // a deletion. + + var hostParent = null; + var hostParentIsContainer = false; + function commitDeletionEffects(root, returnFiber, deletedFiber) { + { + // We only have the top Fiber that was deleted but we need to recurse down its + // children to find all the terminal nodes. + // Recursively delete all host nodes from the parent, detach refs, clean + // up mounted layout effects, and call componentWillUnmount. + // We only need to remove the topmost host child in each branch. But then we + // still need to keep traversing to unmount effects, refs, and cWU. TODO: We + // could split this into two separate traversals functions, where the second + // one doesn't include any removeChild logic. This is maybe the same + // function as "disappearLayoutEffects" (or whatever that turns into after + // the layout phase is refactored to use recursion). + // Before starting, find the nearest host parent on the stack so we know + // which instance/container to remove the children from. + // TODO: Instead of searching up the fiber return path on every deletion, we + // can track the nearest host component on the JS stack as we traverse the + // tree during the commit phase. This would make insertions faster, too. + var parent = returnFiber; + findParent: while (parent !== null) { + switch (parent.tag) { + case HostComponent: + { + hostParent = parent.stateNode; + hostParentIsContainer = false; + break findParent; + } + case HostRoot: + { + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = true; + break findParent; + } + case HostPortal: + { + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = true; + break findParent; + } + } + parent = parent.return; + } + if (hostParent === null) { + throw new Error("Expected to find a host parent. This error is likely caused by " + "a bug in React. Please file an issue."); + } + commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); + hostParent = null; + hostParentIsContainer = false; + } + detachFiberMutation(deletedFiber); + } + function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) { + // TODO: Use a static flag to skip trees that don't have unmount effects + var child = parent.child; + while (child !== null) { + commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, child); + child = child.sibling; + } + } + function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) { + onCommitUnmount(deletedFiber); // The cases in this outer switch modify the stack before they traverse + // into their subtree. There are simpler cases in the inner switch + // that don't modify the stack. + + switch (deletedFiber.tag) { + case HostComponent: + { + { + safelyDetachRef(deletedFiber, nearestMountedAncestor); + } // Intentional fallthrough to next branch + } + // eslint-disable-next-line-no-fallthrough + + case HostText: + { + // We only need to remove the nearest host child. Set the host parent + // to `null` on the stack to indicate that nested children don't + // need to be removed. + { + var prevHostParent = hostParent; + var prevHostParentIsContainer = hostParentIsContainer; + hostParent = null; + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + hostParent = prevHostParent; + hostParentIsContainer = prevHostParentIsContainer; + if (hostParent !== null) { + // Now that all the child effects have unmounted, we can remove the + // node from the tree. + if (hostParentIsContainer) { + removeChildFromContainer(hostParent, deletedFiber.stateNode); + } else { + removeChild(hostParent, deletedFiber.stateNode); + } + } + } + return; + } + case DehydratedFragment: + { + // Delete the dehydrated suspense boundary and all of its content. + + { + if (hostParent !== null) { + if (hostParentIsContainer) { + clearSuspenseBoundaryFromContainer(hostParent, deletedFiber.stateNode); + } else { + clearSuspenseBoundary(hostParent, deletedFiber.stateNode); + } + } + } + return; + } + case HostPortal: + { + { + // When we go into a portal, it becomes the parent to remove from. + var _prevHostParent = hostParent; + var _prevHostParentIsContainer = hostParentIsContainer; + hostParent = deletedFiber.stateNode.containerInfo; + hostParentIsContainer = true; + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + hostParent = _prevHostParent; + hostParentIsContainer = _prevHostParentIsContainer; + } + return; + } + case FunctionComponent: + case ForwardRef: + case MemoComponent: + case SimpleMemoComponent: + { + { + var updateQueue = deletedFiber.updateQueue; + if (updateQueue !== null) { + var lastEffect = updateQueue.lastEffect; + if (lastEffect !== null) { + var firstEffect = lastEffect.next; + var effect = firstEffect; + do { + var _effect = effect, + destroy = _effect.destroy, + tag = _effect.tag; + if (destroy !== undefined) { + if ((tag & Insertion) !== NoFlags$1) { + safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy); + } else if ((tag & Layout) !== NoFlags$1) { + if (deletedFiber.mode & ProfileMode) { + startLayoutEffectTimer(); + safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy); + recordLayoutEffectDuration(deletedFiber); + } else { + safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy); + } + } + } + effect = effect.next; + } while (effect !== firstEffect); + } + } + } + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + return; + } + case ClassComponent: + { + { + safelyDetachRef(deletedFiber, nearestMountedAncestor); + var instance = deletedFiber.stateNode; + if (typeof instance.componentWillUnmount === "function") { + safelyCallComponentWillUnmount(deletedFiber, nearestMountedAncestor, instance); + } + } + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + return; + } + case ScopeComponent: + { + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + return; + } + case OffscreenComponent: + { + { + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + } + break; + } + default: + { + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + return; + } + } + } + function commitSuspenseCallback(finishedWork) { + // TODO: Move this to passive phase + var newState = finishedWork.memoizedState; + } + function attachSuspenseRetryListeners(finishedWork) { + // If this boundary just timed out, then it will have a set of wakeables. + // For each wakeable, attach a listener so that when it resolves, React + // attempts to re-render the boundary in the primary (pre-timeout) state. + var wakeables = finishedWork.updateQueue; + if (wakeables !== null) { + finishedWork.updateQueue = null; + var retryCache = finishedWork.stateNode; + if (retryCache === null) { + retryCache = finishedWork.stateNode = new PossiblyWeakSet(); + } + wakeables.forEach(function (wakeable) { + // Memoize using the boundary fiber to prevent redundant listeners. + var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); + if (!retryCache.has(wakeable)) { + retryCache.add(wakeable); + { + if (isDevToolsPresent) { + if (inProgressLanes !== null && inProgressRoot !== null) { + // If we have pending work still, associate the original updaters with it. + restorePendingUpdaters(inProgressRoot, inProgressLanes); + } else { + throw Error("Expected finished root and lanes to be set. This is a bug in React."); + } + } + } + wakeable.then(retry, retry); + } + }); + } + } // This function detects when a Suspense boundary goes from visible to hidden. + function commitMutationEffects(root, finishedWork, committedLanes) { + inProgressLanes = committedLanes; + inProgressRoot = root; + setCurrentFiber(finishedWork); + commitMutationEffectsOnFiber(finishedWork, root); + setCurrentFiber(finishedWork); + inProgressLanes = null; + inProgressRoot = null; + } + function recursivelyTraverseMutationEffects(root, parentFiber, lanes) { + // Deletions effects can be scheduled on any fiber type. They need to happen + // before the children effects hae fired. + var deletions = parentFiber.deletions; + if (deletions !== null) { + for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i]; + try { + commitDeletionEffects(root, parentFiber, childToDelete); + } catch (error) { + captureCommitPhaseError(childToDelete, parentFiber, error); + } + } + } + var prevDebugFiber = getCurrentFiber(); + if (parentFiber.subtreeFlags & MutationMask) { + var child = parentFiber.child; + while (child !== null) { + setCurrentFiber(child); + commitMutationEffectsOnFiber(child, root); + child = child.sibling; + } + } + setCurrentFiber(prevDebugFiber); + } + function commitMutationEffectsOnFiber(finishedWork, root, lanes) { + var current = finishedWork.alternate; + var flags = finishedWork.flags; // The effect flag should be checked *after* we refine the type of fiber, + // because the fiber tag is more specific. An exception is any flag related + // to reconcilation, because those can be set on all fiber types. + + switch (finishedWork.tag) { + case FunctionComponent: + case ForwardRef: + case MemoComponent: + case SimpleMemoComponent: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & Update) { + try { + commitHookEffectListUnmount(Insertion | HasEffect, finishedWork, finishedWork.return); + commitHookEffectListMount(Insertion | HasEffect, finishedWork); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } // Layout effects are destroyed during the mutation phase so that all + // destroy functions for all fibers are called before any create functions. + // This prevents sibling component effects from interfering with each other, + // e.g. a destroy function in one component should never override a ref set + // by a create function in another component during the same commit. + + if (finishedWork.mode & ProfileMode) { + try { + startLayoutEffectTimer(); + commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + recordLayoutEffectDuration(finishedWork); + } else { + try { + commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + return; + } + case ClassComponent: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & Ref) { + if (current !== null) { + safelyDetachRef(current, current.return); + } + } + return; + } + case HostComponent: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & Ref) { + if (current !== null) { + safelyDetachRef(current, current.return); + } + } + { + // TODO: ContentReset gets cleared by the children during the commit + // phase. This is a refactor hazard because it means we must read + // flags the flags after `commitReconciliationEffects` has already run; + // the order matters. We should refactor so that ContentReset does not + // rely on mutating the flag during commit. Like by setting a flag + // during the render phase instead. + if (finishedWork.flags & ContentReset) { + var instance = finishedWork.stateNode; + try { + resetTextContent(instance); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + if (flags & Update) { + var _instance4 = finishedWork.stateNode; + if (_instance4 != null) { + // Commit the work prepared earlier. + var newProps = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps + // as the newProps. The updatePayload will contain the real change in + // this case. + + var oldProps = current !== null ? current.memoizedProps : newProps; + var type = finishedWork.type; // TODO: Type the updateQueue to be specific to host components. + + var updatePayload = finishedWork.updateQueue; + finishedWork.updateQueue = null; + if (updatePayload !== null) { + try { + commitUpdate(_instance4, updatePayload, type, oldProps, newProps, finishedWork); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + } + } + return; + } + case HostText: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & Update) { + { + if (finishedWork.stateNode === null) { + throw new Error("This should have a text node initialized. This error is likely " + "caused by a bug in React. Please file an issue."); + } + var textInstance = finishedWork.stateNode; + var newText = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps + // as the newProps. The updatePayload will contain the real change in + // this case. + + var oldText = current !== null ? current.memoizedProps : newText; + try { + commitTextUpdate(textInstance, oldText, newText); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + return; + } + case HostRoot: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + return; + } + case HostPortal: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + return; + } + case SuspenseComponent: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + var offscreenFiber = finishedWork.child; + if (offscreenFiber.flags & Visibility) { + var offscreenInstance = offscreenFiber.stateNode; + var newState = offscreenFiber.memoizedState; + var isHidden = newState !== null; // Track the current state on the Offscreen instance so we can + // read it during an event + + offscreenInstance.isHidden = isHidden; + if (isHidden) { + var wasHidden = offscreenFiber.alternate !== null && offscreenFiber.alternate.memoizedState !== null; + if (!wasHidden) { + // TODO: Move to passive phase + markCommitTimeOfFallback(); + } + } + } + if (flags & Update) { + try { + commitSuspenseCallback(finishedWork); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + attachSuspenseRetryListeners(finishedWork); + } + return; + } + case OffscreenComponent: + { + var _wasHidden = current !== null && current.memoizedState !== null; + { + recursivelyTraverseMutationEffects(root, finishedWork); + } + commitReconciliationEffects(finishedWork); + if (flags & Visibility) { + var _offscreenInstance = finishedWork.stateNode; + var _newState = finishedWork.memoizedState; + var _isHidden = _newState !== null; + var offscreenBoundary = finishedWork; // Track the current state on the Offscreen instance so we can + // read it during an event + + _offscreenInstance.isHidden = _isHidden; + { + // TODO: This needs to run whenever there's an insertion or update + // inside a hidden Offscreen tree. + hideOrUnhideAllChildren(offscreenBoundary, _isHidden); + } + } + return; + } + case SuspenseListComponent: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & Update) { + attachSuspenseRetryListeners(finishedWork); + } + return; + } + case ScopeComponent: + { + return; + } + default: + { + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + return; + } + } + } + function commitReconciliationEffects(finishedWork) { + // Placement effects (insertions, reorders) can be scheduled on any fiber + // type. They needs to happen after the children effects have fired, but + // before the effects on this fiber have fired. + var flags = finishedWork.flags; + if (flags & Placement) { + try { + commitPlacement(finishedWork); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } // Clear the "placement" from effect tag so that we know that this is + // inserted, before any life-cycles like componentDidMount gets called. + // TODO: findDOMNode doesn't rely on this any more but isMounted does + // and isMounted is deprecated anyway so we should be able to kill this. + + finishedWork.flags &= ~Placement; + } + if (flags & Hydrating) { + finishedWork.flags &= ~Hydrating; + } + } + function commitLayoutEffects(finishedWork, root, committedLanes) { + inProgressLanes = committedLanes; + inProgressRoot = root; + nextEffect = finishedWork; + commitLayoutEffects_begin(finishedWork, root, committedLanes); + inProgressLanes = null; + inProgressRoot = null; + } + function commitLayoutEffects_begin(subtreeRoot, root, committedLanes) { + // Suspense layout effects semantics don't change for legacy roots. + var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode; + while (nextEffect !== null) { + var fiber = nextEffect; + var firstChild = fiber.child; + if ((fiber.subtreeFlags & LayoutMask) !== NoFlags && firstChild !== null) { + firstChild.return = fiber; + nextEffect = firstChild; + } else { + commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes); + } + } + } + function commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes) { + while (nextEffect !== null) { + var fiber = nextEffect; + if ((fiber.flags & LayoutMask) !== NoFlags) { + var current = fiber.alternate; + setCurrentFiber(fiber); + try { + commitLayoutEffectOnFiber(root, current, fiber, committedLanes); + } catch (error) { + captureCommitPhaseError(fiber, fiber.return, error); + } + resetCurrentFiber(); + } + if (fiber === subtreeRoot) { + nextEffect = null; + return; + } + var sibling = fiber.sibling; + if (sibling !== null) { + sibling.return = fiber.return; + nextEffect = sibling; + return; + } + nextEffect = fiber.return; + } + } + function commitPassiveMountEffects(root, finishedWork, committedLanes, committedTransitions) { + nextEffect = finishedWork; + commitPassiveMountEffects_begin(finishedWork, root, committedLanes, committedTransitions); + } + function commitPassiveMountEffects_begin(subtreeRoot, root, committedLanes, committedTransitions) { + while (nextEffect !== null) { + var fiber = nextEffect; + var firstChild = fiber.child; + if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && firstChild !== null) { + firstChild.return = fiber; + nextEffect = firstChild; + } else { + commitPassiveMountEffects_complete(subtreeRoot, root, committedLanes, committedTransitions); + } + } + } + function commitPassiveMountEffects_complete(subtreeRoot, root, committedLanes, committedTransitions) { + while (nextEffect !== null) { + var fiber = nextEffect; + if ((fiber.flags & Passive) !== NoFlags) { + setCurrentFiber(fiber); + try { + commitPassiveMountOnFiber(root, fiber, committedLanes, committedTransitions); + } catch (error) { + captureCommitPhaseError(fiber, fiber.return, error); + } + resetCurrentFiber(); + } + if (fiber === subtreeRoot) { + nextEffect = null; + return; + } + var sibling = fiber.sibling; + if (sibling !== null) { + sibling.return = fiber.return; + nextEffect = sibling; + return; + } + nextEffect = fiber.return; + } + } + function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) { + switch (finishedWork.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + { + if (finishedWork.mode & ProfileMode) { + startPassiveEffectTimer(); + try { + commitHookEffectListMount(Passive$1 | HasEffect, finishedWork); + } finally { + recordPassiveEffectDuration(finishedWork); + } + } else { + commitHookEffectListMount(Passive$1 | HasEffect, finishedWork); + } + break; + } + } + } + function commitPassiveUnmountEffects(firstChild) { + nextEffect = firstChild; + commitPassiveUnmountEffects_begin(); + } + function commitPassiveUnmountEffects_begin() { + while (nextEffect !== null) { + var fiber = nextEffect; + var child = fiber.child; + if ((nextEffect.flags & ChildDeletion) !== NoFlags) { + var deletions = fiber.deletions; + if (deletions !== null) { + for (var i = 0; i < deletions.length; i++) { + var fiberToDelete = deletions[i]; + nextEffect = fiberToDelete; + commitPassiveUnmountEffectsInsideOfDeletedTree_begin(fiberToDelete, fiber); + } + { + // A fiber was deleted from this parent fiber, but it's still part of + // the previous (alternate) parent fiber's list of children. Because + // children are a linked list, an earlier sibling that's still alive + // will be connected to the deleted fiber via its `alternate`: + // + // live fiber + // --alternate--> previous live fiber + // --sibling--> deleted fiber + // + // We can't disconnect `alternate` on nodes that haven't been deleted + // yet, but we can disconnect the `sibling` and `child` pointers. + var previousFiber = fiber.alternate; + if (previousFiber !== null) { + var detachedChild = previousFiber.child; + if (detachedChild !== null) { + previousFiber.child = null; + do { + var detachedSibling = detachedChild.sibling; + detachedChild.sibling = null; + detachedChild = detachedSibling; + } while (detachedChild !== null); + } + } + } + nextEffect = fiber; + } + } + if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) { + child.return = fiber; + nextEffect = child; + } else { + commitPassiveUnmountEffects_complete(); + } + } + } + function commitPassiveUnmountEffects_complete() { + while (nextEffect !== null) { + var fiber = nextEffect; + if ((fiber.flags & Passive) !== NoFlags) { + setCurrentFiber(fiber); + commitPassiveUnmountOnFiber(fiber); + resetCurrentFiber(); + } + var sibling = fiber.sibling; + if (sibling !== null) { + sibling.return = fiber.return; + nextEffect = sibling; + return; + } + nextEffect = fiber.return; + } + } + function commitPassiveUnmountOnFiber(finishedWork) { + switch (finishedWork.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + { + if (finishedWork.mode & ProfileMode) { + startPassiveEffectTimer(); + commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return); + recordPassiveEffectDuration(finishedWork); + } else { + commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return); + } + break; + } + } + } + function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) { + while (nextEffect !== null) { + var fiber = nextEffect; // Deletion effects fire in parent -> child order + // TODO: Check if fiber has a PassiveStatic flag + + setCurrentFiber(fiber); + commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor); + resetCurrentFiber(); + var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag. (But, if we + // do this, still need to handle `deletedTreeCleanUpLevel` correctly.) + + if (child !== null) { + child.return = fiber; + nextEffect = child; + } else { + commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot); + } + } + } + function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot) { + while (nextEffect !== null) { + var fiber = nextEffect; + var sibling = fiber.sibling; + var returnFiber = fiber.return; + { + // Recursively traverse the entire deleted tree and clean up fiber fields. + // This is more aggressive than ideal, and the long term goal is to only + // have to detach the deleted tree at the root. + detachFiberAfterEffects(fiber); + if (fiber === deletedSubtreeRoot) { + nextEffect = null; + return; + } + } + if (sibling !== null) { + sibling.return = returnFiber; + nextEffect = sibling; + return; + } + nextEffect = returnFiber; + } + } + function commitPassiveUnmountInsideDeletedTreeOnFiber(current, nearestMountedAncestor) { + switch (current.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + { + if (current.mode & ProfileMode) { + startPassiveEffectTimer(); + commitHookEffectListUnmount(Passive$1, current, nearestMountedAncestor); + recordPassiveEffectDuration(current); + } else { + commitHookEffectListUnmount(Passive$1, current, nearestMountedAncestor); + } + break; + } + } + } // TODO: Reuse reappearLayoutEffects traversal here? + + var COMPONENT_TYPE = 0; + var HAS_PSEUDO_CLASS_TYPE = 1; + var ROLE_TYPE = 2; + var TEST_NAME_TYPE = 3; + var TEXT_TYPE = 4; + if (typeof Symbol === "function" && Symbol.for) { + var symbolFor = Symbol.for; + COMPONENT_TYPE = symbolFor("selector.component"); + HAS_PSEUDO_CLASS_TYPE = symbolFor("selector.has_pseudo_class"); + ROLE_TYPE = symbolFor("selector.role"); + TEST_NAME_TYPE = symbolFor("selector.test_id"); + TEXT_TYPE = symbolFor("selector.text"); + } + var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue; + function isLegacyActEnvironment(fiber) { + { + // Legacy mode. We preserve the behavior of React 17's act. It assumes an + // act environment whenever `jest` is defined, but you can still turn off + // spurious warnings by setting IS_REACT_ACT_ENVIRONMENT explicitly + // to false. + var isReactActEnvironmentGlobal = + // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global + typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : undefined; // $FlowExpectedError - Flow doesn't know about jest + + var jestIsDefined = typeof jest !== "undefined"; + return jestIsDefined && isReactActEnvironmentGlobal !== false; + } + } + function isConcurrentActEnvironment() { + { + var isReactActEnvironmentGlobal = + // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global + typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : undefined; + if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) { + // TODO: Include link to relevant documentation page. + error("The current testing environment is not configured to support " + "act(...)"); + } + return isReactActEnvironmentGlobal; + } + } + var ceil = Math.ceil; + var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, + ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, + ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig, + ReactCurrentActQueue$1 = ReactSharedInternals.ReactCurrentActQueue; + var NoContext = /* */ + 0; + var BatchedContext = /* */ + 1; + var RenderContext = /* */ + 2; + var CommitContext = /* */ + 4; + var RootInProgress = 0; + var RootFatalErrored = 1; + var RootErrored = 2; + var RootSuspended = 3; + var RootSuspendedWithDelay = 4; + var RootCompleted = 5; + var RootDidNotComplete = 6; // Describes where we are in the React execution stack + + var executionContext = NoContext; // The root we're working on + + var workInProgressRoot = null; // The fiber we're working on + + var workInProgress = null; // The lanes we're rendering + + var workInProgressRootRenderLanes = NoLanes; // Stack that allows components to change the render lanes for its subtree + // This is a superset of the lanes we started working on at the root. The only + // case where it's different from `workInProgressRootRenderLanes` is when we + // enter a subtree that is hidden and needs to be unhidden: Suspense and + // Offscreen component. + // + // Most things in the work loop should deal with workInProgressRootRenderLanes. + // Most things in begin/complete phases should deal with subtreeRenderLanes. + + var subtreeRenderLanes = NoLanes; + var subtreeRenderLanesCursor = createCursor(NoLanes); // Whether to root completed, errored, suspended, etc. + + var workInProgressRootExitStatus = RootInProgress; // A fatal error, if one is thrown + + var workInProgressRootFatalError = null; // "Included" lanes refer to lanes that were worked on during this render. It's + // slightly different than `renderLanes` because `renderLanes` can change as you + // enter and exit an Offscreen tree. This value is the combination of all render + // lanes for the entire render phase. + + var workInProgressRootIncludedLanes = NoLanes; // The work left over by components that were visited during this render. Only + // includes unprocessed updates, not work in bailed out children. + + var workInProgressRootSkippedLanes = NoLanes; // Lanes that were updated (in an interleaved event) during this render. + + var workInProgressRootInterleavedUpdatedLanes = NoLanes; // Lanes that were updated during the render phase (*not* an interleaved event). + + var workInProgressRootPingedLanes = NoLanes; // Errors that are thrown during the render phase. + + var workInProgressRootConcurrentErrors = null; // These are errors that we recovered from without surfacing them to the UI. + // We will log them once the tree commits. + + var workInProgressRootRecoverableErrors = null; // The most recent time we committed a fallback. This lets us ensure a train + // model where we don't commit new loading states in too quick succession. + + var globalMostRecentFallbackTime = 0; + var FALLBACK_THROTTLE_MS = 500; // The absolute time for when we should start giving up on rendering + // more and prefer CPU suspense heuristics instead. + + var workInProgressRootRenderTargetTime = Infinity; // How long a render is supposed to take before we start following CPU + // suspense heuristics and opt out of rendering more content. + + var RENDER_TIMEOUT_MS = 500; + var workInProgressTransitions = null; + function resetRenderTimer() { + workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS; + } + function getRenderTargetTime() { + return workInProgressRootRenderTargetTime; + } + var hasUncaughtError = false; + var firstUncaughtError = null; + var legacyErrorBoundariesThatAlreadyFailed = null; // Only used when enableProfilerNestedUpdateScheduledHook is true; + var rootDoesHavePassiveEffects = false; + var rootWithPendingPassiveEffects = null; + var pendingPassiveEffectsLanes = NoLanes; + var pendingPassiveProfilerEffects = []; + var pendingPassiveTransitions = null; // Use these to prevent an infinite loop of nested updates + + var NESTED_UPDATE_LIMIT = 50; + var nestedUpdateCount = 0; + var rootWithNestedUpdates = null; + var isFlushingPassiveEffects = false; + var didScheduleUpdateDuringPassiveEffects = false; + var NESTED_PASSIVE_UPDATE_LIMIT = 50; + var nestedPassiveUpdateCount = 0; + var rootWithPassiveNestedUpdates = null; // If two updates are scheduled within the same event, we should treat their + // event times as simultaneous, even if the actual clock time has advanced + // between the first and second call. + + var currentEventTime = NoTimestamp; + var currentEventTransitionLane = NoLanes; + var isRunningInsertionEffect = false; + function getWorkInProgressRoot() { + return workInProgressRoot; + } + function requestEventTime() { + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { + // We're inside React, so it's fine to read the actual time. + return now(); + } // We're not inside React, so we may be in the middle of a browser event. + + if (currentEventTime !== NoTimestamp) { + // Use the same start time for all updates until we enter React again. + return currentEventTime; + } // This is the first update since React yielded. Compute a new start time. + + currentEventTime = now(); + return currentEventTime; + } + function requestUpdateLane(fiber) { + // Special cases + var mode = fiber.mode; + if ((mode & ConcurrentMode) === NoMode) { + return SyncLane; + } else if ((executionContext & RenderContext) !== NoContext && workInProgressRootRenderLanes !== NoLanes) { + // This is a render phase update. These are not officially supported. The + // old behavior is to give this the same "thread" (lanes) as + // whatever is currently rendering. So if you call `setState` on a component + // that happens later in the same render, it will flush. Ideally, we want to + // remove the special case and treat them as if they came from an + // interleaved event. Regardless, this pattern is not officially supported. + // This behavior is only a fallback. The flag only exists until we can roll + // out the setState warning, since existing code might accidentally rely on + // the current behavior. + return pickArbitraryLane(workInProgressRootRenderLanes); + } + var isTransition = requestCurrentTransition() !== NoTransition; + if (isTransition) { + if (ReactCurrentBatchConfig$2.transition !== null) { + var transition = ReactCurrentBatchConfig$2.transition; + if (!transition._updatedFibers) { + transition._updatedFibers = new Set(); + } + transition._updatedFibers.add(fiber); + } // The algorithm for assigning an update to a lane should be stable for all + // updates at the same priority within the same event. To do this, the + // inputs to the algorithm must be the same. + // + // The trick we use is to cache the first of each of these inputs within an + // event. Then reset the cached values once we can be sure the event is + // over. Our heuristic for that is whenever we enter a concurrent work loop. + + if (currentEventTransitionLane === NoLane) { + // All transitions within the same event are assigned the same lane. + currentEventTransitionLane = claimNextTransitionLane(); + } + return currentEventTransitionLane; + } // Updates originating inside certain React methods, like flushSync, have + // their priority set by tracking it with a context variable. + // + // The opaque type returned by the host config is internally a lane, so we can + // use that directly. + // TODO: Move this type conversion to the event priority module. + + var updateLane = getCurrentUpdatePriority(); + if (updateLane !== NoLane) { + return updateLane; + } // This update originated outside React. Ask the host environment for an + // appropriate priority, based on the type of event. + // + // The opaque type returned by the host config is internally a lane, so we can + // use that directly. + // TODO: Move this type conversion to the event priority module. + + var eventLane = getCurrentEventPriority(); + return eventLane; + } + function requestRetryLane(fiber) { + // This is a fork of `requestUpdateLane` designed specifically for Suspense + // "retries" — a special update that attempts to flip a Suspense boundary + // from its placeholder state to its primary/resolved state. + // Special cases + var mode = fiber.mode; + if ((mode & ConcurrentMode) === NoMode) { + return SyncLane; + } + return claimNextRetryLane(); + } + function scheduleUpdateOnFiber(root, fiber, lane, eventTime) { + checkForNestedUpdates(); + { + if (isRunningInsertionEffect) { + error("useInsertionEffect must not schedule updates."); + } + } + { + if (isFlushingPassiveEffects) { + didScheduleUpdateDuringPassiveEffects = true; + } + } // Mark that the root has a pending update. + + markRootUpdated(root, lane, eventTime); + if ((executionContext & RenderContext) !== NoLanes && root === workInProgressRoot) { + // This update was dispatched during the render phase. This is a mistake + // if the update originates from user space (with the exception of local + // hook updates, which are handled differently and don't reach this + // function), but there are some internal React features that use this as + // an implementation detail, like selective hydration. + warnAboutRenderPhaseUpdatesInDEV(fiber); // Track lanes that were updated during the render phase + } else { + // This is a normal update, scheduled from outside the render phase. For + // example, during an input event. + { + if (isDevToolsPresent) { + addFiberToLanesMap(root, fiber, lane); + } + } + warnIfUpdatesNotWrappedWithActDEV(fiber); + if (root === workInProgressRoot) { + // Received an update to a tree that's in the middle of rendering. Mark + // that there was an interleaved update work on this root. Unless the + // `deferRenderPhaseUpdateToNextBatch` flag is off and this is a render + // phase update. In that case, we don't treat render phase updates as if + // they were interleaved, for backwards compat reasons. + if ((executionContext & RenderContext) === NoContext) { + workInProgressRootInterleavedUpdatedLanes = mergeLanes(workInProgressRootInterleavedUpdatedLanes, lane); + } + if (workInProgressRootExitStatus === RootSuspendedWithDelay) { + // The root already suspended with a delay, which means this render + // definitely won't finish. Since we have a new update, let's mark it as + // suspended now, right before marking the incoming update. This has the + // effect of interrupting the current render and switching to the update. + // TODO: Make sure this doesn't override pings that happen while we've + // already started rendering. + markRootSuspended$1(root, workInProgressRootRenderLanes); + } + } + ensureRootIsScheduled(root, eventTime); + if (lane === SyncLane && executionContext === NoContext && (fiber.mode & ConcurrentMode) === NoMode && + // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode. + !ReactCurrentActQueue$1.isBatchingLegacy) { + // Flush the synchronous work now, unless we're already working or inside + // a batch. This is intentionally inside scheduleUpdateOnFiber instead of + // scheduleCallbackForFiber to preserve the ability to schedule a callback + // without immediately flushing it. We only do this for user-initiated + // updates, to preserve historical behavior of legacy mode. + resetRenderTimer(); + flushSyncCallbacksOnlyInLegacyMode(); + } + } + } + function isUnsafeClassRenderPhaseUpdate(fiber) { + // Check if this is a render phase update. Only called by class components, + // which special (deprecated) behavior for UNSAFE_componentWillReceive props. + return ( + // TODO: Remove outdated deferRenderPhaseUpdateToNextBatch experiment. We + // decided not to enable it. + (executionContext & RenderContext) !== NoContext + ); + } // Use this function to schedule a task for a root. There's only one task per + // root; if a task was already scheduled, we'll check to make sure the priority + // of the existing task is the same as the priority of the next level that the + // root has work on. This function is called on every update, and right before + // exiting a task. + + function ensureRootIsScheduled(root, currentTime) { + var existingCallbackNode = root.callbackNode; // Check if any lanes are being starved by other work. If so, mark them as + // expired so we know to work on those next. + + markStarvedLanesAsExpired(root, currentTime); // Determine the next lanes to work on, and their priority. + + var nextLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes); + if (nextLanes === NoLanes) { + // Special case: There's nothing to work on. + if (existingCallbackNode !== null) { + cancelCallback$1(existingCallbackNode); + } + root.callbackNode = null; + root.callbackPriority = NoLane; + return; + } // We use the highest priority lane to represent the priority of the callback. + + var newCallbackPriority = getHighestPriorityLane(nextLanes); // Check if there's an existing task. We may be able to reuse it. + + var existingCallbackPriority = root.callbackPriority; + if (existingCallbackPriority === newCallbackPriority && + // Special case related to `act`. If the currently scheduled task is a + // Scheduler task, rather than an `act` task, cancel it and re-scheduled + // on the `act` queue. + !(ReactCurrentActQueue$1.current !== null && existingCallbackNode !== fakeActCallbackNode)) { + { + // If we're going to re-use an existing task, it needs to exist. + // Assume that discrete update microtasks are non-cancellable and null. + // TODO: Temporary until we confirm this warning is not fired. + if (existingCallbackNode == null && existingCallbackPriority !== SyncLane) { + error("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue."); + } + } // The priority hasn't changed. We can reuse the existing task. Exit. + + return; + } + if (existingCallbackNode != null) { + // Cancel the existing callback. We'll schedule a new one below. + cancelCallback$1(existingCallbackNode); + } // Schedule a new callback. + + var newCallbackNode; + if (newCallbackPriority === SyncLane) { + // Special case: Sync React callbacks are scheduled on a special + // internal queue + if (root.tag === LegacyRoot) { + if (ReactCurrentActQueue$1.isBatchingLegacy !== null) { + ReactCurrentActQueue$1.didScheduleLegacyUpdate = true; + } + scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root)); + } else { + scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root)); + } + { + // Flush the queue in an Immediate task. + scheduleCallback$1(ImmediatePriority, flushSyncCallbacks); + } + newCallbackNode = null; + } else { + var schedulerPriorityLevel; + switch (lanesToEventPriority(nextLanes)) { + case DiscreteEventPriority: + schedulerPriorityLevel = ImmediatePriority; + break; + case ContinuousEventPriority: + schedulerPriorityLevel = UserBlockingPriority; + break; + case DefaultEventPriority: + schedulerPriorityLevel = NormalPriority; + break; + case IdleEventPriority: + schedulerPriorityLevel = IdlePriority; + break; + default: + schedulerPriorityLevel = NormalPriority; + break; + } + newCallbackNode = scheduleCallback$1(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root)); + } + root.callbackPriority = newCallbackPriority; + root.callbackNode = newCallbackNode; + } // This is the entry point for every concurrent task, i.e. anything that + // goes through Scheduler. + + function performConcurrentWorkOnRoot(root, didTimeout) { + { + resetNestedUpdateFlag(); + } // Since we know we're in a React event, we can clear the current + // event time. The next update will compute a new event time. + + currentEventTime = NoTimestamp; + currentEventTransitionLane = NoLanes; + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { + throw new Error("Should not already be working."); + } // Flush any pending passive effects before deciding which lanes to work on, + // in case they schedule additional work. + + var originalCallbackNode = root.callbackNode; + var didFlushPassiveEffects = flushPassiveEffects(); + if (didFlushPassiveEffects) { + // Something in the passive effect phase may have canceled the current task. + // Check if the task node for this root was changed. + if (root.callbackNode !== originalCallbackNode) { + // The current task was canceled. Exit. We don't need to call + // `ensureRootIsScheduled` because the check above implies either that + // there's a new task, or that there's no remaining work on this root. + return null; + } + } // Determine the next lanes to work on, using the fields stored + // on the root. + + var lanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes); + if (lanes === NoLanes) { + // Defensive coding. This is never expected to happen. + return null; + } // We disable time-slicing in some cases: if the work has been CPU-bound + // for too long ("expired" work, to prevent starvation), or we're in + // sync-updates-by-default mode. + // TODO: We only check `didTimeout` defensively, to account for a Scheduler + // bug we're still investigating. Once the bug in Scheduler is fixed, + // we can remove this, since we track expiration ourselves. + + var shouldTimeSlice = !includesBlockingLane(root, lanes) && !includesExpiredLane(root, lanes) && !didTimeout; + var exitStatus = shouldTimeSlice ? renderRootConcurrent(root, lanes) : renderRootSync(root, lanes); + if (exitStatus !== RootInProgress) { + if (exitStatus === RootErrored) { + // If something threw an error, try rendering one more time. We'll + // render synchronously to block concurrent data mutations, and we'll + // includes all pending updates are included. If it still fails after + // the second attempt, we'll give up and commit the resulting tree. + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); + if (errorRetryLanes !== NoLanes) { + lanes = errorRetryLanes; + exitStatus = recoverFromConcurrentError(root, errorRetryLanes); + } + } + if (exitStatus === RootFatalErrored) { + var fatalError = workInProgressRootFatalError; + prepareFreshStack(root, NoLanes); + markRootSuspended$1(root, lanes); + ensureRootIsScheduled(root, now()); + throw fatalError; + } + if (exitStatus === RootDidNotComplete) { + // The render unwound without completing the tree. This happens in special + // cases where need to exit the current render without producing a + // consistent tree or committing. + // + // This should only happen during a concurrent render, not a discrete or + // synchronous update. We should have already checked for this when we + // unwound the stack. + markRootSuspended$1(root, lanes); + } else { + // The render completed. + // Check if this render may have yielded to a concurrent event, and if so, + // confirm that any newly rendered stores are consistent. + // TODO: It's possible that even a concurrent render may never have yielded + // to the main thread, if it was fast enough, or if it expired. We could + // skip the consistency check in that case, too. + var renderWasConcurrent = !includesBlockingLane(root, lanes); + var finishedWork = root.current.alternate; + if (renderWasConcurrent && !isRenderConsistentWithExternalStores(finishedWork)) { + // A store was mutated in an interleaved event. Render again, + // synchronously, to block further mutations. + exitStatus = renderRootSync(root, lanes); // We need to check again if something threw + + if (exitStatus === RootErrored) { + var _errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); + if (_errorRetryLanes !== NoLanes) { + lanes = _errorRetryLanes; + exitStatus = recoverFromConcurrentError(root, _errorRetryLanes); // We assume the tree is now consistent because we didn't yield to any + // concurrent events. + } + } + if (exitStatus === RootFatalErrored) { + var _fatalError = workInProgressRootFatalError; + prepareFreshStack(root, NoLanes); + markRootSuspended$1(root, lanes); + ensureRootIsScheduled(root, now()); + throw _fatalError; + } + } // We now have a consistent tree. The next step is either to commit it, + // or, if something suspended, wait to commit it after a timeout. + + root.finishedWork = finishedWork; + root.finishedLanes = lanes; + finishConcurrentRender(root, exitStatus, lanes); + } + } + ensureRootIsScheduled(root, now()); + if (root.callbackNode === originalCallbackNode) { + // The task node scheduled for this root is the same one that's + // currently executed. Need to return a continuation. + return performConcurrentWorkOnRoot.bind(null, root); + } + return null; + } + function recoverFromConcurrentError(root, errorRetryLanes) { + // If an error occurred during hydration, discard server response and fall + // back to client side render. + // Before rendering again, save the errors from the previous attempt. + var errorsFromFirstAttempt = workInProgressRootConcurrentErrors; + if (isRootDehydrated(root)) { + // The shell failed to hydrate. Set a flag to force a client rendering + // during the next attempt. To do this, we call prepareFreshStack now + // to create the root work-in-progress fiber. This is a bit weird in terms + // of factoring, because it relies on renderRootSync not calling + // prepareFreshStack again in the call below, which happens because the + // root and lanes haven't changed. + // + // TODO: I think what we should do is set ForceClientRender inside + // throwException, like we do for nested Suspense boundaries. The reason + // it's here instead is so we can switch to the synchronous work loop, too. + // Something to consider for a future refactor. + var rootWorkInProgress = prepareFreshStack(root, errorRetryLanes); + rootWorkInProgress.flags |= ForceClientRender; + { + errorHydratingContainer(root.containerInfo); + } + } + var exitStatus = renderRootSync(root, errorRetryLanes); + if (exitStatus !== RootErrored) { + // Successfully finished rendering on retry + // The errors from the failed first attempt have been recovered. Add + // them to the collection of recoverable errors. We'll log them in the + // commit phase. + var errorsFromSecondAttempt = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = errorsFromFirstAttempt; // The errors from the second attempt should be queued after the errors + // from the first attempt, to preserve the causal sequence. + + if (errorsFromSecondAttempt !== null) { + queueRecoverableErrors(errorsFromSecondAttempt); + } + } + return exitStatus; + } + function queueRecoverableErrors(errors) { + if (workInProgressRootRecoverableErrors === null) { + workInProgressRootRecoverableErrors = errors; + } else { + workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, errors); + } + } + function finishConcurrentRender(root, exitStatus, lanes) { + switch (exitStatus) { + case RootInProgress: + case RootFatalErrored: + { + throw new Error("Root did not complete. This is a bug in React."); + } + // Flow knows about invariant, so it complains if I add a break + // statement, but eslint doesn't know about invariant, so it complains + // if I do. eslint-disable-next-line no-fallthrough + + case RootErrored: + { + // We should have already attempted to retry this tree. If we reached + // this point, it errored again. Commit it. + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + } + case RootSuspended: + { + markRootSuspended$1(root, lanes); // We have an acceptable loading state. We need to figure out if we + // should immediately commit it or wait a bit. + + if (includesOnlyRetries(lanes) && + // do not delay if we're inside an act() scope + !shouldForceFlushFallbacksInDEV()) { + // This render only included retries, no updates. Throttle committing + // retries so that we don't show too many loading states too quickly. + var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); // Don't bother with a very short suspense time. + + if (msUntilTimeout > 10) { + var nextLanes = getNextLanes(root, NoLanes); + if (nextLanes !== NoLanes) { + // There's additional work on this root. + break; + } + var suspendedLanes = root.suspendedLanes; + if (!isSubsetOfLanes(suspendedLanes, lanes)) { + // We should prefer to render the fallback of at the last + // suspended level. Ping the last suspended level to try + // rendering it again. + // FIXME: What if the suspended lanes are Idle? Should not restart. + var eventTime = requestEventTime(); + markRootPinged(root, suspendedLanes); + break; + } // The render is suspended, it hasn't timed out, and there's no + // lower priority work to do. Instead of committing the fallback + // immediately, wait for more data to arrive. + + root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root, workInProgressRootRecoverableErrors, workInProgressTransitions), msUntilTimeout); + break; + } + } // The work expired. Commit immediately. + + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + } + case RootSuspendedWithDelay: + { + markRootSuspended$1(root, lanes); + if (includesOnlyTransitions(lanes)) { + // This is a transition, so we should exit without committing a + // placeholder and without scheduling a timeout. Delay indefinitely + // until we receive more data. + break; + } + if (!shouldForceFlushFallbacksInDEV()) { + // This is not a transition, but we did trigger an avoided state. + // Schedule a placeholder to display after a short delay, using the Just + // Noticeable Difference. + // TODO: Is the JND optimization worth the added complexity? If this is + // the only reason we track the event time, then probably not. + // Consider removing. + var mostRecentEventTime = getMostRecentEventTime(root, lanes); + var eventTimeMs = mostRecentEventTime; + var timeElapsedMs = now() - eventTimeMs; + var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time. + + if (_msUntilTimeout > 10) { + // Instead of committing the fallback immediately, wait for more data + // to arrive. + root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root, workInProgressRootRecoverableErrors, workInProgressTransitions), _msUntilTimeout); + break; + } + } // Commit the placeholder. + + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + } + case RootCompleted: + { + // The work completed. Ready to commit. + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + } + default: + { + throw new Error("Unknown root exit status."); + } + } + } + function isRenderConsistentWithExternalStores(finishedWork) { + // Search the rendered tree for external store reads, and check whether the + // stores were mutated in a concurrent event. Intentionally using an iterative + // loop instead of recursion so we can exit early. + var node = finishedWork; + while (true) { + if (node.flags & StoreConsistency) { + var updateQueue = node.updateQueue; + if (updateQueue !== null) { + var checks = updateQueue.stores; + if (checks !== null) { + for (var i = 0; i < checks.length; i++) { + var check = checks[i]; + var getSnapshot = check.getSnapshot; + var renderedValue = check.value; + try { + if (!objectIs(getSnapshot(), renderedValue)) { + // Found an inconsistent store. + return false; + } + } catch (error) { + // If `getSnapshot` throws, return `false`. This will schedule + // a re-render, and the error will be rethrown during render. + return false; + } + } + } + } + } + var child = node.child; + if (node.subtreeFlags & StoreConsistency && child !== null) { + child.return = node; + node = child; + continue; + } + if (node === finishedWork) { + return true; + } + while (node.sibling === null) { + if (node.return === null || node.return === finishedWork) { + return true; + } + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } // Flow doesn't know this is unreachable, but eslint does + // eslint-disable-next-line no-unreachable + + return true; + } + function markRootSuspended$1(root, suspendedLanes) { + // When suspending, we should always exclude lanes that were pinged or (more + // rarely, since we try to avoid it) updated during the render phase. + // TODO: Lol maybe there's a better way to factor this besides this + // obnoxiously named function :) + suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes); + suspendedLanes = removeLanes(suspendedLanes, workInProgressRootInterleavedUpdatedLanes); + markRootSuspended(root, suspendedLanes); + } // This is the entry point for synchronous tasks that don't go + // through Scheduler + + function performSyncWorkOnRoot(root) { + { + syncNestedUpdateFlag(); + } + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { + throw new Error("Should not already be working."); + } + flushPassiveEffects(); + var lanes = getNextLanes(root, NoLanes); + if (!includesSomeLane(lanes, SyncLane)) { + // There's no remaining sync work left. + ensureRootIsScheduled(root, now()); + return null; + } + var exitStatus = renderRootSync(root, lanes); + if (root.tag !== LegacyRoot && exitStatus === RootErrored) { + // If something threw an error, try rendering one more time. We'll render + // synchronously to block concurrent data mutations, and we'll includes + // all pending updates are included. If it still fails after the second + // attempt, we'll give up and commit the resulting tree. + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); + if (errorRetryLanes !== NoLanes) { + lanes = errorRetryLanes; + exitStatus = recoverFromConcurrentError(root, errorRetryLanes); + } + } + if (exitStatus === RootFatalErrored) { + var fatalError = workInProgressRootFatalError; + prepareFreshStack(root, NoLanes); + markRootSuspended$1(root, lanes); + ensureRootIsScheduled(root, now()); + throw fatalError; + } + if (exitStatus === RootDidNotComplete) { + throw new Error("Root did not complete. This is a bug in React."); + } // We now have a consistent tree. Because this is a sync render, we + // will commit it even if something suspended. + + var finishedWork = root.current.alternate; + root.finishedWork = finishedWork; + root.finishedLanes = lanes; + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); // Before exiting, make sure there's a callback scheduled for the next + // pending level. + + ensureRootIsScheduled(root, now()); + return null; + } + function batchedUpdates$1(fn, a) { + var prevExecutionContext = executionContext; + executionContext |= BatchedContext; + try { + return fn(a); + } finally { + executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer + // most batchedUpdates-like method. + + if (executionContext === NoContext && + // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode. + !ReactCurrentActQueue$1.isBatchingLegacy) { + resetRenderTimer(); + flushSyncCallbacksOnlyInLegacyMode(); + } + } + } + // Warning, this opts-out of checking the function body. + + // eslint-disable-next-line no-redeclare + function flushSync(fn) { + // In legacy mode, we flush pending passive effects at the beginning of the + // next event, not at the end of the previous one. + if (rootWithPendingPassiveEffects !== null && rootWithPendingPassiveEffects.tag === LegacyRoot && (executionContext & (RenderContext | CommitContext)) === NoContext) { + flushPassiveEffects(); + } + var prevExecutionContext = executionContext; + executionContext |= BatchedContext; + var prevTransition = ReactCurrentBatchConfig$2.transition; + var previousPriority = getCurrentUpdatePriority(); + try { + ReactCurrentBatchConfig$2.transition = null; + setCurrentUpdatePriority(DiscreteEventPriority); + if (fn) { + return fn(); + } else { + return undefined; + } + } finally { + setCurrentUpdatePriority(previousPriority); + ReactCurrentBatchConfig$2.transition = prevTransition; + executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch. + // Note that this will happen even if batchedUpdates is higher up + // the stack. + + if ((executionContext & (RenderContext | CommitContext)) === NoContext) { + flushSyncCallbacks(); + } + } + } + function pushRenderLanes(fiber, lanes) { + push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber); + subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes); + workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes); + } + function popRenderLanes(fiber) { + subtreeRenderLanes = subtreeRenderLanesCursor.current; + pop(subtreeRenderLanesCursor, fiber); + } + function prepareFreshStack(root, lanes) { + root.finishedWork = null; + root.finishedLanes = NoLanes; + var timeoutHandle = root.timeoutHandle; + if (timeoutHandle !== noTimeout) { + // The root previous suspended and scheduled a timeout to commit a fallback + // state. Now that we have additional work, cancel the timeout. + root.timeoutHandle = noTimeout; // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above + + cancelTimeout(timeoutHandle); + } + if (workInProgress !== null) { + var interruptedWork = workInProgress.return; + while (interruptedWork !== null) { + var current = interruptedWork.alternate; + unwindInterruptedWork(current, interruptedWork); + interruptedWork = interruptedWork.return; + } + } + workInProgressRoot = root; + var rootWorkInProgress = createWorkInProgress(root.current, null); + workInProgress = rootWorkInProgress; + workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes; + workInProgressRootExitStatus = RootInProgress; + workInProgressRootFatalError = null; + workInProgressRootSkippedLanes = NoLanes; + workInProgressRootInterleavedUpdatedLanes = NoLanes; + workInProgressRootPingedLanes = NoLanes; + workInProgressRootConcurrentErrors = null; + workInProgressRootRecoverableErrors = null; + finishQueueingConcurrentUpdates(); + { + ReactStrictModeWarnings.discardPendingWarnings(); + } + return rootWorkInProgress; + } + function handleError(root, thrownValue) { + do { + var erroredWork = workInProgress; + try { + // Reset module-level state that was set during the render phase. + resetContextDependencies(); + resetHooksAfterThrow(); + resetCurrentFiber(); // TODO: I found and added this missing line while investigating a + // separate issue. Write a regression test using string refs. + + ReactCurrentOwner$2.current = null; + if (erroredWork === null || erroredWork.return === null) { + // Expected to be working on a non-root fiber. This is a fatal error + // because there's no ancestor that can handle it; the root is + // supposed to capture all errors that weren't caught by an error + // boundary. + workInProgressRootExitStatus = RootFatalErrored; + workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next + // sibling, or the parent if there are no siblings. But since the root + // has no siblings nor a parent, we set it to null. Usually this is + // handled by `completeUnitOfWork` or `unwindWork`, but since we're + // intentionally not calling those, we need set it here. + // TODO: Consider calling `unwindWork` to pop the contexts. + + workInProgress = null; + return; + } + if (enableProfilerTimer && erroredWork.mode & ProfileMode) { + // Record the time spent rendering before an error was thrown. This + // avoids inaccurate Profiler durations in the case of a + // suspended render. + stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true); + } + if (enableSchedulingProfiler) { + markComponentRenderStopped(); + if (thrownValue !== null && typeof thrownValue === "object" && typeof thrownValue.then === "function") { + var wakeable = thrownValue; + markComponentSuspended(erroredWork, wakeable, workInProgressRootRenderLanes); + } else { + markComponentErrored(erroredWork, thrownValue, workInProgressRootRenderLanes); + } + } + throwException(root, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes); + completeUnitOfWork(erroredWork); + } catch (yetAnotherThrownValue) { + // Something in the return path also threw. + thrownValue = yetAnotherThrownValue; + if (workInProgress === erroredWork && erroredWork !== null) { + // If this boundary has already errored, then we had trouble processing + // the error. Bubble it to the next boundary. + erroredWork = erroredWork.return; + workInProgress = erroredWork; + } else { + erroredWork = workInProgress; + } + continue; + } // Return to the normal work loop. + + return; + } while (true); + } + function pushDispatcher() { + var prevDispatcher = ReactCurrentDispatcher$2.current; + ReactCurrentDispatcher$2.current = ContextOnlyDispatcher; + if (prevDispatcher === null) { + // The React isomorphic package does not include a default dispatcher. + // Instead the first renderer will lazily attach one, in order to give + // nicer error messages. + return ContextOnlyDispatcher; + } else { + return prevDispatcher; + } + } + function popDispatcher(prevDispatcher) { + ReactCurrentDispatcher$2.current = prevDispatcher; + } + function markCommitTimeOfFallback() { + globalMostRecentFallbackTime = now(); + } + function markSkippedUpdateLanes(lane) { + workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes); + } + function renderDidSuspend() { + if (workInProgressRootExitStatus === RootInProgress) { + workInProgressRootExitStatus = RootSuspended; + } + } + function renderDidSuspendDelayIfPossible() { + if (workInProgressRootExitStatus === RootInProgress || workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootErrored) { + workInProgressRootExitStatus = RootSuspendedWithDelay; + } // Check if there are updates that we skipped tree that might have unblocked + // this render. + + if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes))) { + // Mark the current render as suspended so that we switch to working on + // the updates that were skipped. Usually we only suspend at the end of + // the render phase. + // TODO: We should probably always mark the root as suspended immediately + // (inside this function), since by suspending at the end of the render + // phase introduces a potential mistake where we suspend lanes that were + // pinged or updated while we were rendering. + markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes); + } + } + function renderDidError(error) { + if (workInProgressRootExitStatus !== RootSuspendedWithDelay) { + workInProgressRootExitStatus = RootErrored; + } + if (workInProgressRootConcurrentErrors === null) { + workInProgressRootConcurrentErrors = [error]; + } else { + workInProgressRootConcurrentErrors.push(error); + } + } // Called during render to determine if anything has suspended. + // Returns false if we're not sure. + + function renderHasNotSuspendedYet() { + // If something errored or completed, we can't really be sure, + // so those are false. + return workInProgressRootExitStatus === RootInProgress; + } + function renderRootSync(root, lanes) { + var prevExecutionContext = executionContext; + executionContext |= RenderContext; + var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack + // and prepare a fresh one. Otherwise we'll continue where we left off. + + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { + { + if (isDevToolsPresent) { + var memoizedUpdaters = root.memoizedUpdaters; + if (memoizedUpdaters.size > 0) { + restorePendingUpdaters(root, workInProgressRootRenderLanes); + memoizedUpdaters.clear(); + } // At this point, move Fibers that scheduled the upcoming work from the Map to the Set. + // If we bailout on this work, we'll move them back (like above). + // It's important to move them now in case the work spawns more work at the same priority with different updaters. + // That way we can keep the current update and future updates separate. + + movePendingFibersToMemoized(root, lanes); + } + } + workInProgressTransitions = getTransitionsForLanes(); + prepareFreshStack(root, lanes); + } + do { + try { + workLoopSync(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } + } while (true); + resetContextDependencies(); + executionContext = prevExecutionContext; + popDispatcher(prevDispatcher); + if (workInProgress !== null) { + // This is a sync render, so we should have finished the whole tree. + throw new Error("Cannot commit an incomplete root. This error is likely caused by a " + "bug in React. Please file an issue."); + } + workInProgressRoot = null; + workInProgressRootRenderLanes = NoLanes; + return workInProgressRootExitStatus; + } // The work loop is an extremely hot path. Tell Closure not to inline it. + + /** @noinline */ + + function workLoopSync() { + // Already timed out, so perform work without checking if we need to yield. + while (workInProgress !== null) { + performUnitOfWork(workInProgress); + } + } + function renderRootConcurrent(root, lanes) { + var prevExecutionContext = executionContext; + executionContext |= RenderContext; + var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack + // and prepare a fresh one. Otherwise we'll continue where we left off. + + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { + { + if (isDevToolsPresent) { + var memoizedUpdaters = root.memoizedUpdaters; + if (memoizedUpdaters.size > 0) { + restorePendingUpdaters(root, workInProgressRootRenderLanes); + memoizedUpdaters.clear(); + } // At this point, move Fibers that scheduled the upcoming work from the Map to the Set. + // If we bailout on this work, we'll move them back (like above). + // It's important to move them now in case the work spawns more work at the same priority with different updaters. + // That way we can keep the current update and future updates separate. + + movePendingFibersToMemoized(root, lanes); + } + } + workInProgressTransitions = getTransitionsForLanes(); + resetRenderTimer(); + prepareFreshStack(root, lanes); + } + do { + try { + workLoopConcurrent(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } + } while (true); + resetContextDependencies(); + popDispatcher(prevDispatcher); + executionContext = prevExecutionContext; + if (workInProgress !== null) { + return RootInProgress; + } else { + workInProgressRoot = null; + workInProgressRootRenderLanes = NoLanes; // Return the final exit status. + + return workInProgressRootExitStatus; + } + } + /** @noinline */ + + function workLoopConcurrent() { + // Perform work until Scheduler asks us to yield + while (workInProgress !== null && !shouldYield()) { + performUnitOfWork(workInProgress); + } + } + function performUnitOfWork(unitOfWork) { + // The current, flushed, state of this fiber is the alternate. Ideally + // nothing should rely on this, but relying on it here means that we don't + // need an additional field on the work in progress. + var current = unitOfWork.alternate; + setCurrentFiber(unitOfWork); + var next; + if ((unitOfWork.mode & ProfileMode) !== NoMode) { + startProfilerTimer(unitOfWork); + next = beginWork$1(current, unitOfWork, subtreeRenderLanes); + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true); + } else { + next = beginWork$1(current, unitOfWork, subtreeRenderLanes); + } + resetCurrentFiber(); + unitOfWork.memoizedProps = unitOfWork.pendingProps; + if (next === null) { + // If this doesn't spawn new work, complete the current work. + completeUnitOfWork(unitOfWork); + } else { + workInProgress = next; + } + ReactCurrentOwner$2.current = null; + } + function completeUnitOfWork(unitOfWork) { + // Attempt to complete the current unit of work, then move to the next + // sibling. If there are no more siblings, return to the parent fiber. + var completedWork = unitOfWork; + do { + // The current, flushed, state of this fiber is the alternate. Ideally + // nothing should rely on this, but relying on it here means that we don't + // need an additional field on the work in progress. + var current = completedWork.alternate; + var returnFiber = completedWork.return; // Check if the work completed or if something threw. + + if ((completedWork.flags & Incomplete) === NoFlags) { + setCurrentFiber(completedWork); + var next = void 0; + if ((completedWork.mode & ProfileMode) === NoMode) { + next = completeWork(current, completedWork, subtreeRenderLanes); + } else { + startProfilerTimer(completedWork); + next = completeWork(current, completedWork, subtreeRenderLanes); // Update render duration assuming we didn't error. + + stopProfilerTimerIfRunningAndRecordDelta(completedWork, false); + } + resetCurrentFiber(); + if (next !== null) { + // Completing this fiber spawned new work. Work on that next. + workInProgress = next; + return; + } + } else { + // This fiber did not complete because something threw. Pop values off + // the stack without entering the complete phase. If this is a boundary, + // capture values if possible. + var _next = unwindWork(current, completedWork); // Because this fiber did not complete, don't reset its lanes. + + if (_next !== null) { + // If completing this work spawned new work, do that next. We'll come + // back here again. + // Since we're restarting, remove anything that is not a host effect + // from the effect tag. + _next.flags &= HostEffectMask; + workInProgress = _next; + return; + } + if ((completedWork.mode & ProfileMode) !== NoMode) { + // Record the render duration for the fiber that errored. + stopProfilerTimerIfRunningAndRecordDelta(completedWork, false); // Include the time spent working on failed children before continuing. + + var actualDuration = completedWork.actualDuration; + var child = completedWork.child; + while (child !== null) { + actualDuration += child.actualDuration; + child = child.sibling; + } + completedWork.actualDuration = actualDuration; + } + if (returnFiber !== null) { + // Mark the parent fiber as incomplete and clear its subtree flags. + returnFiber.flags |= Incomplete; + returnFiber.subtreeFlags = NoFlags; + returnFiber.deletions = null; + } else { + // We've unwound all the way to the root. + workInProgressRootExitStatus = RootDidNotComplete; + workInProgress = null; + return; + } + } + var siblingFiber = completedWork.sibling; + if (siblingFiber !== null) { + // If there is more work to do in this returnFiber, do that next. + workInProgress = siblingFiber; + return; + } // Otherwise, return to the parent + + completedWork = returnFiber; // Update the next thing we're working on in case something throws. + + workInProgress = completedWork; + } while (completedWork !== null); // We've reached the root. + + if (workInProgressRootExitStatus === RootInProgress) { + workInProgressRootExitStatus = RootCompleted; + } + } + function commitRoot(root, recoverableErrors, transitions) { + // TODO: This no longer makes any sense. We already wrap the mutation and + // layout phases. Should be able to remove. + var previousUpdateLanePriority = getCurrentUpdatePriority(); + var prevTransition = ReactCurrentBatchConfig$2.transition; + try { + ReactCurrentBatchConfig$2.transition = null; + setCurrentUpdatePriority(DiscreteEventPriority); + commitRootImpl(root, recoverableErrors, transitions, previousUpdateLanePriority); + } finally { + ReactCurrentBatchConfig$2.transition = prevTransition; + setCurrentUpdatePriority(previousUpdateLanePriority); + } + return null; + } + function commitRootImpl(root, recoverableErrors, transitions, renderPriorityLevel) { + do { + // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which + // means `flushPassiveEffects` will sometimes result in additional + // passive effects. So we need to keep flushing in a loop until there are + // no more pending effects. + // TODO: Might be better if `flushPassiveEffects` did not automatically + // flush synchronous work at the end, to avoid factoring hazards like this. + flushPassiveEffects(); + } while (rootWithPendingPassiveEffects !== null); + flushRenderPhaseStrictModeWarningsInDEV(); + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { + throw new Error("Should not already be working."); + } + var finishedWork = root.finishedWork; + var lanes = root.finishedLanes; + if (finishedWork === null) { + return null; + } else { + { + if (lanes === NoLanes) { + error("root.finishedLanes should not be empty during a commit. This is a " + "bug in React."); + } + } + } + root.finishedWork = null; + root.finishedLanes = NoLanes; + if (finishedWork === root.current) { + throw new Error("Cannot commit the same tree as before. This error is likely caused by " + "a bug in React. Please file an issue."); + } // commitRoot never returns a continuation; it always finishes synchronously. + // So we can clear these now to allow a new callback to be scheduled. + + root.callbackNode = null; + root.callbackPriority = NoLane; // Update the first and last pending times on this root. The new first + // pending time is whatever is left on the root fiber. + + var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes); + markRootFinished(root, remainingLanes); + if (root === workInProgressRoot) { + // We can reset these now that they are finished. + workInProgressRoot = null; + workInProgress = null; + workInProgressRootRenderLanes = NoLanes; + } // If there are pending passive effects, schedule a callback to process them. + // Do this as early as possible, so it is queued before anything else that + // might get scheduled in the commit phase. (See #16714.) + // TODO: Delete all other places that schedule the passive effect callback + // They're redundant. + + if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags || (finishedWork.flags & PassiveMask) !== NoFlags) { + if (!rootDoesHavePassiveEffects) { + rootDoesHavePassiveEffects = true; + // to store it in pendingPassiveTransitions until they get processed + // We need to pass this through as an argument to commitRoot + // because workInProgressTransitions might have changed between + // the previous render and commit if we throttle the commit + // with setTimeout + + pendingPassiveTransitions = transitions; + scheduleCallback$1(NormalPriority, function () { + flushPassiveEffects(); // This render triggered passive effects: release the root cache pool + // *after* passive effects fire to avoid freeing a cache pool that may + // be referenced by a node in the tree (HostRoot, Cache boundary etc) + + return null; + }); + } + } // Check if there are any effects in the whole tree. + // TODO: This is left over from the effect list implementation, where we had + // to check for the existence of `firstEffect` to satisfy Flow. I think the + // only other reason this optimization exists is because it affects profiling. + // Reconsider whether this is necessary. + + var subtreeHasEffects = (finishedWork.subtreeFlags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags; + var rootHasEffect = (finishedWork.flags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags; + if (subtreeHasEffects || rootHasEffect) { + var prevTransition = ReactCurrentBatchConfig$2.transition; + ReactCurrentBatchConfig$2.transition = null; + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(DiscreteEventPriority); + var prevExecutionContext = executionContext; + executionContext |= CommitContext; // Reset this to null before calling lifecycles + + ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass + // of the effect list for each phase: all mutation effects come before all + // layout effects, and so on. + // The first phase a "before mutation" phase. We use this phase to read the + // state of the host tree right before we mutate it. This is where + // getSnapshotBeforeUpdate is called. + + var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects(root, finishedWork); + { + // Mark the current commit time to be shared by all Profilers in this + // batch. This enables them to be grouped later. + recordCommitTime(); + } + commitMutationEffects(root, finishedWork, lanes); + resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after + // the mutation phase, so that the previous tree is still current during + // componentWillUnmount, but before the layout phase, so that the finished + // work is current during componentDidMount/Update. + + root.current = finishedWork; // The next phase is the layout phase, where we call effects that read + + commitLayoutEffects(finishedWork, root, lanes); + // opportunity to paint. + + requestPaint(); + executionContext = prevExecutionContext; // Reset the priority to the previous non-sync value. + + setCurrentUpdatePriority(previousPriority); + ReactCurrentBatchConfig$2.transition = prevTransition; + } else { + // No effects. + root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were + // no effects. + // TODO: Maybe there's a better way to report this. + + { + recordCommitTime(); + } + } + if (rootDoesHavePassiveEffects) { + // This commit has passive effects. Stash a reference to them. But don't + // schedule a callback until after flushing layout work. + rootDoesHavePassiveEffects = false; + rootWithPendingPassiveEffects = root; + pendingPassiveEffectsLanes = lanes; + } else { + { + nestedPassiveUpdateCount = 0; + rootWithPassiveNestedUpdates = null; + } + } // Read this again, since an effect might have updated it + + remainingLanes = root.pendingLanes; // Check if there's remaining work on this root + // TODO: This is part of the `componentDidCatch` implementation. Its purpose + // is to detect whether something might have called setState inside + // `componentDidCatch`. The mechanism is known to be flawed because `setState` + // inside `componentDidCatch` is itself flawed — that's why we recommend + // `getDerivedStateFromError` instead. However, it could be improved by + // checking if remainingLanes includes Sync work, instead of whether there's + // any work remaining at all (which would also include stuff like Suspense + // retries or transitions). It's been like this for a while, though, so fixing + // it probably isn't that urgent. + + if (remainingLanes === NoLanes) { + // If there's no remaining work, we can clear the set of already failed + // error boundaries. + legacyErrorBoundariesThatAlreadyFailed = null; + } + onCommitRoot(finishedWork.stateNode, renderPriorityLevel); + { + if (isDevToolsPresent) { + root.memoizedUpdaters.clear(); + } + } + // additional work on this root is scheduled. + + ensureRootIsScheduled(root, now()); + if (recoverableErrors !== null) { + // There were errors during this render, but recovered from them without + // needing to surface it to the UI. We log them here. + var onRecoverableError = root.onRecoverableError; + for (var i = 0; i < recoverableErrors.length; i++) { + var recoverableError = recoverableErrors[i]; + var componentStack = recoverableError.stack; + var digest = recoverableError.digest; + onRecoverableError(recoverableError.value, { + componentStack: componentStack, + digest: digest + }); + } + } + if (hasUncaughtError) { + hasUncaughtError = false; + var error$1 = firstUncaughtError; + firstUncaughtError = null; + throw error$1; + } // If the passive effects are the result of a discrete render, flush them + // synchronously at the end of the current task so that the result is + // immediately observable. Otherwise, we assume that they are not + // order-dependent and do not need to be observed by external systems, so we + // can wait until after paint. + // TODO: We can optimize this by not scheduling the callback earlier. Since we + // currently schedule the callback in multiple places, will wait until those + // are consolidated. + + if (includesSomeLane(pendingPassiveEffectsLanes, SyncLane) && root.tag !== LegacyRoot) { + flushPassiveEffects(); + } // Read this again, since a passive effect might have updated it + + remainingLanes = root.pendingLanes; + if (includesSomeLane(remainingLanes, SyncLane)) { + { + markNestedUpdateScheduled(); + } // Count the number of times the root synchronously re-renders without + // finishing. If there are too many, it indicates an infinite update loop. + + if (root === rootWithNestedUpdates) { + nestedUpdateCount++; + } else { + nestedUpdateCount = 0; + rootWithNestedUpdates = root; + } + } else { + nestedUpdateCount = 0; + } // If layout work was scheduled, flush it now. + + flushSyncCallbacks(); + return null; + } + function flushPassiveEffects() { + // Returns whether passive effects were flushed. + // TODO: Combine this check with the one in flushPassiveEFfectsImpl. We should + // probably just combine the two functions. I believe they were only separate + // in the first place because we used to wrap it with + // `Scheduler.runWithPriority`, which accepts a function. But now we track the + // priority within React itself, so we can mutate the variable directly. + if (rootWithPendingPassiveEffects !== null) { + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); + var priority = lowerEventPriority(DefaultEventPriority, renderPriority); + var prevTransition = ReactCurrentBatchConfig$2.transition; + var previousPriority = getCurrentUpdatePriority(); + try { + ReactCurrentBatchConfig$2.transition = null; + setCurrentUpdatePriority(priority); + return flushPassiveEffectsImpl(); + } finally { + setCurrentUpdatePriority(previousPriority); + ReactCurrentBatchConfig$2.transition = prevTransition; // Once passive effects have run for the tree - giving components a + } + } + return false; + } + function enqueuePendingPassiveProfilerEffect(fiber) { + { + pendingPassiveProfilerEffects.push(fiber); + if (!rootDoesHavePassiveEffects) { + rootDoesHavePassiveEffects = true; + scheduleCallback$1(NormalPriority, function () { + flushPassiveEffects(); + return null; + }); + } + } + } + function flushPassiveEffectsImpl() { + if (rootWithPendingPassiveEffects === null) { + return false; + } // Cache and clear the transitions flag + + var transitions = pendingPassiveTransitions; + pendingPassiveTransitions = null; + var root = rootWithPendingPassiveEffects; + var lanes = pendingPassiveEffectsLanes; + rootWithPendingPassiveEffects = null; // TODO: This is sometimes out of sync with rootWithPendingPassiveEffects. + // Figure out why and fix it. It's not causing any known issues (probably + // because it's only used for profiling), but it's a refactor hazard. + + pendingPassiveEffectsLanes = NoLanes; + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { + throw new Error("Cannot flush passive effects while already rendering."); + } + { + isFlushingPassiveEffects = true; + didScheduleUpdateDuringPassiveEffects = false; + } + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + commitPassiveUnmountEffects(root.current); + commitPassiveMountEffects(root, root.current, lanes, transitions); // TODO: Move to commitPassiveMountEffects + + { + var profilerEffects = pendingPassiveProfilerEffects; + pendingPassiveProfilerEffects = []; + for (var i = 0; i < profilerEffects.length; i++) { + var _fiber = profilerEffects[i]; + commitPassiveEffectDurations(root, _fiber); + } + } + executionContext = prevExecutionContext; + flushSyncCallbacks(); + { + // If additional passive effects were scheduled, increment a counter. If this + // exceeds the limit, we'll fire a warning. + if (didScheduleUpdateDuringPassiveEffects) { + if (root === rootWithPassiveNestedUpdates) { + nestedPassiveUpdateCount++; + } else { + nestedPassiveUpdateCount = 0; + rootWithPassiveNestedUpdates = root; + } + } else { + nestedPassiveUpdateCount = 0; + } + isFlushingPassiveEffects = false; + didScheduleUpdateDuringPassiveEffects = false; + } // TODO: Move to commitPassiveMountEffects + + onPostCommitRoot(root); + { + var stateNode = root.current.stateNode; + stateNode.effectDuration = 0; + stateNode.passiveEffectDuration = 0; + } + return true; + } + function isAlreadyFailedLegacyErrorBoundary(instance) { + return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance); + } + function markLegacyErrorBoundaryAsFailed(instance) { + if (legacyErrorBoundariesThatAlreadyFailed === null) { + legacyErrorBoundariesThatAlreadyFailed = new Set([instance]); + } else { + legacyErrorBoundariesThatAlreadyFailed.add(instance); + } + } + function prepareToThrowUncaughtError(error) { + if (!hasUncaughtError) { + hasUncaughtError = true; + firstUncaughtError = error; + } + } + var onUncaughtError = prepareToThrowUncaughtError; + function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { + var errorInfo = createCapturedValueAtFiber(error, sourceFiber); + var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane); + var root = enqueueUpdate(rootFiber, update, SyncLane); + var eventTime = requestEventTime(); + if (root !== null) { + markRootUpdated(root, SyncLane, eventTime); + ensureRootIsScheduled(root, eventTime); + } + } + function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) { + { + reportUncaughtErrorInDEV(error$1); + setIsRunningInsertionEffect(false); + } + if (sourceFiber.tag === HostRoot) { + // Error was thrown at the root. There is no parent, so the root + // itself should capture it. + captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error$1); + return; + } + var fiber = null; + { + fiber = sourceFiber.return; + } + while (fiber !== null) { + if (fiber.tag === HostRoot) { + captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error$1); + return; + } else if (fiber.tag === ClassComponent) { + var ctor = fiber.type; + var instance = fiber.stateNode; + if (typeof ctor.getDerivedStateFromError === "function" || typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance)) { + var errorInfo = createCapturedValueAtFiber(error$1, sourceFiber); + var update = createClassErrorUpdate(fiber, errorInfo, SyncLane); + var root = enqueueUpdate(fiber, update, SyncLane); + var eventTime = requestEventTime(); + if (root !== null) { + markRootUpdated(root, SyncLane, eventTime); + ensureRootIsScheduled(root, eventTime); + } + return; + } + } + fiber = fiber.return; + } + { + // TODO: Until we re-land skipUnmountedBoundaries (see #20147), this warning + // will fire for errors that are thrown by destroy functions inside deleted + // trees. What it should instead do is propagate the error to the parent of + // the deleted tree. In the meantime, do not add this warning to the + // allowlist; this is only for our internal use. + error("Internal React error: Attempted to capture a commit phase error " + "inside a detached tree. This indicates a bug in React. Likely " + "causes include deleting the same fiber more than once, committing an " + "already-finished tree, or an inconsistent return pointer.\n\n" + "Error message:\n\n%s", error$1); + } + } + function pingSuspendedRoot(root, wakeable, pingedLanes) { + var pingCache = root.pingCache; + if (pingCache !== null) { + // The wakeable resolved, so we no longer need to memoize, because it will + // never be thrown again. + pingCache.delete(wakeable); + } + var eventTime = requestEventTime(); + markRootPinged(root, pingedLanes); + warnIfSuspenseResolutionNotWrappedWithActDEV(root); + if (workInProgressRoot === root && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) { + // Received a ping at the same priority level at which we're currently + // rendering. We might want to restart this render. This should mirror + // the logic of whether or not a root suspends once it completes. + // TODO: If we're rendering sync either due to Sync, Batched or expired, + // we should probably never restart. + // If we're suspended with delay, or if it's a retry, we'll always suspend + // so we can always restart. + if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) { + // Restart from the root. + prepareFreshStack(root, NoLanes); + } else { + // Even though we can't restart right now, we might get an + // opportunity later. So we mark this render as having a ping. + workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes); + } + } + ensureRootIsScheduled(root, eventTime); + } + function retryTimedOutBoundary(boundaryFiber, retryLane) { + // The boundary fiber (a Suspense component or SuspenseList component) + // previously was rendered in its fallback state. One of the promises that + // suspended it has resolved, which means at least part of the tree was + // likely unblocked. Try rendering again, at a new lanes. + if (retryLane === NoLane) { + // TODO: Assign this to `suspenseState.retryLane`? to avoid + // unnecessary entanglement? + retryLane = requestRetryLane(boundaryFiber); + } // TODO: Special case idle priority? + + var eventTime = requestEventTime(); + var root = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); + if (root !== null) { + markRootUpdated(root, retryLane, eventTime); + ensureRootIsScheduled(root, eventTime); + } + } + function retryDehydratedSuspenseBoundary(boundaryFiber) { + var suspenseState = boundaryFiber.memoizedState; + var retryLane = NoLane; + if (suspenseState !== null) { + retryLane = suspenseState.retryLane; + } + retryTimedOutBoundary(boundaryFiber, retryLane); + } + function resolveRetryWakeable(boundaryFiber, wakeable) { + var retryLane = NoLane; // Default + + var retryCache; + switch (boundaryFiber.tag) { + case SuspenseComponent: + retryCache = boundaryFiber.stateNode; + var suspenseState = boundaryFiber.memoizedState; + if (suspenseState !== null) { + retryLane = suspenseState.retryLane; + } + break; + case SuspenseListComponent: + retryCache = boundaryFiber.stateNode; + break; + default: + throw new Error("Pinged unknown suspense boundary type. " + "This is probably a bug in React."); + } + if (retryCache !== null) { + // The wakeable resolved, so we no longer need to memoize, because it will + // never be thrown again. + retryCache.delete(wakeable); + } + retryTimedOutBoundary(boundaryFiber, retryLane); + } // Computes the next Just Noticeable Difference (JND) boundary. + // The theory is that a person can't tell the difference between small differences in time. + // Therefore, if we wait a bit longer than necessary that won't translate to a noticeable + // difference in the experience. However, waiting for longer might mean that we can avoid + // showing an intermediate loading state. The longer we have already waited, the harder it + // is to tell small differences in time. Therefore, the longer we've already waited, + // the longer we can wait additionally. At some point we have to give up though. + // We pick a train model where the next boundary commits at a consistent schedule. + // These particular numbers are vague estimates. We expect to adjust them based on research. + + function jnd(timeElapsed) { + return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960; + } + function checkForNestedUpdates() { + if (nestedUpdateCount > NESTED_UPDATE_LIMIT) { + nestedUpdateCount = 0; + rootWithNestedUpdates = null; + throw new 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."); + } + { + if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) { + nestedPassiveUpdateCount = 0; + rootWithPassiveNestedUpdates = null; + error("Maximum update depth exceeded. This can happen when a component " + "calls setState inside useEffect, but useEffect either doesn't " + "have a dependency array, or one of the dependencies changes on " + "every render."); + } + } + } + function flushRenderPhaseStrictModeWarningsInDEV() { + { + ReactStrictModeWarnings.flushLegacyContextWarning(); + { + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); + } + } + } + var didWarnStateUpdateForNotYetMountedComponent = null; + function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) { + { + if ((executionContext & RenderContext) !== NoContext) { + // We let the other warning about render phase updates deal with this one. + return; + } + if (!(fiber.mode & ConcurrentMode)) { + return; + } + var tag = fiber.tag; + if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) { + // Only warn for user-defined components, not internal ones like Suspense. + return; + } // We show the whole stack but dedupe on the top component's name because + // the problematic code almost always lies inside that component. + + var componentName = getComponentNameFromFiber(fiber) || "ReactComponent"; + if (didWarnStateUpdateForNotYetMountedComponent !== null) { + if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) { + return; + } + didWarnStateUpdateForNotYetMountedComponent.add(componentName); + } else { + didWarnStateUpdateForNotYetMountedComponent = new Set([componentName]); + } + var previousFiber = current; + try { + setCurrentFiber(fiber); + error("Can't perform a React state update on a component that hasn't mounted yet. " + "This indicates that you have a side-effect in your render function that " + "asynchronously later calls tries to update the component. Move this work to " + "useEffect instead."); + } finally { + if (previousFiber) { + setCurrentFiber(fiber); + } else { + resetCurrentFiber(); + } + } + } + } + var beginWork$1; + { + var dummyFiber = null; + beginWork$1 = function beginWork$1(current, unitOfWork, lanes) { + // If a component throws an error, we replay it again in a synchronously + // dispatched event, so that the debugger will treat it as an uncaught + // error See ReactErrorUtils for more information. + // Before entering the begin phase, copy the work-in-progress onto a dummy + // fiber. If beginWork throws, we'll use this to reset the state. + var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork); + try { + return beginWork(current, unitOfWork, lanes); + } catch (originalError) { + if (didSuspendOrErrorWhileHydratingDEV() || originalError !== null && typeof originalError === "object" && typeof originalError.then === "function") { + // Don't replay promises. + // Don't replay errors if we are hydrating and have already suspended or handled an error + throw originalError; + } // Keep this code in sync with handleError; any changes here must have + // corresponding changes there. + + resetContextDependencies(); + resetHooksAfterThrow(); // Don't reset current debug fiber, since we're about to work on the + // same fiber again. + // Unwind the failed stack frame + + unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber. + + assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); + if (unitOfWork.mode & ProfileMode) { + // Reset the profiler timer. + startProfilerTimer(unitOfWork); + } // Run beginWork again. + + invokeGuardedCallback(null, beginWork, null, current, unitOfWork, lanes); + if (hasCaughtError()) { + var replayError = clearCaughtError(); + if (typeof replayError === "object" && replayError !== null && replayError._suppressLogging && typeof originalError === "object" && originalError !== null && !originalError._suppressLogging) { + // If suppressed, let the flag carry over to the original error which is the one we'll rethrow. + originalError._suppressLogging = true; + } + } // We always throw the original error in case the second render pass is not idempotent. + // This can happen if a memoized function or CommonJS module doesn't throw after first invocation. + + throw originalError; + } + }; + } + var didWarnAboutUpdateInRender = false; + var didWarnAboutUpdateInRenderForAnotherComponent; + { + didWarnAboutUpdateInRenderForAnotherComponent = new Set(); + } + function warnAboutRenderPhaseUpdatesInDEV(fiber) { + { + if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) { + switch (fiber.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + { + var renderingComponentName = workInProgress && getComponentNameFromFiber(workInProgress) || "Unknown"; // Dedupe by the rendering component because it's the one that needs to be fixed. + + var dedupeKey = renderingComponentName; + if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) { + didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey); + var setStateComponentName = getComponentNameFromFiber(fiber) || "Unknown"; + error("Cannot update a component (`%s`) while rendering a " + "different component (`%s`). To locate the bad setState() call inside `%s`, " + "follow the stack trace as described in https://react.dev/link/setstate-in-render", setStateComponentName, renderingComponentName, renderingComponentName); + } + break; + } + case ClassComponent: + { + if (!didWarnAboutUpdateInRender) { + error("Cannot update during an existing state transition (such as " + "within `render`). Render methods should be a pure " + "function of props and state."); + didWarnAboutUpdateInRender = true; + } + break; + } + } + } + } + } + function restorePendingUpdaters(root, lanes) { + { + if (isDevToolsPresent) { + var memoizedUpdaters = root.memoizedUpdaters; + memoizedUpdaters.forEach(function (schedulingFiber) { + addFiberToLanesMap(root, schedulingFiber, lanes); + }); // This function intentionally does not clear memoized updaters. + // Those may still be relevant to the current commit + // and a future one (e.g. Suspense). + } + } + } + var fakeActCallbackNode = {}; + function scheduleCallback$1(priorityLevel, callback) { + { + // If we're currently inside an `act` scope, bypass Scheduler and push to + // the `act` queue instead. + var actQueue = ReactCurrentActQueue$1.current; + if (actQueue !== null) { + actQueue.push(callback); + return fakeActCallbackNode; + } else { + return scheduleCallback(priorityLevel, callback); + } + } + } + function cancelCallback$1(callbackNode) { + if (callbackNode === fakeActCallbackNode) { + return; + } // In production, always call Scheduler. This function will be stripped out. + + return cancelCallback(callbackNode); + } + function shouldForceFlushFallbacksInDEV() { + // Never force flush in production. This function should get stripped out. + return ReactCurrentActQueue$1.current !== null; + } + function warnIfUpdatesNotWrappedWithActDEV(fiber) { + { + if (fiber.mode & ConcurrentMode) { + if (!isConcurrentActEnvironment()) { + // Not in an act environment. No need to warn. + return; + } + } else { + // Legacy mode has additional cases where we suppress a warning. + if (!isLegacyActEnvironment()) { + // Not in an act environment. No need to warn. + return; + } + if (executionContext !== NoContext) { + // Legacy mode doesn't warn if the update is batched, i.e. + // batchedUpdates or flushSync. + return; + } + if (fiber.tag !== FunctionComponent && fiber.tag !== ForwardRef && fiber.tag !== SimpleMemoComponent) { + // For backwards compatibility with pre-hooks code, legacy mode only + // warns for updates that originate from a hook. + return; + } + } + if (ReactCurrentActQueue$1.current === null) { + var previousFiber = current; + try { + setCurrentFiber(fiber); + error("An update to %s inside a test was not wrapped in act(...).\n\n" + "When testing, code that causes React state updates should be " + "wrapped into act(...):\n\n" + "act(() => {\n" + " /* fire events that update state */\n" + "});\n" + "/* assert on the output */\n\n" + "This ensures that you're testing the behavior the user would see " + "in the browser." + " Learn more at https://react.dev/link/wrap-tests-with-act", getComponentNameFromFiber(fiber)); + } finally { + if (previousFiber) { + setCurrentFiber(fiber); + } else { + resetCurrentFiber(); + } + } + } + } + } + function warnIfSuspenseResolutionNotWrappedWithActDEV(root) { + { + if (root.tag !== LegacyRoot && isConcurrentActEnvironment() && ReactCurrentActQueue$1.current === null) { + error("A suspended resource finished loading inside a test, but the event " + "was not wrapped in act(...).\n\n" + "When testing, code that resolves suspended data should be wrapped " + "into act(...):\n\n" + "act(() => {\n" + " /* finish loading suspended data */\n" + "});\n" + "/* assert on the output */\n\n" + "This ensures that you're testing the behavior the user would see " + "in the browser." + " Learn more at https://react.dev/link/wrap-tests-with-act"); + } + } + } + function setIsRunningInsertionEffect(isRunning) { + { + isRunningInsertionEffect = isRunning; + } + } + + /* eslint-disable react-internal/prod-error-codes */ + var resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below. + + var failedBoundaries = null; + var setRefreshHandler = function setRefreshHandler(handler) { + { + resolveFamily = handler; + } + }; + function resolveFunctionForHotReloading(type) { + { + if (resolveFamily === null) { + // Hot reloading is disabled. + return type; + } + var family = resolveFamily(type); + if (family === undefined) { + return type; + } // Use the latest known implementation. + + return family.current; + } + } + function resolveClassForHotReloading(type) { + // No implementation differences. + return resolveFunctionForHotReloading(type); + } + function resolveForwardRefForHotReloading(type) { + { + if (resolveFamily === null) { + // Hot reloading is disabled. + return type; + } + var family = resolveFamily(type); + if (family === undefined) { + // Check if we're dealing with a real forwardRef. Don't want to crash early. + if (type !== null && type !== undefined && typeof type.render === "function") { + // ForwardRef is special because its resolved .type is an object, + // but it's possible that we only have its inner render function in the map. + // If that inner render function is different, we'll build a new forwardRef type. + var currentRender = resolveFunctionForHotReloading(type.render); + if (type.render !== currentRender) { + var syntheticType = { + $$typeof: REACT_FORWARD_REF_TYPE, + render: currentRender + }; + if (type.displayName !== undefined) { + syntheticType.displayName = type.displayName; + } + return syntheticType; + } + } + return type; + } // Use the latest known implementation. + + return family.current; + } + } + function isCompatibleFamilyForHotReloading(fiber, element) { + { + if (resolveFamily === null) { + // Hot reloading is disabled. + return false; + } + var prevType = fiber.elementType; + var nextType = element.type; // If we got here, we know types aren't === equal. + + var needsCompareFamilies = false; + var $$typeofNextType = typeof nextType === "object" && nextType !== null ? nextType.$$typeof : null; + switch (fiber.tag) { + case ClassComponent: + { + if (typeof nextType === "function") { + needsCompareFamilies = true; + } + break; + } + case FunctionComponent: + { + if (typeof nextType === "function") { + needsCompareFamilies = true; + } else if ($$typeofNextType === REACT_LAZY_TYPE) { + // We don't know the inner type yet. + // We're going to assume that the lazy inner type is stable, + // and so it is sufficient to avoid reconciling it away. + // We're not going to unwrap or actually use the new lazy type. + needsCompareFamilies = true; + } + break; + } + case ForwardRef: + { + if ($$typeofNextType === REACT_FORWARD_REF_TYPE) { + needsCompareFamilies = true; + } else if ($$typeofNextType === REACT_LAZY_TYPE) { + needsCompareFamilies = true; + } + break; + } + case MemoComponent: + case SimpleMemoComponent: + { + if ($$typeofNextType === REACT_MEMO_TYPE) { + // TODO: if it was but can no longer be simple, + // we shouldn't set this. + needsCompareFamilies = true; + } else if ($$typeofNextType === REACT_LAZY_TYPE) { + needsCompareFamilies = true; + } + break; + } + default: + return false; + } // Check if both types have a family and it's the same one. + + if (needsCompareFamilies) { + // Note: memo() and forwardRef() we'll compare outer rather than inner type. + // This means both of them need to be registered to preserve state. + // If we unwrapped and compared the inner types for wrappers instead, + // then we would risk falsely saying two separate memo(Foo) + // calls are equivalent because they wrap the same Foo function. + var prevFamily = resolveFamily(prevType); + if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) { + return true; + } + } + return false; + } + } + function markFailedErrorBoundaryForHotReloading(fiber) { + { + if (resolveFamily === null) { + // Hot reloading is disabled. + return; + } + if (typeof WeakSet !== "function") { + return; + } + if (failedBoundaries === null) { + failedBoundaries = new WeakSet(); + } + failedBoundaries.add(fiber); + } + } + var scheduleRefresh = function scheduleRefresh(root, update) { + { + if (resolveFamily === null) { + // Hot reloading is disabled. + return; + } + var staleFamilies = update.staleFamilies, + updatedFamilies = update.updatedFamilies; + flushPassiveEffects(); + flushSync(function () { + scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies); + }); + } + }; + var scheduleRoot = function scheduleRoot(root, element) { + { + if (root.context !== emptyContextObject) { + // Super edge case: root has a legacy _renderSubtree context + // but we don't know the parentComponent so we can't pass it. + // Just ignore. We'll delete this with _renderSubtree code path later. + return; + } + flushPassiveEffects(); + flushSync(function () { + updateContainer(element, root, null, null); + }); + } + }; + function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) { + { + var alternate = fiber.alternate, + child = fiber.child, + sibling = fiber.sibling, + tag = fiber.tag, + type = fiber.type; + var candidateType = null; + switch (tag) { + case FunctionComponent: + case SimpleMemoComponent: + case ClassComponent: + candidateType = type; + break; + case ForwardRef: + candidateType = type.render; + break; + } + if (resolveFamily === null) { + throw new Error("Expected resolveFamily to be set during hot reload."); + } + var needsRender = false; + var needsRemount = false; + if (candidateType !== null) { + var family = resolveFamily(candidateType); + if (family !== undefined) { + if (staleFamilies.has(family)) { + needsRemount = true; + } else if (updatedFamilies.has(family)) { + if (tag === ClassComponent) { + needsRemount = true; + } else { + needsRender = true; + } + } + } + } + if (failedBoundaries !== null) { + if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) { + needsRemount = true; + } + } + if (needsRemount) { + fiber._debugNeedsRemount = true; + } + if (needsRemount || needsRender) { + var _root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (_root !== null) { + scheduleUpdateOnFiber(_root, fiber, SyncLane, NoTimestamp); + } + } + if (child !== null && !needsRemount) { + scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies); + } + if (sibling !== null) { + scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies); + } + } + } + var findHostInstancesForRefresh = function findHostInstancesForRefresh(root, families) { + { + var hostInstances = new Set(); + var types = new Set(families.map(function (family) { + return family.current; + })); + findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances); + return hostInstances; + } + }; + function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) { + { + var child = fiber.child, + sibling = fiber.sibling, + tag = fiber.tag, + type = fiber.type; + var candidateType = null; + switch (tag) { + case FunctionComponent: + case SimpleMemoComponent: + case ClassComponent: + candidateType = type; + break; + case ForwardRef: + candidateType = type.render; + break; + } + var didMatch = false; + if (candidateType !== null) { + if (types.has(candidateType)) { + didMatch = true; + } + } + if (didMatch) { + // We have a match. This only drills down to the closest host components. + // There's no need to search deeper because for the purpose of giving + // visual feedback, "flashing" outermost parent rectangles is sufficient. + findHostInstancesForFiberShallowly(fiber, hostInstances); + } else { + // If there's no match, maybe there will be one further down in the child tree. + if (child !== null) { + findHostInstancesForMatchingFibersRecursively(child, types, hostInstances); + } + } + if (sibling !== null) { + findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances); + } + } + } + function findHostInstancesForFiberShallowly(fiber, hostInstances) { + { + var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances); + if (foundHostInstances) { + return; + } // If we didn't find any host children, fallback to closest host parent. + + var node = fiber; + while (true) { + switch (node.tag) { + case HostComponent: + hostInstances.add(node.stateNode); + return; + case HostPortal: + hostInstances.add(node.stateNode.containerInfo); + return; + case HostRoot: + hostInstances.add(node.stateNode.containerInfo); + return; + } + if (node.return === null) { + throw new Error("Expected to reach root first."); + } + node = node.return; + } + } + } + function findChildHostInstancesForFiberShallowly(fiber, hostInstances) { + { + var node = fiber; + var foundHostInstances = false; + while (true) { + if (node.tag === HostComponent) { + // We got a match. + foundHostInstances = true; + hostInstances.add(node.stateNode); // There may still be more, so keep searching. + } else if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } + if (node === fiber) { + return foundHostInstances; + } + while (node.sibling === null) { + if (node.return === null || node.return === fiber) { + return foundHostInstances; + } + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + } + return false; + } + var hasBadMapPolyfill; + { + hasBadMapPolyfill = false; + try { + var nonExtensibleObject = Object.preventExtensions({}); + /* eslint-disable no-new */ + + new Map([[nonExtensibleObject, null]]); + new Set([nonExtensibleObject]); + /* eslint-enable no-new */ + } catch (e) { + // TODO: Consider warning about bad polyfills + hasBadMapPolyfill = true; + } + } + function FiberNode(tag, pendingProps, key, mode) { + // Instance + this.tag = tag; + this.key = key; + this.elementType = null; + this.type = null; + this.stateNode = null; // Fiber + + this.return = null; + this.child = null; + this.sibling = null; + this.index = 0; + this.ref = null; + this.pendingProps = pendingProps; + this.memoizedProps = null; + this.updateQueue = null; + this.memoizedState = null; + this.dependencies = null; + this.mode = mode; // Effects + + this.flags = NoFlags; + this.subtreeFlags = NoFlags; + this.deletions = null; + this.lanes = NoLanes; + this.childLanes = NoLanes; + this.alternate = null; + { + // Note: The following is done to avoid a v8 performance cliff. + // + // Initializing the fields below to smis and later updating them with + // double values will cause Fibers to end up having separate shapes. + // This behavior/bug has something to do with Object.preventExtension(). + // Fortunately this only impacts DEV builds. + // Unfortunately it makes React unusably slow for some applications. + // To work around this, initialize the fields below with doubles. + // + // Learn more about this here: + // https://github.com/facebook/react/issues/14365 + // https://bugs.chromium.org/p/v8/issues/detail?id=8538 + this.actualDuration = Number.NaN; + this.actualStartTime = Number.NaN; + this.selfBaseDuration = Number.NaN; + this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization. + // This won't trigger the performance cliff mentioned above, + // and it simplifies other profiler code (including DevTools). + + this.actualDuration = 0; + this.actualStartTime = -1; + this.selfBaseDuration = 0; + this.treeBaseDuration = 0; + } + { + // This isn't directly used but is handy for debugging internals: + this._debugSource = null; + this._debugOwner = null; + this._debugNeedsRemount = false; + this._debugHookTypes = null; + if (!hasBadMapPolyfill && typeof Object.preventExtensions === "function") { + Object.preventExtensions(this); + } + } + } // This is a constructor function, rather than a POJO constructor, still + // please ensure we do the following: + // 1) Nobody should add any instance methods on this. Instance methods can be + // more difficult to predict when they get optimized and they are almost + // never inlined properly in static compilers. + // 2) Nobody should rely on `instanceof Fiber` for type testing. We should + // always know when it is a fiber. + // 3) We might want to experiment with using numeric keys since they are easier + // to optimize in a non-JIT environment. + // 4) We can easily go from a constructor to a createFiber object literal if that + // is faster. + // 5) It should be easy to port this to a C struct and keep a C implementation + // compatible. + + var createFiber = function createFiber(tag, pendingProps, key, mode) { + // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors + return new FiberNode(tag, pendingProps, key, mode); + }; + function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); + } + function isSimpleFunctionComponent(type) { + return typeof type === "function" && !shouldConstruct(type) && type.defaultProps === undefined; + } + function resolveLazyComponentTag(Component) { + if (typeof Component === "function") { + return shouldConstruct(Component) ? ClassComponent : FunctionComponent; + } else if (Component !== undefined && Component !== null) { + var $$typeof = Component.$$typeof; + if ($$typeof === REACT_FORWARD_REF_TYPE) { + return ForwardRef; + } + if ($$typeof === REACT_MEMO_TYPE) { + return MemoComponent; + } + } + return IndeterminateComponent; + } // This is used to create an alternate fiber to do work on. + + function createWorkInProgress(current, pendingProps) { + var workInProgress = current.alternate; + if (workInProgress === null) { + // We use a double buffering pooling technique because we know that we'll + // only ever need at most two versions of a tree. We pool the "other" unused + // node that we're free to reuse. This is lazily created to avoid allocating + // extra objects for things that are never updated. It also allow us to + // reclaim the extra memory if needed. + workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode); + workInProgress.elementType = current.elementType; + workInProgress.type = current.type; + workInProgress.stateNode = current.stateNode; + { + // DEV-only fields + workInProgress._debugSource = current._debugSource; + workInProgress._debugOwner = current._debugOwner; + workInProgress._debugHookTypes = current._debugHookTypes; + } + workInProgress.alternate = current; + current.alternate = workInProgress; + } else { + workInProgress.pendingProps = pendingProps; // Needed because Blocks store data on type. + + workInProgress.type = current.type; // We already have an alternate. + // Reset the effect tag. + + workInProgress.flags = NoFlags; // The effects are no longer valid. + + workInProgress.subtreeFlags = NoFlags; + workInProgress.deletions = null; + { + // We intentionally reset, rather than copy, actualDuration & actualStartTime. + // This prevents time from endlessly accumulating in new commits. + // This has the downside of resetting values for different priority renders, + // But works for yielding (the common case) and should support resuming. + workInProgress.actualDuration = 0; + workInProgress.actualStartTime = -1; + } + } // Reset all effects except static ones. + // Static effects are not specific to a render. + + workInProgress.flags = current.flags & StaticMask; + workInProgress.childLanes = current.childLanes; + workInProgress.lanes = current.lanes; + workInProgress.child = current.child; + workInProgress.memoizedProps = current.memoizedProps; + workInProgress.memoizedState = current.memoizedState; + workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so + // it cannot be shared with the current fiber. + + var currentDependencies = current.dependencies; + workInProgress.dependencies = currentDependencies === null ? null : { + lanes: currentDependencies.lanes, + firstContext: currentDependencies.firstContext + }; // These will be overridden during the parent's reconciliation + + workInProgress.sibling = current.sibling; + workInProgress.index = current.index; + workInProgress.ref = current.ref; + { + workInProgress.selfBaseDuration = current.selfBaseDuration; + workInProgress.treeBaseDuration = current.treeBaseDuration; + } + { + workInProgress._debugNeedsRemount = current._debugNeedsRemount; + switch (workInProgress.tag) { + case IndeterminateComponent: + case FunctionComponent: + case SimpleMemoComponent: + workInProgress.type = resolveFunctionForHotReloading(current.type); + break; + case ClassComponent: + workInProgress.type = resolveClassForHotReloading(current.type); + break; + case ForwardRef: + workInProgress.type = resolveForwardRefForHotReloading(current.type); + break; + } + } + return workInProgress; + } // Used to reuse a Fiber for a second pass. + + function resetWorkInProgress(workInProgress, renderLanes) { + // This resets the Fiber to what createFiber or createWorkInProgress would + // have set the values to before during the first pass. Ideally this wouldn't + // be necessary but unfortunately many code paths reads from the workInProgress + // when they should be reading from current and writing to workInProgress. + // We assume pendingProps, index, key, ref, return are still untouched to + // avoid doing another reconciliation. + // Reset the effect flags but keep any Placement tags, since that's something + // that child fiber is setting, not the reconciliation. + workInProgress.flags &= StaticMask | Placement; // The effects are no longer valid. + + var current = workInProgress.alternate; + if (current === null) { + // Reset to createFiber's initial values. + workInProgress.childLanes = NoLanes; + workInProgress.lanes = renderLanes; + workInProgress.child = null; + workInProgress.subtreeFlags = NoFlags; + workInProgress.memoizedProps = null; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.dependencies = null; + workInProgress.stateNode = null; + { + // Note: We don't reset the actualTime counts. It's useful to accumulate + // actual time across multiple render passes. + workInProgress.selfBaseDuration = 0; + workInProgress.treeBaseDuration = 0; + } + } else { + // Reset to the cloned values that createWorkInProgress would've. + workInProgress.childLanes = current.childLanes; + workInProgress.lanes = current.lanes; + workInProgress.child = current.child; + workInProgress.subtreeFlags = NoFlags; + workInProgress.deletions = null; + workInProgress.memoizedProps = current.memoizedProps; + workInProgress.memoizedState = current.memoizedState; + workInProgress.updateQueue = current.updateQueue; // Needed because Blocks store data on type. + + workInProgress.type = current.type; // Clone the dependencies object. This is mutated during the render phase, so + // it cannot be shared with the current fiber. + + var currentDependencies = current.dependencies; + workInProgress.dependencies = currentDependencies === null ? null : { + lanes: currentDependencies.lanes, + firstContext: currentDependencies.firstContext + }; + { + // Note: We don't reset the actualTime counts. It's useful to accumulate + // actual time across multiple render passes. + workInProgress.selfBaseDuration = current.selfBaseDuration; + workInProgress.treeBaseDuration = current.treeBaseDuration; + } + } + return workInProgress; + } + function createHostRootFiber(tag, isStrictMode, concurrentUpdatesByDefaultOverride) { + var mode; + if (tag === ConcurrentRoot) { + mode = ConcurrentMode; + if (isStrictMode === true) { + mode |= StrictLegacyMode; + } + } else { + mode = NoMode; + } + if (isDevToolsPresent) { + // Always collect profile timings when DevTools are present. + // This enables DevTools to start capturing timing at any point– + // Without some nodes in the tree having empty base times. + mode |= ProfileMode; + } + return createFiber(HostRoot, null, null, mode); + } + function createFiberFromTypeAndProps(type, + // React$ElementType + key, pendingProps, owner, mode, lanes) { + var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. + + var resolvedType = type; + if (typeof type === "function") { + if (shouldConstruct(type)) { + fiberTag = ClassComponent; + { + resolvedType = resolveClassForHotReloading(resolvedType); + } + } else { + { + resolvedType = resolveFunctionForHotReloading(resolvedType); + } + } + } else if (typeof type === "string") { + fiberTag = HostComponent; + } else { + getTag: switch (type) { + case REACT_FRAGMENT_TYPE: + return createFiberFromFragment(pendingProps.children, mode, lanes, key); + case REACT_STRICT_MODE_TYPE: + fiberTag = Mode; + mode |= StrictLegacyMode; + break; + case REACT_PROFILER_TYPE: + return createFiberFromProfiler(pendingProps, mode, lanes, key); + case REACT_SUSPENSE_TYPE: + return createFiberFromSuspense(pendingProps, mode, lanes, key); + case REACT_SUSPENSE_LIST_TYPE: + return createFiberFromSuspenseList(pendingProps, mode, lanes, key); + case REACT_OFFSCREEN_TYPE: + return createFiberFromOffscreen(pendingProps, mode, lanes, key); + case REACT_LEGACY_HIDDEN_TYPE: + + // eslint-disable-next-line no-fallthrough + + case REACT_SCOPE_TYPE: + + // eslint-disable-next-line no-fallthrough + + case REACT_CACHE_TYPE: + + // eslint-disable-next-line no-fallthrough + + case REACT_TRACING_MARKER_TYPE: + + // eslint-disable-next-line no-fallthrough + + case REACT_DEBUG_TRACING_MODE_TYPE: + + // eslint-disable-next-line no-fallthrough + + default: + { + if (typeof type === "object" && type !== null) { + switch (type.$$typeof) { + case REACT_PROVIDER_TYPE: + fiberTag = ContextProvider; + break getTag; + case REACT_CONTEXT_TYPE: + // This is a consumer + fiberTag = ContextConsumer; + break getTag; + case REACT_FORWARD_REF_TYPE: + fiberTag = ForwardRef; + { + resolvedType = resolveForwardRefForHotReloading(resolvedType); + } + break getTag; + case REACT_MEMO_TYPE: + fiberTag = MemoComponent; + break getTag; + case REACT_LAZY_TYPE: + fiberTag = LazyComponent; + resolvedType = null; + break getTag; + } + } + var info = ""; + { + if (type === undefined || typeof type === "object" && type !== null && Object.keys(type).length === 0) { + info += " You likely forgot to export your component from the file " + "it's defined in, or you might have mixed up default and " + "named imports."; + } + var ownerName = owner ? getComponentNameFromFiber(owner) : null; + if (ownerName) { + info += "\n\nCheck the render method of `" + ownerName + "`."; + } + } + throw new Error("Element type is invalid: expected a string (for built-in " + "components) or a class/function (for composite components) " + ("but got: " + (type == null ? type : typeof type) + "." + info)); + } + } + } + var fiber = createFiber(fiberTag, pendingProps, key, mode); + fiber.elementType = type; + fiber.type = resolvedType; + fiber.lanes = lanes; + { + fiber._debugOwner = owner; + } + return fiber; + } + function createFiberFromElement(element, mode, lanes) { + var owner = null; + { + owner = element._owner; + } + var type = element.type; + var key = element.key; + var pendingProps = element.props; + var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes); + { + fiber._debugSource = element._source; + fiber._debugOwner = element._owner; + } + return fiber; + } + function createFiberFromFragment(elements, mode, lanes, key) { + var fiber = createFiber(Fragment, elements, key, mode); + fiber.lanes = lanes; + return fiber; + } + function createFiberFromProfiler(pendingProps, mode, lanes, key) { + { + if (typeof pendingProps.id !== "string") { + error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof pendingProps.id); + } + } + var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); + fiber.elementType = REACT_PROFILER_TYPE; + fiber.lanes = lanes; + { + fiber.stateNode = { + effectDuration: 0, + passiveEffectDuration: 0 + }; + } + return fiber; + } + function createFiberFromSuspense(pendingProps, mode, lanes, key) { + var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); + fiber.elementType = REACT_SUSPENSE_TYPE; + fiber.lanes = lanes; + return fiber; + } + function createFiberFromSuspenseList(pendingProps, mode, lanes, key) { + var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode); + fiber.elementType = REACT_SUSPENSE_LIST_TYPE; + fiber.lanes = lanes; + return fiber; + } + function createFiberFromOffscreen(pendingProps, mode, lanes, key) { + var fiber = createFiber(OffscreenComponent, pendingProps, key, mode); + fiber.elementType = REACT_OFFSCREEN_TYPE; + fiber.lanes = lanes; + var primaryChildInstance = { + isHidden: false + }; + fiber.stateNode = primaryChildInstance; + return fiber; + } + function createFiberFromText(content, mode, lanes) { + var fiber = createFiber(HostText, content, null, mode); + fiber.lanes = lanes; + return fiber; + } + function createFiberFromPortal(portal, mode, lanes) { + var pendingProps = portal.children !== null ? portal.children : []; + var fiber = createFiber(HostPortal, pendingProps, portal.key, mode); + fiber.lanes = lanes; + fiber.stateNode = { + containerInfo: portal.containerInfo, + pendingChildren: null, + // Used by persistent updates + implementation: portal.implementation + }; + return fiber; + } // Used for stashing WIP properties to replay failed work in DEV. + + function assignFiberPropertiesInDEV(target, source) { + if (target === null) { + // This Fiber's initial properties will always be overwritten. + // We only use a Fiber to ensure the same hidden class so DEV isn't slow. + target = createFiber(IndeterminateComponent, null, null, NoMode); + } // This is intentionally written as a list of all properties. + // We tried to use Object.assign() instead but this is called in + // the hottest path, and Object.assign() was too slow: + // https://github.com/facebook/react/issues/12502 + // This code is DEV-only so size is not a concern. + + target.tag = source.tag; + target.key = source.key; + target.elementType = source.elementType; + target.type = source.type; + target.stateNode = source.stateNode; + target.return = source.return; + target.child = source.child; + target.sibling = source.sibling; + target.index = source.index; + target.ref = source.ref; + target.pendingProps = source.pendingProps; + target.memoizedProps = source.memoizedProps; + target.updateQueue = source.updateQueue; + target.memoizedState = source.memoizedState; + target.dependencies = source.dependencies; + target.mode = source.mode; + target.flags = source.flags; + target.subtreeFlags = source.subtreeFlags; + target.deletions = source.deletions; + target.lanes = source.lanes; + target.childLanes = source.childLanes; + target.alternate = source.alternate; + { + target.actualDuration = source.actualDuration; + target.actualStartTime = source.actualStartTime; + target.selfBaseDuration = source.selfBaseDuration; + target.treeBaseDuration = source.treeBaseDuration; + } + target._debugSource = source._debugSource; + target._debugOwner = source._debugOwner; + target._debugNeedsRemount = source._debugNeedsRemount; + target._debugHookTypes = source._debugHookTypes; + return target; + } + function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onRecoverableError) { + this.tag = tag; + this.containerInfo = containerInfo; + this.pendingChildren = null; + this.current = null; + this.pingCache = null; + this.finishedWork = null; + this.timeoutHandle = noTimeout; + this.context = null; + this.pendingContext = null; + this.callbackNode = null; + this.callbackPriority = NoLane; + this.eventTimes = createLaneMap(NoLanes); + this.expirationTimes = createLaneMap(NoTimestamp); + this.pendingLanes = NoLanes; + this.suspendedLanes = NoLanes; + this.pingedLanes = NoLanes; + this.expiredLanes = NoLanes; + this.mutableReadLanes = NoLanes; + this.finishedLanes = NoLanes; + this.entangledLanes = NoLanes; + this.entanglements = createLaneMap(NoLanes); + this.identifierPrefix = identifierPrefix; + this.onRecoverableError = onRecoverableError; + { + this.effectDuration = 0; + this.passiveEffectDuration = 0; + } + { + this.memoizedUpdaters = new Set(); + var pendingUpdatersLaneMap = this.pendingUpdatersLaneMap = []; + for (var _i = 0; _i < TotalLanes; _i++) { + pendingUpdatersLaneMap.push(new Set()); + } + } + { + switch (tag) { + case ConcurrentRoot: + this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; + break; + case LegacyRoot: + this._debugRootType = hydrate ? "hydrate()" : "render()"; + break; + } + } + } + function createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, + // TODO: We have several of these arguments that are conceptually part of the + // host config, but because they are passed in at runtime, we have to thread + // them through the root constructor. Perhaps we should put them all into a + // single type, like a DynamicHostConfig that is defined by the renderer. + identifierPrefix, onRecoverableError, transitionCallbacks) { + var root = new FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onRecoverableError); + // stateNode is any. + + var uninitializedFiber = createHostRootFiber(tag, isStrictMode); + root.current = uninitializedFiber; + uninitializedFiber.stateNode = root; + { + var _initialState = { + element: initialChildren, + isDehydrated: hydrate, + cache: null, + // not enabled yet + transitions: null, + pendingSuspenseBoundaries: null + }; + uninitializedFiber.memoizedState = _initialState; + } + initializeUpdateQueue(uninitializedFiber); + return root; + } + var ReactVersion = "18.2.0-next-9e3b772b8-20220608"; + function createPortal(children, containerInfo, + // TODO: figure out the API for cross-renderer implementation. + implementation) { + var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; + { + checkKeyStringCoercion(key); + } + return { + // This tag allow us to uniquely identify this as a React Portal + $$typeof: REACT_PORTAL_TYPE, + key: key == null ? null : "" + key, + children: children, + containerInfo: containerInfo, + implementation: implementation + }; + } + var didWarnAboutNestedUpdates; + var didWarnAboutFindNodeInStrictMode; + { + didWarnAboutNestedUpdates = false; + didWarnAboutFindNodeInStrictMode = {}; + } + function getContextForSubtree(parentComponent) { + if (!parentComponent) { + return emptyContextObject; + } + var fiber = get(parentComponent); + var parentContext = findCurrentUnmaskedContext(fiber); + if (fiber.tag === ClassComponent) { + var Component = fiber.type; + if (isContextProvider(Component)) { + return processChildContext(fiber, Component, parentContext); + } + } + return parentContext; + } + function findHostInstanceWithWarning(component, methodName) { + { + var fiber = get(component); + if (fiber === undefined) { + if (typeof component.render === "function") { + throw new Error("Unable to find node on an unmounted component."); + } else { + var keys = Object.keys(component).join(","); + throw new Error("Argument appears to not be a ReactComponent. Keys: " + keys); + } + } + var hostFiber = findCurrentHostFiber(fiber); + if (hostFiber === null) { + return null; + } + if (hostFiber.mode & StrictLegacyMode) { + var componentName = getComponentNameFromFiber(fiber) || "Component"; + if (!didWarnAboutFindNodeInStrictMode[componentName]) { + didWarnAboutFindNodeInStrictMode[componentName] = true; + var previousFiber = current; + try { + setCurrentFiber(hostFiber); + if (fiber.mode & StrictLegacyMode) { + error("%s is deprecated in StrictMode. " + "%s was passed an instance of %s which is inside StrictMode. " + "Instead, add a ref directly to the element you want to reference. " + "Learn more about using refs safely here: " + "https://react.dev/link/strict-mode-find-node", methodName, methodName, componentName); + } else { + error("%s is deprecated in StrictMode. " + "%s was passed an instance of %s which renders StrictMode children. " + "Instead, add a ref directly to the element you want to reference. " + "Learn more about using refs safely here: " + "https://react.dev/link/strict-mode-find-node", methodName, methodName, componentName); + } + } finally { + // Ideally this should reset to previous but this shouldn't be called in + // render and there's another warning for that anyway. + if (previousFiber) { + setCurrentFiber(previousFiber); + } else { + resetCurrentFiber(); + } + } + } + } + return hostFiber.stateNode; + } + } + function createContainer(containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) { + var hydrate = false; + var initialChildren = null; + return createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError); + } + function updateContainer(element, container, parentComponent, callback) { + { + onScheduleRoot(container, element); + } + var current$1 = container.current; + var eventTime = requestEventTime(); + var lane = requestUpdateLane(current$1); + var context = getContextForSubtree(parentComponent); + if (container.context === null) { + container.context = context; + } else { + container.pendingContext = context; + } + { + if (isRendering && current !== null && !didWarnAboutNestedUpdates) { + didWarnAboutNestedUpdates = true; + error("Render methods should be a pure function of props and state; " + "triggering nested component updates from render is not allowed. " + "If necessary, trigger nested updates in componentDidUpdate.\n\n" + "Check the render method of %s.", getComponentNameFromFiber(current) || "Unknown"); + } + } + var update = createUpdate(eventTime, lane); // Caution: React DevTools currently depends on this property + // being called "element". + + update.payload = { + element: element + }; + callback = callback === undefined ? null : callback; + if (callback !== null) { + { + if (typeof callback !== "function") { + error("render(...): Expected the last optional `callback` argument to be a " + "function. Instead received: %s.", callback); + } + } + update.callback = callback; + } + var root = enqueueUpdate(current$1, update, lane); + if (root !== null) { + scheduleUpdateOnFiber(root, current$1, lane, eventTime); + entangleTransitions(root, current$1, lane); + } + return lane; + } + function getPublicRootInstance(container) { + var containerFiber = container.current; + if (!containerFiber.child) { + return null; + } + switch (containerFiber.child.tag) { + case HostComponent: + return getPublicInstance(containerFiber.child.stateNode); + default: + return containerFiber.child.stateNode; + } + } + var shouldErrorImpl = function shouldErrorImpl(fiber) { + return null; + }; + function shouldError(fiber) { + return shouldErrorImpl(fiber); + } + var shouldSuspendImpl = function shouldSuspendImpl(fiber) { + return false; + }; + function shouldSuspend(fiber) { + return shouldSuspendImpl(fiber); + } + var overrideHookState = null; + var overrideHookStateDeletePath = null; + var overrideHookStateRenamePath = null; + var overrideProps = null; + var overridePropsDeletePath = null; + var overridePropsRenamePath = null; + var scheduleUpdate = null; + var setErrorHandler = null; + var setSuspenseHandler = null; + { + var _copyWithDeleteImpl = function copyWithDeleteImpl(obj, path, index) { + var key = path[index]; + var updated = isArray(obj) ? obj.slice() : assign({}, obj); + if (index + 1 === path.length) { + if (isArray(updated)) { + updated.splice(key, 1); + } else { + delete updated[key]; + } + return updated; + } // $FlowFixMe number or string is fine here + + updated[key] = _copyWithDeleteImpl(obj[key], path, index + 1); + return updated; + }; + var copyWithDelete = function copyWithDelete(obj, path) { + return _copyWithDeleteImpl(obj, path, 0); + }; + var _copyWithRenameImpl = function copyWithRenameImpl(obj, oldPath, newPath, index) { + var oldKey = oldPath[index]; + var updated = isArray(obj) ? obj.slice() : assign({}, obj); + if (index + 1 === oldPath.length) { + var newKey = newPath[index]; // $FlowFixMe number or string is fine here + + updated[newKey] = updated[oldKey]; + if (isArray(updated)) { + updated.splice(oldKey, 1); + } else { + delete updated[oldKey]; + } + } else { + // $FlowFixMe number or string is fine here + updated[oldKey] = _copyWithRenameImpl( + // $FlowFixMe number or string is fine here + obj[oldKey], oldPath, newPath, index + 1); + } + return updated; + }; + var copyWithRename = function copyWithRename(obj, oldPath, newPath) { + if (oldPath.length !== newPath.length) { + warn("copyWithRename() expects paths of the same length"); + return; + } else { + for (var i = 0; i < newPath.length - 1; i++) { + if (oldPath[i] !== newPath[i]) { + warn("copyWithRename() expects paths to be the same except for the deepest key"); + return; + } + } + } + return _copyWithRenameImpl(obj, oldPath, newPath, 0); + }; + var _copyWithSetImpl = function copyWithSetImpl(obj, path, index, value) { + if (index >= path.length) { + return value; + } + var key = path[index]; + var updated = isArray(obj) ? obj.slice() : assign({}, obj); // $FlowFixMe number or string is fine here + + updated[key] = _copyWithSetImpl(obj[key], path, index + 1, value); + return updated; + }; + var copyWithSet = function copyWithSet(obj, path, value) { + return _copyWithSetImpl(obj, path, 0, value); + }; + var findHook = function findHook(fiber, id) { + // For now, the "id" of stateful hooks is just the stateful hook index. + // This may change in the future with e.g. nested hooks. + var currentHook = fiber.memoizedState; + while (currentHook !== null && id > 0) { + currentHook = currentHook.next; + id--; + } + return currentHook; + }; // Support DevTools editable values for useState and useReducer. + + overrideHookState = function overrideHookState(fiber, id, path, value) { + var hook = findHook(fiber, id); + if (hook !== null) { + var newState = copyWithSet(hook.memoizedState, path, value); + hook.memoizedState = newState; + hook.baseState = newState; // We aren't actually adding an update to the queue, + // because there is no update we can add for useReducer hooks that won't trigger an error. + // (There's no appropriate action type for DevTools overrides.) + // As a result though, React will see the scheduled update as a noop and bailout. + // Shallow cloning props works as a workaround for now to bypass the bailout check. + + fiber.memoizedProps = assign({}, fiber.memoizedProps); + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + } + }; + overrideHookStateDeletePath = function overrideHookStateDeletePath(fiber, id, path) { + var hook = findHook(fiber, id); + if (hook !== null) { + var newState = copyWithDelete(hook.memoizedState, path); + hook.memoizedState = newState; + hook.baseState = newState; // We aren't actually adding an update to the queue, + // because there is no update we can add for useReducer hooks that won't trigger an error. + // (There's no appropriate action type for DevTools overrides.) + // As a result though, React will see the scheduled update as a noop and bailout. + // Shallow cloning props works as a workaround for now to bypass the bailout check. + + fiber.memoizedProps = assign({}, fiber.memoizedProps); + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + } + }; + overrideHookStateRenamePath = function overrideHookStateRenamePath(fiber, id, oldPath, newPath) { + var hook = findHook(fiber, id); + if (hook !== null) { + var newState = copyWithRename(hook.memoizedState, oldPath, newPath); + hook.memoizedState = newState; + hook.baseState = newState; // We aren't actually adding an update to the queue, + // because there is no update we can add for useReducer hooks that won't trigger an error. + // (There's no appropriate action type for DevTools overrides.) + // As a result though, React will see the scheduled update as a noop and bailout. + // Shallow cloning props works as a workaround for now to bypass the bailout check. + + fiber.memoizedProps = assign({}, fiber.memoizedProps); + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + } + }; // Support DevTools props for function components, forwardRef, memo, host components, etc. + + overrideProps = function overrideProps(fiber, path, value) { + fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value); + if (fiber.alternate) { + fiber.alternate.pendingProps = fiber.pendingProps; + } + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + }; + overridePropsDeletePath = function overridePropsDeletePath(fiber, path) { + fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path); + if (fiber.alternate) { + fiber.alternate.pendingProps = fiber.pendingProps; + } + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + }; + overridePropsRenamePath = function overridePropsRenamePath(fiber, oldPath, newPath) { + fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath); + if (fiber.alternate) { + fiber.alternate.pendingProps = fiber.pendingProps; + } + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + }; + scheduleUpdate = function scheduleUpdate(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + if (root !== null) { + scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); + } + }; + setErrorHandler = function setErrorHandler(newShouldErrorImpl) { + shouldErrorImpl = newShouldErrorImpl; + }; + setSuspenseHandler = function setSuspenseHandler(newShouldSuspendImpl) { + shouldSuspendImpl = newShouldSuspendImpl; + }; + } + function findHostInstanceByFiber(fiber) { + var hostFiber = findCurrentHostFiber(fiber); + if (hostFiber === null) { + return null; + } + return hostFiber.stateNode; + } + function emptyFindFiberByHostInstance(instance) { + return null; + } + function getCurrentFiberForDevTools() { + return current; + } + function injectIntoDevTools(devToolsConfig) { + var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance; + var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; + return injectInternals({ + bundleType: devToolsConfig.bundleType, + version: devToolsConfig.version, + rendererPackageName: devToolsConfig.rendererPackageName, + rendererConfig: devToolsConfig.rendererConfig, + overrideHookState: overrideHookState, + overrideHookStateDeletePath: overrideHookStateDeletePath, + overrideHookStateRenamePath: overrideHookStateRenamePath, + overrideProps: overrideProps, + overridePropsDeletePath: overridePropsDeletePath, + overridePropsRenamePath: overridePropsRenamePath, + setErrorHandler: setErrorHandler, + setSuspenseHandler: setSuspenseHandler, + scheduleUpdate: scheduleUpdate, + currentDispatcherRef: ReactCurrentDispatcher, + findHostInstanceByFiber: findHostInstanceByFiber, + findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance, + // React Refresh + findHostInstancesForRefresh: findHostInstancesForRefresh, + scheduleRefresh: scheduleRefresh, + scheduleRoot: scheduleRoot, + setRefreshHandler: setRefreshHandler, + // Enables DevTools to append owner stacks to error messages in DEV mode. + getCurrentFiber: getCurrentFiberForDevTools, + // Enables DevTools to detect reconciler version rather than renderer version + // which may not match for third party renderers. + reconcilerVersion: ReactVersion + }); + } + var emptyObject$1 = {}; + { + Object.freeze(emptyObject$1); + } + var createHierarchy; + var getHostNode; + var getHostProps; + var lastNonHostInstance; + var getOwnerHierarchy; + var _traverseOwnerTreeUp; + { + createHierarchy = function createHierarchy(fiberHierarchy) { + return fiberHierarchy.map(function (fiber) { + return { + name: getComponentNameFromType(fiber.type), + getInspectorData: function getInspectorData(findNodeHandle) { + return { + props: getHostProps(fiber), + source: fiber._debugSource, + measure: function measure(callback) { + // If this is Fabric, we'll find a ShadowNode and use that to measure. + var hostFiber = findCurrentHostFiber(fiber); + var shadowNode = hostFiber != null && hostFiber.stateNode !== null && hostFiber.stateNode.node; + if (shadowNode) { + nativeFabricUIManager.measure(shadowNode, callback); + } else { + return ReactNativePrivateInterface.UIManager.measure(getHostNode(fiber, findNodeHandle), callback); + } + } + }; + } + }; + }); + }; + getHostNode = function getHostNode(fiber, findNodeHandle) { + var hostNode; // look for children first for the hostNode + // as composite fibers do not have a hostNode + + while (fiber) { + if (fiber.stateNode !== null && fiber.tag === HostComponent) { + hostNode = findNodeHandle(fiber.stateNode); + } + if (hostNode) { + return hostNode; + } + fiber = fiber.child; + } + return null; + }; + getHostProps = function getHostProps(fiber) { + var host = findCurrentHostFiber(fiber); + if (host) { + return host.memoizedProps || emptyObject$1; + } + return emptyObject$1; + }; + exports.getInspectorDataForInstance = function (closestInstance) { + // Handle case where user clicks outside of ReactNative + if (!closestInstance) { + return { + hierarchy: [], + props: emptyObject$1, + selectedIndex: null, + source: null + }; + } + var fiber = findCurrentFiberUsingSlowPath(closestInstance); + var fiberHierarchy = getOwnerHierarchy(fiber); + var instance = lastNonHostInstance(fiberHierarchy); + var hierarchy = createHierarchy(fiberHierarchy); + var props = getHostProps(instance); + var source = instance._debugSource; + var selectedIndex = fiberHierarchy.indexOf(instance); + return { + hierarchy: hierarchy, + props: props, + selectedIndex: selectedIndex, + source: source + }; + }; + getOwnerHierarchy = function getOwnerHierarchy(instance) { + var hierarchy = []; + _traverseOwnerTreeUp(hierarchy, instance); + return hierarchy; + }; + lastNonHostInstance = function lastNonHostInstance(hierarchy) { + for (var i = hierarchy.length - 1; i > 1; i--) { + var instance = hierarchy[i]; + if (instance.tag !== HostComponent) { + return instance; + } + } + return hierarchy[0]; + }; + _traverseOwnerTreeUp = function traverseOwnerTreeUp(hierarchy, instance) { + if (instance) { + hierarchy.unshift(instance); + _traverseOwnerTreeUp(hierarchy, instance._debugOwner); + } + }; + } + var getInspectorDataForViewTag; + var getInspectorDataForViewAtPoint; + { + getInspectorDataForViewTag = function getInspectorDataForViewTag(viewTag) { + var closestInstance = getInstanceFromTag(viewTag); // Handle case where user clicks outside of ReactNative + + if (!closestInstance) { + return { + hierarchy: [], + props: emptyObject$1, + selectedIndex: null, + source: null + }; + } + var fiber = findCurrentFiberUsingSlowPath(closestInstance); + var fiberHierarchy = getOwnerHierarchy(fiber); + var instance = lastNonHostInstance(fiberHierarchy); + var hierarchy = createHierarchy(fiberHierarchy); + var props = getHostProps(instance); + var source = instance._debugSource; + var selectedIndex = fiberHierarchy.indexOf(instance); + return { + hierarchy: hierarchy, + props: props, + selectedIndex: selectedIndex, + source: source + }; + }; + getInspectorDataForViewAtPoint = function getInspectorDataForViewAtPoint(findNodeHandle, inspectedView, locationX, locationY, callback) { + var closestInstance = null; + if (inspectedView._internalInstanceHandle != null) { + // For Fabric we can look up the instance handle directly and measure it. + nativeFabricUIManager.findNodeAtPoint(inspectedView._internalInstanceHandle.stateNode.node, locationX, locationY, function (internalInstanceHandle) { + if (internalInstanceHandle == null) { + callback(assign({ + pointerY: locationY, + frame: { + left: 0, + top: 0, + width: 0, + height: 0 + } + }, exports.getInspectorDataForInstance(closestInstance))); + } + closestInstance = internalInstanceHandle.stateNode.canonical._internalInstanceHandle; // Note: this is deprecated and we want to remove it ASAP. Keeping it here for React DevTools compatibility for now. + + var nativeViewTag = internalInstanceHandle.stateNode.canonical._nativeTag; + nativeFabricUIManager.measure(internalInstanceHandle.stateNode.node, function (x, y, width, height, pageX, pageY) { + var inspectorData = exports.getInspectorDataForInstance(closestInstance); + callback(assign({}, inspectorData, { + pointerY: locationY, + frame: { + left: pageX, + top: pageY, + width: width, + height: height + }, + touchedViewTag: nativeViewTag + })); + }); + }); + } else if (inspectedView._internalFiberInstanceHandleDEV != null) { + // For Paper we fall back to the old strategy using the React tag. + ReactNativePrivateInterface.UIManager.findSubviewIn(findNodeHandle(inspectedView), [locationX, locationY], function (nativeViewTag, left, top, width, height) { + var inspectorData = exports.getInspectorDataForInstance(getInstanceFromTag(nativeViewTag)); + callback(assign({}, inspectorData, { + pointerY: locationY, + frame: { + left: left, + top: top, + width: width, + height: height + }, + touchedViewTag: nativeViewTag + })); + }); + } else { + error("getInspectorDataForViewAtPoint expects to receive a host component"); + return; + } + }; + } + var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner; + function findHostInstance_DEPRECATED(componentOrHandle) { + { + var owner = ReactCurrentOwner$3.current; + if (owner !== null && owner.stateNode !== null) { + if (!owner.stateNode._warnedAboutRefsInRender) { + error("%s is accessing findNodeHandle inside its render(). " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", getComponentNameFromType(owner.type) || "A component"); + } + owner.stateNode._warnedAboutRefsInRender = true; + } + } + if (componentOrHandle == null) { + return null; + } + if (componentOrHandle._nativeTag) { + return componentOrHandle; + } + if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag) { + return componentOrHandle.canonical; + } + var hostInstance; + { + hostInstance = findHostInstanceWithWarning(componentOrHandle, "findHostInstance_DEPRECATED"); + } + if (hostInstance == null) { + return hostInstance; + } + if (hostInstance.canonical) { + // Fabric + return hostInstance.canonical; + } // $FlowFixMe[incompatible-return] + + return hostInstance; + } + function findNodeHandle(componentOrHandle) { + { + var owner = ReactCurrentOwner$3.current; + if (owner !== null && owner.stateNode !== null) { + if (!owner.stateNode._warnedAboutRefsInRender) { + error("%s is accessing findNodeHandle inside its render(). " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", getComponentNameFromType(owner.type) || "A component"); + } + owner.stateNode._warnedAboutRefsInRender = true; + } + } + if (componentOrHandle == null) { + return null; + } + if (typeof componentOrHandle === "number") { + // Already a node handle + return componentOrHandle; + } + if (componentOrHandle._nativeTag) { + return componentOrHandle._nativeTag; + } + if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag) { + return componentOrHandle.canonical._nativeTag; + } + var hostInstance; + { + hostInstance = findHostInstanceWithWarning(componentOrHandle, "findNodeHandle"); + } + if (hostInstance == null) { + return hostInstance; + } + if (hostInstance.canonical) { + // Fabric + return hostInstance.canonical._nativeTag; + } + return hostInstance._nativeTag; + } + function dispatchCommand(handle, command, args) { + if (handle._nativeTag == null) { + { + error("dispatchCommand was called with a ref that isn't a " + "native component. Use React.forwardRef to get access to the underlying native component"); + } + return; + } + if (handle._internalInstanceHandle != null) { + var stateNode = handle._internalInstanceHandle.stateNode; + if (stateNode != null) { + nativeFabricUIManager.dispatchCommand(stateNode.node, command, args); + } + } else { + ReactNativePrivateInterface.UIManager.dispatchViewManagerCommand(handle._nativeTag, command, args); + } + } + function sendAccessibilityEvent(handle, eventType) { + if (handle._nativeTag == null) { + { + error("sendAccessibilityEvent was called with a ref that isn't a " + "native component. Use React.forwardRef to get access to the underlying native component"); + } + return; + } + if (handle._internalInstanceHandle != null) { + var stateNode = handle._internalInstanceHandle.stateNode; + if (stateNode != null) { + nativeFabricUIManager.sendAccessibilityEvent(stateNode.node, eventType); + } + } else { + ReactNativePrivateInterface.legacySendAccessibilityEvent(handle._nativeTag, eventType); + } + } + function onRecoverableError(error$1) { + // TODO: Expose onRecoverableError option to userspace + // eslint-disable-next-line react-internal/no-production-logging, react-internal/warning-args + error(error$1); + } + function render(element, containerTag, callback) { + var root = roots.get(containerTag); + if (!root) { + // TODO (bvaughn): If we decide to keep the wrapper component, + // We could create a wrapper for containerTag as well to reduce special casing. + root = createContainer(containerTag, LegacyRoot, null, false, null, "", onRecoverableError); + roots.set(containerTag, root); + } + updateContainer(element, root, null, callback); // $FlowIssue Flow has hardcoded values for React DOM that don't work with RN + + return getPublicRootInstance(root); + } + function unmountComponentAtNode(containerTag) { + var root = roots.get(containerTag); + if (root) { + // TODO: Is it safe to reset this now or should I wait since this unmount could be deferred? + updateContainer(null, root, null, function () { + roots.delete(containerTag); + }); + } + } + function unmountComponentAtNodeAndRemoveContainer(containerTag) { + unmountComponentAtNode(containerTag); // Call back into native to remove all of the subviews from this container + + ReactNativePrivateInterface.UIManager.removeRootView(containerTag); + } + function createPortal$1(children, containerTag) { + var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + return createPortal(children, containerTag, null, key); + } + setBatchingImplementation(batchedUpdates$1); + function computeComponentStackForErrorReporting(reactTag) { + var fiber = getInstanceFromTag(reactTag); + if (!fiber) { + return ""; + } + return getStackByFiberInDevAndProd(fiber); + } + var roots = new Map(); + var Internals = { + computeComponentStackForErrorReporting: computeComponentStackForErrorReporting + }; + injectIntoDevTools({ + findFiberByHostInstance: getInstanceFromTag, + bundleType: 1, + version: ReactVersion, + rendererPackageName: "react-native-renderer", + rendererConfig: { + getInspectorDataForViewTag: getInspectorDataForViewTag, + getInspectorDataForViewAtPoint: getInspectorDataForViewAtPoint.bind(null, findNodeHandle) + } + }); + exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; + exports.createPortal = createPortal$1; + exports.dispatchCommand = dispatchCommand; + exports.findHostInstance_DEPRECATED = findHostInstance_DEPRECATED; + exports.findNodeHandle = findNodeHandle; + exports.render = render; + exports.sendAccessibilityEvent = sendAccessibilityEvent; + exports.unmountComponentAtNode = unmountComponentAtNode; + exports.unmountComponentAtNodeAndRemoveContainer = unmountComponentAtNodeAndRemoveContainer; + exports.unstable_batchedUpdates = batchedUpdates; + + /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === 'function') { + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); + } + })(); + } +},438,[65,68,279,439],"node_modules\\react-native\\Libraries\\Renderer\\implementations\\ReactNativeRenderer-dev.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + if (process.env.NODE_ENV === 'production') { + module.exports = _$$_REQUIRE(_dependencyMap[0], "./cjs/scheduler.native.production.min.js"); + } else { + module.exports = _$$_REQUIRE(_dependencyMap[1], "./cjs/scheduler.native.development.js"); + } +},439,[440,441],"node_modules\\scheduler\\index.native.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * @license React + * scheduler.native.production.min.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + 'use strict'; + + function f(a, b) { + var c = a.length; + a.push(b); + a: for (; 0 < c;) { + var d = c - 1 >>> 1, + e = a[d]; + if (0 < g(e, b)) a[d] = b, a[c] = e, c = d;else break a; + } + } + function h(a) { + return 0 === a.length ? null : a[0]; + } + function k(a) { + if (0 === a.length) return null; + var b = a[0], + c = a.pop(); + if (c !== b) { + a[0] = c; + a: for (var d = 0, e = a.length, t = e >>> 1; d < t;) { + var m = 2 * (d + 1) - 1, + E = a[m], + n = m + 1, + A = a[n]; + if (0 > g(E, c)) n < e && 0 > g(A, E) ? (a[d] = A, a[n] = c, d = n) : (a[d] = E, a[m] = c, d = m);else if (n < e && 0 > g(A, c)) a[d] = A, a[n] = c, d = n;else break a; + } + } + return b; + } + function g(a, b) { + var c = a.sortIndex - b.sortIndex; + return 0 !== c ? c : a.id - b.id; + } + var l; + if ("object" === typeof performance && "function" === typeof performance.now) { + var p = performance; + l = function l() { + return p.now(); + }; + } else { + var q = Date, + r = q.now(); + l = function l() { + return q.now() - r; + }; + } + var u = [], + v = [], + w = 1, + x = null, + y = 3, + z = !1, + B = !1, + C = !1, + D = "function" === typeof setTimeout ? setTimeout : null, + F = "function" === typeof clearTimeout ? clearTimeout : null, + G = "undefined" !== typeof setImmediate ? setImmediate : null; + "undefined" !== typeof navigator && void 0 !== navigator.scheduling && void 0 !== navigator.scheduling.isInputPending ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null; + function H(a) { + for (var b = h(v); null !== b;) { + if (null === b.callback) k(v);else if (b.startTime <= a) k(v), b.sortIndex = b.expirationTime, f(u, b);else break; + b = h(v); + } + } + function I(a) { + C = !1; + H(a); + if (!B) if (null !== h(u)) B = !0, J = K, L || (L = !0, M());else { + var b = h(v); + null !== b && N(I, b.startTime - a); + } + } + function K(a, b) { + B = !1; + C && (C = !1, F(O), O = -1); + z = !0; + var c = y; + try { + a: { + H(b); + for (x = h(u); null !== x && (!(x.expirationTime > b) || a && !P());) { + var d = x.callback; + if ("function" === typeof d) { + x.callback = null; + y = x.priorityLevel; + var e = d(x.expirationTime <= b); + b = l(); + if ("function" === typeof e) { + x.callback = e; + H(b); + var t = !0; + break a; + } else x === h(u) && k(u), H(b); + } else k(u); + x = h(u); + } + if (null !== x) t = !0;else { + var m = h(v); + null !== m && N(I, m.startTime - b); + t = !1; + } + } + return t; + } finally { + x = null, y = c, z = !1; + } + } + function Q(a, b, c) { + var d = l(); + "object" === typeof c && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d; + switch (a) { + case 1: + var e = -1; + break; + case 2: + e = 250; + break; + case 5: + e = 1073741823; + break; + case 4: + e = 1E4; + break; + default: + e = 5E3; + } + e = c + e; + a = { + id: w++, + callback: b, + priorityLevel: a, + startTime: c, + expirationTime: e, + sortIndex: -1 + }; + c > d ? (a.sortIndex = c, f(v, a), null === h(u) && a === h(v) && (C ? (F(O), O = -1) : C = !0, N(I, c - d))) : (a.sortIndex = e, f(u, a), B || z || (B = !0, J = K, L || (L = !0, M()))); + return a; + } + function R(a) { + a.callback = null; + } + function S() { + return y; + } + var L = !1, + J = null, + O = -1, + T = -1; + function P() { + return 5 > l() - T ? !1 : !0; + } + function U() {} + function V() { + if (null !== J) { + var a = l(); + T = a; + var b = !0; + try { + b = J(!0, a); + } finally { + b ? M() : (L = !1, J = null); + } + } else L = !1; + } + var M; + if ("function" === typeof G) M = function M() { + G(V); + };else if ("undefined" !== typeof MessageChannel) { + var W = new MessageChannel(), + X = W.port2; + W.port1.onmessage = V; + M = function M() { + X.postMessage(null); + }; + } else M = function M() { + D(V, 0); + }; + function N(a, b) { + O = D(function () { + a(l()); + }, b); + } + var Y = "undefined" !== typeof nativeRuntimeScheduler ? nativeRuntimeScheduler.unstable_UserBlockingPriority : 2, + aa = "undefined" !== typeof nativeRuntimeScheduler ? nativeRuntimeScheduler.unstable_NormalPriority : 3, + ba = "undefined" !== typeof nativeRuntimeScheduler ? nativeRuntimeScheduler.unstable_LowPriority : 4, + ca = "undefined" !== typeof nativeRuntimeScheduler ? nativeRuntimeScheduler.unstable_ImmediatePriority : 1, + da = "undefined" !== typeof nativeRuntimeScheduler ? nativeRuntimeScheduler.unstable_scheduleCallback : Q, + ea = "undefined" !== typeof nativeRuntimeScheduler ? nativeRuntimeScheduler.unstable_cancelCallback : R, + fa = "undefined" !== typeof nativeRuntimeScheduler ? nativeRuntimeScheduler.unstable_getCurrentPriorityLevel : S, + ha = "undefined" !== typeof nativeRuntimeScheduler ? nativeRuntimeScheduler.unstable_shouldYield : P, + ia = "undefined" !== typeof nativeRuntimeScheduler ? nativeRuntimeScheduler.unstable_requestPaint : U, + ja = "undefined" !== typeof nativeRuntimeScheduler ? nativeRuntimeScheduler.unstable_now : l; + function Z() { + throw Error("Not implemented."); + } + exports.unstable_IdlePriority = "undefined" !== typeof nativeRuntimeScheduler ? nativeRuntimeScheduler.unstable_IdlePriority : 5; + exports.unstable_ImmediatePriority = ca; + exports.unstable_LowPriority = ba; + exports.unstable_NormalPriority = aa; + exports.unstable_Profiling = null; + exports.unstable_UserBlockingPriority = Y; + exports.unstable_cancelCallback = ea; + exports.unstable_continueExecution = Z; + exports.unstable_forceFrameRate = Z; + exports.unstable_getCurrentPriorityLevel = fa; + exports.unstable_getFirstCallbackNode = Z; + exports.unstable_next = Z; + exports.unstable_now = ja; + exports.unstable_pauseExecution = Z; + exports.unstable_requestPaint = ia; + exports.unstable_runWithPriority = Z; + exports.unstable_scheduleCallback = da; + exports.unstable_shouldYield = ha; + exports.unstable_wrapCallback = Z; +},440,[],"node_modules\\scheduler\\cjs\\scheduler.native.production.min.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * @license React + * scheduler.native.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + 'use strict'; + + if (process.env.NODE_ENV !== "production") { + (function () { + 'use strict'; + + var enableSchedulerDebugging = false; + var enableProfiling = false; + var frameYieldMs = 5; + function push(heap, node) { + var index = heap.length; + heap.push(node); + siftUp(heap, node, index); + } + function peek(heap) { + return heap.length === 0 ? null : heap[0]; + } + function pop(heap) { + if (heap.length === 0) { + return null; + } + var first = heap[0]; + var last = heap.pop(); + if (last !== first) { + heap[0] = last; + siftDown(heap, last, 0); + } + return first; + } + function siftUp(heap, node, i) { + var index = i; + while (index > 0) { + var parentIndex = index - 1 >>> 1; + var parent = heap[parentIndex]; + if (compare(parent, node) > 0) { + // The parent is larger. Swap positions. + heap[parentIndex] = node; + heap[index] = parent; + index = parentIndex; + } else { + // The parent is smaller. Exit. + return; + } + } + } + function siftDown(heap, node, i) { + var index = i; + var length = heap.length; + var halfLength = length >>> 1; + while (index < halfLength) { + var leftIndex = (index + 1) * 2 - 1; + var left = heap[leftIndex]; + var rightIndex = leftIndex + 1; + var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those. + + if (compare(left, node) < 0) { + if (rightIndex < length && compare(right, left) < 0) { + heap[index] = right; + heap[rightIndex] = node; + index = rightIndex; + } else { + heap[index] = left; + heap[leftIndex] = node; + index = leftIndex; + } + } else if (rightIndex < length && compare(right, node) < 0) { + heap[index] = right; + heap[rightIndex] = node; + index = rightIndex; + } else { + // Neither child is smaller. Exit. + return; + } + } + } + function compare(a, b) { + // Compare sort index first, then task id. + var diff = a.sortIndex - b.sortIndex; + return diff !== 0 ? diff : a.id - b.id; + } + + // TODO: Use symbols? + var ImmediatePriority = 1; + var UserBlockingPriority = 2; + var NormalPriority = 3; + var LowPriority = 4; + var IdlePriority = 5; + function markTaskErrored(task, ms) {} + + /* eslint-disable no-var */ + var getCurrentTime; + var hasPerformanceNow = + // $FlowFixMe[method-unbinding] + typeof performance === 'object' && typeof performance.now === 'function'; + if (hasPerformanceNow) { + var localPerformance = performance; + getCurrentTime = function getCurrentTime() { + return localPerformance.now(); + }; + } else { + var localDate = Date; + var initialTime = localDate.now(); + getCurrentTime = function getCurrentTime() { + return localDate.now() - initialTime; + }; + } // Max 31 bit integer. The max integer size in V8 for 32-bit systems. + // Math.pow(2, 30) - 1 + // 0b111111111111111111111111111111 + + var maxSigned31BitInt = 1073741823; // Times out immediately + + var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out + + var USER_BLOCKING_PRIORITY_TIMEOUT = 250; + var NORMAL_PRIORITY_TIMEOUT = 5000; + var LOW_PRIORITY_TIMEOUT = 10000; // Never times out + + var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap + + var taskQueue = []; + var timerQueue = []; // Incrementing id counter. Used to maintain insertion order. + + var taskIdCounter = 1; // Pausing the scheduler is useful for debugging. + var currentTask = null; + var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrance. + + var isPerformingWork = false; + var isHostCallbackScheduled = false; + var isHostTimeoutScheduled = false; // Capture local references to native APIs, in case a polyfill overrides them. + + var localSetTimeout = typeof setTimeout === 'function' ? setTimeout : null; + var localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : null; + var localSetImmediate = typeof setImmediate !== 'undefined' ? setImmediate : null; // IE and Node.js + jsdom + + typeof navigator !== 'undefined' && + // $FlowFixMe[prop-missing] + navigator.scheduling !== undefined && + // $FlowFixMe[incompatible-type] + navigator.scheduling.isInputPending !== undefined ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null; + function advanceTimers(currentTime) { + // Check for tasks that are no longer delayed and add them to the queue. + var timer = peek(timerQueue); + while (timer !== null) { + if (timer.callback === null) { + // Timer was cancelled. + pop(timerQueue); + } else if (timer.startTime <= currentTime) { + // Timer fired. Transfer to the task queue. + pop(timerQueue); + timer.sortIndex = timer.expirationTime; + push(taskQueue, timer); + } else { + // Remaining timers are pending. + return; + } + timer = peek(timerQueue); + } + } + function handleTimeout(currentTime) { + isHostTimeoutScheduled = false; + advanceTimers(currentTime); + if (!isHostCallbackScheduled) { + if (peek(taskQueue) !== null) { + isHostCallbackScheduled = true; + requestHostCallback(flushWork); + } else { + var firstTimer = peek(timerQueue); + if (firstTimer !== null) { + requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); + } + } + } + } + function flushWork(hasTimeRemaining, initialTime) { + isHostCallbackScheduled = false; + if (isHostTimeoutScheduled) { + // We scheduled a timeout but it's no longer needed. Cancel it. + isHostTimeoutScheduled = false; + cancelHostTimeout(); + } + isPerformingWork = true; + var previousPriorityLevel = currentPriorityLevel; + try { + var currentTime; + if (enableProfiling) ;else { + // No catch in prod code path. + return workLoop(hasTimeRemaining, initialTime); + } + } finally { + currentTask = null; + currentPriorityLevel = previousPriorityLevel; + isPerformingWork = false; + } + } + function workLoop(hasTimeRemaining, initialTime) { + var currentTime = initialTime; + advanceTimers(currentTime); + currentTask = peek(taskQueue); + while (currentTask !== null && !enableSchedulerDebugging) { + if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) { + // This currentTask hasn't expired, and we've reached the deadline. + break; + } // $FlowFixMe[incompatible-use] found when upgrading Flow + + var callback = currentTask.callback; + if (typeof callback === 'function') { + // $FlowFixMe[incompatible-use] found when upgrading Flow + currentTask.callback = null; // $FlowFixMe[incompatible-use] found when upgrading Flow + + currentPriorityLevel = currentTask.priorityLevel; // $FlowFixMe[incompatible-use] found when upgrading Flow + + var didUserCallbackTimeout = currentTask.expirationTime <= currentTime; + var continuationCallback = callback(didUserCallbackTimeout); + currentTime = getCurrentTime(); + if (typeof continuationCallback === 'function') { + // If a continuation is returned, immediately yield to the main thread + // regardless of how much time is left in the current time slice. + // $FlowFixMe[incompatible-use] found when upgrading Flow + currentTask.callback = continuationCallback; + advanceTimers(currentTime); + return true; + } else { + if (currentTask === peek(taskQueue)) { + pop(taskQueue); + } + advanceTimers(currentTime); + } + } else { + pop(taskQueue); + } + currentTask = peek(taskQueue); + } // Return whether there's additional work + + if (currentTask !== null) { + return true; + } else { + var firstTimer = peek(timerQueue); + if (firstTimer !== null) { + requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); + } + return false; + } + } + function unstable_scheduleCallback$1(priorityLevel, callback, options) { + var currentTime = getCurrentTime(); + var startTime; + if (typeof options === 'object' && options !== null) { + var delay = options.delay; + if (typeof delay === 'number' && delay > 0) { + startTime = currentTime + delay; + } else { + startTime = currentTime; + } + } else { + startTime = currentTime; + } + var timeout; + switch (priorityLevel) { + case ImmediatePriority: + timeout = IMMEDIATE_PRIORITY_TIMEOUT; + break; + case UserBlockingPriority: + timeout = USER_BLOCKING_PRIORITY_TIMEOUT; + break; + case IdlePriority: + timeout = IDLE_PRIORITY_TIMEOUT; + break; + case LowPriority: + timeout = LOW_PRIORITY_TIMEOUT; + break; + case NormalPriority: + default: + timeout = NORMAL_PRIORITY_TIMEOUT; + break; + } + var expirationTime = startTime + timeout; + var newTask = { + id: taskIdCounter++, + callback: callback, + priorityLevel: priorityLevel, + startTime: startTime, + expirationTime: expirationTime, + sortIndex: -1 + }; + if (startTime > currentTime) { + // This is a delayed task. + newTask.sortIndex = startTime; + push(timerQueue, newTask); + if (peek(taskQueue) === null && newTask === peek(timerQueue)) { + // All tasks are delayed, and this is the task with the earliest delay. + if (isHostTimeoutScheduled) { + // Cancel an existing timeout. + cancelHostTimeout(); + } else { + isHostTimeoutScheduled = true; + } // Schedule a timeout. + + requestHostTimeout(handleTimeout, startTime - currentTime); + } + } else { + newTask.sortIndex = expirationTime; + push(taskQueue, newTask); + // wait until the next time we yield. + + if (!isHostCallbackScheduled && !isPerformingWork) { + isHostCallbackScheduled = true; + requestHostCallback(flushWork); + } + } + return newTask; + } + function unstable_cancelCallback$1(task) { + // remove from the queue because you can't remove arbitrary nodes from an + // array based heap, only the first one.) + + task.callback = null; + } + function unstable_getCurrentPriorityLevel$1() { + return currentPriorityLevel; + } + var isMessageLoopRunning = false; + var scheduledHostCallback = null; + var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main + // thread, like user events. By default, it yields multiple times per frame. + // It does not attempt to align with frame boundaries, since most tasks don't + // need to be frame aligned; for those that do, use requestAnimationFrame. + + var frameInterval = frameYieldMs; + var startTime = -1; + function shouldYieldToHost() { + var timeElapsed = getCurrentTime() - startTime; + if (timeElapsed < frameInterval) { + // The main thread has only been blocked for a really short amount of time; + // smaller than a single frame. Don't yield yet. + return false; + } // The main thread has been blocked for a non-negligible amount of time. We + + return true; + } + function requestPaint() {} + var performWorkUntilDeadline = function performWorkUntilDeadline() { + if (scheduledHostCallback !== null) { + var currentTime = getCurrentTime(); // Keep track of the start time so we can measure how long the main thread + // has been blocked. + + startTime = currentTime; + var hasTimeRemaining = true; // If a scheduler task throws, exit the current browser task so the + // error can be observed. + // + // Intentionally not using a try-catch, since that makes some debugging + // techniques harder. Instead, if `scheduledHostCallback` errors, then + // `hasMoreWork` will remain true, and we'll continue the work loop. + + var hasMoreWork = true; + try { + // $FlowFixMe[not-a-function] found when upgrading Flow + hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); + } finally { + if (hasMoreWork) { + // If there's more work, schedule the next message event at the end + // of the preceding one. + schedulePerformWorkUntilDeadline(); + } else { + isMessageLoopRunning = false; + scheduledHostCallback = null; + } + } + } else { + isMessageLoopRunning = false; + } // Yielding to the browser will give it a chance to paint, so we can + }; + var schedulePerformWorkUntilDeadline; + if (typeof localSetImmediate === 'function') { + // Node.js and old IE. + // There's a few reasons for why we prefer setImmediate. + // + // Unlike MessageChannel, it doesn't prevent a Node.js process from exiting. + // (Even though this is a DOM fork of the Scheduler, you could get here + // with a mix of Node.js 15+, which has a MessageChannel, and jsdom.) + // https://github.com/facebook/react/issues/20756 + // + // But also, it runs earlier which is the semantic we want. + // If other browsers ever implement it, it's better to use it. + // Although both of these would be inferior to native scheduling. + schedulePerformWorkUntilDeadline = function schedulePerformWorkUntilDeadline() { + localSetImmediate(performWorkUntilDeadline); + }; + } else if (typeof MessageChannel !== 'undefined') { + // DOM and Worker environments. + // We prefer MessageChannel because of the 4ms setTimeout clamping. + var channel = new MessageChannel(); + var port = channel.port2; + channel.port1.onmessage = performWorkUntilDeadline; + schedulePerformWorkUntilDeadline = function schedulePerformWorkUntilDeadline() { + port.postMessage(null); + }; + } else { + // We should only fallback here in non-browser environments. + schedulePerformWorkUntilDeadline = function schedulePerformWorkUntilDeadline() { + // $FlowFixMe[not-a-function] nullable value + localSetTimeout(performWorkUntilDeadline, 0); + }; + } + function requestHostCallback(callback) { + scheduledHostCallback = callback; + if (!isMessageLoopRunning) { + isMessageLoopRunning = true; + schedulePerformWorkUntilDeadline(); + } + } + function requestHostTimeout(callback, ms) { + // $FlowFixMe[not-a-function] nullable value + taskTimeoutID = localSetTimeout(function () { + callback(getCurrentTime()); + }, ms); + } + function cancelHostTimeout() { + // $FlowFixMe[not-a-function] nullable value + localClearTimeout(taskTimeoutID); + taskTimeoutID = -1; + } + + // https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp + + var unstable_UserBlockingPriority = typeof nativeRuntimeScheduler !== 'undefined' ? nativeRuntimeScheduler.unstable_UserBlockingPriority : UserBlockingPriority; + var unstable_NormalPriority = typeof nativeRuntimeScheduler !== 'undefined' ? nativeRuntimeScheduler.unstable_NormalPriority : NormalPriority; + var unstable_IdlePriority = typeof nativeRuntimeScheduler !== 'undefined' ? nativeRuntimeScheduler.unstable_IdlePriority : IdlePriority; + var unstable_LowPriority = typeof nativeRuntimeScheduler !== 'undefined' ? nativeRuntimeScheduler.unstable_LowPriority : LowPriority; + var unstable_ImmediatePriority = typeof nativeRuntimeScheduler !== 'undefined' ? nativeRuntimeScheduler.unstable_ImmediatePriority : ImmediatePriority; + var unstable_scheduleCallback = typeof nativeRuntimeScheduler !== 'undefined' ? nativeRuntimeScheduler.unstable_scheduleCallback : unstable_scheduleCallback$1; + var unstable_cancelCallback = typeof nativeRuntimeScheduler !== 'undefined' ? nativeRuntimeScheduler.unstable_cancelCallback : unstable_cancelCallback$1; + var unstable_getCurrentPriorityLevel = typeof nativeRuntimeScheduler !== 'undefined' ? nativeRuntimeScheduler.unstable_getCurrentPriorityLevel : unstable_getCurrentPriorityLevel$1; + var unstable_shouldYield = typeof nativeRuntimeScheduler !== 'undefined' ? nativeRuntimeScheduler.unstable_shouldYield : shouldYieldToHost; + var unstable_requestPaint = typeof nativeRuntimeScheduler !== 'undefined' ? nativeRuntimeScheduler.unstable_requestPaint : requestPaint; + var unstable_now = typeof nativeRuntimeScheduler !== 'undefined' ? nativeRuntimeScheduler.unstable_now : getCurrentTime; // These were never implemented on the native scheduler because React never calls them. + // For consistency, let's disable them altogether and make them throw. + + var unstable_next = throwNotImplemented; + var unstable_runWithPriority = throwNotImplemented; + var unstable_wrapCallback = throwNotImplemented; + var unstable_continueExecution = throwNotImplemented; + var unstable_pauseExecution = throwNotImplemented; + var unstable_getFirstCallbackNode = throwNotImplemented; + var unstable_forceFrameRate = throwNotImplemented; + var unstable_Profiling = null; + function throwNotImplemented() { + throw Error('Not implemented.'); + } // Flow magic to verify the exports of this file match the original version. + + exports.unstable_IdlePriority = unstable_IdlePriority; + exports.unstable_ImmediatePriority = unstable_ImmediatePriority; + exports.unstable_LowPriority = unstable_LowPriority; + exports.unstable_NormalPriority = unstable_NormalPriority; + exports.unstable_Profiling = unstable_Profiling; + exports.unstable_UserBlockingPriority = unstable_UserBlockingPriority; + exports.unstable_cancelCallback = unstable_cancelCallback; + exports.unstable_continueExecution = unstable_continueExecution; + exports.unstable_forceFrameRate = unstable_forceFrameRate; + exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel; + exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode; + exports.unstable_next = unstable_next; + exports.unstable_now = unstable_now; + exports.unstable_pauseExecution = unstable_pauseExecution; + exports.unstable_requestPaint = unstable_requestPaint; + exports.unstable_runWithPriority = unstable_runWithPriority; + exports.unstable_scheduleCallback = unstable_scheduleCallback; + exports.unstable_shouldYield = unstable_shouldYield; + exports.unstable_wrapCallback = unstable_wrapCallback; + })(); + } +},441,[],"node_modules\\scheduler\\cjs\\scheduler.native.development.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * 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. + * + * + * @nolint + * @providesModule ReactNativeRenderer-prod + * @preventMunge + * @generated SignedSource<<07cf699c0d1c149943b7a02432aa1550>> + */ + + "use strict"; + + _$$_REQUIRE(_dependencyMap[0], "react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore"); + var React = _$$_REQUIRE(_dependencyMap[1], "react"); + 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 onError(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 isArrayImpl = Array.isArray, + 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 (isArrayImpl(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; + } + var assign = Object.assign; + 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; + } + assign(SyntheticEvent.prototype, { + preventDefault: function preventDefault() { + this.defaultPrevented = !0; + var event = this.nativeEvent; + event && (event.preventDefault ? event.preventDefault() : "unknown" !== typeof event.returnValue && (event.returnValue = !1), this.isDefaultPrevented = functionThatReturnsTrue); + }, + stopPropagation: function stopPropagation() { + var event = this.nativeEvent; + event && (event.stopPropagation ? event.stopPropagation() : "unknown" !== typeof event.cancelBubble && (event.cancelBubble = !0), this.isPropagationStopped = functionThatReturnsTrue); + }, + persist: function persist() { + this.isPersistent = functionThatReturnsTrue; + }, + isPersistent: functionThatReturnsFalse, + destructor: function destructor() { + 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 currentTarget() { + return null; + }, + eventPhase: null, + bubbles: null, + cancelable: null, + timeStamp: function timeStamp(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(); + assign(prototype, Class.prototype); + Class.prototype = prototype; + Class.prototype.constructor = Class; + Class.Interface = 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 touchHistory() { + 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 instrumentationCallback, + ResponderTouchHistoryStore = { + instrument: function instrument(callback) { + instrumentationCallback = callback; + }, + recordTouchTrack: function recordTouchTrack(topLevelType, nativeEvent) { + null != instrumentationCallback && instrumentationCallback(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 : isArrayImpl(current) ? current.concat(next) : isArrayImpl(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 (isArrayImpl(current)) { + if (isArrayImpl(next)) return current.push.apply(current, next), current; + current.push(next); + return current; + } + return isArrayImpl(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 _getResponder() { + return responderInst; + }, + eventTypes: eventTypes, + extractEvents: function extractEvents(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 (isArrayImpl(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 injectGlobalResponderHandler(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 getListeners(inst, registrationName, phase, dispatchToImperativeListeners) { + var stateNode = inst.stateNode; + if (null === stateNode) return null; + inst = getFiberCurrentPropsFromNode(stateNode); + 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."); + if (!(dispatchToImperativeListeners && stateNode.canonical && stateNode.canonical._eventListeners)) return inst; + var listeners = []; + inst && listeners.push(inst); + var requestedPhaseIsCapture = "captured" === phase, + mangledImperativeRegistrationName = requestedPhaseIsCapture ? "rn:" + registrationName.replace(/Capture$/, "") : "rn:" + registrationName; + stateNode.canonical._eventListeners[mangledImperativeRegistrationName] && 0 < stateNode.canonical._eventListeners[mangledImperativeRegistrationName].length && stateNode.canonical._eventListeners[mangledImperativeRegistrationName].forEach(function (listenerObj) { + if ((null != listenerObj.options.capture && listenerObj.options.capture) === requestedPhaseIsCapture) { + var listenerFnWrapper = function listenerFnWrapper(syntheticEvent) { + var eventInst = new (_$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").CustomEvent)(mangledImperativeRegistrationName, { + detail: syntheticEvent.nativeEvent + }); + eventInst.isTrusted = !0; + eventInst.setSyntheticEvent(syntheticEvent); + for (var _len = arguments.length, args = Array(1 < _len ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key]; + listenerObj.listener.apply(listenerObj, [eventInst].concat(args)); + }; + listenerObj.options.once ? listeners.push(function () { + stateNode.canonical.removeEventListener_unstable(mangledImperativeRegistrationName, listenerObj.listener, listenerObj.capture); + listenerObj.invalidated || (listenerObj.invalidated = !0, listenerObj.listener.apply(listenerObj, arguments)); + }) : listeners.push(listenerFnWrapper); + } + }); + return 0 === listeners.length ? null : 1 === listeners.length ? listeners[0] : listeners; + } + var customBubblingEventTypes = _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").ReactNativeViewConfigRegistry.customBubblingEventTypes, + customDirectEventTypes = _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").ReactNativeViewConfigRegistry.customDirectEventTypes; + function accumulateListenersAndInstances(inst, event, listeners) { + var listenersLength = listeners ? isArrayImpl(listeners) ? listeners.length : 1 : 0; + if (0 < listenersLength) if (event._dispatchListeners = accumulateInto(event._dispatchListeners, listeners), null == event._dispatchInstances && 1 === listenersLength) event._dispatchInstances = inst;else for (event._dispatchInstances = event._dispatchInstances || [], isArrayImpl(event._dispatchInstances) || (event._dispatchInstances = [event._dispatchInstances]), listeners = 0; listeners < listenersLength; listeners++) event._dispatchInstances.push(inst); + } + function accumulateDirectionalDispatches$1(inst, phase, event) { + phase = getListeners(inst, event.dispatchConfig.phasedRegistrationNames[phase], phase, !0); + accumulateListenersAndInstances(inst, event, phase); + } + function traverseTwoPhase$1(inst, fn, arg, skipBubbling) { + for (var path = []; inst;) { + path.push(inst); + do inst = inst.return; while (inst && 5 !== inst.tag); + inst = inst ? inst : null; + } + for (inst = path.length; 0 < inst--;) fn(path[inst], "captured", arg); + if (skipBubbling) fn(path[0], "bubbled", arg);else for (inst = 0; inst < path.length; inst++) fn(path[inst], "bubbled", arg); + } + function accumulateTwoPhaseDispatchesSingle$1(event) { + event && event.dispatchConfig.phasedRegistrationNames && traverseTwoPhase$1(event._targetInst, accumulateDirectionalDispatches$1, event, !1); + } + function accumulateDirectDispatchesSingle$1(event) { + if (event && event.dispatchConfig.registrationName) { + var inst = event._targetInst; + if (inst && event && event.dispatchConfig.registrationName) { + var listeners = getListeners(inst, event.dispatchConfig.registrationName, "bubbled", !1); + accumulateListenersAndInstances(inst, event, listeners); + } + } + } + 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_229 = { + ResponderEventPlugin: ResponderEventPlugin, + ReactNativeBridgeEventPlugin: { + eventTypes: {}, + extractEvents: function extractEvents(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) null != topLevelType && null != topLevelType.dispatchConfig.phasedRegistrationNames && topLevelType.dispatchConfig.phasedRegistrationNames.skipBubbling ? topLevelType && topLevelType.dispatchConfig.phasedRegistrationNames && traverseTwoPhase$1(topLevelType._targetInst, accumulateDirectionalDispatches$1, topLevelType, !0) : forEachAccumulated(topLevelType, accumulateTwoPhaseDispatchesSingle$1);else if (directDispatchConfig) forEachAccumulated(topLevelType, accumulateDirectDispatchesSingle$1);else return null; + return topLevelType; + } + } + }, + isOrderingDirty$jscomp$inline_230 = !1, + pluginName$jscomp$inline_231; + for (pluginName$jscomp$inline_231 in injectedNamesToPlugins$jscomp$inline_229) if (injectedNamesToPlugins$jscomp$inline_229.hasOwnProperty(pluginName$jscomp$inline_231)) { + var pluginModule$jscomp$inline_232 = injectedNamesToPlugins$jscomp$inline_229[pluginName$jscomp$inline_231]; + if (!namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_231) || namesToPlugins[pluginName$jscomp$inline_231] !== pluginModule$jscomp$inline_232) { + if (namesToPlugins[pluginName$jscomp$inline_231]) throw Error("EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + (pluginName$jscomp$inline_231 + "`.")); + namesToPlugins[pluginName$jscomp$inline_231] = pluginModule$jscomp$inline_232; + isOrderingDirty$jscomp$inline_230 = !0; + } + } + isOrderingDirty$jscomp$inline_230 && 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 (isArrayImpl(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; + } + }); + } + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").RCTEventEmitter.register({ + receiveEvent: function receiveEvent(rootNodeID, topLevelType, nativeEventParam) { + _receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam); + }, + receiveTouches: function receiveTouches(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 getFiberCurrentPropsFromNode(stateNode) { + return instanceProps.get(stateNode._nativeTag) || null; + }; + getInstanceFromNode = getInstanceFromTag; + getNodeFromInstance = function getNodeFromInstance(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 onChange(from, to, blockNativeResponder) { + null !== to ? _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.setJSResponder(to.stateNode._nativeTag, blockNativeResponder) : _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.clearJSResponder(); + } + }); + var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, + REACT_ELEMENT_TYPE = Symbol.for("react.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_PROVIDER_TYPE = Symbol.for("react.provider"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"); + Symbol.for("react.scope"); + Symbol.for("react.debug_trace_mode"); + var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); + Symbol.for("react.legacy_hidden"); + Symbol.for("react.cache"); + Symbol.for("react.tracing_marker"); + var MAYBE_ITERATOR_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 getComponentNameFromType(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"; + } + 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; + type = type.displayName; + type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"); + return type; + case REACT_MEMO_TYPE: + return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo"; + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; + } + function getComponentNameFromFiber(fiber) { + var type = fiber.type; + switch (fiber.tag) { + case 24: + return "Cache"; + case 9: + return (type.displayName || "Context") + ".Consumer"; + case 10: + return (type._context.displayName || "Context") + ".Provider"; + case 18: + return "DehydratedFragment"; + case 11: + return fiber = type.render, fiber = fiber.displayName || fiber.name || "", type.displayName || ("" !== fiber ? "ForwardRef(" + fiber + ")" : "ForwardRef"); + case 7: + return "Fragment"; + case 5: + return type; + case 4: + return "Portal"; + case 3: + return "Root"; + case 6: + return "Text"; + case 16: + return getComponentNameFromType(type); + case 8: + return type === REACT_STRICT_MODE_TYPE ? "StrictMode" : "Mode"; + case 22: + return "Offscreen"; + case 12: + return "Profiler"; + case 21: + return "Scope"; + case 13: + return "Suspense"; + case 19: + return "SuspenseList"; + case 25: + return "TracingMarker"; + case 1: + case 0: + case 17: + case 2: + case 14: + case 15: + if ("function" === typeof type) return type.displayName || type.name || null; + if ("string" === typeof type) return type; + } + 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 & 4098) && (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; + } + var emptyObject = {}, + removedKeys = null, + removedKeyCount = 0, + deepDifferOptions = { + unsafelyIgnoreFunctions: !0 + }; + function defaultDiffer(prevProp, nextProp) { + return "object" !== typeof nextProp || null === nextProp ? !0 : _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").deepDiffer(prevProp, nextProp, deepDifferOptions); + } + function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) { + if (isArrayImpl(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 (!isArrayImpl(prevProp) && !isArrayImpl(nextProp)) return diffProperties(updatePayload, prevProp, nextProp, validAttributes); + if (isArrayImpl(prevProp) && isArrayImpl(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 isArrayImpl(prevProp) ? diffProperties(updatePayload, _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").flattenStyle(prevProp), nextProp, validAttributes) : diffProperties(updatePayload, prevProp, _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").flattenStyle(nextProp), validAttributes); + } + function addNestedProperty(updatePayload, nextProp, validAttributes) { + if (!nextProp) return updatePayload; + if (!isArrayImpl(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 (!isArrayImpl(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 () { + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").TextInputState.blurTextInput(this); + }; + _proto.focus = function () { + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").TextInputState.focusTextInput(this); + }; + _proto.measure = function (callback) { + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.measure(this._nativeTag, mountSafeCallback_NOT_REALLY_SAFE(this, callback)); + }; + _proto.measureInWindow = function (callback) { + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/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 && _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/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 && _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.updateView(this._nativeTag, this.viewConfig.uiViewClassName, nativeProps); + }; + return ReactNativeFiberHostComponent; + }(), + rendererID = null, + injectedHook = null; + function onCommitRoot(root) { + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) try { + injectedHook.onCommitFiberRoot(rendererID, root, void 0, 128 === (root.current.flags & 128)); + } catch (err) {} + } + var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, + log = Math.log, + LN2 = Math.LN2; + function clz32Fallback(x) { + x >>>= 0; + return 0 === x ? 32 : 31 - (log(x) / LN2 | 0) | 0; + } + var nextTransitionLane = 64, + nextRetryLane = 4194304; + function getHighestPriorityLanes(lanes) { + switch (lanes & -lanes) { + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return lanes & 4194240; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return lanes & 130023424; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: + return 1073741824; + default: + return lanes; + } + } + function getNextLanes(root, wipLanes) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) return 0; + var nextLanes = 0, + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes, + nonIdlePendingLanes = pendingLanes & 268435455; + if (0 !== nonIdlePendingLanes) { + var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes; + 0 !== nonIdleUnblockedLanes ? nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes) : (pingedLanes &= nonIdlePendingLanes, 0 !== pingedLanes && (nextLanes = getHighestPriorityLanes(pingedLanes))); + } else nonIdlePendingLanes = pendingLanes & ~suspendedLanes, 0 !== nonIdlePendingLanes ? nextLanes = getHighestPriorityLanes(nonIdlePendingLanes) : 0 !== pingedLanes && (nextLanes = getHighestPriorityLanes(pingedLanes)); + if (0 === nextLanes) return 0; + if (0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && (suspendedLanes = nextLanes & -nextLanes, pingedLanes = wipLanes & -wipLanes, suspendedLanes >= pingedLanes || 16 === suspendedLanes && 0 !== (pingedLanes & 4194240))) return wipLanes; + 0 !== (nextLanes & 4) && (nextLanes |= pendingLanes & 16); + wipLanes = root.entangledLanes; + if (0 !== wipLanes) for (root = root.entanglements, wipLanes &= nextLanes; 0 < wipLanes;) pendingLanes = 31 - clz32(wipLanes), suspendedLanes = 1 << pendingLanes, nextLanes |= root[pendingLanes], wipLanes &= ~suspendedLanes; + return nextLanes; + } + function computeExpirationTime(lane, currentTime) { + switch (lane) { + case 1: + case 2: + case 4: + return currentTime + 250; + case 8: + case 16: + case 32: + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return currentTime + 5e3; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return -1; + case 134217728: + case 268435456: + case 536870912: + case 1073741824: + return -1; + default: + return -1; + } + } + function getLanesToRetrySynchronouslyOnError(root) { + root = root.pendingLanes & -1073741825; + return 0 !== root ? root : root & 1073741824 ? 1073741824 : 0; + } + function claimNextTransitionLane() { + var lane = nextTransitionLane; + nextTransitionLane <<= 1; + 0 === (nextTransitionLane & 4194240) && (nextTransitionLane = 64); + return lane; + } + 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 currentUpdatePriority = 0; + function lanesToEventPriority(lanes) { + lanes &= -lanes; + return 1 < lanes ? 4 < lanes ? 0 !== (lanes & 268435455) ? 16 : 536870912 : 4 : 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 = _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/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; + }); + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/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 hasOwnProperty = Object.prototype.hasOwnProperty, + 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; + type = type.childContextTypes; + if ("function" !== typeof instance.getChildContext) return parentContext; + instance = instance.getChildContext(); + for (var contextKey in instance) if (!(contextKey in type)) throw Error((getComponentNameFromFiber(fiber) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.'); + return 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); + } + 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, + syncQueue = null, + includesLegacySyncCallbacks = !1, + isFlushingSyncQueue = !1; + function flushSyncCallbacks() { + if (!isFlushingSyncQueue && null !== syncQueue) { + isFlushingSyncQueue = !0; + var i = 0, + previousUpdatePriority = currentUpdatePriority; + try { + var queue = syncQueue; + for (currentUpdatePriority = 1; i < queue.length; i++) { + var callback = queue[i]; + do callback = callback(!0); while (null !== callback); + } + syncQueue = null; + includesLegacySyncCallbacks = !1; + } catch (error) { + throw null !== syncQueue && (syncQueue = syncQueue.slice(i + 1)), _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_scheduleCallback(_$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_ImmediatePriority, flushSyncCallbacks), error; + } finally { + currentUpdatePriority = previousUpdatePriority, isFlushingSyncQueue = !1; + } + } + return null; + } + var forkStack = [], + forkStackIndex = 0, + treeForkProvider = null, + idStack = [], + idStackIndex = 0, + treeContextProvider = null; + function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider;) treeForkProvider = forkStack[--forkStackIndex], forkStack[forkStackIndex] = null, --forkStackIndex, forkStack[forkStackIndex] = null; + for (; workInProgress === treeContextProvider;) treeContextProvider = idStack[--idStackIndex], idStack[idStackIndex] = null, --idStackIndex, idStack[idStackIndex] = null, --idStackIndex, idStack[idStackIndex] = null; + } + var hydrationErrors = null, + ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; + 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++) { + var currentKey = keysA[keysB]; + if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey])) 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 = 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, + lastFullyObservedContext = null; + function resetContextDependencies() { + lastFullyObservedContext = lastContextDependency = currentlyRenderingFiber = null; + } + function popProvider(context) { + var currentValue = valueCursor.current; + pop(valueCursor); + context._currentValue = currentValue; + } + function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { + for (; null !== parent;) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes ? (parent.childLanes |= renderLanes, null !== alternate && (alternate.childLanes |= renderLanes)) : null !== alternate && (alternate.childLanes & renderLanes) !== renderLanes && (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; + } + } + function prepareToReadContext(workInProgress, renderLanes) { + currentlyRenderingFiber = workInProgress; + lastFullyObservedContext = lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && null !== workInProgress.firstContext && (0 !== (workInProgress.lanes & renderLanes) && (didReceiveUpdate = !0), workInProgress.firstContext = null); + } + function readContext(context) { + var value = context._currentValue; + if (lastFullyObservedContext !== context) if (context = { + context: context, + memoizedValue: value, + next: null + }, 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 = context; + currentlyRenderingFiber.dependencies = { + lanes: 0, + firstContext: context + }; + } else lastContextDependency = lastContextDependency.next = context; + return value; + } + var concurrentQueues = null; + function pushConcurrentUpdateQueue(queue) { + null === concurrentQueues ? concurrentQueues = [queue] : concurrentQueues.push(queue); + } + function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { + var interleaved = queue.interleaved; + null === interleaved ? (update.next = update, pushConcurrentUpdateQueue(queue)) : (update.next = interleaved.next, interleaved.next = update); + queue.interleaved = update; + return markUpdateLaneFromFiberToRoot(fiber, lane); + } + 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; + } + var 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, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if (0 !== (executionContext & 2)) { + var pending = updateQueue.pending; + null === pending ? update.next = update : (update.next = pending.next, pending.next = update); + updateQueue.pending = update; + return markUpdateLaneFromFiberToRoot(fiber, lane); + } + pending = updateQueue.interleaved; + null === pending ? (update.next = update, pushConcurrentUpdateQueue(updateQueue)) : (update.next = pending.next, pending.next = update); + updateQueue.interleaved = update; + return markUpdateLaneFromFiberToRoot(fiber, lane); + } + function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && (fiber = fiber.shared, 0 !== (lane & 4194240))) { + 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 & -65537 | 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 = assign({}, newState, updateLane); + break a; + case 2: + hasForceUpdate = !0; + } + } + null !== pendingQueue.callback && 0 !== pendingQueue.lane && (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 : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && (workInProgress.updateQueue.baseState = getDerivedStateFromProps); + } + var classComponentUpdater = { + isMounted: function isMounted(component) { + return (component = component._reactInternals) ? getNearestMountedFiber(component) === component : !1; + }, + enqueueSetState: function enqueueSetState(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); + payload = enqueueUpdate(inst, update, lane); + null !== payload && (scheduleUpdateOnFiber(payload, inst, lane, eventTime), entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function enqueueReplaceState(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); + payload = enqueueUpdate(inst, update, lane); + null !== payload && (scheduleUpdateOnFiber(payload, inst, lane, eventTime), entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function enqueueForceUpdate(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); + callback = enqueueUpdate(inst, update, lane); + null !== callback && (scheduleUpdateOnFiber(callback, inst, lane, eventTime), 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)); + 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); + } + 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://react.dev/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 resolvedInst = inst, + stringRef = "" + returnFiber; + if (null !== current && null !== current.ref && "function" === typeof current.ref && current.ref._stringRef === stringRef) return current.ref; + current = function current(value) { + var refs = resolvedInst.refs; + refs === emptyRefsObject && (refs = resolvedInst.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://react.dev/link/refs-must-have-owner for more information."); + } + return returnFiber; + } + function throwOnInvalidObjectType(returnFiber, newChild) { + returnFiber = Object.prototype.toString.call(newChild); + throw Error("Objects are not valid as a React child (found: " + ("[object Object]" === returnFiber ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : returnFiber) + "). If you meant to render a collection of children, use an array instead."); + } + function resolveLazy(lazyType) { + var init = lazyType._init; + return init(lazyType._payload); + } + 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 newFiber.flags |= 1048576, 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 || "object" === typeof elementType && null !== elementType && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current.type)) 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 && "" !== 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; + case REACT_LAZY_TYPE: + var init = newChild._init; + return createChild(returnFiber, init(newChild._payload), lanes); + } + if (isArrayImpl(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 && "" !== 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; + case REACT_LAZY_TYPE: + return key = newChild._init, updateSlot(returnFiber, oldFiber, key(newChild._payload), lanes); + } + if (isArrayImpl(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 && "" !== 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); + case REACT_LAZY_TYPE: + var init = newChild._init; + return updateFromMap(existingChildren, returnFiber, newIdx, init(newChild._payload), lanes); + } + if (isArrayImpl(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; + } + function reconcileChildFibers(returnFiber, currentFirstChild, newChild, lanes) { + "object" === typeof newChild && null !== newChild && newChild.type === REACT_FRAGMENT_TYPE && null === newChild.key && (newChild = newChild.props.children); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + a: { + for (var key = newChild.key, child = currentFirstChild; null !== child;) { + if (child.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === child.tag) { + deleteRemainingChildren(returnFiber, child.sibling); + currentFirstChild = useFiber(child, newChild.props.children); + currentFirstChild.return = returnFiber; + returnFiber = currentFirstChild; + break a; + } + } else if (child.elementType === key || "object" === typeof key && null !== key && key.$$typeof === REACT_LAZY_TYPE && resolveLazy(key) === child.type) { + deleteRemainingChildren(returnFiber, child.sibling); + currentFirstChild = useFiber(child, newChild.props); + currentFirstChild.ref = coerceRef(returnFiber, child, newChild); + currentFirstChild.return = returnFiber; + returnFiber = currentFirstChild; + break a; + } + deleteRemainingChildren(returnFiber, child); + break; + } else deleteChild(returnFiber, child); + child = child.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 (child = newChild.key; null !== currentFirstChild;) { + if (currentFirstChild.key === child) { + 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); + case REACT_LAZY_TYPE: + return child = newChild._init, reconcileChildFibers(returnFiber, currentFirstChild, child(newChild._payload), lanes); + } + if (isArrayImpl(newChild)) return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes); + if (getIteratorFn(newChild)) return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes); + throwOnInvalidObjectType(returnFiber, newChild); + } + return "string" === typeof newChild && "" !== newChild || "number" === typeof newChild ? (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)) : deleteRemainingChildren(returnFiber, currentFirstChild); + } + return reconcileChildFibers; + } + 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, + globalClientIdCounter = 0; + function throwInvalidHookError() { + throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."); + } + function 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, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), current = update.hasEagerState ? update.eagerState : reducer(current, update.action);else { + var clone = { + lane: updateLane, + action: update.action, + hasEagerState: update.hasEagerState, + 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 updateMutableSource() {} + function updateSyncExternalStore(subscribe, getSnapshot) { + var fiber = currentlyRenderingFiber$1, + hook = updateWorkInProgressHook(), + nextSnapshot = getSnapshot(), + snapshotChanged = !objectIs(hook.memoizedState, nextSnapshot); + snapshotChanged && (hook.memoizedState = nextSnapshot, didReceiveUpdate = !0); + hook = hook.queue; + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [subscribe]); + if (hook.getSnapshot !== getSnapshot || snapshotChanged || null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) { + fiber.flags |= 2048; + pushEffect(9, updateStoreInstance.bind(null, fiber, hook, nextSnapshot, getSnapshot), void 0, null); + if (null === workInProgressRoot) throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue."); + 0 !== (renderLanes & 30) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + } + return nextSnapshot; + } + function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { + getSnapshot: getSnapshot, + value: renderedSnapshot + }; + getSnapshot = currentlyRenderingFiber$1.updateQueue; + null === getSnapshot ? (getSnapshot = { + lastEffect: null, + stores: null + }, currentlyRenderingFiber$1.updateQueue = getSnapshot, getSnapshot.stores = [fiber]) : (renderedSnapshot = getSnapshot.stores, null === renderedSnapshot ? getSnapshot.stores = [fiber] : renderedSnapshot.push(fiber)); + } + function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + } + function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); + } + function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; + } + } + function forceStoreRerender(fiber) { + var root = markUpdateLaneFromFiberToRoot(fiber, 1); + null !== root && scheduleUpdateOnFiber(root, fiber, 1, -1); + } + function mountState(initialState) { + var hook = mountWorkInProgressHook(); + "function" === typeof initialState && (initialState = initialState()); + hook.memoizedState = hook.baseState = initialState; + initialState = { + pending: null, + interleaved: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + hook.queue = initialState; + initialState = initialState.dispatch = dispatchSetState.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, + stores: 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(8390656, 8, create, deps); + } + function updateEffect(create, deps) { + return updateEffectImpl(2048, 8, create, deps); + } + function updateInsertionEffect(create, deps) { + return updateEffectImpl(4, 2, create, deps); + } + function updateLayoutEffect(create, deps) { + return updateEffectImpl(4, 4, create, deps); + } + function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) 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, 4, imperativeHandleEffect.bind(null, create, ref), deps); + } + function mountDebugValue() {} + function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== 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 updateDeferredValueImpl(hook, prevValue, value) { + if (0 === (renderLanes & 21)) return hook.baseState && (hook.baseState = !1, didReceiveUpdate = !0), hook.memoizedState = value; + objectIs(value, prevValue) || (value = claimNextTransitionLane(), currentlyRenderingFiber$1.lanes |= value, workInProgressRootSkippedLanes |= value, hook.baseState = !0); + return prevValue; + } + function startTransition(setPending, callback) { + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 0 !== previousPriority && 4 > previousPriority ? previousPriority : 4; + setPending(!0); + var prevTransition = ReactCurrentBatchConfig$1.transition; + ReactCurrentBatchConfig$1.transition = {}; + try { + setPending(!1), callback(); + } finally { + currentUpdatePriority = previousPriority, ReactCurrentBatchConfig$1.transition = prevTransition; + } + } + function updateId() { + return updateWorkInProgressHook().memoizedState; + } + function dispatchReducerAction(fiber, queue, action) { + var lane = requestUpdateLane(fiber); + action = { + lane: lane, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, action);else if (action = enqueueConcurrentHookUpdate(fiber, queue, action, lane), null !== action) { + var eventTime = requestEventTime(); + scheduleUpdateOnFiber(action, fiber, lane, eventTime); + entangleTransitionUpdate(action, queue, lane); + } + } + function dispatchSetState(fiber, queue, action) { + var lane = requestUpdateLane(fiber), + update = { + lane: lane, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);else { + var alternate = fiber.alternate; + if (0 === fiber.lanes && (null === alternate || 0 === alternate.lanes) && (alternate = queue.lastRenderedReducer, null !== alternate)) try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) { + var interleaved = queue.interleaved; + null === interleaved ? (update.next = update, pushConcurrentUpdateQueue(queue)) : (update.next = interleaved.next, interleaved.next = update); + queue.interleaved = update; + return; + } + } catch (error) {} finally {} + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + null !== action && (update = requestEventTime(), scheduleUpdateOnFiber(action, fiber, lane, update), entangleTransitionUpdate(action, queue, lane)); + } + } + function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return fiber === currentlyRenderingFiber$1 || null !== alternate && alternate === currentlyRenderingFiber$1; + } + function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = !0; + var pending = queue.pending; + null === pending ? update.next = update : (update.next = pending.next, pending.next = update); + queue.pending = update; + } + function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194240)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); + } + } + var ContextOnlyDispatcher = { + readContext: readContext, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useMutableSource: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + unstable_isNewReconciler: !1 + }, + HooksDispatcherOnMount = { + readContext: readContext, + useCallback: function useCallback(callback, deps) { + mountWorkInProgressHook().memoizedState = [callback, void 0 === deps ? null : deps]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + return mountEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + return mountEffectImpl(4, 4, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + return mountEffectImpl(4, 2, create, deps); + }, + useMemo: function useMemo(nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + nextCreate = nextCreate(); + hook.memoizedState = [nextCreate, deps]; + return nextCreate; + }, + useReducer: function useReducer(reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + initialArg = void 0 !== init ? init(initialArg) : initialArg; + hook.memoizedState = hook.baseState = initialArg; + reducer = { + pending: null, + interleaved: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialArg + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind(null, currentlyRenderingFiber$1, reducer); + return [hook.memoizedState, reducer]; + }, + useRef: function useRef(initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { + current: initialValue + }; + return hook.memoizedState = initialValue; + }, + useState: mountState, + useDebugValue: mountDebugValue, + useDeferredValue: function useDeferredValue(value) { + return mountWorkInProgressHook().memoizedState = value; + }, + useTransition: function useTransition() { + var _mountState = mountState(!1), + isPending = _mountState[0]; + _mountState = startTransition.bind(null, _mountState[1]); + mountWorkInProgressHook().memoizedState = _mountState; + return [isPending, _mountState]; + }, + useMutableSource: function useMutableSource() {}, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot) { + var fiber = currentlyRenderingFiber$1, + hook = mountWorkInProgressHook(); + var nextSnapshot = getSnapshot(); + if (null === workInProgressRoot) throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue."); + 0 !== (renderLanes & 30) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + hook.memoizedState = nextSnapshot; + var inst = { + value: nextSnapshot, + getSnapshot: getSnapshot + }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]); + fiber.flags |= 2048; + pushEffect(9, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null); + return nextSnapshot; + }, + useId: function useId() { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix, + globalClientId = globalClientIdCounter++; + identifierPrefix = ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; + return hook.memoizedState = identifierPrefix; + }, + unstable_isNewReconciler: !1 + }, + HooksDispatcherOnUpdate = { + readContext: readContext, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function useState() { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function useDeferredValue(value) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl(hook, currentHook.memoizedState, value); + }, + useTransition: function useTransition() { + var isPending = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [isPending, start]; + }, + useMutableSource: updateMutableSource, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + unstable_isNewReconciler: !1 + }, + HooksDispatcherOnRerender = { + readContext: readContext, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: rerenderReducer, + useRef: updateRef, + useState: function useState() { + return rerenderReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function useDeferredValue(value) { + var hook = updateWorkInProgressHook(); + return null === currentHook ? hook.memoizedState = value : updateDeferredValueImpl(hook, currentHook.memoizedState, value); + }, + useTransition: function useTransition() { + var isPending = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [isPending, start]; + }, + useMutableSource: updateMutableSource, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + unstable_isNewReconciler: !1 + }; + function createCapturedValueAtFiber(value, source) { + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source), + digest: null + }; + } + function createCapturedValue(value, digest, stack) { + return { + value: value, + source: null, + stack: null != stack ? stack : null, + digest: null != digest ? digest : null + }; + } + if ("function" !== typeof _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").ReactFiberErrorDialog.showErrorDialog) throw Error("Expected ReactFiberErrorDialog.showErrorDialog to be a function."); + function logCapturedError(boundary, errorInfo) { + try { + !1 !== _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/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 () { + return getDerivedStateFromError(error); + }; + lane.callback = function () { + logCapturedError(fiber, errorInfo); + }; + } + var inst = fiber.stateNode; + null !== inst && "function" === typeof inst.componentDidCatch && (lane.callback = function () { + logCapturedError(fiber, errorInfo); + "function" !== typeof getDerivedStateFromError && (null === legacyErrorBoundariesThatAlreadyFailed ? legacyErrorBoundariesThatAlreadyFailed = new Set([this]) : legacyErrorBoundariesThatAlreadyFailed.add(this)); + var stack = errorInfo.stack; + this.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + }); + return lane; + } + function attachPingListener(root, wakeable, lanes) { + var pingCache = root.pingCache; + if (null === pingCache) { + pingCache = root.pingCache = new PossiblyWeakMap(); + var threadIDs = new Set(); + pingCache.set(wakeable, threadIDs); + } else threadIDs = pingCache.get(wakeable), void 0 === threadIDs && (threadIDs = new Set(), pingCache.set(wakeable, threadIDs)); + threadIDs.has(lanes) || (threadIDs.add(lanes), root = pingSuspendedRoot.bind(null, root, wakeable, lanes), wakeable.then(root, root)); + } + 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 &= -2053, current.lanes &= ~renderLanes, bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; + } + function updateMemoComponent(current, workInProgress, Component, nextProps, renderLanes) { + if (null === current) { + var type = Component.type; + if ("function" === typeof type && !shouldConstruct(type) && void 0 === type.defaultProps && null === Component.compare && void 0 === Component.defaultProps) return workInProgress.tag = 15, workInProgress.type = type, updateSimpleMemoComponent(current, workInProgress, type, nextProps, renderLanes); + current = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress, workInProgress.mode, renderLanes); + current.ref = workInProgress.ref; + current.return = workInProgress; + return workInProgress.child = current; + } + type = current.child; + if (0 === (current.lanes & renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return workInProgress.child = current; + } + function updateSimpleMemoComponent(current, workInProgress, Component, nextProps, renderLanes) { + if (null !== current) { + var prevProps = current.memoizedProps; + if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref) if (didReceiveUpdate = !1, workInProgress.pendingProps = nextProps = prevProps, 0 !== (current.lanes & renderLanes)) 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);else return workInProgress.lanes = current.lanes, bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + return updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes); + } + function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + prevState = null !== current ? current.memoizedState : null; + if ("hidden" === nextProps.mode) { + if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = { + baseLanes: 0, + cachePool: null, + transitions: null + }, push(subtreeRenderLanesCursor, subtreeRenderLanes), subtreeRenderLanes |= renderLanes;else { + if (0 === (renderLanes & 1073741824)) return current = null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, workInProgress.lanes = workInProgress.childLanes = 1073741824, workInProgress.memoizedState = { + baseLanes: current, + cachePool: null, + transitions: null + }, workInProgress.updateQueue = null, push(subtreeRenderLanesCursor, subtreeRenderLanes), subtreeRenderLanes |= current, null; + workInProgress.memoizedState = { + baseLanes: 0, + cachePool: null, + transitions: 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 |= 512; + } + 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 &= -2053, 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) resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), 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) || !1) ? (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 |= 1024)) : ("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 |= 1024), 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 |= 1024), 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; + var nextChildren = didCaptureError && "function" !== typeof Component.getDerivedStateFromError ? null : shouldUpdate.render(); + workInProgress.flags |= 1; + null !== current && didCaptureError ? (workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderLanes), workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, 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, + treeContext: null, + retryLane: 0 + }; + function mountSuspenseOffscreenState(renderLanes) { + return { + baseLanes: renderLanes, + cachePool: null, + transitions: null + }; + } + function updateSuspenseComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + suspenseContext = suspenseStackCursor.current, + showFallback = !1, + didSuspend = 0 !== (workInProgress.flags & 128), + JSCompiler_temp; + (JSCompiler_temp = didSuspend) || (JSCompiler_temp = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseContext & 2)); + if (JSCompiler_temp) showFallback = !0, workInProgress.flags &= -129;else if (null === current || null !== current.memoizedState) suspenseContext |= 1; + push(suspenseStackCursor, suspenseContext & 1); + if (null === current) { + current = workInProgress.memoizedState; + if (null !== current && null !== current.dehydrated) return 0 === (workInProgress.mode & 1) ? workInProgress.lanes = 1 : shim() ? workInProgress.lanes = 8 : workInProgress.lanes = 1073741824, null; + didSuspend = nextProps.children; + current = nextProps.fallback; + return showFallback ? (nextProps = workInProgress.mode, showFallback = workInProgress.child, didSuspend = { + mode: "hidden", + children: didSuspend + }, 0 === (nextProps & 1) && null !== showFallback ? (showFallback.childLanes = 0, showFallback.pendingProps = didSuspend) : showFallback = createFiberFromOffscreen(didSuspend, nextProps, 0, null), current = createFiberFromFragment(current, nextProps, renderLanes, null), showFallback.return = workInProgress, current.return = workInProgress, showFallback.sibling = current, workInProgress.child = showFallback, workInProgress.child.memoizedState = mountSuspenseOffscreenState(renderLanes), workInProgress.memoizedState = SUSPENDED_MARKER, current) : mountSuspensePrimaryChildren(workInProgress, didSuspend); + } + suspenseContext = current.memoizedState; + if (null !== suspenseContext && (JSCompiler_temp = suspenseContext.dehydrated, null !== JSCompiler_temp)) return updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, JSCompiler_temp, suspenseContext, renderLanes); + if (showFallback) { + showFallback = nextProps.fallback; + didSuspend = workInProgress.mode; + suspenseContext = current.child; + JSCompiler_temp = suspenseContext.sibling; + var primaryChildProps = { + mode: "hidden", + children: nextProps.children + }; + 0 === (didSuspend & 1) && workInProgress.child !== suspenseContext ? (nextProps = workInProgress.child, nextProps.childLanes = 0, nextProps.pendingProps = primaryChildProps, workInProgress.deletions = null) : (nextProps = createWorkInProgress(suspenseContext, primaryChildProps), nextProps.subtreeFlags = suspenseContext.subtreeFlags & 14680064); + null !== JSCompiler_temp ? showFallback = createWorkInProgress(JSCompiler_temp, showFallback) : (showFallback = createFiberFromFragment(showFallback, didSuspend, renderLanes, null), showFallback.flags |= 2); + showFallback.return = workInProgress; + nextProps.return = workInProgress; + nextProps.sibling = showFallback; + workInProgress.child = nextProps; + nextProps = showFallback; + showFallback = workInProgress.child; + didSuspend = current.child.memoizedState; + didSuspend = null === didSuspend ? mountSuspenseOffscreenState(renderLanes) : { + baseLanes: didSuspend.baseLanes | renderLanes, + cachePool: null, + transitions: didSuspend.transitions + }; + showFallback.memoizedState = didSuspend; + showFallback.childLanes = current.childLanes & ~renderLanes; + workInProgress.memoizedState = SUSPENDED_MARKER; + return nextProps; + } + showFallback = current.child; + current = showFallback.sibling; + nextProps = createWorkInProgress(showFallback, { + mode: "visible", + children: nextProps.children + }); + 0 === (workInProgress.mode & 1) && (nextProps.lanes = renderLanes); + nextProps.return = workInProgress; + nextProps.sibling = null; + null !== current && (renderLanes = workInProgress.deletions, null === renderLanes ? (workInProgress.deletions = [current], workInProgress.flags |= 16) : renderLanes.push(current)); + workInProgress.child = nextProps; + workInProgress.memoizedState = null; + return nextProps; + } + function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = createFiberFromOffscreen({ + mode: "visible", + children: primaryChildren + }, workInProgress.mode, 0, null); + primaryChildren.return = workInProgress; + return workInProgress.child = primaryChildren; + } + function retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, recoverableError) { + null !== recoverableError && (null === hydrationErrors ? hydrationErrors = [recoverableError] : hydrationErrors.push(recoverableError)); + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren(workInProgress, workInProgress.pendingProps.children); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; + } + function updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, suspenseInstance, suspenseState, renderLanes) { + if (didSuspend) { + if (workInProgress.flags & 256) return workInProgress.flags &= -257, suspenseState = createCapturedValue(Error("There was an error while hydrating this Suspense boundary. Switched to client rendering.")), retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, suspenseState); + if (null !== workInProgress.memoizedState) return workInProgress.child = current.child, workInProgress.flags |= 128, null; + suspenseState = nextProps.fallback; + didSuspend = workInProgress.mode; + nextProps = createFiberFromOffscreen({ + mode: "visible", + children: nextProps.children + }, didSuspend, 0, null); + suspenseState = createFiberFromFragment(suspenseState, didSuspend, renderLanes, null); + suspenseState.flags |= 2; + nextProps.return = workInProgress; + suspenseState.return = workInProgress; + nextProps.sibling = suspenseState; + workInProgress.child = nextProps; + 0 !== (workInProgress.mode & 1) && reconcileChildFibers(workInProgress, current.child, null, renderLanes); + workInProgress.child.memoizedState = mountSuspenseOffscreenState(renderLanes); + workInProgress.memoizedState = SUSPENDED_MARKER; + return suspenseState; + } + if (0 === (workInProgress.mode & 1)) return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, null); + if (shim()) return suspenseState = shim().digest, suspenseState = createCapturedValue(Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."), suspenseState, void 0), retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, suspenseState); + didSuspend = 0 !== (renderLanes & current.childLanes); + if (didReceiveUpdate || didSuspend) { + nextProps = workInProgressRoot; + if (null !== nextProps) { + switch (renderLanes & -renderLanes) { + case 4: + didSuspend = 2; + break; + case 16: + didSuspend = 8; + break; + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + didSuspend = 32; + break; + case 536870912: + didSuspend = 268435456; + break; + default: + didSuspend = 0; + } + didSuspend = 0 !== (didSuspend & (nextProps.suspendedLanes | renderLanes)) ? 0 : didSuspend; + 0 !== didSuspend && didSuspend !== suspenseState.retryLane && (suspenseState.retryLane = didSuspend, markUpdateLaneFromFiberToRoot(current, didSuspend), scheduleUpdateOnFiber(nextProps, current, didSuspend, -1)); + } + renderDidSuspendDelayIfPossible(); + suspenseState = createCapturedValue(Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition.")); + return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, suspenseState); + } + if (shim()) return workInProgress.flags |= 128, workInProgress.child = current.child, retryDehydratedSuspenseBoundary.bind(null, current), shim(), null; + current = mountSuspensePrimaryChildren(workInProgress, nextProps.children); + current.flags |= 4096; + return current; + } + function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); + } + function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode) { + var renderState = workInProgress.memoizedState; + null === renderState ? workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + } : (renderState.isBackwards = isBackwards, renderState.rendering = null, renderState.renderingStartTime = 0, renderState.last = lastContentRow, renderState.tail = tail, renderState.tailMode = tailMode); + } + function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + reconcileChildren(current, workInProgress, nextProps.children, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & 2)) nextProps = nextProps & 1 | 2, workInProgress.flags |= 128;else { + if (null !== current && 0 !== (current.flags & 128)) a: for (current = workInProgress.child; null !== current;) { + if (13 === current.tag) null !== current.memoizedState && scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);else if (19 === current.tag) scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling;) { + if (null === current.return || current.return === workInProgress) break a; + current = current.return; + } + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= 1; + } + push(suspenseStackCursor, nextProps); + 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 resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + 0 === (workInProgress.mode & 1) && null !== current && (current.alternate = null, workInProgress.alternate = null, workInProgress.flags |= 2); + } + function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { + null !== current && (workInProgress.dependencies = current.dependencies); + 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; + } + function attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes) { + 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: + var context = workInProgress.type._context, + nextValue = workInProgress.memoizedProps.value; + push(valueCursor, context._currentValue); + context._currentValue = nextValue; + break; + case 13: + context = workInProgress.memoizedState; + if (null !== context) { + if (null !== context.dehydrated) return push(suspenseStackCursor, suspenseStackCursor.current & 1), workInProgress.flags |= 128, null; + if (0 !== (renderLanes & workInProgress.child.childLanes)) return updateSuspenseComponent(current, workInProgress, renderLanes); + push(suspenseStackCursor, suspenseStackCursor.current & 1); + current = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + return null !== current ? current.sibling : null; + } + push(suspenseStackCursor, suspenseStackCursor.current & 1); + break; + case 19: + context = 0 !== (renderLanes & workInProgress.childLanes); + if (0 !== (current.flags & 128)) { + if (context) 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 (context) break;else return null; + case 22: + case 23: + return workInProgress.lanes = 0, updateOffscreenComponent(current, workInProgress, renderLanes); + } + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + var appendAllChildren, updateHostContainer, updateHostComponent$1, updateHostText$1; + appendAllChildren = function appendAllChildren(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 updateHostContainer() {}; + updateHostComponent$1 = function updateHostComponent$1(current, workInProgress, type, newProps) { + current.memoizedProps !== newProps && (requiredContext(contextStackCursor$1.current), workInProgress.updateQueue = UPDATE_SIGNAL) && (workInProgress.flags |= 4); + }; + updateHostText$1 = function updateHostText$1(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$62 = null; null !== lastTailNode;) null !== lastTailNode.alternate && (lastTailNode$62 = lastTailNode), lastTailNode = lastTailNode.sibling; + null === lastTailNode$62 ? hasRenderedATailFallback || null === renderState.tail ? renderState.tail = null : renderState.tail.sibling = null : lastTailNode$62.sibling = null; + } + } + function bubbleProperties(completedWork) { + var didBailout = null !== completedWork.alternate && completedWork.alternate.child === completedWork.child, + newChildLanes = 0, + subtreeFlags = 0; + if (didBailout) for (var child$63 = completedWork.child; null !== child$63;) newChildLanes |= child$63.lanes | child$63.childLanes, subtreeFlags |= child$63.subtreeFlags & 14680064, subtreeFlags |= child$63.flags & 14680064, child$63.return = completedWork, child$63 = child$63.sibling;else for (child$63 = completedWork.child; null !== child$63;) newChildLanes |= child$63.lanes | child$63.childLanes, subtreeFlags |= child$63.subtreeFlags, subtreeFlags |= child$63.flags, child$63.return = completedWork, child$63 = child$63.sibling; + completedWork.subtreeFlags |= subtreeFlags; + completedWork.childLanes = newChildLanes; + return didBailout; + } + function completeWork(current, workInProgress, renderLanes) { + var newProps = workInProgress.pendingProps; + popTreeContext(workInProgress); + 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 renderLanes = workInProgress.stateNode, popHostContainer(), pop(didPerformWorkStackCursor), pop(contextStackCursor), resetWorkInProgressVersions(), renderLanes.pendingContext && (renderLanes.context = renderLanes.pendingContext, renderLanes.pendingContext = null), null !== current && null !== current.child || null === current || current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256) || (workInProgress.flags |= 1024, null !== hydrationErrors && (queueRecoverableErrors(hydrationErrors), hydrationErrors = null)), 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 |= 512);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); + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/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 |= 512); + } + 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 component."); + renderLanes = allocateTag(); + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/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 (null === current || null !== current.memoizedState && null !== current.memoizedState.dehydrated) { + if (null !== newProps && null !== newProps.dehydrated) { + if (null === current) { + throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React."); + throw Error("Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue."); + } + 0 === (workInProgress.flags & 128) && (workInProgress.memoizedState = null); + workInProgress.flags |= 4; + bubbleProperties(workInProgress); + type = !1; + } else null !== hydrationErrors && (queueRecoverableErrors(hydrationErrors), hydrationErrors = null), type = !0; + if (!type) return workInProgress.flags & 65536 ? workInProgress : null; + } + if (0 !== (workInProgress.flags & 128)) return workInProgress.lanes = renderLanes, workInProgress; + renderLanes = null !== newProps; + renderLanes !== (null !== current && null !== current.memoizedState) && renderLanes && (workInProgress.child.flags |= 8192, 0 !== (workInProgress.mode & 1) && (null === current || 0 !== (suspenseStackCursor.current & 1) ? 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 3) : renderDidSuspendDelayIfPossible())); + null !== workInProgress.updateQueue && (workInProgress.flags |= 4); + bubbleProperties(workInProgress); + 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 (renderLanes = workInProgress.child; null !== renderLanes;) newProps = renderLanes, type = current, newProps.flags &= 14680066, updatePayload = newProps.alternate, null === updatePayload ? (newProps.childLanes = 0, newProps.lanes = type, newProps.child = null, newProps.subtreeFlags = 0, newProps.memoizedProps = null, newProps.memoizedState = null, newProps.updateQueue = null, newProps.dependencies = null, newProps.stateNode = null) : (newProps.childLanes = updatePayload.childLanes, newProps.lanes = updatePayload.lanes, newProps.child = updatePayload.child, newProps.subtreeFlags = 0, newProps.deletions = null, newProps.memoizedProps = updatePayload.memoizedProps, newProps.memoizedState = updatePayload.memoizedState, newProps.updateQueue = updatePayload.updateQueue, newProps.type = updatePayload.type, type = updatePayload.dependencies, newProps.dependencies = null === type ? null : { + lanes: type.lanes, + firstContext: type.firstContext + }), renderLanes = renderLanes.sibling; + push(suspenseStackCursor, suspenseStackCursor.current & 1 | 2); + return workInProgress.child; + } + current = current.sibling; + } + null !== type.tail && _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now() > workInProgressRootRenderTargetTime && (workInProgress.flags |= 128, newProps = !0, cutOffTailIfNeeded(type, !1), workInProgress.lanes = 4194304); + } + } 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 * _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now() - type.renderingStartTime > workInProgressRootRenderTargetTime && 1073741824 !== renderLanes && (workInProgress.flags |= 128, newProps = !0, cutOffTailIfNeeded(type, !1), workInProgress.lanes = 4194304); + 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 = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_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 && (workInProgress.flags |= 8192), renderLanes && 0 !== (workInProgress.mode & 1) ? 0 !== (subtreeRenderLanes & 1073741824) && (bubbleProperties(workInProgress), workInProgress.subtreeFlags & 6 && (workInProgress.flags |= 8192)) : bubbleProperties(workInProgress), null; + case 24: + return null; + case 25: + return 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(current, workInProgress) { + popTreeContext(workInProgress); + switch (workInProgress.tag) { + case 1: + return isContextProvider(workInProgress.type) && popContext(), current = workInProgress.flags, current & 65536 ? (workInProgress.flags = current & -65537 | 128, workInProgress) : null; + case 3: + return popHostContainer(), pop(didPerformWorkStackCursor), pop(contextStackCursor), resetWorkInProgressVersions(), current = workInProgress.flags, 0 !== (current & 65536) && 0 === (current & 128) ? (workInProgress.flags = current & -65537 | 128, workInProgress) : null; + case 5: + return popHostContext(workInProgress), null; + case 13: + pop(suspenseStackCursor); + current = workInProgress.memoizedState; + if (null !== current && null !== current.dehydrated && null === workInProgress.alternate) throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue."); + current = workInProgress.flags; + return current & 65536 ? (workInProgress.flags = current & -65537 | 128, 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; + } + } + 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 (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } else ref.current = null; + } + function safelyCallDestroy(current, nearestMountedAncestor, destroy) { + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + var shouldFireAfterActiveInstanceBlur = !1; + function commitBeforeMutationEffects(root, firstChild) { + for (nextEffect = firstChild; null !== nextEffect;) if (root = nextEffect, firstChild = root.child, 0 !== (root.subtreeFlags & 1028) && null !== firstChild) firstChild.return = root, nextEffect = firstChild;else for (; null !== nextEffect;) { + root = nextEffect; + try { + var current = root.alternate; + if (0 !== (root.flags & 1024)) 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; + return current; + } + function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) { + 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; + void 0 !== destroy && safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy); + } + effect = effect.next; + } while (effect !== updateQueue); + } + } + function commitHookEffectListMount(flags, finishedWork) { + finishedWork = finishedWork.updateQueue; + finishedWork = null !== finishedWork ? finishedWork.lastEffect : null; + if (null !== finishedWork) { + var effect = finishedWork = finishedWork.next; + do { + if ((effect.tag & flags) === flags) { + var create$75 = effect.create; + effect.destroy = create$75(); + } + effect = effect.next; + } while (effect !== finishedWork); + } + } + function detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + null !== alternate && (fiber.alternate = null, detachFiberAfterEffects(alternate)); + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; + fiber.stateNode = null; + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; + fiber.updateQueue = null; + } + function isHostParent(fiber) { + return 5 === fiber.tag || 3 === fiber.tag || 4 === fiber.tag; + } + function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling;) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for (fiber = fiber.sibling; 5 !== fiber.tag && 6 !== fiber.tag && 18 !== fiber.tag;) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a;else fiber.child.return = fiber, fiber = fiber.child; + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } + } + function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) { + if (node = node.stateNode, before) { + if ("number" === typeof parent) throw Error("Container does not support insertBefore operation"); + } else _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/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; + if (5 === tag || 6 === tag) { + if (node = node.stateNode, before) { + tag = parent._children; + var index = tag.indexOf(node); + 0 <= index ? (tag.splice(index, 1), before = tag.indexOf(before), tag.splice(before, 0, node), _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.manageChildren(parent._nativeTag, [index], [before], [], [], [])) : (before = tag.indexOf(before), tag.splice(before, 0, node), _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.manageChildren(parent._nativeTag, [], [], ["number" === typeof node ? node : node._nativeTag], [before], [])); + } else before = "number" === typeof node ? node : node._nativeTag, tag = parent._children, index = tag.indexOf(node), 0 <= index ? (tag.splice(index, 1), tag.push(node), _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.manageChildren(parent._nativeTag, [index], [tag.length - 1], [], [], [])) : (tag.push(node), _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/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; + } + var hostParent = null, + hostParentIsContainer = !1; + function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) { + for (parent = parent.child; null !== parent;) commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent), parent = parent.sibling; + } + function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) { + if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount) try { + injectedHook.onCommitFiberUnmount(rendererID, deletedFiber); + } catch (err) {} + switch (deletedFiber.tag) { + case 5: + safelyDetachRef(deletedFiber, nearestMountedAncestor); + case 6: + var prevHostParent = hostParent, + prevHostParentIsContainer = hostParentIsContainer; + hostParent = null; + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + hostParent = prevHostParent; + hostParentIsContainer = prevHostParentIsContainer; + null !== hostParent && (hostParentIsContainer ? (finishedRoot = hostParent, recursivelyUncacheFiberNode(deletedFiber.stateNode), _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.manageChildren(finishedRoot, [], [], [], [], [0])) : (finishedRoot = hostParent, nearestMountedAncestor = deletedFiber.stateNode, recursivelyUncacheFiberNode(nearestMountedAncestor), deletedFiber = finishedRoot._children, nearestMountedAncestor = deletedFiber.indexOf(nearestMountedAncestor), deletedFiber.splice(nearestMountedAncestor, 1), _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.manageChildren(finishedRoot._nativeTag, [], [], [], [], [nearestMountedAncestor]))); + break; + case 18: + null !== hostParent && shim(hostParent, deletedFiber.stateNode); + break; + case 4: + prevHostParent = hostParent; + prevHostParentIsContainer = hostParentIsContainer; + hostParent = deletedFiber.stateNode.containerInfo; + hostParentIsContainer = !0; + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + hostParent = prevHostParent; + hostParentIsContainer = prevHostParentIsContainer; + break; + case 0: + case 11: + case 14: + case 15: + prevHostParent = deletedFiber.updateQueue; + if (null !== prevHostParent && (prevHostParent = prevHostParent.lastEffect, null !== prevHostParent)) { + prevHostParentIsContainer = prevHostParent = prevHostParent.next; + do { + var _effect = prevHostParentIsContainer, + destroy = _effect.destroy; + _effect = _effect.tag; + void 0 !== destroy && (0 !== (_effect & 2) ? safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy) : 0 !== (_effect & 4) && safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy)); + prevHostParentIsContainer = prevHostParentIsContainer.next; + } while (prevHostParentIsContainer !== prevHostParent); + } + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + break; + case 1: + safelyDetachRef(deletedFiber, nearestMountedAncestor); + prevHostParent = deletedFiber.stateNode; + if ("function" === typeof prevHostParent.componentWillUnmount) try { + prevHostParent.props = deletedFiber.memoizedProps, prevHostParent.state = deletedFiber.memoizedState, prevHostParent.componentWillUnmount(); + } catch (error) { + captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); + } + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + break; + case 21: + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + break; + case 22: + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + break; + default: + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + } + } + 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) || (retryCache.add(wakeable), wakeable.then(retry, retry)); + }); + } + } + function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { + var deletions = parentFiber.deletions; + if (null !== deletions) for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i]; + try { + var root = root$jscomp$0, + returnFiber = parentFiber, + parent = returnFiber; + a: for (; null !== parent;) { + switch (parent.tag) { + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + } + parent = parent.return; + } + if (null === hostParent) throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."); + commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); + hostParent = null; + hostParentIsContainer = !1; + var alternate = childToDelete.alternate; + null !== alternate && (alternate.return = null); + childToDelete.return = null; + } catch (error) { + captureCommitPhaseError(childToDelete, parentFiber, error); + } + } + if (parentFiber.subtreeFlags & 12854) for (parentFiber = parentFiber.child; null !== parentFiber;) commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), parentFiber = parentFiber.sibling; + } + function commitMutationEffectsOnFiber(finishedWork, root) { + var current = finishedWork.alternate, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 14: + case 15: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & 4) { + try { + commitHookEffectListUnmount(3, finishedWork, finishedWork.return), commitHookEffectListMount(3, finishedWork); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + try { + commitHookEffectListUnmount(5, finishedWork, finishedWork.return); + } catch (error$85) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$85); + } + } + break; + case 1: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 512 && null !== current && safelyDetachRef(current, current.return); + break; + case 5: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 512 && null !== current && safelyDetachRef(current, current.return); + if (flags & 4) { + var instance$87 = finishedWork.stateNode; + if (null != instance$87) { + var newProps = finishedWork.memoizedProps, + oldProps = null !== current ? current.memoizedProps : newProps, + updatePayload = finishedWork.updateQueue; + finishedWork.updateQueue = null; + if (null !== updatePayload) try { + var viewConfig = instance$87.viewConfig; + instanceProps.set(instance$87._nativeTag, newProps); + var updatePayload$jscomp$0 = diffProperties(null, oldProps, newProps, viewConfig.validAttributes); + null != updatePayload$jscomp$0 && _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.updateView(instance$87._nativeTag, viewConfig.uiViewClassName, updatePayload$jscomp$0); + } catch (error$88) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$88); + } + } + } + break; + case 6: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & 4) { + 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."); + viewConfig = finishedWork.stateNode; + updatePayload$jscomp$0 = finishedWork.memoizedProps; + try { + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.updateView(viewConfig, "RCTRawText", { + text: updatePayload$jscomp$0 + }); + } catch (error$89) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$89); + } + } + break; + case 3: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + break; + case 4: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + break; + case 13: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + viewConfig = finishedWork.child; + viewConfig.flags & 8192 && (updatePayload$jscomp$0 = null !== viewConfig.memoizedState, viewConfig.stateNode.isHidden = updatePayload$jscomp$0, !updatePayload$jscomp$0 || null !== viewConfig.alternate && null !== viewConfig.alternate.memoizedState || (globalMostRecentFallbackTime = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now())); + flags & 4 && attachSuspenseRetryListeners(finishedWork); + break; + case 22: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & 8192) a: for (viewConfig = null !== finishedWork.memoizedState, finishedWork.stateNode.isHidden = viewConfig, updatePayload$jscomp$0 = null, current = finishedWork;;) { + if (5 === current.tag) { + if (null === updatePayload$jscomp$0) { + updatePayload$jscomp$0 = current; + try { + if (instance$87 = current.stateNode, viewConfig) newProps = instance$87.viewConfig, oldProps = diffProperties(null, emptyObject, { + style: { + display: "none" + } + }, newProps.validAttributes), _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.updateView(instance$87._nativeTag, newProps.uiViewClassName, oldProps);else { + updatePayload = current.stateNode; + var props = current.memoizedProps, + viewConfig$jscomp$0 = updatePayload.viewConfig, + prevProps = assign({}, props, { + style: [props.style, { + display: "none" + }] + }); + var updatePayload$jscomp$1 = diffProperties(null, prevProps, props, viewConfig$jscomp$0.validAttributes); + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.updateView(updatePayload._nativeTag, viewConfig$jscomp$0.uiViewClassName, updatePayload$jscomp$1); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } else if (6 === current.tag) { + if (null === updatePayload$jscomp$0) try { + throw Error("Not yet implemented."); + } catch (error$80) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$80); + } + } else if ((22 !== current.tag && 23 !== current.tag || null === current.memoizedState || current === finishedWork) && null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === finishedWork) break a; + for (; null === current.sibling;) { + if (null === current.return || current.return === finishedWork) break a; + updatePayload$jscomp$0 === current && (updatePayload$jscomp$0 = null); + current = current.return; + } + updatePayload$jscomp$0 === current && (updatePayload$jscomp$0 = null); + current.sibling.return = current.return; + current = current.sibling; + } + break; + case 19: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 4 && attachSuspenseRetryListeners(finishedWork); + break; + case 21: + break; + default: + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); + } + } + function commitReconciliationEffects(finishedWork) { + var flags = finishedWork.flags; + if (flags & 2) { + try { + a: { + for (var parent = finishedWork.return; null !== parent;) { + if (isHostParent(parent)) { + var JSCompiler_inline_result = 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."); + } + switch (JSCompiler_inline_result.tag) { + case 5: + var parent$jscomp$0 = JSCompiler_inline_result.stateNode; + JSCompiler_inline_result.flags & 32 && (JSCompiler_inline_result.flags &= -33); + var before = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); + break; + case 3: + case 4: + var parent$81 = JSCompiler_inline_result.stateNode.containerInfo, + before$82 = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer(finishedWork, before$82, parent$81); + break; + default: + throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue."); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + finishedWork.flags &= -3; + } + flags & 4096 && (finishedWork.flags &= -4097); + } + function commitLayoutEffects(finishedWork) { + for (nextEffect = finishedWork; null !== nextEffect;) { + var fiber = nextEffect, + firstChild = fiber.child; + if (0 !== (fiber.subtreeFlags & 8772) && null !== firstChild) firstChild.return = fiber, nextEffect = firstChild;else for (fiber = finishedWork; null !== nextEffect;) { + firstChild = nextEffect; + if (0 !== (firstChild.flags & 8772)) { + var current = firstChild.alternate; + try { + if (0 !== (firstChild.flags & 8772)) switch (firstChild.tag) { + case 0: + case 11: + case 15: + commitHookEffectListMount(5, firstChild); + break; + case 1: + var instance = firstChild.stateNode; + if (firstChild.flags & 4) if (null === current) instance.componentDidMount();else { + var prevProps = firstChild.elementType === firstChild.type ? current.memoizedProps : resolveDefaultProps(firstChild.type, current.memoizedProps); + instance.componentDidUpdate(prevProps, current.memoizedState, instance.__reactInternalSnapshotBeforeUpdate); + } + var updateQueue = firstChild.updateQueue; + null !== updateQueue && commitUpdateQueue(firstChild, updateQueue, instance); + break; + case 3: + var updateQueue$76 = firstChild.updateQueue; + if (null !== updateQueue$76) { + current = null; + if (null !== firstChild.child) switch (firstChild.child.tag) { + case 5: + current = firstChild.child.stateNode; + break; + case 1: + current = firstChild.child.stateNode; + } + commitUpdateQueue(firstChild, updateQueue$76, current); + } + break; + case 5: + break; + case 6: + break; + case 4: + break; + case 12: + break; + case 13: + break; + case 19: + case 17: + case 21: + case 22: + case 23: + case 25: + 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 (firstChild.flags & 512) { + current = void 0; + var ref = firstChild.ref; + if (null !== ref) { + var instance$jscomp$0 = firstChild.stateNode; + switch (firstChild.tag) { + case 5: + current = instance$jscomp$0; + break; + default: + current = instance$jscomp$0; + } + "function" === typeof ref ? ref(current) : ref.current = current; + } + } + } catch (error) { + captureCommitPhaseError(firstChild, firstChild.return, error); + } + } + if (firstChild === fiber) { + nextEffect = null; + break; + } + current = firstChild.sibling; + if (null !== current) { + current.return = firstChild.return; + nextEffect = current; + break; + } + nextEffect = firstChild.return; + } + } + } + var ceil = Math.ceil, + ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, + ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, + ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig, + executionContext = 0, + workInProgressRoot = null, + workInProgress = null, + workInProgressRootRenderLanes = 0, + subtreeRenderLanes = 0, + subtreeRenderLanesCursor = createCursor(0), + workInProgressRootExitStatus = 0, + workInProgressRootFatalError = null, + workInProgressRootSkippedLanes = 0, + workInProgressRootInterleavedUpdatedLanes = 0, + workInProgressRootPingedLanes = 0, + workInProgressRootConcurrentErrors = null, + workInProgressRootRecoverableErrors = null, + globalMostRecentFallbackTime = 0, + workInProgressRootRenderTargetTime = Infinity, + workInProgressTransitions = null, + hasUncaughtError = !1, + firstUncaughtError = null, + legacyErrorBoundariesThatAlreadyFailed = null, + rootDoesHavePassiveEffects = !1, + rootWithPendingPassiveEffects = null, + pendingPassiveEffectsLanes = 0, + nestedUpdateCount = 0, + rootWithNestedUpdates = null, + currentEventTime = -1, + currentEventTransitionLane = 0; + function requestEventTime() { + return 0 !== (executionContext & 6) ? _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now() : -1 !== currentEventTime ? currentEventTime : currentEventTime = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now(); + } + function requestUpdateLane(fiber) { + if (0 === (fiber.mode & 1)) return 1; + if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes) return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; + if (null !== ReactCurrentBatchConfig.transition) return 0 === currentEventTransitionLane && (currentEventTransitionLane = claimNextTransitionLane()), currentEventTransitionLane; + fiber = currentUpdatePriority; + return 0 !== fiber ? fiber : 16; + } + function scheduleUpdateOnFiber(root, 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."); + markRootUpdated(root, lane, eventTime); + if (0 === (executionContext & 2) || root !== workInProgressRoot) root === workInProgressRoot && (0 === (executionContext & 2) && (workInProgressRootInterleavedUpdatedLanes |= lane), 4 === workInProgressRootExitStatus && markRootSuspended$1(root, workInProgressRootRenderLanes)), ensureRootIsScheduled(root, eventTime), 1 === lane && 0 === executionContext && 0 === (fiber.mode & 1) && (workInProgressRootRenderTargetTime = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now() + 500, includesLegacySyncCallbacks && flushSyncCallbacks()); + } + 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)) expirationTimes[index$6] = computeExpirationTime(lane, currentTime); + } else expirationTime <= currentTime && (root.expiredLanes |= lane); + lanes &= ~lane; + } + suspendedLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : 0); + if (0 === suspendedLanes) null !== existingCallbackNode && _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_cancelCallback(existingCallbackNode), root.callbackNode = null, root.callbackPriority = 0;else if (currentTime = suspendedLanes & -suspendedLanes, root.callbackPriority !== currentTime) { + null != existingCallbackNode && _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_cancelCallback(existingCallbackNode); + if (1 === currentTime) 0 === root.tag ? (existingCallbackNode = performSyncWorkOnRoot.bind(null, root), includesLegacySyncCallbacks = !0, null === syncQueue ? syncQueue = [existingCallbackNode] : syncQueue.push(existingCallbackNode)) : (existingCallbackNode = performSyncWorkOnRoot.bind(null, root), null === syncQueue ? syncQueue = [existingCallbackNode] : syncQueue.push(existingCallbackNode)), _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_scheduleCallback(_$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_ImmediatePriority, flushSyncCallbacks), existingCallbackNode = null;else { + switch (lanesToEventPriority(suspendedLanes)) { + case 1: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_ImmediatePriority; + break; + case 4: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_UserBlockingPriority; + break; + case 16: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_NormalPriority; + break; + case 536870912: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_IdlePriority; + break; + default: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_NormalPriority; + } + existingCallbackNode = scheduleCallback$1(existingCallbackNode, performConcurrentWorkOnRoot.bind(null, root)); + } + root.callbackPriority = currentTime; + root.callbackNode = existingCallbackNode; + } + } + function performConcurrentWorkOnRoot(root, didTimeout) { + currentEventTime = -1; + currentEventTransitionLane = 0; + if (0 !== (executionContext & 6)) 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 (0 !== (lanes & 30) || 0 !== (lanes & root.expiredLanes) || didTimeout) didTimeout = renderRootSync(root, lanes);else { + didTimeout = lanes; + var prevExecutionContext = executionContext; + executionContext |= 2; + var prevDispatcher = pushDispatcher(); + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== didTimeout) workInProgressTransitions = null, workInProgressRootRenderTargetTime = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now() + 500, prepareFreshStack(root, didTimeout); + do try { + workLoopConcurrent(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } while (1); + resetContextDependencies(); + ReactCurrentDispatcher$2.current = prevDispatcher; + executionContext = prevExecutionContext; + null !== workInProgress ? didTimeout = 0 : (workInProgressRoot = null, workInProgressRootRenderLanes = 0, didTimeout = workInProgressRootExitStatus); + } + if (0 !== didTimeout) { + 2 === didTimeout && (prevExecutionContext = getLanesToRetrySynchronouslyOnError(root), 0 !== prevExecutionContext && (lanes = prevExecutionContext, didTimeout = recoverFromConcurrentError(root, prevExecutionContext))); + if (1 === didTimeout) throw originalCallbackNode = workInProgressRootFatalError, prepareFreshStack(root, 0), markRootSuspended$1(root, lanes), ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now()), originalCallbackNode; + if (6 === didTimeout) markRootSuspended$1(root, lanes);else { + prevExecutionContext = root.current.alternate; + if (0 === (lanes & 30) && !isRenderConsistentWithExternalStores(prevExecutionContext) && (didTimeout = renderRootSync(root, lanes), 2 === didTimeout && (prevDispatcher = getLanesToRetrySynchronouslyOnError(root), 0 !== prevDispatcher && (lanes = prevDispatcher, didTimeout = recoverFromConcurrentError(root, prevDispatcher))), 1 === didTimeout)) throw originalCallbackNode = workInProgressRootFatalError, prepareFreshStack(root, 0), markRootSuspended$1(root, lanes), ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now()), originalCallbackNode; + root.finishedWork = prevExecutionContext; + 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, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + case 3: + markRootSuspended$1(root, lanes); + if ((lanes & 130023424) === lanes && (didTimeout = globalMostRecentFallbackTime + 500 - _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now(), 10 < didTimeout)) { + if (0 !== getNextLanes(root, 0)) break; + prevExecutionContext = root.suspendedLanes; + if ((prevExecutionContext & lanes) !== lanes) { + requestEventTime(); + root.pingedLanes |= root.suspendedLanes & prevExecutionContext; + break; + } + root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root, workInProgressRootRecoverableErrors, workInProgressTransitions), didTimeout); + break; + } + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + case 4: + markRootSuspended$1(root, lanes); + if ((lanes & 4194240) === lanes) break; + didTimeout = root.eventTimes; + for (prevExecutionContext = -1; 0 < lanes;) { + var index$5 = 31 - clz32(lanes); + prevDispatcher = 1 << index$5; + index$5 = didTimeout[index$5]; + index$5 > prevExecutionContext && (prevExecutionContext = index$5); + lanes &= ~prevDispatcher; + } + lanes = prevExecutionContext; + lanes = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_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, workInProgressRootRecoverableErrors, workInProgressTransitions), lanes); + break; + } + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + case 5: + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + default: + throw Error("Unknown root exit status."); + } + } + } + ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now()); + return root.callbackNode === originalCallbackNode ? performConcurrentWorkOnRoot.bind(null, root) : null; + } + function recoverFromConcurrentError(root, errorRetryLanes) { + var errorsFromFirstAttempt = workInProgressRootConcurrentErrors; + root.current.memoizedState.isDehydrated && (prepareFreshStack(root, errorRetryLanes).flags |= 256); + root = renderRootSync(root, errorRetryLanes); + 2 !== root && (errorRetryLanes = workInProgressRootRecoverableErrors, workInProgressRootRecoverableErrors = errorsFromFirstAttempt, null !== errorRetryLanes && queueRecoverableErrors(errorRetryLanes)); + return root; + } + function queueRecoverableErrors(errors) { + null === workInProgressRootRecoverableErrors ? workInProgressRootRecoverableErrors = errors : workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, errors); + } + function isRenderConsistentWithExternalStores(finishedWork) { + for (var node = finishedWork;;) { + if (node.flags & 16384) { + var updateQueue = node.updateQueue; + if (null !== updateQueue && (updateQueue = updateQueue.stores, null !== updateQueue)) for (var i = 0; i < updateQueue.length; i++) { + var check = updateQueue[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; + } + } + } + updateQueue = node.child; + if (node.subtreeFlags & 16384 && null !== updateQueue) updateQueue.return = node, node = updateQueue;else { + if (node === finishedWork) break; + for (; null === node.sibling;) { + if (null === node.return || node.return === finishedWork) return !0; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + } + return !0; + } + function markRootSuspended$1(root, suspendedLanes) { + suspendedLanes &= ~workInProgressRootPingedLanes; + suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; + 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 & 6)) throw Error("Should not already be working."); + flushPassiveEffects(); + var lanes = getNextLanes(root, 0); + if (0 === (lanes & 1)) return ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now()), null; + var exitStatus = renderRootSync(root, lanes); + if (0 !== root.tag && 2 === exitStatus) { + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); + 0 !== errorRetryLanes && (lanes = errorRetryLanes, exitStatus = recoverFromConcurrentError(root, errorRetryLanes)); + } + if (1 === exitStatus) throw exitStatus = workInProgressRootFatalError, prepareFreshStack(root, 0), markRootSuspended$1(root, lanes), ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now()), exitStatus; + if (6 === exitStatus) throw Error("Root did not complete. This is a bug in React."); + root.finishedWork = root.current.alternate; + root.finishedLanes = lanes; + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_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; + popTreeContext(interruptedWork); + 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 = root = createWorkInProgress(root.current, null); + workInProgressRootRenderLanes = subtreeRenderLanes = lanes; + workInProgressRootExitStatus = 0; + workInProgressRootFatalError = null; + workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = 0; + workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; + if (null !== concurrentQueues) { + for (lanes = 0; lanes < concurrentQueues.length; lanes++) if (timeoutHandle = concurrentQueues[lanes], interruptedWork = timeoutHandle.interleaved, null !== interruptedWork) { + timeoutHandle.interleaved = null; + var firstInterleavedUpdate = interruptedWork.next, + lastPendingUpdate = timeoutHandle.pending; + if (null !== lastPendingUpdate) { + var firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = firstInterleavedUpdate; + interruptedWork.next = firstPendingUpdate; + } + timeoutHandle.pending = interruptedWork; + } + concurrentQueues = null; + } + return root; + } + 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; + } + a: { + var root = root$jscomp$0, + returnFiber = erroredWork.return, + sourceFiber = erroredWork, + value = thrownValue; + thrownValue = workInProgressRootRenderLanes; + sourceFiber.flags |= 32768; + if (null !== value && "object" === typeof value && "function" === typeof value.then) { + var wakeable = value, + sourceFiber$jscomp$0 = sourceFiber, + tag = sourceFiber$jscomp$0.tag; + if (0 === (sourceFiber$jscomp$0.mode & 1) && (0 === tag || 11 === tag || 15 === tag)) { + var currentSource = sourceFiber$jscomp$0.alternate; + currentSource ? (sourceFiber$jscomp$0.updateQueue = currentSource.updateQueue, sourceFiber$jscomp$0.memoizedState = currentSource.memoizedState, sourceFiber$jscomp$0.lanes = currentSource.lanes) : (sourceFiber$jscomp$0.updateQueue = null, sourceFiber$jscomp$0.memoizedState = null); + } + b: { + sourceFiber$jscomp$0 = returnFiber; + do { + var JSCompiler_temp; + if (JSCompiler_temp = 13 === sourceFiber$jscomp$0.tag) { + var nextState = sourceFiber$jscomp$0.memoizedState; + JSCompiler_temp = null !== nextState ? null !== nextState.dehydrated ? !0 : !1 : !0; + } + if (JSCompiler_temp) { + var suspenseBoundary = sourceFiber$jscomp$0; + break b; + } + sourceFiber$jscomp$0 = sourceFiber$jscomp$0.return; + } while (null !== sourceFiber$jscomp$0); + suspenseBoundary = null; + } + if (null !== suspenseBoundary) { + suspenseBoundary.flags &= -257; + value = suspenseBoundary; + sourceFiber$jscomp$0 = thrownValue; + if (0 === (value.mode & 1)) { + if (value === returnFiber) value.flags |= 65536;else { + value.flags |= 128; + sourceFiber.flags |= 131072; + sourceFiber.flags &= -52805; + if (1 === sourceFiber.tag) if (null === sourceFiber.alternate) sourceFiber.tag = 17;else { + var update = createUpdate(-1, 1); + update.tag = 2; + enqueueUpdate(sourceFiber, update, 1); + } + sourceFiber.lanes |= 1; + } + } else value.flags |= 65536, value.lanes = sourceFiber$jscomp$0; + suspenseBoundary.mode & 1 && attachPingListener(root, wakeable, thrownValue); + thrownValue = suspenseBoundary; + root = wakeable; + var wakeables = thrownValue.updateQueue; + if (null === wakeables) { + var updateQueue = new Set(); + updateQueue.add(root); + thrownValue.updateQueue = updateQueue; + } else wakeables.add(root); + break a; + } else { + if (0 === (thrownValue & 1)) { + attachPingListener(root, wakeable, thrownValue); + renderDidSuspendDelayIfPossible(); + break a; + } + value = Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition."); + } + } + root = value = createCapturedValueAtFiber(value, sourceFiber); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + null === workInProgressRootConcurrentErrors ? workInProgressRootConcurrentErrors = [root] : workInProgressRootConcurrentErrors.push(root); + root = returnFiber; + do { + switch (root.tag) { + case 3: + wakeable = value; + root.flags |= 65536; + thrownValue &= -thrownValue; + root.lanes |= thrownValue; + var update$jscomp$0 = createRootErrorUpdate(root, wakeable, thrownValue); + enqueueCapturedUpdate(root, update$jscomp$0); + break a; + case 1: + wakeable = value; + var ctor = root.type, + instance = root.stateNode; + if (0 === (root.flags & 128) && ("function" === typeof ctor.getDerivedStateFromError || null !== instance && "function" === typeof instance.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) { + root.flags |= 65536; + thrownValue &= -thrownValue; + root.lanes |= thrownValue; + var update$34 = createClassErrorUpdate(root, wakeable, thrownValue); + enqueueCapturedUpdate(root, update$34); + break a; + } + } + root = root.return; + } while (null !== root); + } + 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 renderDidSuspendDelayIfPossible() { + if (0 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus || 2 === workInProgressRootExitStatus) workInProgressRootExitStatus = 4; + null === workInProgressRoot || 0 === (workInProgressRootSkippedLanes & 268435455) && 0 === (workInProgressRootInterleavedUpdatedLanes & 268435455) || markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes); + } + function renderRootSync(root, lanes) { + var prevExecutionContext = executionContext; + executionContext |= 2; + var prevDispatcher = pushDispatcher(); + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) workInProgressTransitions = null, prepareFreshStack(root, lanes); + do try { + workLoopSync(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } while (1); + resetContextDependencies(); + 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 && !_$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_shouldYield();) performUnitOfWork(workInProgress); + } + function performUnitOfWork(unitOfWork) { + var next = beginWork$1(unitOfWork.alternate, unitOfWork, subtreeRenderLanes); + unitOfWork.memoizedProps = unitOfWork.pendingProps; + null === next ? completeUnitOfWork(unitOfWork) : workInProgress = next; + ReactCurrentOwner$2.current = null; + } + function completeUnitOfWork(unitOfWork) { + var completedWork = unitOfWork; + do { + var current = completedWork.alternate; + unitOfWork = completedWork.return; + if (0 === (completedWork.flags & 32768)) { + if (current = completeWork(current, completedWork, subtreeRenderLanes), null !== current) { + workInProgress = current; + return; + } + } else { + current = unwindWork(current, completedWork); + if (null !== current) { + current.flags &= 32767; + workInProgress = current; + return; + } + if (null !== unitOfWork) unitOfWork.flags |= 32768, unitOfWork.subtreeFlags = 0, unitOfWork.deletions = null;else { + workInProgressRootExitStatus = 6; + workInProgress = null; + return; + } + } + completedWork = completedWork.sibling; + if (null !== completedWork) { + workInProgress = completedWork; + return; + } + workInProgress = completedWork = unitOfWork; + } while (null !== completedWork); + 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); + } + function commitRoot(root, recoverableErrors, transitions) { + var previousUpdateLanePriority = currentUpdatePriority, + prevTransition = ReactCurrentBatchConfig$2.transition; + try { + ReactCurrentBatchConfig$2.transition = null, currentUpdatePriority = 1, commitRootImpl(root, recoverableErrors, transitions, previousUpdateLanePriority); + } finally { + ReactCurrentBatchConfig$2.transition = prevTransition, currentUpdatePriority = previousUpdateLanePriority; + } + return null; + } + function commitRootImpl(root, recoverableErrors, transitions, renderPriorityLevel) { + do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) throw Error("Should not already be working."); + transitions = root.finishedWork; + var lanes = root.finishedLanes; + if (null === transitions) return null; + root.finishedWork = null; + root.finishedLanes = 0; + if (transitions === 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 = transitions.lanes | transitions.childLanes; + markRootFinished(root, remainingLanes); + root === workInProgressRoot && (workInProgress = workInProgressRoot = null, workInProgressRootRenderLanes = 0); + 0 === (transitions.subtreeFlags & 2064) && 0 === (transitions.flags & 2064) || rootDoesHavePassiveEffects || (rootDoesHavePassiveEffects = !0, scheduleCallback$1(_$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_NormalPriority, function () { + flushPassiveEffects(); + return null; + })); + remainingLanes = 0 !== (transitions.flags & 15990); + if (0 !== (transitions.subtreeFlags & 15990) || remainingLanes) { + remainingLanes = ReactCurrentBatchConfig$2.transition; + ReactCurrentBatchConfig$2.transition = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 1; + var prevExecutionContext = executionContext; + executionContext |= 4; + ReactCurrentOwner$2.current = null; + commitBeforeMutationEffects(root, transitions); + commitMutationEffectsOnFiber(transitions, root); + root.current = transitions; + commitLayoutEffects(transitions, root, lanes); + _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_requestPaint(); + executionContext = prevExecutionContext; + currentUpdatePriority = previousPriority; + ReactCurrentBatchConfig$2.transition = remainingLanes; + } else root.current = transitions; + rootDoesHavePassiveEffects && (rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = root, pendingPassiveEffectsLanes = lanes); + remainingLanes = root.pendingLanes; + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + onCommitRoot(transitions.stateNode, renderPriorityLevel); + ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now()); + if (null !== recoverableErrors) for (renderPriorityLevel = root.onRecoverableError, transitions = 0; transitions < recoverableErrors.length; transitions++) lanes = recoverableErrors[transitions], renderPriorityLevel(lanes.value, { + componentStack: lanes.stack, + digest: lanes.digest + }); + if (hasUncaughtError) throw hasUncaughtError = !1, root = firstUncaughtError, firstUncaughtError = null, root; + 0 !== (pendingPassiveEffectsLanes & 1) && 0 !== root.tag && flushPassiveEffects(); + remainingLanes = root.pendingLanes; + 0 !== (remainingLanes & 1) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : (nestedUpdateCount = 0, rootWithNestedUpdates = root) : nestedUpdateCount = 0; + flushSyncCallbacks(); + return null; + } + function flushPassiveEffects() { + if (null !== rootWithPendingPassiveEffects) { + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig$2.transition, + previousPriority = currentUpdatePriority; + try { + ReactCurrentBatchConfig$2.transition = null; + currentUpdatePriority = 16 > renderPriority ? 16 : renderPriority; + if (null === rootWithPendingPassiveEffects) var JSCompiler_inline_result = !1;else { + renderPriority = rootWithPendingPassiveEffects; + rootWithPendingPassiveEffects = null; + pendingPassiveEffectsLanes = 0; + if (0 !== (executionContext & 6)) throw Error("Cannot flush passive effects while already rendering."); + var prevExecutionContext = executionContext; + executionContext |= 4; + for (nextEffect = renderPriority.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(8, 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; + var sibling = fiber$jscomp$0.sibling, + returnFiber = fiber$jscomp$0.return; + detachFiberAfterEffects(fiber$jscomp$0); + if (fiber$jscomp$0 === fiberToDelete) { + nextEffect = null; + break; + } + if (null !== sibling) { + sibling.return = returnFiber; + nextEffect = sibling; + break; + } + nextEffect = returnFiber; + } + } + } + var previousFiber = fiber.alternate; + if (null !== previousFiber) { + var detachedChild = previousFiber.child; + if (null !== detachedChild) { + previousFiber.child = null; + do { + var detachedSibling = detachedChild.sibling; + detachedChild.sibling = null; + detachedChild = detachedSibling; + } while (null !== detachedChild); + } + } + nextEffect = fiber; + } + } + if (0 !== (fiber.subtreeFlags & 2064) && null !== child) child.return = fiber, nextEffect = child;else b: for (; null !== nextEffect;) { + fiber = nextEffect; + if (0 !== (fiber.flags & 2048)) switch (fiber.tag) { + case 0: + case 11: + case 15: + commitHookEffectListUnmount(9, fiber, fiber.return); + } + var sibling$jscomp$0 = fiber.sibling; + if (null !== sibling$jscomp$0) { + sibling$jscomp$0.return = fiber.return; + nextEffect = sibling$jscomp$0; + break b; + } + nextEffect = fiber.return; + } + } + var finishedWork = renderPriority.current; + for (nextEffect = finishedWork; null !== nextEffect;) { + child = nextEffect; + var firstChild = child.child; + if (0 !== (child.subtreeFlags & 2064) && null !== firstChild) firstChild.return = child, nextEffect = firstChild;else b: for (child = finishedWork; null !== nextEffect;) { + deletions = nextEffect; + if (0 !== (deletions.flags & 2048)) try { + switch (deletions.tag) { + case 0: + case 11: + case 15: + commitHookEffectListMount(9, deletions); + } + } catch (error) { + captureCommitPhaseError(deletions, deletions.return, error); + } + if (deletions === child) { + nextEffect = null; + break b; + } + var sibling$jscomp$1 = deletions.sibling; + if (null !== sibling$jscomp$1) { + sibling$jscomp$1.return = deletions.return; + nextEffect = sibling$jscomp$1; + break b; + } + nextEffect = deletions.return; + } + } + executionContext = prevExecutionContext; + flushSyncCallbacks(); + if (injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot) try { + injectedHook.onPostCommitFiberRoot(rendererID, renderPriority); + } catch (err) {} + JSCompiler_inline_result = !0; + } + return JSCompiler_inline_result; + } finally { + currentUpdatePriority = previousPriority, ReactCurrentBatchConfig$2.transition = prevTransition; + } + } + return !1; + } + function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { + sourceFiber = createCapturedValueAtFiber(error, sourceFiber); + sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 1); + rootFiber = enqueueUpdate(rootFiber, sourceFiber, 1); + sourceFiber = requestEventTime(); + null !== rootFiber && (markRootUpdated(rootFiber, 1, sourceFiber), ensureRootIsScheduled(rootFiber, sourceFiber)); + } + 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 = createCapturedValueAtFiber(error, sourceFiber); + sourceFiber = createClassErrorUpdate(nearestMountedAncestor, sourceFiber, 1); + nearestMountedAncestor = enqueueUpdate(nearestMountedAncestor, sourceFiber, 1); + sourceFiber = requestEventTime(); + null !== nearestMountedAncestor && (markRootUpdated(nearestMountedAncestor, 1, sourceFiber), ensureRootIsScheduled(nearestMountedAncestor, sourceFiber)); + 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 & 130023424) === workInProgressRootRenderLanes && 500 > _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now() - globalMostRecentFallbackTime ? prepareFreshStack(root, 0) : workInProgressRootPingedLanes |= pingedLanes); + ensureRootIsScheduled(root, wakeable); + } + function retryTimedOutBoundary(boundaryFiber, retryLane) { + 0 === retryLane && (0 === (boundaryFiber.mode & 1) ? retryLane = 1 : (retryLane = nextRetryLane, nextRetryLane <<= 1, 0 === (nextRetryLane & 130023424) && (nextRetryLane = 4194304))); + var eventTime = requestEventTime(); + boundaryFiber = markUpdateLaneFromFiberToRoot(boundaryFiber, retryLane); + null !== boundaryFiber && (markRootUpdated(boundaryFiber, retryLane, eventTime), ensureRootIsScheduled(boundaryFiber, eventTime)); + } + function retryDehydratedSuspenseBoundary(boundaryFiber) { + var suspenseState = boundaryFiber.memoizedState, + retryLane = 0; + null !== suspenseState && (retryLane = suspenseState.retryLane); + retryTimedOutBoundary(boundaryFiber, retryLane); + } + function resolveRetryWakeable(boundaryFiber, wakeable) { + var retryLane = 0; + switch (boundaryFiber.tag) { + case 13: + var retryCache = boundaryFiber.stateNode; + var suspenseState = boundaryFiber.memoizedState; + null !== suspenseState && (retryLane = suspenseState.retryLane); + break; + case 19: + retryCache = boundaryFiber.stateNode; + break; + default: + throw Error("Pinged unknown suspense boundary type. This is probably a bug in React."); + } + null !== retryCache && retryCache.delete(wakeable); + retryTimedOutBoundary(boundaryFiber, retryLane); + } + var beginWork$1; + beginWork$1 = function beginWork$1(current, workInProgress, renderLanes) { + if (null !== current) { + if (current.memoizedProps !== workInProgress.pendingProps || didPerformWorkStackCursor.current) didReceiveUpdate = !0;else { + if (0 === (current.lanes & renderLanes) && 0 === (workInProgress.flags & 128)) return didReceiveUpdate = !1, attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + } + } else didReceiveUpdate = !1; + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 2: + var Component = workInProgress.type; + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + var context = getMaskedContext(workInProgress, contextStackCursor.current); + prepareToReadContext(workInProgress, renderLanes); + context = renderWithHooks(null, workInProgress, Component, current, context, renderLanes); + workInProgress.flags |= 1; + if ("object" === typeof context && null !== context && "function" === typeof context.render && void 0 === context.$$typeof) { + workInProgress.tag = 1; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + if (isContextProvider(Component)) { + var hasContext = !0; + pushContextProvider(workInProgress); + } else hasContext = !1; + workInProgress.memoizedState = null !== context.state && void 0 !== context.state ? context.state : null; + initializeUpdateQueue(workInProgress); + context.updater = classComponentUpdater; + workInProgress.stateNode = context; + context._reactInternals = workInProgress; + mountClassInstance(workInProgress, Component, current, renderLanes); + workInProgress = finishClassComponent(null, workInProgress, Component, !0, hasContext, renderLanes); + } else workInProgress.tag = 0, reconcileChildren(null, workInProgress, context, renderLanes), workInProgress = workInProgress.child; + return workInProgress; + case 16: + Component = workInProgress.elementType; + a: { + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + context = Component._init; + Component = context(Component._payload); + workInProgress.type = Component; + context = workInProgress.tag = resolveLazyComponentTag(Component); + current = resolveDefaultProps(Component, current); + switch (context) { + case 0: + workInProgress = updateFunctionComponent(null, workInProgress, Component, current, renderLanes); + break a; + case 1: + workInProgress = updateClassComponent(null, workInProgress, Component, current, renderLanes); + break a; + case 11: + workInProgress = updateForwardRef(null, workInProgress, Component, current, renderLanes); + break a; + case 14: + workInProgress = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, current), renderLanes); + break a; + } + throw Error("Element type is invalid. Received a promise that resolves to: " + Component + ". Lazy element type must resolve to a class or function."); + } + return workInProgress; + case 0: + return Component = workInProgress.type, context = workInProgress.pendingProps, context = workInProgress.elementType === Component ? context : resolveDefaultProps(Component, context), updateFunctionComponent(current, workInProgress, Component, context, renderLanes); + case 1: + return Component = workInProgress.type, context = workInProgress.pendingProps, context = workInProgress.elementType === Component ? context : resolveDefaultProps(Component, context), updateClassComponent(current, workInProgress, Component, context, renderLanes); + case 3: + pushHostRootContext(workInProgress); + if (null === current) throw Error("Should have a current fiber. This is a bug in React."); + context = workInProgress.pendingProps; + Component = workInProgress.memoizedState.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, context, null, renderLanes); + context = workInProgress.memoizedState.element; + context === Component ? workInProgress = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) : (reconcileChildren(current, workInProgress, context, renderLanes), workInProgress = workInProgress.child); + return workInProgress; + case 5: + return pushHostContext(workInProgress), Component = workInProgress.pendingProps.children, markRef(current, workInProgress), reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child; + case 6: + return null; + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: + return pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo), Component = workInProgress.pendingProps, null === current ? workInProgress.child = reconcileChildFibers(workInProgress, null, Component, renderLanes) : reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child; + case 11: + return Component = workInProgress.type, context = workInProgress.pendingProps, context = workInProgress.elementType === Component ? context : resolveDefaultProps(Component, context), updateForwardRef(current, workInProgress, Component, context, renderLanes); + case 7: + return reconcileChildren(current, workInProgress, workInProgress.pendingProps, renderLanes), workInProgress.child; + case 8: + return reconcileChildren(current, workInProgress, workInProgress.pendingProps.children, renderLanes), workInProgress.child; + case 12: + return reconcileChildren(current, workInProgress, workInProgress.pendingProps.children, renderLanes), workInProgress.child; + case 10: + a: { + Component = workInProgress.type._context; + context = workInProgress.pendingProps; + hasContext = workInProgress.memoizedProps; + var newValue = context.value; + push(valueCursor, Component._currentValue); + Component._currentValue = newValue; + if (null !== hasContext) if (objectIs(hasContext.value, newValue)) { + if (hasContext.children === context.children && !didPerformWorkStackCursor.current) { + workInProgress = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + break a; + } + } else for (hasContext = workInProgress.child, null !== hasContext && (hasContext.return = workInProgress); null !== hasContext;) { + var list = hasContext.dependencies; + if (null !== list) { + newValue = hasContext.child; + for (var dependency = list.firstContext; null !== dependency;) { + if (dependency.context === Component) { + if (1 === hasContext.tag) { + dependency = createUpdate(-1, renderLanes & -renderLanes); + dependency.tag = 2; + var updateQueue = hasContext.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; + } + } + hasContext.lanes |= renderLanes; + dependency = hasContext.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath(hasContext.return, renderLanes, workInProgress); + list.lanes |= renderLanes; + break; + } + dependency = dependency.next; + } + } else if (10 === hasContext.tag) newValue = hasContext.type === workInProgress.type ? null : hasContext.child;else if (18 === hasContext.tag) { + newValue = hasContext.return; + if (null === newValue) throw Error("We just came from a parent so we must have had a parent. This is a bug in React."); + newValue.lanes |= renderLanes; + list = newValue.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(newValue, renderLanes, workInProgress); + newValue = hasContext.sibling; + } else newValue = hasContext.child; + if (null !== newValue) newValue.return = hasContext;else for (newValue = hasContext; null !== newValue;) { + if (newValue === workInProgress) { + newValue = null; + break; + } + hasContext = newValue.sibling; + if (null !== hasContext) { + hasContext.return = newValue.return; + newValue = hasContext; + break; + } + newValue = newValue.return; + } + hasContext = newValue; + } + reconcileChildren(current, workInProgress, context.children, renderLanes); + workInProgress = workInProgress.child; + } + return workInProgress; + case 9: + return context = workInProgress.type, Component = workInProgress.pendingProps.children, prepareToReadContext(workInProgress, renderLanes), context = readContext(context), Component = Component(context), workInProgress.flags |= 1, reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child; + case 14: + return Component = workInProgress.type, context = resolveDefaultProps(Component, workInProgress.pendingProps), context = resolveDefaultProps(Component.type, context), updateMemoComponent(current, workInProgress, Component, context, renderLanes); + case 15: + return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, renderLanes); + case 17: + return Component = workInProgress.type, context = workInProgress.pendingProps, context = workInProgress.elementType === Component ? context : resolveDefaultProps(Component, context), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), workInProgress.tag = 1, isContextProvider(Component) ? (current = !0, pushContextProvider(workInProgress)) : current = !1, prepareToReadContext(workInProgress, renderLanes), constructClassInstance(workInProgress, Component, context), mountClassInstance(workInProgress, Component, context, renderLanes), finishClassComponent(null, workInProgress, Component, !0, current, renderLanes); + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 22: + 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 scheduleCallback$1(priorityLevel, callback) { + return _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_scheduleCallback(priorityLevel, callback); + } + 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; + } + 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.flags = current.flags & 14680064; + 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; + 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_STRICT_MODE_TYPE: + fiberTag = 8; + mode |= 8; + break; + case REACT_PROFILER_TYPE: + return type = createFiber(12, pendingProps, key, mode | 2), type.elementType = REACT_PROFILER_TYPE, type.lanes = lanes, type; + case REACT_SUSPENSE_TYPE: + return type = createFiber(13, pendingProps, key, mode), 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); + 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; + pendingProps.stateNode = { + isHidden: !1 + }; + 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, identifierPrefix, onRecoverableError) { + this.tag = tag; + this.containerInfo = containerInfo; + this.finishedWork = this.pingCache = this.current = this.pendingChildren = null; + this.timeoutHandle = -1; + this.callbackNode = this.pendingContext = this.context = 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.identifierPrefix = identifierPrefix; + this.onRecoverableError = onRecoverableError; + } + 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."); + component = Object.keys(component).join(","); + throw Error("Argument appears to not be a ReactComponent. 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); + element = enqueueUpdate(current, container, lane); + null !== element && (scheduleUpdateOnFiber(element, current, lane, eventTime), 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 onRecoverableError(error) { + console.error(error); + } + function unmountComponentAtNode(containerTag) { + var root = roots.get(containerTag); + root && updateContainer(null, root, null, function () { + roots.delete(containerTag); + }); + } + batchedUpdatesImpl = function batchedUpdatesImpl(fn, a) { + var prevExecutionContext = executionContext; + executionContext |= 1; + try { + return fn(a); + } finally { + executionContext = prevExecutionContext, 0 === executionContext && (workInProgressRootRenderTargetTime = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now() + 500, includesLegacySyncCallbacks && flushSyncCallbacks()); + } + }; + var roots = new Map(), + devToolsConfig$jscomp$inline_979 = { + findFiberByHostInstance: getInstanceFromTag, + bundleType: 0, + version: "18.2.0-next-9e3b772b8-20220608", + rendererPackageName: "react-native-renderer", + rendererConfig: { + getInspectorDataForViewTag: function getInspectorDataForViewTag() { + 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_1247 = { + bundleType: devToolsConfig$jscomp$inline_979.bundleType, + version: devToolsConfig$jscomp$inline_979.version, + rendererPackageName: devToolsConfig$jscomp$inline_979.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_979.rendererConfig, + overrideHookState: null, + overrideHookStateDeletePath: null, + overrideHookStateRenamePath: null, + overrideProps: null, + overridePropsDeletePath: null, + overridePropsRenamePath: null, + setErrorHandler: null, + setSuspenseHandler: null, + scheduleUpdate: null, + currentDispatcherRef: ReactSharedInternals.ReactCurrentDispatcher, + findHostInstanceByFiber: function findHostInstanceByFiber(fiber) { + fiber = findCurrentHostFiber(fiber); + return null === fiber ? null : fiber.stateNode; + }, + findFiberByHostInstance: devToolsConfig$jscomp$inline_979.findFiberByHostInstance || emptyFindFiberByHostInstance, + findHostInstancesForRefresh: null, + scheduleRefresh: null, + scheduleRoot: null, + setRefreshHandler: null, + getCurrentFiber: null, + reconcilerVersion: "18.2.0-next-9e3b772b8-20220608" + }; + if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { + var hook$jscomp$inline_1248 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + if (!hook$jscomp$inline_1248.isDisabled && hook$jscomp$inline_1248.supportsFiber) try { + rendererID = hook$jscomp$inline_1248.inject(internals$jscomp$inline_1247), injectedHook = hook$jscomp$inline_1248; + } catch (err) {} + } + exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { + computeComponentStackForErrorReporting: function computeComponentStackForErrorReporting(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 && (null != handle._internalInstanceHandle ? (handle = handle._internalInstanceHandle.stateNode, null != handle && nativeFabricUIManager.dispatchCommand(handle.node, command, args)) : _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/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.getInspectorDataForInstance = void 0; + exports.render = function (element, containerTag, callback) { + var root = roots.get(containerTag); + if (!root) { + root = new FiberRootNode(containerTag, 0, !1, "", onRecoverableError); + var JSCompiler_inline_result = createFiber(3, null, null, 0); + root.current = JSCompiler_inline_result; + JSCompiler_inline_result.stateNode = root; + JSCompiler_inline_result.memoizedState = { + element: null, + isDehydrated: !1, + cache: null, + transitions: null, + pendingSuspenseBoundaries: 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 && (null != handle._internalInstanceHandle ? (handle = handle._internalInstanceHandle.stateNode, null != handle && nativeFabricUIManager.sendAccessibilityEvent(handle.node, eventType)) : _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").legacySendAccessibilityEvent(handle._nativeTag, eventType)); + }; + exports.unmountComponentAtNode = unmountComponentAtNode; + exports.unmountComponentAtNodeAndRemoveContainer = function (containerTag) { + unmountComponentAtNode(containerTag); + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.removeRootView(containerTag); + }; + exports.unstable_batchedUpdates = batchedUpdates; +},442,[68,65,279,439],"node_modules\\react-native\\Libraries\\Renderer\\implementations\\ReactNativeRenderer-prod.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _reactJsxRuntime = _$$_REQUIRE(_dependencyMap[0], "react/jsx-runtime"); + var _classCallCheck = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass"); + var _possibleConstructorReturn = _$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn"); + var _getPrototypeOf = _$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf"); + var _inherits = _$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Inspector\\ElementProperties.js"; + function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + var React = _$$_REQUIRE(_dependencyMap[6], "react"); + var ElementProperties = /*#__PURE__*/function (_React$Component) { + function ElementProperties() { + _classCallCheck(this, ElementProperties); + return _callSuper(this, ElementProperties, arguments); + } + _inherits(ElementProperties, _React$Component); + return _createClass(ElementProperties, [{ + key: "render", + value: function render() { + var _this = this; + var style = _$$_REQUIRE(_dependencyMap[7], "../StyleSheet/flattenStyle")(this.props.style); + var selection = this.props.selection; + var openFileButton; + var source = this.props.source; + var _ref = source || {}, + fileName = _ref.fileName, + lineNumber = _ref.lineNumber; + if (fileName && lineNumber) { + var parts = fileName.split('/'); + var fileNameShort = parts[parts.length - 1]; + openFileButton = /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[8], "../Components/Touchable/TouchableHighlight"), { + style: styles.openButton, + onPress: _$$_REQUIRE(_dependencyMap[9], "../Core/Devtools/openFileInEditor").bind(null, fileName, lineNumber), + children: /*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[10], "../Text/Text"), { + style: styles.openButtonTitle, + numberOfLines: 1, + children: [fileNameShort, ":", lineNumber] + }) + }); + } + // Without the `TouchableWithoutFeedback`, taps on this inspector pane + // would change the inspected element to whatever is under the inspector + return /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[11], "../Components/Touchable/TouchableWithoutFeedback"), { + children: /*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[12], "../Components/View/View"), { + style: styles.info, + children: [/*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[12], "../Components/View/View"), { + style: styles.breadcrumb, + children: _$$_REQUIRE(_dependencyMap[13], "../Utilities/mapWithSeparator")(this.props.hierarchy, function (hierarchyItem, i) { + return /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[8], "../Components/Touchable/TouchableHighlight"), { + style: [styles.breadItem, i === selection && styles.selected] + // $FlowFixMe[not-a-function] found when converting React.createClass to ES6 + , + onPress: function onPress() { + return _this.props.setSelection(i); + }, + children: /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[10], "../Text/Text"), { + style: styles.breadItemText, + children: hierarchyItem.name + }) + }, 'item-' + i); + }, function (i) { + return /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[10], "../Text/Text"), { + style: styles.breadSep, + children: "\u25B8" + }, 'sep-' + i); + }) + }), /*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[12], "../Components/View/View"), { + style: styles.row, + children: [/*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[12], "../Components/View/View"), { + style: styles.col, + children: [/*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[14], "./StyleInspector"), { + style: style + }), openFileButton] + }), /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[15], "./BoxInspector"), { + style: style, + frame: this.props.frame + })] + })] + }) + }); + } + }]); + }(React.Component); + var styles = _$$_REQUIRE(_dependencyMap[16], "../StyleSheet/StyleSheet").create({ + breadSep: { + fontSize: 8, + color: 'white' + }, + breadcrumb: { + flexDirection: 'row', + flexWrap: 'wrap', + alignItems: 'flex-start', + marginBottom: 5 + }, + selected: { + borderColor: 'white', + borderRadius: 5 + }, + breadItem: { + borderWidth: 1, + borderColor: 'transparent', + marginHorizontal: 2 + }, + breadItemText: { + fontSize: 10, + color: 'white', + marginHorizontal: 5 + }, + row: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between' + }, + col: { + flex: 1 + }, + info: { + padding: 10 + }, + openButton: { + padding: 10, + backgroundColor: '#000', + marginVertical: 5, + marginRight: 5, + borderRadius: 2 + }, + openButtonTitle: { + color: 'white', + fontSize: 8 + } + }); + module.exports = ElementProperties; +},443,[106,18,19,23,25,28,65,222,444,445,310,446,241,447,448,449,266],"node_modules\\react-native\\Libraries\\Inspector\\ElementProperties.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _objectWithoutProperties2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/objectWithoutProperties")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../../Components/View/View")); + var _Pressability = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "../../Pressability/Pressability")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "../../StyleSheet/StyleSheet")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "../../Utilities/Platform")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[12], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Components\\Touchable\\TouchableHighlight.js", + _this3 = this; + var _excluded = ["onBlur", "onFocus"]; + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + /** + * A wrapper for making views respond properly to touches. + * On press down, the opacity of the wrapped view is decreased, which allows + * the underlay color to show through, darkening or tinting the view. + * + * The underlay comes from wrapping the child in a new View, which can affect + * layout, and sometimes cause unwanted visual artifacts if not used correctly, + * for example if the backgroundColor of the wrapped view isn't explicitly set + * to an opaque color. + * + * TouchableHighlight must have one child (not zero or more than one). + * If you wish to have several child components, wrap them in a View. + * + * Example: + * + * ``` + * renderButton: function() { + * return ( + * + * + * + * ); + * }, + * ``` + * + * + * ### Example + * + * ```ReactNativeWebPlayer + * import React, { Component } from 'react' + * import { + * AppRegistry, + * StyleSheet, + * TouchableHighlight, + * Text, + * View, + * } from 'react-native' + * + * class App extends Component { + * constructor(props) { + * super(props) + * this.state = { count: 0 } + * } + * + * onPress = () => { + * this.setState({ + * count: this.state.count+1 + * }) + * } + * + * render() { + * return ( + * + * + * Touch Here + * + * + * + * { this.state.count !== 0 ? this.state.count: null} + * + * + * + * ) + * } + * } + * + * const styles = StyleSheet.create({ + * container: { + * flex: 1, + * justifyContent: 'center', + * paddingHorizontal: 10 + * }, + * button: { + * alignItems: 'center', + * backgroundColor: '#DDDDDD', + * padding: 10 + * }, + * countContainer: { + * alignItems: 'center', + * padding: 10 + * }, + * countText: { + * color: '#FF00FF' + * } + * }) + * + * AppRegistry.registerComponent('App', () => App) + * ``` + * + */ + var TouchableHighlight = /*#__PURE__*/function (_React$Component) { + function TouchableHighlight() { + var _this; + (0, _classCallCheck2.default)(this, TouchableHighlight); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, TouchableHighlight, [].concat(args)); + _this._isMounted = false; + _this.state = { + pressability: new _Pressability.default(_this._createPressabilityConfig()), + extraStyles: _this.props.testOnly_pressed === true ? _this._createExtraStyles() : null + }; + return _this; + } + (0, _inherits2.default)(TouchableHighlight, _React$Component); + return (0, _createClass2.default)(TouchableHighlight, [{ + key: "_createPressabilityConfig", + value: function _createPressabilityConfig() { + var _this$props$accessibi, + _this2 = this; + return { + cancelable: !this.props.rejectResponderTermination, + disabled: this.props.disabled != null ? this.props.disabled : (_this$props$accessibi = this.props.accessibilityState) == null ? void 0 : _this$props$accessibi.disabled, + hitSlop: this.props.hitSlop, + delayLongPress: this.props.delayLongPress, + delayPressIn: this.props.delayPressIn, + delayPressOut: this.props.delayPressOut, + minPressDuration: 0, + pressRectOffset: this.props.pressRetentionOffset, + android_disableSound: this.props.touchSoundDisabled, + onBlur: function onBlur(event) { + if (_Platform.default.isTV) { + _this2._hideUnderlay(); + } + if (_this2.props.onBlur != null) { + _this2.props.onBlur(event); + } + }, + onFocus: function onFocus(event) { + if (_Platform.default.isTV) { + _this2._showUnderlay(); + } + if (_this2.props.onFocus != null) { + _this2.props.onFocus(event); + } + }, + onLongPress: this.props.onLongPress, + onPress: function onPress(event) { + if (_this2._hideTimeout != null) { + clearTimeout(_this2._hideTimeout); + } + if (!_Platform.default.isTV) { + var _this2$props$delayPre; + _this2._showUnderlay(); + _this2._hideTimeout = setTimeout(function () { + _this2._hideUnderlay(); + }, (_this2$props$delayPre = _this2.props.delayPressOut) != null ? _this2$props$delayPre : 0); + } + if (_this2.props.onPress != null) { + _this2.props.onPress(event); + } + }, + onPressIn: function onPressIn(event) { + if (_this2._hideTimeout != null) { + clearTimeout(_this2._hideTimeout); + _this2._hideTimeout = null; + } + _this2._showUnderlay(); + if (_this2.props.onPressIn != null) { + _this2.props.onPressIn(event); + } + }, + onPressOut: function onPressOut(event) { + if (_this2._hideTimeout == null) { + _this2._hideUnderlay(); + } + if (_this2.props.onPressOut != null) { + _this2.props.onPressOut(event); + } + } + }; + } + }, { + key: "_createExtraStyles", + value: function _createExtraStyles() { + var _this$props$activeOpa; + return { + child: { + opacity: (_this$props$activeOpa = this.props.activeOpacity) != null ? _this$props$activeOpa : 0.85 + }, + underlay: { + backgroundColor: this.props.underlayColor === undefined ? 'black' : this.props.underlayColor + } + }; + } + }, { + key: "_showUnderlay", + value: function _showUnderlay() { + if (!this._isMounted || !this._hasPressHandler()) { + return; + } + this.setState({ + extraStyles: this._createExtraStyles() + }); + if (this.props.onShowUnderlay != null) { + this.props.onShowUnderlay(); + } + } + }, { + key: "_hideUnderlay", + value: function _hideUnderlay() { + if (this._hideTimeout != null) { + clearTimeout(this._hideTimeout); + this._hideTimeout = null; + } + if (this.props.testOnly_pressed === true) { + return; + } + if (this._hasPressHandler()) { + this.setState({ + extraStyles: null + }); + if (this.props.onHideUnderlay != null) { + this.props.onHideUnderlay(); + } + } + } + }, { + key: "_hasPressHandler", + value: function _hasPressHandler() { + return this.props.onPress != null || this.props.onPressIn != null || this.props.onPressOut != null || this.props.onLongPress != null; + } + }, { + key: "render", + value: function render() { + var _this$props$ariaValu, _this$props$accessibi2, _this$props$ariaValu2, _this$props$accessibi3, _this$props$ariaValu3, _this$props$accessibi4, _this$props$ariaValu4, _this$props$accessibi5, _this$props$ariaLive, _this$props$ariaLabe, _this$props$ariaModa, _this$props$ariaHidd, _this$state$extraStyl, _this$props$id, _this$state$extraStyl2; + var child = React.Children.only(this.props.children); + + // BACKWARD-COMPATIBILITY: Focus and blur events were never supported before + // adopting `Pressability`, so preserve that behavior. + var _this$state$pressabil = this.state.pressability.getEventHandlers(), + onBlur = _this$state$pressabil.onBlur, + onFocus = _this$state$pressabil.onFocus, + eventHandlersWithoutBlurAndFocus = (0, _objectWithoutProperties2.default)(_this$state$pressabil, _excluded); + var accessibilityState = this.props.disabled != null ? Object.assign({}, this.props.accessibilityState, { + disabled: this.props.disabled + }) : this.props.accessibilityState; + var accessibilityValue = { + max: (_this$props$ariaValu = this.props['aria-valuemax']) != null ? _this$props$ariaValu : (_this$props$accessibi2 = this.props.accessibilityValue) == null ? void 0 : _this$props$accessibi2.max, + min: (_this$props$ariaValu2 = this.props['aria-valuemin']) != null ? _this$props$ariaValu2 : (_this$props$accessibi3 = this.props.accessibilityValue) == null ? void 0 : _this$props$accessibi3.min, + now: (_this$props$ariaValu3 = this.props['aria-valuenow']) != null ? _this$props$ariaValu3 : (_this$props$accessibi4 = this.props.accessibilityValue) == null ? void 0 : _this$props$accessibi4.now, + text: (_this$props$ariaValu4 = this.props['aria-valuetext']) != null ? _this$props$ariaValu4 : (_this$props$accessibi5 = this.props.accessibilityValue) == null ? void 0 : _this$props$accessibi5.text + }; + var accessibilityLiveRegion = this.props['aria-live'] === 'off' ? 'none' : (_this$props$ariaLive = this.props['aria-live']) != null ? _this$props$ariaLive : this.props.accessibilityLiveRegion; + var accessibilityLabel = (_this$props$ariaLabe = this.props['aria-label']) != null ? _this$props$ariaLabe : this.props.accessibilityLabel; + return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, Object.assign({ + accessible: this.props.accessible !== false, + accessibilityLabel: accessibilityLabel, + accessibilityHint: this.props.accessibilityHint, + accessibilityLanguage: this.props.accessibilityLanguage, + accessibilityRole: this.props.accessibilityRole, + accessibilityState: accessibilityState, + accessibilityValue: accessibilityValue, + accessibilityActions: this.props.accessibilityActions, + onAccessibilityAction: this.props.onAccessibilityAction, + importantForAccessibility: this.props['aria-hidden'] === true ? 'no-hide-descendants' : this.props.importantForAccessibility, + accessibilityViewIsModal: (_this$props$ariaModa = this.props['aria-modal']) != null ? _this$props$ariaModa : this.props.accessibilityViewIsModal, + accessibilityLiveRegion: accessibilityLiveRegion, + accessibilityElementsHidden: (_this$props$ariaHidd = this.props['aria-hidden']) != null ? _this$props$ariaHidd : this.props.accessibilityElementsHidden, + style: _StyleSheet.default.compose(this.props.style, (_this$state$extraStyl = this.state.extraStyles) == null ? void 0 : _this$state$extraStyl.underlay), + onLayout: this.props.onLayout, + hitSlop: this.props.hitSlop, + hasTVPreferredFocus: this.props.hasTVPreferredFocus, + nextFocusDown: this.props.nextFocusDown, + nextFocusForward: this.props.nextFocusForward, + nextFocusLeft: this.props.nextFocusLeft, + nextFocusRight: this.props.nextFocusRight, + nextFocusUp: this.props.nextFocusUp, + focusable: this.props.focusable !== false && this.props.onPress !== undefined, + nativeID: (_this$props$id = this.props.id) != null ? _this$props$id : this.props.nativeID, + testID: this.props.testID, + ref: this.props.hostRef + }, eventHandlersWithoutBlurAndFocus, { + children: [React.cloneElement(child, { + style: _StyleSheet.default.compose(child.props.style, (_this$state$extraStyl2 = this.state.extraStyles) == null ? void 0 : _this$state$extraStyl2.child) + }), __DEV__ ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[13], "../../Pressability/PressabilityDebug").PressabilityDebugView, { + color: "green", + hitSlop: this.props.hitSlop + }) : null] + })); + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + this._isMounted = true; + this.state.pressability.configure(this._createPressabilityConfig()); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + this.state.pressability.configure(this._createPressabilityConfig()); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this._isMounted = false; + if (this._hideTimeout != null) { + clearTimeout(this._hideTimeout); + } + this.state.pressability.reset(); + } + }]); + }(React.Component); + var Touchable = React.forwardRef(function (props, hostRef) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(TouchableHighlight, Object.assign({}, props, { + hostRef: hostRef + })); + }); + Touchable.displayName = 'TouchableHighlight'; + module.exports = Touchable; +},444,[6,166,18,19,23,25,28,241,312,266,34,65,106,304],"node_modules\\react-native\\Libraries\\Components\\Touchable\\TouchableHighlight.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + function openFileInEditor(file, lineNumber) { + // $FlowFixMe[unused-promise] + fetch(_$$_REQUIRE(_dependencyMap[0], "./getDevServer")().url + 'open-stack-frame', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + file: file, + lineNumber: lineNumber + }) + }); + } + module.exports = openFileInEditor; +},445,[102],"node_modules\\react-native\\Libraries\\Core\\Devtools\\openFileInEditor.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _objectWithoutProperties2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/objectWithoutProperties")); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "@babel/runtime/helpers/inherits")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../../Components/View/View")); + var _Pressability = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "../../Pressability/Pressability")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[10], "react/jsx-runtime"); + var _excluded = ["onBlur", "onFocus"], + _excluded2 = ["aria-disabled"]; + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Components\\Touchable\\TouchableWithoutFeedback.js"; + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var PASSTHROUGH_PROPS = ['accessibilityActions', 'accessibilityElementsHidden', 'accessibilityHint', 'accessibilityLanguage', 'accessibilityIgnoresInvertColors', 'accessibilityLabel', 'accessibilityLiveRegion', 'accessibilityRole', 'accessibilityValue', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext', 'accessibilityViewIsModal', 'aria-modal', 'hitSlop', 'importantForAccessibility', 'nativeID', 'onAccessibilityAction', 'onBlur', 'onFocus', 'onLayout', 'testID']; + var TouchableWithoutFeedback = /*#__PURE__*/function (_React$Component) { + function TouchableWithoutFeedback() { + var _this; + (0, _classCallCheck2.default)(this, TouchableWithoutFeedback); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, TouchableWithoutFeedback, [].concat(args)); + _this.state = { + pressability: new _Pressability.default(createPressabilityConfig(_this.props)) + }; + return _this; + } + (0, _inherits2.default)(TouchableWithoutFeedback, _React$Component); + return (0, _createClass2.default)(TouchableWithoutFeedback, [{ + key: "render", + value: function render() { + var _this$props$ariaBusy, _this$props$accessibi, _this$props$ariaChec, _this$props$accessibi2, _this$props$ariaDisa, _this$props$accessibi3, _this$props$ariaExpa, _this$props$accessibi4, _this$props$ariaSele, _this$props$accessibi5, _this$props$ariaHidd, _this$props$id; + var element = React.Children.only(this.props.children); + var children = [element.props.children]; + var ariaLive = this.props['aria-live']; + if (__DEV__) { + if (element.type === _View.default) { + children.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_$$_REQUIRE(_dependencyMap[11], "../../Pressability/PressabilityDebug").PressabilityDebugView, { + color: "red", + hitSlop: this.props.hitSlop + })); + } + } + var _accessibilityState = { + busy: (_this$props$ariaBusy = this.props['aria-busy']) != null ? _this$props$ariaBusy : (_this$props$accessibi = this.props.accessibilityState) == null ? void 0 : _this$props$accessibi.busy, + checked: (_this$props$ariaChec = this.props['aria-checked']) != null ? _this$props$ariaChec : (_this$props$accessibi2 = this.props.accessibilityState) == null ? void 0 : _this$props$accessibi2.checked, + disabled: (_this$props$ariaDisa = this.props['aria-disabled']) != null ? _this$props$ariaDisa : (_this$props$accessibi3 = this.props.accessibilityState) == null ? void 0 : _this$props$accessibi3.disabled, + expanded: (_this$props$ariaExpa = this.props['aria-expanded']) != null ? _this$props$ariaExpa : (_this$props$accessibi4 = this.props.accessibilityState) == null ? void 0 : _this$props$accessibi4.expanded, + selected: (_this$props$ariaSele = this.props['aria-selected']) != null ? _this$props$ariaSele : (_this$props$accessibi5 = this.props.accessibilityState) == null ? void 0 : _this$props$accessibi5.selected + }; + + // BACKWARD-COMPATIBILITY: Focus and blur events were never supported before + // adopting `Pressability`, so preserve that behavior. + var _this$state$pressabil = this.state.pressability.getEventHandlers(), + onBlur = _this$state$pressabil.onBlur, + onFocus = _this$state$pressabil.onFocus, + eventHandlersWithoutBlurAndFocus = (0, _objectWithoutProperties2.default)(_this$state$pressabil, _excluded); + var elementProps = Object.assign({}, eventHandlersWithoutBlurAndFocus, { + accessible: this.props.accessible !== false, + accessibilityState: this.props.disabled != null ? Object.assign({}, _accessibilityState, { + disabled: this.props.disabled + }) : _accessibilityState, + focusable: this.props.focusable !== false && this.props.onPress !== undefined, + accessibilityElementsHidden: (_this$props$ariaHidd = this.props['aria-hidden']) != null ? _this$props$ariaHidd : this.props.accessibilityElementsHidden, + importantForAccessibility: this.props['aria-hidden'] === true ? 'no-hide-descendants' : this.props.importantForAccessibility, + accessibilityLiveRegion: ariaLive === 'off' ? 'none' : ariaLive != null ? ariaLive : this.props.accessibilityLiveRegion, + nativeID: (_this$props$id = this.props.id) != null ? _this$props$id : this.props.nativeID + }); + for (var prop of PASSTHROUGH_PROPS) { + if (this.props[prop] !== undefined) { + elementProps[prop] = this.props[prop]; + } + } + + // $FlowFixMe[incompatible-call] + return React.cloneElement.apply(React, [element, elementProps].concat(children)); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() { + this.state.pressability.configure(createPressabilityConfig(this.props)); + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + this.state.pressability.configure(createPressabilityConfig(this.props)); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.state.pressability.reset(); + } + }]); + }(React.Component); + function createPressabilityConfig(_ref) { + var _props$accessibilityS; + var ariaDisabled = _ref['aria-disabled'], + props = (0, _objectWithoutProperties2.default)(_ref, _excluded2); + var accessibilityStateDisabled = ariaDisabled != null ? ariaDisabled : (_props$accessibilityS = props.accessibilityState) == null ? void 0 : _props$accessibilityS.disabled; + return { + cancelable: !props.rejectResponderTermination, + disabled: props.disabled !== null ? props.disabled : accessibilityStateDisabled, + hitSlop: props.hitSlop, + delayLongPress: props.delayLongPress, + delayPressIn: props.delayPressIn, + delayPressOut: props.delayPressOut, + minPressDuration: 0, + pressRectOffset: props.pressRetentionOffset, + android_disableSound: props.touchSoundDisabled, + onBlur: props.onBlur, + onFocus: props.onFocus, + onLongPress: props.onLongPress, + onPress: props.onPress, + onPressIn: props.onPressIn, + onPressOut: props.onPressOut + }; + } + TouchableWithoutFeedback.displayName = 'TouchableWithoutFeedback'; + module.exports = TouchableWithoutFeedback; +},446,[6,166,18,19,23,25,28,241,312,65,106,304],"node_modules\\react-native\\Libraries\\Components\\Touchable\\TouchableWithoutFeedback.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + function mapWithSeparator(items, itemRenderer, spacerRenderer) { + var mapped = []; + if (items.length > 0) { + mapped.push(itemRenderer(items[0], 0, items)); + for (var ii = 1; ii < items.length; ii++) { + mapped.push(spacerRenderer(ii - 1), itemRenderer(items[ii], ii, items)); + } + } + return mapped; + } + module.exports = mapWithSeparator; +},447,[],"node_modules\\react-native\\Libraries\\Utilities\\mapWithSeparator.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _reactJsxRuntime = _$$_REQUIRE(_dependencyMap[0], "react/jsx-runtime"); + var _classCallCheck = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass"); + var _possibleConstructorReturn = _$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn"); + var _getPrototypeOf = _$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf"); + var _inherits = _$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Inspector\\StyleInspector.js"; + function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + var React = _$$_REQUIRE(_dependencyMap[6], "react"); + var StyleInspector = /*#__PURE__*/function (_React$Component) { + function StyleInspector() { + _classCallCheck(this, StyleInspector); + return _callSuper(this, StyleInspector, arguments); + } + _inherits(StyleInspector, _React$Component); + return _createClass(StyleInspector, [{ + key: "render", + value: function render() { + var _this = this; + if (!this.props.style) { + return /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[7], "../Text/Text"), { + style: styles.noStyle, + children: "No style" + }); + } + var names = Object.keys(this.props.style); + return /*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + style: styles.container, + children: [/*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + children: names.map(function (name) { + return /*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[7], "../Text/Text"), { + style: styles.attr, + children: [name, ":"] + }, name); + }) + }), /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + children: names.map(function (name) { + var value = _this.props.style[name]; + return /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[7], "../Text/Text"), { + style: styles.value, + children: typeof value !== 'string' && typeof value !== 'number' ? JSON.stringify(value) : value + }, name); + }) + })] + }); + } + }]); + }(React.Component); + var styles = _$$_REQUIRE(_dependencyMap[9], "../StyleSheet/StyleSheet").create({ + container: { + flexDirection: 'row' + }, + attr: { + fontSize: 10, + color: '#ccc' + }, + value: { + fontSize: 10, + color: 'white', + marginLeft: 10 + }, + noStyle: { + color: 'white', + fontSize: 10 + } + }); + module.exports = StyleInspector; +},448,[106,18,19,23,25,28,65,310,241,266],"node_modules\\react-native\\Libraries\\Inspector\\StyleInspector.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _reactJsxRuntime = _$$_REQUIRE(_dependencyMap[0], "react/jsx-runtime"); + var _classCallCheck = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass"); + var _possibleConstructorReturn = _$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn"); + var _getPrototypeOf = _$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf"); + var _inherits = _$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Inspector\\BoxInspector.js"; + function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + var React = _$$_REQUIRE(_dependencyMap[6], "react"); + var blank = { + top: 0, + left: 0, + right: 0, + bottom: 0 + }; + var BoxInspector = /*#__PURE__*/function (_React$Component) { + function BoxInspector() { + _classCallCheck(this, BoxInspector); + return _callSuper(this, BoxInspector, arguments); + } + _inherits(BoxInspector, _React$Component); + return _createClass(BoxInspector, [{ + key: "render", + value: function render() { + var frame = this.props.frame; + var style = this.props.style; + var margin = style && _$$_REQUIRE(_dependencyMap[7], "./resolveBoxStyle")('margin', style) || blank; + var padding = style && _$$_REQUIRE(_dependencyMap[7], "./resolveBoxStyle")('padding', style) || blank; + return /*#__PURE__*/_reactJsxRuntime.jsx(BoxContainer, { + title: "margin", + titleStyle: styles.marginLabel, + box: margin, + children: /*#__PURE__*/_reactJsxRuntime.jsx(BoxContainer, { + title: "padding", + box: padding, + children: /*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + children: [/*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: styles.innerText, + children: ["(", (frame.left || 0).toFixed(1), ", ", (frame.top || 0).toFixed(1), ")"] + }), /*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: styles.innerText, + children: [(frame.width || 0).toFixed(1), " \xD7", ' ', (frame.height || 0).toFixed(1)] + })] + }) + }) + }); + } + }]); + }(React.Component); + var BoxContainer = /*#__PURE__*/function (_React$Component2) { + function BoxContainer() { + _classCallCheck(this, BoxContainer); + return _callSuper(this, BoxContainer, arguments); + } + _inherits(BoxContainer, _React$Component2); + return _createClass(BoxContainer, [{ + key: "render", + value: function render() { + var box = this.props.box; + return /*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + style: styles.box, + children: [/*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + style: styles.row, + children: [/*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: [this.props.titleStyle, styles.label], + children: this.props.title + }), /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: styles.boxText, + children: box.top + })] + }), /*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + style: styles.row, + children: [/*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: styles.boxText, + children: box.left + }), this.props.children, /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: styles.boxText, + children: box.right + })] + }), /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: styles.boxText, + children: box.bottom + })] + }); + } + }]); + }(React.Component); + var styles = _$$_REQUIRE(_dependencyMap[10], "../StyleSheet/StyleSheet").create({ + row: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-around' + }, + marginLabel: { + width: 60 + }, + label: { + fontSize: 10, + color: 'rgb(255,100,0)', + marginLeft: 5, + flex: 1, + textAlign: 'left', + top: -3 + }, + innerText: { + color: 'yellow', + fontSize: 12, + textAlign: 'center', + width: 70 + }, + box: { + borderWidth: 1, + borderColor: 'grey' + }, + boxText: { + color: 'white', + fontSize: 12, + marginHorizontal: 3, + marginVertical: 2, + textAlign: 'center' + } + }); + module.exports = BoxInspector; +},449,[106,18,19,23,25,28,65,269,241,310,266],"node_modules\\react-native\\Libraries\\Inspector\\BoxInspector.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _reactJsxRuntime = _$$_REQUIRE(_dependencyMap[0], "react/jsx-runtime"); + var _classCallCheck = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass"); + var _possibleConstructorReturn = _$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn"); + var _getPrototypeOf = _$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf"); + var _inherits = _$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Inspector\\PerformanceOverlay.js"; + function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + var React = _$$_REQUIRE(_dependencyMap[6], "react"); + var PerformanceOverlay = /*#__PURE__*/function (_React$Component) { + function PerformanceOverlay() { + _classCallCheck(this, PerformanceOverlay); + return _callSuper(this, PerformanceOverlay, arguments); + } + _inherits(PerformanceOverlay, _React$Component); + return _createClass(PerformanceOverlay, [{ + key: "render", + value: function render() { + var perfLogs = _$$_REQUIRE(_dependencyMap[7], "../Utilities/GlobalPerformanceLogger").getTimespans(); + var items = []; + for (var key in perfLogs) { + var _perfLogs$key; + if ((_perfLogs$key = perfLogs[key]) != null && _perfLogs$key.totalTime) { + var unit = key === 'BundleSize' ? 'b' : 'ms'; + items.push(/*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + style: styles.row, + children: [/*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: [styles.text, styles.label], + children: key + }), /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: [styles.text, styles.totalTime], + children: perfLogs[key].totalTime + unit + })] + }, key)); + } + } + return /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + style: styles.container, + children: items + }); + } + }]); + }(React.Component); + var styles = _$$_REQUIRE(_dependencyMap[10], "../StyleSheet/StyleSheet").create({ + container: { + height: 100, + paddingTop: 10 + }, + label: { + flex: 1 + }, + row: { + flexDirection: 'row', + paddingHorizontal: 10 + }, + text: { + color: 'white', + fontSize: 12 + }, + totalTime: { + paddingRight: 100 + } + }); + module.exports = PerformanceOverlay; +},450,[106,18,19,23,25,28,65,155,241,310,266],"node_modules\\react-native\\Libraries\\Inspector\\PerformanceOverlay.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + 'use strict'; + + var _reactJsxRuntime = _$$_REQUIRE(_dependencyMap[0], "react/jsx-runtime"); + var _classCallCheck = _$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck"); + var _createClass = _$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass"); + var _possibleConstructorReturn = _$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn"); + var _getPrototypeOf = _$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf"); + var _inherits = _$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Inspector\\NetworkOverlay.js"; + function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + var React = _$$_REQUIRE(_dependencyMap[6], "react"); + var LISTVIEW_CELL_HEIGHT = 15; + + // Global id for the intercepted XMLHttpRequest objects. + var nextXHRId = 0; + function getStringByValue(value) { + if (value === undefined) { + return 'undefined'; + } + if (typeof value === 'object') { + return JSON.stringify(value); + } + if (typeof value === 'string' && value.length > 500) { + return String(value).slice(0, 500).concat('\n***TRUNCATED TO 500 CHARACTERS***'); + } + return value; + } + function getTypeShortName(type) { + if (type === 'XMLHttpRequest') { + return 'XHR'; + } else if (type === 'WebSocket') { + return 'WS'; + } + return ''; + } + function keyExtractor(request) { + return String(request.id); + } + + /** + * Show all the intercepted network requests over the InspectorPanel. + */ + var NetworkOverlay = /*#__PURE__*/function (_React$Component) { + function NetworkOverlay() { + var _this; + _classCallCheck(this, NetworkOverlay); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, NetworkOverlay, [].concat(args)); + // Metrics are used to decide when if the request list should be sticky, and + // scroll to the bottom as new network requests come in, or if the user has + // intentionally scrolled away from the bottom - to instead flash the scroll bar + // and keep the current position + _this._requestsListViewScrollMetrics = { + offset: 0, + visibleLength: 0, + contentLength: 0 + }; + // Map of `socketId` -> `index in `this.state.requests`. + _this._socketIdMap = {}; + // Map of `xhr._index` -> `index in `this.state.requests`. + _this._xhrIdMap = {}; + _this.state = { + detailRowId: null, + requests: [] + }; + _this._renderItem = function (_ref) { + var item = _ref.item, + index = _ref.index; + var tableRowViewStyle = [styles.tableRow, index % 2 === 1 ? styles.tableRowOdd : styles.tableRowEven, index === _this.state.detailRowId && styles.tableRowPressed]; + var urlCellViewStyle = styles.urlCellView; + var methodCellViewStyle = styles.methodCellView; + return /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[7], "../Components/Touchable/TouchableHighlight"), { + onPress: function onPress() { + _this._pressRow(index); + }, + children: /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + children: /*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + style: tableRowViewStyle, + children: [/*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + style: urlCellViewStyle, + children: /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: styles.cellText, + numberOfLines: 1, + children: item.url + }) + }), /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + style: methodCellViewStyle, + children: /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: styles.cellText, + numberOfLines: 1, + children: getTypeShortName(item.type) + }) + })] + }) + }) + }); + }; + _this._indicateAdditionalRequests = function () { + if (_this._requestsListView) { + var distanceFromEndThreshold = LISTVIEW_CELL_HEIGHT * 2; + var _this$_requestsListVi = _this._requestsListViewScrollMetrics, + offset = _this$_requestsListVi.offset, + visibleLength = _this$_requestsListVi.visibleLength, + contentLength = _this$_requestsListVi.contentLength; + var distanceFromEnd = contentLength - visibleLength - offset; + var isCloseToEnd = distanceFromEnd <= distanceFromEndThreshold; + if (isCloseToEnd) { + _this._requestsListView.scrollToEnd(); + } else { + _this._requestsListView.flashScrollIndicators(); + } + } + }; + _this._captureRequestsListView = function (listRef) { + _this._requestsListView = listRef; + }; + _this._requestsListViewOnScroll = function (e) { + _this._requestsListViewScrollMetrics.offset = e.nativeEvent.contentOffset.y; + _this._requestsListViewScrollMetrics.visibleLength = e.nativeEvent.layoutMeasurement.height; + _this._requestsListViewScrollMetrics.contentLength = e.nativeEvent.contentSize.height; + }; + _this._scrollDetailToTop = function () { + if (_this._detailScrollView) { + _this._detailScrollView.scrollTo({ + y: 0, + animated: false + }); + } + }; + _this._closeButtonClicked = function () { + _this.setState({ + detailRowId: null + }); + }; + return _this; + } + _inherits(NetworkOverlay, _React$Component); + return _createClass(NetworkOverlay, [{ + key: "_enableXHRInterception", + value: function _enableXHRInterception() { + var _this2 = this; + if (_$$_REQUIRE(_dependencyMap[10], "../Network/XHRInterceptor").isInterceptorEnabled()) { + return; + } + // Show the XHR request item in listView as soon as it was opened. + _$$_REQUIRE(_dependencyMap[10], "../Network/XHRInterceptor").setOpenCallback(function (method, url, xhr) { + // Generate a global id for each intercepted xhr object, add this id + // to the xhr object as a private `_index` property to identify it, + // so that we can distinguish different xhr objects in callbacks. + xhr._index = nextXHRId++; + var xhrIndex = _this2.state.requests.length; + _this2._xhrIdMap[xhr._index] = xhrIndex; + var _xhr = { + id: xhrIndex, + type: 'XMLHttpRequest', + method: method, + url: url + }; + _this2.setState({ + requests: _this2.state.requests.concat(_xhr) + }, _this2._indicateAdditionalRequests); + }); + _$$_REQUIRE(_dependencyMap[10], "../Network/XHRInterceptor").setRequestHeaderCallback(function (header, value, xhr) { + var xhrIndex = _this2._getRequestIndexByXHRID(xhr._index); + if (xhrIndex === -1) { + return; + } + _this2.setState(function (_ref2) { + var requests = _ref2.requests; + var networkRequestInfo = requests[xhrIndex]; + if (!networkRequestInfo.requestHeaders) { + networkRequestInfo.requestHeaders = {}; + } + networkRequestInfo.requestHeaders[header] = value; + return { + requests: requests + }; + }); + }); + _$$_REQUIRE(_dependencyMap[10], "../Network/XHRInterceptor").setSendCallback(function (data, xhr) { + var xhrIndex = _this2._getRequestIndexByXHRID(xhr._index); + if (xhrIndex === -1) { + return; + } + _this2.setState(function (_ref3) { + var requests = _ref3.requests; + var networkRequestInfo = requests[xhrIndex]; + networkRequestInfo.dataSent = data; + return { + requests: requests + }; + }); + }); + _$$_REQUIRE(_dependencyMap[10], "../Network/XHRInterceptor").setHeaderReceivedCallback(function (type, size, responseHeaders, xhr) { + var xhrIndex = _this2._getRequestIndexByXHRID(xhr._index); + if (xhrIndex === -1) { + return; + } + _this2.setState(function (_ref4) { + var requests = _ref4.requests; + var networkRequestInfo = requests[xhrIndex]; + networkRequestInfo.responseContentType = type; + networkRequestInfo.responseSize = size; + networkRequestInfo.responseHeaders = responseHeaders; + return { + requests: requests + }; + }); + }); + _$$_REQUIRE(_dependencyMap[10], "../Network/XHRInterceptor").setResponseCallback(function (status, timeout, response, responseURL, responseType, xhr) { + var xhrIndex = _this2._getRequestIndexByXHRID(xhr._index); + if (xhrIndex === -1) { + return; + } + _this2.setState(function (_ref5) { + var requests = _ref5.requests; + var networkRequestInfo = requests[xhrIndex]; + networkRequestInfo.status = status; + networkRequestInfo.timeout = timeout; + networkRequestInfo.response = response; + networkRequestInfo.responseURL = responseURL; + networkRequestInfo.responseType = responseType; + return { + requests: requests + }; + }); + }); + + // Fire above callbacks. + _$$_REQUIRE(_dependencyMap[10], "../Network/XHRInterceptor").enableInterception(); + } + }, { + key: "_enableWebSocketInterception", + value: function _enableWebSocketInterception() { + var _this3 = this; + if (_$$_REQUIRE(_dependencyMap[11], "../WebSocket/WebSocketInterceptor").isInterceptorEnabled()) { + return; + } + // Show the WebSocket request item in listView when 'connect' is called. + _$$_REQUIRE(_dependencyMap[11], "../WebSocket/WebSocketInterceptor").setConnectCallback(function (url, protocols, options, socketId) { + var socketIndex = _this3.state.requests.length; + _this3._socketIdMap[socketId] = socketIndex; + var _webSocket = { + id: socketIndex, + type: 'WebSocket', + url: url, + protocols: protocols + }; + _this3.setState({ + requests: _this3.state.requests.concat(_webSocket) + }, _this3._indicateAdditionalRequests); + }); + _$$_REQUIRE(_dependencyMap[11], "../WebSocket/WebSocketInterceptor").setCloseCallback(function (statusCode, closeReason, socketId) { + var socketIndex = _this3._socketIdMap[socketId]; + if (socketIndex === undefined) { + return; + } + if (statusCode !== null && closeReason !== null) { + _this3.setState(function (_ref6) { + var requests = _ref6.requests; + var networkRequestInfo = requests[socketIndex]; + networkRequestInfo.status = statusCode; + networkRequestInfo.closeReason = closeReason; + return { + requests: requests + }; + }); + } + }); + _$$_REQUIRE(_dependencyMap[11], "../WebSocket/WebSocketInterceptor").setSendCallback(function (data, socketId) { + var socketIndex = _this3._socketIdMap[socketId]; + if (socketIndex === undefined) { + return; + } + _this3.setState(function (_ref7) { + var requests = _ref7.requests; + var networkRequestInfo = requests[socketIndex]; + if (!networkRequestInfo.messages) { + networkRequestInfo.messages = ''; + } + networkRequestInfo.messages += 'Sent: ' + JSON.stringify(data) + '\n'; + return { + requests: requests + }; + }); + }); + _$$_REQUIRE(_dependencyMap[11], "../WebSocket/WebSocketInterceptor").setOnMessageCallback(function (socketId, message) { + var socketIndex = _this3._socketIdMap[socketId]; + if (socketIndex === undefined) { + return; + } + _this3.setState(function (_ref8) { + var requests = _ref8.requests; + var networkRequestInfo = requests[socketIndex]; + if (!networkRequestInfo.messages) { + networkRequestInfo.messages = ''; + } + networkRequestInfo.messages += 'Received: ' + JSON.stringify(message) + '\n'; + return { + requests: requests + }; + }); + }); + _$$_REQUIRE(_dependencyMap[11], "../WebSocket/WebSocketInterceptor").setOnCloseCallback(function (socketId, message) { + var socketIndex = _this3._socketIdMap[socketId]; + if (socketIndex === undefined) { + return; + } + _this3.setState(function (_ref9) { + var requests = _ref9.requests; + var networkRequestInfo = requests[socketIndex]; + networkRequestInfo.serverClose = message; + return { + requests: requests + }; + }); + }); + _$$_REQUIRE(_dependencyMap[11], "../WebSocket/WebSocketInterceptor").setOnErrorCallback(function (socketId, message) { + var socketIndex = _this3._socketIdMap[socketId]; + if (socketIndex === undefined) { + return; + } + _this3.setState(function (_ref10) { + var requests = _ref10.requests; + var networkRequestInfo = requests[socketIndex]; + networkRequestInfo.serverError = message; + return { + requests: requests + }; + }); + }); + + // Fire above callbacks. + _$$_REQUIRE(_dependencyMap[11], "../WebSocket/WebSocketInterceptor").enableInterception(); + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + this._enableXHRInterception(); + this._enableWebSocketInterception(); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[10], "../Network/XHRInterceptor").disableInterception(); + _$$_REQUIRE(_dependencyMap[11], "../WebSocket/WebSocketInterceptor").disableInterception(); + } + }, { + key: "_renderItemDetail", + value: function _renderItemDetail(id) { + var _this4 = this; + var requestItem = this.state.requests[id]; + var details = Object.keys(requestItem).map(function (key) { + if (key === 'id') { + return; + } + return /*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + style: styles.detailViewRow, + children: [/*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: [styles.detailViewText, styles.detailKeyCellView], + children: key + }), /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: [styles.detailViewText, styles.detailValueCellView], + children: getStringByValue(requestItem[key]) + })] + }, key); + }); + return /*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + children: [/*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[7], "../Components/Touchable/TouchableHighlight"), { + style: styles.closeButton, + onPress: this._closeButtonClicked, + children: /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + children: /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: styles.closeButtonText, + children: "v" + }) + }) + }), /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[12], "../Components/ScrollView/ScrollView"), { + style: styles.detailScrollView, + ref: function ref(scrollRef) { + return _this4._detailScrollView = scrollRef; + }, + children: details + })] + }); + } + }, { + key: "_pressRow", + value: + /** + * Popup a scrollView to dynamically show detailed information of + * the request, when pressing a row in the network flow listView. + */ + function _pressRow(rowId) { + this.setState({ + detailRowId: rowId + }, this._scrollDetailToTop); + } + }, { + key: "_getRequestIndexByXHRID", + value: function _getRequestIndexByXHRID(index) { + if (index === undefined) { + return -1; + } + var xhrIndex = this._xhrIdMap[index]; + if (xhrIndex === undefined) { + return -1; + } else { + return xhrIndex; + } + } + }, { + key: "render", + value: function render() { + var _this$state = this.state, + requests = _this$state.requests, + detailRowId = _this$state.detailRowId; + return /*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + style: styles.container, + children: [detailRowId != null && this._renderItemDetail(detailRowId), /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + style: styles.listViewTitle, + children: requests.length > 0 && /*#__PURE__*/_reactJsxRuntime.jsxs(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + style: styles.tableRow, + children: [/*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + style: styles.urlTitleCellView, + children: /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: styles.cellText, + numberOfLines: 1, + children: "URL" + }) + }), /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[8], "../Components/View/View"), { + style: styles.methodTitleCellView, + children: /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[9], "../Text/Text"), { + style: styles.cellText, + numberOfLines: 1, + children: "Type" + }) + })] + }) + }), /*#__PURE__*/_reactJsxRuntime.jsx(_$$_REQUIRE(_dependencyMap[13], "../Lists/FlatList"), { + ref: this._captureRequestsListView, + onScroll: this._requestsListViewOnScroll, + style: styles.listView, + data: requests, + renderItem: this._renderItem, + keyExtractor: keyExtractor, + extraData: this.state + })] + }); + } + }]); + }(React.Component); + var styles = _$$_REQUIRE(_dependencyMap[14], "../StyleSheet/StyleSheet").create({ + container: { + paddingTop: 10, + paddingBottom: 10, + paddingLeft: 5, + paddingRight: 5 + }, + listViewTitle: { + height: 20 + }, + listView: { + flex: 1, + height: 60 + }, + tableRow: { + flexDirection: 'row', + flex: 1, + height: LISTVIEW_CELL_HEIGHT + }, + tableRowEven: { + backgroundColor: '#555' + }, + tableRowOdd: { + backgroundColor: '#000' + }, + tableRowPressed: { + backgroundColor: '#3B5998' + }, + cellText: { + color: 'white', + fontSize: 12 + }, + methodTitleCellView: { + height: 18, + borderColor: '#DCD7CD', + borderTopWidth: 1, + borderBottomWidth: 1, + borderRightWidth: 1, + alignItems: 'center', + justifyContent: 'center', + backgroundColor: '#444', + flex: 1 + }, + urlTitleCellView: { + height: 18, + borderColor: '#DCD7CD', + borderTopWidth: 1, + borderBottomWidth: 1, + borderLeftWidth: 1, + borderRightWidth: 1, + justifyContent: 'center', + backgroundColor: '#444', + flex: 5, + paddingLeft: 3 + }, + methodCellView: { + height: 15, + borderColor: '#DCD7CD', + borderRightWidth: 1, + alignItems: 'center', + justifyContent: 'center', + flex: 1 + }, + urlCellView: { + height: 15, + borderColor: '#DCD7CD', + borderLeftWidth: 1, + borderRightWidth: 1, + justifyContent: 'center', + flex: 5, + paddingLeft: 3 + }, + detailScrollView: { + flex: 1, + height: 180, + marginTop: 5, + marginBottom: 5 + }, + detailKeyCellView: { + flex: 1.3 + }, + detailValueCellView: { + flex: 2 + }, + detailViewRow: { + flexDirection: 'row', + paddingHorizontal: 3 + }, + detailViewText: { + color: 'white', + fontSize: 11 + }, + closeButtonText: { + color: 'white', + fontSize: 10 + }, + closeButton: { + marginTop: 5, + backgroundColor: '#888', + justifyContent: 'center', + alignItems: 'center' + } + }); + module.exports = NetworkOverlay; +},451,[106,18,19,23,25,28,65,444,241,310,452,453,346,402,266],"node_modules\\react-native\\Libraries\\Inspector\\NetworkOverlay.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + + 'use strict'; + + var originalXHROpen = _$$_REQUIRE(_dependencyMap[0], "./XMLHttpRequest").prototype.open; + var originalXHRSend = _$$_REQUIRE(_dependencyMap[0], "./XMLHttpRequest").prototype.send; + var originalXHRSetRequestHeader = _$$_REQUIRE(_dependencyMap[0], "./XMLHttpRequest").prototype.setRequestHeader; + var openCallback; + var sendCallback; + var requestHeaderCallback; + var headerReceivedCallback; + var responseCallback; + var _isInterceptorEnabled = false; + + /** + * A network interceptor which monkey-patches XMLHttpRequest methods + * to gather all network requests/responses, in order to show their + * information in the React Native inspector development tool. + * This supports interception with XMLHttpRequest API, including Fetch API + * and any other third party libraries that depend on XMLHttpRequest. + */ + var XHRInterceptor = { + /** + * Invoked before XMLHttpRequest.open(...) is called. + */ + setOpenCallback: function setOpenCallback(callback) { + openCallback = callback; + }, + /** + * Invoked before XMLHttpRequest.send(...) is called. + */ + setSendCallback: function setSendCallback(callback) { + sendCallback = callback; + }, + /** + * Invoked after xhr's readyState becomes xhr.HEADERS_RECEIVED. + */ + setHeaderReceivedCallback: function setHeaderReceivedCallback(callback) { + headerReceivedCallback = callback; + }, + /** + * Invoked after xhr's readyState becomes xhr.DONE. + */ + setResponseCallback: function setResponseCallback(callback) { + responseCallback = callback; + }, + /** + * Invoked before XMLHttpRequest.setRequestHeader(...) is called. + */ + setRequestHeaderCallback: function setRequestHeaderCallback(callback) { + requestHeaderCallback = callback; + }, + isInterceptorEnabled: function isInterceptorEnabled() { + return _isInterceptorEnabled; + }, + enableInterception: function enableInterception() { + if (_isInterceptorEnabled) { + return; + } + // Override `open` method for all XHR requests to intercept the request + // method and url, then pass them through the `openCallback`. + _$$_REQUIRE(_dependencyMap[0], "./XMLHttpRequest").prototype.open = function (method, url) { + if (openCallback) { + openCallback(method, url, this); + } + originalXHROpen.apply(this, arguments); + }; + + // Override `setRequestHeader` method for all XHR requests to intercept + // the request headers, then pass them through the `requestHeaderCallback`. + _$$_REQUIRE(_dependencyMap[0], "./XMLHttpRequest").prototype.setRequestHeader = function (header, value) { + if (requestHeaderCallback) { + requestHeaderCallback(header, value, this); + } + originalXHRSetRequestHeader.apply(this, arguments); + }; + + // Override `send` method of all XHR requests to intercept the data sent, + // register listeners to intercept the response, and invoke the callbacks. + _$$_REQUIRE(_dependencyMap[0], "./XMLHttpRequest").prototype.send = function (data) { + var _this = this; + if (sendCallback) { + sendCallback(data, this); + } + if (this.addEventListener) { + this.addEventListener('readystatechange', function () { + if (!_isInterceptorEnabled) { + return; + } + if (_this.readyState === _this.HEADERS_RECEIVED) { + var contentTypeString = _this.getResponseHeader('Content-Type'); + var contentLengthString = _this.getResponseHeader('Content-Length'); + var responseContentType, responseSize; + if (contentTypeString) { + responseContentType = contentTypeString.split(';')[0]; + } + if (contentLengthString) { + responseSize = parseInt(contentLengthString, 10); + } + if (headerReceivedCallback) { + headerReceivedCallback(responseContentType, responseSize, _this.getAllResponseHeaders(), _this); + } + } + if (_this.readyState === _this.DONE) { + if (responseCallback) { + responseCallback(_this.status, _this.timeout, _this.response, _this.responseURL, _this.responseType, _this); + } + } + }, false); + } + originalXHRSend.apply(this, arguments); + }; + _isInterceptorEnabled = true; + }, + // Unpatch XMLHttpRequest methods and remove the callbacks. + disableInterception: function disableInterception() { + if (!_isInterceptorEnabled) { + return; + } + _isInterceptorEnabled = false; + _$$_REQUIRE(_dependencyMap[0], "./XMLHttpRequest").prototype.send = originalXHRSend; + _$$_REQUIRE(_dependencyMap[0], "./XMLHttpRequest").prototype.open = originalXHROpen; + _$$_REQUIRE(_dependencyMap[0], "./XMLHttpRequest").prototype.setRequestHeader = originalXHRSetRequestHeader; + responseCallback = null; + openCallback = null; + sendCallback = null; + headerReceivedCallback = null; + requestHeaderCallback = null; + } + }; + module.exports = XHRInterceptor; +},452,[149],"node_modules\\react-native\\Libraries\\Network\\XHRInterceptor.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _NativeEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../EventEmitter/NativeEventEmitter")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../Utilities/Platform")); + var _NativeWebSocketModule = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "./NativeWebSocketModule")); + var _base64Js = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "base64-js")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + + var originalRCTWebSocketConnect = _NativeWebSocketModule.default.connect; + var originalRCTWebSocketSend = _NativeWebSocketModule.default.send; + var originalRCTWebSocketSendBinary = _NativeWebSocketModule.default.sendBinary; + var originalRCTWebSocketClose = _NativeWebSocketModule.default.close; + var eventEmitter; + var subscriptions; + var closeCallback; + var sendCallback; + var connectCallback; + var onOpenCallback; + var onMessageCallback; + var onErrorCallback; + var onCloseCallback; + var _isInterceptorEnabled = false; + + /** + * A network interceptor which monkey-patches RCTWebSocketModule methods + * to gather all websocket network requests/responses, in order to show + * their information in the React Native inspector development tool. + */ + + var WebSocketInterceptor = { + /** + * Invoked when RCTWebSocketModule.close(...) is called. + */ + setCloseCallback: function setCloseCallback(callback) { + closeCallback = callback; + }, + /** + * Invoked when RCTWebSocketModule.send(...) or sendBinary(...) is called. + */ + setSendCallback: function setSendCallback(callback) { + sendCallback = callback; + }, + /** + * Invoked when RCTWebSocketModule.connect(...) is called. + */ + setConnectCallback: function setConnectCallback(callback) { + connectCallback = callback; + }, + /** + * Invoked when event "websocketOpen" happens. + */ + setOnOpenCallback: function setOnOpenCallback(callback) { + onOpenCallback = callback; + }, + /** + * Invoked when event "websocketMessage" happens. + */ + setOnMessageCallback: function setOnMessageCallback(callback) { + onMessageCallback = callback; + }, + /** + * Invoked when event "websocketFailed" happens. + */ + setOnErrorCallback: function setOnErrorCallback(callback) { + onErrorCallback = callback; + }, + /** + * Invoked when event "websocketClosed" happens. + */ + setOnCloseCallback: function setOnCloseCallback(callback) { + onCloseCallback = callback; + }, + isInterceptorEnabled: function isInterceptorEnabled() { + return _isInterceptorEnabled; + }, + _unregisterEvents: function _unregisterEvents() { + subscriptions.forEach(function (e) { + return e.remove(); + }); + subscriptions = []; + }, + /** + * Add listeners to the RCTWebSocketModule events to intercept them. + */ + _registerEvents: function _registerEvents() { + subscriptions = [eventEmitter.addListener('websocketMessage', function (ev) { + if (onMessageCallback) { + onMessageCallback(ev.id, ev.type === 'binary' ? WebSocketInterceptor._arrayBufferToString(ev.data) : ev.data); + } + }), eventEmitter.addListener('websocketOpen', function (ev) { + if (onOpenCallback) { + onOpenCallback(ev.id); + } + }), eventEmitter.addListener('websocketClosed', function (ev) { + if (onCloseCallback) { + onCloseCallback(ev.id, { + code: ev.code, + reason: ev.reason + }); + } + }), eventEmitter.addListener('websocketFailed', function (ev) { + if (onErrorCallback) { + onErrorCallback(ev.id, { + message: ev.message + }); + } + })]; + }, + enableInterception: function enableInterception() { + if (_isInterceptorEnabled) { + return; + } + eventEmitter = new _NativeEventEmitter.default( + // T88715063: NativeEventEmitter only used this parameter on iOS. Now it uses it on all platforms, so this code was modified automatically to preserve its behavior + // If you want to use the native module on other platforms, please remove this condition and test its behavior + _Platform.default.OS !== 'ios' ? null : _NativeWebSocketModule.default); + WebSocketInterceptor._registerEvents(); + + // Override `connect` method for all RCTWebSocketModule requests + // to intercept the request url, protocols, options and socketId, + // then pass them through the `connectCallback`. + _NativeWebSocketModule.default.connect = function (url, protocols, options, socketId) { + if (connectCallback) { + connectCallback(url, protocols, options, socketId); + } + originalRCTWebSocketConnect.apply(this, arguments); + }; + + // Override `send` method for all RCTWebSocketModule requests to intercept + // the data sent, then pass them through the `sendCallback`. + _NativeWebSocketModule.default.send = function (data, socketId) { + if (sendCallback) { + sendCallback(data, socketId); + } + originalRCTWebSocketSend.apply(this, arguments); + }; + + // Override `sendBinary` method for all RCTWebSocketModule requests to + // intercept the data sent, then pass them through the `sendCallback`. + _NativeWebSocketModule.default.sendBinary = function (data, socketId) { + if (sendCallback) { + sendCallback(WebSocketInterceptor._arrayBufferToString(data), socketId); + } + originalRCTWebSocketSendBinary.apply(this, arguments); + }; + + // Override `close` method for all RCTWebSocketModule requests to intercept + // the close information, then pass them through the `closeCallback`. + _NativeWebSocketModule.default.close = function () { + if (closeCallback) { + if (arguments.length === 3) { + closeCallback(arguments[0], arguments[1], arguments[2]); + } else { + closeCallback(null, null, arguments[0]); + } + } + originalRCTWebSocketClose.apply(this, arguments); + }; + _isInterceptorEnabled = true; + }, + _arrayBufferToString: function _arrayBufferToString(data) { + var value = _base64Js.default.toByteArray(data).buffer; + if (value === undefined || value === null) { + return '(no value)'; + } + if (typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && value instanceof ArrayBuffer) { + return `ArrayBuffer {${String(Array.from(new Uint8Array(value)))}}`; + } + return value; + }, + // Unpatch RCTWebSocketModule methods and remove the callbacks. + disableInterception: function disableInterception() { + if (!_isInterceptorEnabled) { + return; + } + _isInterceptorEnabled = false; + _NativeWebSocketModule.default.send = originalRCTWebSocketSend; + _NativeWebSocketModule.default.sendBinary = originalRCTWebSocketSendBinary; + _NativeWebSocketModule.default.close = originalRCTWebSocketClose; + _NativeWebSocketModule.default.connect = originalRCTWebSocketConnect; + connectCallback = null; + closeCallback = null; + sendCallback = null; + onOpenCallback = null; + onMessageCallback = null; + onCloseCallback = null; + onErrorCallback = null; + WebSocketInterceptor._unregisterEvents(); + } + }; + module.exports = WebSocketInterceptor; +},453,[6,160,34,168,3],"node_modules\\react-native\\Libraries\\WebSocket\\WebSocketInterceptor.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports._LogBoxNotificationContainer = _LogBoxNotificationContainer; + exports.default = void 0; + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../Components/View/View")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../StyleSheet/StyleSheet")); + var LogBoxData = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3], "./Data/LogBoxData")); + var _LogBoxLog = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "./Data/LogBoxLog")); + var _LogBoxNotification = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "./UI/LogBoxNotification")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[7], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\LogBoxNotificationContainer.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _LogBoxNotificationContainer(props) { + var logs = props.logs; + var onDismissWarns = function onDismissWarns() { + LogBoxData.clearWarnings(); + }; + var onDismissErrors = function onDismissErrors() { + LogBoxData.clearErrors(); + }; + var setSelectedLog = function setSelectedLog(index) { + LogBoxData.setSelectedLog(index); + }; + function openLog(log) { + var index = logs.length - 1; + + // Stop at zero because if we don't find any log, we'll open the first log. + while (index > 0 && logs[index] !== log) { + index -= 1; + } + setSelectedLog(index); + } + if (logs.length === 0 || props.isDisabled === true) { + return null; + } + var warnings = logs.filter(function (log) { + return log.level === 'warn'; + }); + var errors = logs.filter(function (log) { + return log.level === 'error' || log.level === 'fatal'; + }); + return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, { + style: styles.list, + children: [warnings.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: styles.toast, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxNotification.default, { + log: warnings[warnings.length - 1], + level: "warn", + totalLogCount: warnings.length, + onPressOpen: function onPressOpen() { + return openLog(warnings[warnings.length - 1]); + }, + onPressDismiss: onDismissWarns + }) + }), errors.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: styles.toast, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxNotification.default, { + log: errors[errors.length - 1], + level: "error", + totalLogCount: errors.length, + onPressOpen: function onPressOpen() { + return openLog(errors[errors.length - 1]); + }, + onPressDismiss: onDismissErrors + }) + })] + }); + } + var styles = _StyleSheet.default.create({ + list: { + bottom: 20, + left: 10, + right: 10, + position: 'absolute' + }, + toast: { + borderRadius: 8, + marginBottom: 5, + overflow: 'hidden' + } + }); + var _default = exports.default = LogBoxData.withSubscription(_LogBoxNotificationContainer); +},454,[6,241,266,97,99,455,65,106],"node_modules\\react-native\\Libraries\\LogBox\\LogBoxNotificationContainer.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Components/View/View")); + var _Image = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Image/Image")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/StyleSheet")); + var _Text = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../Text/Text")); + var LogBoxData = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5], "../Data/LogBoxData")); + var _LogBoxLog = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../Data/LogBoxLog")); + var _LogBoxButton = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./LogBoxButton")); + var _LogBoxMessage = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./LogBoxMessage")); + var LogBoxStyle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9], "./LogBoxStyle")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[11], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxNotification.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function LogBoxLogNotification(props) { + var totalLogCount = props.totalLogCount, + level = props.level, + log = props.log; + + // Eagerly symbolicate so the stack is available when pressing to inspect. + React.useEffect(function () { + LogBoxData.symbolicateLogLazy(log); + }, [log]); + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: toastStyles.container, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxButton.default, { + onPress: props.onPressOpen, + style: toastStyles.press, + backgroundColor: { + default: LogBoxStyle.getBackgroundColor(1), + pressed: LogBoxStyle.getBackgroundColor(0.9) + }, + children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, { + style: toastStyles.content, + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(CountBadge, { + count: totalLogCount, + level: level + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Message, { + message: log.message + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(DismissButton, { + onPress: props.onPressDismiss + })] + }) + }) + }); + } + function CountBadge(props) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: countStyles.outside, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: [countStyles.inside, countStyles[props.level]], + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: countStyles.text, + children: props.count <= 1 ? '!' : props.count + }) + }) + }); + } + function Message(props) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: messageStyles.container, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + numberOfLines: 1, + style: messageStyles.text, + children: props.message && /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxMessage.default, { + plaintext: true, + message: props.message, + style: messageStyles.substitutionText + }) + }) + }); + } + function DismissButton(props) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: dismissStyles.container, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxButton.default, { + backgroundColor: { + default: LogBoxStyle.getTextColor(0.3), + pressed: LogBoxStyle.getTextColor(0.5) + }, + hitSlop: { + top: 12, + right: 10, + bottom: 12, + left: 10 + }, + onPress: props.onPress, + style: dismissStyles.press, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.default, { + source: _$$_REQUIRE(_dependencyMap[12], "./LogBoxImages/close.png"), + style: dismissStyles.image + }) + }) + }); + } + var countStyles = _StyleSheet.default.create({ + warn: { + backgroundColor: LogBoxStyle.getWarningColor(1) + }, + error: { + backgroundColor: LogBoxStyle.getErrorColor(1) + }, + log: { + backgroundColor: LogBoxStyle.getLogColor(1) + }, + outside: { + padding: 2, + borderRadius: 25, + backgroundColor: '#fff', + marginRight: 8 + }, + inside: { + minWidth: 18, + paddingLeft: 4, + paddingRight: 4, + borderRadius: 25, + fontWeight: '600' + }, + text: { + color: LogBoxStyle.getTextColor(1), + fontSize: 14, + lineHeight: 18, + textAlign: 'center', + fontWeight: '600', + textShadowColor: LogBoxStyle.getBackgroundColor(0.4), + textShadowOffset: { + width: 0, + height: 0 + }, + textShadowRadius: 3 + } + }); + var messageStyles = _StyleSheet.default.create({ + container: { + alignSelf: 'stretch', + flexGrow: 1, + flexShrink: 1, + flexBasis: 'auto', + borderLeftColor: LogBoxStyle.getTextColor(0.2), + borderLeftWidth: 1, + paddingLeft: 8 + }, + text: { + color: LogBoxStyle.getTextColor(1), + flex: 1, + fontSize: 14, + lineHeight: 22 + }, + substitutionText: { + color: LogBoxStyle.getTextColor(0.6) + } + }); + var dismissStyles = _StyleSheet.default.create({ + container: { + alignSelf: 'center', + flexDirection: 'row', + flexGrow: 0, + flexShrink: 0, + flexBasis: 'auto', + marginLeft: 5 + }, + press: { + height: 20, + width: 20, + borderRadius: 25, + alignSelf: 'flex-end', + alignItems: 'center', + justifyContent: 'center' + }, + image: { + height: 8, + width: 8, + tintColor: LogBoxStyle.getBackgroundColor(1) + } + }); + var toastStyles = _StyleSheet.default.create({ + container: { + height: 48, + position: 'relative', + width: '100%', + justifyContent: 'center', + marginTop: 0.5, + backgroundColor: LogBoxStyle.getTextColor(1) + }, + press: { + height: 48, + position: 'relative', + width: '100%', + justifyContent: 'center', + marginTop: 0.5, + paddingHorizontal: 12 + }, + content: { + alignItems: 'flex-start', + flexDirection: 'row', + borderRadius: 8, + flexGrow: 0, + flexShrink: 0, + flexBasis: 'auto' + } + }); + var _default = exports.default = LogBoxLogNotification; +},455,[6,241,421,266,310,97,99,456,458,457,65,106,462],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxNotification.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _TouchableWithoutFeedback = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Components/Touchable/TouchableWithoutFeedback")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Components/View/View")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../StyleSheet/StyleSheet")); + var LogBoxStyle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5], "./LogBoxStyle")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[7], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxButton.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function LogBoxButton(props) { + var _React$useState = React.useState(false), + _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2), + pressed = _React$useState2[0], + setPressed = _React$useState2[1]; + var backgroundColor = props.backgroundColor; + if (!backgroundColor) { + backgroundColor = { + default: LogBoxStyle.getBackgroundColor(0.95), + pressed: LogBoxStyle.getBackgroundColor(0.6) + }; + } + var content = /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: _StyleSheet.default.compose({ + backgroundColor: pressed ? backgroundColor.pressed : backgroundColor.default + }, props.style), + children: props.children + }); + return props.onPress == null ? content : /*#__PURE__*/(0, _jsxRuntime.jsx)(_TouchableWithoutFeedback.default, { + hitSlop: props.hitSlop, + onPress: props.onPress, + onPressIn: function onPressIn() { + return setPressed(true); + }, + onPressOut: function onPressOut() { + return setPressed(false); + }, + children: content + }); + } + var _default = exports.default = LogBoxButton; +},456,[6,7,446,241,266,457,65,106],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxButton.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getBackgroundColor = getBackgroundColor; + exports.getBackgroundDarkColor = getBackgroundDarkColor; + exports.getBackgroundLightColor = getBackgroundLightColor; + exports.getDividerColor = getDividerColor; + exports.getErrorColor = getErrorColor; + exports.getErrorDarkColor = getErrorDarkColor; + exports.getFatalColor = getFatalColor; + exports.getFatalDarkColor = getFatalDarkColor; + exports.getHighlightColor = getHighlightColor; + exports.getLogColor = getLogColor; + exports.getTextColor = getTextColor; + exports.getWarningColor = getWarningColor; + exports.getWarningDarkColor = getWarningDarkColor; + exports.getWarningHighlightColor = getWarningHighlightColor; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + function getBackgroundColor(opacity) { + return `rgba(51, 51, 51, ${opacity == null ? 1 : opacity})`; + } + function getBackgroundLightColor(opacity) { + return `rgba(69, 69, 69, ${opacity == null ? 1 : opacity})`; + } + function getBackgroundDarkColor(opacity) { + return `rgba(34, 34, 34, ${opacity == null ? 1 : opacity})`; + } + function getWarningColor(opacity) { + return `rgba(250, 186, 48, ${opacity == null ? 1 : opacity})`; + } + function getWarningDarkColor(opacity) { + return `rgba(224, 167, 8, ${opacity == null ? 1 : opacity})`; + } + function getFatalColor(opacity) { + return `rgba(243, 83, 105, ${opacity == null ? 1 : opacity})`; + } + function getFatalDarkColor(opacity) { + return `rgba(208, 75, 95, ${opacity == null ? 1 : opacity})`; + } + function getErrorColor(opacity) { + return `rgba(243, 83, 105, ${opacity == null ? 1 : opacity})`; + } + function getErrorDarkColor(opacity) { + return `rgba(208, 75, 95, ${opacity == null ? 1 : opacity})`; + } + function getLogColor(opacity) { + return `rgba(119, 119, 119, ${opacity == null ? 1 : opacity})`; + } + function getWarningHighlightColor(opacity) { + return `rgba(252, 176, 29, ${opacity == null ? 1 : opacity})`; + } + function getDividerColor(opacity) { + return `rgba(255, 255, 255, ${opacity == null ? 1 : opacity})`; + } + function getHighlightColor(opacity) { + return `rgba(252, 176, 29, ${opacity == null ? 1 : opacity})`; + } + function getTextColor(opacity) { + return `rgba(255, 255, 255, ${opacity == null ? 1 : opacity})`; + } +},457,[],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxStyle.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _Linking = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Linking/Linking")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../StyleSheet/StyleSheet")); + var _Text = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Text/Text")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[5], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxMessage.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function getLinkRanges(string) { + var regex = /https?:\/\/[^\s$.?#].[^\s]*/gi; + var matches = []; + var regexResult; + while ((regexResult = regex.exec(string)) !== null) { + if (regexResult != null) { + matches.push({ + lowerBound: regexResult.index, + upperBound: regex.lastIndex + }); + } + } + return matches; + } + function TappableLinks(props) { + var _this = this; + var matches = getLinkRanges(props.content); + if (matches.length === 0) { + // No URLs detected. Just return the content. + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: props.style, + children: props.content + }); + } + + // URLs were detected. Construct array of Text nodes. + + var fragments = []; + var indexCounter = 0; + var startIndex = 0; + var _loop = function _loop() { + if (startIndex < linkRange.lowerBound) { + var _text = props.content.substring(startIndex, linkRange.lowerBound); + fragments.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + children: _text + }, ++indexCounter)); + } + var link = props.content.substring(linkRange.lowerBound, linkRange.upperBound); + fragments.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + onPress: function onPress() { + // $FlowFixMe[unused-promise] + _Linking.default.openURL(link); + }, + style: styles.linkText, + children: link + }, ++indexCounter)); + startIndex = linkRange.upperBound; + }; + for (var linkRange of matches) { + _loop(); + } + if (startIndex < props.content.length) { + var text = props.content.substring(startIndex); + fragments.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: props.style, + children: text + }, ++indexCounter)); + } + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: props.style, + children: fragments + }); + } + var cleanContent = function cleanContent(content) { + return content.replace(/^(TransformError |Warning: (Warning: )?|Error: )/g, ''); + }; + function LogBoxMessage(props) { + var _this2 = this; + var _props$message = props.message, + content = _props$message.content, + substitutions = _props$message.substitutions; + if (props.plaintext === true) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + children: cleanContent(content) + }); + } + var maxLength = props.maxLength != null ? props.maxLength : Infinity; + var substitutionStyle = props.style; + var elements = []; + var length = 0; + var createUnderLength = function createUnderLength(key, message, style) { + var cleanMessage = cleanContent(message); + if (props.maxLength != null) { + cleanMessage = cleanMessage.slice(0, props.maxLength - length); + } + if (length < maxLength) { + elements.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(TappableLinks, { + content: cleanMessage, + style: style + }, key)); + } + length += cleanMessage.length; + }; + var lastOffset = substitutions.reduce(function (prevOffset, substitution, index) { + var key = String(index); + if (substitution.offset > prevOffset) { + var prevPart = content.slice(prevOffset, substitution.offset); + createUnderLength(key, prevPart); + } + var substitutionPart = content.slice(substitution.offset, substitution.offset + substitution.length); + createUnderLength(key + '.5', substitutionPart, substitutionStyle); + return substitution.offset + substitution.length; + }, 0); + if (lastOffset < content.length) { + var lastPart = content.slice(lastOffset); + createUnderLength('-1', lastPart); + } + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, { + children: elements + }); + } + var styles = _StyleSheet.default.create({ + linkText: { + textDecorationLine: 'underline' + } + }); + var _default = exports.default = LogBoxMessage; +},458,[6,459,266,310,65,106],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxMessage.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _NativeEventEmitter2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../EventEmitter/NativeEventEmitter")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../Utilities/Platform")); + var _NativeIntentAndroid = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./NativeIntentAndroid")); + var _NativeLinkingManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./NativeLinkingManager")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "invariant")); + var _nullthrows = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[11], "nullthrows")); + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + /** + * `Linking` gives you a general interface to interact with both incoming + * and outgoing app links. + * + * See https://reactnative.dev/docs/linking + */ + var Linking = /*#__PURE__*/function (_NativeEventEmitter) { + function Linking() { + (0, _classCallCheck2.default)(this, Linking); + return _callSuper(this, Linking, [_Platform.default.OS === 'ios' ? (0, _nullthrows.default)(_NativeLinkingManager.default) : undefined]); + } + + /** + * Add a handler to Linking changes by listening to the `url` event type + * and providing the handler + * + * See https://reactnative.dev/docs/linking#addeventlistener + */ + (0, _inherits2.default)(Linking, _NativeEventEmitter); + return (0, _createClass2.default)(Linking, [{ + key: "addEventListener", + value: function addEventListener(eventType, listener, context) { + return this.addListener(eventType, listener); + } + + /** + * Try to open the given `url` with any of the installed apps. + * + * See https://reactnative.dev/docs/linking#openurl + */ + }, { + key: "openURL", + value: function openURL(url) { + this._validateURL(url); + if (_Platform.default.OS === 'android') { + return (0, _nullthrows.default)(_NativeIntentAndroid.default).openURL(url); + } else { + return (0, _nullthrows.default)(_NativeLinkingManager.default).openURL(url); + } + } + + /** + * Determine whether or not an installed app can handle a given URL. + * + * See https://reactnative.dev/docs/linking#canopenurl + */ + }, { + key: "canOpenURL", + value: function canOpenURL(url) { + this._validateURL(url); + if (_Platform.default.OS === 'android') { + return (0, _nullthrows.default)(_NativeIntentAndroid.default).canOpenURL(url); + } else { + return (0, _nullthrows.default)(_NativeLinkingManager.default).canOpenURL(url); + } + } + + /** + * Open app settings. + * + * See https://reactnative.dev/docs/linking#opensettings + */ + }, { + key: "openSettings", + value: function openSettings() { + if (_Platform.default.OS === 'android') { + return (0, _nullthrows.default)(_NativeIntentAndroid.default).openSettings(); + } else { + return (0, _nullthrows.default)(_NativeLinkingManager.default).openSettings(); + } + } + + /** + * If the app launch was triggered by an app link, + * it will give the link url, otherwise it will give `null` + * + * See https://reactnative.dev/docs/linking#getinitialurl + */ + }, { + key: "getInitialURL", + value: function getInitialURL() { + return _Platform.default.OS === 'android' ? (0, _nullthrows.default)(_NativeIntentAndroid.default).getInitialURL() : (0, _nullthrows.default)(_NativeLinkingManager.default).getInitialURL(); + } + + /* + * Launch an Android intent with extras (optional) + * + * @platform android + * + * See https://reactnative.dev/docs/linking#sendintent + */ + }, { + key: "sendIntent", + value: function sendIntent(action, extras) { + if (_Platform.default.OS === 'android') { + return (0, _nullthrows.default)(_NativeIntentAndroid.default).sendIntent(action, extras); + } else { + return new Promise(function (resolve, reject) { + return reject(new Error('Unsupported')); + }); + } + } + }, { + key: "_validateURL", + value: function _validateURL(url) { + (0, _invariant.default)(typeof url === 'string', 'Invalid URL: should be a string. Was: ' + url); + (0, _invariant.default)(url, 'Invalid URL: cannot be empty'); + } + }]); + }(_NativeEventEmitter2.default); + module.exports = new Linking(); +},459,[6,18,19,23,25,28,160,34,460,461,37,52],"node_modules\\react-native\\Libraries\\Linking\\Linking.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('IntentAndroid'); +},460,[36],"node_modules\\react-native\\Libraries\\Linking\\NativeIntentAndroid.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('LinkingManager'); +},461,[36],"node_modules\\react-native\\Libraries\\Linking\\NativeLinkingManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0], "react-native/Libraries/Image/AssetRegistry").registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/node_modules/react-native/Libraries/LogBox/UI/LogBoxImages", + "width": 28, + "height": 28, + "scales": [1], + "hash": "369745d4a4a6fa62fa0ed495f89aa964", + "name": "close", + "type": "png" + }); +},462,[463],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxImages\\close.png"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + 'use strict'; + + module.exports = _$$_REQUIRE(_dependencyMap[0], "@react-native/assets-registry/registry"); +},463,[251],"node_modules\\react-native\\Libraries\\Image\\AssetRegistry.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.RootTagContext = void 0; + exports.createRootTag = createRootTag; + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var RootTagContext = exports.RootTagContext = React.createContext(0); + if (__DEV__) { + RootTagContext.displayName = 'RootTagContext'; + } + + /** + * Intended to only be used by `AppContainer`. + */ + function createRootTag(rootTag) { + return rootTag; + } +},464,[65],"node_modules\\react-native\\Libraries\\ReactNative\\RootTag.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.coerceDisplayMode = coerceDisplayMode; + exports.default = void 0; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + /** DisplayMode should be in sync with the method displayModeToInt from + * react/renderer/uimanager/primitives.h. */ + var DisplayMode = Object.freeze({ + VISIBLE: 1, + SUSPENDED: 2, + HIDDEN: 3 + }); + function coerceDisplayMode(value) { + switch (value) { + case DisplayMode.SUSPENDED: + return DisplayMode.SUSPENDED; + case DisplayMode.HIDDEN: + return DisplayMode.HIDDEN; + default: + return DisplayMode.VISIBLE; + } + } + var _default = exports.default = DisplayMode; +},465,[],"node_modules\\react-native\\Libraries\\ReactNative\\DisplayMode.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = getCachedComponentWithDisplayName; + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "react")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var cache = new Map(); + function getCachedComponentWithDisplayName(displayName) { + var ComponentWithDisplayName = cache.get(displayName); + if (!ComponentWithDisplayName) { + ComponentWithDisplayName = function ComponentWithDisplayName(_ref) { + var children = _ref.children; + return children; + }; + // $FlowFixMe[prop-missing] + ComponentWithDisplayName.displayName = displayName; + cache.set(displayName, ComponentWithDisplayName); + } + return ComponentWithDisplayName; + } +},466,[65],"node_modules\\react-native\\Libraries\\ReactNative\\getCachedComponentWithDebugName.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _NativeDeviceEventManager = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Libraries/NativeModules/specs/NativeDeviceEventManager")); + var _RCTDeviceEventEmitter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../EventEmitter/RCTDeviceEventEmitter")); + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var DEVICE_BACK_EVENT = 'hardwareBackPress'; + var _backPressSubscriptions = []; + _RCTDeviceEventEmitter.default.addListener(DEVICE_BACK_EVENT, function () { + for (var i = _backPressSubscriptions.length - 1; i >= 0; i--) { + if (_backPressSubscriptions[i]()) { + return; + } + } + BackHandler.exitApp(); + }); + + /** + * Detect hardware button presses for back navigation. + * + * Android: Detect hardware back button presses, and programmatically invoke the default back button + * functionality to exit the app if there are no listeners or if none of the listeners return true. + * + * iOS: Not applicable. + * + * The event subscriptions are called in reverse order (i.e. last registered subscription first), + * and if one subscription returns true then subscriptions registered earlier will not be called. + * + * Example: + * + * ```javascript + * BackHandler.addEventListener('hardwareBackPress', function() { + * // this.onMainScreen and this.goBack are just examples, you need to use your own implementation here + * // Typically you would use the navigator here to go to the last state. + * + * if (!this.onMainScreen()) { + * this.goBack(); + * return true; + * } + * return false; + * }); + * ``` + */ + + var BackHandler = { + exitApp: function exitApp() { + if (!_NativeDeviceEventManager.default) { + return; + } + _NativeDeviceEventManager.default.invokeDefaultBackPressHandler(); + }, + /** + * Adds an event handler. Supported events: + * + * - `hardwareBackPress`: Fires when the Android hardware back button is pressed. + */ + addEventListener: function addEventListener(eventName, handler) { + if (_backPressSubscriptions.indexOf(handler) === -1) { + _backPressSubscriptions.push(handler); + } + return { + remove: function remove() { + return BackHandler.removeEventListener(eventName, handler); + } + }; + }, + /** + * Removes the event handler. + */ + removeEventListener: function removeEventListener(eventName, handler) { + var index = _backPressSubscriptions.indexOf(handler); + if (index !== -1) { + _backPressSubscriptions.splice(index, 1); + } + } + }; + module.exports = BackHandler; +},467,[6,468,17],"node_modules\\react-native\\Libraries\\Utilities\\BackHandler.android.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _default = exports.default = TurboModuleRegistry.get('DeviceEventManager'); +},468,[36],"node_modules\\react-native\\Libraries\\NativeModules\\specs\\NativeDeviceEventManager.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports._LogBoxInspectorContainer = void 0; + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../Components/View/View")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../StyleSheet/StyleSheet")); + var LogBoxData = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8], "./Data/LogBoxData")); + var _LogBoxInspector = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./UI/LogBoxInspector")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[11], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\LogBoxInspectorContainer.js"; + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var _LogBoxInspectorContainer = exports._LogBoxInspectorContainer = /*#__PURE__*/function (_React$Component) { + function _LogBoxInspectorContainer() { + var _this; + (0, _classCallCheck2.default)(this, _LogBoxInspectorContainer); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, _LogBoxInspectorContainer, [].concat(args)); + _this._handleDismiss = function () { + // Here we handle the cases when the log is dismissed and it + // was either the last log, or when the current index + // is now outside the bounds of the log array. + var _this$props = _this.props, + selectedLogIndex = _this$props.selectedLogIndex, + logs = _this$props.logs; + var logsArray = Array.from(logs); + if (selectedLogIndex != null) { + if (logsArray.length - 1 <= 0) { + LogBoxData.setSelectedLog(-1); + } else if (selectedLogIndex >= logsArray.length - 1) { + LogBoxData.setSelectedLog(selectedLogIndex - 1); + } + LogBoxData.dismiss(logsArray[selectedLogIndex]); + } + }; + _this._handleMinimize = function () { + LogBoxData.setSelectedLog(-1); + }; + _this._handleSetSelectedLog = function (index) { + LogBoxData.setSelectedLog(index); + }; + return _this; + } + (0, _inherits2.default)(_LogBoxInspectorContainer, _React$Component); + return (0, _createClass2.default)(_LogBoxInspectorContainer, [{ + key: "render", + value: function render() { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: _StyleSheet.default.absoluteFill, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxInspector.default, { + onDismiss: this._handleDismiss, + onMinimize: this._handleMinimize, + onChangeSelectedIndex: this._handleSetSelectedLog, + logs: this.props.logs, + selectedIndex: this.props.selectedLogIndex + }) + }); + } + }]); + }(React.Component); + var _default = exports.default = LogBoxData.withSubscription(_LogBoxInspectorContainer); +},469,[6,18,19,23,25,28,241,266,97,470,65,106],"node_modules\\react-native\\Libraries\\LogBox\\LogBoxInspectorContainer.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _Keyboard = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Components/Keyboard/Keyboard")); + var _ScrollView = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Components/ScrollView/ScrollView")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../Components/View/View")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../../StyleSheet/StyleSheet")); + var LogBoxData = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6], "../Data/LogBoxData")); + var _LogBoxLog = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../Data/LogBoxLog")); + var _LogBoxInspectorCodeFrame = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./LogBoxInspectorCodeFrame")); + var _LogBoxInspectorFooter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./LogBoxInspectorFooter")); + var _LogBoxInspectorHeader = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "./LogBoxInspectorHeader")); + var _LogBoxInspectorMessageHeader = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[11], "./LogBoxInspectorMessageHeader")); + var _LogBoxInspectorReactFrames = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[12], "./LogBoxInspectorReactFrames")); + var _LogBoxInspectorStackFrames = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[13], "./LogBoxInspectorStackFrames")); + var LogBoxStyle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[14], "./LogBoxStyle")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[15], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[16], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspector.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function LogBoxInspector(props) { + var logs = props.logs, + selectedIndex = props.selectedIndex; + var log = logs[selectedIndex]; + React.useEffect(function () { + if (log) { + LogBoxData.symbolicateLogNow(log); + } + }, [log]); + React.useEffect(function () { + // Optimistically symbolicate the last and next logs. + if (logs.length > 1) { + var selected = selectedIndex; + var lastIndex = logs.length - 1; + var prevIndex = selected - 1 < 0 ? lastIndex : selected - 1; + var nextIndex = selected + 1 > lastIndex ? 0 : selected + 1; + LogBoxData.symbolicateLogLazy(logs[prevIndex]); + LogBoxData.symbolicateLogLazy(logs[nextIndex]); + } + }, [logs, selectedIndex]); + React.useEffect(function () { + _Keyboard.default.dismiss(); + }, []); + function _handleRetry() { + LogBoxData.retrySymbolicateLogNow(log); + } + if (log == null) { + return null; + } + return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, { + style: styles.root, + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxInspectorHeader.default, { + onSelectIndex: props.onChangeSelectedIndex, + selectedIndex: selectedIndex, + total: logs.length, + level: log.level + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(LogBoxInspectorBody, { + log: log, + onRetry: _handleRetry + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxInspectorFooter.default, { + onDismiss: props.onDismiss, + onMinimize: props.onMinimize, + level: log.level + })] + }); + } + var headerTitleMap = { + warn: 'Console Warning', + error: 'Console Error', + fatal: 'Uncaught Error', + syntax: 'Syntax Error', + component: 'Render Error' + }; + function LogBoxInspectorBody(props) { + var _props$log$type; + var _React$useState = React.useState(true), + _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2), + collapsed = _React$useState2[0], + setCollapsed = _React$useState2[1]; + React.useEffect(function () { + setCollapsed(true); + }, [props.log]); + var headerTitle = (_props$log$type = props.log.type) != null ? _props$log$type : headerTitleMap[props.log.isComponentError ? 'component' : props.log.level]; + if (collapsed) { + return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, { + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxInspectorMessageHeader.default, { + collapsed: collapsed, + onPress: function onPress() { + return setCollapsed(!collapsed); + }, + message: props.log.message, + level: props.log.level, + title: headerTitle + }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ScrollView.default, { + style: styles.scrollBody, + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxInspectorCodeFrame.default, { + codeFrame: props.log.codeFrame + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxInspectorReactFrames.default, { + log: props.log + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxInspectorStackFrames.default, { + log: props.log, + onRetry: props.onRetry + })] + })] + }); + } + return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ScrollView.default, { + style: styles.scrollBody, + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxInspectorMessageHeader.default, { + collapsed: collapsed, + onPress: function onPress() { + return setCollapsed(!collapsed); + }, + message: props.log.message, + level: props.log.level, + title: headerTitle + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxInspectorCodeFrame.default, { + codeFrame: props.log.codeFrame + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxInspectorReactFrames.default, { + log: props.log + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxInspectorStackFrames.default, { + log: props.log, + onRetry: props.onRetry + })] + }); + } + var styles = _StyleSheet.default.create({ + root: { + flex: 1, + backgroundColor: LogBoxStyle.getTextColor() + }, + scrollBody: { + backgroundColor: LogBoxStyle.getBackgroundColor(0.9), + flex: 1 + } + }); + var _default = exports.default = LogBoxInspector; +},470,[6,7,388,346,241,266,97,99,471,475,476,482,483,484,457,65,106],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspector.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _ScrollView = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Components/ScrollView/ScrollView")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Components/View/View")); + var _openFileInEditor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Core/Devtools/openFileInEditor")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../StyleSheet/StyleSheet")); + var _Text = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../../Text/Text")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../../Utilities/Platform")); + var LogBoxData = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7], "../Data/LogBoxData")); + var _AnsiHighlight = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./AnsiHighlight")); + var _LogBoxButton = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./LogBoxButton")); + var _LogBoxInspectorSection = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "./LogBoxInspectorSection")); + var LogBoxStyle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11], "./LogBoxStyle")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[13], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorCodeFrame.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function LogBoxInspectorCodeFrame(props) { + var codeFrame = props.codeFrame; + if (codeFrame == null) { + return null; + } + function getFileName() { + // $FlowFixMe[incompatible-use] + var matches = /[^/]*$/.exec(codeFrame.fileName); + if (matches && matches.length > 0) { + return matches[0]; + } + + // $FlowFixMe[incompatible-use] + return codeFrame.fileName; + } + function getLocation() { + // $FlowFixMe[incompatible-use] + var location = codeFrame.location; + if (location != null) { + return ` (${location.row}:${location.column + 1 /* Code frame columns are zero indexed */})`; + } + return null; + } + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxInspectorSection.default, { + heading: "Source", + action: /*#__PURE__*/(0, _jsxRuntime.jsx)(AppInfo, {}), + children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, { + style: styles.box, + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: styles.frame, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScrollView.default, { + horizontal: true, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_AnsiHighlight.default, { + style: styles.content, + text: codeFrame.content + }) + }) + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxButton.default, { + backgroundColor: { + default: 'transparent', + pressed: LogBoxStyle.getBackgroundDarkColor(1) + }, + style: styles.button, + onPress: function onPress() { + var _codeFrame$location$r, _codeFrame$location; + (0, _openFileInEditor.default)(codeFrame.fileName, (_codeFrame$location$r = (_codeFrame$location = codeFrame.location) == null ? void 0 : _codeFrame$location.row) != null ? _codeFrame$location$r : 0); + }, + children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Text.default, { + style: styles.fileText, + children: [getFileName(), getLocation()] + }) + })] + }) + }); + } + function AppInfo() { + var appInfo = LogBoxData.getAppInfo(); + if (appInfo == null) { + return null; + } + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxButton.default, { + backgroundColor: { + default: 'transparent', + pressed: appInfo.onPress ? LogBoxStyle.getBackgroundColor(1) : 'transparent' + }, + style: appInfoStyles.buildButton, + onPress: appInfo.onPress, + children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Text.default, { + style: appInfoStyles.text, + children: [appInfo.appVersion, " (", appInfo.engine, ")"] + }) + }); + } + var appInfoStyles = _StyleSheet.default.create({ + text: { + color: LogBoxStyle.getTextColor(0.4), + fontSize: 12, + lineHeight: 12 + }, + buildButton: { + flex: 0, + flexGrow: 0, + paddingVertical: 4, + paddingHorizontal: 5, + borderRadius: 5, + marginRight: -8 + } + }); + var styles = _StyleSheet.default.create({ + box: { + backgroundColor: LogBoxStyle.getBackgroundColor(), + marginLeft: 10, + marginRight: 10, + marginTop: 5, + borderRadius: 3 + }, + frame: { + padding: 10, + borderBottomColor: LogBoxStyle.getTextColor(0.1), + borderBottomWidth: 1 + }, + button: { + paddingTop: 10, + paddingBottom: 10 + }, + content: { + color: LogBoxStyle.getTextColor(1), + fontSize: 12, + includeFontPadding: false, + lineHeight: 20, + fontFamily: _Platform.default.select({ + android: 'monospace', + ios: 'Menlo' + }) + }, + fileText: { + color: LogBoxStyle.getTextColor(0.5), + textAlign: 'center', + flex: 1, + fontSize: 12, + includeFontPadding: false, + lineHeight: 16, + fontFamily: _Platform.default.select({ + android: 'monospace', + ios: 'Menlo' + }) + } + }); + var _default = exports.default = LogBoxInspectorCodeFrame; +},471,[6,346,241,445,266,310,34,97,472,456,474,457,65,106],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorCodeFrame.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = Ansi; + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Components/View/View")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../StyleSheet/StyleSheet")); + var _Text = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Text/Text")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[5], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\UI\\AnsiHighlight.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + // Afterglow theme from https://iterm2colorschemes.com/ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + var COLORS = { + 'ansi-black': 'rgb(27, 27, 27)', + 'ansi-red': 'rgb(187, 86, 83)', + 'ansi-green': 'rgb(144, 157, 98)', + 'ansi-yellow': 'rgb(234, 193, 121)', + 'ansi-blue': 'rgb(125, 169, 199)', + 'ansi-magenta': 'rgb(176, 101, 151)', + 'ansi-cyan': 'rgb(140, 220, 216)', + // Instead of white, use the default color provided to the component + // 'ansi-white': 'rgb(216, 216, 216)', + 'ansi-bright-black': 'rgb(98, 98, 98)', + 'ansi-bright-red': 'rgb(187, 86, 83)', + 'ansi-bright-green': 'rgb(144, 157, 98)', + 'ansi-bright-yellow': 'rgb(234, 193, 121)', + 'ansi-bright-blue': 'rgb(125, 169, 199)', + 'ansi-bright-magenta': 'rgb(176, 101, 151)', + 'ansi-bright-cyan': 'rgb(140, 220, 216)', + 'ansi-bright-white': 'rgb(247, 247, 247)' + }; + function Ansi(_ref) { + var _this = this; + var text = _ref.text, + style = _ref.style; + var commonWhitespaceLength = Infinity; + var parsedLines = text.split(/\n/).map(function (line) { + return (0, _$$_REQUIRE(_dependencyMap[6], "anser").ansiToJson)(line, { + json: true, + remove_empty: true, + use_classes: true + }); + }); + parsedLines.map(function (lines) { + var _lines$, _lines$$content, _match$; + // The third item on each line includes the whitespace of the source code. + // We are looking for the least amount of common whitespace to trim all lines. + // Example: Array [" ", " 96 |", " text", ...] + var match = lines[2] && ((_lines$ = lines[2]) == null ? void 0 : (_lines$$content = _lines$.content) == null ? void 0 : _lines$$content.match(/^ +/)); + var whitespaceLength = match && ((_match$ = match[0]) == null ? void 0 : _match$.length) || 0; + if (whitespaceLength < commonWhitespaceLength) { + commonWhitespaceLength = whitespaceLength; + } + }); + + /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's + * LTI update could not be added via codemod */ + var getText = function getText(content, key) { + if (key === 1) { + // Remove the vertical bar after line numbers + return content.replace(/\| $/, ' '); + } else if (key === 2 && commonWhitespaceLength < Infinity) { + // Remove common whitespace at the beginning of the line + return content.slice(commonWhitespaceLength); + } else { + return content; + } + }; + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + children: parsedLines.map(function (items, i) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: styles.line, + children: items.map(function (bundle, key) { + var textStyle = bundle.fg && COLORS[bundle.fg] ? { + backgroundColor: bundle.bg && COLORS[bundle.bg], + color: bundle.fg && COLORS[bundle.fg] + } : { + backgroundColor: bundle.bg && COLORS[bundle.bg] + }; + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: [style, textStyle], + children: getText(bundle.content, key) + }, key); + }) + }, i); + }) + }); + } + var styles = _StyleSheet.default.create({ + line: { + flexDirection: 'row' + } + }); +},472,[6,241,266,310,65,106,473],"node_modules\\react-native\\Libraries\\LogBox\\UI\\AnsiHighlight.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + // This file was originally written by @drudru (https://github.com/drudru/ansi_up), MIT, 2011 + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var ANSI_COLORS = [[{ + color: "0, 0, 0", + "class": "ansi-black" + }, { + color: "187, 0, 0", + "class": "ansi-red" + }, { + color: "0, 187, 0", + "class": "ansi-green" + }, { + color: "187, 187, 0", + "class": "ansi-yellow" + }, { + color: "0, 0, 187", + "class": "ansi-blue" + }, { + color: "187, 0, 187", + "class": "ansi-magenta" + }, { + color: "0, 187, 187", + "class": "ansi-cyan" + }, { + color: "255,255,255", + "class": "ansi-white" + }], [{ + color: "85, 85, 85", + "class": "ansi-bright-black" + }, { + color: "255, 85, 85", + "class": "ansi-bright-red" + }, { + color: "0, 255, 0", + "class": "ansi-bright-green" + }, { + color: "255, 255, 85", + "class": "ansi-bright-yellow" + }, { + color: "85, 85, 255", + "class": "ansi-bright-blue" + }, { + color: "255, 85, 255", + "class": "ansi-bright-magenta" + }, { + color: "85, 255, 255", + "class": "ansi-bright-cyan" + }, { + color: "255, 255, 255", + "class": "ansi-bright-white" + }]]; + var Anser = function () { + _createClass(Anser, null, [{ + key: "escapeForHtml", + /** + * Anser.escapeForHtml + * Escape the input HTML. + * + * This does the minimum escaping of text to make it compliant with HTML. + * In particular, the '&','<', and '>' characters are escaped. This should + * be run prior to `ansiToHtml`. + * + * @name Anser.escapeForHtml + * @function + * @param {String} txt The input text (containing the ANSI snippets). + * @returns {String} The escaped html. + */ + value: function escapeForHtml(txt) { + return new Anser().escapeForHtml(txt); + } + + /** + * Anser.linkify + * Adds the links in the HTML. + * + * This replaces any links in the text with anchor tags that display the + * link. The links should have at least one whitespace character + * surrounding it. Also, you should apply this after you have run + * `ansiToHtml` on the text. + * + * @name Anser.linkify + * @function + * @param {String} txt The input text. + * @returns {String} The HTML containing the tags (unescaped). + */ + }, { + key: "linkify", + value: function linkify(txt) { + return new Anser().linkify(txt); + } + + /** + * Anser.ansiToHtml + * This replaces ANSI terminal escape codes with SPAN tags that wrap the + * content. + * + * This function only interprets ANSI SGR (Select Graphic Rendition) codes + * that can be represented in HTML. + * For example, cursor movement codes are ignored and hidden from output. + * The default style uses colors that are very close to the prescribed + * standard. The standard assumes that the text will have a black + * background. These colors are set as inline styles on the SPAN tags. + * + * Another option is to set `use_classes: true` in the options argument. + * This will instead set classes on the spans so the colors can be set via + * CSS. The class names used are of the format `ansi-*-fg/bg` and + * `ansi-bright-*-fg/bg` where `*` is the color name, + * i.e black/red/green/yellow/blue/magenta/cyan/white. + * + * @name Anser.ansiToHtml + * @function + * @param {String} txt The input text. + * @param {Object} options The options passed to the ansiToHTML method. + * @returns {String} The HTML output. + */ + }, { + key: "ansiToHtml", + value: function ansiToHtml(txt, options) { + return new Anser().ansiToHtml(txt, options); + } + + /** + * Anser.ansiToJson + * Converts ANSI input into JSON output. + * + * @name Anser.ansiToJson + * @function + * @param {String} txt The input text. + * @param {Object} options The options passed to the ansiToHTML method. + * @returns {String} The HTML output. + */ + }, { + key: "ansiToJson", + value: function ansiToJson(txt, options) { + return new Anser().ansiToJson(txt, options); + } + + /** + * Anser.ansiToText + * Converts ANSI input into text output. + * + * @name Anser.ansiToText + * @function + * @param {String} txt The input text. + * @returns {String} The text output. + */ + }, { + key: "ansiToText", + value: function ansiToText(txt) { + return new Anser().ansiToText(txt); + } + + /** + * Anser + * The `Anser` class. + * + * @name Anser + * @function + * @returns {Anser} + */ + }]); + function Anser() { + _classCallCheck(this, Anser); + this.fg = this.bg = this.fg_truecolor = this.bg_truecolor = null; + this.bright = 0; + } + + /** + * setupPalette + * Sets up the palette. + * + * @name setupPalette + * @function + */ + + _createClass(Anser, [{ + key: "setupPalette", + value: function setupPalette() { + this.PALETTE_COLORS = []; + + // Index 0..15 : System color + for (var i = 0; i < 2; ++i) { + for (var j = 0; j < 8; ++j) { + this.PALETTE_COLORS.push(ANSI_COLORS[i][j].color); + } + } + + // Index 16..231 : RGB 6x6x6 + // https://gist.github.com/jasonm23/2868981#file-xterm-256color-yaml + var levels = [0, 95, 135, 175, 215, 255]; + var format = function format(r, g, b) { + return levels[r] + ", " + levels[g] + ", " + levels[b]; + }; + var r = void 0, + g = void 0, + b = void 0; + for (var _r = 0; _r < 6; ++_r) { + for (var _g = 0; _g < 6; ++_g) { + for (var _b = 0; _b < 6; ++_b) { + this.PALETTE_COLORS.push(format(_r, _g, _b)); + } + } + } + + // Index 232..255 : Grayscale + var level = 8; + for (var _i = 0; _i < 24; ++_i, level += 10) { + this.PALETTE_COLORS.push(format(level, level, level)); + } + } + + /** + * escapeForHtml + * Escapes the input text. + * + * @name escapeForHtml + * @function + * @param {String} txt The input text. + * @returns {String} The escpaed HTML output. + */ + }, { + key: "escapeForHtml", + value: function escapeForHtml(txt) { + return txt.replace(/[&<>]/gm, function (str) { + return str == "&" ? "&" : str == "<" ? "<" : str == ">" ? ">" : ""; + }); + } + + /** + * linkify + * Adds HTML link elements. + * + * @name linkify + * @function + * @param {String} txt The input text. + * @returns {String} The HTML output containing link elements. + */ + }, { + key: "linkify", + value: function linkify(txt) { + return txt.replace(/(https?:\/\/[^\s]+)/gm, function (str) { + return "" + str + ""; + }); + } + + /** + * ansiToHtml + * Converts ANSI input into HTML output. + * + * @name ansiToHtml + * @function + * @param {String} txt The input text. + * @param {Object} options The options passed ot the `process` method. + * @returns {String} The HTML output. + */ + }, { + key: "ansiToHtml", + value: function ansiToHtml(txt, options) { + return this.process(txt, options, true); + } + + /** + * ansiToJson + * Converts ANSI input into HTML output. + * + * @name ansiToJson + * @function + * @param {String} txt The input text. + * @param {Object} options The options passed ot the `process` method. + * @returns {String} The JSON output. + */ + }, { + key: "ansiToJson", + value: function ansiToJson(txt, options) { + options = options || {}; + options.json = true; + options.clearLine = false; + return this.process(txt, options, true); + } + + /** + * ansiToText + * Converts ANSI input into HTML output. + * + * @name ansiToText + * @function + * @param {String} txt The input text. + * @returns {String} The text output. + */ + }, { + key: "ansiToText", + value: function ansiToText(txt) { + return this.process(txt, {}, false); + } + + /** + * process + * Processes the input. + * + * @name process + * @function + * @param {String} txt The input text. + * @param {Object} options An object passed to `processChunk` method, extended with: + * + * - `json` (Boolean): If `true`, the result will be an object. + * - `use_classes` (Boolean): If `true`, HTML classes will be appended to the HTML output. + * + * @param {Boolean} markup + */ + }, { + key: "process", + value: function process(txt, options, markup) { + var _this = this; + var self = this; + var raw_text_chunks = txt.split(/\033\[/); + var first_chunk = raw_text_chunks.shift(); // the first chunk is not the result of the split + + if (options === undefined || options === null) { + options = {}; + } + options.clearLine = /\r/.test(txt); // check for Carriage Return + var color_chunks = raw_text_chunks.map(function (chunk) { + return _this.processChunk(chunk, options, markup); + }); + if (options && options.json) { + var first = self.processChunkJson(""); + first.content = first_chunk; + first.clearLine = options.clearLine; + color_chunks.unshift(first); + if (options.remove_empty) { + color_chunks = color_chunks.filter(function (c) { + return !c.isEmpty(); + }); + } + return color_chunks; + } else { + color_chunks.unshift(first_chunk); + } + return color_chunks.join(""); + } + + /** + * processChunkJson + * Processes the current chunk into json output. + * + * @name processChunkJson + * @function + * @param {String} text The input text. + * @param {Object} options An object containing the following fields: + * + * - `json` (Boolean): If `true`, the result will be an object. + * - `use_classes` (Boolean): If `true`, HTML classes will be appended to the HTML output. + * + * @param {Boolean} markup If false, the colors will not be parsed. + * @return {Object} The result object: + * + * - `content` (String): The text. + * - `fg` (String|null): The foreground color. + * - `bg` (String|null): The background color. + * - `fg_truecolor` (String|null): The foreground true color (if 16m color is enabled). + * - `bg_truecolor` (String|null): The background true color (if 16m color is enabled). + * - `clearLine` (Boolean): `true` if a carriageReturn \r was fount at end of line. + * - `was_processed` (Bolean): `true` if the colors were processed, `false` otherwise. + * - `isEmpty` (Function): A function returning `true` if the content is empty, or `false` otherwise. + * + */ + }, { + key: "processChunkJson", + value: function processChunkJson(text, options, markup) { + // Are we using classes or styles? + options = typeof options == "undefined" ? {} : options; + var use_classes = options.use_classes = typeof options.use_classes != "undefined" && options.use_classes; + var key = options.key = use_classes ? "class" : "color"; + var result = { + content: text, + fg: null, + bg: null, + fg_truecolor: null, + bg_truecolor: null, + clearLine: options.clearLine, + decoration: null, + was_processed: false, + isEmpty: function isEmpty() { + return !result.content; + } + }; + + // Each "chunk" is the text after the CSI (ESC + "[") and before the next CSI/EOF. + // + // This regex matches four groups within a chunk. + // + // The first and third groups match code type. + // We supported only SGR command. It has empty first group and "m" in third. + // + // The second group matches all of the number+semicolon command sequences + // before the "m" (or other trailing) character. + // These are the graphics or SGR commands. + // + // The last group is the text (including newlines) that is colored by + // the other group"s commands. + var matches = text.match(/^([!\x3c-\x3f]*)([\d;]*)([\x20-\x2c]*[\x40-\x7e])([\s\S]*)/m); + if (!matches) return result; + var orig_txt = result.content = matches[4]; + var nums = matches[2].split(";"); + + // We currently support only "SGR" (Select Graphic Rendition) + // Simply ignore if not a SGR command. + if (matches[1] !== "" || matches[3] !== "m") { + return result; + } + if (!markup) { + return result; + } + var self = this; + self.decoration = null; + while (nums.length > 0) { + var num_str = nums.shift(); + var num = parseInt(num_str); + if (isNaN(num) || num === 0) { + self.fg = self.bg = self.decoration = null; + } else if (num === 1) { + self.decoration = "bold"; + } else if (num === 2) { + self.decoration = "dim"; + // Enable code 2 to get string + } else if (num == 3) { + self.decoration = "italic"; + } else if (num == 4) { + self.decoration = "underline"; + } else if (num == 5) { + self.decoration = "blink"; + } else if (num === 7) { + self.decoration = "reverse"; + } else if (num === 8) { + self.decoration = "hidden"; + // Enable code 9 to get strikethrough + } else if (num === 9) { + self.decoration = "strikethrough"; + } else if (num == 39) { + self.fg = null; + } else if (num == 49) { + self.bg = null; + // Foreground color + } else if (num >= 30 && num < 38) { + self.fg = ANSI_COLORS[0][num % 10][key]; + // Foreground bright color + } else if (num >= 90 && num < 98) { + self.fg = ANSI_COLORS[1][num % 10][key]; + // Background color + } else if (num >= 40 && num < 48) { + self.bg = ANSI_COLORS[0][num % 10][key]; + // Background bright color + } else if (num >= 100 && num < 108) { + self.bg = ANSI_COLORS[1][num % 10][key]; + } else if (num === 38 || num === 48) { + // extend color (38=fg, 48=bg) + var is_foreground = num === 38; + if (nums.length >= 1) { + var mode = nums.shift(); + if (mode === "5" && nums.length >= 1) { + // palette color + var palette_index = parseInt(nums.shift()); + if (palette_index >= 0 && palette_index <= 255) { + if (!use_classes) { + if (!this.PALETTE_COLORS) { + self.setupPalette(); + } + if (is_foreground) { + self.fg = this.PALETTE_COLORS[palette_index]; + } else { + self.bg = this.PALETTE_COLORS[palette_index]; + } + } else { + var klass = palette_index >= 16 ? "ansi-palette-" + palette_index : ANSI_COLORS[palette_index > 7 ? 1 : 0][palette_index % 8]["class"]; + if (is_foreground) { + self.fg = klass; + } else { + self.bg = klass; + } + } + } + } else if (mode === "2" && nums.length >= 3) { + // true color + var r = parseInt(nums.shift()); + var g = parseInt(nums.shift()); + var b = parseInt(nums.shift()); + if (r >= 0 && r <= 255 && g >= 0 && g <= 255 && b >= 0 && b <= 255) { + var color = r + ", " + g + ", " + b; + if (!use_classes) { + if (is_foreground) { + self.fg = color; + } else { + self.bg = color; + } + } else { + if (is_foreground) { + self.fg = "ansi-truecolor"; + self.fg_truecolor = color; + } else { + self.bg = "ansi-truecolor"; + self.bg_truecolor = color; + } + } + } + } + } + } + } + if (self.fg === null && self.bg === null && self.decoration === null) { + return result; + } else { + var styles = []; + var classes = []; + var data = {}; + result.fg = self.fg; + result.bg = self.bg; + result.fg_truecolor = self.fg_truecolor; + result.bg_truecolor = self.bg_truecolor; + result.decoration = self.decoration; + result.was_processed = true; + return result; + } + } + + /** + * processChunk + * Processes the current chunk of text. + * + * @name processChunk + * @function + * @param {String} text The input text. + * @param {Object} options An object containing the following fields: + * + * - `json` (Boolean): If `true`, the result will be an object. + * - `use_classes` (Boolean): If `true`, HTML classes will be appended to the HTML output. + * + * @param {Boolean} markup If false, the colors will not be parsed. + * @return {Object|String} The result (object if `json` is wanted back or string otherwise). + */ + }, { + key: "processChunk", + value: function processChunk(text, options, markup) { + var _this2 = this; + var self = this; + options = options || {}; + var jsonChunk = this.processChunkJson(text, options, markup); + if (options.json) { + return jsonChunk; + } + if (jsonChunk.isEmpty()) { + return ""; + } + if (!jsonChunk.was_processed) { + return jsonChunk.content; + } + var use_classes = options.use_classes; + var styles = []; + var classes = []; + var data = {}; + var render_data = function render_data(data) { + var fragments = []; + var key = void 0; + for (key in data) { + if (data.hasOwnProperty(key)) { + fragments.push("data-" + key + "=\"" + _this2.escapeForHtml(data[key]) + "\""); + } + } + return fragments.length > 0 ? " " + fragments.join(" ") : ""; + }; + if (jsonChunk.fg) { + if (use_classes) { + classes.push(jsonChunk.fg + "-fg"); + if (jsonChunk.fg_truecolor !== null) { + data["ansi-truecolor-fg"] = jsonChunk.fg_truecolor; + jsonChunk.fg_truecolor = null; + } + } else { + styles.push("color:rgb(" + jsonChunk.fg + ")"); + } + } + if (jsonChunk.bg) { + if (use_classes) { + classes.push(jsonChunk.bg + "-bg"); + if (jsonChunk.bg_truecolor !== null) { + data["ansi-truecolor-bg"] = jsonChunk.bg_truecolor; + jsonChunk.bg_truecolor = null; + } + } else { + styles.push("background-color:rgb(" + jsonChunk.bg + ")"); + } + } + if (jsonChunk.decoration) { + if (use_classes) { + classes.push("ansi-" + jsonChunk.decoration); + } else if (jsonChunk.decoration === "bold") { + styles.push("font-weight:bold"); + } else if (jsonChunk.decoration === "dim") { + styles.push("opacity:0.5"); + } else if (jsonChunk.decoration === "italic") { + styles.push("font-style:italic"); + // underline and blink are treated bellow + } else if (jsonChunk.decoration === "reverse") { + styles.push("filter:invert(100%)"); + } else if (jsonChunk.decoration === "hidden") { + styles.push("visibility:hidden"); + } else if (jsonChunk.decoration === "strikethrough") { + styles.push("text-decoration:line-through"); + } else { + styles.push("text-decoration:" + jsonChunk.decoration); + } + } + if (use_classes) { + return "" + jsonChunk.content + ""; + } else { + return "" + jsonChunk.content + ""; + } + } + }]); + return Anser; + }(); + ; + module.exports = Anser; +},473,[],"node_modules\\anser\\lib\\index.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Components/View/View")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../StyleSheet/StyleSheet")); + var _Text = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Text/Text")); + var LogBoxStyle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4], "./LogBoxStyle")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[6], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorSection.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function LogBoxInspectorSection(props) { + return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, { + style: styles.section, + children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, { + style: styles.heading, + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: styles.headingText, + children: props.heading + }), props.action] + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: styles.body, + children: props.children + })] + }); + } + var styles = _StyleSheet.default.create({ + section: { + marginTop: 15 + }, + heading: { + alignItems: 'center', + flexDirection: 'row', + paddingHorizontal: 12, + marginBottom: 10 + }, + headingText: { + color: LogBoxStyle.getTextColor(1), + flex: 1, + fontSize: 18, + fontWeight: '600', + includeFontPadding: false, + lineHeight: 20 + }, + body: { + paddingBottom: 10 + } + }); + var _default = exports.default = LogBoxInspectorSection; +},474,[6,241,266,310,457,65,106],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorSection.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _SafeAreaView = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Components/SafeAreaView/SafeAreaView")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Components/View/View")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../StyleSheet/StyleSheet")); + var _Text = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../Text/Text")); + var _LogBoxButton = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "./LogBoxButton")); + var LogBoxStyle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6], "./LogBoxStyle")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[8], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorFooter.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function LogBoxInspectorFooter(props) { + if (props.level === 'syntax') { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: styles.root, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: styles.button, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: styles.syntaxErrorText, + children: "This error cannot be dismissed." + }) + }) + }); + } + return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, { + style: styles.root, + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(FooterButton, { + text: "Dismiss", + onPress: props.onDismiss + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(FooterButton, { + text: "Minimize", + onPress: props.onMinimize + })] + }); + } + function FooterButton(props) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SafeAreaView.default, { + style: styles.button, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxButton.default, { + backgroundColor: { + default: 'transparent', + pressed: LogBoxStyle.getBackgroundDarkColor() + }, + onPress: props.onPress, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: styles.buttonContent, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: styles.buttonLabel, + children: props.text + }) + }) + }) + }); + } + var styles = _StyleSheet.default.create({ + root: { + backgroundColor: LogBoxStyle.getBackgroundColor(1), + shadowColor: '#000', + shadowOffset: { + width: 0, + height: -2 + }, + shadowRadius: 2, + shadowOpacity: 0.5, + flexDirection: 'row' + }, + button: { + flex: 1 + }, + buttonContent: { + alignItems: 'center', + height: 48, + justifyContent: 'center' + }, + buttonLabel: { + color: LogBoxStyle.getTextColor(1), + fontSize: 14, + includeFontPadding: false, + lineHeight: 20 + }, + syntaxErrorText: { + textAlign: 'center', + width: '100%', + height: 48, + fontSize: 14, + lineHeight: 20, + paddingTop: 20, + paddingBottom: 50, + fontStyle: 'italic', + color: LogBoxStyle.getTextColor(0.6) + } + }); + var _default = exports.default = LogBoxInspectorFooter; +},475,[6,308,241,266,310,456,457,65,106],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorFooter.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _StatusBar = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Components/StatusBar/StatusBar")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Components/View/View")); + var _Image = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Image/Image")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../StyleSheet/StyleSheet")); + var _Text = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../../Text/Text")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../../Utilities/Platform")); + var _LogBoxButton = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./LogBoxButton")); + var LogBoxStyle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8], "./LogBoxStyle")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[10], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorHeader.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function LogBoxInspectorHeader(props) { + if (props.level === 'syntax') { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: [styles.safeArea, styles[props.level]], + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: styles.header, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: styles.title, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: styles.titleText, + children: "Failed to compile" + }) + }) + }) + }); + } + var prevIndex = props.selectedIndex - 1 < 0 ? props.total - 1 : props.selectedIndex - 1; + var nextIndex = props.selectedIndex + 1 > props.total - 1 ? 0 : props.selectedIndex + 1; + var titleText = `Log ${props.selectedIndex + 1} of ${props.total}`; + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: [styles.safeArea, styles[props.level]], + children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, { + style: styles.header, + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(LogBoxInspectorHeaderButton, { + disabled: props.total <= 1, + level: props.level, + image: _$$_REQUIRE(_dependencyMap[11], "./LogBoxImages/chevron-left.png"), + onPress: function onPress() { + return props.onSelectIndex(prevIndex); + } + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: styles.title, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: styles.titleText, + children: titleText + }) + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(LogBoxInspectorHeaderButton, { + disabled: props.total <= 1, + level: props.level, + image: _$$_REQUIRE(_dependencyMap[12], "./LogBoxImages/chevron-right.png"), + onPress: function onPress() { + return props.onSelectIndex(nextIndex); + } + })] + }) + }); + } + var backgroundForLevel = function backgroundForLevel(level) { + return { + warn: { + default: 'transparent', + pressed: LogBoxStyle.getWarningDarkColor() + }, + error: { + default: 'transparent', + pressed: LogBoxStyle.getErrorDarkColor() + }, + fatal: { + default: 'transparent', + pressed: LogBoxStyle.getFatalDarkColor() + }, + syntax: { + default: 'transparent', + pressed: LogBoxStyle.getFatalDarkColor() + } + }[level]; + }; + function LogBoxInspectorHeaderButton(props) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxButton.default, { + backgroundColor: backgroundForLevel(props.level), + onPress: props.disabled ? null : props.onPress, + style: headerStyles.button, + children: props.disabled ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.default, { + source: props.image, + style: headerStyles.buttonImage + }) + }); + } + var headerStyles = _StyleSheet.default.create({ + button: { + alignItems: 'center', + aspectRatio: 1, + justifyContent: 'center', + marginTop: 5, + marginRight: 6, + marginLeft: 6, + marginBottom: -8, + borderRadius: 3 + }, + buttonImage: { + height: 14, + width: 8, + tintColor: LogBoxStyle.getTextColor() + } + }); + var styles = _StyleSheet.default.create({ + syntax: { + backgroundColor: LogBoxStyle.getFatalColor() + }, + fatal: { + backgroundColor: LogBoxStyle.getFatalColor() + }, + warn: { + backgroundColor: LogBoxStyle.getWarningColor() + }, + error: { + backgroundColor: LogBoxStyle.getErrorColor() + }, + header: { + flexDirection: 'row', + height: _Platform.default.select({ + android: 48, + ios: 44 + }) + }, + title: { + alignItems: 'center', + flex: 1, + justifyContent: 'center' + }, + titleText: { + color: LogBoxStyle.getTextColor(), + fontSize: 16, + fontWeight: '600', + includeFontPadding: false, + lineHeight: 20 + }, + safeArea: { + paddingTop: _Platform.default.OS === 'android' ? _StatusBar.default.currentHeight : 40 + } + }); + var _default = exports.default = LogBoxInspectorHeader; +},476,[6,477,241,421,266,310,34,456,457,65,106,480,481],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorHeader.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _processColor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../../StyleSheet/processColor")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../../Utilities/Platform")); + var _NativeStatusBarManagerAndroid = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./NativeStatusBarManagerAndroid")); + var _NativeStatusBarManagerIOS = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./NativeStatusBarManagerIOS")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "invariant")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11], "react")); + var _StatusBar, _NativeStatusBarManag; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + /** + * Status bar style + */ + + /** + * Status bar animation + */ + + /** + * Merges the prop stack with the default values. + */ + function mergePropsStack(propsStack, defaultValues) { + return propsStack.reduce(function (prev, cur) { + for (var prop in cur) { + if (cur[prop] != null) { + prev[prop] = cur[prop]; + } + } + return prev; + }, Object.assign({}, defaultValues)); + } + + /** + * Returns an object to insert in the props stack from the props + * and the transition/animation info. + */ + function createStackEntry(props) { + var _props$animated, _props$showHideTransi; + var animated = (_props$animated = props.animated) != null ? _props$animated : false; + var showHideTransition = (_props$showHideTransi = props.showHideTransition) != null ? _props$showHideTransi : 'fade'; + return { + backgroundColor: props.backgroundColor != null ? { + value: props.backgroundColor, + animated: animated + } : null, + barStyle: props.barStyle != null ? { + value: props.barStyle, + animated: animated + } : null, + translucent: props.translucent, + hidden: props.hidden != null ? { + value: props.hidden, + animated: animated, + transition: showHideTransition + } : null, + networkActivityIndicatorVisible: props.networkActivityIndicatorVisible + }; + } + + /** + * Component to control the app status bar. + * + * ### Usage with Navigator + * + * It is possible to have multiple `StatusBar` components mounted at the same + * time. The props will be merged in the order the `StatusBar` components were + * mounted. One use case is to specify status bar styles per route using `Navigator`. + * + * ``` + * + * + * + * + * + * } + * /> + * + * ``` + * + * ### Imperative API + * + * For cases where using a component is not ideal, there are static methods + * to manipulate the `StatusBar` display stack. These methods have the same + * behavior as mounting and unmounting a `StatusBar` component. + * + * For example, you can call `StatusBar.pushStackEntry` to update the status bar + * before launching a third-party native UI component, and then call + * `StatusBar.popStackEntry` when completed. + * + * ``` + * const openThirdPartyBugReporter = async () => { + * // The bug reporter has a dark background, so we push a new status bar style. + * const stackEntry = StatusBar.pushStackEntry({barStyle: 'light-content'}); + * + * // `open` returns a promise that resolves when the UI is dismissed. + * await BugReporter.open(); + * + * // Don't forget to call `popStackEntry` when you're done. + * StatusBar.popStackEntry(stackEntry); + * }; + * ``` + * + * There is a legacy imperative API that enables you to manually update the + * status bar styles. However, the legacy API does not update the internal + * `StatusBar` display stack, which means that any changes will be overridden + * whenever a `StatusBar` component is mounted or unmounted. + * + * It is strongly advised that you use `pushStackEntry`, `popStackEntry`, or + * `replaceStackEntry` instead of the static methods beginning with `set`. + * + * ### Constants + * + * `currentHeight` (Android only) The height of the status bar. + */ + var StatusBar = /*#__PURE__*/function (_React$Component) { + function StatusBar() { + var _this; + (0, _classCallCheck2.default)(this, StatusBar); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, StatusBar, [].concat(args)); + // $FlowFixMe[missing-local-annot] + _this._stackEntry = null; + return _this; + } + (0, _inherits2.default)(StatusBar, _React$Component); + return (0, _createClass2.default)(StatusBar, [{ + key: "componentDidMount", + value: function componentDidMount() { + // Every time a StatusBar component is mounted, we push it's prop to a stack + // and always update the native status bar with the props from the top of then + // stack. This allows having multiple StatusBar components and the one that is + // added last or is deeper in the view hierarchy will have priority. + this._stackEntry = StatusBar.pushStackEntry(this.props); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + // When a StatusBar is unmounted, remove itself from the stack and update + // the native bar with the next props. + StatusBar.popStackEntry(this._stackEntry); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() { + this._stackEntry = StatusBar.replaceStackEntry(this._stackEntry, this.props); + } + + /** + * Updates the native status bar with the props from the stack. + */ + }, { + key: "render", + value: function render() { + return null; + } + }], [{ + key: "setHidden", + value: + // Provide an imperative API as static functions of the component. + // See the corresponding prop for more detail. + + /** + * Show or hide the status bar + * @param hidden Hide the status bar. + * @param animation Optional animation when + * changing the status bar hidden property. + */ + function setHidden(hidden, animation) { + animation = animation || 'none'; + StatusBar._defaultProps.hidden.value = hidden; + if (_Platform.default.OS === 'ios') { + _NativeStatusBarManagerIOS.default.setHidden(hidden, animation); + } else if (_Platform.default.OS === 'android') { + _NativeStatusBarManagerAndroid.default.setHidden(hidden); + } + } + + /** + * Set the status bar style + * @param style Status bar style to set + * @param animated Animate the style change. + */ + }, { + key: "setBarStyle", + value: function setBarStyle(style, animated) { + animated = animated || false; + StatusBar._defaultProps.barStyle.value = style; + if (_Platform.default.OS === 'ios') { + _NativeStatusBarManagerIOS.default.setStyle(style, animated); + } else if (_Platform.default.OS === 'android') { + _NativeStatusBarManagerAndroid.default.setStyle(style); + } + } + + /** + * Control the visibility of the network activity indicator + * @param visible Show the indicator. + */ + }, { + key: "setNetworkActivityIndicatorVisible", + value: function setNetworkActivityIndicatorVisible(visible) { + if (_Platform.default.OS !== 'ios') { + console.warn('`setNetworkActivityIndicatorVisible` is only available on iOS'); + return; + } + StatusBar._defaultProps.networkActivityIndicatorVisible = visible; + _NativeStatusBarManagerIOS.default.setNetworkActivityIndicatorVisible(visible); + } + + /** + * Set the background color for the status bar + * @param color Background color. + * @param animated Animate the style change. + */ + }, { + key: "setBackgroundColor", + value: function setBackgroundColor(color, animated) { + if (_Platform.default.OS !== 'android') { + console.warn('`setBackgroundColor` is only available on Android'); + return; + } + animated = animated || false; + StatusBar._defaultProps.backgroundColor.value = color; + var processedColor = (0, _processColor.default)(color); + if (processedColor == null) { + console.warn(`\`StatusBar.setBackgroundColor\`: Color ${color} parsed to null or undefined`); + return; + } + (0, _invariant.default)(typeof processedColor === 'number', 'Unexpected color given for StatusBar.setBackgroundColor'); + _NativeStatusBarManagerAndroid.default.setColor(processedColor, animated); + } + + /** + * Control the translucency of the status bar + * @param translucent Set as translucent. + */ + }, { + key: "setTranslucent", + value: function setTranslucent(translucent) { + if (_Platform.default.OS !== 'android') { + console.warn('`setTranslucent` is only available on Android'); + return; + } + StatusBar._defaultProps.translucent = translucent; + _NativeStatusBarManagerAndroid.default.setTranslucent(translucent); + } + + /** + * Push a StatusBar entry onto the stack. + * The return value should be passed to `popStackEntry` when complete. + * + * @param props Object containing the StatusBar props to use in the stack entry. + */ + }, { + key: "pushStackEntry", + value: function pushStackEntry(props) { + var entry = createStackEntry(props); + StatusBar._propsStack.push(entry); + StatusBar._updatePropsStack(); + return entry; + } + + /** + * Pop a StatusBar entry from the stack. + * + * @param entry Entry returned from `pushStackEntry`. + */ + }, { + key: "popStackEntry", + value: function popStackEntry(entry) { + var index = StatusBar._propsStack.indexOf(entry); + if (index !== -1) { + StatusBar._propsStack.splice(index, 1); + } + StatusBar._updatePropsStack(); + } + + /** + * Replace an existing StatusBar stack entry with new props. + * + * @param entry Entry returned from `pushStackEntry` to replace. + * @param props Object containing the StatusBar props to use in the replacement stack entry. + */ + }, { + key: "replaceStackEntry", + value: function replaceStackEntry(entry, props) { + var newEntry = createStackEntry(props); + var index = StatusBar._propsStack.indexOf(entry); + if (index !== -1) { + StatusBar._propsStack[index] = newEntry; + } + StatusBar._updatePropsStack(); + return newEntry; + } + }]); + }(React.Component); + _StatusBar = StatusBar; + StatusBar._propsStack = []; + StatusBar._defaultProps = createStackEntry({ + backgroundColor: _Platform.default.OS === 'android' ? (_NativeStatusBarManag = _NativeStatusBarManagerAndroid.default.getConstants().DEFAULT_BACKGROUND_COLOR) != null ? _NativeStatusBarManag : 'black' : 'black', + barStyle: 'default', + translucent: false, + hidden: false, + networkActivityIndicatorVisible: false + }); + // Timer for updating the native module values at the end of the frame. + // $FlowFixMe[missing-local-annot] + StatusBar._updateImmediate = null; + // The current merged values from the props stack. + // $FlowFixMe[missing-local-annot] + StatusBar._currentValues = null; + // TODO(janic): Provide a real API to deal with status bar height. See the + // discussion in #6195. + /** + * The current height of the status bar on the device. + * + * @platform android + */ + StatusBar.currentHeight = _Platform.default.OS === 'android' ? _NativeStatusBarManagerAndroid.default.getConstants().HEIGHT : null; + StatusBar._updatePropsStack = function () { + // Send the update to the native module only once at the end of the frame. + clearImmediate(_StatusBar._updateImmediate); + _StatusBar._updateImmediate = setImmediate(function () { + var oldProps = _StatusBar._currentValues; + var mergedProps = mergePropsStack(_StatusBar._propsStack, _StatusBar._defaultProps); + + // Update the props that have changed using the merged values from the props stack. + if (_Platform.default.OS === 'ios') { + if (!oldProps || oldProps.barStyle.value !== mergedProps.barStyle.value) { + _NativeStatusBarManagerIOS.default.setStyle(mergedProps.barStyle.value, mergedProps.barStyle.animated || false); + } + if (!oldProps || oldProps.hidden.value !== mergedProps.hidden.value) { + _NativeStatusBarManagerIOS.default.setHidden(mergedProps.hidden.value, mergedProps.hidden.animated ? mergedProps.hidden.transition : 'none'); + } + if (!oldProps || oldProps.networkActivityIndicatorVisible !== mergedProps.networkActivityIndicatorVisible) { + _NativeStatusBarManagerIOS.default.setNetworkActivityIndicatorVisible(mergedProps.networkActivityIndicatorVisible); + } + } else if (_Platform.default.OS === 'android') { + //todo(T60684787): Add back optimization to only update bar style and + //background color if the new value is different from the old value. + _NativeStatusBarManagerAndroid.default.setStyle(mergedProps.barStyle.value); + var processedColor = (0, _processColor.default)(mergedProps.backgroundColor.value); + if (processedColor == null) { + console.warn(`\`StatusBar._updatePropsStack\`: Color ${mergedProps.backgroundColor.value} parsed to null or undefined`); + } else { + (0, _invariant.default)(typeof processedColor === 'number', 'Unexpected color given in StatusBar._updatePropsStack'); + _NativeStatusBarManagerAndroid.default.setColor(processedColor, mergedProps.backgroundColor.animated); + } + if (!oldProps || oldProps.hidden.value !== mergedProps.hidden.value) { + _NativeStatusBarManagerAndroid.default.setHidden(mergedProps.hidden.value); + } + // Activities are not translucent by default, so always set if true. + if (!oldProps || oldProps.translucent !== mergedProps.translucent || mergedProps.translucent) { + _NativeStatusBarManagerAndroid.default.setTranslucent(mergedProps.translucent); + } + } + // Update the current prop values. + _StatusBar._currentValues = mergedProps; + }); + }; + module.exports = StatusBar; +},477,[6,18,19,23,25,28,189,34,478,479,37,65],"node_modules\\react-native\\Libraries\\Components\\StatusBar\\StatusBar.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var NativeModule = TurboModuleRegistry.getEnforcing('StatusBarManager'); + var constants = null; + var NativeStatusBarManager = { + getConstants: function getConstants() { + if (constants == null) { + constants = NativeModule.getConstants(); + } + return constants; + }, + setColor: function setColor(color, animated) { + NativeModule.setColor(color, animated); + }, + setTranslucent: function setTranslucent(translucent) { + NativeModule.setTranslucent(translucent); + }, + /** + * - statusBarStyles can be: + * - 'default' + * - 'dark-content' + */ + setStyle: function setStyle(statusBarStyle) { + NativeModule.setStyle(statusBarStyle); + }, + setHidden: function setHidden(hidden) { + NativeModule.setHidden(hidden); + } + }; + var _default = exports.default = NativeStatusBarManager; +},478,[36],"node_modules\\react-native\\Libraries\\Components\\StatusBar\\NativeStatusBarManagerAndroid.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0], "../../TurboModule/TurboModuleRegistry")); + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var NativeModule = TurboModuleRegistry.getEnforcing('StatusBarManager'); + var constants = null; + var NativeStatusBarManager = { + getConstants: function getConstants() { + if (constants == null) { + constants = NativeModule.getConstants(); + } + return constants; + }, + // TODO(T47754272) Can we remove this method? + getHeight: function getHeight(callback) { + NativeModule.getHeight(callback); + }, + setNetworkActivityIndicatorVisible: function setNetworkActivityIndicatorVisible(visible) { + NativeModule.setNetworkActivityIndicatorVisible(visible); + }, + addListener: function addListener(eventType) { + NativeModule.addListener(eventType); + }, + removeListeners: function removeListeners(count) { + NativeModule.removeListeners(count); + }, + /** + * - statusBarStyles can be: + * - 'default' + * - 'dark-content' + * - 'light-content' + */ + setStyle: function setStyle(statusBarStyle, animated) { + NativeModule.setStyle(statusBarStyle, animated); + }, + /** + * - withAnimation can be: 'none' | 'fade' | 'slide' + */ + setHidden: function setHidden(hidden, withAnimation) { + NativeModule.setHidden(hidden, withAnimation); + } + }; + var _default = exports.default = NativeStatusBarManager; +},479,[36],"node_modules\\react-native\\Libraries\\Components\\StatusBar\\NativeStatusBarManagerIOS.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0], "react-native/Libraries/Image/AssetRegistry").registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/node_modules/react-native/Libraries/LogBox/UI/LogBoxImages", + "width": 16, + "height": 28, + "scales": [1], + "hash": "5b50965d3dfbc518fe50ce36c314a6ec", + "name": "chevron-left", + "type": "png" + }); +},480,[463],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxImages\\chevron-left.png"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0], "react-native/Libraries/Image/AssetRegistry").registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/node_modules/react-native/Libraries/LogBox/UI/LogBoxImages", + "width": 16, + "height": 28, + "scales": [1], + "hash": "e62addcde857ebdb7342e6b9f1095e97", + "name": "chevron-right", + "type": "png" + }); +},481,[463],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxImages\\chevron-right.png"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Components/View/View")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../StyleSheet/StyleSheet")); + var _Text = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Text/Text")); + var _LogBoxMessage = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "./LogBoxMessage")); + var LogBoxStyle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5], "./LogBoxStyle")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[7], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorMessageHeader.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + var SHOW_MORE_MESSAGE_LENGTH = 300; + function LogBoxInspectorMessageHeader(props) { + function renderShowMore() { + if (props.message.content.length < SHOW_MORE_MESSAGE_LENGTH || !props.collapsed) { + return null; + } + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: messageStyles.collapse, + onPress: function onPress() { + return props.onPress(); + }, + children: "... See More" + }); + } + return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, { + style: messageStyles.body, + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: messageStyles.heading, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: [messageStyles.headingText, messageStyles[props.level]], + children: props.title + }) + }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Text.default, { + style: messageStyles.bodyText, + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxMessage.default, { + maxLength: props.collapsed ? SHOW_MORE_MESSAGE_LENGTH : Infinity, + message: props.message, + style: messageStyles.messageText + }), renderShowMore()] + })] + }); + } + var messageStyles = _StyleSheet.default.create({ + body: { + backgroundColor: LogBoxStyle.getBackgroundColor(1), + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 2 + }, + shadowRadius: 2, + shadowOpacity: 0.5, + flex: 0 + }, + bodyText: { + color: LogBoxStyle.getTextColor(1), + fontSize: 14, + includeFontPadding: false, + lineHeight: 20, + fontWeight: '500', + paddingHorizontal: 12, + paddingBottom: 10 + }, + heading: { + alignItems: 'center', + flexDirection: 'row', + paddingHorizontal: 12, + marginTop: 10, + marginBottom: 5 + }, + headingText: { + flex: 1, + fontSize: 20, + fontWeight: '600', + includeFontPadding: false, + lineHeight: 28 + }, + warn: { + color: LogBoxStyle.getWarningColor(1) + }, + error: { + color: LogBoxStyle.getErrorColor(1) + }, + fatal: { + color: LogBoxStyle.getFatalColor(1) + }, + syntax: { + color: LogBoxStyle.getFatalColor(1) + }, + messageText: { + color: LogBoxStyle.getTextColor(0.6) + }, + collapse: { + color: LogBoxStyle.getTextColor(0.7), + fontSize: 14, + fontWeight: '300', + lineHeight: 12 + }, + button: { + paddingVertical: 5, + paddingHorizontal: 10, + borderRadius: 3 + } + }); + var _default = exports.default = LogBoxInspectorMessageHeader; +},482,[6,241,266,310,458,457,65,106],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorMessageHeader.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Components/View/View")); + var _openFileInEditor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Core/Devtools/openFileInEditor")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../StyleSheet/StyleSheet")); + var _Text = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../../Text/Text")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../../Utilities/Platform")); + var _LogBoxButton = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./LogBoxButton")); + var _LogBoxInspectorSection = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./LogBoxInspectorSection")); + var LogBoxStyle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9], "./LogBoxStyle")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[11], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorReactFrames.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + var BEFORE_SLASH_RE = /^(.*)[\\/]/; + + // Taken from React https://github.com/facebook/react/blob/206d61f72214e8ae5b935f0bf8628491cb7f0797/packages/react-devtools-shared/src/backend/describeComponentFrame.js#L27-L41 + function getPrettyFileName(path) { + var fileName = path.replace(BEFORE_SLASH_RE, ''); + + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + if (match) { + var pathBeforeSlash = match[1]; + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + // Note the below string contains a zero width space after the "/" character. + // This is to prevent browsers like Chrome from formatting the file name as a link. + // (Since this is a source link, it would not work to open the source file anyway.) + fileName = folderName + '/​' + fileName; + } + } + } + return fileName; + } + function LogBoxInspectorReactFrames(props) { + var _this = this; + var _React$useState = React.useState(true), + _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2), + collapsed = _React$useState2[0], + setCollapsed = _React$useState2[1]; + if (props.log.componentStack == null || props.log.componentStack.length < 1) { + return null; + } + function getStackList() { + if (collapsed) { + return props.log.componentStack.slice(0, 3); + } else { + return props.log.componentStack; + } + } + function getCollapseMessage() { + if (props.log.componentStack.length <= 3) { + return; + } + var count = props.log.componentStack.length - 3; + if (collapsed) { + return `See ${count} more components`; + } else { + return `Collapse ${count} components`; + } + } + return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_LogBoxInspectorSection.default, { + heading: "Component Stack", + children: [getStackList().map(function (frame, index) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default + // Unfortunately we don't have a unique identifier for stack traces. + , { + style: componentStyles.frameContainer, + children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_LogBoxButton.default, { + backgroundColor: { + default: 'transparent', + pressed: LogBoxStyle.getBackgroundColor(1) + }, + onPress: + // Older versions of DevTools do not provide full path. + // This will not work on Windows, remove check once the + // DevTools return the full file path. + frame.fileName.startsWith('/') ? function () { + var _frame$location$row, _frame$location; + return (0, _openFileInEditor.default)(frame.fileName, (_frame$location$row = (_frame$location = frame.location) == null ? void 0 : _frame$location.row) != null ? _frame$location$row : 1); + } : null, + style: componentStyles.frame, + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: componentStyles.component, + children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Text.default, { + style: componentStyles.frameName, + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: componentStyles.bracket, + children: '<' + }), frame.content, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: componentStyles.bracket, + children: ' />' + })] + }) + }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Text.default, { + style: componentStyles.frameLocation, + children: [getPrettyFileName(frame.fileName), frame.location ? `:${frame.location.row}` : ''] + })] + }) + }, index); + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: componentStyles.collapseContainer, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxButton.default, { + backgroundColor: { + default: 'transparent', + pressed: LogBoxStyle.getBackgroundColor(1) + }, + onPress: function onPress() { + return setCollapsed(!collapsed); + }, + style: componentStyles.collapseButton, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: componentStyles.collapse, + children: getCollapseMessage() + }) + }) + })] + }); + } + var componentStyles = _StyleSheet.default.create({ + collapseContainer: { + marginLeft: 15, + flexDirection: 'row' + }, + collapseButton: { + borderRadius: 5 + }, + collapse: { + color: LogBoxStyle.getTextColor(0.7), + fontSize: 12, + fontWeight: '300', + lineHeight: 20, + marginTop: 0, + paddingVertical: 5, + paddingHorizontal: 10 + }, + frameContainer: { + flexDirection: 'row', + paddingHorizontal: 15 + }, + frame: { + flex: 1, + paddingVertical: 4, + paddingHorizontal: 10, + borderRadius: 5 + }, + component: { + flexDirection: 'row', + paddingRight: 10 + }, + frameName: { + fontFamily: _Platform.default.select({ + android: 'monospace', + ios: 'Menlo' + }), + color: LogBoxStyle.getTextColor(1), + fontSize: 14, + includeFontPadding: false, + lineHeight: 18 + }, + bracket: { + fontFamily: _Platform.default.select({ + android: 'monospace', + ios: 'Menlo' + }), + color: LogBoxStyle.getTextColor(0.4), + fontSize: 14, + fontWeight: '500', + includeFontPadding: false, + lineHeight: 18 + }, + frameLocation: { + color: LogBoxStyle.getTextColor(0.7), + fontSize: 12, + fontWeight: '300', + includeFontPadding: false, + lineHeight: 16, + paddingLeft: 10 + } + }); + var _default = exports.default = LogBoxInspectorReactFrames; +},483,[6,7,241,445,266,310,34,456,474,457,65,106],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorReactFrames.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + exports.getCollapseMessage = getCollapseMessage; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Components/View/View")); + var _openFileInEditor = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Core/Devtools/openFileInEditor")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../StyleSheet/StyleSheet")); + var _Text = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../../Text/Text")); + var _LogBoxButton = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./LogBoxButton")); + var _LogBoxInspectorSection = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "./LogBoxInspectorSection")); + var _LogBoxInspectorSourceMapStatus = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "./LogBoxInspectorSourceMapStatus")); + var _LogBoxInspectorStackFrame = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./LogBoxInspectorStackFrame")); + var LogBoxStyle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10], "./LogBoxStyle")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[12], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorStackFrames.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function getCollapseMessage(stackFrames, collapsed) { + if (stackFrames.length === 0) { + return 'No frames to show'; + } + var collapsedCount = stackFrames.reduce(function (count, _ref) { + var collapse = _ref.collapse; + if (collapse === true) { + return count + 1; + } + return count; + }, 0); + if (collapsedCount === 0) { + return 'Showing all frames'; + } + var framePlural = `frame${collapsedCount > 1 ? 's' : ''}`; + if (collapsedCount === stackFrames.length) { + return collapsed ? `See${collapsedCount > 1 ? ' all ' : ' '}${collapsedCount} collapsed ${framePlural}` : `Collapse${collapsedCount > 1 ? ' all ' : ' '}${collapsedCount} ${framePlural}`; + } else { + return collapsed ? `See ${collapsedCount} more ${framePlural}` : `Collapse ${collapsedCount} ${framePlural}`; + } + } + function LogBoxInspectorStackFrames(props) { + var _React$useState = React.useState(function () { + // Only collapse frames initially if some frames are not collapsed. + return props.log.getAvailableStack().some(function (_ref2) { + var collapse = _ref2.collapse; + return !collapse; + }); + }), + _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2), + collapsed = _React$useState2[0], + setCollapsed = _React$useState2[1]; + function getStackList() { + if (collapsed === true) { + return props.log.getAvailableStack().filter(function (_ref3) { + var collapse = _ref3.collapse; + return !collapse; + }); + } else { + return props.log.getAvailableStack(); + } + } + if (props.log.getAvailableStack().length === 0) { + return null; + } + return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_LogBoxInspectorSection.default, { + heading: "Call Stack", + action: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxInspectorSourceMapStatus.default, { + onPress: props.log.symbolicated.status === 'FAILED' ? props.onRetry : null, + status: props.log.symbolicated.status + }), + children: [props.log.symbolicated.status !== 'COMPLETE' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: stackStyles.hintBox, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: stackStyles.hintText, + children: "This call stack is not symbolicated. Some features are unavailable such as viewing the function name or tapping to open files." + }) + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(StackFrameList, { + list: getStackList(), + status: props.log.symbolicated.status + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(StackFrameFooter, { + onPress: function onPress() { + return setCollapsed(!collapsed); + }, + message: getCollapseMessage(props.log.getAvailableStack(), collapsed) + })] + }); + } + function StackFrameList(props) { + var _this = this; + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, { + children: props.list.map(function (frame, index) { + var file = frame.file, + lineNumber = frame.lineNumber; + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxInspectorStackFrame.default, { + frame: frame, + onPress: props.status === 'COMPLETE' && file != null && lineNumber != null ? function () { + return (0, _openFileInEditor.default)(file, lineNumber); + } : null + }, index); + }) + }); + } + function StackFrameFooter(props) { + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: stackStyles.collapseContainer, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LogBoxButton.default, { + backgroundColor: { + default: 'transparent', + pressed: LogBoxStyle.getBackgroundColor(1) + }, + onPress: props.onPress, + style: stackStyles.collapseButton, + children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: stackStyles.collapse, + children: props.message + }) + }) + }); + } + var stackStyles = _StyleSheet.default.create({ + section: { + marginTop: 15 + }, + heading: { + alignItems: 'center', + flexDirection: 'row', + paddingHorizontal: 12, + marginBottom: 10 + }, + headingText: { + color: LogBoxStyle.getTextColor(1), + flex: 1, + fontSize: 20, + fontWeight: '600', + includeFontPadding: false, + lineHeight: 20 + }, + body: { + paddingBottom: 10 + }, + bodyText: { + color: LogBoxStyle.getTextColor(1), + fontSize: 14, + includeFontPadding: false, + lineHeight: 18, + fontWeight: '500', + paddingHorizontal: 27 + }, + hintText: { + color: LogBoxStyle.getTextColor(0.7), + fontSize: 13, + includeFontPadding: false, + lineHeight: 18, + fontWeight: '400', + marginHorizontal: 10 + }, + hintBox: { + backgroundColor: LogBoxStyle.getBackgroundColor(), + marginHorizontal: 10, + paddingHorizontal: 5, + paddingVertical: 10, + borderRadius: 5, + marginBottom: 5 + }, + collapseContainer: { + marginLeft: 15, + flexDirection: 'row' + }, + collapseButton: { + borderRadius: 5 + }, + collapse: { + color: LogBoxStyle.getTextColor(0.7), + fontSize: 12, + fontWeight: '300', + lineHeight: 20, + marginTop: 0, + paddingHorizontal: 10, + paddingVertical: 5 + } + }); + var _default = exports.default = LogBoxInspectorStackFrames; +},484,[6,7,241,445,266,310,456,474,485,488,457,65,106],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorStackFrames.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _slicedToArray2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/slicedToArray")); + var _Animated = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../Animated/Animated")); + var _Easing = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Animated/Easing")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../StyleSheet/StyleSheet")); + var _Text = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "../../Text/Text")); + var _LogBoxButton = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "./LogBoxButton")); + var LogBoxStyle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7], "./LogBoxStyle")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[9], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorSourceMapStatus.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function LogBoxInspectorSourceMapStatus(props) { + var _React$useState = React.useState({ + animation: null, + rotate: null + }), + _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2), + state = _React$useState2[0], + setState = _React$useState2[1]; + React.useEffect(function () { + if (props.status === 'PENDING') { + if (state.animation == null) { + var animated = new _Animated.default.Value(0); + var animation = _Animated.default.loop(_Animated.default.timing(animated, { + duration: 2000, + easing: _Easing.default.linear, + toValue: 1, + useNativeDriver: true + })); + // $FlowFixMe[incompatible-call] + setState({ + animation: animation, + rotate: animated.interpolate({ + inputRange: [0, 1], + outputRange: ['0deg', '360deg'] + }) + }); + animation.start(); + } + } else { + if (state.animation != null) { + state.animation.stop(); + setState({ + animation: null, + rotate: null + }); + } + } + return function () { + if (state.animation != null) { + state.animation.stop(); + } + }; + }, [props.status, state.animation]); + var image; + var color; + switch (props.status) { + case 'FAILED': + image = _$$_REQUIRE(_dependencyMap[10], "./LogBoxImages/alert-triangle.png"); + color = LogBoxStyle.getErrorColor(1); + break; + case 'PENDING': + image = _$$_REQUIRE(_dependencyMap[11], "./LogBoxImages/loader.png"); + color = LogBoxStyle.getWarningColor(1); + break; + } + if (props.status === 'COMPLETE' || image == null) { + return null; + } + return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_LogBoxButton.default, { + backgroundColor: { + default: 'transparent', + pressed: LogBoxStyle.getBackgroundColor(1) + }, + hitSlop: { + bottom: 8, + left: 8, + right: 8, + top: 8 + }, + onPress: props.onPress, + style: styles.root, + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.Image, { + source: image, + style: [styles.image, { + tintColor: color + }, state.rotate == null || props.status !== 'PENDING' ? null : { + transform: [{ + rotate: state.rotate + }] + }] + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: [styles.text, { + color: color + }], + children: "Source Map" + })] + }); + } + var styles = _StyleSheet.default.create({ + root: { + alignItems: 'center', + borderRadius: 12, + flexDirection: 'row', + height: 24, + paddingHorizontal: 8 + }, + image: { + height: 14, + width: 16, + marginEnd: 4, + tintColor: LogBoxStyle.getTextColor(0.4) + }, + text: { + fontSize: 12, + includeFontPadding: false, + lineHeight: 16 + } + }); + var _default = exports.default = LogBoxInspectorSourceMapStatus; +},485,[6,7,399,359,266,310,456,457,65,106,486,487],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorSourceMapStatus.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0], "react-native/Libraries/Image/AssetRegistry").registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/node_modules/react-native/Libraries/LogBox/UI/LogBoxImages", + "width": 48, + "height": 42, + "scales": [1], + "hash": "4f355ba1efca4b9c0e7a6271af047f61", + "name": "alert-triangle", + "type": "png" + }); +},486,[463],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxImages\\alert-triangle.png"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0], "react-native/Libraries/Image/AssetRegistry").registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/node_modules/react-native/Libraries/LogBox/UI/LogBoxImages", + "width": 44, + "height": 44, + "scales": [1], + "hash": "817aca47ff3cea63020753d336e628a4", + "name": "loader", + "type": "png" + }); +},487,[463],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxImages\\loader.png"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Components/View/View")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../StyleSheet/StyleSheet")); + var _Text = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Text/Text")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../../Utilities/Platform")); + var _LogBoxButton = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "./LogBoxButton")); + var LogBoxStyle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6], "./LogBoxStyle")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[8], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorStackFrame.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function LogBoxInspectorStackFrame(props) { + var frame = props.frame, + onPress = props.onPress; + var column = frame.column != null && parseInt(frame.column, 10); + var location = getFileName(frame.file) + (frame.lineNumber != null ? ':' + frame.lineNumber + (column && !isNaN(column) ? ':' + (column + 1) : '') : ''); + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + style: styles.frameContainer, + children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_LogBoxButton.default, { + backgroundColor: { + default: 'transparent', + pressed: onPress ? LogBoxStyle.getBackgroundColor(1) : 'transparent' + }, + onPress: onPress, + style: styles.frame, + children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + style: [styles.name, frame.collapse === true && styles.dim], + children: frame.methodName + }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { + ellipsizeMode: "middle", + numberOfLines: 1, + style: [styles.location, frame.collapse === true && styles.dim], + children: location + })] + }) + }); + } + function getFileName(file) { + if (file == null) { + return ''; + } + var queryIndex = file.indexOf('?'); + return file.substring(file.lastIndexOf('/') + 1, queryIndex === -1 ? file.length : queryIndex); + } + var styles = _StyleSheet.default.create({ + frameContainer: { + flexDirection: 'row', + paddingHorizontal: 15 + }, + frame: { + flex: 1, + paddingVertical: 4, + paddingHorizontal: 10, + borderRadius: 5 + }, + lineLocation: { + flexDirection: 'row' + }, + name: { + color: LogBoxStyle.getTextColor(1), + fontSize: 14, + includeFontPadding: false, + lineHeight: 18, + fontWeight: '400', + fontFamily: _Platform.default.select({ + android: 'monospace', + ios: 'Menlo' + }) + }, + location: { + color: LogBoxStyle.getTextColor(0.8), + fontSize: 12, + fontWeight: '300', + includeFontPadding: false, + lineHeight: 16, + paddingLeft: 10 + }, + dim: { + color: LogBoxStyle.getTextColor(0.4), + fontWeight: '300' + }, + line: { + color: LogBoxStyle.getTextColor(0.8), + fontSize: 12, + fontWeight: '300', + includeFontPadding: false, + lineHeight: 16 + } + }); + var _default = exports.default = LogBoxInspectorStackFrame; +},488,[6,241,266,310,34,456,457,65,106],"node_modules\\react-native\\Libraries\\LogBox\\UI\\LogBoxInspectorStackFrame.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * 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. + * + * + * @nolint + * @providesModule ReactFabric-prod + * @preventMunge + * @generated SignedSource<> + */ + + "use strict"; + + _$$_REQUIRE(_dependencyMap[0], "react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore"); + var React = _$$_REQUIRE(_dependencyMap[1], "react"); + 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 onError(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 isArrayImpl = Array.isArray, + 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 (isArrayImpl(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; + } + var assign = Object.assign; + 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; + } + assign(SyntheticEvent.prototype, { + preventDefault: function preventDefault() { + this.defaultPrevented = !0; + var event = this.nativeEvent; + event && (event.preventDefault ? event.preventDefault() : "unknown" !== typeof event.returnValue && (event.returnValue = !1), this.isDefaultPrevented = functionThatReturnsTrue); + }, + stopPropagation: function stopPropagation() { + var event = this.nativeEvent; + event && (event.stopPropagation ? event.stopPropagation() : "unknown" !== typeof event.cancelBubble && (event.cancelBubble = !0), this.isPropagationStopped = functionThatReturnsTrue); + }, + persist: function persist() { + this.isPersistent = functionThatReturnsTrue; + }, + isPersistent: functionThatReturnsFalse, + destructor: function destructor() { + 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 currentTarget() { + return null; + }, + eventPhase: null, + bubbles: null, + cancelable: null, + timeStamp: function timeStamp(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(); + assign(prototype, Class.prototype); + Class.prototype = prototype; + Class.prototype.constructor = Class; + Class.Interface = 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 touchHistory() { + 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 instrumentationCallback, + ResponderTouchHistoryStore = { + instrument: function instrument(callback) { + instrumentationCallback = callback; + }, + recordTouchTrack: function recordTouchTrack(topLevelType, nativeEvent) { + null != instrumentationCallback && instrumentationCallback(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 : isArrayImpl(current) ? current.concat(next) : isArrayImpl(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 (isArrayImpl(current)) { + if (isArrayImpl(next)) return current.push.apply(current, next), current; + current.push(next); + return current; + } + return isArrayImpl(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 _getResponder() { + return responderInst; + }, + eventTypes: eventTypes, + extractEvents: function extractEvents(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 (isArrayImpl(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 injectGlobalResponderHandler(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 getListeners(inst, registrationName, phase, dispatchToImperativeListeners) { + var stateNode = inst.stateNode; + if (null === stateNode) return null; + inst = getFiberCurrentPropsFromNode(stateNode); + 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."); + if (!(dispatchToImperativeListeners && stateNode.canonical && stateNode.canonical._eventListeners)) return inst; + var listeners = []; + inst && listeners.push(inst); + var requestedPhaseIsCapture = "captured" === phase, + mangledImperativeRegistrationName = requestedPhaseIsCapture ? "rn:" + registrationName.replace(/Capture$/, "") : "rn:" + registrationName; + stateNode.canonical._eventListeners[mangledImperativeRegistrationName] && 0 < stateNode.canonical._eventListeners[mangledImperativeRegistrationName].length && stateNode.canonical._eventListeners[mangledImperativeRegistrationName].forEach(function (listenerObj) { + if ((null != listenerObj.options.capture && listenerObj.options.capture) === requestedPhaseIsCapture) { + var listenerFnWrapper = function listenerFnWrapper(syntheticEvent) { + var eventInst = new (_$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").CustomEvent)(mangledImperativeRegistrationName, { + detail: syntheticEvent.nativeEvent + }); + eventInst.isTrusted = !0; + eventInst.setSyntheticEvent(syntheticEvent); + for (var _len = arguments.length, args = Array(1 < _len ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key]; + listenerObj.listener.apply(listenerObj, [eventInst].concat(args)); + }; + listenerObj.options.once ? listeners.push(function () { + stateNode.canonical.removeEventListener_unstable(mangledImperativeRegistrationName, listenerObj.listener, listenerObj.capture); + listenerObj.invalidated || (listenerObj.invalidated = !0, listenerObj.listener.apply(listenerObj, arguments)); + }) : listeners.push(listenerFnWrapper); + } + }); + return 0 === listeners.length ? null : 1 === listeners.length ? listeners[0] : listeners; + } + var customBubblingEventTypes = _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").ReactNativeViewConfigRegistry.customBubblingEventTypes, + customDirectEventTypes = _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").ReactNativeViewConfigRegistry.customDirectEventTypes; + function accumulateListenersAndInstances(inst, event, listeners) { + var listenersLength = listeners ? isArrayImpl(listeners) ? listeners.length : 1 : 0; + if (0 < listenersLength) if (event._dispatchListeners = accumulateInto(event._dispatchListeners, listeners), null == event._dispatchInstances && 1 === listenersLength) event._dispatchInstances = inst;else for (event._dispatchInstances = event._dispatchInstances || [], isArrayImpl(event._dispatchInstances) || (event._dispatchInstances = [event._dispatchInstances]), listeners = 0; listeners < listenersLength; listeners++) event._dispatchInstances.push(inst); + } + function accumulateDirectionalDispatches$1(inst, phase, event) { + phase = getListeners(inst, event.dispatchConfig.phasedRegistrationNames[phase], phase, !0); + accumulateListenersAndInstances(inst, event, phase); + } + function traverseTwoPhase$1(inst, fn, arg, skipBubbling) { + for (var path = []; inst;) { + path.push(inst); + do inst = inst.return; while (inst && 5 !== inst.tag); + inst = inst ? inst : null; + } + for (inst = path.length; 0 < inst--;) fn(path[inst], "captured", arg); + if (skipBubbling) fn(path[0], "bubbled", arg);else for (inst = 0; inst < path.length; inst++) fn(path[inst], "bubbled", arg); + } + function accumulateTwoPhaseDispatchesSingle$1(event) { + event && event.dispatchConfig.phasedRegistrationNames && traverseTwoPhase$1(event._targetInst, accumulateDirectionalDispatches$1, event, !1); + } + function accumulateDirectDispatchesSingle$1(event) { + if (event && event.dispatchConfig.registrationName) { + var inst = event._targetInst; + if (inst && event && event.dispatchConfig.registrationName) { + var listeners = getListeners(inst, event.dispatchConfig.registrationName, "bubbled", !1); + accumulateListenersAndInstances(inst, event, listeners); + } + } + } + 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_223 = { + ResponderEventPlugin: ResponderEventPlugin, + ReactNativeBridgeEventPlugin: { + eventTypes: {}, + extractEvents: function extractEvents(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) null != topLevelType && null != topLevelType.dispatchConfig.phasedRegistrationNames && topLevelType.dispatchConfig.phasedRegistrationNames.skipBubbling ? topLevelType && topLevelType.dispatchConfig.phasedRegistrationNames && traverseTwoPhase$1(topLevelType._targetInst, accumulateDirectionalDispatches$1, topLevelType, !0) : forEachAccumulated(topLevelType, accumulateTwoPhaseDispatchesSingle$1);else if (directDispatchConfig) forEachAccumulated(topLevelType, accumulateDirectDispatchesSingle$1);else return null; + return topLevelType; + } + } + }, + isOrderingDirty$jscomp$inline_224 = !1, + pluginName$jscomp$inline_225; + for (pluginName$jscomp$inline_225 in injectedNamesToPlugins$jscomp$inline_223) if (injectedNamesToPlugins$jscomp$inline_223.hasOwnProperty(pluginName$jscomp$inline_225)) { + var pluginModule$jscomp$inline_226 = injectedNamesToPlugins$jscomp$inline_223[pluginName$jscomp$inline_225]; + if (!namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_225) || namesToPlugins[pluginName$jscomp$inline_225] !== pluginModule$jscomp$inline_226) { + if (namesToPlugins[pluginName$jscomp$inline_225]) throw Error("EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + (pluginName$jscomp$inline_225 + "`.")); + namesToPlugins[pluginName$jscomp$inline_225] = pluginModule$jscomp$inline_226; + isOrderingDirty$jscomp$inline_224 = !0; + } + } + isOrderingDirty$jscomp$inline_224 && recomputePluginOrdering(); + function getInstanceFromInstance(instanceHandle) { + return instanceHandle; + } + getFiberCurrentPropsFromNode = function getFiberCurrentPropsFromNode(inst) { + return inst.canonical.currentProps; + }; + getInstanceFromNode = getInstanceFromInstance; + getNodeFromInstance = function getNodeFromInstance(inst) { + inst = inst.stateNode.canonical; + if (!inst._nativeTag) throw Error("All native instances should have a tag."); + return inst; + }; + ResponderEventPlugin.injection.injectGlobalResponderHandler({ + onChange: function onChange(from, to, blockNativeResponder) { + var fromOrTo = from || to; + (fromOrTo = fromOrTo && fromOrTo.stateNode) && fromOrTo.canonical._internalInstanceHandle ? (from && nativeFabricUIManager.setIsJSResponder(from.stateNode.node, !1, blockNativeResponder || !1), to && nativeFabricUIManager.setIsJSResponder(to.stateNode.node, !0, blockNativeResponder || !1)) : null !== to ? _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.setJSResponder(to.stateNode.canonical._nativeTag, blockNativeResponder) : _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").UIManager.clearJSResponder(); + } + }); + var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, + REACT_ELEMENT_TYPE = Symbol.for("react.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_PROVIDER_TYPE = Symbol.for("react.provider"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"); + Symbol.for("react.scope"); + Symbol.for("react.debug_trace_mode"); + var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); + Symbol.for("react.legacy_hidden"); + Symbol.for("react.cache"); + Symbol.for("react.tracing_marker"); + var MAYBE_ITERATOR_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 getComponentNameFromType(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"; + } + 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; + type = type.displayName; + type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"); + return type; + case REACT_MEMO_TYPE: + return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo"; + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; + } + function getComponentNameFromFiber(fiber) { + var type = fiber.type; + switch (fiber.tag) { + case 24: + return "Cache"; + case 9: + return (type.displayName || "Context") + ".Consumer"; + case 10: + return (type._context.displayName || "Context") + ".Provider"; + case 18: + return "DehydratedFragment"; + case 11: + return fiber = type.render, fiber = fiber.displayName || fiber.name || "", type.displayName || ("" !== fiber ? "ForwardRef(" + fiber + ")" : "ForwardRef"); + case 7: + return "Fragment"; + case 5: + return type; + case 4: + return "Portal"; + case 3: + return "Root"; + case 6: + return "Text"; + case 16: + return getComponentNameFromType(type); + case 8: + return type === REACT_STRICT_MODE_TYPE ? "StrictMode" : "Mode"; + case 22: + return "Offscreen"; + case 12: + return "Profiler"; + case 21: + return "Scope"; + case 13: + return "Suspense"; + case 19: + return "SuspenseList"; + case 25: + return "TracingMarker"; + case 1: + case 0: + case 17: + case 2: + case 14: + case 15: + if ("function" === typeof type) return type.displayName || type.name || null; + if ("string" === typeof type) return type; + } + 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 & 4098) && (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$0 = parentA.child; child$0;) { + if (child$0 === a) { + didFindChild = !0; + a = parentA; + b = parentB; + break; + } + if (child$0 === b) { + didFindChild = !0; + b = parentA; + a = parentB; + break; + } + child$0 = child$0.sibling; + } + if (!didFindChild) { + for (child$0 = parentB.child; child$0;) { + if (child$0 === a) { + didFindChild = !0; + a = parentB; + b = parentA; + break; + } + if (child$0 === b) { + didFindChild = !0; + b = parentB; + a = parentA; + break; + } + child$0 = child$0.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 mountSafeCallback_NOT_REALLY_SAFE(context, callback) { + return function () { + if (callback && ("boolean" !== typeof context.__isMounted || context.__isMounted)) return callback.apply(context, arguments); + }; + } + var emptyObject = {}, + removedKeys = null, + removedKeyCount = 0, + deepDifferOptions = { + unsafelyIgnoreFunctions: !0 + }; + function defaultDiffer(prevProp, nextProp) { + return "object" !== typeof nextProp || null === nextProp ? !0 : _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").deepDiffer(prevProp, nextProp, deepDifferOptions); + } + function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) { + if (isArrayImpl(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 (!isArrayImpl(prevProp) && !isArrayImpl(nextProp)) return diffProperties(updatePayload, prevProp, nextProp, validAttributes); + if (isArrayImpl(prevProp) && isArrayImpl(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 isArrayImpl(prevProp) ? diffProperties(updatePayload, _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").flattenStyle(prevProp), nextProp, validAttributes) : diffProperties(updatePayload, prevProp, _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").flattenStyle(nextProp), validAttributes); + } + function addNestedProperty(updatePayload, nextProp, validAttributes) { + if (!nextProp) return updatePayload; + if (!isArrayImpl(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 (!isArrayImpl(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$2 in prevProps) void 0 === nextProps[propKey$2] && (!(attributeConfig = validAttributes[propKey$2]) || updatePayload && void 0 !== updatePayload[propKey$2] || (prevProp = prevProps[propKey$2], void 0 !== prevProp && ("object" !== typeof attributeConfig || "function" === typeof attributeConfig.diff || "function" === typeof attributeConfig.process ? ((updatePayload || (updatePayload = {}))[propKey$2] = null, removedKeys || (removedKeys = {}), removedKeys[propKey$2] || (removedKeys[propKey$2] = !0, removedKeyCount++)) : updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig)))); + return updatePayload; + } + 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 (isArrayImpl(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); + } + } + function dispatchEvent(target, topLevelType, nativeEvent) { + var eventTarget = null; + if (null != target) { + var stateNode = target.stateNode; + null != stateNode && (eventTarget = stateNode.canonical); + } + batchedUpdates(function () { + var event = { + eventName: topLevelType, + nativeEvent: nativeEvent + }; + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").RawEventEmitter.emit(topLevelType, event); + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").RawEventEmitter.emit("*", event); + event = eventTarget; + for (var events = null, legacyPlugins = plugins, i = 0; i < legacyPlugins.length; i++) { + var possiblePlugin = legacyPlugins[i]; + possiblePlugin && (possiblePlugin = possiblePlugin.extractEvents(topLevelType, target, nativeEvent, event)) && (events = accumulateInto(events, possiblePlugin)); + } + event = events; + null !== event && (eventQueue = accumulateInto(eventQueue, event)); + event = eventQueue; + eventQueue = null; + if (event) { + forEachAccumulated(event, 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 event = rethrowError, hasRethrowError = !1, rethrowError = null, event; + } + }); + } + var rendererID = null, + injectedHook = null; + function onCommitRoot(root) { + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) try { + injectedHook.onCommitFiberRoot(rendererID, root, void 0, 128 === (root.current.flags & 128)); + } catch (err) {} + } + var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, + log = Math.log, + LN2 = Math.LN2; + function clz32Fallback(x) { + x >>>= 0; + return 0 === x ? 32 : 31 - (log(x) / LN2 | 0) | 0; + } + var nextTransitionLane = 64, + nextRetryLane = 4194304; + function getHighestPriorityLanes(lanes) { + switch (lanes & -lanes) { + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return lanes & 4194240; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return lanes & 130023424; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: + return 1073741824; + default: + return lanes; + } + } + function getNextLanes(root, wipLanes) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) return 0; + var nextLanes = 0, + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes, + nonIdlePendingLanes = pendingLanes & 268435455; + if (0 !== nonIdlePendingLanes) { + var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes; + 0 !== nonIdleUnblockedLanes ? nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes) : (pingedLanes &= nonIdlePendingLanes, 0 !== pingedLanes && (nextLanes = getHighestPriorityLanes(pingedLanes))); + } else nonIdlePendingLanes = pendingLanes & ~suspendedLanes, 0 !== nonIdlePendingLanes ? nextLanes = getHighestPriorityLanes(nonIdlePendingLanes) : 0 !== pingedLanes && (nextLanes = getHighestPriorityLanes(pingedLanes)); + if (0 === nextLanes) return 0; + if (0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && (suspendedLanes = nextLanes & -nextLanes, pingedLanes = wipLanes & -wipLanes, suspendedLanes >= pingedLanes || 16 === suspendedLanes && 0 !== (pingedLanes & 4194240))) return wipLanes; + 0 !== (nextLanes & 4) && (nextLanes |= pendingLanes & 16); + wipLanes = root.entangledLanes; + if (0 !== wipLanes) for (root = root.entanglements, wipLanes &= nextLanes; 0 < wipLanes;) pendingLanes = 31 - clz32(wipLanes), suspendedLanes = 1 << pendingLanes, nextLanes |= root[pendingLanes], wipLanes &= ~suspendedLanes; + return nextLanes; + } + function computeExpirationTime(lane, currentTime) { + switch (lane) { + case 1: + case 2: + case 4: + return currentTime + 250; + case 8: + case 16: + case 32: + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return currentTime + 5e3; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return -1; + case 134217728: + case 268435456: + case 536870912: + case 1073741824: + return -1; + default: + return -1; + } + } + function getLanesToRetrySynchronouslyOnError(root) { + root = root.pendingLanes & -1073741825; + return 0 !== root ? root : root & 1073741824 ? 1073741824 : 0; + } + function claimNextTransitionLane() { + var lane = nextTransitionLane; + nextTransitionLane <<= 1; + 0 === (nextTransitionLane & 4194240) && (nextTransitionLane = 64); + return lane; + } + 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$7 = 31 - clz32(noLongerPendingLanes), + lane = 1 << index$7; + remainingLanes[index$7] = 0; + eventTimes[index$7] = -1; + root[index$7] = -1; + noLongerPendingLanes &= ~lane; + } + } + function markRootEntangled(root, entangledLanes) { + var rootEntangledLanes = root.entangledLanes |= entangledLanes; + for (root = root.entanglements; rootEntangledLanes;) { + var index$8 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$8; + lane & entangledLanes | root[index$8] & entangledLanes && (root[index$8] |= entangledLanes); + rootEntangledLanes &= ~lane; + } + } + var currentUpdatePriority = 0; + function lanesToEventPriority(lanes) { + lanes &= -lanes; + return 1 < lanes ? 4 < lanes ? 0 !== (lanes & 268435455) ? 16 : 536870912 : 4 : 1; + } + function shim$1() { + throw Error("The current renderer does not support hydration. This error is likely caused by a bug in React. Please file an issue."); + } + var _nativeFabricUIManage = nativeFabricUIManager, + createNode = _nativeFabricUIManage.createNode, + cloneNode = _nativeFabricUIManage.cloneNode, + cloneNodeWithNewChildren = _nativeFabricUIManage.cloneNodeWithNewChildren, + cloneNodeWithNewChildrenAndProps = _nativeFabricUIManage.cloneNodeWithNewChildrenAndProps, + cloneNodeWithNewProps = _nativeFabricUIManage.cloneNodeWithNewProps, + createChildNodeSet = _nativeFabricUIManage.createChildSet, + appendChildNode = _nativeFabricUIManage.appendChild, + appendChildNodeToSet = _nativeFabricUIManage.appendChildToSet, + completeRoot = _nativeFabricUIManage.completeRoot, + registerEventHandler = _nativeFabricUIManage.registerEventHandler, + fabricMeasure = _nativeFabricUIManage.measure, + fabricMeasureInWindow = _nativeFabricUIManage.measureInWindow, + fabricMeasureLayout = _nativeFabricUIManage.measureLayout, + FabricDiscretePriority = _nativeFabricUIManage.unstable_DiscreteEventPriority, + fabricGetCurrentEventPriority = _nativeFabricUIManage.unstable_getCurrentEventPriority, + _setNativeProps = _nativeFabricUIManage.setNativeProps, + getViewConfigForType = _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").ReactNativeViewConfigRegistry.get, + nextReactTag = 2; + registerEventHandler && registerEventHandler(dispatchEvent); + var ReactFabricHostComponent = function () { + function ReactFabricHostComponent(tag, viewConfig, props, internalInstanceHandle) { + this._nativeTag = tag; + this.viewConfig = viewConfig; + this.currentProps = props; + this._internalInstanceHandle = internalInstanceHandle; + } + var _proto = ReactFabricHostComponent.prototype; + _proto.blur = function () { + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").TextInputState.blurTextInput(this); + }; + _proto.focus = function () { + _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").TextInputState.focusTextInput(this); + }; + _proto.measure = function (callback) { + var stateNode = this._internalInstanceHandle.stateNode; + null != stateNode && fabricMeasure(stateNode.node, mountSafeCallback_NOT_REALLY_SAFE(this, callback)); + }; + _proto.measureInWindow = function (callback) { + var stateNode = this._internalInstanceHandle.stateNode; + null != stateNode && fabricMeasureInWindow(stateNode.node, mountSafeCallback_NOT_REALLY_SAFE(this, callback)); + }; + _proto.measureLayout = function (relativeToNativeNode, onSuccess, onFail) { + if ("number" !== typeof relativeToNativeNode && relativeToNativeNode instanceof ReactFabricHostComponent) { + var toStateNode = this._internalInstanceHandle.stateNode; + relativeToNativeNode = relativeToNativeNode._internalInstanceHandle.stateNode; + null != toStateNode && null != relativeToNativeNode && fabricMeasureLayout(toStateNode.node, relativeToNativeNode.node, mountSafeCallback_NOT_REALLY_SAFE(this, onFail), mountSafeCallback_NOT_REALLY_SAFE(this, onSuccess)); + } + }; + _proto.setNativeProps = function (nativeProps) { + nativeProps = diffProperties(null, emptyObject, nativeProps, this.viewConfig.validAttributes); + var stateNode = this._internalInstanceHandle.stateNode; + null != stateNode && null != nativeProps && _setNativeProps(stateNode.node, nativeProps); + }; + _proto.addEventListener_unstable = function (eventType, listener, options) { + if ("string" !== typeof eventType) throw Error("addEventListener_unstable eventType must be a string"); + if ("function" !== typeof listener) throw Error("addEventListener_unstable listener must be a function"); + var optionsObj = "object" === typeof options && null !== options ? options : {}; + options = ("boolean" === typeof options ? options : optionsObj.capture) || !1; + var once = optionsObj.once || !1; + optionsObj = optionsObj.passive || !1; + var eventListeners = this._eventListeners || {}; + null == this._eventListeners && (this._eventListeners = eventListeners); + var namedEventListeners = eventListeners[eventType] || []; + null == eventListeners[eventType] && (eventListeners[eventType] = namedEventListeners); + namedEventListeners.push({ + listener: listener, + invalidated: !1, + options: { + capture: options, + once: once, + passive: optionsObj, + signal: null + } + }); + }; + _proto.removeEventListener_unstable = function (eventType, listener, options) { + var optionsObj = "object" === typeof options && null !== options ? options : {}, + capture = ("boolean" === typeof options ? options : optionsObj.capture) || !1; + (options = this._eventListeners) && (optionsObj = options[eventType]) && (options[eventType] = optionsObj.filter(function (listenerObj) { + return !(listenerObj.listener === listener && listenerObj.options.capture === capture); + })); + }; + return ReactFabricHostComponent; + }(); + function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) { + hostContext = nextReactTag; + nextReactTag += 2; + return { + node: createNode(hostContext, "RCTRawText", rootContainerInstance, { + text: text + }, internalInstanceHandle) + }; + } + var scheduleTimeout = setTimeout, + cancelTimeout = clearTimeout; + function cloneHiddenInstance(instance) { + var node = instance.node; + var JSCompiler_inline_result = diffProperties(null, emptyObject, { + style: { + display: "none" + } + }, instance.canonical.viewConfig.validAttributes); + return { + node: cloneNodeWithNewProps(node, JSCompiler_inline_result), + canonical: instance.canonical + }; + } + 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 hasOwnProperty = Object.prototype.hasOwnProperty, + 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; + type = type.childContextTypes; + if ("function" !== typeof instance.getChildContext) return parentContext; + instance = instance.getChildContext(); + for (var contextKey in instance) if (!(contextKey in type)) throw Error((getComponentNameFromFiber(fiber) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.'); + return 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); + } + 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, + syncQueue = null, + includesLegacySyncCallbacks = !1, + isFlushingSyncQueue = !1; + function flushSyncCallbacks() { + if (!isFlushingSyncQueue && null !== syncQueue) { + isFlushingSyncQueue = !0; + var i = 0, + previousUpdatePriority = currentUpdatePriority; + try { + var queue = syncQueue; + for (currentUpdatePriority = 1; i < queue.length; i++) { + var callback = queue[i]; + do callback = callback(!0); while (null !== callback); + } + syncQueue = null; + includesLegacySyncCallbacks = !1; + } catch (error) { + throw null !== syncQueue && (syncQueue = syncQueue.slice(i + 1)), _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_scheduleCallback(_$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_ImmediatePriority, flushSyncCallbacks), error; + } finally { + currentUpdatePriority = previousUpdatePriority, isFlushingSyncQueue = !1; + } + } + return null; + } + var forkStack = [], + forkStackIndex = 0, + treeForkProvider = null, + idStack = [], + idStackIndex = 0, + treeContextProvider = null; + function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider;) treeForkProvider = forkStack[--forkStackIndex], forkStack[forkStackIndex] = null, --forkStackIndex, forkStack[forkStackIndex] = null; + for (; workInProgress === treeContextProvider;) treeContextProvider = idStack[--idStackIndex], idStack[idStackIndex] = null, --idStackIndex, idStack[idStackIndex] = null, --idStackIndex, idStack[idStackIndex] = null; + } + var hydrationErrors = null, + ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; + 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++) { + var currentKey = keysA[keysB]; + if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey])) 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 resolveDefaultProps(Component, baseProps) { + if (Component && Component.defaultProps) { + baseProps = 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, + lastFullyObservedContext = null; + function resetContextDependencies() { + lastFullyObservedContext = lastContextDependency = currentlyRenderingFiber = null; + } + function popProvider(context) { + var currentValue = valueCursor.current; + pop(valueCursor); + context._currentValue2 = currentValue; + } + function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { + for (; null !== parent;) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes ? (parent.childLanes |= renderLanes, null !== alternate && (alternate.childLanes |= renderLanes)) : null !== alternate && (alternate.childLanes & renderLanes) !== renderLanes && (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; + } + } + function prepareToReadContext(workInProgress, renderLanes) { + currentlyRenderingFiber = workInProgress; + lastFullyObservedContext = lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && null !== workInProgress.firstContext && (0 !== (workInProgress.lanes & renderLanes) && (didReceiveUpdate = !0), workInProgress.firstContext = null); + } + function readContext(context) { + var value = context._currentValue2; + if (lastFullyObservedContext !== context) if (context = { + context: context, + memoizedValue: value, + next: null + }, 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 = context; + currentlyRenderingFiber.dependencies = { + lanes: 0, + firstContext: context + }; + } else lastContextDependency = lastContextDependency.next = context; + return value; + } + var concurrentQueues = null; + function pushConcurrentUpdateQueue(queue) { + null === concurrentQueues ? concurrentQueues = [queue] : concurrentQueues.push(queue); + } + function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { + var interleaved = queue.interleaved; + null === interleaved ? (update.next = update, pushConcurrentUpdateQueue(queue)) : (update.next = interleaved.next, interleaved.next = update); + queue.interleaved = update; + return markUpdateLaneFromFiberToRoot(fiber, lane); + } + 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; + } + var 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, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if (0 !== (executionContext & 2)) { + var pending = updateQueue.pending; + null === pending ? update.next = update : (update.next = pending.next, pending.next = update); + updateQueue.pending = update; + return markUpdateLaneFromFiberToRoot(fiber, lane); + } + pending = updateQueue.interleaved; + null === pending ? (update.next = update, pushConcurrentUpdateQueue(updateQueue)) : (update.next = pending.next, pending.next = update); + updateQueue.interleaved = update; + return markUpdateLaneFromFiberToRoot(fiber, lane); + } + function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && (fiber = fiber.shared, 0 !== (lane & 4194240))) { + 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 & -65537 | 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 = assign({}, newState, updateLane); + break a; + case 2: + hasForceUpdate = !0; + } + } + null !== pendingQueue.callback && 0 !== pendingQueue.lane && (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 : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && (workInProgress.updateQueue.baseState = getDerivedStateFromProps); + } + var classComponentUpdater = { + isMounted: function isMounted(component) { + return (component = component._reactInternals) ? getNearestMountedFiber(component) === component : !1; + }, + enqueueSetState: function enqueueSetState(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); + payload = enqueueUpdate(inst, update, lane); + null !== payload && (scheduleUpdateOnFiber(payload, inst, lane, eventTime), entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function enqueueReplaceState(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); + payload = enqueueUpdate(inst, update, lane); + null !== payload && (scheduleUpdateOnFiber(payload, inst, lane, eventTime), entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function enqueueForceUpdate(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); + callback = enqueueUpdate(inst, update, lane); + null !== callback && (scheduleUpdateOnFiber(callback, inst, lane, eventTime), 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)); + 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); + } + 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://react.dev/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 resolvedInst = inst, + stringRef = "" + returnFiber; + if (null !== current && null !== current.ref && "function" === typeof current.ref && current.ref._stringRef === stringRef) return current.ref; + current = function current(value) { + var refs = resolvedInst.refs; + refs === emptyRefsObject && (refs = resolvedInst.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://react.dev/link/refs-must-have-owner for more information."); + } + return returnFiber; + } + function throwOnInvalidObjectType(returnFiber, newChild) { + returnFiber = Object.prototype.toString.call(newChild); + throw Error("Objects are not valid as a React child (found: " + ("[object Object]" === returnFiber ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : returnFiber) + "). If you meant to render a collection of children, use an array instead."); + } + function resolveLazy(lazyType) { + var init = lazyType._init; + return init(lazyType._payload); + } + 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 newFiber.flags |= 1048576, 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 || "object" === typeof elementType && null !== elementType && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current.type)) 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 && "" !== 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; + case REACT_LAZY_TYPE: + var init = newChild._init; + return createChild(returnFiber, init(newChild._payload), lanes); + } + if (isArrayImpl(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 && "" !== 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; + case REACT_LAZY_TYPE: + return key = newChild._init, updateSlot(returnFiber, oldFiber, key(newChild._payload), lanes); + } + if (isArrayImpl(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 && "" !== 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); + case REACT_LAZY_TYPE: + var init = newChild._init; + return updateFromMap(existingChildren, returnFiber, newIdx, init(newChild._payload), lanes); + } + if (isArrayImpl(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; + } + function reconcileChildFibers(returnFiber, currentFirstChild, newChild, lanes) { + "object" === typeof newChild && null !== newChild && newChild.type === REACT_FRAGMENT_TYPE && null === newChild.key && (newChild = newChild.props.children); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + a: { + for (var key = newChild.key, child = currentFirstChild; null !== child;) { + if (child.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === child.tag) { + deleteRemainingChildren(returnFiber, child.sibling); + currentFirstChild = useFiber(child, newChild.props.children); + currentFirstChild.return = returnFiber; + returnFiber = currentFirstChild; + break a; + } + } else if (child.elementType === key || "object" === typeof key && null !== key && key.$$typeof === REACT_LAZY_TYPE && resolveLazy(key) === child.type) { + deleteRemainingChildren(returnFiber, child.sibling); + currentFirstChild = useFiber(child, newChild.props); + currentFirstChild.ref = coerceRef(returnFiber, child, newChild); + currentFirstChild.return = returnFiber; + returnFiber = currentFirstChild; + break a; + } + deleteRemainingChildren(returnFiber, child); + break; + } else deleteChild(returnFiber, child); + child = child.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 (child = newChild.key; null !== currentFirstChild;) { + if (currentFirstChild.key === child) { + 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); + case REACT_LAZY_TYPE: + return child = newChild._init, reconcileChildFibers(returnFiber, currentFirstChild, child(newChild._payload), lanes); + } + if (isArrayImpl(newChild)) return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes); + if (getIteratorFn(newChild)) return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes); + throwOnInvalidObjectType(returnFiber, newChild); + } + return "string" === typeof newChild && "" !== newChild || "number" === typeof newChild ? (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)) : deleteRemainingChildren(returnFiber, currentFirstChild); + } + return reconcileChildFibers; + } + 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$1() || shim$1())) 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]._workInProgressVersionSecondary = 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, + globalClientIdCounter = 0; + function throwInvalidHookError() { + throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."); + } + function 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, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), current = update.hasEagerState ? update.eagerState : reducer(current, update.action);else { + var clone = { + lane: updateLane, + action: update.action, + hasEagerState: update.hasEagerState, + 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 updateMutableSource() {} + function updateSyncExternalStore(subscribe, getSnapshot) { + var fiber = currentlyRenderingFiber$1, + hook = updateWorkInProgressHook(), + nextSnapshot = getSnapshot(), + snapshotChanged = !objectIs(hook.memoizedState, nextSnapshot); + snapshotChanged && (hook.memoizedState = nextSnapshot, didReceiveUpdate = !0); + hook = hook.queue; + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [subscribe]); + if (hook.getSnapshot !== getSnapshot || snapshotChanged || null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) { + fiber.flags |= 2048; + pushEffect(9, updateStoreInstance.bind(null, fiber, hook, nextSnapshot, getSnapshot), void 0, null); + if (null === workInProgressRoot) throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue."); + 0 !== (renderLanes & 30) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + } + return nextSnapshot; + } + function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { + getSnapshot: getSnapshot, + value: renderedSnapshot + }; + getSnapshot = currentlyRenderingFiber$1.updateQueue; + null === getSnapshot ? (getSnapshot = { + lastEffect: null, + stores: null + }, currentlyRenderingFiber$1.updateQueue = getSnapshot, getSnapshot.stores = [fiber]) : (renderedSnapshot = getSnapshot.stores, null === renderedSnapshot ? getSnapshot.stores = [fiber] : renderedSnapshot.push(fiber)); + } + function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + } + function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); + } + function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; + } + } + function forceStoreRerender(fiber) { + var root = markUpdateLaneFromFiberToRoot(fiber, 1); + null !== root && scheduleUpdateOnFiber(root, fiber, 1, -1); + } + function mountState(initialState) { + var hook = mountWorkInProgressHook(); + "function" === typeof initialState && (initialState = initialState()); + hook.memoizedState = hook.baseState = initialState; + initialState = { + pending: null, + interleaved: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + hook.queue = initialState; + initialState = initialState.dispatch = dispatchSetState.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, + stores: 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(8390656, 8, create, deps); + } + function updateEffect(create, deps) { + return updateEffectImpl(2048, 8, create, deps); + } + function updateInsertionEffect(create, deps) { + return updateEffectImpl(4, 2, create, deps); + } + function updateLayoutEffect(create, deps) { + return updateEffectImpl(4, 4, create, deps); + } + function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) 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, 4, imperativeHandleEffect.bind(null, create, ref), deps); + } + function mountDebugValue() {} + function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== 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 updateDeferredValueImpl(hook, prevValue, value) { + if (0 === (renderLanes & 21)) return hook.baseState && (hook.baseState = !1, didReceiveUpdate = !0), hook.memoizedState = value; + objectIs(value, prevValue) || (value = claimNextTransitionLane(), currentlyRenderingFiber$1.lanes |= value, workInProgressRootSkippedLanes |= value, hook.baseState = !0); + return prevValue; + } + function startTransition(setPending, callback) { + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 0 !== previousPriority && 4 > previousPriority ? previousPriority : 4; + setPending(!0); + var prevTransition = ReactCurrentBatchConfig$1.transition; + ReactCurrentBatchConfig$1.transition = {}; + try { + setPending(!1), callback(); + } finally { + currentUpdatePriority = previousPriority, ReactCurrentBatchConfig$1.transition = prevTransition; + } + } + function updateId() { + return updateWorkInProgressHook().memoizedState; + } + function dispatchReducerAction(fiber, queue, action) { + var lane = requestUpdateLane(fiber); + action = { + lane: lane, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, action);else if (action = enqueueConcurrentHookUpdate(fiber, queue, action, lane), null !== action) { + var eventTime = requestEventTime(); + scheduleUpdateOnFiber(action, fiber, lane, eventTime); + entangleTransitionUpdate(action, queue, lane); + } + } + function dispatchSetState(fiber, queue, action) { + var lane = requestUpdateLane(fiber), + update = { + lane: lane, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);else { + var alternate = fiber.alternate; + if (0 === fiber.lanes && (null === alternate || 0 === alternate.lanes) && (alternate = queue.lastRenderedReducer, null !== alternate)) try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) { + var interleaved = queue.interleaved; + null === interleaved ? (update.next = update, pushConcurrentUpdateQueue(queue)) : (update.next = interleaved.next, interleaved.next = update); + queue.interleaved = update; + return; + } + } catch (error) {} finally {} + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + null !== action && (update = requestEventTime(), scheduleUpdateOnFiber(action, fiber, lane, update), entangleTransitionUpdate(action, queue, lane)); + } + } + function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return fiber === currentlyRenderingFiber$1 || null !== alternate && alternate === currentlyRenderingFiber$1; + } + function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = !0; + var pending = queue.pending; + null === pending ? update.next = update : (update.next = pending.next, pending.next = update); + queue.pending = update; + } + function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194240)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); + } + } + var ContextOnlyDispatcher = { + readContext: readContext, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useMutableSource: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + unstable_isNewReconciler: !1 + }, + HooksDispatcherOnMount = { + readContext: readContext, + useCallback: function useCallback(callback, deps) { + mountWorkInProgressHook().memoizedState = [callback, void 0 === deps ? null : deps]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + return mountEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + return mountEffectImpl(4, 4, create, deps); + }, + useInsertionEffect: function useInsertionEffect(create, deps) { + return mountEffectImpl(4, 2, create, deps); + }, + useMemo: function useMemo(nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + nextCreate = nextCreate(); + hook.memoizedState = [nextCreate, deps]; + return nextCreate; + }, + useReducer: function useReducer(reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + initialArg = void 0 !== init ? init(initialArg) : initialArg; + hook.memoizedState = hook.baseState = initialArg; + reducer = { + pending: null, + interleaved: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialArg + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind(null, currentlyRenderingFiber$1, reducer); + return [hook.memoizedState, reducer]; + }, + useRef: function useRef(initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { + current: initialValue + }; + return hook.memoizedState = initialValue; + }, + useState: mountState, + useDebugValue: mountDebugValue, + useDeferredValue: function useDeferredValue(value) { + return mountWorkInProgressHook().memoizedState = value; + }, + useTransition: function useTransition() { + var _mountState = mountState(!1), + isPending = _mountState[0]; + _mountState = startTransition.bind(null, _mountState[1]); + mountWorkInProgressHook().memoizedState = _mountState; + return [isPending, _mountState]; + }, + useMutableSource: function useMutableSource() {}, + useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot) { + var fiber = currentlyRenderingFiber$1, + hook = mountWorkInProgressHook(); + var nextSnapshot = getSnapshot(); + if (null === workInProgressRoot) throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue."); + 0 !== (renderLanes & 30) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + hook.memoizedState = nextSnapshot; + var inst = { + value: nextSnapshot, + getSnapshot: getSnapshot + }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]); + fiber.flags |= 2048; + pushEffect(9, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null); + return nextSnapshot; + }, + useId: function useId() { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix, + globalClientId = globalClientIdCounter++; + identifierPrefix = ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; + return hook.memoizedState = identifierPrefix; + }, + unstable_isNewReconciler: !1 + }, + HooksDispatcherOnUpdate = { + readContext: readContext, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function useState() { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function useDeferredValue(value) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl(hook, currentHook.memoizedState, value); + }, + useTransition: function useTransition() { + var isPending = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [isPending, start]; + }, + useMutableSource: updateMutableSource, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + unstable_isNewReconciler: !1 + }, + HooksDispatcherOnRerender = { + readContext: readContext, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: rerenderReducer, + useRef: updateRef, + useState: function useState() { + return rerenderReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function useDeferredValue(value) { + var hook = updateWorkInProgressHook(); + return null === currentHook ? hook.memoizedState = value : updateDeferredValueImpl(hook, currentHook.memoizedState, value); + }, + useTransition: function useTransition() { + var isPending = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [isPending, start]; + }, + useMutableSource: updateMutableSource, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + unstable_isNewReconciler: !1 + }; + function createCapturedValueAtFiber(value, source) { + try { + var info = "", + node = source; + do info += describeFiber(node), node = node.return; while (node); + var JSCompiler_inline_result = info; + } catch (x) { + JSCompiler_inline_result = "\nError generating stack: " + x.message + "\n" + x.stack; + } + return { + value: value, + source: source, + stack: JSCompiler_inline_result, + digest: null + }; + } + function createCapturedValue(value, digest, stack) { + return { + value: value, + source: null, + stack: null != stack ? stack : null, + digest: null != digest ? digest : null + }; + } + if ("function" !== typeof _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").ReactFiberErrorDialog.showErrorDialog) throw Error("Expected ReactFiberErrorDialog.showErrorDialog to be a function."); + function logCapturedError(boundary, errorInfo) { + try { + !1 !== _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/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 () { + return getDerivedStateFromError(error); + }; + lane.callback = function () { + logCapturedError(fiber, errorInfo); + }; + } + var inst = fiber.stateNode; + null !== inst && "function" === typeof inst.componentDidCatch && (lane.callback = function () { + logCapturedError(fiber, errorInfo); + "function" !== typeof getDerivedStateFromError && (null === legacyErrorBoundariesThatAlreadyFailed ? legacyErrorBoundariesThatAlreadyFailed = new Set([this]) : legacyErrorBoundariesThatAlreadyFailed.add(this)); + var stack = errorInfo.stack; + this.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + }); + return lane; + } + function attachPingListener(root, wakeable, lanes) { + var pingCache = root.pingCache; + if (null === pingCache) { + pingCache = root.pingCache = new PossiblyWeakMap(); + var threadIDs = new Set(); + pingCache.set(wakeable, threadIDs); + } else threadIDs = pingCache.get(wakeable), void 0 === threadIDs && (threadIDs = new Set(), pingCache.set(wakeable, threadIDs)); + threadIDs.has(lanes) || (threadIDs.add(lanes), root = pingSuspendedRoot.bind(null, root, wakeable, lanes), wakeable.then(root, root)); + } + 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 &= -2053, current.lanes &= ~renderLanes, bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; + } + function updateMemoComponent(current, workInProgress, Component, nextProps, renderLanes) { + if (null === current) { + var type = Component.type; + if ("function" === typeof type && !shouldConstruct(type) && void 0 === type.defaultProps && null === Component.compare && void 0 === Component.defaultProps) return workInProgress.tag = 15, workInProgress.type = type, updateSimpleMemoComponent(current, workInProgress, type, nextProps, renderLanes); + current = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress, workInProgress.mode, renderLanes); + current.ref = workInProgress.ref; + current.return = workInProgress; + return workInProgress.child = current; + } + type = current.child; + if (0 === (current.lanes & renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return workInProgress.child = current; + } + function updateSimpleMemoComponent(current, workInProgress, Component, nextProps, renderLanes) { + if (null !== current) { + var prevProps = current.memoizedProps; + if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref) if (didReceiveUpdate = !1, workInProgress.pendingProps = nextProps = prevProps, 0 !== (current.lanes & renderLanes)) 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);else return workInProgress.lanes = current.lanes, bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + return updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes); + } + function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + prevState = null !== current ? current.memoizedState : null; + if ("hidden" === nextProps.mode) { + if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = { + baseLanes: 0, + cachePool: null, + transitions: null + }, push(subtreeRenderLanesCursor, subtreeRenderLanes), subtreeRenderLanes |= renderLanes;else { + if (0 === (renderLanes & 1073741824)) return current = null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, workInProgress.lanes = workInProgress.childLanes = 1073741824, workInProgress.memoizedState = { + baseLanes: current, + cachePool: null, + transitions: null + }, workInProgress.updateQueue = null, push(subtreeRenderLanesCursor, subtreeRenderLanes), subtreeRenderLanes |= current, null; + workInProgress.memoizedState = { + baseLanes: 0, + cachePool: null, + transitions: 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 |= 512; + } + 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 &= -2053, 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) resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), 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) || !1) ? (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 |= 1024)) : ("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 |= 1024), 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 |= 1024), 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; + var nextChildren = didCaptureError && "function" !== typeof Component.getDerivedStateFromError ? null : shouldUpdate.render(); + workInProgress.flags |= 1; + null !== current && didCaptureError ? (workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderLanes), workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, 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, + treeContext: null, + retryLane: 0 + }; + function mountSuspenseOffscreenState(renderLanes) { + return { + baseLanes: renderLanes, + cachePool: null, + transitions: null + }; + } + function updateSuspenseComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + suspenseContext = suspenseStackCursor.current, + showFallback = !1, + didSuspend = 0 !== (workInProgress.flags & 128), + JSCompiler_temp; + (JSCompiler_temp = didSuspend) || (JSCompiler_temp = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseContext & 2)); + if (JSCompiler_temp) showFallback = !0, workInProgress.flags &= -129;else if (null === current || null !== current.memoizedState) suspenseContext |= 1; + push(suspenseStackCursor, suspenseContext & 1); + if (null === current) { + current = workInProgress.memoizedState; + if (null !== current && null !== current.dehydrated) return 0 === (workInProgress.mode & 1) ? workInProgress.lanes = 1 : shim$1() ? workInProgress.lanes = 8 : workInProgress.lanes = 1073741824, null; + didSuspend = nextProps.children; + current = nextProps.fallback; + return showFallback ? (nextProps = workInProgress.mode, showFallback = workInProgress.child, didSuspend = { + mode: "hidden", + children: didSuspend + }, 0 === (nextProps & 1) && null !== showFallback ? (showFallback.childLanes = 0, showFallback.pendingProps = didSuspend) : showFallback = createFiberFromOffscreen(didSuspend, nextProps, 0, null), current = createFiberFromFragment(current, nextProps, renderLanes, null), showFallback.return = workInProgress, current.return = workInProgress, showFallback.sibling = current, workInProgress.child = showFallback, workInProgress.child.memoizedState = mountSuspenseOffscreenState(renderLanes), workInProgress.memoizedState = SUSPENDED_MARKER, current) : mountSuspensePrimaryChildren(workInProgress, didSuspend); + } + suspenseContext = current.memoizedState; + if (null !== suspenseContext && (JSCompiler_temp = suspenseContext.dehydrated, null !== JSCompiler_temp)) return updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, JSCompiler_temp, suspenseContext, renderLanes); + if (showFallback) { + showFallback = nextProps.fallback; + didSuspend = workInProgress.mode; + suspenseContext = current.child; + JSCompiler_temp = suspenseContext.sibling; + var primaryChildProps = { + mode: "hidden", + children: nextProps.children + }; + 0 === (didSuspend & 1) && workInProgress.child !== suspenseContext ? (nextProps = workInProgress.child, nextProps.childLanes = 0, nextProps.pendingProps = primaryChildProps, workInProgress.deletions = null) : (nextProps = createWorkInProgress(suspenseContext, primaryChildProps), nextProps.subtreeFlags = suspenseContext.subtreeFlags & 14680064); + null !== JSCompiler_temp ? showFallback = createWorkInProgress(JSCompiler_temp, showFallback) : (showFallback = createFiberFromFragment(showFallback, didSuspend, renderLanes, null), showFallback.flags |= 2); + showFallback.return = workInProgress; + nextProps.return = workInProgress; + nextProps.sibling = showFallback; + workInProgress.child = nextProps; + nextProps = showFallback; + showFallback = workInProgress.child; + didSuspend = current.child.memoizedState; + didSuspend = null === didSuspend ? mountSuspenseOffscreenState(renderLanes) : { + baseLanes: didSuspend.baseLanes | renderLanes, + cachePool: null, + transitions: didSuspend.transitions + }; + showFallback.memoizedState = didSuspend; + showFallback.childLanes = current.childLanes & ~renderLanes; + workInProgress.memoizedState = SUSPENDED_MARKER; + return nextProps; + } + showFallback = current.child; + current = showFallback.sibling; + nextProps = createWorkInProgress(showFallback, { + mode: "visible", + children: nextProps.children + }); + 0 === (workInProgress.mode & 1) && (nextProps.lanes = renderLanes); + nextProps.return = workInProgress; + nextProps.sibling = null; + null !== current && (renderLanes = workInProgress.deletions, null === renderLanes ? (workInProgress.deletions = [current], workInProgress.flags |= 16) : renderLanes.push(current)); + workInProgress.child = nextProps; + workInProgress.memoizedState = null; + return nextProps; + } + function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = createFiberFromOffscreen({ + mode: "visible", + children: primaryChildren + }, workInProgress.mode, 0, null); + primaryChildren.return = workInProgress; + return workInProgress.child = primaryChildren; + } + function retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, recoverableError) { + null !== recoverableError && (null === hydrationErrors ? hydrationErrors = [recoverableError] : hydrationErrors.push(recoverableError)); + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren(workInProgress, workInProgress.pendingProps.children); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; + } + function updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, suspenseInstance, suspenseState, renderLanes) { + if (didSuspend) { + if (workInProgress.flags & 256) return workInProgress.flags &= -257, suspenseState = createCapturedValue(Error("There was an error while hydrating this Suspense boundary. Switched to client rendering.")), retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, suspenseState); + if (null !== workInProgress.memoizedState) return workInProgress.child = current.child, workInProgress.flags |= 128, null; + suspenseState = nextProps.fallback; + didSuspend = workInProgress.mode; + nextProps = createFiberFromOffscreen({ + mode: "visible", + children: nextProps.children + }, didSuspend, 0, null); + suspenseState = createFiberFromFragment(suspenseState, didSuspend, renderLanes, null); + suspenseState.flags |= 2; + nextProps.return = workInProgress; + suspenseState.return = workInProgress; + nextProps.sibling = suspenseState; + workInProgress.child = nextProps; + 0 !== (workInProgress.mode & 1) && reconcileChildFibers(workInProgress, current.child, null, renderLanes); + workInProgress.child.memoizedState = mountSuspenseOffscreenState(renderLanes); + workInProgress.memoizedState = SUSPENDED_MARKER; + return suspenseState; + } + if (0 === (workInProgress.mode & 1)) return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, null); + if (shim$1()) return suspenseState = shim$1().digest, suspenseState = createCapturedValue(Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."), suspenseState, void 0), retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, suspenseState); + didSuspend = 0 !== (renderLanes & current.childLanes); + if (didReceiveUpdate || didSuspend) { + nextProps = workInProgressRoot; + if (null !== nextProps) { + switch (renderLanes & -renderLanes) { + case 4: + didSuspend = 2; + break; + case 16: + didSuspend = 8; + break; + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + didSuspend = 32; + break; + case 536870912: + didSuspend = 268435456; + break; + default: + didSuspend = 0; + } + didSuspend = 0 !== (didSuspend & (nextProps.suspendedLanes | renderLanes)) ? 0 : didSuspend; + 0 !== didSuspend && didSuspend !== suspenseState.retryLane && (suspenseState.retryLane = didSuspend, markUpdateLaneFromFiberToRoot(current, didSuspend), scheduleUpdateOnFiber(nextProps, current, didSuspend, -1)); + } + renderDidSuspendDelayIfPossible(); + suspenseState = createCapturedValue(Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition.")); + return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, suspenseState); + } + if (shim$1()) return workInProgress.flags |= 128, workInProgress.child = current.child, retryDehydratedSuspenseBoundary.bind(null, current), shim$1(), null; + current = mountSuspensePrimaryChildren(workInProgress, nextProps.children); + current.flags |= 4096; + return current; + } + function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); + } + function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode) { + var renderState = workInProgress.memoizedState; + null === renderState ? workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + } : (renderState.isBackwards = isBackwards, renderState.rendering = null, renderState.renderingStartTime = 0, renderState.last = lastContentRow, renderState.tail = tail, renderState.tailMode = tailMode); + } + function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + reconcileChildren(current, workInProgress, nextProps.children, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & 2)) nextProps = nextProps & 1 | 2, workInProgress.flags |= 128;else { + if (null !== current && 0 !== (current.flags & 128)) a: for (current = workInProgress.child; null !== current;) { + if (13 === current.tag) null !== current.memoizedState && scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);else if (19 === current.tag) scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling;) { + if (null === current.return || current.return === workInProgress) break a; + current = current.return; + } + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= 1; + } + push(suspenseStackCursor, nextProps); + 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 resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { + 0 === (workInProgress.mode & 1) && null !== current && (current.alternate = null, workInProgress.alternate = null, workInProgress.flags |= 2); + } + function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { + null !== current && (workInProgress.dependencies = current.dependencies); + 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; + } + function attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes) { + 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: + var context = workInProgress.type._context, + nextValue = workInProgress.memoizedProps.value; + push(valueCursor, context._currentValue2); + context._currentValue2 = nextValue; + break; + case 13: + context = workInProgress.memoizedState; + if (null !== context) { + if (null !== context.dehydrated) return push(suspenseStackCursor, suspenseStackCursor.current & 1), workInProgress.flags |= 128, null; + if (0 !== (renderLanes & workInProgress.child.childLanes)) return updateSuspenseComponent(current, workInProgress, renderLanes); + push(suspenseStackCursor, suspenseStackCursor.current & 1); + current = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + return null !== current ? current.sibling : null; + } + push(suspenseStackCursor, suspenseStackCursor.current & 1); + break; + case 19: + context = 0 !== (renderLanes & workInProgress.childLanes); + if (0 !== (current.flags & 128)) { + if (context) 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 (context) break;else return null; + case 22: + case 23: + return workInProgress.lanes = 0, updateOffscreenComponent(current, workInProgress, renderLanes); + } + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + function hadNoMutationsEffects(current, completedWork) { + if (null !== current && current.child === completedWork.child) return !0; + if (0 !== (completedWork.flags & 16)) return !1; + for (current = completedWork.child; null !== current;) { + if (0 !== (current.flags & 12854) || 0 !== (current.subtreeFlags & 12854)) return !1; + current = current.sibling; + } + return !0; + } + var _appendAllChildren, updateHostContainer, updateHostComponent$1, updateHostText$1; + _appendAllChildren = function appendAllChildren(parent, workInProgress, needsVisibilityToggle, isHidden) { + for (var node = workInProgress.child; null !== node;) { + if (5 === node.tag) { + var instance = node.stateNode; + needsVisibilityToggle && isHidden && (instance = cloneHiddenInstance(instance)); + appendChildNode(parent.node, instance.node); + } else if (6 === node.tag) { + instance = node.stateNode; + if (needsVisibilityToggle && isHidden) throw Error("Not yet implemented."); + appendChildNode(parent.node, instance.node); + } else if (4 !== node.tag) if (22 === node.tag && null !== node.memoizedState) instance = node.child, null !== instance && (instance.return = node), _appendAllChildren(parent, node, !0, !0);else if (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; + } + }; + function appendAllChildrenToContainer(containerChildSet, workInProgress, needsVisibilityToggle, isHidden) { + for (var node = workInProgress.child; null !== node;) { + if (5 === node.tag) { + var instance = node.stateNode; + needsVisibilityToggle && isHidden && (instance = cloneHiddenInstance(instance)); + appendChildNodeToSet(containerChildSet, instance.node); + } else if (6 === node.tag) { + instance = node.stateNode; + if (needsVisibilityToggle && isHidden) throw Error("Not yet implemented."); + appendChildNodeToSet(containerChildSet, instance.node); + } else if (4 !== node.tag) if (22 === node.tag && null !== node.memoizedState) instance = node.child, null !== instance && (instance.return = node), appendAllChildrenToContainer(containerChildSet, node, !0, !0);else if (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 updateHostContainer(current, workInProgress) { + var portalOrRoot = workInProgress.stateNode; + if (!hadNoMutationsEffects(current, workInProgress)) { + current = portalOrRoot.containerInfo; + var newChildSet = createChildNodeSet(current); + appendAllChildrenToContainer(newChildSet, workInProgress, !1, !1); + portalOrRoot.pendingChildren = newChildSet; + workInProgress.flags |= 4; + completeRoot(current, newChildSet); + } + }; + updateHostComponent$1 = function updateHostComponent$1(current, workInProgress, type, newProps) { + type = current.stateNode; + var oldProps = current.memoizedProps; + if ((current = hadNoMutationsEffects(current, workInProgress)) && oldProps === newProps) workInProgress.stateNode = type;else { + var recyclableInstance = workInProgress.stateNode; + requiredContext(contextStackCursor$1.current); + var updatePayload = null; + oldProps !== newProps && (oldProps = diffProperties(null, oldProps, newProps, recyclableInstance.canonical.viewConfig.validAttributes), recyclableInstance.canonical.currentProps = newProps, updatePayload = oldProps); + current && null === updatePayload ? workInProgress.stateNode = type : (newProps = updatePayload, oldProps = type.node, type = { + node: current ? null !== newProps ? cloneNodeWithNewProps(oldProps, newProps) : cloneNode(oldProps) : null !== newProps ? cloneNodeWithNewChildrenAndProps(oldProps, newProps) : cloneNodeWithNewChildren(oldProps), + canonical: type.canonical + }, workInProgress.stateNode = type, current ? workInProgress.flags |= 4 : _appendAllChildren(type, workInProgress, !1, !1)); + } + }; + updateHostText$1 = function updateHostText$1(current, workInProgress, oldText, newText) { + oldText !== newText ? (current = requiredContext(rootInstanceStackCursor.current), oldText = requiredContext(contextStackCursor$1.current), workInProgress.stateNode = createTextInstance(newText, current, oldText, workInProgress), workInProgress.flags |= 4) : workInProgress.stateNode = current.stateNode; + }; + 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$62 = null; null !== lastTailNode;) null !== lastTailNode.alternate && (lastTailNode$62 = lastTailNode), lastTailNode = lastTailNode.sibling; + null === lastTailNode$62 ? hasRenderedATailFallback || null === renderState.tail ? renderState.tail = null : renderState.tail.sibling = null : lastTailNode$62.sibling = null; + } + } + function bubbleProperties(completedWork) { + var didBailout = null !== completedWork.alternate && completedWork.alternate.child === completedWork.child, + newChildLanes = 0, + subtreeFlags = 0; + if (didBailout) for (var child$63 = completedWork.child; null !== child$63;) newChildLanes |= child$63.lanes | child$63.childLanes, subtreeFlags |= child$63.subtreeFlags & 14680064, subtreeFlags |= child$63.flags & 14680064, child$63.return = completedWork, child$63 = child$63.sibling;else for (child$63 = completedWork.child; null !== child$63;) newChildLanes |= child$63.lanes | child$63.childLanes, subtreeFlags |= child$63.subtreeFlags, subtreeFlags |= child$63.flags, child$63.return = completedWork, child$63 = child$63.sibling; + completedWork.subtreeFlags |= subtreeFlags; + completedWork.childLanes = newChildLanes; + return didBailout; + } + function completeWork(current, workInProgress, renderLanes) { + var newProps = workInProgress.pendingProps; + popTreeContext(workInProgress); + 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 renderLanes = workInProgress.stateNode, popHostContainer(), pop(didPerformWorkStackCursor), pop(contextStackCursor), resetWorkInProgressVersions(), renderLanes.pendingContext && (renderLanes.context = renderLanes.pendingContext, renderLanes.pendingContext = null), null !== current && null !== current.child || null === current || current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256) || (workInProgress.flags |= 1024, null !== hydrationErrors && (queueRecoverableErrors(hydrationErrors), hydrationErrors = null)), 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 |= 512);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 = nextReactTag; + nextReactTag += 2; + type = getViewConfigForType(type); + var updatePayload = diffProperties(null, emptyObject, newProps, type.validAttributes); + renderLanes = createNode(current, type.uiViewClassName, renderLanes, updatePayload, workInProgress); + current = new ReactFabricHostComponent(current, type, newProps, workInProgress); + current = { + node: renderLanes, + canonical: current + }; + _appendAllChildren(current, workInProgress, !1, !1); + workInProgress.stateNode = current; + null !== workInProgress.ref && (workInProgress.flags |= 512); + } + 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); + renderLanes = requiredContext(contextStackCursor$1.current); + workInProgress.stateNode = createTextInstance(newProps, current, renderLanes, workInProgress); + } + bubbleProperties(workInProgress); + return null; + case 13: + pop(suspenseStackCursor); + newProps = workInProgress.memoizedState; + if (null === current || null !== current.memoizedState && null !== current.memoizedState.dehydrated) { + if (null !== newProps && null !== newProps.dehydrated) { + if (null === current) { + throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React."); + throw Error("Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue."); + } + 0 === (workInProgress.flags & 128) && (workInProgress.memoizedState = null); + workInProgress.flags |= 4; + bubbleProperties(workInProgress); + type = !1; + } else null !== hydrationErrors && (queueRecoverableErrors(hydrationErrors), hydrationErrors = null), type = !0; + if (!type) return workInProgress.flags & 65536 ? workInProgress : null; + } + if (0 !== (workInProgress.flags & 128)) return workInProgress.lanes = renderLanes, workInProgress; + renderLanes = null !== newProps; + renderLanes !== (null !== current && null !== current.memoizedState) && renderLanes && (workInProgress.child.flags |= 8192, 0 !== (workInProgress.mode & 1) && (null === current || 0 !== (suspenseStackCursor.current & 1) ? 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 3) : renderDidSuspendDelayIfPossible())); + null !== workInProgress.updateQueue && (workInProgress.flags |= 4); + bubbleProperties(workInProgress); + 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 (renderLanes = workInProgress.child; null !== renderLanes;) newProps = renderLanes, type = current, newProps.flags &= 14680066, updatePayload = newProps.alternate, null === updatePayload ? (newProps.childLanes = 0, newProps.lanes = type, newProps.child = null, newProps.subtreeFlags = 0, newProps.memoizedProps = null, newProps.memoizedState = null, newProps.updateQueue = null, newProps.dependencies = null, newProps.stateNode = null) : (newProps.childLanes = updatePayload.childLanes, newProps.lanes = updatePayload.lanes, newProps.child = updatePayload.child, newProps.subtreeFlags = 0, newProps.deletions = null, newProps.memoizedProps = updatePayload.memoizedProps, newProps.memoizedState = updatePayload.memoizedState, newProps.updateQueue = updatePayload.updateQueue, newProps.type = updatePayload.type, type = updatePayload.dependencies, newProps.dependencies = null === type ? null : { + lanes: type.lanes, + firstContext: type.firstContext + }), renderLanes = renderLanes.sibling; + push(suspenseStackCursor, suspenseStackCursor.current & 1 | 2); + return workInProgress.child; + } + current = current.sibling; + } + null !== type.tail && _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now() > workInProgressRootRenderTargetTime && (workInProgress.flags |= 128, newProps = !0, cutOffTailIfNeeded(type, !1), workInProgress.lanes = 4194304); + } + } 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 * _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now() - type.renderingStartTime > workInProgressRootRenderTargetTime && 1073741824 !== renderLanes && (workInProgress.flags |= 128, newProps = !0, cutOffTailIfNeeded(type, !1), workInProgress.lanes = 4194304); + 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 = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_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 && (workInProgress.flags |= 8192), renderLanes && 0 !== (workInProgress.mode & 1) ? 0 !== (subtreeRenderLanes & 1073741824) && bubbleProperties(workInProgress) : bubbleProperties(workInProgress), null; + case 24: + return null; + case 25: + return 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(current, workInProgress) { + popTreeContext(workInProgress); + switch (workInProgress.tag) { + case 1: + return isContextProvider(workInProgress.type) && popContext(), current = workInProgress.flags, current & 65536 ? (workInProgress.flags = current & -65537 | 128, workInProgress) : null; + case 3: + return popHostContainer(), pop(didPerformWorkStackCursor), pop(contextStackCursor), resetWorkInProgressVersions(), current = workInProgress.flags, 0 !== (current & 65536) && 0 === (current & 128) ? (workInProgress.flags = current & -65537 | 128, workInProgress) : null; + case 5: + return popHostContext(workInProgress), null; + case 13: + pop(suspenseStackCursor); + current = workInProgress.memoizedState; + if (null !== current && null !== current.dehydrated && null === workInProgress.alternate) throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue."); + current = workInProgress.flags; + return current & 65536 ? (workInProgress.flags = current & -65537 | 128, 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; + } + } + 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 (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } else ref.current = null; + } + function safelyCallDestroy(current, nearestMountedAncestor, destroy) { + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + var shouldFireAfterActiveInstanceBlur = !1; + function commitBeforeMutationEffects(root, firstChild) { + for (nextEffect = firstChild; null !== nextEffect;) if (root = nextEffect, firstChild = root.child, 0 !== (root.subtreeFlags & 1028) && null !== firstChild) firstChild.return = root, nextEffect = firstChild;else for (; null !== nextEffect;) { + root = nextEffect; + try { + var current = root.alternate; + if (0 !== (root.flags & 1024)) 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; + return current; + } + function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) { + 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; + void 0 !== destroy && safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy); + } + effect = effect.next; + } while (effect !== updateQueue); + } + } + function commitHookEffectListMount(flags, finishedWork) { + finishedWork = finishedWork.updateQueue; + finishedWork = null !== finishedWork ? finishedWork.lastEffect : null; + if (null !== finishedWork) { + var effect = finishedWork = finishedWork.next; + do { + if ((effect.tag & flags) === flags) { + var create$75 = effect.create; + effect.destroy = create$75(); + } + effect = effect.next; + } while (effect !== finishedWork); + } + } + function detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + null !== alternate && (fiber.alternate = null, detachFiberAfterEffects(alternate)); + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; + fiber.stateNode = null; + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; + fiber.updateQueue = null; + } + function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) { + for (parent = parent.child; null !== parent;) commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent), parent = parent.sibling; + } + function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) { + if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount) try { + injectedHook.onCommitFiberUnmount(rendererID, deletedFiber); + } catch (err) {} + switch (deletedFiber.tag) { + case 5: + safelyDetachRef(deletedFiber, nearestMountedAncestor); + case 6: + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + break; + case 18: + break; + case 4: + createChildNodeSet(deletedFiber.stateNode.containerInfo); + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + break; + case 0: + case 11: + case 14: + case 15: + var updateQueue = deletedFiber.updateQueue; + if (null !== updateQueue && (updateQueue = updateQueue.lastEffect, null !== updateQueue)) { + var effect = updateQueue = updateQueue.next; + do { + var _effect = effect, + destroy = _effect.destroy; + _effect = _effect.tag; + void 0 !== destroy && (0 !== (_effect & 2) ? safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy) : 0 !== (_effect & 4) && safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy)); + effect = effect.next; + } while (effect !== updateQueue); + } + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + break; + case 1: + safelyDetachRef(deletedFiber, nearestMountedAncestor); + updateQueue = deletedFiber.stateNode; + if ("function" === typeof updateQueue.componentWillUnmount) try { + updateQueue.props = deletedFiber.memoizedProps, updateQueue.state = deletedFiber.memoizedState, updateQueue.componentWillUnmount(); + } catch (error) { + captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); + } + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + break; + case 21: + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + break; + case 22: + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + break; + default: + recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); + } + } + 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) || (retryCache.add(wakeable), wakeable.then(retry, retry)); + }); + } + } + function recursivelyTraverseMutationEffects(root, parentFiber) { + var deletions = parentFiber.deletions; + if (null !== deletions) for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i]; + try { + commitDeletionEffectsOnFiber(root, parentFiber, childToDelete); + var alternate = childToDelete.alternate; + null !== alternate && (alternate.return = null); + childToDelete.return = null; + } catch (error) { + captureCommitPhaseError(childToDelete, parentFiber, error); + } + } + if (parentFiber.subtreeFlags & 12854) for (parentFiber = parentFiber.child; null !== parentFiber;) commitMutationEffectsOnFiber(parentFiber, root), parentFiber = parentFiber.sibling; + } + function commitMutationEffectsOnFiber(finishedWork, root) { + var current = finishedWork.alternate, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 14: + case 15: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + if (flags & 4) { + try { + commitHookEffectListUnmount(3, finishedWork, finishedWork.return), commitHookEffectListMount(3, finishedWork); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + try { + commitHookEffectListUnmount(5, finishedWork, finishedWork.return); + } catch (error$79) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$79); + } + } + break; + case 1: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 512 && null !== current && safelyDetachRef(current, current.return); + break; + case 5: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 512 && null !== current && safelyDetachRef(current, current.return); + break; + case 6: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + break; + case 3: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + break; + case 4: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + break; + case 13: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + root = finishedWork.child; + root.flags & 8192 && (current = null !== root.memoizedState, root.stateNode.isHidden = current, !current || null !== root.alternate && null !== root.alternate.memoizedState || (globalMostRecentFallbackTime = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now())); + flags & 4 && attachSuspenseRetryListeners(finishedWork); + break; + case 22: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 8192 && (finishedWork.stateNode.isHidden = null !== finishedWork.memoizedState); + break; + case 19: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 4 && attachSuspenseRetryListeners(finishedWork); + break; + case 21: + break; + default: + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); + } + } + function commitReconciliationEffects(finishedWork) { + var flags = finishedWork.flags; + flags & 2 && (finishedWork.flags &= -3); + flags & 4096 && (finishedWork.flags &= -4097); + } + function commitLayoutEffects(finishedWork) { + for (nextEffect = finishedWork; null !== nextEffect;) { + var fiber = nextEffect, + firstChild = fiber.child; + if (0 !== (fiber.subtreeFlags & 8772) && null !== firstChild) firstChild.return = fiber, nextEffect = firstChild;else for (fiber = finishedWork; null !== nextEffect;) { + firstChild = nextEffect; + if (0 !== (firstChild.flags & 8772)) { + var current = firstChild.alternate; + try { + if (0 !== (firstChild.flags & 8772)) switch (firstChild.tag) { + case 0: + case 11: + case 15: + commitHookEffectListMount(5, firstChild); + break; + case 1: + var instance = firstChild.stateNode; + if (firstChild.flags & 4) if (null === current) instance.componentDidMount();else { + var prevProps = firstChild.elementType === firstChild.type ? current.memoizedProps : resolveDefaultProps(firstChild.type, current.memoizedProps); + instance.componentDidUpdate(prevProps, current.memoizedState, instance.__reactInternalSnapshotBeforeUpdate); + } + var updateQueue = firstChild.updateQueue; + null !== updateQueue && commitUpdateQueue(firstChild, updateQueue, instance); + break; + case 3: + var updateQueue$76 = firstChild.updateQueue; + if (null !== updateQueue$76) { + current = null; + if (null !== firstChild.child) switch (firstChild.child.tag) { + case 5: + current = firstChild.child.stateNode.canonical; + break; + case 1: + current = firstChild.child.stateNode; + } + commitUpdateQueue(firstChild, updateQueue$76, current); + } + break; + case 5: + if (null === current && firstChild.flags & 4) throw Error("The current renderer does not support mutation. This error is likely caused by a bug in React. Please file an issue."); + break; + case 6: + break; + case 4: + break; + case 12: + break; + case 13: + break; + case 19: + case 17: + case 21: + case 22: + case 23: + case 25: + 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 (firstChild.flags & 512) { + current = void 0; + var ref = firstChild.ref; + if (null !== ref) { + var instance$jscomp$0 = firstChild.stateNode; + switch (firstChild.tag) { + case 5: + current = instance$jscomp$0.canonical; + break; + default: + current = instance$jscomp$0; + } + "function" === typeof ref ? ref(current) : ref.current = current; + } + } + } catch (error) { + captureCommitPhaseError(firstChild, firstChild.return, error); + } + } + if (firstChild === fiber) { + nextEffect = null; + break; + } + current = firstChild.sibling; + if (null !== current) { + current.return = firstChild.return; + nextEffect = current; + break; + } + nextEffect = firstChild.return; + } + } + } + var ceil = Math.ceil, + ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, + ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, + ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig, + executionContext = 0, + workInProgressRoot = null, + workInProgress = null, + workInProgressRootRenderLanes = 0, + subtreeRenderLanes = 0, + subtreeRenderLanesCursor = createCursor(0), + workInProgressRootExitStatus = 0, + workInProgressRootFatalError = null, + workInProgressRootSkippedLanes = 0, + workInProgressRootInterleavedUpdatedLanes = 0, + workInProgressRootPingedLanes = 0, + workInProgressRootConcurrentErrors = null, + workInProgressRootRecoverableErrors = null, + globalMostRecentFallbackTime = 0, + workInProgressRootRenderTargetTime = Infinity, + workInProgressTransitions = null, + hasUncaughtError = !1, + firstUncaughtError = null, + legacyErrorBoundariesThatAlreadyFailed = null, + rootDoesHavePassiveEffects = !1, + rootWithPendingPassiveEffects = null, + pendingPassiveEffectsLanes = 0, + nestedUpdateCount = 0, + rootWithNestedUpdates = null, + currentEventTime = -1, + currentEventTransitionLane = 0; + function requestEventTime() { + return 0 !== (executionContext & 6) ? _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now() : -1 !== currentEventTime ? currentEventTime : currentEventTime = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now(); + } + function requestUpdateLane(fiber) { + if (0 === (fiber.mode & 1)) return 1; + if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes) return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; + if (null !== ReactCurrentBatchConfig.transition) return 0 === currentEventTransitionLane && (currentEventTransitionLane = claimNextTransitionLane()), currentEventTransitionLane; + fiber = currentUpdatePriority; + if (0 === fiber) a: { + fiber = fabricGetCurrentEventPriority ? fabricGetCurrentEventPriority() : null; + if (null != fiber) switch (fiber) { + case FabricDiscretePriority: + fiber = 1; + break a; + } + fiber = 16; + } + return fiber; + } + function scheduleUpdateOnFiber(root, 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."); + markRootUpdated(root, lane, eventTime); + if (0 === (executionContext & 2) || root !== workInProgressRoot) root === workInProgressRoot && (0 === (executionContext & 2) && (workInProgressRootInterleavedUpdatedLanes |= lane), 4 === workInProgressRootExitStatus && markRootSuspended$1(root, workInProgressRootRenderLanes)), ensureRootIsScheduled(root, eventTime), 1 === lane && 0 === executionContext && 0 === (fiber.mode & 1) && (workInProgressRootRenderTargetTime = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now() + 500, includesLegacySyncCallbacks && flushSyncCallbacks()); + } + 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$5 = 31 - clz32(lanes), + lane = 1 << index$5, + expirationTime = expirationTimes[index$5]; + if (-1 === expirationTime) { + if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) expirationTimes[index$5] = computeExpirationTime(lane, currentTime); + } else expirationTime <= currentTime && (root.expiredLanes |= lane); + lanes &= ~lane; + } + suspendedLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : 0); + if (0 === suspendedLanes) null !== existingCallbackNode && _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_cancelCallback(existingCallbackNode), root.callbackNode = null, root.callbackPriority = 0;else if (currentTime = suspendedLanes & -suspendedLanes, root.callbackPriority !== currentTime) { + null != existingCallbackNode && _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_cancelCallback(existingCallbackNode); + if (1 === currentTime) 0 === root.tag ? (existingCallbackNode = performSyncWorkOnRoot.bind(null, root), includesLegacySyncCallbacks = !0, null === syncQueue ? syncQueue = [existingCallbackNode] : syncQueue.push(existingCallbackNode)) : (existingCallbackNode = performSyncWorkOnRoot.bind(null, root), null === syncQueue ? syncQueue = [existingCallbackNode] : syncQueue.push(existingCallbackNode)), _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_scheduleCallback(_$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_ImmediatePriority, flushSyncCallbacks), existingCallbackNode = null;else { + switch (lanesToEventPriority(suspendedLanes)) { + case 1: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_ImmediatePriority; + break; + case 4: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_UserBlockingPriority; + break; + case 16: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_NormalPriority; + break; + case 536870912: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_IdlePriority; + break; + default: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_NormalPriority; + } + existingCallbackNode = scheduleCallback$1(existingCallbackNode, performConcurrentWorkOnRoot.bind(null, root)); + } + root.callbackPriority = currentTime; + root.callbackNode = existingCallbackNode; + } + } + function performConcurrentWorkOnRoot(root, didTimeout) { + currentEventTime = -1; + currentEventTransitionLane = 0; + if (0 !== (executionContext & 6)) 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 (0 !== (lanes & 30) || 0 !== (lanes & root.expiredLanes) || didTimeout) didTimeout = renderRootSync(root, lanes);else { + didTimeout = lanes; + var prevExecutionContext = executionContext; + executionContext |= 2; + var prevDispatcher = pushDispatcher(); + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== didTimeout) workInProgressTransitions = null, workInProgressRootRenderTargetTime = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now() + 500, prepareFreshStack(root, didTimeout); + do try { + workLoopConcurrent(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } while (1); + resetContextDependencies(); + ReactCurrentDispatcher$2.current = prevDispatcher; + executionContext = prevExecutionContext; + null !== workInProgress ? didTimeout = 0 : (workInProgressRoot = null, workInProgressRootRenderLanes = 0, didTimeout = workInProgressRootExitStatus); + } + if (0 !== didTimeout) { + 2 === didTimeout && (prevExecutionContext = getLanesToRetrySynchronouslyOnError(root), 0 !== prevExecutionContext && (lanes = prevExecutionContext, didTimeout = recoverFromConcurrentError(root, prevExecutionContext))); + if (1 === didTimeout) throw originalCallbackNode = workInProgressRootFatalError, prepareFreshStack(root, 0), markRootSuspended$1(root, lanes), ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now()), originalCallbackNode; + if (6 === didTimeout) markRootSuspended$1(root, lanes);else { + prevExecutionContext = root.current.alternate; + if (0 === (lanes & 30) && !isRenderConsistentWithExternalStores(prevExecutionContext) && (didTimeout = renderRootSync(root, lanes), 2 === didTimeout && (prevDispatcher = getLanesToRetrySynchronouslyOnError(root), 0 !== prevDispatcher && (lanes = prevDispatcher, didTimeout = recoverFromConcurrentError(root, prevDispatcher))), 1 === didTimeout)) throw originalCallbackNode = workInProgressRootFatalError, prepareFreshStack(root, 0), markRootSuspended$1(root, lanes), ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now()), originalCallbackNode; + root.finishedWork = prevExecutionContext; + 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, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + case 3: + markRootSuspended$1(root, lanes); + if ((lanes & 130023424) === lanes && (didTimeout = globalMostRecentFallbackTime + 500 - _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now(), 10 < didTimeout)) { + if (0 !== getNextLanes(root, 0)) break; + prevExecutionContext = root.suspendedLanes; + if ((prevExecutionContext & lanes) !== lanes) { + requestEventTime(); + root.pingedLanes |= root.suspendedLanes & prevExecutionContext; + break; + } + root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root, workInProgressRootRecoverableErrors, workInProgressTransitions), didTimeout); + break; + } + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + case 4: + markRootSuspended$1(root, lanes); + if ((lanes & 4194240) === lanes) break; + didTimeout = root.eventTimes; + for (prevExecutionContext = -1; 0 < lanes;) { + var index$4 = 31 - clz32(lanes); + prevDispatcher = 1 << index$4; + index$4 = didTimeout[index$4]; + index$4 > prevExecutionContext && (prevExecutionContext = index$4); + lanes &= ~prevDispatcher; + } + lanes = prevExecutionContext; + lanes = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_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, workInProgressRootRecoverableErrors, workInProgressTransitions), lanes); + break; + } + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + case 5: + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + break; + default: + throw Error("Unknown root exit status."); + } + } + } + ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now()); + return root.callbackNode === originalCallbackNode ? performConcurrentWorkOnRoot.bind(null, root) : null; + } + function recoverFromConcurrentError(root, errorRetryLanes) { + var errorsFromFirstAttempt = workInProgressRootConcurrentErrors; + root.current.memoizedState.isDehydrated && (prepareFreshStack(root, errorRetryLanes).flags |= 256); + root = renderRootSync(root, errorRetryLanes); + 2 !== root && (errorRetryLanes = workInProgressRootRecoverableErrors, workInProgressRootRecoverableErrors = errorsFromFirstAttempt, null !== errorRetryLanes && queueRecoverableErrors(errorRetryLanes)); + return root; + } + function queueRecoverableErrors(errors) { + null === workInProgressRootRecoverableErrors ? workInProgressRootRecoverableErrors = errors : workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, errors); + } + function isRenderConsistentWithExternalStores(finishedWork) { + for (var node = finishedWork;;) { + if (node.flags & 16384) { + var updateQueue = node.updateQueue; + if (null !== updateQueue && (updateQueue = updateQueue.stores, null !== updateQueue)) for (var i = 0; i < updateQueue.length; i++) { + var check = updateQueue[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; + } + } + } + updateQueue = node.child; + if (node.subtreeFlags & 16384 && null !== updateQueue) updateQueue.return = node, node = updateQueue;else { + if (node === finishedWork) break; + for (; null === node.sibling;) { + if (null === node.return || node.return === finishedWork) return !0; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + } + return !0; + } + function markRootSuspended$1(root, suspendedLanes) { + suspendedLanes &= ~workInProgressRootPingedLanes; + suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; + root.suspendedLanes |= suspendedLanes; + root.pingedLanes &= ~suspendedLanes; + for (root = root.expirationTimes; 0 < suspendedLanes;) { + var index$6 = 31 - clz32(suspendedLanes), + lane = 1 << index$6; + root[index$6] = -1; + suspendedLanes &= ~lane; + } + } + function performSyncWorkOnRoot(root) { + if (0 !== (executionContext & 6)) throw Error("Should not already be working."); + flushPassiveEffects(); + var lanes = getNextLanes(root, 0); + if (0 === (lanes & 1)) return ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now()), null; + var exitStatus = renderRootSync(root, lanes); + if (0 !== root.tag && 2 === exitStatus) { + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); + 0 !== errorRetryLanes && (lanes = errorRetryLanes, exitStatus = recoverFromConcurrentError(root, errorRetryLanes)); + } + if (1 === exitStatus) throw exitStatus = workInProgressRootFatalError, prepareFreshStack(root, 0), markRootSuspended$1(root, lanes), ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now()), exitStatus; + if (6 === exitStatus) throw Error("Root did not complete. This is a bug in React."); + root.finishedWork = root.current.alternate; + root.finishedLanes = lanes; + commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); + ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_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; + popTreeContext(interruptedWork); + 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 = root = createWorkInProgress(root.current, null); + workInProgressRootRenderLanes = subtreeRenderLanes = lanes; + workInProgressRootExitStatus = 0; + workInProgressRootFatalError = null; + workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = 0; + workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; + if (null !== concurrentQueues) { + for (lanes = 0; lanes < concurrentQueues.length; lanes++) if (timeoutHandle = concurrentQueues[lanes], interruptedWork = timeoutHandle.interleaved, null !== interruptedWork) { + timeoutHandle.interleaved = null; + var firstInterleavedUpdate = interruptedWork.next, + lastPendingUpdate = timeoutHandle.pending; + if (null !== lastPendingUpdate) { + var firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = firstInterleavedUpdate; + interruptedWork.next = firstPendingUpdate; + } + timeoutHandle.pending = interruptedWork; + } + concurrentQueues = null; + } + return root; + } + 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; + } + a: { + var root = root$jscomp$0, + returnFiber = erroredWork.return, + sourceFiber = erroredWork, + value = thrownValue; + thrownValue = workInProgressRootRenderLanes; + sourceFiber.flags |= 32768; + if (null !== value && "object" === typeof value && "function" === typeof value.then) { + var wakeable = value, + sourceFiber$jscomp$0 = sourceFiber, + tag = sourceFiber$jscomp$0.tag; + if (0 === (sourceFiber$jscomp$0.mode & 1) && (0 === tag || 11 === tag || 15 === tag)) { + var currentSource = sourceFiber$jscomp$0.alternate; + currentSource ? (sourceFiber$jscomp$0.updateQueue = currentSource.updateQueue, sourceFiber$jscomp$0.memoizedState = currentSource.memoizedState, sourceFiber$jscomp$0.lanes = currentSource.lanes) : (sourceFiber$jscomp$0.updateQueue = null, sourceFiber$jscomp$0.memoizedState = null); + } + b: { + sourceFiber$jscomp$0 = returnFiber; + do { + var JSCompiler_temp; + if (JSCompiler_temp = 13 === sourceFiber$jscomp$0.tag) { + var nextState = sourceFiber$jscomp$0.memoizedState; + JSCompiler_temp = null !== nextState ? null !== nextState.dehydrated ? !0 : !1 : !0; + } + if (JSCompiler_temp) { + var suspenseBoundary = sourceFiber$jscomp$0; + break b; + } + sourceFiber$jscomp$0 = sourceFiber$jscomp$0.return; + } while (null !== sourceFiber$jscomp$0); + suspenseBoundary = null; + } + if (null !== suspenseBoundary) { + suspenseBoundary.flags &= -257; + value = suspenseBoundary; + sourceFiber$jscomp$0 = thrownValue; + if (0 === (value.mode & 1)) { + if (value === returnFiber) value.flags |= 65536;else { + value.flags |= 128; + sourceFiber.flags |= 131072; + sourceFiber.flags &= -52805; + if (1 === sourceFiber.tag) if (null === sourceFiber.alternate) sourceFiber.tag = 17;else { + var update = createUpdate(-1, 1); + update.tag = 2; + enqueueUpdate(sourceFiber, update, 1); + } + sourceFiber.lanes |= 1; + } + } else value.flags |= 65536, value.lanes = sourceFiber$jscomp$0; + suspenseBoundary.mode & 1 && attachPingListener(root, wakeable, thrownValue); + thrownValue = suspenseBoundary; + root = wakeable; + var wakeables = thrownValue.updateQueue; + if (null === wakeables) { + var updateQueue = new Set(); + updateQueue.add(root); + thrownValue.updateQueue = updateQueue; + } else wakeables.add(root); + break a; + } else { + if (0 === (thrownValue & 1)) { + attachPingListener(root, wakeable, thrownValue); + renderDidSuspendDelayIfPossible(); + break a; + } + value = Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition."); + } + } + root = value = createCapturedValueAtFiber(value, sourceFiber); + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + null === workInProgressRootConcurrentErrors ? workInProgressRootConcurrentErrors = [root] : workInProgressRootConcurrentErrors.push(root); + root = returnFiber; + do { + switch (root.tag) { + case 3: + wakeable = value; + root.flags |= 65536; + thrownValue &= -thrownValue; + root.lanes |= thrownValue; + var update$jscomp$0 = createRootErrorUpdate(root, wakeable, thrownValue); + enqueueCapturedUpdate(root, update$jscomp$0); + break a; + case 1: + wakeable = value; + var ctor = root.type, + instance = root.stateNode; + if (0 === (root.flags & 128) && ("function" === typeof ctor.getDerivedStateFromError || null !== instance && "function" === typeof instance.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) { + root.flags |= 65536; + thrownValue &= -thrownValue; + root.lanes |= thrownValue; + var update$32 = createClassErrorUpdate(root, wakeable, thrownValue); + enqueueCapturedUpdate(root, update$32); + break a; + } + } + root = root.return; + } while (null !== root); + } + 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 renderDidSuspendDelayIfPossible() { + if (0 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus || 2 === workInProgressRootExitStatus) workInProgressRootExitStatus = 4; + null === workInProgressRoot || 0 === (workInProgressRootSkippedLanes & 268435455) && 0 === (workInProgressRootInterleavedUpdatedLanes & 268435455) || markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes); + } + function renderRootSync(root, lanes) { + var prevExecutionContext = executionContext; + executionContext |= 2; + var prevDispatcher = pushDispatcher(); + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) workInProgressTransitions = null, prepareFreshStack(root, lanes); + do try { + workLoopSync(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } while (1); + resetContextDependencies(); + 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 && !_$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_shouldYield();) performUnitOfWork(workInProgress); + } + function performUnitOfWork(unitOfWork) { + var next = beginWork$1(unitOfWork.alternate, unitOfWork, subtreeRenderLanes); + unitOfWork.memoizedProps = unitOfWork.pendingProps; + null === next ? completeUnitOfWork(unitOfWork) : workInProgress = next; + ReactCurrentOwner$2.current = null; + } + function completeUnitOfWork(unitOfWork) { + var completedWork = unitOfWork; + do { + var current = completedWork.alternate; + unitOfWork = completedWork.return; + if (0 === (completedWork.flags & 32768)) { + if (current = completeWork(current, completedWork, subtreeRenderLanes), null !== current) { + workInProgress = current; + return; + } + } else { + current = unwindWork(current, completedWork); + if (null !== current) { + current.flags &= 32767; + workInProgress = current; + return; + } + if (null !== unitOfWork) unitOfWork.flags |= 32768, unitOfWork.subtreeFlags = 0, unitOfWork.deletions = null;else { + workInProgressRootExitStatus = 6; + workInProgress = null; + return; + } + } + completedWork = completedWork.sibling; + if (null !== completedWork) { + workInProgress = completedWork; + return; + } + workInProgress = completedWork = unitOfWork; + } while (null !== completedWork); + 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); + } + function commitRoot(root, recoverableErrors, transitions) { + var previousUpdateLanePriority = currentUpdatePriority, + prevTransition = ReactCurrentBatchConfig$2.transition; + try { + ReactCurrentBatchConfig$2.transition = null, currentUpdatePriority = 1, commitRootImpl(root, recoverableErrors, transitions, previousUpdateLanePriority); + } finally { + ReactCurrentBatchConfig$2.transition = prevTransition, currentUpdatePriority = previousUpdateLanePriority; + } + return null; + } + function commitRootImpl(root, recoverableErrors, transitions, renderPriorityLevel) { + do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) throw Error("Should not already be working."); + transitions = root.finishedWork; + var lanes = root.finishedLanes; + if (null === transitions) return null; + root.finishedWork = null; + root.finishedLanes = 0; + if (transitions === 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 = transitions.lanes | transitions.childLanes; + markRootFinished(root, remainingLanes); + root === workInProgressRoot && (workInProgress = workInProgressRoot = null, workInProgressRootRenderLanes = 0); + 0 === (transitions.subtreeFlags & 2064) && 0 === (transitions.flags & 2064) || rootDoesHavePassiveEffects || (rootDoesHavePassiveEffects = !0, scheduleCallback$1(_$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_NormalPriority, function () { + flushPassiveEffects(); + return null; + })); + remainingLanes = 0 !== (transitions.flags & 15990); + if (0 !== (transitions.subtreeFlags & 15990) || remainingLanes) { + remainingLanes = ReactCurrentBatchConfig$2.transition; + ReactCurrentBatchConfig$2.transition = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 1; + var prevExecutionContext = executionContext; + executionContext |= 4; + ReactCurrentOwner$2.current = null; + commitBeforeMutationEffects(root, transitions); + commitMutationEffectsOnFiber(transitions, root); + root.current = transitions; + commitLayoutEffects(transitions, root, lanes); + _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_requestPaint(); + executionContext = prevExecutionContext; + currentUpdatePriority = previousPriority; + ReactCurrentBatchConfig$2.transition = remainingLanes; + } else root.current = transitions; + rootDoesHavePassiveEffects && (rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = root, pendingPassiveEffectsLanes = lanes); + remainingLanes = root.pendingLanes; + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + onCommitRoot(transitions.stateNode, renderPriorityLevel); + ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now()); + if (null !== recoverableErrors) for (renderPriorityLevel = root.onRecoverableError, transitions = 0; transitions < recoverableErrors.length; transitions++) lanes = recoverableErrors[transitions], renderPriorityLevel(lanes.value, { + componentStack: lanes.stack, + digest: lanes.digest + }); + if (hasUncaughtError) throw hasUncaughtError = !1, root = firstUncaughtError, firstUncaughtError = null, root; + 0 !== (pendingPassiveEffectsLanes & 1) && 0 !== root.tag && flushPassiveEffects(); + remainingLanes = root.pendingLanes; + 0 !== (remainingLanes & 1) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : (nestedUpdateCount = 0, rootWithNestedUpdates = root) : nestedUpdateCount = 0; + flushSyncCallbacks(); + return null; + } + function flushPassiveEffects() { + if (null !== rootWithPendingPassiveEffects) { + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig$2.transition, + previousPriority = currentUpdatePriority; + try { + ReactCurrentBatchConfig$2.transition = null; + currentUpdatePriority = 16 > renderPriority ? 16 : renderPriority; + if (null === rootWithPendingPassiveEffects) var JSCompiler_inline_result = !1;else { + renderPriority = rootWithPendingPassiveEffects; + rootWithPendingPassiveEffects = null; + pendingPassiveEffectsLanes = 0; + if (0 !== (executionContext & 6)) throw Error("Cannot flush passive effects while already rendering."); + var prevExecutionContext = executionContext; + executionContext |= 4; + for (nextEffect = renderPriority.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(8, 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; + var sibling = fiber$jscomp$0.sibling, + returnFiber = fiber$jscomp$0.return; + detachFiberAfterEffects(fiber$jscomp$0); + if (fiber$jscomp$0 === fiberToDelete) { + nextEffect = null; + break; + } + if (null !== sibling) { + sibling.return = returnFiber; + nextEffect = sibling; + break; + } + nextEffect = returnFiber; + } + } + } + var previousFiber = fiber.alternate; + if (null !== previousFiber) { + var detachedChild = previousFiber.child; + if (null !== detachedChild) { + previousFiber.child = null; + do { + var detachedSibling = detachedChild.sibling; + detachedChild.sibling = null; + detachedChild = detachedSibling; + } while (null !== detachedChild); + } + } + nextEffect = fiber; + } + } + if (0 !== (fiber.subtreeFlags & 2064) && null !== child) child.return = fiber, nextEffect = child;else b: for (; null !== nextEffect;) { + fiber = nextEffect; + if (0 !== (fiber.flags & 2048)) switch (fiber.tag) { + case 0: + case 11: + case 15: + commitHookEffectListUnmount(9, fiber, fiber.return); + } + var sibling$jscomp$0 = fiber.sibling; + if (null !== sibling$jscomp$0) { + sibling$jscomp$0.return = fiber.return; + nextEffect = sibling$jscomp$0; + break b; + } + nextEffect = fiber.return; + } + } + var finishedWork = renderPriority.current; + for (nextEffect = finishedWork; null !== nextEffect;) { + child = nextEffect; + var firstChild = child.child; + if (0 !== (child.subtreeFlags & 2064) && null !== firstChild) firstChild.return = child, nextEffect = firstChild;else b: for (child = finishedWork; null !== nextEffect;) { + deletions = nextEffect; + if (0 !== (deletions.flags & 2048)) try { + switch (deletions.tag) { + case 0: + case 11: + case 15: + commitHookEffectListMount(9, deletions); + } + } catch (error) { + captureCommitPhaseError(deletions, deletions.return, error); + } + if (deletions === child) { + nextEffect = null; + break b; + } + var sibling$jscomp$1 = deletions.sibling; + if (null !== sibling$jscomp$1) { + sibling$jscomp$1.return = deletions.return; + nextEffect = sibling$jscomp$1; + break b; + } + nextEffect = deletions.return; + } + } + executionContext = prevExecutionContext; + flushSyncCallbacks(); + if (injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot) try { + injectedHook.onPostCommitFiberRoot(rendererID, renderPriority); + } catch (err) {} + JSCompiler_inline_result = !0; + } + return JSCompiler_inline_result; + } finally { + currentUpdatePriority = previousPriority, ReactCurrentBatchConfig$2.transition = prevTransition; + } + } + return !1; + } + function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { + sourceFiber = createCapturedValueAtFiber(error, sourceFiber); + sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 1); + rootFiber = enqueueUpdate(rootFiber, sourceFiber, 1); + sourceFiber = requestEventTime(); + null !== rootFiber && (markRootUpdated(rootFiber, 1, sourceFiber), ensureRootIsScheduled(rootFiber, sourceFiber)); + } + 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 = createCapturedValueAtFiber(error, sourceFiber); + sourceFiber = createClassErrorUpdate(nearestMountedAncestor, sourceFiber, 1); + nearestMountedAncestor = enqueueUpdate(nearestMountedAncestor, sourceFiber, 1); + sourceFiber = requestEventTime(); + null !== nearestMountedAncestor && (markRootUpdated(nearestMountedAncestor, 1, sourceFiber), ensureRootIsScheduled(nearestMountedAncestor, sourceFiber)); + 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 & 130023424) === workInProgressRootRenderLanes && 500 > _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now() - globalMostRecentFallbackTime ? prepareFreshStack(root, 0) : workInProgressRootPingedLanes |= pingedLanes); + ensureRootIsScheduled(root, wakeable); + } + function retryTimedOutBoundary(boundaryFiber, retryLane) { + 0 === retryLane && (0 === (boundaryFiber.mode & 1) ? retryLane = 1 : (retryLane = nextRetryLane, nextRetryLane <<= 1, 0 === (nextRetryLane & 130023424) && (nextRetryLane = 4194304))); + var eventTime = requestEventTime(); + boundaryFiber = markUpdateLaneFromFiberToRoot(boundaryFiber, retryLane); + null !== boundaryFiber && (markRootUpdated(boundaryFiber, retryLane, eventTime), ensureRootIsScheduled(boundaryFiber, eventTime)); + } + function retryDehydratedSuspenseBoundary(boundaryFiber) { + var suspenseState = boundaryFiber.memoizedState, + retryLane = 0; + null !== suspenseState && (retryLane = suspenseState.retryLane); + retryTimedOutBoundary(boundaryFiber, retryLane); + } + function resolveRetryWakeable(boundaryFiber, wakeable) { + var retryLane = 0; + switch (boundaryFiber.tag) { + case 13: + var retryCache = boundaryFiber.stateNode; + var suspenseState = boundaryFiber.memoizedState; + null !== suspenseState && (retryLane = suspenseState.retryLane); + break; + case 19: + retryCache = boundaryFiber.stateNode; + break; + default: + throw Error("Pinged unknown suspense boundary type. This is probably a bug in React."); + } + null !== retryCache && retryCache.delete(wakeable); + retryTimedOutBoundary(boundaryFiber, retryLane); + } + var beginWork$1; + beginWork$1 = function beginWork$1(current, workInProgress, renderLanes) { + if (null !== current) { + if (current.memoizedProps !== workInProgress.pendingProps || didPerformWorkStackCursor.current) didReceiveUpdate = !0;else { + if (0 === (current.lanes & renderLanes) && 0 === (workInProgress.flags & 128)) return didReceiveUpdate = !1, attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + } + } else didReceiveUpdate = !1; + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 2: + var Component = workInProgress.type; + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + var context = getMaskedContext(workInProgress, contextStackCursor.current); + prepareToReadContext(workInProgress, renderLanes); + context = renderWithHooks(null, workInProgress, Component, current, context, renderLanes); + workInProgress.flags |= 1; + if ("object" === typeof context && null !== context && "function" === typeof context.render && void 0 === context.$$typeof) { + workInProgress.tag = 1; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + if (isContextProvider(Component)) { + var hasContext = !0; + pushContextProvider(workInProgress); + } else hasContext = !1; + workInProgress.memoizedState = null !== context.state && void 0 !== context.state ? context.state : null; + initializeUpdateQueue(workInProgress); + context.updater = classComponentUpdater; + workInProgress.stateNode = context; + context._reactInternals = workInProgress; + mountClassInstance(workInProgress, Component, current, renderLanes); + workInProgress = finishClassComponent(null, workInProgress, Component, !0, hasContext, renderLanes); + } else workInProgress.tag = 0, reconcileChildren(null, workInProgress, context, renderLanes), workInProgress = workInProgress.child; + return workInProgress; + case 16: + Component = workInProgress.elementType; + a: { + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + context = Component._init; + Component = context(Component._payload); + workInProgress.type = Component; + context = workInProgress.tag = resolveLazyComponentTag(Component); + current = resolveDefaultProps(Component, current); + switch (context) { + case 0: + workInProgress = updateFunctionComponent(null, workInProgress, Component, current, renderLanes); + break a; + case 1: + workInProgress = updateClassComponent(null, workInProgress, Component, current, renderLanes); + break a; + case 11: + workInProgress = updateForwardRef(null, workInProgress, Component, current, renderLanes); + break a; + case 14: + workInProgress = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, current), renderLanes); + break a; + } + throw Error("Element type is invalid. Received a promise that resolves to: " + Component + ". Lazy element type must resolve to a class or function."); + } + return workInProgress; + case 0: + return Component = workInProgress.type, context = workInProgress.pendingProps, context = workInProgress.elementType === Component ? context : resolveDefaultProps(Component, context), updateFunctionComponent(current, workInProgress, Component, context, renderLanes); + case 1: + return Component = workInProgress.type, context = workInProgress.pendingProps, context = workInProgress.elementType === Component ? context : resolveDefaultProps(Component, context), updateClassComponent(current, workInProgress, Component, context, renderLanes); + case 3: + pushHostRootContext(workInProgress); + if (null === current) throw Error("Should have a current fiber. This is a bug in React."); + context = workInProgress.pendingProps; + Component = workInProgress.memoizedState.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, context, null, renderLanes); + context = workInProgress.memoizedState.element; + context === Component ? workInProgress = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) : (reconcileChildren(current, workInProgress, context, renderLanes), workInProgress = workInProgress.child); + return workInProgress; + case 5: + return pushHostContext(workInProgress), Component = workInProgress.pendingProps.children, markRef(current, workInProgress), reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child; + case 6: + return null; + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: + return pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo), Component = workInProgress.pendingProps, null === current ? workInProgress.child = reconcileChildFibers(workInProgress, null, Component, renderLanes) : reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child; + case 11: + return Component = workInProgress.type, context = workInProgress.pendingProps, context = workInProgress.elementType === Component ? context : resolveDefaultProps(Component, context), updateForwardRef(current, workInProgress, Component, context, renderLanes); + case 7: + return reconcileChildren(current, workInProgress, workInProgress.pendingProps, renderLanes), workInProgress.child; + case 8: + return reconcileChildren(current, workInProgress, workInProgress.pendingProps.children, renderLanes), workInProgress.child; + case 12: + return reconcileChildren(current, workInProgress, workInProgress.pendingProps.children, renderLanes), workInProgress.child; + case 10: + a: { + Component = workInProgress.type._context; + context = workInProgress.pendingProps; + hasContext = workInProgress.memoizedProps; + var newValue = context.value; + push(valueCursor, Component._currentValue2); + Component._currentValue2 = newValue; + if (null !== hasContext) if (objectIs(hasContext.value, newValue)) { + if (hasContext.children === context.children && !didPerformWorkStackCursor.current) { + workInProgress = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + break a; + } + } else for (hasContext = workInProgress.child, null !== hasContext && (hasContext.return = workInProgress); null !== hasContext;) { + var list = hasContext.dependencies; + if (null !== list) { + newValue = hasContext.child; + for (var dependency = list.firstContext; null !== dependency;) { + if (dependency.context === Component) { + if (1 === hasContext.tag) { + dependency = createUpdate(-1, renderLanes & -renderLanes); + dependency.tag = 2; + var updateQueue = hasContext.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; + } + } + hasContext.lanes |= renderLanes; + dependency = hasContext.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath(hasContext.return, renderLanes, workInProgress); + list.lanes |= renderLanes; + break; + } + dependency = dependency.next; + } + } else if (10 === hasContext.tag) newValue = hasContext.type === workInProgress.type ? null : hasContext.child;else if (18 === hasContext.tag) { + newValue = hasContext.return; + if (null === newValue) throw Error("We just came from a parent so we must have had a parent. This is a bug in React."); + newValue.lanes |= renderLanes; + list = newValue.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(newValue, renderLanes, workInProgress); + newValue = hasContext.sibling; + } else newValue = hasContext.child; + if (null !== newValue) newValue.return = hasContext;else for (newValue = hasContext; null !== newValue;) { + if (newValue === workInProgress) { + newValue = null; + break; + } + hasContext = newValue.sibling; + if (null !== hasContext) { + hasContext.return = newValue.return; + newValue = hasContext; + break; + } + newValue = newValue.return; + } + hasContext = newValue; + } + reconcileChildren(current, workInProgress, context.children, renderLanes); + workInProgress = workInProgress.child; + } + return workInProgress; + case 9: + return context = workInProgress.type, Component = workInProgress.pendingProps.children, prepareToReadContext(workInProgress, renderLanes), context = readContext(context), Component = Component(context), workInProgress.flags |= 1, reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child; + case 14: + return Component = workInProgress.type, context = resolveDefaultProps(Component, workInProgress.pendingProps), context = resolveDefaultProps(Component.type, context), updateMemoComponent(current, workInProgress, Component, context, renderLanes); + case 15: + return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, renderLanes); + case 17: + return Component = workInProgress.type, context = workInProgress.pendingProps, context = workInProgress.elementType === Component ? context : resolveDefaultProps(Component, context), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), workInProgress.tag = 1, isContextProvider(Component) ? (current = !0, pushContextProvider(workInProgress)) : current = !1, prepareToReadContext(workInProgress, renderLanes), constructClassInstance(workInProgress, Component, context), mountClassInstance(workInProgress, Component, context, renderLanes), finishClassComponent(null, workInProgress, Component, !0, current, renderLanes); + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 22: + 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 scheduleCallback$1(priorityLevel, callback) { + return _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_scheduleCallback(priorityLevel, callback); + } + 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; + } + 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.flags = current.flags & 14680064; + 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; + 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_STRICT_MODE_TYPE: + fiberTag = 8; + mode |= 8; + break; + case REACT_PROFILER_TYPE: + return type = createFiber(12, pendingProps, key, mode | 2), type.elementType = REACT_PROFILER_TYPE, type.lanes = lanes, type; + case REACT_SUSPENSE_TYPE: + return type = createFiber(13, pendingProps, key, mode), 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); + 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; + pendingProps.stateNode = { + isHidden: !1 + }; + 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, identifierPrefix, onRecoverableError) { + this.tag = tag; + this.containerInfo = containerInfo; + this.finishedWork = this.pingCache = this.current = this.pendingChildren = null; + this.timeoutHandle = -1; + this.callbackNode = this.pendingContext = this.context = 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.identifierPrefix = identifierPrefix; + this.onRecoverableError = onRecoverableError; + } + 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."); + component = Object.keys(component).join(","); + throw Error("Argument appears to not be a ReactComponent. 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); + element = enqueueUpdate(current, container, lane); + null !== element && (scheduleUpdateOnFiber(element, current, lane, eventTime), 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 onRecoverableError(error) { + console.error(error); + } + batchedUpdatesImpl = function batchedUpdatesImpl(fn, a) { + var prevExecutionContext = executionContext; + executionContext |= 1; + try { + return fn(a); + } finally { + executionContext = prevExecutionContext, 0 === executionContext && (workInProgressRootRenderTargetTime = _$$_REQUIRE(_dependencyMap[3], "scheduler").unstable_now() + 500, includesLegacySyncCallbacks && flushSyncCallbacks()); + } + }; + var roots = new Map(), + devToolsConfig$jscomp$inline_938 = { + findFiberByHostInstance: getInstanceFromInstance, + bundleType: 0, + version: "18.2.0-next-9e3b772b8-20220608", + rendererPackageName: "react-native-renderer", + rendererConfig: { + getInspectorDataForViewTag: function getInspectorDataForViewTag() { + 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_1180 = { + bundleType: devToolsConfig$jscomp$inline_938.bundleType, + version: devToolsConfig$jscomp$inline_938.version, + rendererPackageName: devToolsConfig$jscomp$inline_938.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_938.rendererConfig, + overrideHookState: null, + overrideHookStateDeletePath: null, + overrideHookStateRenamePath: null, + overrideProps: null, + overridePropsDeletePath: null, + overridePropsRenamePath: null, + setErrorHandler: null, + setSuspenseHandler: null, + scheduleUpdate: null, + currentDispatcherRef: ReactSharedInternals.ReactCurrentDispatcher, + findHostInstanceByFiber: function findHostInstanceByFiber(fiber) { + fiber = findCurrentHostFiber(fiber); + return null === fiber ? null : fiber.stateNode; + }, + findFiberByHostInstance: devToolsConfig$jscomp$inline_938.findFiberByHostInstance || emptyFindFiberByHostInstance, + findHostInstancesForRefresh: null, + scheduleRefresh: null, + scheduleRoot: null, + setRefreshHandler: null, + getCurrentFiber: null, + reconcilerVersion: "18.2.0-next-9e3b772b8-20220608" + }; + if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { + var hook$jscomp$inline_1181 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + if (!hook$jscomp$inline_1181.isDisabled && hook$jscomp$inline_1181.supportsFiber) try { + rendererID = hook$jscomp$inline_1181.inject(internals$jscomp$inline_1180), injectedHook = hook$jscomp$inline_1181; + } catch (err) {} + } + 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 && (null != handle._internalInstanceHandle ? (handle = handle._internalInstanceHandle.stateNode, null != handle && nativeFabricUIManager.dispatchCommand(handle.node, command, args)) : _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/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.getInspectorDataForInstance = void 0; + exports.render = function (element, containerTag, callback, concurrentRoot) { + var root = roots.get(containerTag); + root || (root = concurrentRoot ? 1 : 0, concurrentRoot = new FiberRootNode(containerTag, root, !1, "", onRecoverableError), root = createFiber(3, null, null, 1 === root ? 1 : 0), concurrentRoot.current = root, root.stateNode = concurrentRoot, root.memoizedState = { + element: null, + isDehydrated: !1, + cache: null, + transitions: null, + pendingSuspenseBoundaries: null + }, initializeUpdateQueue(root), root = concurrentRoot, 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.canonical; + break a; + default: + element = element.child.stateNode; + } else element = null; + return element; + }; + exports.sendAccessibilityEvent = function (handle, eventType) { + null != handle._nativeTag && (null != handle._internalInstanceHandle ? (handle = handle._internalInstanceHandle.stateNode, null != handle && nativeFabricUIManager.sendAccessibilityEvent(handle.node, eventType)) : _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/ReactPrivate/ReactNativePrivateInterface").legacySendAccessibilityEvent(handle._nativeTag, eventType)); + }; + exports.stopSurface = function (containerTag) { + var root = roots.get(containerTag); + root && updateContainer(null, root, null, function () { + roots.delete(containerTag); + }); + }; + exports.unmountComponentAtNode = function (containerTag) { + this.stopSurface(containerTag); + }; +},489,[68,65,279,439],"node_modules\\react-native\\Libraries\\Renderer\\implementations\\ReactFabric-prod.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + * @generate-docs + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = void 0; + var _objectWithoutProperties2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/objectWithoutProperties")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "../../StyleSheet/StyleSheet")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "../../Utilities/Platform")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "../View/View")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[6], "react/jsx-runtime"); + var _excluded = ["animating", "color", "hidesWhenStopped", "onLayout", "size", "style"]; + var _this = this, + _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Components\\ActivityIndicator\\ActivityIndicator.js"; + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + var PlatformActivityIndicator = _Platform.default.OS === 'android' ? _$$_REQUIRE(_dependencyMap[7], "../ProgressBarAndroid/ProgressBarAndroid") : _$$_REQUIRE(_dependencyMap[8], "./ActivityIndicatorViewNativeComponent").default; + var GRAY = '#999999'; + var ActivityIndicator = function ActivityIndicator(_ref, forwardedRef) { + var _ref$animating = _ref.animating, + animating = _ref$animating === void 0 ? true : _ref$animating, + _ref$color = _ref.color, + color = _ref$color === void 0 ? _Platform.default.OS === 'ios' ? GRAY : null : _ref$color, + _ref$hidesWhenStopped = _ref.hidesWhenStopped, + hidesWhenStopped = _ref$hidesWhenStopped === void 0 ? true : _ref$hidesWhenStopped, + onLayout = _ref.onLayout, + _ref$size = _ref.size, + size = _ref$size === void 0 ? 'small' : _ref$size, + style = _ref.style, + restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded); + var sizeStyle; + var sizeProp; + switch (size) { + case 'small': + sizeStyle = styles.sizeSmall; + sizeProp = 'small'; + break; + case 'large': + sizeStyle = styles.sizeLarge; + sizeProp = 'large'; + break; + default: + sizeStyle = { + height: size, + width: size + }; + break; + } + var nativeProps = Object.assign({ + animating: animating, + color: color, + hidesWhenStopped: hidesWhenStopped + }, restProps, { + ref: forwardedRef, + style: sizeStyle, + size: sizeProp + }); + var androidProps = { + styleAttr: 'Normal', + indeterminate: true + }; + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, { + onLayout: onLayout, + style: _StyleSheet.default.compose(styles.container, style), + children: _Platform.default.OS === 'android' ? + /*#__PURE__*/ + // $FlowFixMe[prop-missing] Flow doesn't know when this is the android component + (0, _jsxRuntime.jsx)(PlatformActivityIndicator, Object.assign({}, nativeProps, androidProps)) : + /*#__PURE__*/ + /* $FlowFixMe[prop-missing] (>=0.106.0 site=react_native_android_fb) This comment + * suppresses an error found when Flow v0.106 was deployed. To see the + * error, delete this comment and run Flow. */ + (0, _jsxRuntime.jsx)(PlatformActivityIndicator, Object.assign({}, nativeProps)) + }); + }; + + /** + Displays a circular loading indicator. + + ```SnackPlayer name=ActivityIndicator%20Function%20Component%20Example + import React from "react"; + import { ActivityIndicator, StyleSheet, Text, View } from "react-native"; + + const App = () => ( + + + + + + + ); + + const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: "center" + }, + horizontal: { + flexDirection: "row", + justifyContent: "space-around", + padding: 10 + } + }); + export default App; + ``` + + ```SnackPlayer name=ActivityIndicator%20Class%20Component%20Example + import React, { Component } from "react"; + import { ActivityIndicator, StyleSheet, Text, View } from "react-native"; + + class App extends Component { + render() { + return ( + + + + + + + ); + } + } + + const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: "center" + }, + horizontal: { + flexDirection: "row", + justifyContent: "space-around", + padding: 10 + } + }); + export default App; + ``` + */ + + var ActivityIndicatorWithRef = React.forwardRef(ActivityIndicator); + ActivityIndicatorWithRef.displayName = 'ActivityIndicator'; + var styles = _StyleSheet.default.create({ + container: { + alignItems: 'center', + justifyContent: 'center' + }, + sizeSmall: { + width: 20, + height: 20 + }, + sizeLarge: { + width: 36, + height: 36 + } + }); + var _default = exports.default = ActivityIndicatorWithRef; +},490,[6,166,266,34,241,65,106,491,493],"node_modules\\react-native\\Libraries\\Components\\ActivityIndicator\\ActivityIndicator.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _objectWithoutProperties2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/objectWithoutProperties")); + var _ProgressBarAndroidNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "./ProgressBarAndroidNativeComponent")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[3], "react/jsx-runtime"); + var _excluded = ["styleAttr", "indeterminate", "animating"]; + var _this = this, + _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Components\\ProgressBarAndroid\\ProgressBarAndroid.android.js"; + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + var React = _$$_REQUIRE(_dependencyMap[4], "react"); + /** + * React component that wraps the Android-only `ProgressBar`. This component is + * used to indicate that the app is loading or there is activity in the app. + * + * Example: + * + * ``` + * render: function() { + * var progressBar = + * + * + * ; + + * return ( + * + * ); + * }, + * ``` + */ + var ProgressBarAndroid = function ProgressBarAndroid(_ref, forwardedRef) { + var _ref$styleAttr = _ref.styleAttr, + styleAttr = _ref$styleAttr === void 0 ? 'Normal' : _ref$styleAttr, + _ref$indeterminate = _ref.indeterminate, + indeterminate = _ref$indeterminate === void 0 ? true : _ref$indeterminate, + _ref$animating = _ref.animating, + animating = _ref$animating === void 0 ? true : _ref$animating, + restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded); + return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBarAndroidNativeComponent.default, Object.assign({ + styleAttr: styleAttr, + indeterminate: indeterminate, + animating: animating + }, restProps, { + ref: forwardedRef + })); + }; + var ProgressBarAndroidToExport = React.forwardRef(ProgressBarAndroid); + module.exports = + /* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ + ProgressBarAndroidToExport; +},491,[6,166,492,106,65],"node_modules\\react-native\\Libraries\\Components\\ProgressBarAndroid\\ProgressBarAndroid.android.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.__INTERNAL_VIEW_CONFIG = void 0; + var _codegenNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Utilities/codegenNativeComponent")); /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + * @format + */ + + var nativeComponentName = 'AndroidProgressBar'; + var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = { + uiViewClassName: 'AndroidProgressBar', + validAttributes: { + styleAttr: true, + typeAttr: true, + indeterminate: true, + progress: true, + animating: true, + color: { + process: _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/StyleSheet/processColor").default + }, + testID: true + } + }; + var _default = exports.default = _$$_REQUIRE(_dependencyMap[3], "react-native/Libraries/NativeComponent/NativeComponentRegistry").get(nativeComponentName, function () { + return __INTERNAL_VIEW_CONFIG; + }); +},492,[6,276,189,244],"node_modules\\react-native\\Libraries\\Components\\ProgressBarAndroid\\ProgressBarAndroidNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.__INTERNAL_VIEW_CONFIG = void 0; + var _codegenNativeComponent = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "../../Utilities/codegenNativeComponent")); /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + */ + + var nativeComponentName = 'RCTActivityIndicatorView'; + var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = { + uiViewClassName: 'RCTActivityIndicatorView', + validAttributes: { + hidesWhenStopped: true, + animating: true, + color: { + process: _$$_REQUIRE(_dependencyMap[2], "react-native/Libraries/StyleSheet/processColor").default + }, + size: true + } + }; + var _default = exports.default = _$$_REQUIRE(_dependencyMap[3], "react-native/Libraries/NativeComponent/NativeComponentRegistry").get(nativeComponentName, function () { + return __INTERNAL_VIEW_CONFIG; + }); +},493,[6,276,189,244],"node_modules\\react-native\\Libraries\\Components\\ActivityIndicator\\ActivityIndicatorViewNativeComponent.js"); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * + * @generate-docs + */ + + 'use strict'; + + var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault"); + var _classCallCheck2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/classCallCheck")); + var _createClass2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "@babel/runtime/helpers/createClass")); + var _possibleConstructorReturn2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[3], "@babel/runtime/helpers/possibleConstructorReturn")); + var _getPrototypeOf2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[4], "@babel/runtime/helpers/getPrototypeOf")); + var _inherits2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[5], "@babel/runtime/helpers/inherits")); + var _StyleSheet = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[6], "../StyleSheet/StyleSheet")); + var _Text = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[7], "../Text/Text")); + var _Platform = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[8], "../Utilities/Platform")); + var _TouchableNativeFeedback = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[9], "./Touchable/TouchableNativeFeedback")); + var _TouchableOpacity = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[10], "./Touchable/TouchableOpacity")); + var _View = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[11], "./View/View")); + var _invariant = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[12], "invariant")); + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13], "react")); + var _jsxRuntime = _$$_REQUIRE(_dependencyMap[14], "react/jsx-runtime"); + var _jsxFileName = "E:\\source\\ikun-music-mobile\\node_modules\\react-native\\Libraries\\Components\\Button.js"; + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } + function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + /** + A basic button component that should render nicely on any platform. Supports a + minimal level of customization. + + If this button doesn't look right for your app, you can build your own button + using [TouchableOpacity](touchableopacity) or + [TouchableWithoutFeedback](touchablewithoutfeedback). For inspiration, look at + the [source code for this button component][button:source]. Or, take a look at + the [wide variety of button components built by the community] + [button:examples]. + + [button:source]: + https://github.com/facebook/react-native/blob/HEAD/Libraries/Components/Button.js + + [button:examples]: + https://js.coach/?menu%5Bcollections%5D=React%20Native&page=1&query=button + + ```jsx +