From 65182b27d8b5ee76157a1b82f59c719882fc86fa Mon Sep 17 00:00:00 2001 From: spmfox Date: Thu, 3 Aug 2023 22:58:31 -0400 Subject: fixing scroll issue --- AnsiblePilotPlugin/index.js | 14017 +++++++++++++++++++++++++----------------- 1 file changed, 8211 insertions(+), 5806 deletions(-) (limited to 'AnsiblePilotPlugin/index.js') diff --git a/AnsiblePilotPlugin/index.js b/AnsiblePilotPlugin/index.js index ab4f3bd..eda3158 100644 --- a/AnsiblePilotPlugin/index.js +++ b/AnsiblePilotPlugin/index.js @@ -25,129 +25,31 @@ mod )); - // node_modules/object-assign/index.js - var require_object_assign = __commonJS({ - "node_modules/object-assign/index.js"(exports, module) { - "use strict"; - var getOwnPropertySymbols = Object.getOwnPropertySymbols; - var hasOwnProperty = Object.prototype.hasOwnProperty; - var propIsEnumerable = Object.prototype.propertyIsEnumerable; - function toObject(val) { - if (val === null || val === void 0) { - throw new TypeError("Object.assign cannot be called with null or undefined"); - } - return Object(val); - } - function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - var test1 = new String("abc"); - test1[5] = "de"; - if (Object.getOwnPropertyNames(test1)[0] === "5") { - return false; - } - 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; - } - var test3 = {}; - "abcdefghijklmnopqrst".split("").forEach(function(letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") { - return false; - } - return true; - } catch (err) { - 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; - }; - } - }); - // node_modules/react/cjs/react.development.js var require_react_development = __commonJS({ - "node_modules/react/cjs/react.development.js"(exports) { + "node_modules/react/cjs/react.development.js"(exports, module) { "use strict"; if (true) { (function() { "use strict"; - var _assign = require_object_assign(); - var ReactVersion = "17.0.2"; - var REACT_ELEMENT_TYPE = 60103; - var REACT_PORTAL_TYPE = 60106; - exports.Fragment = 60107; - exports.StrictMode = 60108; - exports.Profiler = 60114; - var REACT_PROVIDER_TYPE = 60109; - var REACT_CONTEXT_TYPE = 60110; - var REACT_FORWARD_REF_TYPE = 60112; - exports.Suspense = 60113; - var REACT_SUSPENSE_LIST_TYPE = 60120; - var REACT_MEMO_TYPE = 60115; - var REACT_LAZY_TYPE = 60116; - var REACT_BLOCK_TYPE = 60121; - var REACT_SERVER_BLOCK_TYPE = 60122; - var REACT_FUNDAMENTAL_TYPE = 60117; - var REACT_SCOPE_TYPE = 60119; - var REACT_OPAQUE_ID_TYPE = 60128; - var REACT_DEBUG_TRACING_MODE_TYPE = 60129; - var REACT_OFFSCREEN_TYPE = 60130; - var REACT_LEGACY_HIDDEN_TYPE = 60131; - if (typeof Symbol === "function" && Symbol.for) { - var symbolFor = Symbol.for; - REACT_ELEMENT_TYPE = symbolFor("react.element"); - REACT_PORTAL_TYPE = symbolFor("react.portal"); - exports.Fragment = symbolFor("react.fragment"); - exports.StrictMode = symbolFor("react.strict_mode"); - exports.Profiler = symbolFor("react.profiler"); - REACT_PROVIDER_TYPE = symbolFor("react.provider"); - REACT_CONTEXT_TYPE = symbolFor("react.context"); - REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref"); - exports.Suspense = 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"); - } - var MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; + 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"; + 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") { @@ -167,7 +69,13 @@ current: null }; var ReactCurrentBatchConfig = { - transition: 0 + transition: null + }; + var ReactCurrentActQueue = { + current: null, + // Used to reproduce behavior of `batchedUpdates` in legacy mode. + isBatchingLegacy: false, + didScheduleLegacyUpdate: false }; var ReactCurrentOwner = { /** @@ -202,34 +110,38 @@ return stack; }; } - var IsSomeRendererActing = { - current: false - }; + var enableScopeAPI = false; + var enableCacheElement = false; + var enableTransitionTracing = false; + var enableLegacyHidden = false; + var enableDebugTracing = false; var ReactSharedInternals = { ReactCurrentDispatcher, ReactCurrentBatchConfig, - ReactCurrentOwner, - IsSomeRendererActing, - // Used by renderers to avoid bundling object-assign twice in UMD bundles: - assign: _assign + ReactCurrentOwner }; { ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame; + ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue; } function warn(format2) { { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; + { + 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", format2, args); } - printWarning("warn", format2, args); } } function error(format2) { { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; + { + 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", format2, args); } - printWarning("error", format2, args); } } function printWarning(level, format2, args) { @@ -241,7 +153,7 @@ args = args.concat([stack]); } var argsWithFormat = args.map(function(item) { - return "" + item; + return String(item); }); argsWithFormat.unshift("Warning: " + format2); Function.prototype.apply.call(console[level], console, argsWithFormat); @@ -321,6 +233,7 @@ warnNoop(publicInstance, "setState"); } }; + var assign = Object.assign; var emptyObject = {}; { Object.freeze(emptyObject); @@ -333,10 +246,8 @@ } Component7.prototype.isReactComponent = {}; Component7.prototype.setState = function(partialState, callback) { - if (!(typeof partialState === "object" || typeof partialState === "function" || partialState == null)) { - { - throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); - } + 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"); }; @@ -373,7 +284,7 @@ } var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); pureComponentPrototype.constructor = PureComponent; - _assign(pureComponentPrototype, Component7.prototype); + assign(pureComponentPrototype, Component7.prototype); pureComponentPrototype.isPureReactComponent = true; function createRef2() { var refObject = { @@ -384,20 +295,56 @@ } return refObject; } + var isArrayImpl = Array.isArray; + function isArray(a) { + return isArrayImpl(a); + } + function typeName(value) { + { + var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; + var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; + return type; + } + } + function willCoercionThrow(value) { + { + try { + testStringCoercion(value); + return false; + } catch (e) { + return true; + } + } + } + function testStringCoercion(value) { + 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); + } + } + } function getWrappedName(outerType, innerType, wrapperName) { + var displayName = outerType.displayName; + if (displayName) { + return displayName; + } var functionName = innerType.displayName || innerType.name || ""; - return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName); + return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; } function getContextName(type) { return type.displayName || "Context"; } - function getComponentName(type) { + function getComponentNameFromType(type) { if (type == null) { return null; } { if (typeof type.tag === "number") { - error("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."); + error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."); } } if (typeof type === "function") { @@ -407,15 +354,15 @@ return type; } switch (type) { - case exports.Fragment: + case REACT_FRAGMENT_TYPE: return "Fragment"; case REACT_PORTAL_TYPE: return "Portal"; - case exports.Profiler: + case REACT_PROFILER_TYPE: return "Profiler"; - case exports.StrictMode: + case REACT_STRICT_MODE_TYPE: return "StrictMode"; - case exports.Suspense: + case REACT_SUSPENSE_TYPE: return "Suspense"; case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; @@ -431,15 +378,17 @@ case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, "ForwardRef"); case REACT_MEMO_TYPE: - return getComponentName(type.type); - case REACT_BLOCK_TYPE: - return getComponentName(type._render); + 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 getComponentName(init(payload)); + return getComponentNameFromType(init(payload)); } catch (x) { return null; } @@ -514,7 +463,7 @@ function warnIfStringRefCannotBeAutoConverted(config) { { if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { - var componentName = getComponentName(ReactCurrentOwner.current.type); + 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; @@ -576,6 +525,9 @@ } } if (hasValidKey(config)) { + { + checkKeyStringCoercion(config.key); + } key = "" + config.key; } self = config.__self === void 0 ? null : config.__self; @@ -627,13 +579,11 @@ return newElement; } function cloneElement2(element, config, children) { - if (!!(element === null || element === void 0)) { - { - throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + "."); - } + if (element === null || element === void 0) { + throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + "."); } var propName; - var props = _assign({}, element.props); + var props = assign({}, element.props); var key = element.key; var ref = element.ref; var self = element._self; @@ -645,6 +595,9 @@ owner = ReactCurrentOwner.current; } if (hasValidKey(config)) { + { + checkKeyStringCoercion(config.key); + } key = "" + config.key; } var defaultProps; @@ -696,6 +649,9 @@ } function getElementKey(element, index) { if (typeof element === "object" && element !== null && element.key != null) { + { + checkKeyStringCoercion(element.key); + } return escape("" + element.key); } return index.toString(36); @@ -726,7 +682,7 @@ var _child = children; var mappedChild = callback(_child); var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar; - if (Array.isArray(mappedChild)) { + if (isArray(mappedChild)) { var escapedChildKey = ""; if (childKey != null) { escapedChildKey = escapeUserProvidedKey(childKey) + "/"; @@ -736,6 +692,11 @@ }); } else if (mappedChild != null) { if (isValidElement2(mappedChild)) { + { + 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 @@ -743,6 +704,7 @@ 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 ); @@ -755,7 +717,7 @@ var nextName; var subtreeCount = 0; var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR; - if (Array.isArray(children)) { + if (isArray(children)) { for (var i = 0; i < children.length; i++) { child = children[i]; nextName = nextNamePrefix + getElementKey(child, i); @@ -782,12 +744,8 @@ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); } } else if (type === "object") { - var childrenString = "" + children; - { - { - throw 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."); - } - } + 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; @@ -822,25 +780,13 @@ } function onlyChild(children) { if (!isValidElement2(children)) { - { - throw Error("React.Children.only expected to receive a single React element child."); - } + throw new Error("React.Children.only expected to receive a single React element child."); } return children; } - function createContext2(defaultValue, calculateChangedBits) { - if (calculateChangedBits === void 0) { - calculateChangedBits = null; - } else { - { - if (calculateChangedBits !== null && typeof calculateChangedBits !== "function") { - error("createContext: Expected the optional second argument to be a function. Instead received: %s", calculateChangedBits); - } - } - } + function createContext2(defaultValue) { var context = { $$typeof: REACT_CONTEXT_TYPE, - _calculateChangedBits: calculateChangedBits, // 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 @@ -853,7 +799,10 @@ _threadCount: 0, // These are circular Provider: null, - Consumer: null + Consumer: null, + // Add these to use same hidden class in VM as ServerContext + _defaultValue: null, + _globalName: null }; context.Provider = { $$typeof: REACT_PROVIDER_TYPE, @@ -865,8 +814,7 @@ { var Consumer = { $$typeof: REACT_CONTEXT_TYPE, - _context: context, - _calculateChangedBits: context._calculateChangedBits + _context: context }; Object.defineProperties(Consumer, { Provider: { @@ -942,31 +890,38 @@ if (payload._status === Uninitialized) { var ctor = payload._result; var thenable = ctor(); - var pending = payload; - pending._status = Pending; - pending._result = thenable; - thenable.then(function(moduleObject) { - if (payload._status === Pending) { - var defaultExport = moduleObject.default; - { - if (defaultExport === void 0) { - error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); - } - } + thenable.then(function(moduleObject2) { + if (payload._status === Pending || payload._status === Uninitialized) { var resolved = payload; resolved._status = Resolved; - resolved._result = defaultExport; + resolved._result = moduleObject2; } }, function(error2) { - if (payload._status === Pending) { + if (payload._status === Pending || payload._status === Uninitialized) { var rejected = payload; rejected._status = Rejected; rejected._result = error2; } }); + if (payload._status === Uninitialized) { + var pending = payload; + pending._status = Pending; + pending._result = thenable; + } } if (payload._status === Resolved) { - return payload._result; + var moduleObject = payload._result; + { + if (moduleObject === void 0) { + error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject); + } + } + { + if (!("default" in moduleObject)) { + error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); + } + } + return moduleObject.default; } else { throw payload._result; } @@ -974,7 +929,7 @@ function lazy(ctor) { var payload = { // We use these fields to store the result. - _status: -1, + _status: Uninitialized, _result: ctor }; var lazyType = { @@ -1047,7 +1002,7 @@ }, set: function(name) { ownName = name; - if (render.displayName == null) { + if (!render.name && !render.displayName) { render.displayName = name; } } @@ -1055,16 +1010,23 @@ } return elementType; } - var enableScopeAPI = false; + var REACT_MODULE_REFERENCE; + { + REACT_MODULE_REFERENCE = Symbol.for("react.module.reference"); + } function isValidElementType(type) { if (typeof type === "string" || typeof type === "function") { return true; } - if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI) { + 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 || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { + 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 !== void 0) { return true; } } @@ -1091,7 +1053,7 @@ }, set: function(name) { ownName = name; - if (type.displayName == null) { + if (!type.name && !type.displayName) { type.displayName = name; } } @@ -1101,19 +1063,16 @@ } function resolveDispatcher() { var dispatcher = ReactCurrentDispatcher.current; - if (!(dispatcher !== null)) { - { - throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."); + { + 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:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."); } } return dispatcher; } - function useContext2(Context, unstable_observedBits) { + function useContext2(Context) { var dispatcher = resolveDispatcher(); { - if (unstable_observedBits !== void 0) { - error("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s", unstable_observedBits, typeof unstable_observedBits === "number" && Array.isArray(arguments[2]) ? "\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://reactjs.org/link/rules-of-hooks" : ""); - } if (Context._context !== void 0) { var realContext = Context._context; if (realContext.Consumer === Context) { @@ -1123,7 +1082,7 @@ } } } - return dispatcher.useContext(Context, unstable_observedBits); + return dispatcher.useContext(Context); } function useState4(initialState) { var dispatcher = resolveDispatcher(); @@ -1141,6 +1100,10 @@ var dispatcher = resolveDispatcher(); return dispatcher.useEffect(create, deps); } + function useInsertionEffect(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useInsertionEffect(create, deps); + } function useLayoutEffect2(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useLayoutEffect(create, deps); @@ -1163,6 +1126,22 @@ 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); + } var disabledDepth = 0; var prevLog; var prevInfo; @@ -1213,25 +1192,25 @@ writable: true }; Object.defineProperties(console, { - log: _assign({}, props, { + log: assign({}, props, { value: prevLog }), - info: _assign({}, props, { + info: assign({}, props, { value: prevInfo }), - warn: _assign({}, props, { + warn: assign({}, props, { value: prevWarn }), - error: _assign({}, props, { + error: assign({}, props, { value: prevError }), - group: _assign({}, props, { + group: assign({}, props, { value: prevGroup }), - groupCollapsed: _assign({}, props, { + groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), - groupEnd: _assign({}, props, { + groupEnd: assign({}, props, { value: prevGroupEnd }) }); @@ -1332,6 +1311,9 @@ c--; if (c < 0 || sampleLines[s] !== controlLines[c]) { var _frame = "\n" + sampleLines[s].replace(" at new ", " at "); + if (fn.displayName && _frame.includes("")) { + _frame = _frame.replace("", fn.displayName); + } { if (typeof fn === "function") { componentFrameCache.set(fn, _frame); @@ -1384,7 +1366,7 @@ return describeBuiltInComponentFrame(type); } switch (type) { - case exports.Suspense: + case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame("Suspense"); case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame("SuspenseList"); @@ -1395,8 +1377,6 @@ return describeFunctionComponentFrame(type.render); case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); - case REACT_BLOCK_TYPE: - return describeFunctionComponentFrame(type._render); case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; @@ -1425,7 +1405,7 @@ } function checkPropTypes(typeSpecs, values, location, componentName, element) { { - var has = Function.call.bind(Object.prototype.hasOwnProperty); + var has = Function.call.bind(hasOwnProperty); for (var typeSpecName in typeSpecs) { if (has(typeSpecs, typeSpecName)) { var error$1 = void 0; @@ -1471,7 +1451,7 @@ } function getDeclarationErrorAddendum() { if (ReactCurrentOwner.current) { - var name = getComponentName(ReactCurrentOwner.current.type); + var name = getComponentNameFromType(ReactCurrentOwner.current.type); if (name) { return "\n\nCheck the render method of `" + name + "`."; } @@ -1515,7 +1495,7 @@ ownerHasKeyUseWarning[currentComponentErrorInfo] = true; var childOwner = ""; if (element && element._owner && element._owner !== ReactCurrentOwner.current) { - childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; + childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + "."; } { setCurrentlyValidatingElement$1(element); @@ -1527,7 +1507,7 @@ if (typeof node !== "object") { return; } - if (Array.isArray(node)) { + if (isArray(node)) { for (var i = 0; i < node.length; i++) { var child = node[i]; if (isValidElement2(child)) { @@ -1570,11 +1550,11 @@ return; } if (propTypes) { - var name = getComponentName(type); + var name = getComponentNameFromType(type); checkPropTypes(propTypes, element.props, "prop", name, element); } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) { propTypesMisspellWarningShown = true; - var _name = getComponentName(type); + 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) { @@ -1617,10 +1597,10 @@ var typeString; if (type === null) { typeString = "null"; - } else if (Array.isArray(type)) { + } else if (isArray(type)) { typeString = "array"; } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) { - typeString = "<" + (getComponentName(type.type) || "Unknown") + " />"; + typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"; info = " Did you accidentally export a JSX literal instead of a component?"; } else { typeString = typeof type; @@ -1638,7 +1618,7 @@ validateChildKeys(arguments[i], type); } } - if (type === exports.Fragment) { + if (type === REACT_FRAGMENT_TYPE) { validateFragmentProps(element); } else { validatePropTypes(element); @@ -1675,12 +1655,194 @@ validatePropTypes(newElement); return newElement; } - { + function startTransition(scope, options) { + var prevTransition = ReactCurrentBatchConfig.transition; + ReactCurrentBatchConfig.transition = {}; + var currentTransition = ReactCurrentBatchConfig.transition; + { + ReactCurrentBatchConfig.transition._updatedFibers = /* @__PURE__ */ new Set(); + } try { - var frozenObject = Object.freeze({}); - /* @__PURE__ */ new Map([[frozenObject, null]]); - /* @__PURE__ */ new Set([frozenObject]); - } catch (e) { + 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 { + var requireString = ("require" + Math.random()).slice(0, 7); + var nodeRequire = module && module[requireString]; + enqueueTaskImpl = nodeRequire.call(module, "timers").setImmediate; + } catch (_err) { + enqueueTaskImpl = function(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(void 0); + }; + } + } + return enqueueTaskImpl(task); + } + var actScopeDepth = 0; + var didWarnNoAwaitAct = false; + function act(callback) { + { + var prevActScopeDepth = actScopeDepth; + actScopeDepth++; + if (ReactCurrentActQueue.current === null) { + ReactCurrentActQueue.current = []; + } + var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy; + var result; + try { + ReactCurrentActQueue.isBatchingLegacy = true; + result = callback(); + if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) { + var queue = ReactCurrentActQueue.current; + if (queue !== null) { + ReactCurrentActQueue.didScheduleLegacyUpdate = false; + flushActQueue(queue); + } + } + } catch (error2) { + popActScope(prevActScopeDepth); + throw error2; + } finally { + ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy; + } + if (result !== null && typeof result === "object" && typeof result.then === "function") { + var thenableResult = result; + var wasAwaited = false; + var thenable = { + then: function(resolve, reject) { + wasAwaited = true; + thenableResult.then(function(returnValue2) { + popActScope(prevActScopeDepth); + if (actScopeDepth === 0) { + recursivelyFlushAsyncActWork(returnValue2, resolve, reject); + } else { + resolve(returnValue2); + } + }, function(error2) { + popActScope(prevActScopeDepth); + reject(error2); + }); + } + }; + { + if (!didWarnNoAwaitAct && typeof Promise !== "undefined") { + 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; + popActScope(prevActScopeDepth); + if (actScopeDepth === 0) { + var _queue = ReactCurrentActQueue.current; + if (_queue !== null) { + flushActQueue(_queue); + ReactCurrentActQueue.current = null; + } + var _thenable = { + then: function(resolve, reject) { + if (ReactCurrentActQueue.current === null) { + ReactCurrentActQueue.current = []; + recursivelyFlushAsyncActWork(returnValue, resolve, reject); + } else { + resolve(returnValue); + } + } + }; + return _thenable; + } else { + var _thenable2 = { + then: function(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) { + ReactCurrentActQueue.current = null; + resolve(returnValue); + } else { + recursivelyFlushAsyncActWork(returnValue, resolve, reject); + } + }); + } catch (error2) { + reject(error2); + } + } else { + resolve(returnValue); + } + } + } + var isFlushing = false; + function flushActQueue(queue) { + { + if (!isFlushing) { + 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 (error2) { + queue = queue.slice(i + 1); + throw error2; + } finally { + isFlushing = false; + } + } } } var createElement$1 = createElementWithValidation; @@ -1695,7 +1857,11 @@ }; exports.Children = Children; exports.Component = Component7; + 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 = createContext2; @@ -1706,17 +1872,27 @@ exports.isValidElement = isValidElement2; exports.lazy = lazy; exports.memo = memo; + exports.startTransition = startTransition; + exports.unstable_act = act; exports.useCallback = useCallback2; exports.useContext = useContext2; exports.useDebugValue = useDebugValue; + exports.useDeferredValue = useDeferredValue; exports.useEffect = useEffect6; + exports.useId = useId; exports.useImperativeHandle = useImperativeHandle; + exports.useInsertionEffect = useInsertionEffect; exports.useLayoutEffect = useLayoutEffect2; exports.useMemo = useMemo4; exports.useReducer = useReducer; exports.useRef = useRef4; exports.useState = useState4; + exports.useSyncExternalStore = useSyncExternalStore; + exports.useTransition = useTransition; exports.version = ReactVersion; + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") { + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); + } })(); } } @@ -1741,170 +1917,38 @@ if (true) { (function() { "use strict"; + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") { + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); + } var enableSchedulerDebugging = false; var enableProfiling = false; - var requestHostCallback; - var requestHostTimeout; - var cancelHostTimeout; - var requestPaint; - var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function"; - if (hasPerformanceNow) { - var localPerformance = performance; - exports.unstable_now = function() { - return localPerformance.now(); - }; - } else { - var localDate = Date; - var initialTime = localDate.now(); - exports.unstable_now = function() { - return localDate.now() - initialTime; - }; - } - if ( - // If Scheduler runs in a non-DOM environment, it falls back to a naive - // implementation using setTimeout. - typeof window === "undefined" || // Check if MessageChannel is supported, too. - typeof MessageChannel !== "function" - ) { - var _callback = null; - var _timeoutID = null; - var _flushCallback = function() { - if (_callback !== null) { - try { - var currentTime = exports.unstable_now(); - var hasRemainingTime = true; - _callback(hasRemainingTime, currentTime); - _callback = null; - } catch (e) { - setTimeout(_flushCallback, 0); - throw e; - } - } - }; - requestHostCallback = function(cb) { - if (_callback !== null) { - setTimeout(requestHostCallback, 0, cb); - } else { - _callback = cb; - setTimeout(_flushCallback, 0); - } - }; - requestHostTimeout = function(cb, ms) { - _timeoutID = setTimeout(cb, ms); - }; - cancelHostTimeout = function() { - clearTimeout(_timeoutID); - }; - exports.unstable_shouldYield = function() { - return false; - }; - requestPaint = exports.unstable_forceFrameRate = function() { - }; - } else { - var _setTimeout = window.setTimeout; - var _clearTimeout = window.clearTimeout; - if (typeof console !== "undefined") { - var requestAnimationFrame = window.requestAnimationFrame; - var cancelAnimationFrame = window.cancelAnimationFrame; - if (typeof requestAnimationFrame !== "function") { - console["error"]("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"); - } - if (typeof cancelAnimationFrame !== "function") { - console["error"]("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"); - } - } - var isMessageLoopRunning = false; - var scheduledHostCallback = null; - var taskTimeoutID = -1; - var yieldInterval = 5; - var deadline = 0; - { - exports.unstable_shouldYield = function() { - return exports.unstable_now() >= deadline; - }; - requestPaint = function() { - }; - } - exports.unstable_forceFrameRate = function(fps) { - if (fps < 0 || fps > 125) { - console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"); - return; - } - if (fps > 0) { - yieldInterval = Math.floor(1e3 / fps); - } else { - yieldInterval = 5; - } - }; - var performWorkUntilDeadline = function() { - if (scheduledHostCallback !== null) { - var currentTime = exports.unstable_now(); - deadline = currentTime + yieldInterval; - var hasTimeRemaining = true; - try { - var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); - if (!hasMoreWork) { - isMessageLoopRunning = false; - scheduledHostCallback = null; - } else { - port.postMessage(null); - } - } catch (error) { - port.postMessage(null); - throw error; - } - } else { - isMessageLoopRunning = false; - } - }; - var channel = new MessageChannel(); - var port = channel.port2; - channel.port1.onmessage = performWorkUntilDeadline; - requestHostCallback = function(callback) { - scheduledHostCallback = callback; - if (!isMessageLoopRunning) { - isMessageLoopRunning = true; - port.postMessage(null); - } - }; - requestHostTimeout = function(callback, ms) { - taskTimeoutID = _setTimeout(function() { - callback(exports.unstable_now()); - }, ms); - }; - cancelHostTimeout = function() { - _clearTimeout(taskTimeoutID); - taskTimeoutID = -1; - }; - } + var frameYieldMs = 5; function push(heap, node) { var index = heap.length; heap.push(node); siftUp(heap, node, index); } function peek(heap) { - var first = heap[0]; - return first === void 0 ? null : first; + return heap.length === 0 ? null : heap[0]; } function pop(heap) { - var first = heap[0]; - if (first !== void 0) { - var last = heap.pop(); - if (last !== first) { - heap[0] = last; - siftDown(heap, last, 0); - } - return first; - } else { + 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 (true) { + while (index > 0) { var parentIndex = index - 1 >>> 1; var parent = heap[parentIndex]; - if (parent !== void 0 && compare(parent, node) > 0) { + if (compare(parent, node) > 0) { heap[parentIndex] = node; heap[index] = parent; index = parentIndex; @@ -1916,13 +1960,14 @@ function siftDown(heap, node, i) { var index = i; var length = heap.length; - while (index < length) { + var halfLength = length >>> 1; + while (index < halfLength) { var leftIndex = (index + 1) * 2 - 1; var left2 = heap[leftIndex]; var rightIndex = leftIndex + 1; var right2 = heap[rightIndex]; - if (left2 !== void 0 && compare(left2, node) < 0) { - if (right2 !== void 0 && compare(right2, left2) < 0) { + if (compare(left2, node) < 0) { + if (rightIndex < length && compare(right2, left2) < 0) { heap[index] = right2; heap[rightIndex] = node; index = rightIndex; @@ -1931,7 +1976,7 @@ heap[leftIndex] = node; index = leftIndex; } - } else if (right2 !== void 0 && compare(right2, node) < 0) { + } else if (rightIndex < length && compare(right2, node) < 0) { heap[index] = right2; heap[rightIndex] = node; index = rightIndex; @@ -1951,13 +1996,26 @@ var IdlePriority = 5; function markTaskErrored(task, ms) { } - var maxSigned31BitInt = 1073741823; - var IMMEDIATE_PRIORITY_TIMEOUT = -1; - var USER_BLOCKING_PRIORITY_TIMEOUT = 250; - var NORMAL_PRIORITY_TIMEOUT = 5e3; - var LOW_PRIORITY_TIMEOUT = 1e4; - var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; - var taskQueue = []; + var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function"; + if (hasPerformanceNow) { + var localPerformance = performance; + exports.unstable_now = function() { + return localPerformance.now(); + }; + } else { + var localDate = Date; + var initialTime = localDate.now(); + exports.unstable_now = function() { + return localDate.now() - initialTime; + }; + } + var maxSigned31BitInt = 1073741823; + var IMMEDIATE_PRIORITY_TIMEOUT = -1; + var USER_BLOCKING_PRIORITY_TIMEOUT = 250; + var NORMAL_PRIORITY_TIMEOUT = 5e3; + var LOW_PRIORITY_TIMEOUT = 1e4; + var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; + var taskQueue = []; var timerQueue = []; var taskIdCounter = 1; var currentTask = null; @@ -1965,6 +2023,10 @@ var isPerformingWork = false; var isHostCallbackScheduled = false; var isHostTimeoutScheduled = false; + var localSetTimeout = typeof setTimeout === "function" ? setTimeout : null; + var localClearTimeout = typeof clearTimeout === "function" ? clearTimeout : null; + var localSetImmediate = typeof setImmediate !== "undefined" ? setImmediate : null; + var isInputPending = typeof navigator !== "undefined" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null; function advanceTimers(currentTime) { var timer = peek(timerQueue); while (timer !== null) { @@ -2029,7 +2091,7 @@ advanceTimers(currentTime); currentTask = peek(taskQueue); while (currentTask !== null && !enableSchedulerDebugging) { - if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || exports.unstable_shouldYield())) { + if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) { break; } var callback = currentTask.callback; @@ -2115,16 +2177,16 @@ } function unstable_scheduleCallback(priorityLevel, callback, options) { var currentTime = exports.unstable_now(); - var startTime; + var startTime2; if (typeof options === "object" && options !== null) { var delay3 = options.delay; if (typeof delay3 === "number" && delay3 > 0) { - startTime = currentTime + delay3; + startTime2 = currentTime + delay3; } else { - startTime = currentTime; + startTime2 = currentTime; } } else { - startTime = currentTime; + startTime2 = currentTime; } var timeout; switch (priorityLevel) { @@ -2145,17 +2207,17 @@ timeout = NORMAL_PRIORITY_TIMEOUT; break; } - var expirationTime = startTime + timeout; + var expirationTime = startTime2 + timeout; var newTask = { id: taskIdCounter++, callback, priorityLevel, - startTime, + startTime: startTime2, expirationTime, sortIndex: -1 }; - if (startTime > currentTime) { - newTask.sortIndex = startTime; + if (startTime2 > currentTime) { + newTask.sortIndex = startTime2; push(timerQueue, newTask); if (peek(taskQueue) === null && newTask === peek(timerQueue)) { if (isHostTimeoutScheduled) { @@ -2163,7 +2225,7 @@ } else { isHostTimeoutScheduled = true; } - requestHostTimeout(handleTimeout, startTime - currentTime); + requestHostTimeout(handleTimeout, startTime2 - currentTime); } } else { newTask.sortIndex = expirationTime; @@ -2192,6 +2254,84 @@ function unstable_getCurrentPriorityLevel() { return currentPriorityLevel; } + var isMessageLoopRunning = false; + var scheduledHostCallback = null; + var taskTimeoutID = -1; + var frameInterval = frameYieldMs; + var startTime = -1; + function shouldYieldToHost() { + var timeElapsed = exports.unstable_now() - startTime; + if (timeElapsed < frameInterval) { + return false; + } + return true; + } + function requestPaint() { + } + function forceFrameRate(fps) { + if (fps < 0 || fps > 125) { + console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"); + return; + } + if (fps > 0) { + frameInterval = Math.floor(1e3 / fps); + } else { + frameInterval = frameYieldMs; + } + } + var performWorkUntilDeadline = function() { + if (scheduledHostCallback !== null) { + var currentTime = exports.unstable_now(); + startTime = currentTime; + var hasTimeRemaining = true; + var hasMoreWork = true; + try { + hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); + } finally { + if (hasMoreWork) { + schedulePerformWorkUntilDeadline(); + } else { + isMessageLoopRunning = false; + scheduledHostCallback = null; + } + } + } else { + isMessageLoopRunning = false; + } + }; + var schedulePerformWorkUntilDeadline; + if (typeof localSetImmediate === "function") { + schedulePerformWorkUntilDeadline = function() { + localSetImmediate(performWorkUntilDeadline); + }; + } else if (typeof MessageChannel !== "undefined") { + var channel = new MessageChannel(); + var port = channel.port2; + channel.port1.onmessage = performWorkUntilDeadline; + schedulePerformWorkUntilDeadline = function() { + port.postMessage(null); + }; + } else { + schedulePerformWorkUntilDeadline = function() { + localSetTimeout(performWorkUntilDeadline, 0); + }; + } + function requestHostCallback(callback) { + scheduledHostCallback = callback; + if (!isMessageLoopRunning) { + isMessageLoopRunning = true; + schedulePerformWorkUntilDeadline(); + } + } + function requestHostTimeout(callback, ms) { + taskTimeoutID = localSetTimeout(function() { + callback(exports.unstable_now()); + }, ms); + } + function cancelHostTimeout() { + localClearTimeout(taskTimeoutID); + taskTimeoutID = -1; + } var unstable_requestPaint = requestPaint; var unstable_Profiling = null; exports.unstable_IdlePriority = IdlePriority; @@ -2202,6 +2342,7 @@ exports.unstable_UserBlockingPriority = UserBlockingPriority; exports.unstable_cancelCallback = unstable_cancelCallback; exports.unstable_continueExecution = unstable_continueExecution; + exports.unstable_forceFrameRate = forceFrameRate; exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel; exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode; exports.unstable_next = unstable_next; @@ -2209,7 +2350,11 @@ exports.unstable_requestPaint = unstable_requestPaint; exports.unstable_runWithPriority = unstable_runWithPriority; exports.unstable_scheduleCallback = unstable_scheduleCallback; + exports.unstable_shouldYield = shouldYieldToHost; exports.unstable_wrapCallback = unstable_wrapCallback; + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") { + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); + } })(); } } @@ -2227,300 +2372,6 @@ } }); - // node_modules/scheduler/cjs/scheduler-tracing.development.js - var require_scheduler_tracing_development = __commonJS({ - "node_modules/scheduler/cjs/scheduler-tracing.development.js"(exports) { - "use strict"; - if (true) { - (function() { - "use strict"; - var DEFAULT_THREAD_ID = 0; - var interactionIDCounter = 0; - var threadIDCounter = 0; - exports.__interactionsRef = null; - exports.__subscriberRef = null; - { - exports.__interactionsRef = { - current: /* @__PURE__ */ new Set() - }; - exports.__subscriberRef = { - current: null - }; - } - function unstable_clear(callback) { - var prevInteractions = exports.__interactionsRef.current; - exports.__interactionsRef.current = /* @__PURE__ */ new Set(); - try { - return callback(); - } finally { - exports.__interactionsRef.current = prevInteractions; - } - } - function unstable_getCurrent() { - { - return exports.__interactionsRef.current; - } - } - function unstable_getThreadID() { - return ++threadIDCounter; - } - function unstable_trace(name, timestamp, callback) { - var threadID = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : DEFAULT_THREAD_ID; - var interaction = { - __count: 1, - id: interactionIDCounter++, - name, - timestamp - }; - var prevInteractions = exports.__interactionsRef.current; - var interactions = new Set(prevInteractions); - interactions.add(interaction); - exports.__interactionsRef.current = interactions; - var subscriber = exports.__subscriberRef.current; - var returnValue; - try { - if (subscriber !== null) { - subscriber.onInteractionTraced(interaction); - } - } finally { - try { - if (subscriber !== null) { - subscriber.onWorkStarted(interactions, threadID); - } - } finally { - try { - returnValue = callback(); - } finally { - exports.__interactionsRef.current = prevInteractions; - try { - if (subscriber !== null) { - subscriber.onWorkStopped(interactions, threadID); - } - } finally { - interaction.__count--; - if (subscriber !== null && interaction.__count === 0) { - subscriber.onInteractionScheduledWorkCompleted(interaction); - } - } - } - } - } - return returnValue; - } - function unstable_wrap(callback) { - var threadID = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : DEFAULT_THREAD_ID; - var wrappedInteractions = exports.__interactionsRef.current; - var subscriber = exports.__subscriberRef.current; - if (subscriber !== null) { - subscriber.onWorkScheduled(wrappedInteractions, threadID); - } - wrappedInteractions.forEach(function(interaction) { - interaction.__count++; - }); - var hasRun = false; - function wrapped() { - var prevInteractions = exports.__interactionsRef.current; - exports.__interactionsRef.current = wrappedInteractions; - subscriber = exports.__subscriberRef.current; - try { - var returnValue; - try { - if (subscriber !== null) { - subscriber.onWorkStarted(wrappedInteractions, threadID); - } - } finally { - try { - returnValue = callback.apply(void 0, arguments); - } finally { - exports.__interactionsRef.current = prevInteractions; - if (subscriber !== null) { - subscriber.onWorkStopped(wrappedInteractions, threadID); - } - } - } - return returnValue; - } finally { - if (!hasRun) { - hasRun = true; - wrappedInteractions.forEach(function(interaction) { - interaction.__count--; - if (subscriber !== null && interaction.__count === 0) { - subscriber.onInteractionScheduledWorkCompleted(interaction); - } - }); - } - } - } - wrapped.cancel = function cancel() { - subscriber = exports.__subscriberRef.current; - try { - if (subscriber !== null) { - subscriber.onWorkCanceled(wrappedInteractions, threadID); - } - } finally { - wrappedInteractions.forEach(function(interaction) { - interaction.__count--; - if (subscriber && interaction.__count === 0) { - subscriber.onInteractionScheduledWorkCompleted(interaction); - } - }); - } - }; - return wrapped; - } - var subscribers = null; - { - subscribers = /* @__PURE__ */ new Set(); - } - function unstable_subscribe(subscriber) { - { - subscribers.add(subscriber); - if (subscribers.size === 1) { - exports.__subscriberRef.current = { - onInteractionScheduledWorkCompleted, - onInteractionTraced, - onWorkCanceled, - onWorkScheduled, - onWorkStarted, - onWorkStopped - }; - } - } - } - function unstable_unsubscribe(subscriber) { - { - subscribers.delete(subscriber); - if (subscribers.size === 0) { - exports.__subscriberRef.current = null; - } - } - } - function onInteractionTraced(interaction) { - var didCatchError = false; - var caughtError = null; - subscribers.forEach(function(subscriber) { - try { - subscriber.onInteractionTraced(interaction); - } catch (error) { - if (!didCatchError) { - didCatchError = true; - caughtError = error; - } - } - }); - if (didCatchError) { - throw caughtError; - } - } - function onInteractionScheduledWorkCompleted(interaction) { - var didCatchError = false; - var caughtError = null; - subscribers.forEach(function(subscriber) { - try { - subscriber.onInteractionScheduledWorkCompleted(interaction); - } catch (error) { - if (!didCatchError) { - didCatchError = true; - caughtError = error; - } - } - }); - if (didCatchError) { - throw caughtError; - } - } - function onWorkScheduled(interactions, threadID) { - var didCatchError = false; - var caughtError = null; - subscribers.forEach(function(subscriber) { - try { - subscriber.onWorkScheduled(interactions, threadID); - } catch (error) { - if (!didCatchError) { - didCatchError = true; - caughtError = error; - } - } - }); - if (didCatchError) { - throw caughtError; - } - } - function onWorkStarted(interactions, threadID) { - var didCatchError = false; - var caughtError = null; - subscribers.forEach(function(subscriber) { - try { - subscriber.onWorkStarted(interactions, threadID); - } catch (error) { - if (!didCatchError) { - didCatchError = true; - caughtError = error; - } - } - }); - if (didCatchError) { - throw caughtError; - } - } - function onWorkStopped(interactions, threadID) { - var didCatchError = false; - var caughtError = null; - subscribers.forEach(function(subscriber) { - try { - subscriber.onWorkStopped(interactions, threadID); - } catch (error) { - if (!didCatchError) { - didCatchError = true; - caughtError = error; - } - } - }); - if (didCatchError) { - throw caughtError; - } - } - function onWorkCanceled(interactions, threadID) { - var didCatchError = false; - var caughtError = null; - subscribers.forEach(function(subscriber) { - try { - subscriber.onWorkCanceled(interactions, threadID); - } catch (error) { - if (!didCatchError) { - didCatchError = true; - caughtError = error; - } - } - }); - if (didCatchError) { - throw caughtError; - } - } - exports.unstable_clear = unstable_clear; - exports.unstable_getCurrent = unstable_getCurrent; - exports.unstable_getThreadID = unstable_getThreadID; - exports.unstable_subscribe = unstable_subscribe; - exports.unstable_trace = unstable_trace; - exports.unstable_unsubscribe = unstable_unsubscribe; - exports.unstable_wrap = unstable_wrap; - })(); - } - } - }); - - // node_modules/scheduler/tracing.js - var require_tracing = __commonJS({ - "node_modules/scheduler/tracing.js"(exports, module) { - "use strict"; - if (false) { - module.exports = null; - } else { - module.exports = require_scheduler_tracing_development(); - } - } - }); - // node_modules/react-dom/cjs/react-dom.development.js var require_react_dom_development = __commonJS({ "node_modules/react-dom/cjs/react-dom.development.js"(exports) { @@ -2528,25 +2379,36 @@ if (true) { (function() { "use strict"; + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") { + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); + } var React25 = require_react(); - var _assign = require_object_assign(); var Scheduler = require_scheduler(); - var tracing = require_tracing(); var ReactSharedInternals = React25.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + var suppressWarning = false; + function setSuppressWarning(newSuppressWarning) { + { + suppressWarning = newSuppressWarning; + } + } function warn(format2) { { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; + if (!suppressWarning) { + 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", format2, args); } - printWarning("warn", format2, args); } } function error(format2) { { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; + if (!suppressWarning) { + 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", format2, args); } - printWarning("error", format2, args); } } function printWarning(level, format2, args) { @@ -2558,17 +2420,12 @@ args = args.concat([stack]); } var argsWithFormat = args.map(function(item) { - return "" + item; + return String(item); }); argsWithFormat.unshift("Warning: " + format2); Function.prototype.apply.call(console[level], console, argsWithFormat); } } - if (!React25) { - { - throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM."); - } - } var FunctionComponent = 0; var ClassComponent = 1; var IndeterminateComponent = 2; @@ -2589,15 +2446,22 @@ var IncompleteClassComponent = 17; var DehydratedFragment = 18; var SuspenseListComponent = 19; - var FundamentalComponent = 20; var ScopeComponent = 21; - var Block = 22; - var OffscreenComponent = 23; - var LegacyHiddenComponent = 24; - var enableProfilerTimer = true; - var enableFundamentalAPI = false; + var OffscreenComponent = 22; + var LegacyHiddenComponent = 23; + var CacheComponent = 24; + var TracingMarkerComponent = 25; + var enableClientRenderFallbackOnTextMismatch = true; var enableNewReconciler = false; + var enableLazyContextPropagation = false; + var enableLegacyHidden = false; + var enableSuspenseAvoidThisFallback = false; + var disableCommentsAsDOMContainers = true; + var enableCustomElementPropertySupport = false; var warnAboutStringRefs = false; + var enableSchedulingProfiler = true; + var enableProfilerTimer = true; + var enableProfilerCommitHooks = true; var allNativeEvents = /* @__PURE__ */ new Set(); var registrationNameDependencies = {}; var possibleRegistrationNames = {}; @@ -2624,6 +2488,75 @@ } } var canUseDOM2 = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); + var hasOwnProperty = Object.prototype.hasOwnProperty; + function typeName(value) { + { + var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; + var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; + return type; + } + } + function willCoercionThrow(value) { + { + try { + testStringCoercion(value); + return false; + } catch (e) { + return true; + } + } + } + function testStringCoercion(value) { + return "" + value; + } + function checkAttributeStringCoercion(value, attributeName) { + { + if (willCoercionThrow(value)) { + error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", attributeName, typeName(value)); + return testStringCoercion(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); + } + } + } + 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); + } + } + } + function checkCSSPropertyStringCoercion(value, propName) { + { + if (willCoercionThrow(value)) { + error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value)); + return testStringCoercion(value); + } + } + } + function checkHtmlStringCoercion(value) { + { + if (willCoercionThrow(value)) { + error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); + return testStringCoercion(value); + } + } + } + function checkFormFieldValueStringCoercion(value) { + { + if (willCoercionThrow(value)) { + error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.", typeName(value)); + return testStringCoercion(value); + } + } + } var RESERVED = 0; var STRING = 1; var BOOLEANISH_STRING = 2; @@ -2633,9 +2566,7 @@ var POSITIVE_NUMERIC = 6; var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var ROOT_ATTRIBUTE_NAME = "data-reactroot"; var VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$"); - var hasOwnProperty = Object.prototype.hasOwnProperty; var illegalAttributeNameCache = {}; var validatedAttributeNameCache = {}; function isAttributeNameSafe(attributeName) { @@ -3127,6 +3058,9 @@ var propertyName = propertyInfo.propertyName; return node[propertyName]; } else { + { + checkAttributeStringCoercion(expected, name); + } if (propertyInfo.sanitizeURL) { sanitizeURL("" + expected); } @@ -3165,18 +3099,18 @@ } } } - function getValueForAttribute(node, name, expected) { + function getValueForAttribute(node, name, expected, isCustomComponentTag) { { if (!isAttributeNameSafe(name)) { return; } - if (isOpaqueHydratingObject(expected)) { - return expected; - } if (!node.hasAttribute(name)) { return expected === void 0 ? void 0 : null; } var value = node.getAttribute(name); + { + checkAttributeStringCoercion(expected, name); + } if (value === "" + expected) { return expected; } @@ -3197,6 +3131,9 @@ if (value === null) { node.removeAttribute(_attributeName); } else { + { + checkAttributeStringCoercion(value, name); + } node.setAttribute(_attributeName, "" + value); } } @@ -3223,6 +3160,9 @@ attributeValue = ""; } else { { + { + checkAttributeStringCoercion(value, attributeName); + } attributeValue = "" + value; } if (propertyInfo.sanitizeURL) { @@ -3236,50 +3176,25 @@ } } } - var REACT_ELEMENT_TYPE = 60103; - var REACT_PORTAL_TYPE = 60106; - var REACT_FRAGMENT_TYPE = 60107; - var REACT_STRICT_MODE_TYPE = 60108; - var REACT_PROFILER_TYPE = 60114; - var REACT_PROVIDER_TYPE = 60109; - var REACT_CONTEXT_TYPE = 60110; - var REACT_FORWARD_REF_TYPE = 60112; - var REACT_SUSPENSE_TYPE = 60113; - var REACT_SUSPENSE_LIST_TYPE = 60120; - var REACT_MEMO_TYPE = 60115; - var REACT_LAZY_TYPE = 60116; - var REACT_BLOCK_TYPE = 60121; - var REACT_SERVER_BLOCK_TYPE = 60122; - var REACT_FUNDAMENTAL_TYPE = 60117; - var REACT_SCOPE_TYPE = 60119; - var REACT_OPAQUE_ID_TYPE = 60128; - var REACT_DEBUG_TRACING_MODE_TYPE = 60129; - var REACT_OFFSCREEN_TYPE = 60130; - var REACT_LEGACY_HIDDEN_TYPE = 60131; - 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"); - } - var MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; + 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") { @@ -3291,6 +3206,7 @@ } return null; } + var assign = Object.assign; var disabledDepth = 0; var prevLog; var prevInfo; @@ -3341,25 +3257,25 @@ writable: true }; Object.defineProperties(console, { - log: _assign({}, props, { + log: assign({}, props, { value: prevLog }), - info: _assign({}, props, { + info: assign({}, props, { value: prevInfo }), - warn: _assign({}, props, { + warn: assign({}, props, { value: prevWarn }), - error: _assign({}, props, { + error: assign({}, props, { value: prevError }), - group: _assign({}, props, { + group: assign({}, props, { value: prevGroup }), - groupCollapsed: _assign({}, props, { + groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), - groupEnd: _assign({}, props, { + groupEnd: assign({}, props, { value: prevGroupEnd }) }); @@ -3460,6 +3376,9 @@ c--; if (c < 0 || sampleLines[s] !== controlLines[c]) { var _frame = "\n" + sampleLines[s].replace(" at new ", " at "); + if (fn.displayName && _frame.includes("")) { + _frame = _frame.replace("", fn.displayName); + } { if (typeof fn === "function") { componentFrameCache.set(fn, _frame); @@ -3528,8 +3447,6 @@ return describeFunctionComponentFrame(type.render); case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); - case REACT_BLOCK_TYPE: - return describeFunctionComponentFrame(type._render); case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; @@ -3561,8 +3478,6 @@ return describeFunctionComponentFrame(fiber.type); case ForwardRef: return describeFunctionComponentFrame(fiber.type.render); - case Block: - return describeFunctionComponentFrame(fiber.type._render); case ClassComponent: return describeClassComponentFrame(fiber.type); default: @@ -3583,19 +3498,23 @@ } } function getWrappedName(outerType, innerType, wrapperName) { + var displayName = outerType.displayName; + if (displayName) { + return displayName; + } var functionName = innerType.displayName || innerType.name || ""; - return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName); + return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; } function getContextName(type) { return type.displayName || "Context"; } - function getComponentName(type) { + function getComponentNameFromType(type) { if (type == null) { return null; } { if (typeof type.tag === "number") { - error("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."); + error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."); } } if (typeof type === "function") { @@ -3629,15 +3548,17 @@ case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, "ForwardRef"); case REACT_MEMO_TYPE: - return getComponentName(type.type); - case REACT_BLOCK_TYPE: - return getComponentName(type._render); + 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 getComponentName(init(payload)); + return getComponentNameFromType(init(payload)); } catch (x) { return null; } @@ -3646,23 +3567,90 @@ } return null; } - var ReactDebugCurrentFrame = 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 getComponentName(owner.type); - } - } - return null; + function getWrappedName$1(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ""; + return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName); } - function getCurrentFiberStackInDev() { - { + 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 Fragment4: + return "Fragment"; + case HostComponent: + return type; + case HostPortal: + return "Portal"; + case HostRoot: + return "Root"; + case HostText: + return "Text"; + case LazyComponent: + return getComponentNameFromType(type); + case Mode: + if (type === REACT_STRICT_MODE_TYPE) { + 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"; + 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; + } + var ReactDebugCurrentFrame = 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 ""; } @@ -3678,19 +3666,19 @@ } function setCurrentFiber(fiber) { { - ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev; + ReactDebugCurrentFrame.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev; current = fiber; isRendering = false; } } - function setIsRendering(rendering) { + function getCurrentFiber() { { - isRendering = rendering; + return current; } } - function getIsRendering() { + function setIsRendering(rendering) { { - return isRendering; + isRendering = rendering; } } function toString(value) { @@ -3700,10 +3688,14 @@ switch (typeof value) { case "boolean": case "number": - case "object": case "string": case "undefined": return value; + case "object": + { + checkFormFieldValueStringCoercion(value); + } + return value; default: return ""; } @@ -3753,6 +3745,9 @@ function trackValueOnNode(node) { var valueField = isCheckable(node) ? "checked" : "value"; var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); + { + checkFormFieldValueStringCoercion(node[valueField]); + } var currentValue = "" + node[valueField]; if (node.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") { return; @@ -3764,6 +3759,9 @@ return get2.call(this); }, set: function(value) { + { + checkFormFieldValueStringCoercion(value); + } currentValue = "" + value; set2.call(this, value); } @@ -3776,6 +3774,9 @@ return currentValue; }, setValue: function(value) { + { + checkFormFieldValueStringCoercion(value); + } currentValue = "" + value; }, stopTracking: function() { @@ -3829,7 +3830,7 @@ function getHostProps(element, props) { var node = element; var checked = props.checked; - var hostProps = _assign({}, props, { + var hostProps = assign({}, props, { defaultChecked: void 0, defaultValue: void 0, value: void 0, @@ -3951,6 +3952,9 @@ while (queryRoot.parentNode) { queryRoot = queryRoot.parentNode; } + { + checkAttributeStringCoercion(name, "name"); + } var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name) + '][type="radio"]'); for (var i = 0; i < group.length; i++) { var otherNode = group[i]; @@ -3959,9 +3963,7 @@ } var otherProps = getFiberCurrentPropsFromNode(otherNode); if (!otherProps) { - { - throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."); - } + throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."); } updateValueIfChanged(otherNode); updateWrapper(otherNode, otherProps); @@ -3982,34 +3984,29 @@ } var didWarnSelectedSetOnOption = false; var didWarnInvalidChild = false; - function flattenChildren(children) { - var content = ""; - React25.Children.forEach(children, function(child) { - if (child == null) { - return; - } - content += child; - }); - return content; - } + var didWarnInvalidInnerHTML = false; function validateProps(element, props) { { - if (typeof props.children === "object" && props.children !== null) { - React25.Children.forEach(props.children, function(child) { - if (child == null) { - return; - } - if (typeof child === "string" || typeof child === "number") { - return; - } - if (typeof child.type !== "string") { - return; - } - if (!didWarnInvalidChild) { - didWarnInvalidChild = true; - error("Only strings and numbers are supported as