39993 lines
1.7 MiB
Plaintext
Executable File
39993 lines
1.7 MiB
Plaintext
Executable File
/*
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
if you want to view the source, please visit the github repository of this plugin
|
|
*/
|
|
|
|
var __create = Object.create;
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __getProtoOf = Object.getPrototypeOf;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var __restKey = (key) => typeof key === "symbol" ? key : key + "";
|
|
var __objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && __getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var __commonJS = (cb, mod) => function __require() {
|
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
};
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps = (to, from2, except, desc) => {
|
|
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
|
|
for (let key of __getOwnPropNames(from2))
|
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
__defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
// file that has been converted to a CommonJS file using a Babel-
|
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
mod
|
|
));
|
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
// node_modules/react/cjs/react.development.js
|
|
var require_react_development = __commonJS({
|
|
"node_modules/react/cjs/react.development.js"(exports, module2) {
|
|
"use strict";
|
|
(function() {
|
|
function defineDeprecationWarning(methodName, info) {
|
|
Object.defineProperty(Component.prototype, methodName, {
|
|
get: function() {
|
|
console.warn(
|
|
"%s(...) is deprecated in plain JavaScript React classes. %s",
|
|
info[0],
|
|
info[1]
|
|
);
|
|
}
|
|
});
|
|
}
|
|
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 warnNoop(publicInstance, callerName) {
|
|
publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
|
|
var warningKey = publicInstance + "." + callerName;
|
|
didWarnStateUpdateForUnmountedComponent[warningKey] || (console.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,
|
|
publicInstance
|
|
), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
|
|
}
|
|
function Component(props, context, updater) {
|
|
this.props = props;
|
|
this.context = context;
|
|
this.refs = emptyObject;
|
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
}
|
|
function ComponentDummy() {
|
|
}
|
|
function PureComponent(props, context, updater) {
|
|
this.props = props;
|
|
this.context = context;
|
|
this.refs = emptyObject;
|
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
}
|
|
function noop3() {
|
|
}
|
|
function testStringCoercion(value) {
|
|
return "" + value;
|
|
}
|
|
function checkKeyStringCoercion(value) {
|
|
try {
|
|
testStringCoercion(value);
|
|
var JSCompiler_inline_result = false;
|
|
} catch (e) {
|
|
JSCompiler_inline_result = true;
|
|
}
|
|
if (JSCompiler_inline_result) {
|
|
JSCompiler_inline_result = console;
|
|
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
JSCompiler_temp_const.call(
|
|
JSCompiler_inline_result,
|
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
JSCompiler_inline_result$jscomp$0
|
|
);
|
|
return testStringCoercion(value);
|
|
}
|
|
}
|
|
function getComponentNameFromType(type) {
|
|
if (null == type) return null;
|
|
if ("function" === typeof type)
|
|
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
if ("string" === typeof type) return type;
|
|
switch (type) {
|
|
case REACT_FRAGMENT_TYPE:
|
|
return "Fragment";
|
|
case REACT_PROFILER_TYPE:
|
|
return "Profiler";
|
|
case REACT_STRICT_MODE_TYPE:
|
|
return "StrictMode";
|
|
case REACT_SUSPENSE_TYPE:
|
|
return "Suspense";
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return "SuspenseList";
|
|
case REACT_ACTIVITY_TYPE:
|
|
return "Activity";
|
|
}
|
|
if ("object" === typeof type)
|
|
switch ("number" === typeof type.tag && console.error(
|
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
), type.$$typeof) {
|
|
case REACT_PORTAL_TYPE:
|
|
return "Portal";
|
|
case REACT_CONTEXT_TYPE:
|
|
return type.displayName || "Context";
|
|
case REACT_CONSUMER_TYPE:
|
|
return (type._context.displayName || "Context") + ".Consumer";
|
|
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 getTaskName(type) {
|
|
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
|
return "<...>";
|
|
try {
|
|
var name = getComponentNameFromType(type);
|
|
return name ? "<" + name + ">" : "<...>";
|
|
} catch (x) {
|
|
return "<...>";
|
|
}
|
|
}
|
|
function getOwner() {
|
|
var dispatcher = ReactSharedInternals.A;
|
|
return null === dispatcher ? null : dispatcher.getOwner();
|
|
}
|
|
function UnknownOwner() {
|
|
return Error("react-stack-top-frame");
|
|
}
|
|
function hasValidKey(config) {
|
|
if (hasOwnProperty.call(config, "key")) {
|
|
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
if (getter && getter.isReactWarning) return false;
|
|
}
|
|
return void 0 !== config.key;
|
|
}
|
|
function defineKeyPropWarningGetter(props, displayName) {
|
|
function warnAboutAccessingKey() {
|
|
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.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://react.dev/link/special-props)",
|
|
displayName
|
|
));
|
|
}
|
|
warnAboutAccessingKey.isReactWarning = true;
|
|
Object.defineProperty(props, "key", {
|
|
get: warnAboutAccessingKey,
|
|
configurable: true
|
|
});
|
|
}
|
|
function elementRefGetterWithDeprecationWarning() {
|
|
var componentName = getComponentNameFromType(this.type);
|
|
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
));
|
|
componentName = this.props.ref;
|
|
return void 0 !== componentName ? componentName : null;
|
|
}
|
|
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
var refProp = props.ref;
|
|
type = {
|
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
type,
|
|
key,
|
|
props,
|
|
_owner: owner
|
|
};
|
|
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
|
enumerable: false,
|
|
get: elementRefGetterWithDeprecationWarning
|
|
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
type._store = {};
|
|
Object.defineProperty(type._store, "validated", {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: true,
|
|
value: 0
|
|
});
|
|
Object.defineProperty(type, "_debugInfo", {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: true,
|
|
value: null
|
|
});
|
|
Object.defineProperty(type, "_debugStack", {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: true,
|
|
value: debugStack
|
|
});
|
|
Object.defineProperty(type, "_debugTask", {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: true,
|
|
value: debugTask
|
|
});
|
|
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
return type;
|
|
}
|
|
function cloneAndReplaceKey(oldElement, newKey) {
|
|
newKey = ReactElement(
|
|
oldElement.type,
|
|
newKey,
|
|
oldElement.props,
|
|
oldElement._owner,
|
|
oldElement._debugStack,
|
|
oldElement._debugTask
|
|
);
|
|
oldElement._store && (newKey._store.validated = oldElement._store.validated);
|
|
return newKey;
|
|
}
|
|
function validateChildKeys(node2) {
|
|
isValidElement5(node2) ? node2._store && (node2._store.validated = 1) : "object" === typeof node2 && null !== node2 && node2.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node2._payload.status ? isValidElement5(node2._payload.value) && node2._payload.value._store && (node2._payload.value._store.validated = 1) : node2._store && (node2._store.validated = 1));
|
|
}
|
|
function isValidElement5(object) {
|
|
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
}
|
|
function escape(key) {
|
|
var escaperLookup = { "=": "=0", ":": "=2" };
|
|
return "$" + key.replace(/[=:]/g, function(match2) {
|
|
return escaperLookup[match2];
|
|
});
|
|
}
|
|
function getElementKey(element, index) {
|
|
return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
|
|
}
|
|
function resolveThenable(thenable) {
|
|
switch (thenable.status) {
|
|
case "fulfilled":
|
|
return thenable.value;
|
|
case "rejected":
|
|
throw thenable.reason;
|
|
default:
|
|
switch ("string" === typeof thenable.status ? thenable.then(noop3, noop3) : (thenable.status = "pending", thenable.then(
|
|
function(fulfilledValue) {
|
|
"pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
|
},
|
|
function(error) {
|
|
"pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
|
}
|
|
)), thenable.status) {
|
|
case "fulfilled":
|
|
return thenable.value;
|
|
case "rejected":
|
|
throw thenable.reason;
|
|
}
|
|
}
|
|
throw thenable;
|
|
}
|
|
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
var type = typeof children;
|
|
if ("undefined" === type || "boolean" === type) children = null;
|
|
var invokeCallback = false;
|
|
if (null === children) invokeCallback = true;
|
|
else
|
|
switch (type) {
|
|
case "bigint":
|
|
case "string":
|
|
case "number":
|
|
invokeCallback = true;
|
|
break;
|
|
case "object":
|
|
switch (children.$$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
case REACT_PORTAL_TYPE:
|
|
invokeCallback = true;
|
|
break;
|
|
case REACT_LAZY_TYPE:
|
|
return invokeCallback = children._init, mapIntoArray(
|
|
invokeCallback(children._payload),
|
|
array,
|
|
escapedPrefix,
|
|
nameSoFar,
|
|
callback
|
|
);
|
|
}
|
|
}
|
|
if (invokeCallback) {
|
|
invokeCallback = children;
|
|
callback = callback(invokeCallback);
|
|
var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
|
|
isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
|
|
return c;
|
|
})) : null != callback && (isValidElement5(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
|
|
callback,
|
|
escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
|
|
userProvidedKeyEscapeRegex,
|
|
"$&/"
|
|
) + "/") + childKey
|
|
), "" !== nameSoFar && null != invokeCallback && isValidElement5(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
|
|
return 1;
|
|
}
|
|
invokeCallback = 0;
|
|
childKey = "" === nameSoFar ? "." : nameSoFar + ":";
|
|
if (isArrayImpl(children))
|
|
for (var i = 0; i < children.length; i++)
|
|
nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
|
|
nameSoFar,
|
|
array,
|
|
escapedPrefix,
|
|
type,
|
|
callback
|
|
);
|
|
else if (i = getIteratorFn(children), "function" === typeof i)
|
|
for (i === children.entries && (didWarnAboutMaps || console.warn(
|
|
"Using Maps as children is not supported. Use an array of keyed ReactElements instead."
|
|
), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
|
|
nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
|
|
nameSoFar,
|
|
array,
|
|
escapedPrefix,
|
|
type,
|
|
callback
|
|
);
|
|
else if ("object" === type) {
|
|
if ("function" === typeof children.then)
|
|
return mapIntoArray(
|
|
resolveThenable(children),
|
|
array,
|
|
escapedPrefix,
|
|
nameSoFar,
|
|
callback
|
|
);
|
|
array = String(children);
|
|
throw Error(
|
|
"Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
|
|
);
|
|
}
|
|
return invokeCallback;
|
|
}
|
|
function mapChildren(children, func, context) {
|
|
if (null == children) return children;
|
|
var result = [], count = 0;
|
|
mapIntoArray(children, result, "", "", function(child) {
|
|
return func.call(context, child, count++);
|
|
});
|
|
return result;
|
|
}
|
|
function lazyInitializer(payload) {
|
|
if (-1 === payload._status) {
|
|
var ioInfo = payload._ioInfo;
|
|
null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
|
|
ioInfo = payload._result;
|
|
var thenable = ioInfo();
|
|
thenable.then(
|
|
function(moduleObject) {
|
|
if (0 === payload._status || -1 === payload._status) {
|
|
payload._status = 1;
|
|
payload._result = moduleObject;
|
|
var _ioInfo = payload._ioInfo;
|
|
null != _ioInfo && (_ioInfo.end = performance.now());
|
|
void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
|
|
}
|
|
},
|
|
function(error) {
|
|
if (0 === payload._status || -1 === payload._status) {
|
|
payload._status = 2;
|
|
payload._result = error;
|
|
var _ioInfo2 = payload._ioInfo;
|
|
null != _ioInfo2 && (_ioInfo2.end = performance.now());
|
|
void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
|
}
|
|
}
|
|
);
|
|
ioInfo = payload._ioInfo;
|
|
if (null != ioInfo) {
|
|
ioInfo.value = thenable;
|
|
var displayName = thenable.displayName;
|
|
"string" === typeof displayName && (ioInfo.name = displayName);
|
|
}
|
|
-1 === payload._status && (payload._status = 0, payload._result = thenable);
|
|
}
|
|
if (1 === payload._status)
|
|
return ioInfo = payload._result, void 0 === ioInfo && console.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?",
|
|
ioInfo
|
|
), "default" in ioInfo || console.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'))",
|
|
ioInfo
|
|
), ioInfo.default;
|
|
throw payload._result;
|
|
}
|
|
function resolveDispatcher() {
|
|
var dispatcher = ReactSharedInternals.H;
|
|
null === dispatcher && console.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."
|
|
);
|
|
return dispatcher;
|
|
}
|
|
function releaseAsyncTransition() {
|
|
ReactSharedInternals.asyncTransitions--;
|
|
}
|
|
function enqueueTask(task) {
|
|
if (null === enqueueTaskImpl)
|
|
try {
|
|
var requireString = ("require" + Math.random()).slice(0, 7);
|
|
enqueueTaskImpl = (module2 && module2[requireString]).call(
|
|
module2,
|
|
"timers"
|
|
).setImmediate;
|
|
} catch (_err) {
|
|
enqueueTaskImpl = function(callback) {
|
|
false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.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);
|
|
}
|
|
function aggregateErrors(errors) {
|
|
return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
|
|
}
|
|
function popActScope(prevActQueue, prevActScopeDepth) {
|
|
prevActScopeDepth !== actScopeDepth - 1 && console.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 = ReactSharedInternals.actQueue;
|
|
if (null !== queue)
|
|
if (0 !== queue.length)
|
|
try {
|
|
flushActQueue(queue);
|
|
enqueueTask(function() {
|
|
return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
});
|
|
return;
|
|
} catch (error) {
|
|
ReactSharedInternals.thrownErrors.push(error);
|
|
}
|
|
else ReactSharedInternals.actQueue = null;
|
|
0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
|
|
}
|
|
function flushActQueue(queue) {
|
|
if (!isFlushing) {
|
|
isFlushing = true;
|
|
var i = 0;
|
|
try {
|
|
for (; i < queue.length; i++) {
|
|
var callback = queue[i];
|
|
do {
|
|
ReactSharedInternals.didUsePromise = false;
|
|
var continuation = callback(false);
|
|
if (null !== continuation) {
|
|
if (ReactSharedInternals.didUsePromise) {
|
|
queue[i] = callback;
|
|
queue.splice(0, i);
|
|
return;
|
|
}
|
|
callback = continuation;
|
|
} else break;
|
|
} while (1);
|
|
}
|
|
queue.length = 0;
|
|
} catch (error) {
|
|
queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
|
|
} finally {
|
|
isFlushing = false;
|
|
}
|
|
}
|
|
}
|
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
|
|
isMounted: function() {
|
|
return false;
|
|
},
|
|
enqueueForceUpdate: function(publicInstance) {
|
|
warnNoop(publicInstance, "forceUpdate");
|
|
},
|
|
enqueueReplaceState: function(publicInstance) {
|
|
warnNoop(publicInstance, "replaceState");
|
|
},
|
|
enqueueSetState: function(publicInstance) {
|
|
warnNoop(publicInstance, "setState");
|
|
}
|
|
}, assign2 = Object.assign, emptyObject = {};
|
|
Object.freeze(emptyObject);
|
|
Component.prototype.isReactComponent = {};
|
|
Component.prototype.setState = function(partialState, callback) {
|
|
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
|
|
throw Error(
|
|
"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");
|
|
};
|
|
Component.prototype.forceUpdate = function(callback) {
|
|
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
};
|
|
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)."
|
|
]
|
|
};
|
|
for (fnName in deprecatedAPIs)
|
|
deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
ComponentDummy.prototype = Component.prototype;
|
|
deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
|
|
deprecatedAPIs.constructor = PureComponent;
|
|
assign2(deprecatedAPIs, Component.prototype);
|
|
deprecatedAPIs.isPureReactComponent = true;
|
|
var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = {
|
|
H: null,
|
|
A: null,
|
|
T: null,
|
|
S: null,
|
|
actQueue: null,
|
|
asyncTransitions: 0,
|
|
isBatchingLegacy: false,
|
|
didScheduleLegacyUpdate: false,
|
|
didUsePromise: false,
|
|
thrownErrors: [],
|
|
getCurrentStack: null,
|
|
recentlyCreatedOwnerStacks: 0
|
|
}, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
|
|
return null;
|
|
};
|
|
deprecatedAPIs = {
|
|
react_stack_bottom_frame: function(callStackForError) {
|
|
return callStackForError();
|
|
}
|
|
};
|
|
var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
|
|
var didWarnAboutElementRef = {};
|
|
var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
|
|
deprecatedAPIs,
|
|
UnknownOwner
|
|
)();
|
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
|
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
|
var event = new window.ErrorEvent("error", {
|
|
bubbles: true,
|
|
cancelable: true,
|
|
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
|
error
|
|
});
|
|
if (!window.dispatchEvent(event)) return;
|
|
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
|
process.emit("uncaughtException", error);
|
|
return;
|
|
}
|
|
console.error(error);
|
|
}, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
|
|
queueMicrotask(function() {
|
|
return queueMicrotask(callback);
|
|
});
|
|
} : enqueueTask;
|
|
deprecatedAPIs = Object.freeze({
|
|
__proto__: null,
|
|
c: function(size) {
|
|
return resolveDispatcher().useMemoCache(size);
|
|
}
|
|
});
|
|
var fnName = {
|
|
map: mapChildren,
|
|
forEach: function(children, forEachFunc, forEachContext) {
|
|
mapChildren(
|
|
children,
|
|
function() {
|
|
forEachFunc.apply(this, arguments);
|
|
},
|
|
forEachContext
|
|
);
|
|
},
|
|
count: function(children) {
|
|
var n = 0;
|
|
mapChildren(children, function() {
|
|
n++;
|
|
});
|
|
return n;
|
|
},
|
|
toArray: function(children) {
|
|
return mapChildren(children, function(child) {
|
|
return child;
|
|
}) || [];
|
|
},
|
|
only: function(children) {
|
|
if (!isValidElement5(children))
|
|
throw Error(
|
|
"React.Children.only expected to receive a single React element child."
|
|
);
|
|
return children;
|
|
}
|
|
};
|
|
exports.Activity = REACT_ACTIVITY_TYPE;
|
|
exports.Children = fnName;
|
|
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.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
|
exports.__COMPILER_RUNTIME = deprecatedAPIs;
|
|
exports.act = function(callback) {
|
|
var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
|
|
actScopeDepth++;
|
|
var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
|
|
try {
|
|
var result = callback();
|
|
} catch (error) {
|
|
ReactSharedInternals.thrownErrors.push(error);
|
|
}
|
|
if (0 < ReactSharedInternals.thrownErrors.length)
|
|
throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
|
if (null !== result && "object" === typeof result && "function" === typeof result.then) {
|
|
var thenable = result;
|
|
queueSeveralMicrotasks(function() {
|
|
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.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 {
|
|
then: function(resolve, reject) {
|
|
didAwaitActCall = true;
|
|
thenable.then(
|
|
function(returnValue) {
|
|
popActScope(prevActQueue, prevActScopeDepth);
|
|
if (0 === prevActScopeDepth) {
|
|
try {
|
|
flushActQueue(queue), enqueueTask(function() {
|
|
return recursivelyFlushAsyncActWork(
|
|
returnValue,
|
|
resolve,
|
|
reject
|
|
);
|
|
});
|
|
} catch (error$0) {
|
|
ReactSharedInternals.thrownErrors.push(error$0);
|
|
}
|
|
if (0 < ReactSharedInternals.thrownErrors.length) {
|
|
var _thrownError = aggregateErrors(
|
|
ReactSharedInternals.thrownErrors
|
|
);
|
|
ReactSharedInternals.thrownErrors.length = 0;
|
|
reject(_thrownError);
|
|
}
|
|
} else resolve(returnValue);
|
|
},
|
|
function(error) {
|
|
popActScope(prevActQueue, prevActScopeDepth);
|
|
0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
|
|
ReactSharedInternals.thrownErrors
|
|
), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
|
|
}
|
|
);
|
|
}
|
|
};
|
|
}
|
|
var returnValue$jscomp$0 = result;
|
|
popActScope(prevActQueue, prevActScopeDepth);
|
|
0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
|
|
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
|
|
"A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
|
|
));
|
|
}), ReactSharedInternals.actQueue = null);
|
|
if (0 < ReactSharedInternals.thrownErrors.length)
|
|
throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
|
return {
|
|
then: function(resolve, reject) {
|
|
didAwaitActCall = true;
|
|
0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
|
|
return recursivelyFlushAsyncActWork(
|
|
returnValue$jscomp$0,
|
|
resolve,
|
|
reject
|
|
);
|
|
})) : resolve(returnValue$jscomp$0);
|
|
}
|
|
};
|
|
};
|
|
exports.cache = function(fn) {
|
|
return function() {
|
|
return fn.apply(null, arguments);
|
|
};
|
|
};
|
|
exports.cacheSignal = function() {
|
|
return null;
|
|
};
|
|
exports.captureOwnerStack = function() {
|
|
var getCurrentStack = ReactSharedInternals.getCurrentStack;
|
|
return null === getCurrentStack ? null : getCurrentStack();
|
|
};
|
|
exports.cloneElement = function(element, config, children) {
|
|
if (null === element || void 0 === element)
|
|
throw Error(
|
|
"The argument must be a React element, but you passed " + element + "."
|
|
);
|
|
var props = assign2({}, element.props), key = element.key, owner = element._owner;
|
|
if (null != config) {
|
|
var JSCompiler_inline_result;
|
|
a: {
|
|
if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
|
|
config,
|
|
"ref"
|
|
).get) && JSCompiler_inline_result.isReactWarning) {
|
|
JSCompiler_inline_result = false;
|
|
break a;
|
|
}
|
|
JSCompiler_inline_result = void 0 !== config.ref;
|
|
}
|
|
JSCompiler_inline_result && (owner = getOwner());
|
|
hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
|
|
for (propName in config)
|
|
!hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
|
|
}
|
|
var propName = arguments.length - 2;
|
|
if (1 === propName) props.children = children;
|
|
else if (1 < propName) {
|
|
JSCompiler_inline_result = Array(propName);
|
|
for (var i = 0; i < propName; i++)
|
|
JSCompiler_inline_result[i] = arguments[i + 2];
|
|
props.children = JSCompiler_inline_result;
|
|
}
|
|
props = ReactElement(
|
|
element.type,
|
|
key,
|
|
props,
|
|
owner,
|
|
element._debugStack,
|
|
element._debugTask
|
|
);
|
|
for (key = 2; key < arguments.length; key++)
|
|
validateChildKeys(arguments[key]);
|
|
return props;
|
|
};
|
|
exports.createContext = function(defaultValue) {
|
|
defaultValue = {
|
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
_currentValue: defaultValue,
|
|
_currentValue2: defaultValue,
|
|
_threadCount: 0,
|
|
Provider: null,
|
|
Consumer: null
|
|
};
|
|
defaultValue.Provider = defaultValue;
|
|
defaultValue.Consumer = {
|
|
$$typeof: REACT_CONSUMER_TYPE,
|
|
_context: defaultValue
|
|
};
|
|
defaultValue._currentRenderer = null;
|
|
defaultValue._currentRenderer2 = null;
|
|
return defaultValue;
|
|
};
|
|
exports.createElement = function(type, config, children) {
|
|
for (var i = 2; i < arguments.length; i++)
|
|
validateChildKeys(arguments[i]);
|
|
i = {};
|
|
var key = null;
|
|
if (null != config)
|
|
for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
|
|
"Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
|
|
)), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
|
|
hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
|
|
var childrenLength = arguments.length - 2;
|
|
if (1 === childrenLength) i.children = children;
|
|
else if (1 < childrenLength) {
|
|
for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
|
|
childArray[_i] = arguments[_i + 2];
|
|
Object.freeze && Object.freeze(childArray);
|
|
i.children = childArray;
|
|
}
|
|
if (type && type.defaultProps)
|
|
for (propName in childrenLength = type.defaultProps, childrenLength)
|
|
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
|
|
key && defineKeyPropWarningGetter(
|
|
i,
|
|
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
|
);
|
|
var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
return ReactElement(
|
|
type,
|
|
key,
|
|
i,
|
|
getOwner(),
|
|
propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
);
|
|
};
|
|
exports.createRef = function() {
|
|
var refObject = { current: null };
|
|
Object.seal(refObject);
|
|
return refObject;
|
|
};
|
|
exports.forwardRef = function(render) {
|
|
null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
|
|
"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
|
|
) : "function" !== typeof render ? console.error(
|
|
"forwardRef requires a render function but was given %s.",
|
|
null === render ? "null" : typeof render
|
|
) : 0 !== render.length && 2 !== render.length && console.error(
|
|
"forwardRef render functions accept exactly two parameters: props and ref. %s",
|
|
1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
|
|
);
|
|
null != render && null != render.defaultProps && console.error(
|
|
"forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
|
|
);
|
|
var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
|
|
Object.defineProperty(elementType, "displayName", {
|
|
enumerable: false,
|
|
configurable: true,
|
|
get: function() {
|
|
return ownName;
|
|
},
|
|
set: function(name) {
|
|
ownName = name;
|
|
render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
|
|
}
|
|
});
|
|
return elementType;
|
|
};
|
|
exports.isValidElement = isValidElement5;
|
|
exports.lazy = function(ctor) {
|
|
ctor = { _status: -1, _result: ctor };
|
|
var lazyType = {
|
|
$$typeof: REACT_LAZY_TYPE,
|
|
_payload: ctor,
|
|
_init: lazyInitializer
|
|
}, ioInfo = {
|
|
name: "lazy",
|
|
start: -1,
|
|
end: -1,
|
|
value: null,
|
|
owner: null,
|
|
debugStack: Error("react-stack-top-frame"),
|
|
debugTask: console.createTask ? console.createTask("lazy()") : null
|
|
};
|
|
ctor._ioInfo = ioInfo;
|
|
lazyType._debugInfo = [{ awaited: ioInfo }];
|
|
return lazyType;
|
|
};
|
|
exports.memo = function(type, compare) {
|
|
null == type && console.error(
|
|
"memo: The first argument must be a component. Instead received: %s",
|
|
null === type ? "null" : typeof type
|
|
);
|
|
compare = {
|
|
$$typeof: REACT_MEMO_TYPE,
|
|
type,
|
|
compare: void 0 === compare ? null : compare
|
|
};
|
|
var ownName;
|
|
Object.defineProperty(compare, "displayName", {
|
|
enumerable: false,
|
|
configurable: true,
|
|
get: function() {
|
|
return ownName;
|
|
},
|
|
set: function(name) {
|
|
ownName = name;
|
|
type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
|
|
}
|
|
});
|
|
return compare;
|
|
};
|
|
exports.startTransition = function(scope) {
|
|
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
|
currentTransition._updatedFibers = /* @__PURE__ */ new Set();
|
|
ReactSharedInternals.T = currentTransition;
|
|
try {
|
|
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
|
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
|
"object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop3, reportGlobalError));
|
|
} catch (error) {
|
|
reportGlobalError(error);
|
|
} finally {
|
|
null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
|
|
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
|
|
)), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
|
|
"We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
|
|
), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
|
|
}
|
|
};
|
|
exports.unstable_useCacheRefresh = function() {
|
|
return resolveDispatcher().useCacheRefresh();
|
|
};
|
|
exports.use = function(usable) {
|
|
return resolveDispatcher().use(usable);
|
|
};
|
|
exports.useActionState = function(action, initialState, permalink) {
|
|
return resolveDispatcher().useActionState(
|
|
action,
|
|
initialState,
|
|
permalink
|
|
);
|
|
};
|
|
exports.useCallback = function(callback, deps) {
|
|
return resolveDispatcher().useCallback(callback, deps);
|
|
};
|
|
exports.useContext = function(Context) {
|
|
var dispatcher = resolveDispatcher();
|
|
Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
|
|
"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
|
|
);
|
|
return dispatcher.useContext(Context);
|
|
};
|
|
exports.useDebugValue = function(value, formatterFn) {
|
|
return resolveDispatcher().useDebugValue(value, formatterFn);
|
|
};
|
|
exports.useDeferredValue = function(value, initialValue) {
|
|
return resolveDispatcher().useDeferredValue(value, initialValue);
|
|
};
|
|
exports.useEffect = function(create, deps) {
|
|
null == create && console.warn(
|
|
"React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
);
|
|
return resolveDispatcher().useEffect(create, deps);
|
|
};
|
|
exports.useEffectEvent = function(callback) {
|
|
return resolveDispatcher().useEffectEvent(callback);
|
|
};
|
|
exports.useId = function() {
|
|
return resolveDispatcher().useId();
|
|
};
|
|
exports.useImperativeHandle = function(ref, create, deps) {
|
|
return resolveDispatcher().useImperativeHandle(ref, create, deps);
|
|
};
|
|
exports.useInsertionEffect = function(create, deps) {
|
|
null == create && console.warn(
|
|
"React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
);
|
|
return resolveDispatcher().useInsertionEffect(create, deps);
|
|
};
|
|
exports.useLayoutEffect = function(create, deps) {
|
|
null == create && console.warn(
|
|
"React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
);
|
|
return resolveDispatcher().useLayoutEffect(create, deps);
|
|
};
|
|
exports.useMemo = function(create, deps) {
|
|
return resolveDispatcher().useMemo(create, deps);
|
|
};
|
|
exports.useOptimistic = function(passthrough, reducer) {
|
|
return resolveDispatcher().useOptimistic(passthrough, reducer);
|
|
};
|
|
exports.useReducer = function(reducer, initialArg, init) {
|
|
return resolveDispatcher().useReducer(reducer, initialArg, init);
|
|
};
|
|
exports.useRef = function(initialValue) {
|
|
return resolveDispatcher().useRef(initialValue);
|
|
};
|
|
exports.useState = function(initialState) {
|
|
return resolveDispatcher().useState(initialState);
|
|
};
|
|
exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
|
|
return resolveDispatcher().useSyncExternalStore(
|
|
subscribe,
|
|
getSnapshot,
|
|
getServerSnapshot
|
|
);
|
|
};
|
|
exports.useTransition = function() {
|
|
return resolveDispatcher().useTransition();
|
|
};
|
|
exports.version = "19.2.7";
|
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
})();
|
|
}
|
|
});
|
|
|
|
// node_modules/react/index.js
|
|
var require_react = __commonJS({
|
|
"node_modules/react/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/scheduler/cjs/scheduler.development.js
|
|
var require_scheduler_development = __commonJS({
|
|
"node_modules/scheduler/cjs/scheduler.development.js"(exports) {
|
|
"use strict";
|
|
(function() {
|
|
function performWorkUntilDeadline() {
|
|
needsPaint = false;
|
|
if (isMessageLoopRunning) {
|
|
var currentTime = exports.unstable_now();
|
|
startTime = currentTime;
|
|
var hasMoreWork = true;
|
|
try {
|
|
a: {
|
|
isHostCallbackScheduled = false;
|
|
isHostTimeoutScheduled && (isHostTimeoutScheduled = false, localClearTimeout(taskTimeoutID), taskTimeoutID = -1);
|
|
isPerformingWork = true;
|
|
var previousPriorityLevel = currentPriorityLevel;
|
|
try {
|
|
b: {
|
|
advanceTimers(currentTime);
|
|
for (currentTask = peek2(taskQueue); null !== currentTask && !(currentTask.expirationTime > currentTime && shouldYieldToHost()); ) {
|
|
var callback = currentTask.callback;
|
|
if ("function" === typeof callback) {
|
|
currentTask.callback = null;
|
|
currentPriorityLevel = currentTask.priorityLevel;
|
|
var continuationCallback = callback(
|
|
currentTask.expirationTime <= currentTime
|
|
);
|
|
currentTime = exports.unstable_now();
|
|
if ("function" === typeof continuationCallback) {
|
|
currentTask.callback = continuationCallback;
|
|
advanceTimers(currentTime);
|
|
hasMoreWork = true;
|
|
break b;
|
|
}
|
|
currentTask === peek2(taskQueue) && pop(taskQueue);
|
|
advanceTimers(currentTime);
|
|
} else pop(taskQueue);
|
|
currentTask = peek2(taskQueue);
|
|
}
|
|
if (null !== currentTask) hasMoreWork = true;
|
|
else {
|
|
var firstTimer = peek2(timerQueue);
|
|
null !== firstTimer && requestHostTimeout(
|
|
handleTimeout,
|
|
firstTimer.startTime - currentTime
|
|
);
|
|
hasMoreWork = false;
|
|
}
|
|
}
|
|
break a;
|
|
} finally {
|
|
currentTask = null, currentPriorityLevel = previousPriorityLevel, isPerformingWork = false;
|
|
}
|
|
hasMoreWork = void 0;
|
|
}
|
|
} finally {
|
|
hasMoreWork ? schedulePerformWorkUntilDeadline() : isMessageLoopRunning = false;
|
|
}
|
|
}
|
|
}
|
|
function push(heap, node2) {
|
|
var index = heap.length;
|
|
heap.push(node2);
|
|
a: for (; 0 < index; ) {
|
|
var parentIndex = index - 1 >>> 1, parent = heap[parentIndex];
|
|
if (0 < compare(parent, node2))
|
|
heap[parentIndex] = node2, heap[index] = parent, index = parentIndex;
|
|
else break a;
|
|
}
|
|
}
|
|
function peek2(heap) {
|
|
return 0 === heap.length ? null : heap[0];
|
|
}
|
|
function pop(heap) {
|
|
if (0 === heap.length) return null;
|
|
var first = heap[0], last = heap.pop();
|
|
if (last !== first) {
|
|
heap[0] = last;
|
|
a: for (var index = 0, length2 = heap.length, halfLength = length2 >>> 1; index < halfLength; ) {
|
|
var leftIndex = 2 * (index + 1) - 1, left = heap[leftIndex], rightIndex = leftIndex + 1, right = heap[rightIndex];
|
|
if (0 > compare(left, last))
|
|
rightIndex < length2 && 0 > compare(right, left) ? (heap[index] = right, heap[rightIndex] = last, index = rightIndex) : (heap[index] = left, heap[leftIndex] = last, index = leftIndex);
|
|
else if (rightIndex < length2 && 0 > compare(right, last))
|
|
heap[index] = right, heap[rightIndex] = last, index = rightIndex;
|
|
else break a;
|
|
}
|
|
}
|
|
return first;
|
|
}
|
|
function compare(a, b) {
|
|
var diff = a.sortIndex - b.sortIndex;
|
|
return 0 !== diff ? diff : a.id - b.id;
|
|
}
|
|
function advanceTimers(currentTime) {
|
|
for (var timer = peek2(timerQueue); null !== timer; ) {
|
|
if (null === timer.callback) pop(timerQueue);
|
|
else if (timer.startTime <= currentTime)
|
|
pop(timerQueue), timer.sortIndex = timer.expirationTime, push(taskQueue, timer);
|
|
else break;
|
|
timer = peek2(timerQueue);
|
|
}
|
|
}
|
|
function handleTimeout(currentTime) {
|
|
isHostTimeoutScheduled = false;
|
|
advanceTimers(currentTime);
|
|
if (!isHostCallbackScheduled)
|
|
if (null !== peek2(taskQueue))
|
|
isHostCallbackScheduled = true, isMessageLoopRunning || (isMessageLoopRunning = true, schedulePerformWorkUntilDeadline());
|
|
else {
|
|
var firstTimer = peek2(timerQueue);
|
|
null !== firstTimer && requestHostTimeout(
|
|
handleTimeout,
|
|
firstTimer.startTime - currentTime
|
|
);
|
|
}
|
|
}
|
|
function shouldYieldToHost() {
|
|
return needsPaint ? true : exports.unstable_now() - startTime < frameInterval ? false : true;
|
|
}
|
|
function requestHostTimeout(callback, ms) {
|
|
taskTimeoutID = localSetTimeout(function() {
|
|
callback(exports.unstable_now());
|
|
}, ms);
|
|
}
|
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
exports.unstable_now = void 0;
|
|
if ("object" === typeof performance && "function" === typeof performance.now) {
|
|
var localPerformance = performance;
|
|
exports.unstable_now = function() {
|
|
return localPerformance.now();
|
|
};
|
|
} else {
|
|
var localDate = Date, initialTime = localDate.now();
|
|
exports.unstable_now = function() {
|
|
return localDate.now() - initialTime;
|
|
};
|
|
}
|
|
var taskQueue = [], timerQueue = [], taskIdCounter = 1, currentTask = null, currentPriorityLevel = 3, isPerformingWork = false, isHostCallbackScheduled = false, isHostTimeoutScheduled = false, needsPaint = false, localSetTimeout = "function" === typeof setTimeout ? setTimeout : null, localClearTimeout = "function" === typeof clearTimeout ? clearTimeout : null, localSetImmediate = "undefined" !== typeof setImmediate ? setImmediate : null, isMessageLoopRunning = false, taskTimeoutID = -1, frameInterval = 5, startTime = -1;
|
|
if ("function" === typeof localSetImmediate)
|
|
var schedulePerformWorkUntilDeadline = function() {
|
|
localSetImmediate(performWorkUntilDeadline);
|
|
};
|
|
else if ("undefined" !== typeof MessageChannel) {
|
|
var channel = new MessageChannel(), port = channel.port2;
|
|
channel.port1.onmessage = performWorkUntilDeadline;
|
|
schedulePerformWorkUntilDeadline = function() {
|
|
port.postMessage(null);
|
|
};
|
|
} else
|
|
schedulePerformWorkUntilDeadline = function() {
|
|
localSetTimeout(performWorkUntilDeadline, 0);
|
|
};
|
|
exports.unstable_IdlePriority = 5;
|
|
exports.unstable_ImmediatePriority = 1;
|
|
exports.unstable_LowPriority = 4;
|
|
exports.unstable_NormalPriority = 3;
|
|
exports.unstable_Profiling = null;
|
|
exports.unstable_UserBlockingPriority = 2;
|
|
exports.unstable_cancelCallback = function(task) {
|
|
task.callback = null;
|
|
};
|
|
exports.unstable_forceFrameRate = function(fps) {
|
|
0 > fps || 125 < fps ? console.error(
|
|
"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"
|
|
) : frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5;
|
|
};
|
|
exports.unstable_getCurrentPriorityLevel = function() {
|
|
return currentPriorityLevel;
|
|
};
|
|
exports.unstable_next = function(eventHandler) {
|
|
switch (currentPriorityLevel) {
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
var priorityLevel = 3;
|
|
break;
|
|
default:
|
|
priorityLevel = currentPriorityLevel;
|
|
}
|
|
var previousPriorityLevel = currentPriorityLevel;
|
|
currentPriorityLevel = priorityLevel;
|
|
try {
|
|
return eventHandler();
|
|
} finally {
|
|
currentPriorityLevel = previousPriorityLevel;
|
|
}
|
|
};
|
|
exports.unstable_requestPaint = function() {
|
|
needsPaint = true;
|
|
};
|
|
exports.unstable_runWithPriority = function(priorityLevel, eventHandler) {
|
|
switch (priorityLevel) {
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
case 5:
|
|
break;
|
|
default:
|
|
priorityLevel = 3;
|
|
}
|
|
var previousPriorityLevel = currentPriorityLevel;
|
|
currentPriorityLevel = priorityLevel;
|
|
try {
|
|
return eventHandler();
|
|
} finally {
|
|
currentPriorityLevel = previousPriorityLevel;
|
|
}
|
|
};
|
|
exports.unstable_scheduleCallback = function(priorityLevel, callback, options) {
|
|
var currentTime = exports.unstable_now();
|
|
"object" === typeof options && null !== options ? (options = options.delay, options = "number" === typeof options && 0 < options ? currentTime + options : currentTime) : options = currentTime;
|
|
switch (priorityLevel) {
|
|
case 1:
|
|
var timeout2 = -1;
|
|
break;
|
|
case 2:
|
|
timeout2 = 250;
|
|
break;
|
|
case 5:
|
|
timeout2 = 1073741823;
|
|
break;
|
|
case 4:
|
|
timeout2 = 1e4;
|
|
break;
|
|
default:
|
|
timeout2 = 5e3;
|
|
}
|
|
timeout2 = options + timeout2;
|
|
priorityLevel = {
|
|
id: taskIdCounter++,
|
|
callback,
|
|
priorityLevel,
|
|
startTime: options,
|
|
expirationTime: timeout2,
|
|
sortIndex: -1
|
|
};
|
|
options > currentTime ? (priorityLevel.sortIndex = options, push(timerQueue, priorityLevel), null === peek2(taskQueue) && priorityLevel === peek2(timerQueue) && (isHostTimeoutScheduled ? (localClearTimeout(taskTimeoutID), taskTimeoutID = -1) : isHostTimeoutScheduled = true, requestHostTimeout(handleTimeout, options - currentTime))) : (priorityLevel.sortIndex = timeout2, push(taskQueue, priorityLevel), isHostCallbackScheduled || isPerformingWork || (isHostCallbackScheduled = true, isMessageLoopRunning || (isMessageLoopRunning = true, schedulePerformWorkUntilDeadline())));
|
|
return priorityLevel;
|
|
};
|
|
exports.unstable_shouldYield = shouldYieldToHost;
|
|
exports.unstable_wrapCallback = function(callback) {
|
|
var parentPriorityLevel = currentPriorityLevel;
|
|
return function() {
|
|
var previousPriorityLevel = currentPriorityLevel;
|
|
currentPriorityLevel = parentPriorityLevel;
|
|
try {
|
|
return callback.apply(this, arguments);
|
|
} finally {
|
|
currentPriorityLevel = previousPriorityLevel;
|
|
}
|
|
};
|
|
};
|
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
})();
|
|
}
|
|
});
|
|
|
|
// node_modules/scheduler/index.js
|
|
var require_scheduler = __commonJS({
|
|
"node_modules/scheduler/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_scheduler_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) {
|
|
"use strict";
|
|
(function() {
|
|
function noop3() {
|
|
}
|
|
function testStringCoercion(value) {
|
|
return "" + value;
|
|
}
|
|
function createPortal$1(children, containerInfo, implementation) {
|
|
var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
|
try {
|
|
testStringCoercion(key);
|
|
var JSCompiler_inline_result = false;
|
|
} catch (e) {
|
|
JSCompiler_inline_result = true;
|
|
}
|
|
JSCompiler_inline_result && (console.error(
|
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
"function" === typeof Symbol && Symbol.toStringTag && key[Symbol.toStringTag] || key.constructor.name || "Object"
|
|
), testStringCoercion(key));
|
|
return {
|
|
$$typeof: REACT_PORTAL_TYPE,
|
|
key: null == key ? null : "" + key,
|
|
children,
|
|
containerInfo,
|
|
implementation
|
|
};
|
|
}
|
|
function getCrossOriginStringAs(as, input) {
|
|
if ("font" === as) return "";
|
|
if ("string" === typeof input)
|
|
return "use-credentials" === input ? input : "";
|
|
}
|
|
function getValueDescriptorExpectingObjectForWarning(thing) {
|
|
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : 'something with type "' + typeof thing + '"';
|
|
}
|
|
function getValueDescriptorExpectingEnumForWarning(thing) {
|
|
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "string" === typeof thing ? JSON.stringify(thing) : "number" === typeof thing ? "`" + thing + "`" : 'something with type "' + typeof thing + '"';
|
|
}
|
|
function resolveDispatcher() {
|
|
var dispatcher = ReactSharedInternals.H;
|
|
null === dispatcher && console.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."
|
|
);
|
|
return dispatcher;
|
|
}
|
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
var React58 = require_react(), Internals = {
|
|
d: {
|
|
f: noop3,
|
|
r: function() {
|
|
throw Error(
|
|
"Invalid form element. requestFormReset must be passed a form that was rendered by React."
|
|
);
|
|
},
|
|
D: noop3,
|
|
C: noop3,
|
|
L: noop3,
|
|
m: noop3,
|
|
X: noop3,
|
|
S: noop3,
|
|
M: noop3
|
|
},
|
|
p: 0,
|
|
findDOMNode: null
|
|
}, REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), ReactSharedInternals = React58.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
"function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error(
|
|
"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
|
|
);
|
|
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
|
|
exports.createPortal = function(children, container) {
|
|
var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
|
if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
|
|
throw Error("Target container is not a DOM element.");
|
|
return createPortal$1(children, container, null, key);
|
|
};
|
|
exports.flushSync = function(fn) {
|
|
var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
|
|
try {
|
|
if (ReactSharedInternals.T = null, Internals.p = 2, fn)
|
|
return fn();
|
|
} finally {
|
|
ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f() && console.error(
|
|
"flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."
|
|
);
|
|
}
|
|
};
|
|
exports.preconnect = function(href, options) {
|
|
"string" === typeof href && href ? null != options && "object" !== typeof options ? console.error(
|
|
"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
|
|
getValueDescriptorExpectingEnumForWarning(options)
|
|
) : null != options && "string" !== typeof options.crossOrigin && console.error(
|
|
"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
|
|
getValueDescriptorExpectingObjectForWarning(options.crossOrigin)
|
|
) : console.error(
|
|
"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
getValueDescriptorExpectingObjectForWarning(href)
|
|
);
|
|
"string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
|
|
};
|
|
exports.prefetchDNS = function(href) {
|
|
if ("string" !== typeof href || !href)
|
|
console.error(
|
|
"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
getValueDescriptorExpectingObjectForWarning(href)
|
|
);
|
|
else if (1 < arguments.length) {
|
|
var options = arguments[1];
|
|
"object" === typeof options && options.hasOwnProperty("crossOrigin") ? console.error(
|
|
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
|
getValueDescriptorExpectingEnumForWarning(options)
|
|
) : console.error(
|
|
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
|
getValueDescriptorExpectingEnumForWarning(options)
|
|
);
|
|
}
|
|
"string" === typeof href && Internals.d.D(href);
|
|
};
|
|
exports.preinit = function(href, options) {
|
|
"string" === typeof href && href ? null == options || "object" !== typeof options ? console.error(
|
|
"ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
|
|
getValueDescriptorExpectingEnumForWarning(options)
|
|
) : "style" !== options.as && "script" !== options.as && console.error(
|
|
'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',
|
|
getValueDescriptorExpectingEnumForWarning(options.as)
|
|
) : console.error(
|
|
"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
getValueDescriptorExpectingObjectForWarning(href)
|
|
);
|
|
if ("string" === typeof href && options && "string" === typeof options.as) {
|
|
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
|
|
"style" === as ? Internals.d.S(
|
|
href,
|
|
"string" === typeof options.precedence ? options.precedence : void 0,
|
|
{
|
|
crossOrigin,
|
|
integrity,
|
|
fetchPriority
|
|
}
|
|
) : "script" === as && Internals.d.X(href, {
|
|
crossOrigin,
|
|
integrity,
|
|
fetchPriority,
|
|
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
});
|
|
}
|
|
};
|
|
exports.preinitModule = function(href, options) {
|
|
var encountered = "";
|
|
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
|
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "script" !== options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingEnumForWarning(options.as) + ".");
|
|
if (encountered)
|
|
console.error(
|
|
"ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
|
|
encountered
|
|
);
|
|
else
|
|
switch (encountered = options && "string" === typeof options.as ? options.as : "script", encountered) {
|
|
case "script":
|
|
break;
|
|
default:
|
|
encountered = getValueDescriptorExpectingEnumForWarning(encountered), console.error(
|
|
'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',
|
|
encountered,
|
|
href
|
|
);
|
|
}
|
|
if ("string" === typeof href)
|
|
if ("object" === typeof options && null !== options) {
|
|
if (null == options.as || "script" === options.as)
|
|
encountered = getCrossOriginStringAs(
|
|
options.as,
|
|
options.crossOrigin
|
|
), Internals.d.M(href, {
|
|
crossOrigin: encountered,
|
|
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
});
|
|
} else null == options && Internals.d.M(href);
|
|
};
|
|
exports.preload = function(href, options) {
|
|
var encountered = "";
|
|
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
|
null == options || "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : "string" === typeof options.as && options.as || (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
|
encountered && console.error(
|
|
'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
|
|
encountered
|
|
);
|
|
if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
|
|
encountered = options.as;
|
|
var crossOrigin = getCrossOriginStringAs(
|
|
encountered,
|
|
options.crossOrigin
|
|
);
|
|
Internals.d.L(href, encountered, {
|
|
crossOrigin,
|
|
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
|
type: "string" === typeof options.type ? options.type : void 0,
|
|
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
|
|
referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
|
|
imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
|
|
imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
|
|
media: "string" === typeof options.media ? options.media : void 0
|
|
});
|
|
}
|
|
};
|
|
exports.preloadModule = function(href, options) {
|
|
var encountered = "";
|
|
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
|
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "string" !== typeof options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
|
encountered && console.error(
|
|
'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
|
|
encountered
|
|
);
|
|
"string" === typeof href && (options ? (encountered = getCrossOriginStringAs(
|
|
options.as,
|
|
options.crossOrigin
|
|
), Internals.d.m(href, {
|
|
as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
|
|
crossOrigin: encountered,
|
|
integrity: "string" === typeof options.integrity ? options.integrity : void 0
|
|
})) : Internals.d.m(href));
|
|
};
|
|
exports.requestFormReset = function(form) {
|
|
Internals.d.r(form);
|
|
};
|
|
exports.unstable_batchedUpdates = function(fn, a) {
|
|
return fn(a);
|
|
};
|
|
exports.useFormState = function(action, initialState, permalink) {
|
|
return resolveDispatcher().useFormState(action, initialState, permalink);
|
|
};
|
|
exports.useFormStatus = function() {
|
|
return resolveDispatcher().useHostTransitionStatus();
|
|
};
|
|
exports.version = "19.2.7";
|
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
})();
|
|
}
|
|
});
|
|
|
|
// node_modules/react-dom/index.js
|
|
var require_react_dom = __commonJS({
|
|
"node_modules/react-dom/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
checkDCE();
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_dom_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react-dom/cjs/react-dom-client.development.js
|
|
var require_react_dom_client_development = __commonJS({
|
|
"node_modules/react-dom/cjs/react-dom-client.development.js"(exports) {
|
|
"use strict";
|
|
(function() {
|
|
function findHook(fiber, id) {
|
|
for (fiber = fiber.memoizedState; null !== fiber && 0 < id; )
|
|
fiber = fiber.next, id--;
|
|
return fiber;
|
|
}
|
|
function copyWithSetImpl(obj, path, index, value) {
|
|
if (index >= path.length) return value;
|
|
var key = path[index], updated = isArrayImpl(obj) ? obj.slice() : assign2({}, obj);
|
|
updated[key] = copyWithSetImpl(obj[key], path, index + 1, value);
|
|
return updated;
|
|
}
|
|
function copyWithRename(obj, oldPath, newPath) {
|
|
if (oldPath.length !== newPath.length)
|
|
console.warn("copyWithRename() expects paths of the same length");
|
|
else {
|
|
for (var i = 0; i < newPath.length - 1; i++)
|
|
if (oldPath[i] !== newPath[i]) {
|
|
console.warn(
|
|
"copyWithRename() expects paths to be the same except for the deepest key"
|
|
);
|
|
return;
|
|
}
|
|
return copyWithRenameImpl(obj, oldPath, newPath, 0);
|
|
}
|
|
}
|
|
function copyWithRenameImpl(obj, oldPath, newPath, index) {
|
|
var oldKey = oldPath[index], updated = isArrayImpl(obj) ? obj.slice() : assign2({}, obj);
|
|
index + 1 === oldPath.length ? (updated[newPath[index]] = updated[oldKey], isArrayImpl(updated) ? updated.splice(oldKey, 1) : delete updated[oldKey]) : updated[oldKey] = copyWithRenameImpl(
|
|
obj[oldKey],
|
|
oldPath,
|
|
newPath,
|
|
index + 1
|
|
);
|
|
return updated;
|
|
}
|
|
function copyWithDeleteImpl(obj, path, index) {
|
|
var key = path[index], updated = isArrayImpl(obj) ? obj.slice() : assign2({}, obj);
|
|
if (index + 1 === path.length)
|
|
return isArrayImpl(updated) ? updated.splice(key, 1) : delete updated[key], updated;
|
|
updated[key] = copyWithDeleteImpl(obj[key], path, index + 1);
|
|
return updated;
|
|
}
|
|
function shouldSuspendImpl() {
|
|
return false;
|
|
}
|
|
function shouldErrorImpl() {
|
|
return null;
|
|
}
|
|
function warnInvalidHookAccess() {
|
|
console.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"
|
|
);
|
|
}
|
|
function warnInvalidContextAccess() {
|
|
console.error(
|
|
"Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
|
|
);
|
|
}
|
|
function noop3() {
|
|
}
|
|
function warnForMissingKey() {
|
|
}
|
|
function setToSortedString(set) {
|
|
var array = [];
|
|
set.forEach(function(value) {
|
|
array.push(value);
|
|
});
|
|
return array.sort().join(", ");
|
|
}
|
|
function createFiber(tag, pendingProps, key, mode) {
|
|
return new FiberNode(tag, pendingProps, key, mode);
|
|
}
|
|
function scheduleRoot(root2, element) {
|
|
root2.context === emptyContextObject && (updateContainerImpl(root2.current, 2, element, root2, null, null), flushSyncWork$1());
|
|
}
|
|
function scheduleRefresh(root2, update2) {
|
|
if (null !== resolveFamily) {
|
|
var staleFamilies = update2.staleFamilies;
|
|
update2 = update2.updatedFamilies;
|
|
flushPendingEffects();
|
|
scheduleFibersWithFamiliesRecursively(
|
|
root2.current,
|
|
update2,
|
|
staleFamilies
|
|
);
|
|
flushSyncWork$1();
|
|
}
|
|
}
|
|
function setRefreshHandler(handler) {
|
|
resolveFamily = handler;
|
|
}
|
|
function isValidContainer(node2) {
|
|
return !(!node2 || 1 !== node2.nodeType && 9 !== node2.nodeType && 11 !== node2.nodeType);
|
|
}
|
|
function getNearestMountedFiber(fiber) {
|
|
var node2 = fiber, nearestMounted = fiber;
|
|
if (fiber.alternate) for (; node2.return; ) node2 = node2.return;
|
|
else {
|
|
fiber = node2;
|
|
do
|
|
node2 = fiber, 0 !== (node2.flags & 4098) && (nearestMounted = node2.return), fiber = node2.return;
|
|
while (fiber);
|
|
}
|
|
return 3 === node2.tag ? nearestMounted : null;
|
|
}
|
|
function getSuspenseInstanceFromFiber(fiber) {
|
|
if (13 === fiber.tag) {
|
|
var suspenseState = fiber.memoizedState;
|
|
null === suspenseState && (fiber = fiber.alternate, null !== fiber && (suspenseState = fiber.memoizedState));
|
|
if (null !== suspenseState) return suspenseState.dehydrated;
|
|
}
|
|
return null;
|
|
}
|
|
function getActivityInstanceFromFiber(fiber) {
|
|
if (31 === fiber.tag) {
|
|
var activityState = fiber.memoizedState;
|
|
null === activityState && (fiber = fiber.alternate, null !== fiber && (activityState = fiber.memoizedState));
|
|
if (null !== activityState) return activityState.dehydrated;
|
|
}
|
|
return 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 = false, _child = parentA.child; _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) {
|
|
for (_child = parentB.child; _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 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 findCurrentHostFiberImpl(node2) {
|
|
var tag = node2.tag;
|
|
if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node2;
|
|
for (node2 = node2.child; null !== node2; ) {
|
|
tag = findCurrentHostFiberImpl(node2);
|
|
if (null !== tag) return tag;
|
|
node2 = node2.sibling;
|
|
}
|
|
return null;
|
|
}
|
|
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.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
if ("string" === typeof type) return type;
|
|
switch (type) {
|
|
case REACT_FRAGMENT_TYPE:
|
|
return "Fragment";
|
|
case REACT_PROFILER_TYPE:
|
|
return "Profiler";
|
|
case REACT_STRICT_MODE_TYPE:
|
|
return "StrictMode";
|
|
case REACT_SUSPENSE_TYPE:
|
|
return "Suspense";
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return "SuspenseList";
|
|
case REACT_ACTIVITY_TYPE:
|
|
return "Activity";
|
|
}
|
|
if ("object" === typeof type)
|
|
switch ("number" === typeof type.tag && console.error(
|
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
), type.$$typeof) {
|
|
case REACT_PORTAL_TYPE:
|
|
return "Portal";
|
|
case REACT_CONTEXT_TYPE:
|
|
return type.displayName || "Context";
|
|
case REACT_CONSUMER_TYPE:
|
|
return (type._context.displayName || "Context") + ".Consumer";
|
|
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 getComponentNameFromOwner(owner) {
|
|
return "number" === typeof owner.tag ? getComponentNameFromFiber(owner) : "string" === typeof owner.name ? owner.name : null;
|
|
}
|
|
function getComponentNameFromFiber(fiber) {
|
|
var type = fiber.type;
|
|
switch (fiber.tag) {
|
|
case 31:
|
|
return "Activity";
|
|
case 24:
|
|
return "Cache";
|
|
case 9:
|
|
return (type._context.displayName || "Context") + ".Consumer";
|
|
case 10:
|
|
return type.displayName || "Context";
|
|
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 26:
|
|
case 27:
|
|
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 14:
|
|
case 15:
|
|
if ("function" === typeof type)
|
|
return type.displayName || type.name || null;
|
|
if ("string" === typeof type) return type;
|
|
break;
|
|
case 29:
|
|
type = fiber._debugInfo;
|
|
if (null != type) {
|
|
for (var i = type.length - 1; 0 <= i; i--)
|
|
if ("string" === typeof type[i].name) return type[i].name;
|
|
}
|
|
if (null !== fiber.return)
|
|
return getComponentNameFromFiber(fiber.return);
|
|
}
|
|
return null;
|
|
}
|
|
function createCursor(defaultValue) {
|
|
return { current: defaultValue };
|
|
}
|
|
function pop(cursor2, fiber) {
|
|
0 > index$jscomp$0 ? console.error("Unexpected pop.") : (fiber !== fiberStack[index$jscomp$0] && console.error("Unexpected Fiber popped."), cursor2.current = valueStack[index$jscomp$0], valueStack[index$jscomp$0] = null, fiberStack[index$jscomp$0] = null, index$jscomp$0--);
|
|
}
|
|
function push(cursor2, value, fiber) {
|
|
index$jscomp$0++;
|
|
valueStack[index$jscomp$0] = cursor2.current;
|
|
fiberStack[index$jscomp$0] = fiber;
|
|
cursor2.current = value;
|
|
}
|
|
function requiredContext(c) {
|
|
null === c && console.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, fiber);
|
|
push(contextFiberStackCursor, fiber, fiber);
|
|
push(contextStackCursor, null, fiber);
|
|
var nextRootContext = nextRootInstance.nodeType;
|
|
switch (nextRootContext) {
|
|
case 9:
|
|
case 11:
|
|
nextRootContext = 9 === nextRootContext ? "#document" : "#fragment";
|
|
nextRootInstance = (nextRootInstance = nextRootInstance.documentElement) ? (nextRootInstance = nextRootInstance.namespaceURI) ? getOwnHostContext(nextRootInstance) : HostContextNamespaceNone : HostContextNamespaceNone;
|
|
break;
|
|
default:
|
|
if (nextRootContext = nextRootInstance.tagName, nextRootInstance = nextRootInstance.namespaceURI)
|
|
nextRootInstance = getOwnHostContext(nextRootInstance), nextRootInstance = getChildHostContextProd(
|
|
nextRootInstance,
|
|
nextRootContext
|
|
);
|
|
else
|
|
switch (nextRootContext) {
|
|
case "svg":
|
|
nextRootInstance = HostContextNamespaceSvg;
|
|
break;
|
|
case "math":
|
|
nextRootInstance = HostContextNamespaceMath;
|
|
break;
|
|
default:
|
|
nextRootInstance = HostContextNamespaceNone;
|
|
}
|
|
}
|
|
nextRootContext = nextRootContext.toLowerCase();
|
|
nextRootContext = updatedAncestorInfoDev(null, nextRootContext);
|
|
nextRootContext = {
|
|
context: nextRootInstance,
|
|
ancestorInfo: nextRootContext
|
|
};
|
|
pop(contextStackCursor, fiber);
|
|
push(contextStackCursor, nextRootContext, fiber);
|
|
}
|
|
function popHostContainer(fiber) {
|
|
pop(contextStackCursor, fiber);
|
|
pop(contextFiberStackCursor, fiber);
|
|
pop(rootInstanceStackCursor, fiber);
|
|
}
|
|
function getHostContext() {
|
|
return requiredContext(contextStackCursor.current);
|
|
}
|
|
function pushHostContext(fiber) {
|
|
null !== fiber.memoizedState && push(hostTransitionProviderCursor, fiber, fiber);
|
|
var context = requiredContext(contextStackCursor.current);
|
|
var type = fiber.type;
|
|
var nextContext = getChildHostContextProd(context.context, type);
|
|
type = updatedAncestorInfoDev(context.ancestorInfo, type);
|
|
nextContext = { context: nextContext, ancestorInfo: type };
|
|
context !== nextContext && (push(contextFiberStackCursor, fiber, fiber), push(contextStackCursor, nextContext, fiber));
|
|
}
|
|
function popHostContext(fiber) {
|
|
contextFiberStackCursor.current === fiber && (pop(contextStackCursor, fiber), pop(contextFiberStackCursor, fiber));
|
|
hostTransitionProviderCursor.current === fiber && (pop(hostTransitionProviderCursor, fiber), HostTransitionContext._currentValue = NotPendingTransition);
|
|
}
|
|
function disabledLog() {
|
|
}
|
|
function disableLogs() {
|
|
if (0 === disabledDepth) {
|
|
prevLog = console.log;
|
|
prevInfo = console.info;
|
|
prevWarn = console.warn;
|
|
prevError = console.error;
|
|
prevGroup = console.group;
|
|
prevGroupCollapsed = console.groupCollapsed;
|
|
prevGroupEnd = console.groupEnd;
|
|
var props = {
|
|
configurable: true,
|
|
enumerable: true,
|
|
value: disabledLog,
|
|
writable: true
|
|
};
|
|
Object.defineProperties(console, {
|
|
info: props,
|
|
log: props,
|
|
warn: props,
|
|
error: props,
|
|
group: props,
|
|
groupCollapsed: props,
|
|
groupEnd: props
|
|
});
|
|
}
|
|
disabledDepth++;
|
|
}
|
|
function reenableLogs() {
|
|
disabledDepth--;
|
|
if (0 === disabledDepth) {
|
|
var props = { configurable: true, enumerable: true, writable: true };
|
|
Object.defineProperties(console, {
|
|
log: assign2({}, props, { value: prevLog }),
|
|
info: assign2({}, props, { value: prevInfo }),
|
|
warn: assign2({}, props, { value: prevWarn }),
|
|
error: assign2({}, props, { value: prevError }),
|
|
group: assign2({}, props, { value: prevGroup }),
|
|
groupCollapsed: assign2({}, props, { value: prevGroupCollapsed }),
|
|
groupEnd: assign2({}, props, { value: prevGroupEnd })
|
|
});
|
|
}
|
|
0 > disabledDepth && console.error(
|
|
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
|
|
);
|
|
}
|
|
function formatOwnerStack(error) {
|
|
var prevPrepareStackTrace = Error.prepareStackTrace;
|
|
Error.prepareStackTrace = void 0;
|
|
error = error.stack;
|
|
Error.prepareStackTrace = prevPrepareStackTrace;
|
|
error.startsWith("Error: react-stack-top-frame\n") && (error = error.slice(29));
|
|
prevPrepareStackTrace = error.indexOf("\n");
|
|
-1 !== prevPrepareStackTrace && (error = error.slice(prevPrepareStackTrace + 1));
|
|
prevPrepareStackTrace = error.indexOf("react_stack_bottom_frame");
|
|
-1 !== prevPrepareStackTrace && (prevPrepareStackTrace = error.lastIndexOf(
|
|
"\n",
|
|
prevPrepareStackTrace
|
|
));
|
|
if (-1 !== prevPrepareStackTrace)
|
|
error = error.slice(0, prevPrepareStackTrace);
|
|
else return "";
|
|
return error;
|
|
}
|
|
function describeBuiltInComponentFrame(name) {
|
|
if (void 0 === prefix2)
|
|
try {
|
|
throw Error();
|
|
} catch (x) {
|
|
var match2 = x.stack.trim().match(/\n( *(at )?)/);
|
|
prefix2 = match2 && match2[1] || "";
|
|
suffix = -1 < x.stack.indexOf("\n at") ? " (<anonymous>)" : -1 < x.stack.indexOf("@") ? "@unknown:0:0" : "";
|
|
}
|
|
return "\n" + prefix2 + name + suffix;
|
|
}
|
|
function describeNativeComponentFrame(fn, construct) {
|
|
if (!fn || reentry) return "";
|
|
var frame = componentFrameCache.get(fn);
|
|
if (void 0 !== frame) return frame;
|
|
reentry = true;
|
|
frame = Error.prepareStackTrace;
|
|
Error.prepareStackTrace = void 0;
|
|
var previousDispatcher2 = null;
|
|
previousDispatcher2 = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = null;
|
|
disableLogs();
|
|
try {
|
|
var RunInRootFrame = {
|
|
DetermineComponentFrameRoot: function() {
|
|
try {
|
|
if (construct) {
|
|
var Fake = function() {
|
|
throw Error();
|
|
};
|
|
Object.defineProperty(Fake.prototype, "props", {
|
|
set: function() {
|
|
throw Error();
|
|
}
|
|
});
|
|
if ("object" === typeof Reflect && Reflect.construct) {
|
|
try {
|
|
Reflect.construct(Fake, []);
|
|
} catch (x) {
|
|
var control = x;
|
|
}
|
|
Reflect.construct(fn, [], Fake);
|
|
} else {
|
|
try {
|
|
Fake.call();
|
|
} catch (x$0) {
|
|
control = x$0;
|
|
}
|
|
fn.call(Fake.prototype);
|
|
}
|
|
} else {
|
|
try {
|
|
throw Error();
|
|
} catch (x$1) {
|
|
control = x$1;
|
|
}
|
|
(Fake = fn()) && "function" === typeof Fake.catch && Fake.catch(function() {
|
|
});
|
|
}
|
|
} catch (sample) {
|
|
if (sample && control && "string" === typeof sample.stack)
|
|
return [sample.stack, control.stack];
|
|
}
|
|
return [null, null];
|
|
}
|
|
};
|
|
RunInRootFrame.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
|
|
var namePropDescriptor = Object.getOwnPropertyDescriptor(
|
|
RunInRootFrame.DetermineComponentFrameRoot,
|
|
"name"
|
|
);
|
|
namePropDescriptor && namePropDescriptor.configurable && Object.defineProperty(
|
|
RunInRootFrame.DetermineComponentFrameRoot,
|
|
"name",
|
|
{ value: "DetermineComponentFrameRoot" }
|
|
);
|
|
var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], controlStack = _RunInRootFrame$Deter[1];
|
|
if (sampleStack && controlStack) {
|
|
var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n");
|
|
for (_RunInRootFrame$Deter = namePropDescriptor = 0; namePropDescriptor < sampleLines.length && !sampleLines[namePropDescriptor].includes(
|
|
"DetermineComponentFrameRoot"
|
|
); )
|
|
namePropDescriptor++;
|
|
for (; _RunInRootFrame$Deter < controlLines.length && !controlLines[_RunInRootFrame$Deter].includes(
|
|
"DetermineComponentFrameRoot"
|
|
); )
|
|
_RunInRootFrame$Deter++;
|
|
if (namePropDescriptor === sampleLines.length || _RunInRootFrame$Deter === controlLines.length)
|
|
for (namePropDescriptor = sampleLines.length - 1, _RunInRootFrame$Deter = controlLines.length - 1; 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter && sampleLines[namePropDescriptor] !== controlLines[_RunInRootFrame$Deter]; )
|
|
_RunInRootFrame$Deter--;
|
|
for (; 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; namePropDescriptor--, _RunInRootFrame$Deter--)
|
|
if (sampleLines[namePropDescriptor] !== controlLines[_RunInRootFrame$Deter]) {
|
|
if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) {
|
|
do
|
|
if (namePropDescriptor--, _RunInRootFrame$Deter--, 0 > _RunInRootFrame$Deter || sampleLines[namePropDescriptor] !== controlLines[_RunInRootFrame$Deter]) {
|
|
var _frame = "\n" + sampleLines[namePropDescriptor].replace(
|
|
" at new ",
|
|
" at "
|
|
);
|
|
fn.displayName && _frame.includes("<anonymous>") && (_frame = _frame.replace("<anonymous>", fn.displayName));
|
|
"function" === typeof fn && componentFrameCache.set(fn, _frame);
|
|
return _frame;
|
|
}
|
|
while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
} finally {
|
|
reentry = false, ReactSharedInternals.H = previousDispatcher2, reenableLogs(), Error.prepareStackTrace = frame;
|
|
}
|
|
sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "") ? describeBuiltInComponentFrame(sampleLines) : "";
|
|
"function" === typeof fn && componentFrameCache.set(fn, sampleLines);
|
|
return sampleLines;
|
|
}
|
|
function describeFiber(fiber, childFiber) {
|
|
switch (fiber.tag) {
|
|
case 26:
|
|
case 27:
|
|
case 5:
|
|
return describeBuiltInComponentFrame(fiber.type);
|
|
case 16:
|
|
return describeBuiltInComponentFrame("Lazy");
|
|
case 13:
|
|
return fiber.child !== childFiber && null !== childFiber ? describeBuiltInComponentFrame("Suspense Fallback") : describeBuiltInComponentFrame("Suspense");
|
|
case 19:
|
|
return describeBuiltInComponentFrame("SuspenseList");
|
|
case 0:
|
|
case 15:
|
|
return describeNativeComponentFrame(fiber.type, false);
|
|
case 11:
|
|
return describeNativeComponentFrame(fiber.type.render, false);
|
|
case 1:
|
|
return describeNativeComponentFrame(fiber.type, true);
|
|
case 31:
|
|
return describeBuiltInComponentFrame("Activity");
|
|
default:
|
|
return "";
|
|
}
|
|
}
|
|
function getStackByFiberInDevAndProd(workInProgress2) {
|
|
try {
|
|
var info = "", previous = null;
|
|
do {
|
|
info += describeFiber(workInProgress2, previous);
|
|
var debugInfo = workInProgress2._debugInfo;
|
|
if (debugInfo)
|
|
for (var i = debugInfo.length - 1; 0 <= i; i--) {
|
|
var entry = debugInfo[i];
|
|
if ("string" === typeof entry.name) {
|
|
var JSCompiler_temp_const = info;
|
|
a: {
|
|
var name = entry.name, env = entry.env, location = entry.debugLocation;
|
|
if (null != location) {
|
|
var childStack = formatOwnerStack(location), idx = childStack.lastIndexOf("\n"), lastLine = -1 === idx ? childStack : childStack.slice(idx + 1);
|
|
if (-1 !== lastLine.indexOf(name)) {
|
|
var JSCompiler_inline_result = "\n" + lastLine;
|
|
break a;
|
|
}
|
|
}
|
|
JSCompiler_inline_result = describeBuiltInComponentFrame(
|
|
name + (env ? " [" + env + "]" : "")
|
|
);
|
|
}
|
|
info = JSCompiler_temp_const + JSCompiler_inline_result;
|
|
}
|
|
}
|
|
previous = workInProgress2;
|
|
workInProgress2 = workInProgress2.return;
|
|
} while (workInProgress2);
|
|
return info;
|
|
} catch (x) {
|
|
return "\nError generating stack: " + x.message + "\n" + x.stack;
|
|
}
|
|
}
|
|
function describeFunctionComponentFrameWithoutLineNumber(fn) {
|
|
return (fn = fn ? fn.displayName || fn.name : "") ? describeBuiltInComponentFrame(fn) : "";
|
|
}
|
|
function getCurrentFiberOwnerNameInDevOrNull() {
|
|
if (null === current) return null;
|
|
var owner = current._debugOwner;
|
|
return null != owner ? getComponentNameFromOwner(owner) : null;
|
|
}
|
|
function getCurrentFiberStackInDev() {
|
|
if (null === current) return "";
|
|
var workInProgress2 = current;
|
|
try {
|
|
var info = "";
|
|
6 === workInProgress2.tag && (workInProgress2 = workInProgress2.return);
|
|
switch (workInProgress2.tag) {
|
|
case 26:
|
|
case 27:
|
|
case 5:
|
|
info += describeBuiltInComponentFrame(workInProgress2.type);
|
|
break;
|
|
case 13:
|
|
info += describeBuiltInComponentFrame("Suspense");
|
|
break;
|
|
case 19:
|
|
info += describeBuiltInComponentFrame("SuspenseList");
|
|
break;
|
|
case 31:
|
|
info += describeBuiltInComponentFrame("Activity");
|
|
break;
|
|
case 30:
|
|
case 0:
|
|
case 15:
|
|
case 1:
|
|
workInProgress2._debugOwner || "" !== info || (info += describeFunctionComponentFrameWithoutLineNumber(
|
|
workInProgress2.type
|
|
));
|
|
break;
|
|
case 11:
|
|
workInProgress2._debugOwner || "" !== info || (info += describeFunctionComponentFrameWithoutLineNumber(
|
|
workInProgress2.type.render
|
|
));
|
|
}
|
|
for (; workInProgress2; )
|
|
if ("number" === typeof workInProgress2.tag) {
|
|
var fiber = workInProgress2;
|
|
workInProgress2 = fiber._debugOwner;
|
|
var debugStack = fiber._debugStack;
|
|
if (workInProgress2 && debugStack) {
|
|
var formattedStack = formatOwnerStack(debugStack);
|
|
"" !== formattedStack && (info += "\n" + formattedStack);
|
|
}
|
|
} else if (null != workInProgress2.debugStack) {
|
|
var ownerStack = workInProgress2.debugStack;
|
|
(workInProgress2 = workInProgress2.owner) && ownerStack && (info += "\n" + formatOwnerStack(ownerStack));
|
|
} else break;
|
|
var JSCompiler_inline_result = info;
|
|
} catch (x) {
|
|
JSCompiler_inline_result = "\nError generating stack: " + x.message + "\n" + x.stack;
|
|
}
|
|
return JSCompiler_inline_result;
|
|
}
|
|
function runWithFiberInDEV(fiber, callback, arg0, arg1, arg2, arg3, arg4) {
|
|
var previousFiber = current;
|
|
setCurrentFiber(fiber);
|
|
try {
|
|
return null !== fiber && fiber._debugTask ? fiber._debugTask.run(
|
|
callback.bind(null, arg0, arg1, arg2, arg3, arg4)
|
|
) : callback(arg0, arg1, arg2, arg3, arg4);
|
|
} finally {
|
|
setCurrentFiber(previousFiber);
|
|
}
|
|
throw Error(
|
|
"runWithFiberInDEV should never be called in production. This is a bug in React."
|
|
);
|
|
}
|
|
function setCurrentFiber(fiber) {
|
|
ReactSharedInternals.getCurrentStack = null === fiber ? null : getCurrentFiberStackInDev;
|
|
isRendering = false;
|
|
current = fiber;
|
|
}
|
|
function typeName(value) {
|
|
return "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
}
|
|
function willCoercionThrow(value) {
|
|
try {
|
|
return testStringCoercion(value), false;
|
|
} catch (e) {
|
|
return true;
|
|
}
|
|
}
|
|
function testStringCoercion(value) {
|
|
return "" + value;
|
|
}
|
|
function checkAttributeStringCoercion(value, attributeName) {
|
|
if (willCoercionThrow(value))
|
|
return console.error(
|
|
"The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
attributeName,
|
|
typeName(value)
|
|
), testStringCoercion(value);
|
|
}
|
|
function checkCSSPropertyStringCoercion(value, propName) {
|
|
if (willCoercionThrow(value))
|
|
return console.error(
|
|
"The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
propName,
|
|
typeName(value)
|
|
), testStringCoercion(value);
|
|
}
|
|
function checkFormFieldValueStringCoercion(value) {
|
|
if (willCoercionThrow(value))
|
|
return console.error(
|
|
"Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.",
|
|
typeName(value)
|
|
), testStringCoercion(value);
|
|
}
|
|
function injectInternals(internals) {
|
|
if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return false;
|
|
var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
if (hook.isDisabled) return true;
|
|
if (!hook.supportsFiber)
|
|
return console.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"
|
|
), true;
|
|
try {
|
|
rendererID = hook.inject(internals), injectedHook = hook;
|
|
} catch (err) {
|
|
console.error("React instrumentation encountered an error: %o.", err);
|
|
}
|
|
return hook.checkDCE ? true : false;
|
|
}
|
|
function setIsStrictModeForDevtools(newIsStrictMode) {
|
|
"function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode);
|
|
if (injectedHook && "function" === typeof injectedHook.setStrictMode)
|
|
try {
|
|
injectedHook.setStrictMode(rendererID, newIsStrictMode);
|
|
} catch (err) {
|
|
hasLoggedError || (hasLoggedError = true, console.error(
|
|
"React instrumentation encountered an error: %o",
|
|
err
|
|
));
|
|
}
|
|
}
|
|
function clz32Fallback(x) {
|
|
x >>>= 0;
|
|
return 0 === x ? 32 : 31 - (log(x) / LN2 | 0) | 0;
|
|
}
|
|
function getHighestPriorityLanes(lanes) {
|
|
var pendingSyncLanes = lanes & 42;
|
|
if (0 !== pendingSyncLanes) return pendingSyncLanes;
|
|
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:
|
|
return 64;
|
|
case 128:
|
|
return 128;
|
|
case 256:
|
|
case 512:
|
|
case 1024:
|
|
case 2048:
|
|
case 4096:
|
|
case 8192:
|
|
case 16384:
|
|
case 32768:
|
|
case 65536:
|
|
case 131072:
|
|
return lanes & 261888;
|
|
case 262144:
|
|
case 524288:
|
|
case 1048576:
|
|
case 2097152:
|
|
return lanes & 3932160;
|
|
case 4194304:
|
|
case 8388608:
|
|
case 16777216:
|
|
case 33554432:
|
|
return lanes & 62914560;
|
|
case 67108864:
|
|
return 67108864;
|
|
case 134217728:
|
|
return 134217728;
|
|
case 268435456:
|
|
return 268435456;
|
|
case 536870912:
|
|
return 536870912;
|
|
case 1073741824:
|
|
return 0;
|
|
default:
|
|
return console.error(
|
|
"Should have found matching lanes. This is a bug in React."
|
|
), lanes;
|
|
}
|
|
}
|
|
function getNextLanes(root2, wipLanes, rootHasPendingCommit) {
|
|
var pendingLanes = root2.pendingLanes;
|
|
if (0 === pendingLanes) return 0;
|
|
var nextLanes = 0, suspendedLanes = root2.suspendedLanes, pingedLanes = root2.pingedLanes;
|
|
root2 = root2.warmLanes;
|
|
var nonIdlePendingLanes = pendingLanes & 134217727;
|
|
0 !== nonIdlePendingLanes ? (pendingLanes = nonIdlePendingLanes & ~suspendedLanes, 0 !== pendingLanes ? nextLanes = getHighestPriorityLanes(pendingLanes) : (pingedLanes &= nonIdlePendingLanes, 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = nonIdlePendingLanes & ~root2, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : (nonIdlePendingLanes = pendingLanes & ~suspendedLanes, 0 !== nonIdlePendingLanes ? nextLanes = getHighestPriorityLanes(nonIdlePendingLanes) : 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = pendingLanes & ~root2, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))));
|
|
return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && (suspendedLanes = nextLanes & -nextLanes, rootHasPendingCommit = wipLanes & -wipLanes, suspendedLanes >= rootHasPendingCommit || 32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048)) ? wipLanes : nextLanes;
|
|
}
|
|
function checkIfRootIsPrerendering(root2, renderLanes2) {
|
|
return 0 === (root2.pendingLanes & ~(root2.suspendedLanes & ~root2.pingedLanes) & renderLanes2);
|
|
}
|
|
function computeExpirationTime(lane, currentTime) {
|
|
switch (lane) {
|
|
case 1:
|
|
case 2:
|
|
case 4:
|
|
case 8:
|
|
case 64:
|
|
return currentTime + 250;
|
|
case 16:
|
|
case 32:
|
|
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:
|
|
return -1;
|
|
case 67108864:
|
|
case 134217728:
|
|
case 268435456:
|
|
case 536870912:
|
|
case 1073741824:
|
|
return -1;
|
|
default:
|
|
return console.error(
|
|
"Should have found matching lanes. This is a bug in React."
|
|
), -1;
|
|
}
|
|
}
|
|
function claimNextRetryLane() {
|
|
var lane = nextRetryLane;
|
|
nextRetryLane <<= 1;
|
|
0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304);
|
|
return lane;
|
|
}
|
|
function createLaneMap(initial) {
|
|
for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial);
|
|
return laneMap;
|
|
}
|
|
function markRootUpdated$1(root2, updateLane) {
|
|
root2.pendingLanes |= updateLane;
|
|
268435456 !== updateLane && (root2.suspendedLanes = 0, root2.pingedLanes = 0, root2.warmLanes = 0);
|
|
}
|
|
function markRootFinished(root2, finishedLanes, remainingLanes, spawnedLane, updatedLanes, suspendedRetryLanes) {
|
|
var previouslyPendingLanes = root2.pendingLanes;
|
|
root2.pendingLanes = remainingLanes;
|
|
root2.suspendedLanes = 0;
|
|
root2.pingedLanes = 0;
|
|
root2.warmLanes = 0;
|
|
root2.expiredLanes &= remainingLanes;
|
|
root2.entangledLanes &= remainingLanes;
|
|
root2.errorRecoveryDisabledLanes &= remainingLanes;
|
|
root2.shellSuspendCounter = 0;
|
|
var entanglements = root2.entanglements, expirationTimes = root2.expirationTimes, hiddenUpdates = root2.hiddenUpdates;
|
|
for (remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) {
|
|
var index = 31 - clz32(remainingLanes), lane = 1 << index;
|
|
entanglements[index] = 0;
|
|
expirationTimes[index] = -1;
|
|
var hiddenUpdatesForLane = hiddenUpdates[index];
|
|
if (null !== hiddenUpdatesForLane)
|
|
for (hiddenUpdates[index] = null, index = 0; index < hiddenUpdatesForLane.length; index++) {
|
|
var update2 = hiddenUpdatesForLane[index];
|
|
null !== update2 && (update2.lane &= -536870913);
|
|
}
|
|
remainingLanes &= ~lane;
|
|
}
|
|
0 !== spawnedLane && markSpawnedDeferredLane(root2, spawnedLane, 0);
|
|
0 !== suspendedRetryLanes && 0 === updatedLanes && 0 !== root2.tag && (root2.suspendedLanes |= suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes));
|
|
}
|
|
function markSpawnedDeferredLane(root2, spawnedLane, entangledLanes) {
|
|
root2.pendingLanes |= spawnedLane;
|
|
root2.suspendedLanes &= ~spawnedLane;
|
|
var spawnedLaneIndex = 31 - clz32(spawnedLane);
|
|
root2.entangledLanes |= spawnedLane;
|
|
root2.entanglements[spawnedLaneIndex] = root2.entanglements[spawnedLaneIndex] | 1073741824 | entangledLanes & 261930;
|
|
}
|
|
function markRootEntangled(root2, entangledLanes) {
|
|
var rootEntangledLanes = root2.entangledLanes |= entangledLanes;
|
|
for (root2 = root2.entanglements; rootEntangledLanes; ) {
|
|
var index = 31 - clz32(rootEntangledLanes), lane = 1 << index;
|
|
lane & entangledLanes | root2[index] & entangledLanes && (root2[index] |= entangledLanes);
|
|
rootEntangledLanes &= ~lane;
|
|
}
|
|
}
|
|
function getBumpedLaneForHydration(root2, renderLanes2) {
|
|
var renderLane = renderLanes2 & -renderLanes2;
|
|
renderLane = 0 !== (renderLane & 42) ? 1 : getBumpedLaneForHydrationByLane(renderLane);
|
|
return 0 !== (renderLane & (root2.suspendedLanes | renderLanes2)) ? 0 : renderLane;
|
|
}
|
|
function getBumpedLaneForHydrationByLane(lane) {
|
|
switch (lane) {
|
|
case 2:
|
|
lane = 1;
|
|
break;
|
|
case 8:
|
|
lane = 4;
|
|
break;
|
|
case 32:
|
|
lane = 16;
|
|
break;
|
|
case 256:
|
|
case 512:
|
|
case 1024:
|
|
case 2048:
|
|
case 4096:
|
|
case 8192:
|
|
case 16384:
|
|
case 32768:
|
|
case 65536:
|
|
case 131072:
|
|
case 262144:
|
|
case 524288:
|
|
case 1048576:
|
|
case 2097152:
|
|
case 4194304:
|
|
case 8388608:
|
|
case 16777216:
|
|
case 33554432:
|
|
lane = 128;
|
|
break;
|
|
case 268435456:
|
|
lane = 134217728;
|
|
break;
|
|
default:
|
|
lane = 0;
|
|
}
|
|
return lane;
|
|
}
|
|
function addFiberToLanesMap(root2, fiber, lanes) {
|
|
if (isDevToolsPresent)
|
|
for (root2 = root2.pendingUpdatersLaneMap; 0 < lanes; ) {
|
|
var index = 31 - clz32(lanes), lane = 1 << index;
|
|
root2[index].add(fiber);
|
|
lanes &= ~lane;
|
|
}
|
|
}
|
|
function movePendingFibersToMemoized(root2, lanes) {
|
|
if (isDevToolsPresent)
|
|
for (var pendingUpdatersLaneMap = root2.pendingUpdatersLaneMap, memoizedUpdaters = root2.memoizedUpdaters; 0 < lanes; ) {
|
|
var index = 31 - clz32(lanes);
|
|
root2 = 1 << index;
|
|
index = pendingUpdatersLaneMap[index];
|
|
0 < index.size && (index.forEach(function(fiber) {
|
|
var alternate = fiber.alternate;
|
|
null !== alternate && memoizedUpdaters.has(alternate) || memoizedUpdaters.add(fiber);
|
|
}), index.clear());
|
|
lanes &= ~root2;
|
|
}
|
|
}
|
|
function lanesToEventPriority(lanes) {
|
|
lanes &= -lanes;
|
|
return 0 !== DiscreteEventPriority && DiscreteEventPriority < lanes ? 0 !== ContinuousEventPriority && ContinuousEventPriority < lanes ? 0 !== (lanes & 134217727) ? DefaultEventPriority : IdleEventPriority : ContinuousEventPriority : DiscreteEventPriority;
|
|
}
|
|
function resolveUpdatePriority() {
|
|
var updatePriority = ReactDOMSharedInternals.p;
|
|
if (0 !== updatePriority) return updatePriority;
|
|
updatePriority = window.event;
|
|
return void 0 === updatePriority ? DefaultEventPriority : getEventPriority(updatePriority.type);
|
|
}
|
|
function runWithPriority(priority, fn) {
|
|
var previousPriority = ReactDOMSharedInternals.p;
|
|
try {
|
|
return ReactDOMSharedInternals.p = priority, fn();
|
|
} finally {
|
|
ReactDOMSharedInternals.p = previousPriority;
|
|
}
|
|
}
|
|
function detachDeletedInstance(node2) {
|
|
delete node2[internalInstanceKey];
|
|
delete node2[internalPropsKey];
|
|
delete node2[internalEventHandlersKey];
|
|
delete node2[internalEventHandlerListenersKey];
|
|
delete node2[internalEventHandlesSetKey];
|
|
}
|
|
function getClosestInstanceFromNode(targetNode) {
|
|
var targetInst = targetNode[internalInstanceKey];
|
|
if (targetInst) return targetInst;
|
|
for (var parentNode = targetNode.parentNode; parentNode; ) {
|
|
if (targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey]) {
|
|
parentNode = targetInst.alternate;
|
|
if (null !== targetInst.child || null !== parentNode && null !== parentNode.child)
|
|
for (targetNode = getParentHydrationBoundary(targetNode); null !== targetNode; ) {
|
|
if (parentNode = targetNode[internalInstanceKey])
|
|
return parentNode;
|
|
targetNode = getParentHydrationBoundary(targetNode);
|
|
}
|
|
return targetInst;
|
|
}
|
|
targetNode = parentNode;
|
|
parentNode = targetNode.parentNode;
|
|
}
|
|
return null;
|
|
}
|
|
function getInstanceFromNode(node2) {
|
|
if (node2 = node2[internalInstanceKey] || node2[internalContainerInstanceKey]) {
|
|
var tag = node2.tag;
|
|
if (5 === tag || 6 === tag || 13 === tag || 31 === tag || 26 === tag || 27 === tag || 3 === tag)
|
|
return node2;
|
|
}
|
|
return null;
|
|
}
|
|
function getNodeFromInstance(inst) {
|
|
var tag = inst.tag;
|
|
if (5 === tag || 26 === tag || 27 === tag || 6 === tag)
|
|
return inst.stateNode;
|
|
throw Error("getNodeFromInstance: Invalid argument.");
|
|
}
|
|
function getResourcesFromRoot(root2) {
|
|
var resources = root2[internalRootNodeResourcesKey];
|
|
resources || (resources = root2[internalRootNodeResourcesKey] = { hoistableStyles: /* @__PURE__ */ new Map(), hoistableScripts: /* @__PURE__ */ new Map() });
|
|
return resources;
|
|
}
|
|
function markNodeAsHoistable(node2) {
|
|
node2[internalHoistableMarker] = true;
|
|
}
|
|
function registerTwoPhaseEvent(registrationName, dependencies) {
|
|
registerDirectEvent(registrationName, dependencies);
|
|
registerDirectEvent(registrationName + "Capture", dependencies);
|
|
}
|
|
function registerDirectEvent(registrationName, dependencies) {
|
|
registrationNameDependencies[registrationName] && console.error(
|
|
"EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",
|
|
registrationName
|
|
);
|
|
registrationNameDependencies[registrationName] = dependencies;
|
|
var lowerCasedName = registrationName.toLowerCase();
|
|
possibleRegistrationNames[lowerCasedName] = registrationName;
|
|
"onDoubleClick" === registrationName && (possibleRegistrationNames.ondblclick = registrationName);
|
|
for (registrationName = 0; registrationName < dependencies.length; registrationName++)
|
|
allNativeEvents.add(dependencies[registrationName]);
|
|
}
|
|
function checkControlledValueProps(tagName, props) {
|
|
hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || null == props.value || ("select" === tagName ? console.error(
|
|
"You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`."
|
|
) : console.error(
|
|
"You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."
|
|
));
|
|
props.onChange || props.readOnly || props.disabled || null == props.checked || console.error(
|
|
"You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`."
|
|
);
|
|
}
|
|
function isAttributeNameSafe(attributeName) {
|
|
if (hasOwnProperty.call(validatedAttributeNameCache, attributeName))
|
|
return true;
|
|
if (hasOwnProperty.call(illegalAttributeNameCache, attributeName))
|
|
return false;
|
|
if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName))
|
|
return validatedAttributeNameCache[attributeName] = true;
|
|
illegalAttributeNameCache[attributeName] = true;
|
|
console.error("Invalid attribute name: `%s`", attributeName);
|
|
return false;
|
|
}
|
|
function getValueForAttributeOnCustomComponent(node2, name, expected) {
|
|
if (isAttributeNameSafe(name)) {
|
|
if (!node2.hasAttribute(name)) {
|
|
switch (typeof expected) {
|
|
case "symbol":
|
|
case "object":
|
|
return expected;
|
|
case "function":
|
|
return expected;
|
|
case "boolean":
|
|
if (false === expected) return expected;
|
|
}
|
|
return void 0 === expected ? void 0 : null;
|
|
}
|
|
node2 = node2.getAttribute(name);
|
|
if ("" === node2 && true === expected) return true;
|
|
checkAttributeStringCoercion(expected, name);
|
|
return node2 === "" + expected ? expected : node2;
|
|
}
|
|
}
|
|
function setValueForAttribute(node2, name, value) {
|
|
if (isAttributeNameSafe(name))
|
|
if (null === value) node2.removeAttribute(name);
|
|
else {
|
|
switch (typeof value) {
|
|
case "undefined":
|
|
case "function":
|
|
case "symbol":
|
|
node2.removeAttribute(name);
|
|
return;
|
|
case "boolean":
|
|
var prefix3 = name.toLowerCase().slice(0, 5);
|
|
if ("data-" !== prefix3 && "aria-" !== prefix3) {
|
|
node2.removeAttribute(name);
|
|
return;
|
|
}
|
|
}
|
|
checkAttributeStringCoercion(value, name);
|
|
node2.setAttribute(name, "" + value);
|
|
}
|
|
}
|
|
function setValueForKnownAttribute(node2, name, value) {
|
|
if (null === value) node2.removeAttribute(name);
|
|
else {
|
|
switch (typeof value) {
|
|
case "undefined":
|
|
case "function":
|
|
case "symbol":
|
|
case "boolean":
|
|
node2.removeAttribute(name);
|
|
return;
|
|
}
|
|
checkAttributeStringCoercion(value, name);
|
|
node2.setAttribute(name, "" + value);
|
|
}
|
|
}
|
|
function setValueForNamespacedAttribute(node2, namespace, name, value) {
|
|
if (null === value) node2.removeAttribute(name);
|
|
else {
|
|
switch (typeof value) {
|
|
case "undefined":
|
|
case "function":
|
|
case "symbol":
|
|
case "boolean":
|
|
node2.removeAttribute(name);
|
|
return;
|
|
}
|
|
checkAttributeStringCoercion(value, name);
|
|
node2.setAttributeNS(namespace, name, "" + value);
|
|
}
|
|
}
|
|
function getToStringValue(value) {
|
|
switch (typeof value) {
|
|
case "bigint":
|
|
case "boolean":
|
|
case "number":
|
|
case "string":
|
|
case "undefined":
|
|
return value;
|
|
case "object":
|
|
return checkFormFieldValueStringCoercion(value), value;
|
|
default:
|
|
return "";
|
|
}
|
|
}
|
|
function isCheckable(elem) {
|
|
var type = elem.type;
|
|
return (elem = elem.nodeName) && "input" === elem.toLowerCase() && ("checkbox" === type || "radio" === type);
|
|
}
|
|
function trackValueOnNode(node2, valueField, currentValue) {
|
|
var descriptor = Object.getOwnPropertyDescriptor(
|
|
node2.constructor.prototype,
|
|
valueField
|
|
);
|
|
if (!node2.hasOwnProperty(valueField) && "undefined" !== typeof descriptor && "function" === typeof descriptor.get && "function" === typeof descriptor.set) {
|
|
var get = descriptor.get, set = descriptor.set;
|
|
Object.defineProperty(node2, valueField, {
|
|
configurable: true,
|
|
get: function() {
|
|
return get.call(this);
|
|
},
|
|
set: function(value) {
|
|
checkFormFieldValueStringCoercion(value);
|
|
currentValue = "" + value;
|
|
set.call(this, value);
|
|
}
|
|
});
|
|
Object.defineProperty(node2, valueField, {
|
|
enumerable: descriptor.enumerable
|
|
});
|
|
return {
|
|
getValue: function() {
|
|
return currentValue;
|
|
},
|
|
setValue: function(value) {
|
|
checkFormFieldValueStringCoercion(value);
|
|
currentValue = "" + value;
|
|
},
|
|
stopTracking: function() {
|
|
node2._valueTracker = null;
|
|
delete node2[valueField];
|
|
}
|
|
};
|
|
}
|
|
}
|
|
function track(node2) {
|
|
if (!node2._valueTracker) {
|
|
var valueField = isCheckable(node2) ? "checked" : "value";
|
|
node2._valueTracker = trackValueOnNode(
|
|
node2,
|
|
valueField,
|
|
"" + node2[valueField]
|
|
);
|
|
}
|
|
}
|
|
function updateValueIfChanged(node2) {
|
|
if (!node2) return false;
|
|
var tracker = node2._valueTracker;
|
|
if (!tracker) return true;
|
|
var lastValue = tracker.getValue();
|
|
var value = "";
|
|
node2 && (value = isCheckable(node2) ? node2.checked ? "true" : "false" : node2.value);
|
|
node2 = value;
|
|
return node2 !== lastValue ? (tracker.setValue(node2), true) : false;
|
|
}
|
|
function getActiveElement(doc) {
|
|
doc = doc || ("undefined" !== typeof document ? document : void 0);
|
|
if ("undefined" === typeof doc) return null;
|
|
try {
|
|
return doc.activeElement || doc.body;
|
|
} catch (e) {
|
|
return doc.body;
|
|
}
|
|
}
|
|
function escapeSelectorAttributeValueInsideDoubleQuotes(value) {
|
|
return value.replace(
|
|
escapeSelectorAttributeValueInsideDoubleQuotesRegex,
|
|
function(ch) {
|
|
return "\\" + ch.charCodeAt(0).toString(16) + " ";
|
|
}
|
|
);
|
|
}
|
|
function validateInputProps(element, props) {
|
|
void 0 === props.checked || void 0 === props.defaultChecked || didWarnCheckedDefaultChecked || (console.error(
|
|
"%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",
|
|
getCurrentFiberOwnerNameInDevOrNull() || "A component",
|
|
props.type
|
|
), didWarnCheckedDefaultChecked = true);
|
|
void 0 === props.value || void 0 === props.defaultValue || didWarnValueDefaultValue$1 || (console.error(
|
|
"%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",
|
|
getCurrentFiberOwnerNameInDevOrNull() || "A component",
|
|
props.type
|
|
), didWarnValueDefaultValue$1 = true);
|
|
}
|
|
function updateInput(element, value, defaultValue, lastDefaultValue, checked, defaultChecked, type, name) {
|
|
element.name = "";
|
|
null != type && "function" !== typeof type && "symbol" !== typeof type && "boolean" !== typeof type ? (checkAttributeStringCoercion(type, "type"), element.type = type) : element.removeAttribute("type");
|
|
if (null != value)
|
|
if ("number" === type) {
|
|
if (0 === value && "" === element.value || element.value != value)
|
|
element.value = "" + getToStringValue(value);
|
|
} else
|
|
element.value !== "" + getToStringValue(value) && (element.value = "" + getToStringValue(value));
|
|
else
|
|
"submit" !== type && "reset" !== type || element.removeAttribute("value");
|
|
null != value ? setDefaultValue(element, type, getToStringValue(value)) : null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) : null != lastDefaultValue && element.removeAttribute("value");
|
|
null == checked && null != defaultChecked && (element.defaultChecked = !!defaultChecked);
|
|
null != checked && (element.checked = checked && "function" !== typeof checked && "symbol" !== typeof checked);
|
|
null != name && "function" !== typeof name && "symbol" !== typeof name && "boolean" !== typeof name ? (checkAttributeStringCoercion(name, "name"), element.name = "" + getToStringValue(name)) : element.removeAttribute("name");
|
|
}
|
|
function initInput(element, value, defaultValue, checked, defaultChecked, type, name, isHydrating2) {
|
|
null != type && "function" !== typeof type && "symbol" !== typeof type && "boolean" !== typeof type && (checkAttributeStringCoercion(type, "type"), element.type = type);
|
|
if (null != value || null != defaultValue) {
|
|
if (!("submit" !== type && "reset" !== type || void 0 !== value && null !== value)) {
|
|
track(element);
|
|
return;
|
|
}
|
|
defaultValue = null != defaultValue ? "" + getToStringValue(defaultValue) : "";
|
|
value = null != value ? "" + getToStringValue(value) : defaultValue;
|
|
isHydrating2 || value === element.value || (element.value = value);
|
|
element.defaultValue = value;
|
|
}
|
|
checked = null != checked ? checked : defaultChecked;
|
|
checked = "function" !== typeof checked && "symbol" !== typeof checked && !!checked;
|
|
element.checked = isHydrating2 ? element.checked : !!checked;
|
|
element.defaultChecked = !!checked;
|
|
null != name && "function" !== typeof name && "symbol" !== typeof name && "boolean" !== typeof name && (checkAttributeStringCoercion(name, "name"), element.name = name);
|
|
track(element);
|
|
}
|
|
function setDefaultValue(node2, type, value) {
|
|
"number" === type && getActiveElement(node2.ownerDocument) === node2 || node2.defaultValue === "" + value || (node2.defaultValue = "" + value);
|
|
}
|
|
function validateOptionProps(element, props) {
|
|
null == props.value && ("object" === typeof props.children && null !== props.children ? React58.Children.forEach(props.children, function(child) {
|
|
null == child || "string" === typeof child || "number" === typeof child || "bigint" === typeof child || didWarnInvalidChild || (didWarnInvalidChild = true, console.error(
|
|
"Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>."
|
|
));
|
|
}) : null == props.dangerouslySetInnerHTML || didWarnInvalidInnerHTML || (didWarnInvalidInnerHTML = true, console.error(
|
|
"Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."
|
|
)));
|
|
null == props.selected || didWarnSelectedSetOnOption || (console.error(
|
|
"Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."
|
|
), didWarnSelectedSetOnOption = true);
|
|
}
|
|
function getDeclarationErrorAddendum() {
|
|
var ownerName = getCurrentFiberOwnerNameInDevOrNull();
|
|
return ownerName ? "\n\nCheck the render method of `" + ownerName + "`." : "";
|
|
}
|
|
function updateOptions(node2, multiple, propValue, setDefaultSelected) {
|
|
node2 = node2.options;
|
|
if (multiple) {
|
|
multiple = {};
|
|
for (var i = 0; i < propValue.length; i++)
|
|
multiple["$" + propValue[i]] = true;
|
|
for (propValue = 0; propValue < node2.length; propValue++)
|
|
i = multiple.hasOwnProperty("$" + node2[propValue].value), node2[propValue].selected !== i && (node2[propValue].selected = i), i && setDefaultSelected && (node2[propValue].defaultSelected = true);
|
|
} else {
|
|
propValue = "" + getToStringValue(propValue);
|
|
multiple = null;
|
|
for (i = 0; i < node2.length; i++) {
|
|
if (node2[i].value === propValue) {
|
|
node2[i].selected = true;
|
|
setDefaultSelected && (node2[i].defaultSelected = true);
|
|
return;
|
|
}
|
|
null !== multiple || node2[i].disabled || (multiple = node2[i]);
|
|
}
|
|
null !== multiple && (multiple.selected = true);
|
|
}
|
|
}
|
|
function validateSelectProps(element, props) {
|
|
for (element = 0; element < valuePropNames.length; element++) {
|
|
var propName = valuePropNames[element];
|
|
if (null != props[propName]) {
|
|
var propNameIsArray = isArrayImpl(props[propName]);
|
|
props.multiple && !propNameIsArray ? console.error(
|
|
"The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",
|
|
propName,
|
|
getDeclarationErrorAddendum()
|
|
) : !props.multiple && propNameIsArray && console.error(
|
|
"The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",
|
|
propName,
|
|
getDeclarationErrorAddendum()
|
|
);
|
|
}
|
|
}
|
|
void 0 === props.value || void 0 === props.defaultValue || didWarnValueDefaultValue || (console.error(
|
|
"Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://react.dev/link/controlled-components"
|
|
), didWarnValueDefaultValue = true);
|
|
}
|
|
function validateTextareaProps(element, props) {
|
|
void 0 === props.value || void 0 === props.defaultValue || didWarnValDefaultVal || (console.error(
|
|
"%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://react.dev/link/controlled-components",
|
|
getCurrentFiberOwnerNameInDevOrNull() || "A component"
|
|
), didWarnValDefaultVal = true);
|
|
null != props.children && null == props.value && console.error(
|
|
"Use the `defaultValue` or `value` props instead of setting children on <textarea>."
|
|
);
|
|
}
|
|
function updateTextarea(element, value, defaultValue) {
|
|
if (null != value && (value = "" + getToStringValue(value), value !== element.value && (element.value = value), null == defaultValue)) {
|
|
element.defaultValue !== value && (element.defaultValue = value);
|
|
return;
|
|
}
|
|
element.defaultValue = null != defaultValue ? "" + getToStringValue(defaultValue) : "";
|
|
}
|
|
function initTextarea(element, value, defaultValue, children) {
|
|
if (null == value) {
|
|
if (null != children) {
|
|
if (null != defaultValue)
|
|
throw Error(
|
|
"If you supply `defaultValue` on a <textarea>, do not pass children."
|
|
);
|
|
if (isArrayImpl(children)) {
|
|
if (1 < children.length)
|
|
throw Error("<textarea> can only have at most one child.");
|
|
children = children[0];
|
|
}
|
|
defaultValue = children;
|
|
}
|
|
null == defaultValue && (defaultValue = "");
|
|
value = defaultValue;
|
|
}
|
|
defaultValue = getToStringValue(value);
|
|
element.defaultValue = defaultValue;
|
|
children = element.textContent;
|
|
children === defaultValue && "" !== children && null !== children && (element.value = children);
|
|
track(element);
|
|
}
|
|
function findNotableNode(node2, indent) {
|
|
return void 0 === node2.serverProps && 0 === node2.serverTail.length && 1 === node2.children.length && 3 < node2.distanceFromLeaf && node2.distanceFromLeaf > 15 - indent ? findNotableNode(node2.children[0], indent) : node2;
|
|
}
|
|
function indentation(indent) {
|
|
return " " + " ".repeat(indent);
|
|
}
|
|
function added(indent) {
|
|
return "+ " + " ".repeat(indent);
|
|
}
|
|
function removed(indent) {
|
|
return "- " + " ".repeat(indent);
|
|
}
|
|
function describeFiberType(fiber) {
|
|
switch (fiber.tag) {
|
|
case 26:
|
|
case 27:
|
|
case 5:
|
|
return fiber.type;
|
|
case 16:
|
|
return "Lazy";
|
|
case 31:
|
|
return "Activity";
|
|
case 13:
|
|
return "Suspense";
|
|
case 19:
|
|
return "SuspenseList";
|
|
case 0:
|
|
case 15:
|
|
return fiber = fiber.type, fiber.displayName || fiber.name || null;
|
|
case 11:
|
|
return fiber = fiber.type.render, fiber.displayName || fiber.name || null;
|
|
case 1:
|
|
return fiber = fiber.type, fiber.displayName || fiber.name || null;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
function describeTextNode(content, maxLength) {
|
|
return needsEscaping.test(content) ? (content = JSON.stringify(content), content.length > maxLength - 2 ? 8 > maxLength ? '{"..."}' : "{" + content.slice(0, maxLength - 7) + '..."}' : "{" + content + "}") : content.length > maxLength ? 5 > maxLength ? '{"..."}' : content.slice(0, maxLength - 3) + "..." : content;
|
|
}
|
|
function describeTextDiff(clientText, serverProps, indent) {
|
|
var maxLength = 120 - 2 * indent;
|
|
if (null === serverProps)
|
|
return added(indent) + describeTextNode(clientText, maxLength) + "\n";
|
|
if ("string" === typeof serverProps) {
|
|
for (var firstDiff = 0; firstDiff < serverProps.length && firstDiff < clientText.length && serverProps.charCodeAt(firstDiff) === clientText.charCodeAt(firstDiff); firstDiff++) ;
|
|
firstDiff > maxLength - 8 && 10 < firstDiff && (clientText = "..." + clientText.slice(firstDiff - 8), serverProps = "..." + serverProps.slice(firstDiff - 8));
|
|
return added(indent) + describeTextNode(clientText, maxLength) + "\n" + removed(indent) + describeTextNode(serverProps, maxLength) + "\n";
|
|
}
|
|
return indentation(indent) + describeTextNode(clientText, maxLength) + "\n";
|
|
}
|
|
function objectName(object) {
|
|
return Object.prototype.toString.call(object).replace(/^\[object (.*)\]$/, function(m, p0) {
|
|
return p0;
|
|
});
|
|
}
|
|
function describeValue(value, maxLength) {
|
|
switch (typeof value) {
|
|
case "string":
|
|
return value = JSON.stringify(value), value.length > maxLength ? 5 > maxLength ? '"..."' : value.slice(0, maxLength - 4) + '..."' : value;
|
|
case "object":
|
|
if (null === value) return "null";
|
|
if (isArrayImpl(value)) return "[...]";
|
|
if (value.$$typeof === REACT_ELEMENT_TYPE)
|
|
return (maxLength = getComponentNameFromType(value.type)) ? "<" + maxLength + ">" : "<...>";
|
|
var name = objectName(value);
|
|
if ("Object" === name) {
|
|
name = "";
|
|
maxLength -= 2;
|
|
for (var propName in value)
|
|
if (value.hasOwnProperty(propName)) {
|
|
var jsonPropName = JSON.stringify(propName);
|
|
jsonPropName !== '"' + propName + '"' && (propName = jsonPropName);
|
|
maxLength -= propName.length - 2;
|
|
jsonPropName = describeValue(
|
|
value[propName],
|
|
15 > maxLength ? maxLength : 15
|
|
);
|
|
maxLength -= jsonPropName.length;
|
|
if (0 > maxLength) {
|
|
name += "" === name ? "..." : ", ...";
|
|
break;
|
|
}
|
|
name += ("" === name ? "" : ",") + propName + ":" + jsonPropName;
|
|
}
|
|
return "{" + name + "}";
|
|
}
|
|
return name;
|
|
case "function":
|
|
return (maxLength = value.displayName || value.name) ? "function " + maxLength : "function";
|
|
default:
|
|
return String(value);
|
|
}
|
|
}
|
|
function describePropValue(value, maxLength) {
|
|
return "string" !== typeof value || needsEscaping.test(value) ? "{" + describeValue(value, maxLength - 2) + "}" : value.length > maxLength - 2 ? 5 > maxLength ? '"..."' : '"' + value.slice(0, maxLength - 5) + '..."' : '"' + value + '"';
|
|
}
|
|
function describeExpandedElement(type, props, rowPrefix) {
|
|
var remainingRowLength = 120 - rowPrefix.length - type.length, properties2 = [], propName;
|
|
for (propName in props)
|
|
if (props.hasOwnProperty(propName) && "children" !== propName) {
|
|
var propValue = describePropValue(
|
|
props[propName],
|
|
120 - rowPrefix.length - propName.length - 1
|
|
);
|
|
remainingRowLength -= propName.length + propValue.length + 2;
|
|
properties2.push(propName + "=" + propValue);
|
|
}
|
|
return 0 === properties2.length ? rowPrefix + "<" + type + ">\n" : 0 < remainingRowLength ? rowPrefix + "<" + type + " " + properties2.join(" ") + ">\n" : rowPrefix + "<" + type + "\n" + rowPrefix + " " + properties2.join("\n" + rowPrefix + " ") + "\n" + rowPrefix + ">\n";
|
|
}
|
|
function describePropertiesDiff(clientObject, serverObject, indent) {
|
|
var properties2 = "", remainingServerProperties = assign2({}, serverObject), propName;
|
|
for (propName in clientObject)
|
|
if (clientObject.hasOwnProperty(propName)) {
|
|
delete remainingServerProperties[propName];
|
|
var maxLength = 120 - 2 * indent - propName.length - 2, clientPropValue = describeValue(clientObject[propName], maxLength);
|
|
serverObject.hasOwnProperty(propName) ? (maxLength = describeValue(serverObject[propName], maxLength), properties2 += added(indent) + propName + ": " + clientPropValue + "\n", properties2 += removed(indent) + propName + ": " + maxLength + "\n") : properties2 += added(indent) + propName + ": " + clientPropValue + "\n";
|
|
}
|
|
for (var _propName in remainingServerProperties)
|
|
remainingServerProperties.hasOwnProperty(_propName) && (clientObject = describeValue(
|
|
remainingServerProperties[_propName],
|
|
120 - 2 * indent - _propName.length - 2
|
|
), properties2 += removed(indent) + _propName + ": " + clientObject + "\n");
|
|
return properties2;
|
|
}
|
|
function describeElementDiff(type, clientProps, serverProps, indent) {
|
|
var content = "", serverPropNames = /* @__PURE__ */ new Map();
|
|
for (propName$jscomp$0 in serverProps)
|
|
serverProps.hasOwnProperty(propName$jscomp$0) && serverPropNames.set(
|
|
propName$jscomp$0.toLowerCase(),
|
|
propName$jscomp$0
|
|
);
|
|
if (1 === serverPropNames.size && serverPropNames.has("children"))
|
|
content += describeExpandedElement(
|
|
type,
|
|
clientProps,
|
|
indentation(indent)
|
|
);
|
|
else {
|
|
for (var _propName2 in clientProps)
|
|
if (clientProps.hasOwnProperty(_propName2) && "children" !== _propName2) {
|
|
var maxLength$jscomp$0 = 120 - 2 * (indent + 1) - _propName2.length - 1, serverPropName = serverPropNames.get(_propName2.toLowerCase());
|
|
if (void 0 !== serverPropName) {
|
|
serverPropNames.delete(_propName2.toLowerCase());
|
|
var propName$jscomp$0 = clientProps[_propName2];
|
|
serverPropName = serverProps[serverPropName];
|
|
var clientPropValue = describePropValue(
|
|
propName$jscomp$0,
|
|
maxLength$jscomp$0
|
|
);
|
|
maxLength$jscomp$0 = describePropValue(
|
|
serverPropName,
|
|
maxLength$jscomp$0
|
|
);
|
|
"object" === typeof propName$jscomp$0 && null !== propName$jscomp$0 && "object" === typeof serverPropName && null !== serverPropName && "Object" === objectName(propName$jscomp$0) && "Object" === objectName(serverPropName) && (2 < Object.keys(propName$jscomp$0).length || 2 < Object.keys(serverPropName).length || -1 < clientPropValue.indexOf("...") || -1 < maxLength$jscomp$0.indexOf("...")) ? content += indentation(indent + 1) + _propName2 + "={{\n" + describePropertiesDiff(
|
|
propName$jscomp$0,
|
|
serverPropName,
|
|
indent + 2
|
|
) + indentation(indent + 1) + "}}\n" : (content += added(indent + 1) + _propName2 + "=" + clientPropValue + "\n", content += removed(indent + 1) + _propName2 + "=" + maxLength$jscomp$0 + "\n");
|
|
} else
|
|
content += indentation(indent + 1) + _propName2 + "=" + describePropValue(clientProps[_propName2], maxLength$jscomp$0) + "\n";
|
|
}
|
|
serverPropNames.forEach(function(propName) {
|
|
if ("children" !== propName) {
|
|
var maxLength = 120 - 2 * (indent + 1) - propName.length - 1;
|
|
content += removed(indent + 1) + propName + "=" + describePropValue(serverProps[propName], maxLength) + "\n";
|
|
}
|
|
});
|
|
content = "" === content ? indentation(indent) + "<" + type + ">\n" : indentation(indent) + "<" + type + "\n" + content + indentation(indent) + ">\n";
|
|
}
|
|
type = serverProps.children;
|
|
clientProps = clientProps.children;
|
|
if ("string" === typeof type || "number" === typeof type || "bigint" === typeof type) {
|
|
serverPropNames = "";
|
|
if ("string" === typeof clientProps || "number" === typeof clientProps || "bigint" === typeof clientProps)
|
|
serverPropNames = "" + clientProps;
|
|
content += describeTextDiff(serverPropNames, "" + type, indent + 1);
|
|
} else if ("string" === typeof clientProps || "number" === typeof clientProps || "bigint" === typeof clientProps)
|
|
content = null == type ? content + describeTextDiff("" + clientProps, null, indent + 1) : content + describeTextDiff("" + clientProps, void 0, indent + 1);
|
|
return content;
|
|
}
|
|
function describeSiblingFiber(fiber, indent) {
|
|
var type = describeFiberType(fiber);
|
|
if (null === type) {
|
|
type = "";
|
|
for (fiber = fiber.child; fiber; )
|
|
type += describeSiblingFiber(fiber, indent), fiber = fiber.sibling;
|
|
return type;
|
|
}
|
|
return indentation(indent) + "<" + type + ">\n";
|
|
}
|
|
function describeNode(node2, indent) {
|
|
var skipToNode = findNotableNode(node2, indent);
|
|
if (skipToNode !== node2 && (1 !== node2.children.length || node2.children[0] !== skipToNode))
|
|
return indentation(indent) + "...\n" + describeNode(skipToNode, indent + 1);
|
|
skipToNode = "";
|
|
var debugInfo = node2.fiber._debugInfo;
|
|
if (debugInfo)
|
|
for (var i = 0; i < debugInfo.length; i++) {
|
|
var serverComponentName = debugInfo[i].name;
|
|
"string" === typeof serverComponentName && (skipToNode += indentation(indent) + "<" + serverComponentName + ">\n", indent++);
|
|
}
|
|
debugInfo = "";
|
|
i = node2.fiber.pendingProps;
|
|
if (6 === node2.fiber.tag)
|
|
debugInfo = describeTextDiff(i, node2.serverProps, indent), indent++;
|
|
else if (serverComponentName = describeFiberType(node2.fiber), null !== serverComponentName)
|
|
if (void 0 === node2.serverProps) {
|
|
debugInfo = indent;
|
|
var maxLength = 120 - 2 * debugInfo - serverComponentName.length - 2, content = "";
|
|
for (propName in i)
|
|
if (i.hasOwnProperty(propName) && "children" !== propName) {
|
|
var propValue = describePropValue(i[propName], 15);
|
|
maxLength -= propName.length + propValue.length + 2;
|
|
if (0 > maxLength) {
|
|
content += " ...";
|
|
break;
|
|
}
|
|
content += " " + propName + "=" + propValue;
|
|
}
|
|
debugInfo = indentation(debugInfo) + "<" + serverComponentName + content + ">\n";
|
|
indent++;
|
|
} else
|
|
null === node2.serverProps ? (debugInfo = describeExpandedElement(
|
|
serverComponentName,
|
|
i,
|
|
added(indent)
|
|
), indent++) : "string" === typeof node2.serverProps ? console.error(
|
|
"Should not have matched a non HostText fiber to a Text node. This is a bug in React."
|
|
) : (debugInfo = describeElementDiff(
|
|
serverComponentName,
|
|
i,
|
|
node2.serverProps,
|
|
indent
|
|
), indent++);
|
|
var propName = "";
|
|
i = node2.fiber.child;
|
|
for (serverComponentName = 0; i && serverComponentName < node2.children.length; )
|
|
maxLength = node2.children[serverComponentName], maxLength.fiber === i ? (propName += describeNode(maxLength, indent), serverComponentName++) : propName += describeSiblingFiber(i, indent), i = i.sibling;
|
|
i && 0 < node2.children.length && (propName += indentation(indent) + "...\n");
|
|
i = node2.serverTail;
|
|
null === node2.serverProps && indent--;
|
|
for (node2 = 0; node2 < i.length; node2++)
|
|
serverComponentName = i[node2], propName = "string" === typeof serverComponentName ? propName + (removed(indent) + describeTextNode(serverComponentName, 120 - 2 * indent) + "\n") : propName + describeExpandedElement(
|
|
serverComponentName.type,
|
|
serverComponentName.props,
|
|
removed(indent)
|
|
);
|
|
return skipToNode + debugInfo + propName;
|
|
}
|
|
function describeDiff(rootNode) {
|
|
try {
|
|
return "\n\n" + describeNode(rootNode, 0);
|
|
} catch (x) {
|
|
return "";
|
|
}
|
|
}
|
|
function describeAncestors(ancestor, child, props) {
|
|
for (var fiber = child, node2 = null, distanceFromLeaf = 0; fiber; )
|
|
fiber === ancestor && (distanceFromLeaf = 0), node2 = {
|
|
fiber,
|
|
children: null !== node2 ? [node2] : [],
|
|
serverProps: fiber === child ? props : fiber === ancestor ? null : void 0,
|
|
serverTail: [],
|
|
distanceFromLeaf
|
|
}, distanceFromLeaf++, fiber = fiber.return;
|
|
return null !== node2 ? describeDiff(node2).replaceAll(/^[+-]/gm, ">") : "";
|
|
}
|
|
function updatedAncestorInfoDev(oldInfo, tag) {
|
|
var ancestorInfo = assign2({}, oldInfo || emptyAncestorInfoDev), info = { tag };
|
|
-1 !== inScopeTags.indexOf(tag) && (ancestorInfo.aTagInScope = null, ancestorInfo.buttonTagInScope = null, ancestorInfo.nobrTagInScope = null);
|
|
-1 !== buttonScopeTags.indexOf(tag) && (ancestorInfo.pTagInButtonScope = null);
|
|
-1 !== specialTags.indexOf(tag) && "address" !== tag && "div" !== tag && "p" !== tag && (ancestorInfo.listItemTagAutoclosing = null, ancestorInfo.dlItemTagAutoclosing = null);
|
|
ancestorInfo.current = info;
|
|
"form" === tag && (ancestorInfo.formTag = info);
|
|
"a" === tag && (ancestorInfo.aTagInScope = info);
|
|
"button" === tag && (ancestorInfo.buttonTagInScope = info);
|
|
"nobr" === tag && (ancestorInfo.nobrTagInScope = info);
|
|
"p" === tag && (ancestorInfo.pTagInButtonScope = info);
|
|
"li" === tag && (ancestorInfo.listItemTagAutoclosing = info);
|
|
if ("dd" === tag || "dt" === tag)
|
|
ancestorInfo.dlItemTagAutoclosing = info;
|
|
"#document" === tag || "html" === tag ? ancestorInfo.containerTagInScope = null : ancestorInfo.containerTagInScope || (ancestorInfo.containerTagInScope = info);
|
|
null !== oldInfo || "#document" !== tag && "html" !== tag && "body" !== tag ? true === ancestorInfo.implicitRootScope && (ancestorInfo.implicitRootScope = false) : ancestorInfo.implicitRootScope = true;
|
|
return ancestorInfo;
|
|
}
|
|
function isTagValidWithParent(tag, parentTag, implicitRootScope) {
|
|
switch (parentTag) {
|
|
case "select":
|
|
return "hr" === tag || "option" === tag || "optgroup" === tag || "script" === tag || "template" === tag || "#text" === tag;
|
|
case "optgroup":
|
|
return "option" === tag || "#text" === tag;
|
|
case "option":
|
|
return "#text" === tag;
|
|
case "tr":
|
|
return "th" === tag || "td" === tag || "style" === tag || "script" === tag || "template" === tag;
|
|
case "tbody":
|
|
case "thead":
|
|
case "tfoot":
|
|
return "tr" === tag || "style" === tag || "script" === tag || "template" === tag;
|
|
case "colgroup":
|
|
return "col" === tag || "template" === tag;
|
|
case "table":
|
|
return "caption" === tag || "colgroup" === tag || "tbody" === tag || "tfoot" === tag || "thead" === tag || "style" === tag || "script" === tag || "template" === tag;
|
|
case "head":
|
|
return "base" === tag || "basefont" === tag || "bgsound" === tag || "link" === tag || "meta" === tag || "title" === tag || "noscript" === tag || "noframes" === tag || "style" === tag || "script" === tag || "template" === tag;
|
|
case "html":
|
|
if (implicitRootScope) break;
|
|
return "head" === tag || "body" === tag || "frameset" === tag;
|
|
case "frameset":
|
|
return "frame" === tag;
|
|
case "#document":
|
|
if (!implicitRootScope) return "html" === tag;
|
|
}
|
|
switch (tag) {
|
|
case "h1":
|
|
case "h2":
|
|
case "h3":
|
|
case "h4":
|
|
case "h5":
|
|
case "h6":
|
|
return "h1" !== parentTag && "h2" !== parentTag && "h3" !== parentTag && "h4" !== parentTag && "h5" !== parentTag && "h6" !== parentTag;
|
|
case "rp":
|
|
case "rt":
|
|
return -1 === impliedEndTags.indexOf(parentTag);
|
|
case "caption":
|
|
case "col":
|
|
case "colgroup":
|
|
case "frameset":
|
|
case "frame":
|
|
case "tbody":
|
|
case "td":
|
|
case "tfoot":
|
|
case "th":
|
|
case "thead":
|
|
case "tr":
|
|
return null == parentTag;
|
|
case "head":
|
|
return implicitRootScope || null === parentTag;
|
|
case "html":
|
|
return implicitRootScope && "#document" === parentTag || null === parentTag;
|
|
case "body":
|
|
return implicitRootScope && ("#document" === parentTag || "html" === parentTag) || null === parentTag;
|
|
}
|
|
return true;
|
|
}
|
|
function findInvalidAncestorForTag(tag, ancestorInfo) {
|
|
switch (tag) {
|
|
case "address":
|
|
case "article":
|
|
case "aside":
|
|
case "blockquote":
|
|
case "center":
|
|
case "details":
|
|
case "dialog":
|
|
case "dir":
|
|
case "div":
|
|
case "dl":
|
|
case "fieldset":
|
|
case "figcaption":
|
|
case "figure":
|
|
case "footer":
|
|
case "header":
|
|
case "hgroup":
|
|
case "main":
|
|
case "menu":
|
|
case "nav":
|
|
case "ol":
|
|
case "p":
|
|
case "section":
|
|
case "summary":
|
|
case "ul":
|
|
case "pre":
|
|
case "listing":
|
|
case "table":
|
|
case "hr":
|
|
case "xmp":
|
|
case "h1":
|
|
case "h2":
|
|
case "h3":
|
|
case "h4":
|
|
case "h5":
|
|
case "h6":
|
|
return ancestorInfo.pTagInButtonScope;
|
|
case "form":
|
|
return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
|
|
case "li":
|
|
return ancestorInfo.listItemTagAutoclosing;
|
|
case "dd":
|
|
case "dt":
|
|
return ancestorInfo.dlItemTagAutoclosing;
|
|
case "button":
|
|
return ancestorInfo.buttonTagInScope;
|
|
case "a":
|
|
return ancestorInfo.aTagInScope;
|
|
case "nobr":
|
|
return ancestorInfo.nobrTagInScope;
|
|
}
|
|
return null;
|
|
}
|
|
function findAncestor(parent, tagName) {
|
|
for (; parent; ) {
|
|
switch (parent.tag) {
|
|
case 5:
|
|
case 26:
|
|
case 27:
|
|
if (parent.type === tagName) return parent;
|
|
}
|
|
parent = parent.return;
|
|
}
|
|
return null;
|
|
}
|
|
function validateDOMNesting(childTag, ancestorInfo) {
|
|
ancestorInfo = ancestorInfo || emptyAncestorInfoDev;
|
|
var parentInfo = ancestorInfo.current;
|
|
ancestorInfo = (parentInfo = isTagValidWithParent(
|
|
childTag,
|
|
parentInfo && parentInfo.tag,
|
|
ancestorInfo.implicitRootScope
|
|
) ? null : parentInfo) ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
|
|
ancestorInfo = parentInfo || ancestorInfo;
|
|
if (!ancestorInfo) return true;
|
|
var ancestorTag = ancestorInfo.tag;
|
|
ancestorInfo = String(!!parentInfo) + "|" + childTag + "|" + ancestorTag;
|
|
if (didWarn[ancestorInfo]) return false;
|
|
didWarn[ancestorInfo] = true;
|
|
var ancestor = (ancestorInfo = current) ? findAncestor(ancestorInfo.return, ancestorTag) : null, ancestorDescription = null !== ancestorInfo && null !== ancestor ? describeAncestors(ancestor, ancestorInfo, null) : "", tagDisplayName = "<" + childTag + ">";
|
|
parentInfo ? (parentInfo = "", "table" === ancestorTag && "tr" === childTag && (parentInfo += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."), console.error(
|
|
"In HTML, %s cannot be a child of <%s>.%s\nThis will cause a hydration error.%s",
|
|
tagDisplayName,
|
|
ancestorTag,
|
|
parentInfo,
|
|
ancestorDescription
|
|
)) : console.error(
|
|
"In HTML, %s cannot be a descendant of <%s>.\nThis will cause a hydration error.%s",
|
|
tagDisplayName,
|
|
ancestorTag,
|
|
ancestorDescription
|
|
);
|
|
ancestorInfo && (childTag = ancestorInfo.return, null === ancestor || null === childTag || ancestor === childTag && childTag._debugOwner === ancestorInfo._debugOwner || runWithFiberInDEV(ancestor, function() {
|
|
console.error(
|
|
"<%s> cannot contain a nested %s.\nSee this log for the ancestor stack trace.",
|
|
ancestorTag,
|
|
tagDisplayName
|
|
);
|
|
}));
|
|
return false;
|
|
}
|
|
function validateTextNesting(childText, parentTag, implicitRootScope) {
|
|
if (implicitRootScope || isTagValidWithParent("#text", parentTag, false))
|
|
return true;
|
|
implicitRootScope = "#text|" + parentTag;
|
|
if (didWarn[implicitRootScope]) return false;
|
|
didWarn[implicitRootScope] = true;
|
|
var ancestor = (implicitRootScope = current) ? findAncestor(implicitRootScope, parentTag) : null;
|
|
implicitRootScope = null !== implicitRootScope && null !== ancestor ? describeAncestors(
|
|
ancestor,
|
|
implicitRootScope,
|
|
6 !== implicitRootScope.tag ? { children: null } : null
|
|
) : "";
|
|
/\S/.test(childText) ? console.error(
|
|
"In HTML, text nodes cannot be a child of <%s>.\nThis will cause a hydration error.%s",
|
|
parentTag,
|
|
implicitRootScope
|
|
) : console.error(
|
|
"In HTML, whitespace text nodes cannot be a child of <%s>. Make sure you don't have any extra whitespace between tags on each line of your source code.\nThis will cause a hydration error.%s",
|
|
parentTag,
|
|
implicitRootScope
|
|
);
|
|
return false;
|
|
}
|
|
function setTextContent(node2, text) {
|
|
if (text) {
|
|
var firstChild = node2.firstChild;
|
|
if (firstChild && firstChild === node2.lastChild && 3 === firstChild.nodeType) {
|
|
firstChild.nodeValue = text;
|
|
return;
|
|
}
|
|
}
|
|
node2.textContent = text;
|
|
}
|
|
function camelize(string) {
|
|
return string.replace(hyphenPattern, function(_, character2) {
|
|
return character2.toUpperCase();
|
|
});
|
|
}
|
|
function setValueForStyle(style4, styleName, value) {
|
|
var isCustomProperty3 = 0 === styleName.indexOf("--");
|
|
isCustomProperty3 || (-1 < styleName.indexOf("-") ? warnedStyleNames.hasOwnProperty(styleName) && warnedStyleNames[styleName] || (warnedStyleNames[styleName] = true, console.error(
|
|
"Unsupported style property %s. Did you mean %s?",
|
|
styleName,
|
|
camelize(styleName.replace(msPattern, "ms-"))
|
|
)) : badVendoredStyleNamePattern.test(styleName) ? warnedStyleNames.hasOwnProperty(styleName) && warnedStyleNames[styleName] || (warnedStyleNames[styleName] = true, console.error(
|
|
"Unsupported vendor-prefixed style property %s. Did you mean %s?",
|
|
styleName,
|
|
styleName.charAt(0).toUpperCase() + styleName.slice(1)
|
|
)) : !badStyleValueWithSemicolonPattern.test(value) || warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value] || (warnedStyleValues[value] = true, console.error(
|
|
`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`,
|
|
styleName,
|
|
value.replace(badStyleValueWithSemicolonPattern, "")
|
|
)), "number" === typeof value && (isNaN(value) ? warnedForNaNValue || (warnedForNaNValue = true, console.error(
|
|
"`NaN` is an invalid value for the `%s` css style property.",
|
|
styleName
|
|
)) : isFinite(value) || warnedForInfinityValue || (warnedForInfinityValue = true, console.error(
|
|
"`Infinity` is an invalid value for the `%s` css style property.",
|
|
styleName
|
|
))));
|
|
null == value || "boolean" === typeof value || "" === value ? isCustomProperty3 ? style4.setProperty(styleName, "") : "float" === styleName ? style4.cssFloat = "" : style4[styleName] = "" : isCustomProperty3 ? style4.setProperty(styleName, value) : "number" !== typeof value || 0 === value || unitlessNumbers.has(styleName) ? "float" === styleName ? style4.cssFloat = value : (checkCSSPropertyStringCoercion(value, styleName), style4[styleName] = ("" + value).trim()) : style4[styleName] = value + "px";
|
|
}
|
|
function setValueForStyles(node2, styles, prevStyles) {
|
|
if (null != styles && "object" !== typeof styles)
|
|
throw Error(
|
|
"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX."
|
|
);
|
|
styles && Object.freeze(styles);
|
|
node2 = node2.style;
|
|
if (null != prevStyles) {
|
|
if (styles) {
|
|
var expandedUpdates = {};
|
|
if (prevStyles) {
|
|
for (var key in prevStyles)
|
|
if (prevStyles.hasOwnProperty(key) && !styles.hasOwnProperty(key))
|
|
for (var longhands = shorthandToLonghand[key] || [key], i = 0; i < longhands.length; i++)
|
|
expandedUpdates[longhands[i]] = key;
|
|
}
|
|
for (var _key in styles)
|
|
if (styles.hasOwnProperty(_key) && (!prevStyles || prevStyles[_key] !== styles[_key]))
|
|
for (key = shorthandToLonghand[_key] || [_key], longhands = 0; longhands < key.length; longhands++)
|
|
expandedUpdates[key[longhands]] = _key;
|
|
_key = {};
|
|
for (var key$jscomp$0 in styles)
|
|
for (key = shorthandToLonghand[key$jscomp$0] || [key$jscomp$0], longhands = 0; longhands < key.length; longhands++)
|
|
_key[key[longhands]] = key$jscomp$0;
|
|
key$jscomp$0 = {};
|
|
for (var _key2 in expandedUpdates)
|
|
if (key = expandedUpdates[_key2], (longhands = _key[_key2]) && key !== longhands && (i = key + "," + longhands, !key$jscomp$0[i])) {
|
|
key$jscomp$0[i] = true;
|
|
i = console;
|
|
var value = styles[key];
|
|
i.error.call(
|
|
i,
|
|
"%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.",
|
|
null == value || "boolean" === typeof value || "" === value ? "Removing" : "Updating",
|
|
key,
|
|
longhands
|
|
);
|
|
}
|
|
}
|
|
for (var styleName in prevStyles)
|
|
!prevStyles.hasOwnProperty(styleName) || null != styles && styles.hasOwnProperty(styleName) || (0 === styleName.indexOf("--") ? node2.setProperty(styleName, "") : "float" === styleName ? node2.cssFloat = "" : node2[styleName] = "");
|
|
for (var _styleName in styles)
|
|
_key2 = styles[_styleName], styles.hasOwnProperty(_styleName) && prevStyles[_styleName] !== _key2 && setValueForStyle(node2, _styleName, _key2);
|
|
} else
|
|
for (expandedUpdates in styles)
|
|
styles.hasOwnProperty(expandedUpdates) && setValueForStyle(node2, expandedUpdates, styles[expandedUpdates]);
|
|
}
|
|
function isCustomElement(tagName) {
|
|
if (-1 === tagName.indexOf("-")) return false;
|
|
switch (tagName) {
|
|
case "annotation-xml":
|
|
case "color-profile":
|
|
case "font-face":
|
|
case "font-face-src":
|
|
case "font-face-uri":
|
|
case "font-face-format":
|
|
case "font-face-name":
|
|
case "missing-glyph":
|
|
return false;
|
|
default:
|
|
return true;
|
|
}
|
|
}
|
|
function getAttributeAlias(name) {
|
|
return aliases2.get(name) || name;
|
|
}
|
|
function validateProperty$1(tagName, name) {
|
|
if (hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name])
|
|
return true;
|
|
if (rARIACamel$1.test(name)) {
|
|
tagName = "aria-" + name.slice(4).toLowerCase();
|
|
tagName = ariaProperties.hasOwnProperty(tagName) ? tagName : null;
|
|
if (null == tagName)
|
|
return console.error(
|
|
"Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.",
|
|
name
|
|
), warnedProperties$1[name] = true;
|
|
if (name !== tagName)
|
|
return console.error(
|
|
"Invalid ARIA attribute `%s`. Did you mean `%s`?",
|
|
name,
|
|
tagName
|
|
), warnedProperties$1[name] = true;
|
|
}
|
|
if (rARIA$1.test(name)) {
|
|
tagName = name.toLowerCase();
|
|
tagName = ariaProperties.hasOwnProperty(tagName) ? tagName : null;
|
|
if (null == tagName) return warnedProperties$1[name] = true, false;
|
|
name !== tagName && (console.error(
|
|
"Unknown ARIA attribute `%s`. Did you mean `%s`?",
|
|
name,
|
|
tagName
|
|
), warnedProperties$1[name] = true);
|
|
}
|
|
return true;
|
|
}
|
|
function validateProperties$2(type, props) {
|
|
var invalidProps = [], key;
|
|
for (key in props)
|
|
validateProperty$1(type, key) || invalidProps.push(key);
|
|
props = invalidProps.map(function(prop) {
|
|
return "`" + prop + "`";
|
|
}).join(", ");
|
|
1 === invalidProps.length ? console.error(
|
|
"Invalid aria prop %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props",
|
|
props,
|
|
type
|
|
) : 1 < invalidProps.length && console.error(
|
|
"Invalid aria props %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props",
|
|
props,
|
|
type
|
|
);
|
|
}
|
|
function validateProperty(tagName, name, value, eventRegistry) {
|
|
if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name])
|
|
return true;
|
|
var lowerCasedName = name.toLowerCase();
|
|
if ("onfocusin" === lowerCasedName || "onfocusout" === lowerCasedName)
|
|
return console.error(
|
|
"React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."
|
|
), warnedProperties[name] = true;
|
|
if ("function" === typeof value && ("form" === tagName && "action" === name || "input" === tagName && "formAction" === name || "button" === tagName && "formAction" === name))
|
|
return true;
|
|
if (null != eventRegistry) {
|
|
tagName = eventRegistry.possibleRegistrationNames;
|
|
if (eventRegistry.registrationNameDependencies.hasOwnProperty(name))
|
|
return true;
|
|
eventRegistry = tagName.hasOwnProperty(lowerCasedName) ? tagName[lowerCasedName] : null;
|
|
if (null != eventRegistry)
|
|
return console.error(
|
|
"Invalid event handler property `%s`. Did you mean `%s`?",
|
|
name,
|
|
eventRegistry
|
|
), warnedProperties[name] = true;
|
|
if (EVENT_NAME_REGEX.test(name))
|
|
return console.error(
|
|
"Unknown event handler property `%s`. It will be ignored.",
|
|
name
|
|
), warnedProperties[name] = true;
|
|
} else if (EVENT_NAME_REGEX.test(name))
|
|
return INVALID_EVENT_NAME_REGEX.test(name) && console.error(
|
|
"Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.",
|
|
name
|
|
), warnedProperties[name] = true;
|
|
if (rARIA.test(name) || rARIACamel.test(name)) return true;
|
|
if ("innerhtml" === lowerCasedName)
|
|
return console.error(
|
|
"Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."
|
|
), warnedProperties[name] = true;
|
|
if ("aria" === lowerCasedName)
|
|
return console.error(
|
|
"The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."
|
|
), warnedProperties[name] = true;
|
|
if ("is" === lowerCasedName && null !== value && void 0 !== value && "string" !== typeof value)
|
|
return console.error(
|
|
"Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.",
|
|
typeof value
|
|
), warnedProperties[name] = true;
|
|
if ("number" === typeof value && isNaN(value))
|
|
return console.error(
|
|
"Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",
|
|
name
|
|
), warnedProperties[name] = true;
|
|
if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
|
|
if (lowerCasedName = possibleStandardNames[lowerCasedName], lowerCasedName !== name)
|
|
return console.error(
|
|
"Invalid DOM property `%s`. Did you mean `%s`?",
|
|
name,
|
|
lowerCasedName
|
|
), warnedProperties[name] = true;
|
|
} else if (name !== lowerCasedName)
|
|
return console.error(
|
|
"React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.",
|
|
name,
|
|
lowerCasedName
|
|
), warnedProperties[name] = true;
|
|
switch (name) {
|
|
case "dangerouslySetInnerHTML":
|
|
case "children":
|
|
case "style":
|
|
case "suppressContentEditableWarning":
|
|
case "suppressHydrationWarning":
|
|
case "defaultValue":
|
|
case "defaultChecked":
|
|
case "innerHTML":
|
|
case "ref":
|
|
return true;
|
|
case "innerText":
|
|
case "textContent":
|
|
return true;
|
|
}
|
|
switch (typeof value) {
|
|
case "boolean":
|
|
switch (name) {
|
|
case "autoFocus":
|
|
case "checked":
|
|
case "multiple":
|
|
case "muted":
|
|
case "selected":
|
|
case "contentEditable":
|
|
case "spellCheck":
|
|
case "draggable":
|
|
case "value":
|
|
case "autoReverse":
|
|
case "externalResourcesRequired":
|
|
case "focusable":
|
|
case "preserveAlpha":
|
|
case "allowFullScreen":
|
|
case "async":
|
|
case "autoPlay":
|
|
case "controls":
|
|
case "default":
|
|
case "defer":
|
|
case "disabled":
|
|
case "disablePictureInPicture":
|
|
case "disableRemotePlayback":
|
|
case "formNoValidate":
|
|
case "hidden":
|
|
case "loop":
|
|
case "noModule":
|
|
case "noValidate":
|
|
case "open":
|
|
case "playsInline":
|
|
case "readOnly":
|
|
case "required":
|
|
case "reversed":
|
|
case "scoped":
|
|
case "seamless":
|
|
case "itemScope":
|
|
case "capture":
|
|
case "download":
|
|
case "inert":
|
|
return true;
|
|
default:
|
|
lowerCasedName = name.toLowerCase().slice(0, 5);
|
|
if ("data-" === lowerCasedName || "aria-" === lowerCasedName)
|
|
return true;
|
|
value ? console.error(
|
|
'Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.',
|
|
value,
|
|
name,
|
|
name,
|
|
value,
|
|
name
|
|
) : console.error(
|
|
'Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.',
|
|
value,
|
|
name,
|
|
name,
|
|
value,
|
|
name,
|
|
name,
|
|
name
|
|
);
|
|
return warnedProperties[name] = true;
|
|
}
|
|
case "function":
|
|
case "symbol":
|
|
return warnedProperties[name] = true, false;
|
|
case "string":
|
|
if ("false" === value || "true" === value) {
|
|
switch (name) {
|
|
case "checked":
|
|
case "selected":
|
|
case "multiple":
|
|
case "muted":
|
|
case "allowFullScreen":
|
|
case "async":
|
|
case "autoPlay":
|
|
case "controls":
|
|
case "default":
|
|
case "defer":
|
|
case "disabled":
|
|
case "disablePictureInPicture":
|
|
case "disableRemotePlayback":
|
|
case "formNoValidate":
|
|
case "hidden":
|
|
case "loop":
|
|
case "noModule":
|
|
case "noValidate":
|
|
case "open":
|
|
case "playsInline":
|
|
case "readOnly":
|
|
case "required":
|
|
case "reversed":
|
|
case "scoped":
|
|
case "seamless":
|
|
case "itemScope":
|
|
case "inert":
|
|
break;
|
|
default:
|
|
return true;
|
|
}
|
|
console.error(
|
|
"Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?",
|
|
value,
|
|
name,
|
|
"false" === value ? "The browser will interpret it as a truthy value." : 'Although this works, it will not work as expected if you pass the string "false".',
|
|
name,
|
|
value
|
|
);
|
|
warnedProperties[name] = true;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function warnUnknownProperties(type, props, eventRegistry) {
|
|
var unknownProps = [], key;
|
|
for (key in props)
|
|
validateProperty(type, key, props[key], eventRegistry) || unknownProps.push(key);
|
|
props = unknownProps.map(function(prop) {
|
|
return "`" + prop + "`";
|
|
}).join(", ");
|
|
1 === unknownProps.length ? console.error(
|
|
"Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://react.dev/link/attribute-behavior ",
|
|
props,
|
|
type
|
|
) : 1 < unknownProps.length && console.error(
|
|
"Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://react.dev/link/attribute-behavior ",
|
|
props,
|
|
type
|
|
);
|
|
}
|
|
function sanitizeURL(url) {
|
|
return isJavaScriptProtocol.test("" + url) ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" : url;
|
|
}
|
|
function noop$1() {
|
|
}
|
|
function getEventTarget(nativeEvent) {
|
|
nativeEvent = nativeEvent.target || nativeEvent.srcElement || window;
|
|
nativeEvent.correspondingUseElement && (nativeEvent = nativeEvent.correspondingUseElement);
|
|
return 3 === nativeEvent.nodeType ? nativeEvent.parentNode : nativeEvent;
|
|
}
|
|
function restoreStateOfTarget(target) {
|
|
var internalInstance = getInstanceFromNode(target);
|
|
if (internalInstance && (target = internalInstance.stateNode)) {
|
|
var props = target[internalPropsKey] || null;
|
|
a: switch (target = internalInstance.stateNode, internalInstance.type) {
|
|
case "input":
|
|
updateInput(
|
|
target,
|
|
props.value,
|
|
props.defaultValue,
|
|
props.defaultValue,
|
|
props.checked,
|
|
props.defaultChecked,
|
|
props.type,
|
|
props.name
|
|
);
|
|
internalInstance = props.name;
|
|
if ("radio" === props.type && null != internalInstance) {
|
|
for (props = target; props.parentNode; ) props = props.parentNode;
|
|
checkAttributeStringCoercion(internalInstance, "name");
|
|
props = props.querySelectorAll(
|
|
'input[name="' + escapeSelectorAttributeValueInsideDoubleQuotes(
|
|
"" + internalInstance
|
|
) + '"][type="radio"]'
|
|
);
|
|
for (internalInstance = 0; internalInstance < props.length; internalInstance++) {
|
|
var otherNode = props[internalInstance];
|
|
if (otherNode !== target && otherNode.form === target.form) {
|
|
var otherProps = otherNode[internalPropsKey] || null;
|
|
if (!otherProps)
|
|
throw Error(
|
|
"ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."
|
|
);
|
|
updateInput(
|
|
otherNode,
|
|
otherProps.value,
|
|
otherProps.defaultValue,
|
|
otherProps.defaultValue,
|
|
otherProps.checked,
|
|
otherProps.defaultChecked,
|
|
otherProps.type,
|
|
otherProps.name
|
|
);
|
|
}
|
|
}
|
|
for (internalInstance = 0; internalInstance < props.length; internalInstance++)
|
|
otherNode = props[internalInstance], otherNode.form === target.form && updateValueIfChanged(otherNode);
|
|
}
|
|
break a;
|
|
case "textarea":
|
|
updateTextarea(target, props.value, props.defaultValue);
|
|
break a;
|
|
case "select":
|
|
internalInstance = props.value, null != internalInstance && updateOptions(target, !!props.multiple, internalInstance, false);
|
|
}
|
|
}
|
|
}
|
|
function batchedUpdates$1(fn, a, b) {
|
|
if (isInsideEventHandler) return fn(a, b);
|
|
isInsideEventHandler = true;
|
|
try {
|
|
var JSCompiler_inline_result = fn(a);
|
|
return JSCompiler_inline_result;
|
|
} finally {
|
|
if (isInsideEventHandler = false, null !== restoreTarget || null !== restoreQueue) {
|
|
if (flushSyncWork$1(), restoreTarget && (a = restoreTarget, fn = restoreQueue, restoreQueue = restoreTarget = null, restoreStateOfTarget(a), fn))
|
|
for (a = 0; a < fn.length; a++) restoreStateOfTarget(fn[a]);
|
|
}
|
|
}
|
|
}
|
|
function getListener(inst, registrationName) {
|
|
var stateNode = inst.stateNode;
|
|
if (null === stateNode) return null;
|
|
var props = stateNode[internalPropsKey] || null;
|
|
if (null === props) return null;
|
|
stateNode = props[registrationName];
|
|
a: switch (registrationName) {
|
|
case "onClick":
|
|
case "onClickCapture":
|
|
case "onDoubleClick":
|
|
case "onDoubleClickCapture":
|
|
case "onMouseDown":
|
|
case "onMouseDownCapture":
|
|
case "onMouseMove":
|
|
case "onMouseMoveCapture":
|
|
case "onMouseUp":
|
|
case "onMouseUpCapture":
|
|
case "onMouseEnter":
|
|
(props = !props.disabled) || (inst = inst.type, props = !("button" === inst || "input" === inst || "select" === inst || "textarea" === inst));
|
|
inst = !props;
|
|
break a;
|
|
default:
|
|
inst = false;
|
|
}
|
|
if (inst) return null;
|
|
if (stateNode && "function" !== typeof stateNode)
|
|
throw Error(
|
|
"Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof stateNode + "` type."
|
|
);
|
|
return stateNode;
|
|
}
|
|
function getData() {
|
|
if (fallbackText) return fallbackText;
|
|
var start, startValue = startText, startLength = startValue.length, end, endValue = "value" in root ? root.value : root.textContent, endLength = endValue.length;
|
|
for (start = 0; start < startLength && startValue[start] === endValue[start]; start++) ;
|
|
var minEnd = startLength - start;
|
|
for (end = 1; end <= minEnd && startValue[startLength - end] === endValue[endLength - end]; end++) ;
|
|
return fallbackText = endValue.slice(start, 1 < end ? 1 - end : void 0);
|
|
}
|
|
function getEventCharCode(nativeEvent) {
|
|
var keyCode = nativeEvent.keyCode;
|
|
"charCode" in nativeEvent ? (nativeEvent = nativeEvent.charCode, 0 === nativeEvent && 13 === keyCode && (nativeEvent = 13)) : nativeEvent = keyCode;
|
|
10 === nativeEvent && (nativeEvent = 13);
|
|
return 32 <= nativeEvent || 13 === nativeEvent ? nativeEvent : 0;
|
|
}
|
|
function functionThatReturnsTrue() {
|
|
return true;
|
|
}
|
|
function functionThatReturnsFalse() {
|
|
return false;
|
|
}
|
|
function createSyntheticEvent(Interface) {
|
|
function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {
|
|
this._reactName = reactName;
|
|
this._targetInst = targetInst;
|
|
this.type = reactEventType;
|
|
this.nativeEvent = nativeEvent;
|
|
this.target = nativeEventTarget;
|
|
this.currentTarget = null;
|
|
for (var propName in Interface)
|
|
Interface.hasOwnProperty(propName) && (reactName = Interface[propName], this[propName] = reactName ? reactName(nativeEvent) : nativeEvent[propName]);
|
|
this.isDefaultPrevented = (null != nativeEvent.defaultPrevented ? nativeEvent.defaultPrevented : false === nativeEvent.returnValue) ? functionThatReturnsTrue : functionThatReturnsFalse;
|
|
this.isPropagationStopped = functionThatReturnsFalse;
|
|
return this;
|
|
}
|
|
assign2(SyntheticBaseEvent.prototype, {
|
|
preventDefault: function() {
|
|
this.defaultPrevented = true;
|
|
var event = this.nativeEvent;
|
|
event && (event.preventDefault ? event.preventDefault() : "unknown" !== typeof event.returnValue && (event.returnValue = false), this.isDefaultPrevented = functionThatReturnsTrue);
|
|
},
|
|
stopPropagation: function() {
|
|
var event = this.nativeEvent;
|
|
event && (event.stopPropagation ? event.stopPropagation() : "unknown" !== typeof event.cancelBubble && (event.cancelBubble = true), this.isPropagationStopped = functionThatReturnsTrue);
|
|
},
|
|
persist: function() {
|
|
},
|
|
isPersistent: functionThatReturnsTrue
|
|
});
|
|
return SyntheticBaseEvent;
|
|
}
|
|
function modifierStateGetter(keyArg) {
|
|
var nativeEvent = this.nativeEvent;
|
|
return nativeEvent.getModifierState ? nativeEvent.getModifierState(keyArg) : (keyArg = modifierKeyToProp[keyArg]) ? !!nativeEvent[keyArg] : false;
|
|
}
|
|
function getEventModifierState() {
|
|
return modifierStateGetter;
|
|
}
|
|
function isFallbackCompositionEnd(domEventName, nativeEvent) {
|
|
switch (domEventName) {
|
|
case "keyup":
|
|
return -1 !== END_KEYCODES.indexOf(nativeEvent.keyCode);
|
|
case "keydown":
|
|
return nativeEvent.keyCode !== START_KEYCODE;
|
|
case "keypress":
|
|
case "mousedown":
|
|
case "focusout":
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
function getDataFromCustomEvent(nativeEvent) {
|
|
nativeEvent = nativeEvent.detail;
|
|
return "object" === typeof nativeEvent && "data" in nativeEvent ? nativeEvent.data : null;
|
|
}
|
|
function getNativeBeforeInputChars(domEventName, nativeEvent) {
|
|
switch (domEventName) {
|
|
case "compositionend":
|
|
return getDataFromCustomEvent(nativeEvent);
|
|
case "keypress":
|
|
if (nativeEvent.which !== SPACEBAR_CODE) return null;
|
|
hasSpaceKeypress = true;
|
|
return SPACEBAR_CHAR;
|
|
case "textInput":
|
|
return domEventName = nativeEvent.data, domEventName === SPACEBAR_CHAR && hasSpaceKeypress ? null : domEventName;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
function getFallbackBeforeInputChars(domEventName, nativeEvent) {
|
|
if (isComposing)
|
|
return "compositionend" === domEventName || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent) ? (domEventName = getData(), fallbackText = startText = root = null, isComposing = false, domEventName) : null;
|
|
switch (domEventName) {
|
|
case "paste":
|
|
return null;
|
|
case "keypress":
|
|
if (!(nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) || nativeEvent.ctrlKey && nativeEvent.altKey) {
|
|
if (nativeEvent.char && 1 < nativeEvent.char.length)
|
|
return nativeEvent.char;
|
|
if (nativeEvent.which)
|
|
return String.fromCharCode(nativeEvent.which);
|
|
}
|
|
return null;
|
|
case "compositionend":
|
|
return useFallbackCompositionData && "ko" !== nativeEvent.locale ? null : nativeEvent.data;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
function isTextInputElement(elem) {
|
|
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
|
return "input" === nodeName ? !!supportedInputTypes[elem.type] : "textarea" === nodeName ? true : false;
|
|
}
|
|
function isEventSupported(eventNameSuffix) {
|
|
if (!canUseDOM) return false;
|
|
eventNameSuffix = "on" + eventNameSuffix;
|
|
var isSupported = eventNameSuffix in document;
|
|
isSupported || (isSupported = document.createElement("div"), isSupported.setAttribute(eventNameSuffix, "return;"), isSupported = "function" === typeof isSupported[eventNameSuffix]);
|
|
return isSupported;
|
|
}
|
|
function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {
|
|
restoreTarget ? restoreQueue ? restoreQueue.push(target) : restoreQueue = [target] : restoreTarget = target;
|
|
inst = accumulateTwoPhaseListeners(inst, "onChange");
|
|
0 < inst.length && (nativeEvent = new SyntheticEvent(
|
|
"onChange",
|
|
"change",
|
|
null,
|
|
nativeEvent,
|
|
target
|
|
), dispatchQueue.push({ event: nativeEvent, listeners: inst }));
|
|
}
|
|
function runEventInBatch(dispatchQueue) {
|
|
processDispatchQueue(dispatchQueue, 0);
|
|
}
|
|
function getInstIfValueChanged(targetInst) {
|
|
var targetNode = getNodeFromInstance(targetInst);
|
|
if (updateValueIfChanged(targetNode)) return targetInst;
|
|
}
|
|
function getTargetInstForChangeEvent(domEventName, targetInst) {
|
|
if ("change" === domEventName) return targetInst;
|
|
}
|
|
function stopWatchingForValueChange() {
|
|
activeElement$1 && (activeElement$1.detachEvent("onpropertychange", handlePropertyChange), activeElementInst$1 = activeElement$1 = null);
|
|
}
|
|
function handlePropertyChange(nativeEvent) {
|
|
if ("value" === nativeEvent.propertyName && getInstIfValueChanged(activeElementInst$1)) {
|
|
var dispatchQueue = [];
|
|
createAndAccumulateChangeEvent(
|
|
dispatchQueue,
|
|
activeElementInst$1,
|
|
nativeEvent,
|
|
getEventTarget(nativeEvent)
|
|
);
|
|
batchedUpdates$1(runEventInBatch, dispatchQueue);
|
|
}
|
|
}
|
|
function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
|
|
"focusin" === domEventName ? (stopWatchingForValueChange(), activeElement$1 = target, activeElementInst$1 = targetInst, activeElement$1.attachEvent("onpropertychange", handlePropertyChange)) : "focusout" === domEventName && stopWatchingForValueChange();
|
|
}
|
|
function getTargetInstForInputEventPolyfill(domEventName) {
|
|
if ("selectionchange" === domEventName || "keyup" === domEventName || "keydown" === domEventName)
|
|
return getInstIfValueChanged(activeElementInst$1);
|
|
}
|
|
function getTargetInstForClickEvent(domEventName, targetInst) {
|
|
if ("click" === domEventName) return getInstIfValueChanged(targetInst);
|
|
}
|
|
function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
|
|
if ("input" === domEventName || "change" === domEventName)
|
|
return getInstIfValueChanged(targetInst);
|
|
}
|
|
function is2(x, y) {
|
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
}
|
|
function shallowEqual(objA, objB) {
|
|
if (objectIs(objA, objB)) return true;
|
|
if ("object" !== typeof objA || null === objA || "object" !== typeof objB || null === objB)
|
|
return false;
|
|
var keysA = Object.keys(objA), keysB = Object.keys(objB);
|
|
if (keysA.length !== keysB.length) return false;
|
|
for (keysB = 0; keysB < keysA.length; keysB++) {
|
|
var currentKey = keysA[keysB];
|
|
if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey]))
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function getLeafNode(node2) {
|
|
for (; node2 && node2.firstChild; ) node2 = node2.firstChild;
|
|
return node2;
|
|
}
|
|
function getNodeForCharacterOffset(root2, offset) {
|
|
var node2 = getLeafNode(root2);
|
|
root2 = 0;
|
|
for (var nodeEnd; node2; ) {
|
|
if (3 === node2.nodeType) {
|
|
nodeEnd = root2 + node2.textContent.length;
|
|
if (root2 <= offset && nodeEnd >= offset)
|
|
return { node: node2, offset: offset - root2 };
|
|
root2 = nodeEnd;
|
|
}
|
|
a: {
|
|
for (; node2; ) {
|
|
if (node2.nextSibling) {
|
|
node2 = node2.nextSibling;
|
|
break a;
|
|
}
|
|
node2 = node2.parentNode;
|
|
}
|
|
node2 = void 0;
|
|
}
|
|
node2 = getLeafNode(node2);
|
|
}
|
|
}
|
|
function containsNode(outerNode, innerNode) {
|
|
return outerNode && innerNode ? outerNode === innerNode ? true : outerNode && 3 === outerNode.nodeType ? false : innerNode && 3 === innerNode.nodeType ? containsNode(outerNode, innerNode.parentNode) : "contains" in outerNode ? outerNode.contains(innerNode) : outerNode.compareDocumentPosition ? !!(outerNode.compareDocumentPosition(innerNode) & 16) : false : false;
|
|
}
|
|
function getActiveElementDeep(containerInfo) {
|
|
containerInfo = null != containerInfo && null != containerInfo.ownerDocument && null != containerInfo.ownerDocument.defaultView ? containerInfo.ownerDocument.defaultView : window;
|
|
for (var element = getActiveElement(containerInfo.document); element instanceof containerInfo.HTMLIFrameElement; ) {
|
|
try {
|
|
var JSCompiler_inline_result = "string" === typeof element.contentWindow.location.href;
|
|
} catch (err) {
|
|
JSCompiler_inline_result = false;
|
|
}
|
|
if (JSCompiler_inline_result) containerInfo = element.contentWindow;
|
|
else break;
|
|
element = getActiveElement(containerInfo.document);
|
|
}
|
|
return element;
|
|
}
|
|
function hasSelectionCapabilities(elem) {
|
|
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
|
return nodeName && ("input" === nodeName && ("text" === elem.type || "search" === elem.type || "tel" === elem.type || "url" === elem.type || "password" === elem.type) || "textarea" === nodeName || "true" === elem.contentEditable);
|
|
}
|
|
function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
|
|
var doc = nativeEventTarget.window === nativeEventTarget ? nativeEventTarget.document : 9 === nativeEventTarget.nodeType ? nativeEventTarget : nativeEventTarget.ownerDocument;
|
|
mouseDown || null == activeElement || activeElement !== getActiveElement(doc) || (doc = activeElement, "selectionStart" in doc && hasSelectionCapabilities(doc) ? doc = { start: doc.selectionStart, end: doc.selectionEnd } : (doc = (doc.ownerDocument && doc.ownerDocument.defaultView || window).getSelection(), doc = {
|
|
anchorNode: doc.anchorNode,
|
|
anchorOffset: doc.anchorOffset,
|
|
focusNode: doc.focusNode,
|
|
focusOffset: doc.focusOffset
|
|
}), lastSelection && shallowEqual(lastSelection, doc) || (lastSelection = doc, doc = accumulateTwoPhaseListeners(activeElementInst, "onSelect"), 0 < doc.length && (nativeEvent = new SyntheticEvent(
|
|
"onSelect",
|
|
"select",
|
|
null,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
), dispatchQueue.push({ event: nativeEvent, listeners: doc }), nativeEvent.target = activeElement)));
|
|
}
|
|
function makePrefixMap(styleProp, eventName) {
|
|
var prefixes = {};
|
|
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
|
|
prefixes["Webkit" + styleProp] = "webkit" + eventName;
|
|
prefixes["Moz" + styleProp] = "moz" + eventName;
|
|
return prefixes;
|
|
}
|
|
function getVendorPrefixedEventName(eventName) {
|
|
if (prefixedEventNames[eventName]) return prefixedEventNames[eventName];
|
|
if (!vendorPrefixes[eventName]) return eventName;
|
|
var prefixMap = vendorPrefixes[eventName], styleProp;
|
|
for (styleProp in prefixMap)
|
|
if (prefixMap.hasOwnProperty(styleProp) && styleProp in style3)
|
|
return prefixedEventNames[eventName] = prefixMap[styleProp];
|
|
return eventName;
|
|
}
|
|
function registerSimpleEvent(domEventName, reactName) {
|
|
topLevelEventsToReactNames.set(domEventName, reactName);
|
|
registerTwoPhaseEvent(reactName, [domEventName]);
|
|
}
|
|
function getArrayKind(array) {
|
|
for (var kind = EMPTY_ARRAY2, i = 0; i < array.length; i++) {
|
|
var value = array[i];
|
|
if ("object" === typeof value && null !== value)
|
|
if (isArrayImpl(value) && 2 === value.length && "string" === typeof value[0]) {
|
|
if (kind !== EMPTY_ARRAY2 && kind !== ENTRIES_ARRAY)
|
|
return COMPLEX_ARRAY;
|
|
kind = ENTRIES_ARRAY;
|
|
} else return COMPLEX_ARRAY;
|
|
else {
|
|
if ("function" === typeof value || "string" === typeof value && 50 < value.length || kind !== EMPTY_ARRAY2 && kind !== PRIMITIVE_ARRAY)
|
|
return COMPLEX_ARRAY;
|
|
kind = PRIMITIVE_ARRAY;
|
|
}
|
|
}
|
|
return kind;
|
|
}
|
|
function addObjectToProperties(object, properties2, indent, prefix3) {
|
|
for (var key in object)
|
|
hasOwnProperty.call(object, key) && "_" !== key[0] && addValueToProperties(key, object[key], properties2, indent, prefix3);
|
|
}
|
|
function addValueToProperties(propertyName, value, properties2, indent, prefix3) {
|
|
switch (typeof value) {
|
|
case "object":
|
|
if (null === value) {
|
|
value = "null";
|
|
break;
|
|
} else {
|
|
if (value.$$typeof === REACT_ELEMENT_TYPE) {
|
|
var typeName2 = getComponentNameFromType(value.type) || "\u2026", key = value.key;
|
|
value = value.props;
|
|
var propsKeys = Object.keys(value), propsLength = propsKeys.length;
|
|
if (null == key && 0 === propsLength) {
|
|
value = "<" + typeName2 + " />";
|
|
break;
|
|
}
|
|
if (3 > indent || 1 === propsLength && "children" === propsKeys[0] && null == key) {
|
|
value = "<" + typeName2 + " \u2026 />";
|
|
break;
|
|
}
|
|
properties2.push([
|
|
prefix3 + "\xA0\xA0".repeat(indent) + propertyName,
|
|
"<" + typeName2
|
|
]);
|
|
null !== key && addValueToProperties(
|
|
"key",
|
|
key,
|
|
properties2,
|
|
indent + 1,
|
|
prefix3
|
|
);
|
|
propertyName = false;
|
|
for (var propKey in value)
|
|
"children" === propKey ? null != value.children && (!isArrayImpl(value.children) || 0 < value.children.length) && (propertyName = true) : hasOwnProperty.call(value, propKey) && "_" !== propKey[0] && addValueToProperties(
|
|
propKey,
|
|
value[propKey],
|
|
properties2,
|
|
indent + 1,
|
|
prefix3
|
|
);
|
|
properties2.push([
|
|
"",
|
|
propertyName ? ">\u2026</" + typeName2 + ">" : "/>"
|
|
]);
|
|
return;
|
|
}
|
|
typeName2 = Object.prototype.toString.call(value);
|
|
typeName2 = typeName2.slice(8, typeName2.length - 1);
|
|
if ("Array" === typeName2) {
|
|
if (propKey = getArrayKind(value), propKey === PRIMITIVE_ARRAY || propKey === EMPTY_ARRAY2) {
|
|
value = JSON.stringify(value);
|
|
break;
|
|
} else if (propKey === ENTRIES_ARRAY) {
|
|
properties2.push([
|
|
prefix3 + "\xA0\xA0".repeat(indent) + propertyName,
|
|
""
|
|
]);
|
|
for (propertyName = 0; propertyName < value.length; propertyName++)
|
|
typeName2 = value[propertyName], addValueToProperties(
|
|
typeName2[0],
|
|
typeName2[1],
|
|
properties2,
|
|
indent + 1,
|
|
prefix3
|
|
);
|
|
return;
|
|
}
|
|
}
|
|
if ("Promise" === typeName2) {
|
|
if ("fulfilled" === value.status) {
|
|
if (typeName2 = properties2.length, addValueToProperties(
|
|
propertyName,
|
|
value.value,
|
|
properties2,
|
|
indent,
|
|
prefix3
|
|
), properties2.length > typeName2) {
|
|
properties2 = properties2[typeName2];
|
|
properties2[1] = "Promise<" + (properties2[1] || "Object") + ">";
|
|
return;
|
|
}
|
|
} else if ("rejected" === value.status && (typeName2 = properties2.length, addValueToProperties(
|
|
propertyName,
|
|
value.reason,
|
|
properties2,
|
|
indent,
|
|
prefix3
|
|
), properties2.length > typeName2)) {
|
|
properties2 = properties2[typeName2];
|
|
properties2[1] = "Rejected Promise<" + properties2[1] + ">";
|
|
return;
|
|
}
|
|
properties2.push([
|
|
"\xA0\xA0".repeat(indent) + propertyName,
|
|
"Promise"
|
|
]);
|
|
return;
|
|
}
|
|
"Object" === typeName2 && (propKey = Object.getPrototypeOf(value)) && "function" === typeof propKey.constructor && (typeName2 = propKey.constructor.name);
|
|
properties2.push([
|
|
prefix3 + "\xA0\xA0".repeat(indent) + propertyName,
|
|
"Object" === typeName2 ? 3 > indent ? "" : "\u2026" : typeName2
|
|
]);
|
|
3 > indent && addObjectToProperties(value, properties2, indent + 1, prefix3);
|
|
return;
|
|
}
|
|
case "function":
|
|
value = "" === value.name ? "() => {}" : value.name + "() {}";
|
|
break;
|
|
case "string":
|
|
value = value === OMITTED_PROP_ERROR ? "\u2026" : JSON.stringify(value);
|
|
break;
|
|
case "undefined":
|
|
value = "undefined";
|
|
break;
|
|
case "boolean":
|
|
value = value ? "true" : "false";
|
|
break;
|
|
default:
|
|
value = String(value);
|
|
}
|
|
properties2.push([
|
|
prefix3 + "\xA0\xA0".repeat(indent) + propertyName,
|
|
value
|
|
]);
|
|
}
|
|
function addObjectDiffToProperties(prev2, next2, properties2, indent) {
|
|
var isDeeplyEqual = true;
|
|
for (key in prev2)
|
|
key in next2 || (properties2.push([
|
|
REMOVED + "\xA0\xA0".repeat(indent) + key,
|
|
"\u2026"
|
|
]), isDeeplyEqual = false);
|
|
for (var _key in next2)
|
|
if (_key in prev2) {
|
|
var key = prev2[_key];
|
|
var nextValue = next2[_key];
|
|
if (key !== nextValue) {
|
|
if (0 === indent && "children" === _key)
|
|
isDeeplyEqual = "\xA0\xA0".repeat(indent) + _key, properties2.push(
|
|
[REMOVED + isDeeplyEqual, "\u2026"],
|
|
[ADDED + isDeeplyEqual, "\u2026"]
|
|
);
|
|
else {
|
|
if (!(3 <= indent)) {
|
|
if ("object" === typeof key && "object" === typeof nextValue && null !== key && null !== nextValue && key.$$typeof === nextValue.$$typeof)
|
|
if (nextValue.$$typeof === REACT_ELEMENT_TYPE) {
|
|
if (key.type === nextValue.type && key.key === nextValue.key) {
|
|
key = getComponentNameFromType(nextValue.type) || "\u2026";
|
|
isDeeplyEqual = "\xA0\xA0".repeat(indent) + _key;
|
|
key = "<" + key + " \u2026 />";
|
|
properties2.push(
|
|
[REMOVED + isDeeplyEqual, key],
|
|
[ADDED + isDeeplyEqual, key]
|
|
);
|
|
isDeeplyEqual = false;
|
|
continue;
|
|
}
|
|
} else {
|
|
var prevKind = Object.prototype.toString.call(key), nextKind = Object.prototype.toString.call(nextValue);
|
|
if (prevKind === nextKind && ("[object Object]" === nextKind || "[object Array]" === nextKind)) {
|
|
prevKind = [
|
|
UNCHANGED + "\xA0\xA0".repeat(indent) + _key,
|
|
"[object Array]" === nextKind ? "Array" : ""
|
|
];
|
|
properties2.push(prevKind);
|
|
nextKind = properties2.length;
|
|
addObjectDiffToProperties(
|
|
key,
|
|
nextValue,
|
|
properties2,
|
|
indent + 1
|
|
) ? nextKind === properties2.length && (prevKind[1] = "Referentially unequal but deeply equal objects. Consider memoization.") : isDeeplyEqual = false;
|
|
continue;
|
|
}
|
|
}
|
|
else if ("function" === typeof key && "function" === typeof nextValue && key.name === nextValue.name && key.length === nextValue.length && (prevKind = Function.prototype.toString.call(key), nextKind = Function.prototype.toString.call(nextValue), prevKind === nextKind)) {
|
|
key = "" === nextValue.name ? "() => {}" : nextValue.name + "() {}";
|
|
properties2.push([
|
|
UNCHANGED + "\xA0\xA0".repeat(indent) + _key,
|
|
key + " Referentially unequal function closure. Consider memoization."
|
|
]);
|
|
continue;
|
|
}
|
|
}
|
|
addValueToProperties(_key, key, properties2, indent, REMOVED);
|
|
addValueToProperties(_key, nextValue, properties2, indent, ADDED);
|
|
}
|
|
isDeeplyEqual = false;
|
|
}
|
|
} else
|
|
properties2.push([
|
|
ADDED + "\xA0\xA0".repeat(indent) + _key,
|
|
"\u2026"
|
|
]), isDeeplyEqual = false;
|
|
return isDeeplyEqual;
|
|
}
|
|
function setCurrentTrackFromLanes(lanes) {
|
|
currentTrack = lanes & 63 ? "Blocking" : lanes & 64 ? "Gesture" : lanes & 4194176 ? "Transition" : lanes & 62914560 ? "Suspense" : lanes & 2080374784 ? "Idle" : "Other";
|
|
}
|
|
function logComponentTrigger(fiber, startTime, endTime, trigger) {
|
|
supportsUserTiming && (reusableComponentOptions.start = startTime, reusableComponentOptions.end = endTime, reusableComponentDevToolDetails.color = "warning", reusableComponentDevToolDetails.tooltipText = trigger, reusableComponentDevToolDetails.properties = null, (fiber = fiber._debugTask) ? fiber.run(
|
|
performance.measure.bind(
|
|
performance,
|
|
trigger,
|
|
reusableComponentOptions
|
|
)
|
|
) : performance.measure(trigger, reusableComponentOptions));
|
|
}
|
|
function logComponentReappeared(fiber, startTime, endTime) {
|
|
logComponentTrigger(fiber, startTime, endTime, "Reconnect");
|
|
}
|
|
function logComponentRender(fiber, startTime, endTime, wasHydrated, committedLanes) {
|
|
var name = getComponentNameFromFiber(fiber);
|
|
if (null !== name && supportsUserTiming) {
|
|
var alternate = fiber.alternate, selfTime = fiber.actualDuration;
|
|
if (null === alternate || alternate.child !== fiber.child)
|
|
for (var child = fiber.child; null !== child; child = child.sibling)
|
|
selfTime -= child.actualDuration;
|
|
wasHydrated = 0.5 > selfTime ? wasHydrated ? "tertiary-light" : "primary-light" : 10 > selfTime ? wasHydrated ? "tertiary" : "primary" : 100 > selfTime ? wasHydrated ? "tertiary-dark" : "primary-dark" : "error";
|
|
var props = fiber.memoizedProps;
|
|
selfTime = fiber._debugTask;
|
|
null !== props && null !== alternate && alternate.memoizedProps !== props ? (child = [resuableChangedPropsEntry], props = addObjectDiffToProperties(
|
|
alternate.memoizedProps,
|
|
props,
|
|
child,
|
|
0
|
|
), 1 < child.length && (props && !alreadyWarnedForDeepEquality && 0 === (alternate.lanes & committedLanes) && 100 < fiber.actualDuration ? (alreadyWarnedForDeepEquality = true, child[0] = reusableDeeplyEqualPropsEntry, reusableComponentDevToolDetails.color = "warning", reusableComponentDevToolDetails.tooltipText = DEEP_EQUALITY_WARNING) : (reusableComponentDevToolDetails.color = wasHydrated, reusableComponentDevToolDetails.tooltipText = name), reusableComponentDevToolDetails.properties = child, reusableComponentOptions.start = startTime, reusableComponentOptions.end = endTime, null != selfTime ? selfTime.run(
|
|
performance.measure.bind(
|
|
performance,
|
|
"\u200B" + name,
|
|
reusableComponentOptions
|
|
)
|
|
) : performance.measure(
|
|
"\u200B" + name,
|
|
reusableComponentOptions
|
|
))) : null != selfTime ? selfTime.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
name,
|
|
startTime,
|
|
endTime,
|
|
COMPONENTS_TRACK,
|
|
void 0,
|
|
wasHydrated
|
|
)
|
|
) : console.timeStamp(
|
|
name,
|
|
startTime,
|
|
endTime,
|
|
COMPONENTS_TRACK,
|
|
void 0,
|
|
wasHydrated
|
|
);
|
|
}
|
|
}
|
|
function logComponentErrored(fiber, startTime, endTime, errors) {
|
|
if (supportsUserTiming) {
|
|
var name = getComponentNameFromFiber(fiber);
|
|
if (null !== name) {
|
|
for (var debugTask = null, properties2 = [], i = 0; i < errors.length; i++) {
|
|
var capturedValue = errors[i];
|
|
null == debugTask && null !== capturedValue.source && (debugTask = capturedValue.source._debugTask);
|
|
capturedValue = capturedValue.value;
|
|
properties2.push([
|
|
"Error",
|
|
"object" === typeof capturedValue && null !== capturedValue && "string" === typeof capturedValue.message ? String(capturedValue.message) : String(capturedValue)
|
|
]);
|
|
}
|
|
null !== fiber.key && addValueToProperties("key", fiber.key, properties2, 0, "");
|
|
null !== fiber.memoizedProps && addObjectToProperties(fiber.memoizedProps, properties2, 0, "");
|
|
null == debugTask && (debugTask = fiber._debugTask);
|
|
fiber = {
|
|
start: startTime,
|
|
end: endTime,
|
|
detail: {
|
|
devtools: {
|
|
color: "error",
|
|
track: COMPONENTS_TRACK,
|
|
tooltipText: 13 === fiber.tag ? "Hydration failed" : "Error boundary caught an error",
|
|
properties: properties2
|
|
}
|
|
}
|
|
};
|
|
debugTask ? debugTask.run(
|
|
performance.measure.bind(performance, "\u200B" + name, fiber)
|
|
) : performance.measure("\u200B" + name, fiber);
|
|
}
|
|
}
|
|
}
|
|
function logComponentEffect(fiber, startTime, endTime, selfTime, errors) {
|
|
if (null !== errors) {
|
|
if (supportsUserTiming) {
|
|
var name = getComponentNameFromFiber(fiber);
|
|
if (null !== name) {
|
|
selfTime = [];
|
|
for (var i = 0; i < errors.length; i++) {
|
|
var error = errors[i].value;
|
|
selfTime.push([
|
|
"Error",
|
|
"object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error)
|
|
]);
|
|
}
|
|
null !== fiber.key && addValueToProperties("key", fiber.key, selfTime, 0, "");
|
|
null !== fiber.memoizedProps && addObjectToProperties(fiber.memoizedProps, selfTime, 0, "");
|
|
startTime = {
|
|
start: startTime,
|
|
end: endTime,
|
|
detail: {
|
|
devtools: {
|
|
color: "error",
|
|
track: COMPONENTS_TRACK,
|
|
tooltipText: "A lifecycle or effect errored",
|
|
properties: selfTime
|
|
}
|
|
}
|
|
};
|
|
(fiber = fiber._debugTask) ? fiber.run(
|
|
performance.measure.bind(
|
|
performance,
|
|
"\u200B" + name,
|
|
startTime
|
|
)
|
|
) : performance.measure("\u200B" + name, startTime);
|
|
}
|
|
}
|
|
} else
|
|
name = getComponentNameFromFiber(fiber), null !== name && supportsUserTiming && (errors = 1 > selfTime ? "secondary-light" : 100 > selfTime ? "secondary" : 500 > selfTime ? "secondary-dark" : "error", (fiber = fiber._debugTask) ? fiber.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
name,
|
|
startTime,
|
|
endTime,
|
|
COMPONENTS_TRACK,
|
|
void 0,
|
|
errors
|
|
)
|
|
) : console.timeStamp(
|
|
name,
|
|
startTime,
|
|
endTime,
|
|
COMPONENTS_TRACK,
|
|
void 0,
|
|
errors
|
|
));
|
|
}
|
|
function logRenderPhase(startTime, endTime, lanes, debugTask) {
|
|
if (supportsUserTiming && !(endTime <= startTime)) {
|
|
var color2 = (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark";
|
|
lanes = (lanes & 536870912) === lanes ? "Prepared" : (lanes & 201326741) === lanes ? "Hydrated" : "Render";
|
|
debugTask ? debugTask.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
lanes,
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
color2
|
|
)
|
|
) : console.timeStamp(
|
|
lanes,
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
color2
|
|
);
|
|
}
|
|
}
|
|
function logSuspendedRenderPhase(startTime, endTime, lanes, debugTask) {
|
|
!supportsUserTiming || endTime <= startTime || (lanes = (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark", debugTask ? debugTask.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
"Prewarm",
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
lanes
|
|
)
|
|
) : console.timeStamp(
|
|
"Prewarm",
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
lanes
|
|
));
|
|
}
|
|
function logSuspendedWithDelayPhase(startTime, endTime, lanes, debugTask) {
|
|
!supportsUserTiming || endTime <= startTime || (lanes = (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark", debugTask ? debugTask.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
"Suspended",
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
lanes
|
|
)
|
|
) : console.timeStamp(
|
|
"Suspended",
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
lanes
|
|
));
|
|
}
|
|
function logRecoveredRenderPhase(startTime, endTime, lanes, recoverableErrors, hydrationFailed, debugTask) {
|
|
if (supportsUserTiming && !(endTime <= startTime)) {
|
|
lanes = [];
|
|
for (var i = 0; i < recoverableErrors.length; i++) {
|
|
var error = recoverableErrors[i].value;
|
|
lanes.push([
|
|
"Recoverable Error",
|
|
"object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error)
|
|
]);
|
|
}
|
|
startTime = {
|
|
start: startTime,
|
|
end: endTime,
|
|
detail: {
|
|
devtools: {
|
|
color: "primary-dark",
|
|
track: currentTrack,
|
|
trackGroup: LANES_TRACK_GROUP,
|
|
tooltipText: hydrationFailed ? "Hydration Failed" : "Recovered after Error",
|
|
properties: lanes
|
|
}
|
|
}
|
|
};
|
|
debugTask ? debugTask.run(
|
|
performance.measure.bind(performance, "Recovered", startTime)
|
|
) : performance.measure("Recovered", startTime);
|
|
}
|
|
}
|
|
function logErroredRenderPhase(startTime, endTime, lanes, debugTask) {
|
|
!supportsUserTiming || endTime <= startTime || (debugTask ? debugTask.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
"Errored",
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"error"
|
|
)
|
|
) : console.timeStamp(
|
|
"Errored",
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"error"
|
|
));
|
|
}
|
|
function logSuspendedCommitPhase(startTime, endTime, reason, debugTask) {
|
|
!supportsUserTiming || endTime <= startTime || (debugTask ? debugTask.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
reason,
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"secondary-light"
|
|
)
|
|
) : console.timeStamp(
|
|
reason,
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"secondary-light"
|
|
));
|
|
}
|
|
function logCommitErrored(startTime, endTime, errors, passive, debugTask) {
|
|
if (supportsUserTiming && !(endTime <= startTime)) {
|
|
for (var properties2 = [], i = 0; i < errors.length; i++) {
|
|
var error = errors[i].value;
|
|
properties2.push([
|
|
"Error",
|
|
"object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error)
|
|
]);
|
|
}
|
|
startTime = {
|
|
start: startTime,
|
|
end: endTime,
|
|
detail: {
|
|
devtools: {
|
|
color: "error",
|
|
track: currentTrack,
|
|
trackGroup: LANES_TRACK_GROUP,
|
|
tooltipText: passive ? "Remaining Effects Errored" : "Commit Errored",
|
|
properties: properties2
|
|
}
|
|
}
|
|
};
|
|
debugTask ? debugTask.run(
|
|
performance.measure.bind(performance, "Errored", startTime)
|
|
) : performance.measure("Errored", startTime);
|
|
}
|
|
}
|
|
function logAnimatingPhase(startTime, endTime, debugTask) {
|
|
!supportsUserTiming || endTime <= startTime || (debugTask ? debugTask.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
"Animating",
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"secondary-dark"
|
|
)
|
|
) : console.timeStamp(
|
|
"Animating",
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"secondary-dark"
|
|
));
|
|
}
|
|
function finishQueueingConcurrentUpdates() {
|
|
for (var endIndex = concurrentQueuesIndex, i = concurrentlyUpdatedLanes = concurrentQueuesIndex = 0; i < endIndex; ) {
|
|
var fiber = concurrentQueues[i];
|
|
concurrentQueues[i++] = null;
|
|
var queue = concurrentQueues[i];
|
|
concurrentQueues[i++] = null;
|
|
var update2 = concurrentQueues[i];
|
|
concurrentQueues[i++] = null;
|
|
var lane = concurrentQueues[i];
|
|
concurrentQueues[i++] = null;
|
|
if (null !== queue && null !== update2) {
|
|
var pending = queue.pending;
|
|
null === pending ? update2.next = update2 : (update2.next = pending.next, pending.next = update2);
|
|
queue.pending = update2;
|
|
}
|
|
0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update2, lane);
|
|
}
|
|
}
|
|
function enqueueUpdate$1(fiber, queue, update2, lane) {
|
|
concurrentQueues[concurrentQueuesIndex++] = fiber;
|
|
concurrentQueues[concurrentQueuesIndex++] = queue;
|
|
concurrentQueues[concurrentQueuesIndex++] = update2;
|
|
concurrentQueues[concurrentQueuesIndex++] = lane;
|
|
concurrentlyUpdatedLanes |= lane;
|
|
fiber.lanes |= lane;
|
|
fiber = fiber.alternate;
|
|
null !== fiber && (fiber.lanes |= lane);
|
|
}
|
|
function enqueueConcurrentHookUpdate(fiber, queue, update2, lane) {
|
|
enqueueUpdate$1(fiber, queue, update2, lane);
|
|
return getRootForUpdatedFiber(fiber);
|
|
}
|
|
function enqueueConcurrentRenderForLane(fiber, lane) {
|
|
enqueueUpdate$1(fiber, null, null, lane);
|
|
return getRootForUpdatedFiber(fiber);
|
|
}
|
|
function markUpdateLaneFromFiberToRoot(sourceFiber, update2, lane) {
|
|
sourceFiber.lanes |= lane;
|
|
var alternate = sourceFiber.alternate;
|
|
null !== alternate && (alternate.lanes |= lane);
|
|
for (var isHidden = false, parent = sourceFiber.return; null !== parent; )
|
|
parent.childLanes |= lane, alternate = parent.alternate, null !== alternate && (alternate.childLanes |= lane), 22 === parent.tag && (sourceFiber = parent.stateNode, null === sourceFiber || sourceFiber._visibility & OffscreenVisible || (isHidden = true)), sourceFiber = parent, parent = parent.return;
|
|
return 3 === sourceFiber.tag ? (parent = sourceFiber.stateNode, isHidden && null !== update2 && (isHidden = 31 - clz32(lane), sourceFiber = parent.hiddenUpdates, alternate = sourceFiber[isHidden], null === alternate ? sourceFiber[isHidden] = [update2] : alternate.push(update2), update2.lane = lane | 536870912), parent) : null;
|
|
}
|
|
function getRootForUpdatedFiber(sourceFiber) {
|
|
if (nestedUpdateCount > NESTED_UPDATE_LIMIT)
|
|
throw nestedPassiveUpdateCount = nestedUpdateCount = 0, rootWithPassiveNestedUpdates = 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."
|
|
);
|
|
nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT && (nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, console.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."
|
|
));
|
|
null === sourceFiber.alternate && 0 !== (sourceFiber.flags & 4098) && warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
|
|
for (var node2 = sourceFiber, parent = node2.return; null !== parent; )
|
|
null === node2.alternate && 0 !== (node2.flags & 4098) && warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber), node2 = parent, parent = node2.return;
|
|
return 3 === node2.tag ? node2.stateNode : null;
|
|
}
|
|
function resolveFunctionForHotReloading(type) {
|
|
if (null === resolveFamily) return type;
|
|
var family = resolveFamily(type);
|
|
return void 0 === family ? type : family.current;
|
|
}
|
|
function resolveForwardRefForHotReloading(type) {
|
|
if (null === resolveFamily) return type;
|
|
var family = resolveFamily(type);
|
|
return void 0 === family ? null !== type && void 0 !== type && "function" === typeof type.render && (family = resolveFunctionForHotReloading(type.render), type.render !== family) ? (family = { $$typeof: REACT_FORWARD_REF_TYPE, render: family }, void 0 !== type.displayName && (family.displayName = type.displayName), family) : type : family.current;
|
|
}
|
|
function isCompatibleFamilyForHotReloading(fiber, element) {
|
|
if (null === resolveFamily) return false;
|
|
var prevType = fiber.elementType;
|
|
element = element.type;
|
|
var needsCompareFamilies = false, $$typeofNextType = "object" === typeof element && null !== element ? element.$$typeof : null;
|
|
switch (fiber.tag) {
|
|
case 1:
|
|
"function" === typeof element && (needsCompareFamilies = true);
|
|
break;
|
|
case 0:
|
|
"function" === typeof element ? needsCompareFamilies = true : $$typeofNextType === REACT_LAZY_TYPE && (needsCompareFamilies = true);
|
|
break;
|
|
case 11:
|
|
$$typeofNextType === REACT_FORWARD_REF_TYPE ? needsCompareFamilies = true : $$typeofNextType === REACT_LAZY_TYPE && (needsCompareFamilies = true);
|
|
break;
|
|
case 14:
|
|
case 15:
|
|
$$typeofNextType === REACT_MEMO_TYPE ? needsCompareFamilies = true : $$typeofNextType === REACT_LAZY_TYPE && (needsCompareFamilies = true);
|
|
break;
|
|
default:
|
|
return false;
|
|
}
|
|
return needsCompareFamilies && (fiber = resolveFamily(prevType), void 0 !== fiber && fiber === resolveFamily(element)) ? true : false;
|
|
}
|
|
function markFailedErrorBoundaryForHotReloading(fiber) {
|
|
null !== resolveFamily && "function" === typeof WeakSet && (null === failedBoundaries && (failedBoundaries = /* @__PURE__ */ new WeakSet()), failedBoundaries.add(fiber));
|
|
}
|
|
function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
|
|
do {
|
|
var _fiber = fiber, alternate = _fiber.alternate, child = _fiber.child, sibling = _fiber.sibling, tag = _fiber.tag;
|
|
_fiber = _fiber.type;
|
|
var candidateType = null;
|
|
switch (tag) {
|
|
case 0:
|
|
case 15:
|
|
case 1:
|
|
candidateType = _fiber;
|
|
break;
|
|
case 11:
|
|
candidateType = _fiber.render;
|
|
}
|
|
if (null === resolveFamily)
|
|
throw Error("Expected resolveFamily to be set during hot reload.");
|
|
var needsRender = false;
|
|
_fiber = false;
|
|
null !== candidateType && (candidateType = resolveFamily(candidateType), void 0 !== candidateType && (staleFamilies.has(candidateType) ? _fiber = true : updatedFamilies.has(candidateType) && (1 === tag ? _fiber = true : needsRender = true)));
|
|
null !== failedBoundaries && (failedBoundaries.has(fiber) || null !== alternate && failedBoundaries.has(alternate)) && (_fiber = true);
|
|
_fiber && (fiber._debugNeedsRemount = true);
|
|
if (_fiber || needsRender)
|
|
alternate = enqueueConcurrentRenderForLane(fiber, 2), null !== alternate && scheduleUpdateOnFiber(alternate, fiber, 2);
|
|
null === child || _fiber || scheduleFibersWithFamiliesRecursively(
|
|
child,
|
|
updatedFamilies,
|
|
staleFamilies
|
|
);
|
|
if (null === sibling) break;
|
|
fiber = sibling;
|
|
} while (1);
|
|
}
|
|
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.refCleanup = this.ref = null;
|
|
this.pendingProps = pendingProps;
|
|
this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null;
|
|
this.mode = mode;
|
|
this.subtreeFlags = this.flags = 0;
|
|
this.deletions = null;
|
|
this.childLanes = this.lanes = 0;
|
|
this.alternate = null;
|
|
this.actualDuration = -0;
|
|
this.actualStartTime = -1.1;
|
|
this.treeBaseDuration = this.selfBaseDuration = -0;
|
|
this._debugTask = this._debugStack = this._debugOwner = this._debugInfo = null;
|
|
this._debugNeedsRemount = false;
|
|
this._debugHookTypes = null;
|
|
hasBadMapPolyfill || "function" !== typeof Object.preventExtensions || Object.preventExtensions(this);
|
|
}
|
|
function shouldConstruct(Component) {
|
|
Component = Component.prototype;
|
|
return !(!Component || !Component.isReactComponent);
|
|
}
|
|
function createWorkInProgress(current2, pendingProps) {
|
|
var workInProgress2 = current2.alternate;
|
|
null === workInProgress2 ? (workInProgress2 = createFiber(
|
|
current2.tag,
|
|
pendingProps,
|
|
current2.key,
|
|
current2.mode
|
|
), workInProgress2.elementType = current2.elementType, workInProgress2.type = current2.type, workInProgress2.stateNode = current2.stateNode, workInProgress2._debugOwner = current2._debugOwner, workInProgress2._debugStack = current2._debugStack, workInProgress2._debugTask = current2._debugTask, workInProgress2._debugHookTypes = current2._debugHookTypes, workInProgress2.alternate = current2, current2.alternate = workInProgress2) : (workInProgress2.pendingProps = pendingProps, workInProgress2.type = current2.type, workInProgress2.flags = 0, workInProgress2.subtreeFlags = 0, workInProgress2.deletions = null, workInProgress2.actualDuration = -0, workInProgress2.actualStartTime = -1.1);
|
|
workInProgress2.flags = current2.flags & 65011712;
|
|
workInProgress2.childLanes = current2.childLanes;
|
|
workInProgress2.lanes = current2.lanes;
|
|
workInProgress2.child = current2.child;
|
|
workInProgress2.memoizedProps = current2.memoizedProps;
|
|
workInProgress2.memoizedState = current2.memoizedState;
|
|
workInProgress2.updateQueue = current2.updateQueue;
|
|
pendingProps = current2.dependencies;
|
|
workInProgress2.dependencies = null === pendingProps ? null : {
|
|
lanes: pendingProps.lanes,
|
|
firstContext: pendingProps.firstContext,
|
|
_debugThenableState: pendingProps._debugThenableState
|
|
};
|
|
workInProgress2.sibling = current2.sibling;
|
|
workInProgress2.index = current2.index;
|
|
workInProgress2.ref = current2.ref;
|
|
workInProgress2.refCleanup = current2.refCleanup;
|
|
workInProgress2.selfBaseDuration = current2.selfBaseDuration;
|
|
workInProgress2.treeBaseDuration = current2.treeBaseDuration;
|
|
workInProgress2._debugInfo = current2._debugInfo;
|
|
workInProgress2._debugNeedsRemount = current2._debugNeedsRemount;
|
|
switch (workInProgress2.tag) {
|
|
case 0:
|
|
case 15:
|
|
workInProgress2.type = resolveFunctionForHotReloading(current2.type);
|
|
break;
|
|
case 1:
|
|
workInProgress2.type = resolveFunctionForHotReloading(current2.type);
|
|
break;
|
|
case 11:
|
|
workInProgress2.type = resolveForwardRefForHotReloading(current2.type);
|
|
}
|
|
return workInProgress2;
|
|
}
|
|
function resetWorkInProgress(workInProgress2, renderLanes2) {
|
|
workInProgress2.flags &= 65011714;
|
|
var current2 = workInProgress2.alternate;
|
|
null === current2 ? (workInProgress2.childLanes = 0, workInProgress2.lanes = renderLanes2, workInProgress2.child = null, workInProgress2.subtreeFlags = 0, workInProgress2.memoizedProps = null, workInProgress2.memoizedState = null, workInProgress2.updateQueue = null, workInProgress2.dependencies = null, workInProgress2.stateNode = null, workInProgress2.selfBaseDuration = 0, workInProgress2.treeBaseDuration = 0) : (workInProgress2.childLanes = current2.childLanes, workInProgress2.lanes = current2.lanes, workInProgress2.child = current2.child, workInProgress2.subtreeFlags = 0, workInProgress2.deletions = null, workInProgress2.memoizedProps = current2.memoizedProps, workInProgress2.memoizedState = current2.memoizedState, workInProgress2.updateQueue = current2.updateQueue, workInProgress2.type = current2.type, renderLanes2 = current2.dependencies, workInProgress2.dependencies = null === renderLanes2 ? null : {
|
|
lanes: renderLanes2.lanes,
|
|
firstContext: renderLanes2.firstContext,
|
|
_debugThenableState: renderLanes2._debugThenableState
|
|
}, workInProgress2.selfBaseDuration = current2.selfBaseDuration, workInProgress2.treeBaseDuration = current2.treeBaseDuration);
|
|
return workInProgress2;
|
|
}
|
|
function createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes) {
|
|
var fiberTag = 0, resolvedType = type;
|
|
if ("function" === typeof type)
|
|
shouldConstruct(type) && (fiberTag = 1), resolvedType = resolveFunctionForHotReloading(resolvedType);
|
|
else if ("string" === typeof type)
|
|
fiberTag = getHostContext(), fiberTag = isHostHoistableType(type, pendingProps, fiberTag) ? 26 : "html" === type || "head" === type || "body" === type ? 27 : 5;
|
|
else
|
|
a: switch (type) {
|
|
case REACT_ACTIVITY_TYPE:
|
|
return key = createFiber(31, pendingProps, key, mode), key.elementType = REACT_ACTIVITY_TYPE, key.lanes = lanes, key;
|
|
case REACT_FRAGMENT_TYPE:
|
|
return createFiberFromFragment(
|
|
pendingProps.children,
|
|
mode,
|
|
lanes,
|
|
key
|
|
);
|
|
case REACT_STRICT_MODE_TYPE:
|
|
fiberTag = 8;
|
|
mode |= StrictLegacyMode;
|
|
mode |= StrictEffectsMode;
|
|
break;
|
|
case REACT_PROFILER_TYPE:
|
|
return type = pendingProps, owner = mode, "string" !== typeof type.id && console.error(
|
|
'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',
|
|
typeof type.id
|
|
), key = createFiber(12, type, key, owner | ProfileMode), key.elementType = REACT_PROFILER_TYPE, key.lanes = lanes, key.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }, key;
|
|
case REACT_SUSPENSE_TYPE:
|
|
return key = createFiber(13, pendingProps, key, mode), key.elementType = REACT_SUSPENSE_TYPE, key.lanes = lanes, key;
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return key = createFiber(19, pendingProps, key, mode), key.elementType = REACT_SUSPENSE_LIST_TYPE, key.lanes = lanes, key;
|
|
default:
|
|
if ("object" === typeof type && null !== type)
|
|
switch (type.$$typeof) {
|
|
case REACT_CONTEXT_TYPE:
|
|
fiberTag = 10;
|
|
break a;
|
|
case REACT_CONSUMER_TYPE:
|
|
fiberTag = 9;
|
|
break a;
|
|
case REACT_FORWARD_REF_TYPE:
|
|
fiberTag = 11;
|
|
resolvedType = resolveForwardRefForHotReloading(resolvedType);
|
|
break a;
|
|
case REACT_MEMO_TYPE:
|
|
fiberTag = 14;
|
|
break a;
|
|
case REACT_LAZY_TYPE:
|
|
fiberTag = 16;
|
|
resolvedType = null;
|
|
break a;
|
|
}
|
|
resolvedType = "";
|
|
if (void 0 === type || "object" === typeof type && null !== type && 0 === Object.keys(type).length)
|
|
resolvedType += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
null === type ? pendingProps = "null" : isArrayImpl(type) ? pendingProps = "array" : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE ? (pendingProps = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />", resolvedType = " Did you accidentally export a JSX literal instead of a component?") : pendingProps = typeof type;
|
|
(fiberTag = owner ? getComponentNameFromOwner(owner) : null) && (resolvedType += "\n\nCheck the render method of `" + fiberTag + "`.");
|
|
fiberTag = 29;
|
|
pendingProps = Error(
|
|
"Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (pendingProps + "." + resolvedType)
|
|
);
|
|
resolvedType = null;
|
|
}
|
|
key = createFiber(fiberTag, pendingProps, key, mode);
|
|
key.elementType = type;
|
|
key.type = resolvedType;
|
|
key.lanes = lanes;
|
|
key._debugOwner = owner;
|
|
return key;
|
|
}
|
|
function createFiberFromElement(element, mode, lanes) {
|
|
mode = createFiberFromTypeAndProps(
|
|
element.type,
|
|
element.key,
|
|
element.props,
|
|
element._owner,
|
|
mode,
|
|
lanes
|
|
);
|
|
mode._debugOwner = element._owner;
|
|
mode._debugStack = element._debugStack;
|
|
mode._debugTask = element._debugTask;
|
|
return mode;
|
|
}
|
|
function createFiberFromFragment(elements, mode, lanes, key) {
|
|
elements = createFiber(7, elements, key, mode);
|
|
elements.lanes = lanes;
|
|
return elements;
|
|
}
|
|
function createFiberFromText(content, mode, lanes) {
|
|
content = createFiber(6, content, null, mode);
|
|
content.lanes = lanes;
|
|
return content;
|
|
}
|
|
function createFiberFromDehydratedFragment(dehydratedNode) {
|
|
var fiber = createFiber(18, null, null, NoMode);
|
|
fiber.stateNode = dehydratedNode;
|
|
return fiber;
|
|
}
|
|
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 createCapturedValueAtFiber(value, source) {
|
|
if ("object" === typeof value && null !== value) {
|
|
var existing = CapturedStacks.get(value);
|
|
if (void 0 !== existing) return existing;
|
|
source = {
|
|
value,
|
|
source,
|
|
stack: getStackByFiberInDevAndProd(source)
|
|
};
|
|
CapturedStacks.set(value, source);
|
|
return source;
|
|
}
|
|
return {
|
|
value,
|
|
source,
|
|
stack: getStackByFiberInDevAndProd(source)
|
|
};
|
|
}
|
|
function pushTreeFork(workInProgress2, totalChildren) {
|
|
warnIfNotHydrating();
|
|
forkStack[forkStackIndex++] = treeForkCount;
|
|
forkStack[forkStackIndex++] = treeForkProvider;
|
|
treeForkProvider = workInProgress2;
|
|
treeForkCount = totalChildren;
|
|
}
|
|
function pushTreeId(workInProgress2, totalChildren, index) {
|
|
warnIfNotHydrating();
|
|
idStack[idStackIndex++] = treeContextId;
|
|
idStack[idStackIndex++] = treeContextOverflow;
|
|
idStack[idStackIndex++] = treeContextProvider;
|
|
treeContextProvider = workInProgress2;
|
|
var baseIdWithLeadingBit = treeContextId;
|
|
workInProgress2 = treeContextOverflow;
|
|
var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
|
|
baseIdWithLeadingBit &= ~(1 << baseLength);
|
|
index += 1;
|
|
var length2 = 32 - clz32(totalChildren) + baseLength;
|
|
if (30 < length2) {
|
|
var numberOfOverflowBits = baseLength - baseLength % 5;
|
|
length2 = (baseIdWithLeadingBit & (1 << numberOfOverflowBits) - 1).toString(32);
|
|
baseIdWithLeadingBit >>= numberOfOverflowBits;
|
|
baseLength -= numberOfOverflowBits;
|
|
treeContextId = 1 << 32 - clz32(totalChildren) + baseLength | index << baseLength | baseIdWithLeadingBit;
|
|
treeContextOverflow = length2 + workInProgress2;
|
|
} else
|
|
treeContextId = 1 << length2 | index << baseLength | baseIdWithLeadingBit, treeContextOverflow = workInProgress2;
|
|
}
|
|
function pushMaterializedTreeId(workInProgress2) {
|
|
warnIfNotHydrating();
|
|
null !== workInProgress2.return && (pushTreeFork(workInProgress2, 1), pushTreeId(workInProgress2, 1, 0));
|
|
}
|
|
function popTreeContext(workInProgress2) {
|
|
for (; workInProgress2 === treeForkProvider; )
|
|
treeForkProvider = forkStack[--forkStackIndex], forkStack[forkStackIndex] = null, treeForkCount = forkStack[--forkStackIndex], forkStack[forkStackIndex] = null;
|
|
for (; workInProgress2 === treeContextProvider; )
|
|
treeContextProvider = idStack[--idStackIndex], idStack[idStackIndex] = null, treeContextOverflow = idStack[--idStackIndex], idStack[idStackIndex] = null, treeContextId = idStack[--idStackIndex], idStack[idStackIndex] = null;
|
|
}
|
|
function getSuspendedTreeContext() {
|
|
warnIfNotHydrating();
|
|
return null !== treeContextProvider ? { id: treeContextId, overflow: treeContextOverflow } : null;
|
|
}
|
|
function restoreSuspendedTreeContext(workInProgress2, suspendedContext) {
|
|
warnIfNotHydrating();
|
|
idStack[idStackIndex++] = treeContextId;
|
|
idStack[idStackIndex++] = treeContextOverflow;
|
|
idStack[idStackIndex++] = treeContextProvider;
|
|
treeContextId = suspendedContext.id;
|
|
treeContextOverflow = suspendedContext.overflow;
|
|
treeContextProvider = workInProgress2;
|
|
}
|
|
function warnIfNotHydrating() {
|
|
isHydrating || console.error(
|
|
"Expected to be hydrating. This is a bug in React. Please file an issue."
|
|
);
|
|
}
|
|
function buildHydrationDiffNode(fiber, distanceFromLeaf) {
|
|
if (null === fiber.return) {
|
|
if (null === hydrationDiffRootDEV)
|
|
hydrationDiffRootDEV = {
|
|
fiber,
|
|
children: [],
|
|
serverProps: void 0,
|
|
serverTail: [],
|
|
distanceFromLeaf
|
|
};
|
|
else {
|
|
if (hydrationDiffRootDEV.fiber !== fiber)
|
|
throw Error(
|
|
"Saw multiple hydration diff roots in a pass. This is a bug in React."
|
|
);
|
|
hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf && (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf);
|
|
}
|
|
return hydrationDiffRootDEV;
|
|
}
|
|
var siblings = buildHydrationDiffNode(
|
|
fiber.return,
|
|
distanceFromLeaf + 1
|
|
).children;
|
|
if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber)
|
|
return siblings = siblings[siblings.length - 1], siblings.distanceFromLeaf > distanceFromLeaf && (siblings.distanceFromLeaf = distanceFromLeaf), siblings;
|
|
distanceFromLeaf = {
|
|
fiber,
|
|
children: [],
|
|
serverProps: void 0,
|
|
serverTail: [],
|
|
distanceFromLeaf
|
|
};
|
|
siblings.push(distanceFromLeaf);
|
|
return distanceFromLeaf;
|
|
}
|
|
function warnIfHydrating() {
|
|
isHydrating && console.error(
|
|
"We should not be hydrating here. This is a bug in React. Please file a bug."
|
|
);
|
|
}
|
|
function warnNonHydratedInstance(fiber, rejectedCandidate) {
|
|
didSuspendOrErrorDEV || (fiber = buildHydrationDiffNode(fiber, 0), fiber.serverProps = null, null !== rejectedCandidate && (rejectedCandidate = describeHydratableInstanceForDevWarnings(rejectedCandidate), fiber.serverTail.push(rejectedCandidate)));
|
|
}
|
|
function throwOnHydrationMismatch(fiber) {
|
|
var fromText = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : false, diff = "", diffRoot = hydrationDiffRootDEV;
|
|
null !== diffRoot && (hydrationDiffRootDEV = null, diff = describeDiff(diffRoot));
|
|
queueHydrationError(
|
|
createCapturedValueAtFiber(
|
|
Error(
|
|
"Hydration failed because the server rendered " + (fromText ? "text" : "HTML") + " didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" + diff
|
|
),
|
|
fiber
|
|
)
|
|
);
|
|
throw HydrationMismatchException;
|
|
}
|
|
function prepareToHydrateHostInstance(fiber) {
|
|
var didHydrate = fiber.stateNode;
|
|
var type = fiber.type, props = fiber.memoizedProps;
|
|
didHydrate[internalInstanceKey] = fiber;
|
|
didHydrate[internalPropsKey] = props;
|
|
validatePropertiesInDevelopment(type, props);
|
|
switch (type) {
|
|
case "dialog":
|
|
listenToNonDelegatedEvent("cancel", didHydrate);
|
|
listenToNonDelegatedEvent("close", didHydrate);
|
|
break;
|
|
case "iframe":
|
|
case "object":
|
|
case "embed":
|
|
listenToNonDelegatedEvent("load", didHydrate);
|
|
break;
|
|
case "video":
|
|
case "audio":
|
|
for (type = 0; type < mediaEventTypes.length; type++)
|
|
listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate);
|
|
break;
|
|
case "source":
|
|
listenToNonDelegatedEvent("error", didHydrate);
|
|
break;
|
|
case "img":
|
|
case "image":
|
|
case "link":
|
|
listenToNonDelegatedEvent("error", didHydrate);
|
|
listenToNonDelegatedEvent("load", didHydrate);
|
|
break;
|
|
case "details":
|
|
listenToNonDelegatedEvent("toggle", didHydrate);
|
|
break;
|
|
case "input":
|
|
checkControlledValueProps("input", props);
|
|
listenToNonDelegatedEvent("invalid", didHydrate);
|
|
validateInputProps(didHydrate, props);
|
|
initInput(
|
|
didHydrate,
|
|
props.value,
|
|
props.defaultValue,
|
|
props.checked,
|
|
props.defaultChecked,
|
|
props.type,
|
|
props.name,
|
|
true
|
|
);
|
|
break;
|
|
case "option":
|
|
validateOptionProps(didHydrate, props);
|
|
break;
|
|
case "select":
|
|
checkControlledValueProps("select", props);
|
|
listenToNonDelegatedEvent("invalid", didHydrate);
|
|
validateSelectProps(didHydrate, props);
|
|
break;
|
|
case "textarea":
|
|
checkControlledValueProps("textarea", props), listenToNonDelegatedEvent("invalid", didHydrate), validateTextareaProps(didHydrate, props), initTextarea(
|
|
didHydrate,
|
|
props.value,
|
|
props.defaultValue,
|
|
props.children
|
|
);
|
|
}
|
|
type = props.children;
|
|
"string" !== typeof type && "number" !== typeof type && "bigint" !== typeof type || didHydrate.textContent === "" + type || true === props.suppressHydrationWarning || checkForUnmatchedText(didHydrate.textContent, type) ? (null != props.popover && (listenToNonDelegatedEvent("beforetoggle", didHydrate), listenToNonDelegatedEvent("toggle", didHydrate)), null != props.onScroll && listenToNonDelegatedEvent("scroll", didHydrate), null != props.onScrollEnd && listenToNonDelegatedEvent("scrollend", didHydrate), null != props.onClick && (didHydrate.onclick = noop$1), didHydrate = true) : didHydrate = false;
|
|
didHydrate || throwOnHydrationMismatch(fiber, true);
|
|
}
|
|
function popToNextHostParent(fiber) {
|
|
for (hydrationParentFiber = fiber.return; hydrationParentFiber; )
|
|
switch (hydrationParentFiber.tag) {
|
|
case 5:
|
|
case 31:
|
|
case 13:
|
|
rootOrSingletonContext = false;
|
|
return;
|
|
case 27:
|
|
case 3:
|
|
rootOrSingletonContext = true;
|
|
return;
|
|
default:
|
|
hydrationParentFiber = hydrationParentFiber.return;
|
|
}
|
|
}
|
|
function popHydrationState(fiber) {
|
|
if (fiber !== hydrationParentFiber) return false;
|
|
if (!isHydrating)
|
|
return popToNextHostParent(fiber), isHydrating = true, false;
|
|
var tag = fiber.tag, JSCompiler_temp;
|
|
if (JSCompiler_temp = 3 !== tag && 27 !== tag) {
|
|
if (JSCompiler_temp = 5 === tag)
|
|
JSCompiler_temp = fiber.type, JSCompiler_temp = !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || shouldSetTextContent(fiber.type, fiber.memoizedProps);
|
|
JSCompiler_temp = !JSCompiler_temp;
|
|
}
|
|
if (JSCompiler_temp && nextHydratableInstance) {
|
|
for (JSCompiler_temp = nextHydratableInstance; JSCompiler_temp; ) {
|
|
var diffNode = buildHydrationDiffNode(fiber, 0), description = describeHydratableInstanceForDevWarnings(JSCompiler_temp);
|
|
diffNode.serverTail.push(description);
|
|
JSCompiler_temp = "Suspense" === description.type ? getNextHydratableInstanceAfterHydrationBoundary(JSCompiler_temp) : getNextHydratable(JSCompiler_temp.nextSibling);
|
|
}
|
|
throwOnHydrationMismatch(fiber);
|
|
}
|
|
popToNextHostParent(fiber);
|
|
if (13 === tag) {
|
|
fiber = fiber.memoizedState;
|
|
fiber = null !== fiber ? fiber.dehydrated : null;
|
|
if (!fiber)
|
|
throw Error(
|
|
"Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
nextHydratableInstance = getNextHydratableInstanceAfterHydrationBoundary(fiber);
|
|
} else if (31 === tag) {
|
|
fiber = fiber.memoizedState;
|
|
fiber = null !== fiber ? fiber.dehydrated : null;
|
|
if (!fiber)
|
|
throw Error(
|
|
"Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
nextHydratableInstance = getNextHydratableInstanceAfterHydrationBoundary(fiber);
|
|
} else
|
|
27 === tag ? (tag = nextHydratableInstance, isSingletonScope(fiber.type) ? (fiber = previousHydratableOnEnteringScopedSingleton, previousHydratableOnEnteringScopedSingleton = null, nextHydratableInstance = fiber) : nextHydratableInstance = tag) : nextHydratableInstance = hydrationParentFiber ? getNextHydratable(fiber.stateNode.nextSibling) : null;
|
|
return true;
|
|
}
|
|
function resetHydrationState() {
|
|
nextHydratableInstance = hydrationParentFiber = null;
|
|
didSuspendOrErrorDEV = isHydrating = false;
|
|
}
|
|
function upgradeHydrationErrorsToRecoverable() {
|
|
var queuedErrors = hydrationErrors;
|
|
null !== queuedErrors && (null === workInProgressRootRecoverableErrors ? workInProgressRootRecoverableErrors = queuedErrors : workInProgressRootRecoverableErrors.push.apply(
|
|
workInProgressRootRecoverableErrors,
|
|
queuedErrors
|
|
), hydrationErrors = null);
|
|
return queuedErrors;
|
|
}
|
|
function queueHydrationError(error) {
|
|
null === hydrationErrors ? hydrationErrors = [error] : hydrationErrors.push(error);
|
|
}
|
|
function emitPendingHydrationWarnings() {
|
|
var diffRoot = hydrationDiffRootDEV;
|
|
if (null !== diffRoot) {
|
|
hydrationDiffRootDEV = null;
|
|
for (var diff = describeDiff(diffRoot); 0 < diffRoot.children.length; )
|
|
diffRoot = diffRoot.children[0];
|
|
runWithFiberInDEV(diffRoot.fiber, function() {
|
|
console.error(
|
|
"A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s",
|
|
"https://react.dev/link/hydration-mismatch",
|
|
diff
|
|
);
|
|
});
|
|
}
|
|
}
|
|
function resetContextDependencies() {
|
|
lastContextDependency = currentlyRenderingFiber$1 = null;
|
|
isDisallowedContextReadInDEV = false;
|
|
}
|
|
function pushProvider(providerFiber, context, nextValue) {
|
|
push(valueCursor, context._currentValue, providerFiber);
|
|
context._currentValue = nextValue;
|
|
push(rendererCursorDEV, context._currentRenderer, providerFiber);
|
|
void 0 !== context._currentRenderer && null !== context._currentRenderer && context._currentRenderer !== rendererSigil && console.error(
|
|
"Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."
|
|
);
|
|
context._currentRenderer = rendererSigil;
|
|
}
|
|
function popProvider(context, providerFiber) {
|
|
context._currentValue = valueCursor.current;
|
|
var currentRenderer = rendererCursorDEV.current;
|
|
pop(rendererCursorDEV, providerFiber);
|
|
context._currentRenderer = currentRenderer;
|
|
pop(valueCursor, providerFiber);
|
|
}
|
|
function scheduleContextWorkOnParentPath(parent, renderLanes2, propagationRoot) {
|
|
for (; null !== parent; ) {
|
|
var alternate = parent.alternate;
|
|
(parent.childLanes & renderLanes2) !== renderLanes2 ? (parent.childLanes |= renderLanes2, null !== alternate && (alternate.childLanes |= renderLanes2)) : null !== alternate && (alternate.childLanes & renderLanes2) !== renderLanes2 && (alternate.childLanes |= renderLanes2);
|
|
if (parent === propagationRoot) break;
|
|
parent = parent.return;
|
|
}
|
|
parent !== propagationRoot && console.error(
|
|
"Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
}
|
|
function propagateContextChanges(workInProgress2, contexts, renderLanes2, forcePropagateEntireTree) {
|
|
var fiber = workInProgress2.child;
|
|
null !== fiber && (fiber.return = workInProgress2);
|
|
for (; null !== fiber; ) {
|
|
var list = fiber.dependencies;
|
|
if (null !== list) {
|
|
var nextFiber = fiber.child;
|
|
list = list.firstContext;
|
|
a: for (; null !== list; ) {
|
|
var dependency = list;
|
|
list = fiber;
|
|
for (var i = 0; i < contexts.length; i++)
|
|
if (dependency.context === contexts[i]) {
|
|
list.lanes |= renderLanes2;
|
|
dependency = list.alternate;
|
|
null !== dependency && (dependency.lanes |= renderLanes2);
|
|
scheduleContextWorkOnParentPath(
|
|
list.return,
|
|
renderLanes2,
|
|
workInProgress2
|
|
);
|
|
forcePropagateEntireTree || (nextFiber = null);
|
|
break a;
|
|
}
|
|
list = dependency.next;
|
|
}
|
|
} else if (18 === fiber.tag) {
|
|
nextFiber = fiber.return;
|
|
if (null === nextFiber)
|
|
throw Error(
|
|
"We just came from a parent so we must have had a parent. This is a bug in React."
|
|
);
|
|
nextFiber.lanes |= renderLanes2;
|
|
list = nextFiber.alternate;
|
|
null !== list && (list.lanes |= renderLanes2);
|
|
scheduleContextWorkOnParentPath(
|
|
nextFiber,
|
|
renderLanes2,
|
|
workInProgress2
|
|
);
|
|
nextFiber = null;
|
|
} else nextFiber = fiber.child;
|
|
if (null !== nextFiber) nextFiber.return = fiber;
|
|
else
|
|
for (nextFiber = fiber; null !== nextFiber; ) {
|
|
if (nextFiber === workInProgress2) {
|
|
nextFiber = null;
|
|
break;
|
|
}
|
|
fiber = nextFiber.sibling;
|
|
if (null !== fiber) {
|
|
fiber.return = nextFiber.return;
|
|
nextFiber = fiber;
|
|
break;
|
|
}
|
|
nextFiber = nextFiber.return;
|
|
}
|
|
fiber = nextFiber;
|
|
}
|
|
}
|
|
function propagateParentContextChanges(current2, workInProgress2, renderLanes2, forcePropagateEntireTree) {
|
|
current2 = null;
|
|
for (var parent = workInProgress2, isInsidePropagationBailout = false; null !== parent; ) {
|
|
if (!isInsidePropagationBailout) {
|
|
if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = true;
|
|
else if (0 !== (parent.flags & 262144)) break;
|
|
}
|
|
if (10 === parent.tag) {
|
|
var currentParent = parent.alternate;
|
|
if (null === currentParent)
|
|
throw Error("Should have a current fiber. This is a bug in React.");
|
|
currentParent = currentParent.memoizedProps;
|
|
if (null !== currentParent) {
|
|
var context = parent.type;
|
|
objectIs(parent.pendingProps.value, currentParent.value) || (null !== current2 ? current2.push(context) : current2 = [context]);
|
|
}
|
|
} else if (parent === hostTransitionProviderCursor.current) {
|
|
currentParent = parent.alternate;
|
|
if (null === currentParent)
|
|
throw Error("Should have a current fiber. This is a bug in React.");
|
|
currentParent.memoizedState.memoizedState !== parent.memoizedState.memoizedState && (null !== current2 ? current2.push(HostTransitionContext) : current2 = [HostTransitionContext]);
|
|
}
|
|
parent = parent.return;
|
|
}
|
|
null !== current2 && propagateContextChanges(
|
|
workInProgress2,
|
|
current2,
|
|
renderLanes2,
|
|
forcePropagateEntireTree
|
|
);
|
|
workInProgress2.flags |= 262144;
|
|
}
|
|
function checkIfContextChanged(currentDependencies) {
|
|
for (currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) {
|
|
if (!objectIs(
|
|
currentDependencies.context._currentValue,
|
|
currentDependencies.memoizedValue
|
|
))
|
|
return true;
|
|
currentDependencies = currentDependencies.next;
|
|
}
|
|
return false;
|
|
}
|
|
function prepareToReadContext(workInProgress2) {
|
|
currentlyRenderingFiber$1 = workInProgress2;
|
|
lastContextDependency = null;
|
|
workInProgress2 = workInProgress2.dependencies;
|
|
null !== workInProgress2 && (workInProgress2.firstContext = null);
|
|
}
|
|
function readContext(context) {
|
|
isDisallowedContextReadInDEV && console.error(
|
|
"Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
|
|
);
|
|
return readContextForConsumer(currentlyRenderingFiber$1, context);
|
|
}
|
|
function readContextDuringReconciliation(consumer, context) {
|
|
null === currentlyRenderingFiber$1 && prepareToReadContext(consumer);
|
|
return readContextForConsumer(consumer, context);
|
|
}
|
|
function readContextForConsumer(consumer, context) {
|
|
var value = context._currentValue;
|
|
context = { context, memoizedValue: value, next: null };
|
|
if (null === lastContextDependency) {
|
|
if (null === consumer)
|
|
throw Error(
|
|
"Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
|
|
);
|
|
lastContextDependency = context;
|
|
consumer.dependencies = {
|
|
lanes: 0,
|
|
firstContext: context,
|
|
_debugThenableState: null
|
|
};
|
|
consumer.flags |= 524288;
|
|
} else lastContextDependency = lastContextDependency.next = context;
|
|
return value;
|
|
}
|
|
function createCache3() {
|
|
return {
|
|
controller: new AbortControllerLocal(),
|
|
data: /* @__PURE__ */ new Map(),
|
|
refCount: 0
|
|
};
|
|
}
|
|
function retainCache(cache) {
|
|
cache.controller.signal.aborted && console.warn(
|
|
"A cache instance was retained after it was already freed. This likely indicates a bug in React."
|
|
);
|
|
cache.refCount++;
|
|
}
|
|
function releaseCache(cache) {
|
|
cache.refCount--;
|
|
0 > cache.refCount && console.warn(
|
|
"A cache instance was released after it was already freed. This likely indicates a bug in React."
|
|
);
|
|
0 === cache.refCount && scheduleCallback$2(NormalPriority, function() {
|
|
cache.controller.abort();
|
|
});
|
|
}
|
|
function startUpdateTimerByLane(lane, method, fiber) {
|
|
if (0 !== (lane & 127))
|
|
0 > blockingUpdateTime && (blockingUpdateTime = now(), blockingUpdateTask = createTask(method), blockingUpdateMethodName = method, null != fiber && (blockingUpdateComponentName = getComponentNameFromFiber(fiber)), (executionContext & (RenderContext | CommitContext)) !== NoContext && (componentEffectSpawnedUpdate = true, blockingUpdateType = SPAWNED_UPDATE), lane = resolveEventTimeStamp(), method = resolveEventType(), lane !== blockingEventRepeatTime || method !== blockingEventType ? blockingEventRepeatTime = -1.1 : null !== method && (blockingUpdateType = SPAWNED_UPDATE), blockingEventTime = lane, blockingEventType = method);
|
|
else if (0 !== (lane & 4194048) && 0 > transitionUpdateTime && (transitionUpdateTime = now(), transitionUpdateTask = createTask(method), transitionUpdateMethodName = method, null != fiber && (transitionUpdateComponentName = getComponentNameFromFiber(fiber)), 0 > transitionStartTime)) {
|
|
lane = resolveEventTimeStamp();
|
|
method = resolveEventType();
|
|
if (lane !== transitionEventRepeatTime || method !== transitionEventType)
|
|
transitionEventRepeatTime = -1.1;
|
|
transitionEventTime = lane;
|
|
transitionEventType = method;
|
|
}
|
|
}
|
|
function startHostActionTimer(fiber) {
|
|
if (0 > blockingUpdateTime) {
|
|
blockingUpdateTime = now();
|
|
blockingUpdateTask = null != fiber._debugTask ? fiber._debugTask : null;
|
|
(executionContext & (RenderContext | CommitContext)) !== NoContext && (blockingUpdateType = SPAWNED_UPDATE);
|
|
var newEventTime = resolveEventTimeStamp(), newEventType = resolveEventType();
|
|
newEventTime !== blockingEventRepeatTime || newEventType !== blockingEventType ? blockingEventRepeatTime = -1.1 : null !== newEventType && (blockingUpdateType = SPAWNED_UPDATE);
|
|
blockingEventTime = newEventTime;
|
|
blockingEventType = newEventType;
|
|
}
|
|
if (0 > transitionUpdateTime && (transitionUpdateTime = now(), transitionUpdateTask = null != fiber._debugTask ? fiber._debugTask : null, 0 > transitionStartTime)) {
|
|
fiber = resolveEventTimeStamp();
|
|
newEventTime = resolveEventType();
|
|
if (fiber !== transitionEventRepeatTime || newEventTime !== transitionEventType)
|
|
transitionEventRepeatTime = -1.1;
|
|
transitionEventTime = fiber;
|
|
transitionEventType = newEventTime;
|
|
}
|
|
}
|
|
function pushNestedEffectDurations() {
|
|
var prevEffectDuration = profilerEffectDuration;
|
|
profilerEffectDuration = 0;
|
|
return prevEffectDuration;
|
|
}
|
|
function popNestedEffectDurations(prevEffectDuration) {
|
|
var elapsedTime = profilerEffectDuration;
|
|
profilerEffectDuration = prevEffectDuration;
|
|
return elapsedTime;
|
|
}
|
|
function bubbleNestedEffectDurations(prevEffectDuration) {
|
|
var elapsedTime = profilerEffectDuration;
|
|
profilerEffectDuration += prevEffectDuration;
|
|
return elapsedTime;
|
|
}
|
|
function resetComponentEffectTimers() {
|
|
componentEffectEndTime = componentEffectStartTime = -1.1;
|
|
}
|
|
function pushComponentEffectStart() {
|
|
var prevEffectStart = componentEffectStartTime;
|
|
componentEffectStartTime = -1.1;
|
|
return prevEffectStart;
|
|
}
|
|
function popComponentEffectStart(prevEffectStart) {
|
|
0 <= prevEffectStart && (componentEffectStartTime = prevEffectStart);
|
|
}
|
|
function pushComponentEffectDuration() {
|
|
var prevEffectDuration = componentEffectDuration;
|
|
componentEffectDuration = -0;
|
|
return prevEffectDuration;
|
|
}
|
|
function popComponentEffectDuration(prevEffectDuration) {
|
|
0 <= prevEffectDuration && (componentEffectDuration = prevEffectDuration);
|
|
}
|
|
function pushComponentEffectErrors() {
|
|
var prevErrors = componentEffectErrors;
|
|
componentEffectErrors = null;
|
|
return prevErrors;
|
|
}
|
|
function pushComponentEffectDidSpawnUpdate() {
|
|
var prev2 = componentEffectSpawnedUpdate;
|
|
componentEffectSpawnedUpdate = false;
|
|
return prev2;
|
|
}
|
|
function startProfilerTimer(fiber) {
|
|
profilerStartTime = now();
|
|
0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime);
|
|
}
|
|
function stopProfilerTimerIfRunningAndRecordDuration(fiber) {
|
|
if (0 <= profilerStartTime) {
|
|
var elapsedTime = now() - profilerStartTime;
|
|
fiber.actualDuration += elapsedTime;
|
|
fiber.selfBaseDuration = elapsedTime;
|
|
profilerStartTime = -1;
|
|
}
|
|
}
|
|
function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) {
|
|
if (0 <= profilerStartTime) {
|
|
var elapsedTime = now() - profilerStartTime;
|
|
fiber.actualDuration += elapsedTime;
|
|
profilerStartTime = -1;
|
|
}
|
|
}
|
|
function recordEffectDuration() {
|
|
if (0 <= profilerStartTime) {
|
|
var endTime = now(), elapsedTime = endTime - profilerStartTime;
|
|
profilerStartTime = -1;
|
|
profilerEffectDuration += elapsedTime;
|
|
componentEffectDuration += elapsedTime;
|
|
componentEffectEndTime = endTime;
|
|
}
|
|
}
|
|
function recordEffectError(errorInfo) {
|
|
null === componentEffectErrors && (componentEffectErrors = []);
|
|
componentEffectErrors.push(errorInfo);
|
|
null === commitErrors && (commitErrors = []);
|
|
commitErrors.push(errorInfo);
|
|
}
|
|
function startEffectTimer() {
|
|
profilerStartTime = now();
|
|
0 > componentEffectStartTime && (componentEffectStartTime = profilerStartTime);
|
|
}
|
|
function transferActualDuration(fiber) {
|
|
for (var child = fiber.child; child; )
|
|
fiber.actualDuration += child.actualDuration, child = child.sibling;
|
|
}
|
|
function entangleAsyncAction(transition, thenable) {
|
|
if (null === currentEntangledListeners) {
|
|
var entangledListeners = currentEntangledListeners = [];
|
|
currentEntangledPendingCount = 0;
|
|
currentEntangledLane = requestTransitionLane();
|
|
currentEntangledActionThenable = {
|
|
status: "pending",
|
|
value: void 0,
|
|
then: function(resolve) {
|
|
entangledListeners.push(resolve);
|
|
}
|
|
};
|
|
}
|
|
currentEntangledPendingCount++;
|
|
thenable.then(pingEngtangledActionScope, pingEngtangledActionScope);
|
|
return thenable;
|
|
}
|
|
function pingEngtangledActionScope() {
|
|
if (0 === --currentEntangledPendingCount && (-1 < transitionUpdateTime || (transitionStartTime = -1.1), null !== currentEntangledListeners)) {
|
|
null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled");
|
|
var listeners = currentEntangledListeners;
|
|
currentEntangledListeners = null;
|
|
currentEntangledLane = 0;
|
|
currentEntangledActionThenable = null;
|
|
for (var i = 0; i < listeners.length; i++) (0, listeners[i])();
|
|
}
|
|
}
|
|
function chainThenableValue(thenable, result) {
|
|
var listeners = [], thenableWithOverride = {
|
|
status: "pending",
|
|
value: null,
|
|
reason: null,
|
|
then: function(resolve) {
|
|
listeners.push(resolve);
|
|
}
|
|
};
|
|
thenable.then(
|
|
function() {
|
|
thenableWithOverride.status = "fulfilled";
|
|
thenableWithOverride.value = result;
|
|
for (var i = 0; i < listeners.length; i++) (0, listeners[i])(result);
|
|
},
|
|
function(error) {
|
|
thenableWithOverride.status = "rejected";
|
|
thenableWithOverride.reason = error;
|
|
for (error = 0; error < listeners.length; error++)
|
|
(0, listeners[error])(void 0);
|
|
}
|
|
);
|
|
return thenableWithOverride;
|
|
}
|
|
function peekCacheFromPool() {
|
|
var cacheResumedFromPreviousRender = resumedCache.current;
|
|
return null !== cacheResumedFromPreviousRender ? cacheResumedFromPreviousRender : workInProgressRoot.pooledCache;
|
|
}
|
|
function pushTransition(offscreenWorkInProgress, prevCachePool) {
|
|
null === prevCachePool ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress);
|
|
}
|
|
function getSuspendedCache() {
|
|
var cacheFromPool = peekCacheFromPool();
|
|
return null === cacheFromPool ? null : { parent: CacheContext._currentValue, pool: cacheFromPool };
|
|
}
|
|
function createThenableState() {
|
|
return { didWarnAboutUncachedPromise: false, thenables: [] };
|
|
}
|
|
function isThenableResolved(thenable) {
|
|
thenable = thenable.status;
|
|
return "fulfilled" === thenable || "rejected" === thenable;
|
|
}
|
|
function trackUsedThenable(thenableState2, thenable, index) {
|
|
null !== ReactSharedInternals.actQueue && (ReactSharedInternals.didUsePromise = true);
|
|
var trackedThenables = thenableState2.thenables;
|
|
index = trackedThenables[index];
|
|
void 0 === index ? trackedThenables.push(thenable) : index !== thenable && (thenableState2.didWarnAboutUncachedPromise || (thenableState2.didWarnAboutUncachedPromise = true, console.error(
|
|
"A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework."
|
|
)), thenable.then(noop$1, noop$1), thenable = index);
|
|
if (void 0 === thenable._debugInfo) {
|
|
thenableState2 = performance.now();
|
|
trackedThenables = thenable.displayName;
|
|
var ioInfo = {
|
|
name: "string" === typeof trackedThenables ? trackedThenables : "Promise",
|
|
start: thenableState2,
|
|
end: thenableState2,
|
|
value: thenable
|
|
};
|
|
thenable._debugInfo = [{ awaited: ioInfo }];
|
|
"fulfilled" !== thenable.status && "rejected" !== thenable.status && (thenableState2 = function() {
|
|
ioInfo.end = performance.now();
|
|
}, thenable.then(thenableState2, thenableState2));
|
|
}
|
|
switch (thenable.status) {
|
|
case "fulfilled":
|
|
return thenable.value;
|
|
case "rejected":
|
|
throw thenableState2 = thenable.reason, checkIfUseWrappedInAsyncCatch(thenableState2), thenableState2;
|
|
default:
|
|
if ("string" === typeof thenable.status)
|
|
thenable.then(noop$1, noop$1);
|
|
else {
|
|
thenableState2 = workInProgressRoot;
|
|
if (null !== thenableState2 && 100 < thenableState2.shellSuspendCounter)
|
|
throw Error(
|
|
"An unknown Component is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
|
|
);
|
|
thenableState2 = thenable;
|
|
thenableState2.status = "pending";
|
|
thenableState2.then(
|
|
function(fulfilledValue) {
|
|
if ("pending" === thenable.status) {
|
|
var fulfilledThenable = thenable;
|
|
fulfilledThenable.status = "fulfilled";
|
|
fulfilledThenable.value = fulfilledValue;
|
|
}
|
|
},
|
|
function(error) {
|
|
if ("pending" === thenable.status) {
|
|
var rejectedThenable = thenable;
|
|
rejectedThenable.status = "rejected";
|
|
rejectedThenable.reason = error;
|
|
}
|
|
}
|
|
);
|
|
}
|
|
switch (thenable.status) {
|
|
case "fulfilled":
|
|
return thenable.value;
|
|
case "rejected":
|
|
throw thenableState2 = thenable.reason, checkIfUseWrappedInAsyncCatch(thenableState2), thenableState2;
|
|
}
|
|
suspendedThenable = thenable;
|
|
needsToResetSuspendedThenableDEV = true;
|
|
throw SuspenseException;
|
|
}
|
|
}
|
|
function resolveLazy(lazyType) {
|
|
try {
|
|
return callLazyInitInDEV(lazyType);
|
|
} catch (x) {
|
|
if (null !== x && "object" === typeof x && "function" === typeof x.then)
|
|
throw suspendedThenable = x, needsToResetSuspendedThenableDEV = true, SuspenseException;
|
|
throw x;
|
|
}
|
|
}
|
|
function getSuspendedThenable() {
|
|
if (null === suspendedThenable)
|
|
throw Error(
|
|
"Expected a suspended thenable. This is a bug in React. Please file an issue."
|
|
);
|
|
var thenable = suspendedThenable;
|
|
suspendedThenable = null;
|
|
needsToResetSuspendedThenableDEV = false;
|
|
return thenable;
|
|
}
|
|
function checkIfUseWrappedInAsyncCatch(rejectedReason) {
|
|
if (rejectedReason === SuspenseException || rejectedReason === SuspenseActionException)
|
|
throw Error(
|
|
"Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
|
|
);
|
|
}
|
|
function pushDebugInfo(debugInfo) {
|
|
var previousDebugInfo = currentDebugInfo;
|
|
null != debugInfo && (currentDebugInfo = null === previousDebugInfo ? debugInfo : previousDebugInfo.concat(debugInfo));
|
|
return previousDebugInfo;
|
|
}
|
|
function getCurrentDebugTask() {
|
|
var debugInfo = currentDebugInfo;
|
|
if (null != debugInfo) {
|
|
for (var i = debugInfo.length - 1; 0 <= i; i--)
|
|
if (null != debugInfo[i].name) {
|
|
var debugTask = debugInfo[i].debugTask;
|
|
if (null != debugTask) return debugTask;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function validateFragmentProps(element, fiber, returnFiber) {
|
|
for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) {
|
|
var key = keys[i];
|
|
if ("children" !== key && "key" !== key) {
|
|
null === fiber && (fiber = createFiberFromElement(element, returnFiber.mode, 0), fiber._debugInfo = currentDebugInfo, fiber.return = returnFiber);
|
|
runWithFiberInDEV(
|
|
fiber,
|
|
function(erroredKey) {
|
|
console.error(
|
|
"Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",
|
|
erroredKey
|
|
);
|
|
},
|
|
key
|
|
);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
function unwrapThenable(thenable) {
|
|
var index = thenableIndexCounter$1;
|
|
thenableIndexCounter$1 += 1;
|
|
null === thenableState$1 && (thenableState$1 = createThenableState());
|
|
return trackUsedThenable(thenableState$1, thenable, index);
|
|
}
|
|
function coerceRef(workInProgress2, element) {
|
|
element = element.props.ref;
|
|
workInProgress2.ref = void 0 !== element ? element : null;
|
|
}
|
|
function throwOnInvalidObjectTypeImpl(returnFiber, newChild) {
|
|
if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)
|
|
throw Error(
|
|
'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.'
|
|
);
|
|
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 throwOnInvalidObjectType(returnFiber, newChild) {
|
|
var debugTask = getCurrentDebugTask();
|
|
null !== debugTask ? debugTask.run(
|
|
throwOnInvalidObjectTypeImpl.bind(null, returnFiber, newChild)
|
|
) : throwOnInvalidObjectTypeImpl(returnFiber, newChild);
|
|
}
|
|
function warnOnFunctionTypeImpl(returnFiber, invalidChild) {
|
|
var parentName = getComponentNameFromFiber(returnFiber) || "Component";
|
|
ownerHasFunctionTypeWarning[parentName] || (ownerHasFunctionTypeWarning[parentName] = true, invalidChild = invalidChild.displayName || invalidChild.name || "Component", 3 === returnFiber.tag ? console.error(
|
|
"Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)",
|
|
invalidChild,
|
|
invalidChild,
|
|
invalidChild
|
|
) : console.error(
|
|
"Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}</%s>",
|
|
invalidChild,
|
|
invalidChild,
|
|
parentName,
|
|
invalidChild,
|
|
parentName
|
|
));
|
|
}
|
|
function warnOnFunctionType(returnFiber, invalidChild) {
|
|
var debugTask = getCurrentDebugTask();
|
|
null !== debugTask ? debugTask.run(
|
|
warnOnFunctionTypeImpl.bind(null, returnFiber, invalidChild)
|
|
) : warnOnFunctionTypeImpl(returnFiber, invalidChild);
|
|
}
|
|
function warnOnSymbolTypeImpl(returnFiber, invalidChild) {
|
|
var parentName = getComponentNameFromFiber(returnFiber) || "Component";
|
|
ownerHasSymbolTypeWarning[parentName] || (ownerHasSymbolTypeWarning[parentName] = true, invalidChild = String(invalidChild), 3 === returnFiber.tag ? console.error(
|
|
"Symbols are not valid as a React child.\n root.render(%s)",
|
|
invalidChild
|
|
) : console.error(
|
|
"Symbols are not valid as a React child.\n <%s>%s</%s>",
|
|
parentName,
|
|
invalidChild,
|
|
parentName
|
|
));
|
|
}
|
|
function warnOnSymbolType(returnFiber, invalidChild) {
|
|
var debugTask = getCurrentDebugTask();
|
|
null !== debugTask ? debugTask.run(
|
|
warnOnSymbolTypeImpl.bind(null, returnFiber, invalidChild)
|
|
) : warnOnSymbolTypeImpl(returnFiber, invalidChild);
|
|
}
|
|
function createChildReconciler(shouldTrackSideEffects) {
|
|
function deleteChild(returnFiber, childToDelete) {
|
|
if (shouldTrackSideEffects) {
|
|
var deletions = returnFiber.deletions;
|
|
null === deletions ? (returnFiber.deletions = [childToDelete], returnFiber.flags |= 16) : deletions.push(childToDelete);
|
|
}
|
|
}
|
|
function deleteRemainingChildren(returnFiber, currentFirstChild) {
|
|
if (!shouldTrackSideEffects) return null;
|
|
for (; null !== currentFirstChild; )
|
|
deleteChild(returnFiber, currentFirstChild), currentFirstChild = currentFirstChild.sibling;
|
|
return null;
|
|
}
|
|
function mapRemainingChildren(currentFirstChild) {
|
|
for (var existingChildren = /* @__PURE__ */ new Map(); null !== currentFirstChild; )
|
|
null !== currentFirstChild.key ? existingChildren.set(currentFirstChild.key, currentFirstChild) : existingChildren.set(currentFirstChild.index, currentFirstChild), currentFirstChild = currentFirstChild.sibling;
|
|
return existingChildren;
|
|
}
|
|
function useFiber(fiber, pendingProps) {
|
|
fiber = createWorkInProgress(fiber, pendingProps);
|
|
fiber.index = 0;
|
|
fiber.sibling = null;
|
|
return fiber;
|
|
}
|
|
function placeChild(newFiber, lastPlacedIndex, newIndex) {
|
|
newFiber.index = newIndex;
|
|
if (!shouldTrackSideEffects)
|
|
return newFiber.flags |= 1048576, lastPlacedIndex;
|
|
newIndex = newFiber.alternate;
|
|
if (null !== newIndex)
|
|
return newIndex = newIndex.index, newIndex < lastPlacedIndex ? (newFiber.flags |= 67108866, lastPlacedIndex) : newIndex;
|
|
newFiber.flags |= 67108866;
|
|
return lastPlacedIndex;
|
|
}
|
|
function placeSingleChild(newFiber) {
|
|
shouldTrackSideEffects && null === newFiber.alternate && (newFiber.flags |= 67108866);
|
|
return newFiber;
|
|
}
|
|
function updateTextNode(returnFiber, current2, textContent, lanes) {
|
|
if (null === current2 || 6 !== current2.tag)
|
|
return current2 = createFiberFromText(
|
|
textContent,
|
|
returnFiber.mode,
|
|
lanes
|
|
), current2.return = returnFiber, current2._debugOwner = returnFiber, current2._debugTask = returnFiber._debugTask, current2._debugInfo = currentDebugInfo, current2;
|
|
current2 = useFiber(current2, textContent);
|
|
current2.return = returnFiber;
|
|
current2._debugInfo = currentDebugInfo;
|
|
return current2;
|
|
}
|
|
function updateElement(returnFiber, current2, element, lanes) {
|
|
var elementType = element.type;
|
|
if (elementType === REACT_FRAGMENT_TYPE)
|
|
return current2 = updateFragment(
|
|
returnFiber,
|
|
current2,
|
|
element.props.children,
|
|
lanes,
|
|
element.key
|
|
), validateFragmentProps(element, current2, returnFiber), current2;
|
|
if (null !== current2 && (current2.elementType === elementType || isCompatibleFamilyForHotReloading(current2, element) || "object" === typeof elementType && null !== elementType && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current2.type))
|
|
return current2 = useFiber(current2, element.props), coerceRef(current2, element), current2.return = returnFiber, current2._debugOwner = element._owner, current2._debugInfo = currentDebugInfo, current2;
|
|
current2 = createFiberFromElement(element, returnFiber.mode, lanes);
|
|
coerceRef(current2, element);
|
|
current2.return = returnFiber;
|
|
current2._debugInfo = currentDebugInfo;
|
|
return current2;
|
|
}
|
|
function updatePortal(returnFiber, current2, portal, lanes) {
|
|
if (null === current2 || 4 !== current2.tag || current2.stateNode.containerInfo !== portal.containerInfo || current2.stateNode.implementation !== portal.implementation)
|
|
return current2 = createFiberFromPortal(portal, returnFiber.mode, lanes), current2.return = returnFiber, current2._debugInfo = currentDebugInfo, current2;
|
|
current2 = useFiber(current2, portal.children || []);
|
|
current2.return = returnFiber;
|
|
current2._debugInfo = currentDebugInfo;
|
|
return current2;
|
|
}
|
|
function updateFragment(returnFiber, current2, fragment, lanes, key) {
|
|
if (null === current2 || 7 !== current2.tag)
|
|
return current2 = createFiberFromFragment(
|
|
fragment,
|
|
returnFiber.mode,
|
|
lanes,
|
|
key
|
|
), current2.return = returnFiber, current2._debugOwner = returnFiber, current2._debugTask = returnFiber._debugTask, current2._debugInfo = currentDebugInfo, current2;
|
|
current2 = useFiber(current2, fragment);
|
|
current2.return = returnFiber;
|
|
current2._debugInfo = currentDebugInfo;
|
|
return current2;
|
|
}
|
|
function createChild(returnFiber, newChild, lanes) {
|
|
if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
|
|
return newChild = createFiberFromText(
|
|
"" + newChild,
|
|
returnFiber.mode,
|
|
lanes
|
|
), newChild.return = returnFiber, newChild._debugOwner = returnFiber, newChild._debugTask = returnFiber._debugTask, newChild._debugInfo = currentDebugInfo, newChild;
|
|
if ("object" === typeof newChild && null !== newChild) {
|
|
switch (newChild.$$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
return lanes = createFiberFromElement(
|
|
newChild,
|
|
returnFiber.mode,
|
|
lanes
|
|
), coerceRef(lanes, newChild), lanes.return = returnFiber, returnFiber = pushDebugInfo(newChild._debugInfo), lanes._debugInfo = currentDebugInfo, currentDebugInfo = returnFiber, lanes;
|
|
case REACT_PORTAL_TYPE:
|
|
return newChild = createFiberFromPortal(
|
|
newChild,
|
|
returnFiber.mode,
|
|
lanes
|
|
), newChild.return = returnFiber, newChild._debugInfo = currentDebugInfo, newChild;
|
|
case REACT_LAZY_TYPE:
|
|
var _prevDebugInfo = pushDebugInfo(newChild._debugInfo);
|
|
newChild = resolveLazy(newChild);
|
|
returnFiber = createChild(returnFiber, newChild, lanes);
|
|
currentDebugInfo = _prevDebugInfo;
|
|
return returnFiber;
|
|
}
|
|
if (isArrayImpl(newChild) || getIteratorFn(newChild))
|
|
return lanes = createFiberFromFragment(
|
|
newChild,
|
|
returnFiber.mode,
|
|
lanes,
|
|
null
|
|
), lanes.return = returnFiber, lanes._debugOwner = returnFiber, lanes._debugTask = returnFiber._debugTask, returnFiber = pushDebugInfo(newChild._debugInfo), lanes._debugInfo = currentDebugInfo, currentDebugInfo = returnFiber, lanes;
|
|
if ("function" === typeof newChild.then)
|
|
return _prevDebugInfo = pushDebugInfo(newChild._debugInfo), returnFiber = createChild(
|
|
returnFiber,
|
|
unwrapThenable(newChild),
|
|
lanes
|
|
), currentDebugInfo = _prevDebugInfo, returnFiber;
|
|
if (newChild.$$typeof === REACT_CONTEXT_TYPE)
|
|
return createChild(
|
|
returnFiber,
|
|
readContextDuringReconciliation(returnFiber, newChild),
|
|
lanes
|
|
);
|
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
}
|
|
"function" === typeof newChild && warnOnFunctionType(returnFiber, newChild);
|
|
"symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
|
|
return null;
|
|
}
|
|
function updateSlot(returnFiber, oldFiber, newChild, lanes) {
|
|
var key = null !== oldFiber ? oldFiber.key : null;
|
|
if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
|
|
return null !== key ? null : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
|
|
if ("object" === typeof newChild && null !== newChild) {
|
|
switch (newChild.$$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
return newChild.key === key ? (key = pushDebugInfo(newChild._debugInfo), returnFiber = updateElement(
|
|
returnFiber,
|
|
oldFiber,
|
|
newChild,
|
|
lanes
|
|
), currentDebugInfo = key, returnFiber) : null;
|
|
case REACT_PORTAL_TYPE:
|
|
return newChild.key === key ? updatePortal(returnFiber, oldFiber, newChild, lanes) : null;
|
|
case REACT_LAZY_TYPE:
|
|
return key = pushDebugInfo(newChild._debugInfo), newChild = resolveLazy(newChild), returnFiber = updateSlot(
|
|
returnFiber,
|
|
oldFiber,
|
|
newChild,
|
|
lanes
|
|
), currentDebugInfo = key, returnFiber;
|
|
}
|
|
if (isArrayImpl(newChild) || getIteratorFn(newChild)) {
|
|
if (null !== key) return null;
|
|
key = pushDebugInfo(newChild._debugInfo);
|
|
returnFiber = updateFragment(
|
|
returnFiber,
|
|
oldFiber,
|
|
newChild,
|
|
lanes,
|
|
null
|
|
);
|
|
currentDebugInfo = key;
|
|
return returnFiber;
|
|
}
|
|
if ("function" === typeof newChild.then)
|
|
return key = pushDebugInfo(newChild._debugInfo), returnFiber = updateSlot(
|
|
returnFiber,
|
|
oldFiber,
|
|
unwrapThenable(newChild),
|
|
lanes
|
|
), currentDebugInfo = key, returnFiber;
|
|
if (newChild.$$typeof === REACT_CONTEXT_TYPE)
|
|
return updateSlot(
|
|
returnFiber,
|
|
oldFiber,
|
|
readContextDuringReconciliation(returnFiber, newChild),
|
|
lanes
|
|
);
|
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
}
|
|
"function" === typeof newChild && warnOnFunctionType(returnFiber, newChild);
|
|
"symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
|
|
return null;
|
|
}
|
|
function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {
|
|
if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
|
|
return existingChildren = existingChildren.get(newIdx) || null, updateTextNode(returnFiber, existingChildren, "" + newChild, lanes);
|
|
if ("object" === typeof newChild && null !== newChild) {
|
|
switch (newChild.$$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
return newIdx = existingChildren.get(
|
|
null === newChild.key ? newIdx : newChild.key
|
|
) || null, existingChildren = pushDebugInfo(newChild._debugInfo), returnFiber = updateElement(
|
|
returnFiber,
|
|
newIdx,
|
|
newChild,
|
|
lanes
|
|
), currentDebugInfo = existingChildren, returnFiber;
|
|
case REACT_PORTAL_TYPE:
|
|
return existingChildren = existingChildren.get(
|
|
null === newChild.key ? newIdx : newChild.key
|
|
) || null, updatePortal(returnFiber, existingChildren, newChild, lanes);
|
|
case REACT_LAZY_TYPE:
|
|
var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo);
|
|
newChild = resolveLazy(newChild);
|
|
returnFiber = updateFromMap(
|
|
existingChildren,
|
|
returnFiber,
|
|
newIdx,
|
|
newChild,
|
|
lanes
|
|
);
|
|
currentDebugInfo = _prevDebugInfo7;
|
|
return returnFiber;
|
|
}
|
|
if (isArrayImpl(newChild) || getIteratorFn(newChild))
|
|
return newIdx = existingChildren.get(newIdx) || null, existingChildren = pushDebugInfo(newChild._debugInfo), returnFiber = updateFragment(
|
|
returnFiber,
|
|
newIdx,
|
|
newChild,
|
|
lanes,
|
|
null
|
|
), currentDebugInfo = existingChildren, returnFiber;
|
|
if ("function" === typeof newChild.then)
|
|
return _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo), returnFiber = updateFromMap(
|
|
existingChildren,
|
|
returnFiber,
|
|
newIdx,
|
|
unwrapThenable(newChild),
|
|
lanes
|
|
), currentDebugInfo = _prevDebugInfo7, returnFiber;
|
|
if (newChild.$$typeof === REACT_CONTEXT_TYPE)
|
|
return updateFromMap(
|
|
existingChildren,
|
|
returnFiber,
|
|
newIdx,
|
|
readContextDuringReconciliation(returnFiber, newChild),
|
|
lanes
|
|
);
|
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
}
|
|
"function" === typeof newChild && warnOnFunctionType(returnFiber, newChild);
|
|
"symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
|
|
return null;
|
|
}
|
|
function warnOnInvalidKey(returnFiber, workInProgress2, child, knownKeys) {
|
|
if ("object" !== typeof child || null === child) return knownKeys;
|
|
switch (child.$$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
case REACT_PORTAL_TYPE:
|
|
warnForMissingKey(returnFiber, workInProgress2, child);
|
|
var key = child.key;
|
|
if ("string" !== typeof key) break;
|
|
if (null === knownKeys) {
|
|
knownKeys = /* @__PURE__ */ new Set();
|
|
knownKeys.add(key);
|
|
break;
|
|
}
|
|
if (!knownKeys.has(key)) {
|
|
knownKeys.add(key);
|
|
break;
|
|
}
|
|
runWithFiberInDEV(workInProgress2, function() {
|
|
console.error(
|
|
"Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.",
|
|
key
|
|
);
|
|
});
|
|
break;
|
|
case REACT_LAZY_TYPE:
|
|
child = resolveLazy(child), warnOnInvalidKey(returnFiber, workInProgress2, child, knownKeys);
|
|
}
|
|
return knownKeys;
|
|
}
|
|
function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
|
|
for (var knownKeys = null, resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, newIdx = currentFirstChild = 0, nextOldFiber = null; null !== oldFiber && newIdx < newChildren.length; newIdx++) {
|
|
oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling;
|
|
var newFiber = updateSlot(
|
|
returnFiber,
|
|
oldFiber,
|
|
newChildren[newIdx],
|
|
lanes
|
|
);
|
|
if (null === newFiber) {
|
|
null === oldFiber && (oldFiber = nextOldFiber);
|
|
break;
|
|
}
|
|
knownKeys = warnOnInvalidKey(
|
|
returnFiber,
|
|
newFiber,
|
|
newChildren[newIdx],
|
|
knownKeys
|
|
);
|
|
shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber);
|
|
currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
|
|
null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber;
|
|
previousNewFiber = newFiber;
|
|
oldFiber = nextOldFiber;
|
|
}
|
|
if (newIdx === newChildren.length)
|
|
return deleteRemainingChildren(returnFiber, oldFiber), isHydrating && pushTreeFork(returnFiber, newIdx), resultingFirstChild;
|
|
if (null === oldFiber) {
|
|
for (; newIdx < newChildren.length; newIdx++)
|
|
oldFiber = createChild(returnFiber, newChildren[newIdx], lanes), null !== oldFiber && (knownKeys = warnOnInvalidKey(
|
|
returnFiber,
|
|
oldFiber,
|
|
newChildren[newIdx],
|
|
knownKeys
|
|
), currentFirstChild = placeChild(
|
|
oldFiber,
|
|
currentFirstChild,
|
|
newIdx
|
|
), null === previousNewFiber ? resultingFirstChild = oldFiber : previousNewFiber.sibling = oldFiber, previousNewFiber = oldFiber);
|
|
isHydrating && pushTreeFork(returnFiber, newIdx);
|
|
return resultingFirstChild;
|
|
}
|
|
for (oldFiber = mapRemainingChildren(oldFiber); newIdx < newChildren.length; newIdx++)
|
|
nextOldFiber = updateFromMap(
|
|
oldFiber,
|
|
returnFiber,
|
|
newIdx,
|
|
newChildren[newIdx],
|
|
lanes
|
|
), null !== nextOldFiber && (knownKeys = warnOnInvalidKey(
|
|
returnFiber,
|
|
nextOldFiber,
|
|
newChildren[newIdx],
|
|
knownKeys
|
|
), shouldTrackSideEffects && null !== nextOldFiber.alternate && oldFiber.delete(
|
|
null === nextOldFiber.key ? newIdx : nextOldFiber.key
|
|
), currentFirstChild = placeChild(
|
|
nextOldFiber,
|
|
currentFirstChild,
|
|
newIdx
|
|
), null === previousNewFiber ? resultingFirstChild = nextOldFiber : previousNewFiber.sibling = nextOldFiber, previousNewFiber = nextOldFiber);
|
|
shouldTrackSideEffects && oldFiber.forEach(function(child) {
|
|
return deleteChild(returnFiber, child);
|
|
});
|
|
isHydrating && pushTreeFork(returnFiber, newIdx);
|
|
return resultingFirstChild;
|
|
}
|
|
function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildren, lanes) {
|
|
if (null == newChildren)
|
|
throw Error("An iterable object provided no iterator.");
|
|
for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, newIdx = currentFirstChild = 0, nextOldFiber = null, knownKeys = null, step = newChildren.next(); null !== oldFiber && !step.done; newIdx++, step = newChildren.next()) {
|
|
oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling;
|
|
var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
|
|
if (null === newFiber) {
|
|
null === oldFiber && (oldFiber = nextOldFiber);
|
|
break;
|
|
}
|
|
knownKeys = warnOnInvalidKey(
|
|
returnFiber,
|
|
newFiber,
|
|
step.value,
|
|
knownKeys
|
|
);
|
|
shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber);
|
|
currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
|
|
null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber;
|
|
previousNewFiber = newFiber;
|
|
oldFiber = nextOldFiber;
|
|
}
|
|
if (step.done)
|
|
return deleteRemainingChildren(returnFiber, oldFiber), isHydrating && pushTreeFork(returnFiber, newIdx), resultingFirstChild;
|
|
if (null === oldFiber) {
|
|
for (; !step.done; newIdx++, step = newChildren.next())
|
|
oldFiber = createChild(returnFiber, step.value, lanes), null !== oldFiber && (knownKeys = warnOnInvalidKey(
|
|
returnFiber,
|
|
oldFiber,
|
|
step.value,
|
|
knownKeys
|
|
), currentFirstChild = placeChild(
|
|
oldFiber,
|
|
currentFirstChild,
|
|
newIdx
|
|
), null === previousNewFiber ? resultingFirstChild = oldFiber : previousNewFiber.sibling = oldFiber, previousNewFiber = oldFiber);
|
|
isHydrating && pushTreeFork(returnFiber, newIdx);
|
|
return resultingFirstChild;
|
|
}
|
|
for (oldFiber = mapRemainingChildren(oldFiber); !step.done; newIdx++, step = newChildren.next())
|
|
nextOldFiber = updateFromMap(
|
|
oldFiber,
|
|
returnFiber,
|
|
newIdx,
|
|
step.value,
|
|
lanes
|
|
), null !== nextOldFiber && (knownKeys = warnOnInvalidKey(
|
|
returnFiber,
|
|
nextOldFiber,
|
|
step.value,
|
|
knownKeys
|
|
), shouldTrackSideEffects && null !== nextOldFiber.alternate && oldFiber.delete(
|
|
null === nextOldFiber.key ? newIdx : nextOldFiber.key
|
|
), currentFirstChild = placeChild(
|
|
nextOldFiber,
|
|
currentFirstChild,
|
|
newIdx
|
|
), null === previousNewFiber ? resultingFirstChild = nextOldFiber : previousNewFiber.sibling = nextOldFiber, previousNewFiber = nextOldFiber);
|
|
shouldTrackSideEffects && oldFiber.forEach(function(child) {
|
|
return deleteChild(returnFiber, child);
|
|
});
|
|
isHydrating && pushTreeFork(returnFiber, newIdx);
|
|
return resultingFirstChild;
|
|
}
|
|
function reconcileChildFibersImpl(returnFiber, currentFirstChild, newChild, lanes) {
|
|
"object" === typeof newChild && null !== newChild && newChild.type === REACT_FRAGMENT_TYPE && null === newChild.key && (validateFragmentProps(newChild, null, returnFiber), newChild = newChild.props.children);
|
|
if ("object" === typeof newChild && null !== newChild) {
|
|
switch (newChild.$$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
var prevDebugInfo = pushDebugInfo(newChild._debugInfo);
|
|
a: {
|
|
for (var key = newChild.key; null !== currentFirstChild; ) {
|
|
if (currentFirstChild.key === key) {
|
|
key = newChild.type;
|
|
if (key === REACT_FRAGMENT_TYPE) {
|
|
if (7 === currentFirstChild.tag) {
|
|
deleteRemainingChildren(
|
|
returnFiber,
|
|
currentFirstChild.sibling
|
|
);
|
|
lanes = useFiber(
|
|
currentFirstChild,
|
|
newChild.props.children
|
|
);
|
|
lanes.return = returnFiber;
|
|
lanes._debugOwner = newChild._owner;
|
|
lanes._debugInfo = currentDebugInfo;
|
|
validateFragmentProps(newChild, lanes, returnFiber);
|
|
returnFiber = lanes;
|
|
break a;
|
|
}
|
|
} else if (currentFirstChild.elementType === key || isCompatibleFamilyForHotReloading(
|
|
currentFirstChild,
|
|
newChild
|
|
) || "object" === typeof key && null !== key && key.$$typeof === REACT_LAZY_TYPE && resolveLazy(key) === currentFirstChild.type) {
|
|
deleteRemainingChildren(
|
|
returnFiber,
|
|
currentFirstChild.sibling
|
|
);
|
|
lanes = useFiber(currentFirstChild, newChild.props);
|
|
coerceRef(lanes, newChild);
|
|
lanes.return = returnFiber;
|
|
lanes._debugOwner = newChild._owner;
|
|
lanes._debugInfo = currentDebugInfo;
|
|
returnFiber = lanes;
|
|
break a;
|
|
}
|
|
deleteRemainingChildren(returnFiber, currentFirstChild);
|
|
break;
|
|
} else deleteChild(returnFiber, currentFirstChild);
|
|
currentFirstChild = currentFirstChild.sibling;
|
|
}
|
|
newChild.type === REACT_FRAGMENT_TYPE ? (lanes = createFiberFromFragment(
|
|
newChild.props.children,
|
|
returnFiber.mode,
|
|
lanes,
|
|
newChild.key
|
|
), lanes.return = returnFiber, lanes._debugOwner = returnFiber, lanes._debugTask = returnFiber._debugTask, lanes._debugInfo = currentDebugInfo, validateFragmentProps(newChild, lanes, returnFiber), returnFiber = lanes) : (lanes = createFiberFromElement(
|
|
newChild,
|
|
returnFiber.mode,
|
|
lanes
|
|
), coerceRef(lanes, newChild), lanes.return = returnFiber, lanes._debugInfo = currentDebugInfo, returnFiber = lanes);
|
|
}
|
|
returnFiber = placeSingleChild(returnFiber);
|
|
currentDebugInfo = prevDebugInfo;
|
|
return returnFiber;
|
|
case REACT_PORTAL_TYPE:
|
|
a: {
|
|
prevDebugInfo = newChild;
|
|
for (newChild = prevDebugInfo.key; null !== currentFirstChild; ) {
|
|
if (currentFirstChild.key === newChild)
|
|
if (4 === currentFirstChild.tag && currentFirstChild.stateNode.containerInfo === prevDebugInfo.containerInfo && currentFirstChild.stateNode.implementation === prevDebugInfo.implementation) {
|
|
deleteRemainingChildren(
|
|
returnFiber,
|
|
currentFirstChild.sibling
|
|
);
|
|
lanes = useFiber(
|
|
currentFirstChild,
|
|
prevDebugInfo.children || []
|
|
);
|
|
lanes.return = returnFiber;
|
|
returnFiber = lanes;
|
|
break a;
|
|
} else {
|
|
deleteRemainingChildren(returnFiber, currentFirstChild);
|
|
break;
|
|
}
|
|
else deleteChild(returnFiber, currentFirstChild);
|
|
currentFirstChild = currentFirstChild.sibling;
|
|
}
|
|
lanes = createFiberFromPortal(
|
|
prevDebugInfo,
|
|
returnFiber.mode,
|
|
lanes
|
|
);
|
|
lanes.return = returnFiber;
|
|
returnFiber = lanes;
|
|
}
|
|
return placeSingleChild(returnFiber);
|
|
case REACT_LAZY_TYPE:
|
|
return prevDebugInfo = pushDebugInfo(newChild._debugInfo), newChild = resolveLazy(newChild), returnFiber = reconcileChildFibersImpl(
|
|
returnFiber,
|
|
currentFirstChild,
|
|
newChild,
|
|
lanes
|
|
), currentDebugInfo = prevDebugInfo, returnFiber;
|
|
}
|
|
if (isArrayImpl(newChild))
|
|
return prevDebugInfo = pushDebugInfo(newChild._debugInfo), returnFiber = reconcileChildrenArray(
|
|
returnFiber,
|
|
currentFirstChild,
|
|
newChild,
|
|
lanes
|
|
), currentDebugInfo = prevDebugInfo, returnFiber;
|
|
if (getIteratorFn(newChild)) {
|
|
prevDebugInfo = pushDebugInfo(newChild._debugInfo);
|
|
key = getIteratorFn(newChild);
|
|
if ("function" !== typeof key)
|
|
throw Error(
|
|
"An object is not an iterable. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
var newChildren = key.call(newChild);
|
|
if (newChildren === newChild) {
|
|
if (0 !== returnFiber.tag || "[object GeneratorFunction]" !== Object.prototype.toString.call(returnFiber.type) || "[object Generator]" !== Object.prototype.toString.call(newChildren))
|
|
didWarnAboutGenerators || console.error(
|
|
"Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items."
|
|
), didWarnAboutGenerators = true;
|
|
} else
|
|
newChild.entries !== key || didWarnAboutMaps || (console.error(
|
|
"Using Maps as children is not supported. Use an array of keyed ReactElements instead."
|
|
), didWarnAboutMaps = true);
|
|
returnFiber = reconcileChildrenIterator(
|
|
returnFiber,
|
|
currentFirstChild,
|
|
newChildren,
|
|
lanes
|
|
);
|
|
currentDebugInfo = prevDebugInfo;
|
|
return returnFiber;
|
|
}
|
|
if ("function" === typeof newChild.then)
|
|
return prevDebugInfo = pushDebugInfo(newChild._debugInfo), returnFiber = reconcileChildFibersImpl(
|
|
returnFiber,
|
|
currentFirstChild,
|
|
unwrapThenable(newChild),
|
|
lanes
|
|
), currentDebugInfo = prevDebugInfo, returnFiber;
|
|
if (newChild.$$typeof === REACT_CONTEXT_TYPE)
|
|
return reconcileChildFibersImpl(
|
|
returnFiber,
|
|
currentFirstChild,
|
|
readContextDuringReconciliation(returnFiber, newChild),
|
|
lanes
|
|
);
|
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
}
|
|
if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
|
|
return prevDebugInfo = "" + newChild, null !== currentFirstChild && 6 === currentFirstChild.tag ? (deleteRemainingChildren(
|
|
returnFiber,
|
|
currentFirstChild.sibling
|
|
), lanes = useFiber(currentFirstChild, prevDebugInfo), lanes.return = returnFiber, returnFiber = lanes) : (deleteRemainingChildren(returnFiber, currentFirstChild), lanes = createFiberFromText(
|
|
prevDebugInfo,
|
|
returnFiber.mode,
|
|
lanes
|
|
), lanes.return = returnFiber, lanes._debugOwner = returnFiber, lanes._debugTask = returnFiber._debugTask, lanes._debugInfo = currentDebugInfo, returnFiber = lanes), placeSingleChild(returnFiber);
|
|
"function" === typeof newChild && warnOnFunctionType(returnFiber, newChild);
|
|
"symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
|
|
return deleteRemainingChildren(returnFiber, currentFirstChild);
|
|
}
|
|
return function(returnFiber, currentFirstChild, newChild, lanes) {
|
|
var prevDebugInfo = currentDebugInfo;
|
|
currentDebugInfo = null;
|
|
try {
|
|
thenableIndexCounter$1 = 0;
|
|
var firstChildFiber = reconcileChildFibersImpl(
|
|
returnFiber,
|
|
currentFirstChild,
|
|
newChild,
|
|
lanes
|
|
);
|
|
thenableState$1 = null;
|
|
return firstChildFiber;
|
|
} catch (x) {
|
|
if (x === SuspenseException || x === SuspenseActionException) throw x;
|
|
var fiber = createFiber(29, x, null, returnFiber.mode);
|
|
fiber.lanes = lanes;
|
|
fiber.return = returnFiber;
|
|
var debugInfo = fiber._debugInfo = currentDebugInfo;
|
|
fiber._debugOwner = returnFiber._debugOwner;
|
|
fiber._debugTask = returnFiber._debugTask;
|
|
if (null != debugInfo) {
|
|
for (var i = debugInfo.length - 1; 0 <= i; i--)
|
|
if ("string" === typeof debugInfo[i].stack) {
|
|
fiber._debugOwner = debugInfo[i];
|
|
fiber._debugTask = debugInfo[i].debugTask;
|
|
break;
|
|
}
|
|
}
|
|
return fiber;
|
|
} finally {
|
|
currentDebugInfo = prevDebugInfo;
|
|
}
|
|
};
|
|
}
|
|
function validateSuspenseListNestedChild(childSlot, index) {
|
|
var isAnArray = isArrayImpl(childSlot);
|
|
childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot);
|
|
return isAnArray || childSlot ? (isAnArray = isAnArray ? "array" : "iterable", console.error(
|
|
"A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",
|
|
isAnArray,
|
|
index,
|
|
isAnArray
|
|
), false) : true;
|
|
}
|
|
function initializeUpdateQueue(fiber) {
|
|
fiber.updateQueue = {
|
|
baseState: fiber.memoizedState,
|
|
firstBaseUpdate: null,
|
|
lastBaseUpdate: null,
|
|
shared: { pending: null, lanes: 0, hiddenCallbacks: null },
|
|
callbacks: null
|
|
};
|
|
}
|
|
function cloneUpdateQueue(current2, workInProgress2) {
|
|
current2 = current2.updateQueue;
|
|
workInProgress2.updateQueue === current2 && (workInProgress2.updateQueue = {
|
|
baseState: current2.baseState,
|
|
firstBaseUpdate: current2.firstBaseUpdate,
|
|
lastBaseUpdate: current2.lastBaseUpdate,
|
|
shared: current2.shared,
|
|
callbacks: null
|
|
});
|
|
}
|
|
function createUpdate(lane) {
|
|
return {
|
|
lane,
|
|
tag: UpdateState,
|
|
payload: null,
|
|
callback: null,
|
|
next: null
|
|
};
|
|
}
|
|
function enqueueUpdate(fiber, update2, lane) {
|
|
var updateQueue = fiber.updateQueue;
|
|
if (null === updateQueue) return null;
|
|
updateQueue = updateQueue.shared;
|
|
if (currentlyProcessingQueue === updateQueue && !didWarnUpdateInsideUpdate) {
|
|
var componentName2 = getComponentNameFromFiber(fiber);
|
|
console.error(
|
|
"An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s",
|
|
componentName2
|
|
);
|
|
didWarnUpdateInsideUpdate = true;
|
|
}
|
|
if ((executionContext & RenderContext) !== NoContext)
|
|
return componentName2 = updateQueue.pending, null === componentName2 ? update2.next = update2 : (update2.next = componentName2.next, componentName2.next = update2), updateQueue.pending = update2, update2 = getRootForUpdatedFiber(fiber), markUpdateLaneFromFiberToRoot(fiber, null, lane), update2;
|
|
enqueueUpdate$1(fiber, updateQueue, update2, lane);
|
|
return getRootForUpdatedFiber(fiber);
|
|
}
|
|
function entangleTransitions(root2, fiber, lane) {
|
|
fiber = fiber.updateQueue;
|
|
if (null !== fiber && (fiber = fiber.shared, 0 !== (lane & 4194048))) {
|
|
var queueLanes = fiber.lanes;
|
|
queueLanes &= root2.pendingLanes;
|
|
lane |= queueLanes;
|
|
fiber.lanes = lane;
|
|
markRootEntangled(root2, lane);
|
|
}
|
|
}
|
|
function enqueueCapturedUpdate(workInProgress2, capturedUpdate) {
|
|
var queue = workInProgress2.updateQueue, current2 = workInProgress2.alternate;
|
|
if (null !== current2 && (current2 = current2.updateQueue, queue === current2)) {
|
|
var newFirst = null, newLast = null;
|
|
queue = queue.firstBaseUpdate;
|
|
if (null !== queue) {
|
|
do {
|
|
var clone = {
|
|
lane: queue.lane,
|
|
tag: queue.tag,
|
|
payload: queue.payload,
|
|
callback: null,
|
|
next: null
|
|
};
|
|
null === newLast ? newFirst = newLast = clone : newLast = newLast.next = clone;
|
|
queue = queue.next;
|
|
} while (null !== queue);
|
|
null === newLast ? newFirst = newLast = capturedUpdate : newLast = newLast.next = capturedUpdate;
|
|
} else newFirst = newLast = capturedUpdate;
|
|
queue = {
|
|
baseState: current2.baseState,
|
|
firstBaseUpdate: newFirst,
|
|
lastBaseUpdate: newLast,
|
|
shared: current2.shared,
|
|
callbacks: current2.callbacks
|
|
};
|
|
workInProgress2.updateQueue = queue;
|
|
return;
|
|
}
|
|
workInProgress2 = queue.lastBaseUpdate;
|
|
null === workInProgress2 ? queue.firstBaseUpdate = capturedUpdate : workInProgress2.next = capturedUpdate;
|
|
queue.lastBaseUpdate = capturedUpdate;
|
|
}
|
|
function suspendIfUpdateReadFromEntangledAsyncAction() {
|
|
if (didReadFromEntangledAsyncAction) {
|
|
var entangledActionThenable = currentEntangledActionThenable;
|
|
if (null !== entangledActionThenable) throw entangledActionThenable;
|
|
}
|
|
}
|
|
function processUpdateQueue(workInProgress2, props, instance$jscomp$0, renderLanes2) {
|
|
didReadFromEntangledAsyncAction = false;
|
|
var queue = workInProgress2.updateQueue;
|
|
hasForceUpdate = false;
|
|
currentlyProcessingQueue = queue.shared;
|
|
var firstBaseUpdate = queue.firstBaseUpdate, lastBaseUpdate = queue.lastBaseUpdate, pendingQueue = queue.shared.pending;
|
|
if (null !== pendingQueue) {
|
|
queue.shared.pending = null;
|
|
var lastPendingUpdate = pendingQueue, firstPendingUpdate = lastPendingUpdate.next;
|
|
lastPendingUpdate.next = null;
|
|
null === lastBaseUpdate ? firstBaseUpdate = firstPendingUpdate : lastBaseUpdate.next = firstPendingUpdate;
|
|
lastBaseUpdate = lastPendingUpdate;
|
|
var current2 = workInProgress2.alternate;
|
|
null !== current2 && (current2 = current2.updateQueue, pendingQueue = current2.lastBaseUpdate, pendingQueue !== lastBaseUpdate && (null === pendingQueue ? current2.firstBaseUpdate = firstPendingUpdate : pendingQueue.next = firstPendingUpdate, current2.lastBaseUpdate = lastPendingUpdate));
|
|
}
|
|
if (null !== firstBaseUpdate) {
|
|
var newState = queue.baseState;
|
|
lastBaseUpdate = 0;
|
|
current2 = firstPendingUpdate = lastPendingUpdate = null;
|
|
pendingQueue = firstBaseUpdate;
|
|
do {
|
|
var updateLane = pendingQueue.lane & -536870913, isHiddenUpdate = updateLane !== pendingQueue.lane;
|
|
if (isHiddenUpdate ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes2 & updateLane) === updateLane) {
|
|
0 !== updateLane && updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction = true);
|
|
null !== current2 && (current2 = current2.next = {
|
|
lane: 0,
|
|
tag: pendingQueue.tag,
|
|
payload: pendingQueue.payload,
|
|
callback: null,
|
|
next: null
|
|
});
|
|
a: {
|
|
updateLane = workInProgress2;
|
|
var partialState = pendingQueue;
|
|
var nextProps = props, instance = instance$jscomp$0;
|
|
switch (partialState.tag) {
|
|
case ReplaceState:
|
|
partialState = partialState.payload;
|
|
if ("function" === typeof partialState) {
|
|
isDisallowedContextReadInDEV = true;
|
|
var nextState = partialState.call(
|
|
instance,
|
|
newState,
|
|
nextProps
|
|
);
|
|
if (updateLane.mode & StrictLegacyMode) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
partialState.call(instance, newState, nextProps);
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
isDisallowedContextReadInDEV = false;
|
|
newState = nextState;
|
|
break a;
|
|
}
|
|
newState = partialState;
|
|
break a;
|
|
case CaptureUpdate:
|
|
updateLane.flags = updateLane.flags & -65537 | 128;
|
|
case UpdateState:
|
|
nextState = partialState.payload;
|
|
if ("function" === typeof nextState) {
|
|
isDisallowedContextReadInDEV = true;
|
|
partialState = nextState.call(
|
|
instance,
|
|
newState,
|
|
nextProps
|
|
);
|
|
if (updateLane.mode & StrictLegacyMode) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
nextState.call(instance, newState, nextProps);
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
isDisallowedContextReadInDEV = false;
|
|
} else partialState = nextState;
|
|
if (null === partialState || void 0 === partialState) break a;
|
|
newState = assign2({}, newState, partialState);
|
|
break a;
|
|
case ForceUpdate:
|
|
hasForceUpdate = true;
|
|
}
|
|
}
|
|
updateLane = pendingQueue.callback;
|
|
null !== updateLane && (workInProgress2.flags |= 64, isHiddenUpdate && (workInProgress2.flags |= 8192), isHiddenUpdate = queue.callbacks, null === isHiddenUpdate ? queue.callbacks = [updateLane] : isHiddenUpdate.push(updateLane));
|
|
} else
|
|
isHiddenUpdate = {
|
|
lane: updateLane,
|
|
tag: pendingQueue.tag,
|
|
payload: pendingQueue.payload,
|
|
callback: pendingQueue.callback,
|
|
next: null
|
|
}, null === current2 ? (firstPendingUpdate = current2 = isHiddenUpdate, lastPendingUpdate = newState) : current2 = current2.next = isHiddenUpdate, lastBaseUpdate |= updateLane;
|
|
pendingQueue = pendingQueue.next;
|
|
if (null === pendingQueue)
|
|
if (pendingQueue = queue.shared.pending, null === pendingQueue)
|
|
break;
|
|
else
|
|
isHiddenUpdate = pendingQueue, pendingQueue = isHiddenUpdate.next, isHiddenUpdate.next = null, queue.lastBaseUpdate = isHiddenUpdate, queue.shared.pending = null;
|
|
} while (1);
|
|
null === current2 && (lastPendingUpdate = newState);
|
|
queue.baseState = lastPendingUpdate;
|
|
queue.firstBaseUpdate = firstPendingUpdate;
|
|
queue.lastBaseUpdate = current2;
|
|
null === firstBaseUpdate && (queue.shared.lanes = 0);
|
|
workInProgressRootSkippedLanes |= lastBaseUpdate;
|
|
workInProgress2.lanes = lastBaseUpdate;
|
|
workInProgress2.memoizedState = newState;
|
|
}
|
|
currentlyProcessingQueue = null;
|
|
}
|
|
function callCallback(callback, context) {
|
|
if ("function" !== typeof callback)
|
|
throw Error(
|
|
"Invalid argument passed as callback. Expected a function. Instead received: " + callback
|
|
);
|
|
callback.call(context);
|
|
}
|
|
function commitHiddenCallbacks(updateQueue, context) {
|
|
var hiddenCallbacks = updateQueue.shared.hiddenCallbacks;
|
|
if (null !== hiddenCallbacks)
|
|
for (updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; updateQueue < hiddenCallbacks.length; updateQueue++)
|
|
callCallback(hiddenCallbacks[updateQueue], context);
|
|
}
|
|
function commitCallbacks(updateQueue, context) {
|
|
var callbacks = updateQueue.callbacks;
|
|
if (null !== callbacks)
|
|
for (updateQueue.callbacks = null, updateQueue = 0; updateQueue < callbacks.length; updateQueue++)
|
|
callCallback(callbacks[updateQueue], context);
|
|
}
|
|
function pushHiddenContext(fiber, context) {
|
|
var prevEntangledRenderLanes = entangledRenderLanes;
|
|
push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber);
|
|
push(currentTreeHiddenStackCursor, context, fiber);
|
|
entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes;
|
|
}
|
|
function reuseHiddenContextOnStack(fiber) {
|
|
push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber);
|
|
push(
|
|
currentTreeHiddenStackCursor,
|
|
currentTreeHiddenStackCursor.current,
|
|
fiber
|
|
);
|
|
}
|
|
function popHiddenContext(fiber) {
|
|
entangledRenderLanes = prevEntangledRenderLanesCursor.current;
|
|
pop(currentTreeHiddenStackCursor, fiber);
|
|
pop(prevEntangledRenderLanesCursor, fiber);
|
|
}
|
|
function pushPrimaryTreeSuspenseHandler(handler) {
|
|
var current2 = handler.alternate;
|
|
push(
|
|
suspenseStackCursor,
|
|
suspenseStackCursor.current & SubtreeSuspenseContextMask,
|
|
handler
|
|
);
|
|
push(suspenseHandlerStackCursor, handler, handler);
|
|
null === shellBoundary && (null === current2 || null !== currentTreeHiddenStackCursor.current ? shellBoundary = handler : null !== current2.memoizedState && (shellBoundary = handler));
|
|
}
|
|
function pushDehydratedActivitySuspenseHandler(fiber) {
|
|
push(suspenseStackCursor, suspenseStackCursor.current, fiber);
|
|
push(suspenseHandlerStackCursor, fiber, fiber);
|
|
null === shellBoundary && (shellBoundary = fiber);
|
|
}
|
|
function pushOffscreenSuspenseHandler(fiber) {
|
|
22 === fiber.tag ? (push(suspenseStackCursor, suspenseStackCursor.current, fiber), push(suspenseHandlerStackCursor, fiber, fiber), null === shellBoundary && (shellBoundary = fiber)) : reuseSuspenseHandlerOnStack(fiber);
|
|
}
|
|
function reuseSuspenseHandlerOnStack(fiber) {
|
|
push(suspenseStackCursor, suspenseStackCursor.current, fiber);
|
|
push(
|
|
suspenseHandlerStackCursor,
|
|
suspenseHandlerStackCursor.current,
|
|
fiber
|
|
);
|
|
}
|
|
function popSuspenseHandler(fiber) {
|
|
pop(suspenseHandlerStackCursor, fiber);
|
|
shellBoundary === fiber && (shellBoundary = null);
|
|
pop(suspenseStackCursor, fiber);
|
|
}
|
|
function findFirstSuspended(row) {
|
|
for (var node2 = row; null !== node2; ) {
|
|
if (13 === node2.tag) {
|
|
var state = node2.memoizedState;
|
|
if (null !== state && (state = state.dehydrated, null === state || isSuspenseInstancePending(state) || isSuspenseInstanceFallback(state)))
|
|
return node2;
|
|
} else if (19 === node2.tag && ("forwards" === node2.memoizedProps.revealOrder || "backwards" === node2.memoizedProps.revealOrder || "unstable_legacy-backwards" === node2.memoizedProps.revealOrder || "together" === node2.memoizedProps.revealOrder)) {
|
|
if (0 !== (node2.flags & 128)) return node2;
|
|
} else if (null !== node2.child) {
|
|
node2.child.return = node2;
|
|
node2 = node2.child;
|
|
continue;
|
|
}
|
|
if (node2 === row) break;
|
|
for (; null === node2.sibling; ) {
|
|
if (null === node2.return || node2.return === row) return null;
|
|
node2 = node2.return;
|
|
}
|
|
node2.sibling.return = node2.return;
|
|
node2 = node2.sibling;
|
|
}
|
|
return null;
|
|
}
|
|
function mountHookTypesDev() {
|
|
var hookName = currentHookNameInDev;
|
|
null === hookTypesDev ? hookTypesDev = [hookName] : hookTypesDev.push(hookName);
|
|
}
|
|
function updateHookTypesDev() {
|
|
var hookName = currentHookNameInDev;
|
|
if (null !== hookTypesDev && (hookTypesUpdateIndexDev++, hookTypesDev[hookTypesUpdateIndexDev] !== hookName)) {
|
|
var componentName2 = getComponentNameFromFiber(currentlyRenderingFiber);
|
|
if (!didWarnAboutMismatchedHooksForComponent.has(componentName2) && (didWarnAboutMismatchedHooksForComponent.add(componentName2), null !== hookTypesDev)) {
|
|
for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) {
|
|
var oldHookName = hookTypesDev[i], newHookName = i === hookTypesUpdateIndexDev ? hookName : oldHookName;
|
|
for (oldHookName = i + 1 + ". " + oldHookName; 30 > oldHookName.length; )
|
|
oldHookName += " ";
|
|
oldHookName += newHookName + "\n";
|
|
table += oldHookName;
|
|
}
|
|
console.error(
|
|
"React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
|
|
componentName2,
|
|
table
|
|
);
|
|
}
|
|
}
|
|
}
|
|
function checkDepsAreArrayDev(deps) {
|
|
void 0 === deps || null === deps || isArrayImpl(deps) || console.error(
|
|
"%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",
|
|
currentHookNameInDev,
|
|
typeof deps
|
|
);
|
|
}
|
|
function warnOnUseFormStateInDev() {
|
|
var componentName2 = getComponentNameFromFiber(currentlyRenderingFiber);
|
|
didWarnAboutUseFormState.has(componentName2) || (didWarnAboutUseFormState.add(componentName2), console.error(
|
|
"ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",
|
|
componentName2
|
|
));
|
|
}
|
|
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 (ignorePreviousDependencies) return false;
|
|
if (null === prevDeps)
|
|
return console.error(
|
|
"%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",
|
|
currentHookNameInDev
|
|
), false;
|
|
nextDeps.length !== prevDeps.length && console.error(
|
|
"The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s",
|
|
currentHookNameInDev,
|
|
"[" + prevDeps.join(", ") + "]",
|
|
"[" + nextDeps.join(", ") + "]"
|
|
);
|
|
for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)
|
|
if (!objectIs(nextDeps[i], prevDeps[i])) return false;
|
|
return true;
|
|
}
|
|
function renderWithHooks(current2, workInProgress2, Component, props, secondArg, nextRenderLanes) {
|
|
renderLanes = nextRenderLanes;
|
|
currentlyRenderingFiber = workInProgress2;
|
|
hookTypesDev = null !== current2 ? current2._debugHookTypes : null;
|
|
hookTypesUpdateIndexDev = -1;
|
|
ignorePreviousDependencies = null !== current2 && current2.type !== workInProgress2.type;
|
|
if ("[object AsyncFunction]" === Object.prototype.toString.call(Component) || "[object AsyncGeneratorFunction]" === Object.prototype.toString.call(Component))
|
|
nextRenderLanes = getComponentNameFromFiber(currentlyRenderingFiber), didWarnAboutAsyncClientComponent.has(nextRenderLanes) || (didWarnAboutAsyncClientComponent.add(nextRenderLanes), console.error(
|
|
"%s is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.",
|
|
null === nextRenderLanes ? "An unknown Component" : "<" + nextRenderLanes + ">"
|
|
));
|
|
workInProgress2.memoizedState = null;
|
|
workInProgress2.updateQueue = null;
|
|
workInProgress2.lanes = 0;
|
|
ReactSharedInternals.H = null !== current2 && null !== current2.memoizedState ? HooksDispatcherOnUpdateInDEV : null !== hookTypesDev ? HooksDispatcherOnMountWithHookTypesInDEV : HooksDispatcherOnMountInDEV;
|
|
shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = (workInProgress2.mode & StrictLegacyMode) !== NoMode;
|
|
var children = callComponentInDEV(Component, props, secondArg);
|
|
shouldDoubleInvokeUserFnsInHooksDEV = false;
|
|
didScheduleRenderPhaseUpdateDuringThisPass && (children = renderWithHooksAgain(
|
|
workInProgress2,
|
|
Component,
|
|
props,
|
|
secondArg
|
|
));
|
|
if (nextRenderLanes) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
children = renderWithHooksAgain(
|
|
workInProgress2,
|
|
Component,
|
|
props,
|
|
secondArg
|
|
);
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
finishRenderingHooks(current2, workInProgress2);
|
|
return children;
|
|
}
|
|
function finishRenderingHooks(current2, workInProgress2) {
|
|
workInProgress2._debugHookTypes = hookTypesDev;
|
|
null === workInProgress2.dependencies ? null !== thenableState && (workInProgress2.dependencies = {
|
|
lanes: 0,
|
|
firstContext: null,
|
|
_debugThenableState: thenableState
|
|
}) : workInProgress2.dependencies._debugThenableState = thenableState;
|
|
ReactSharedInternals.H = ContextOnlyDispatcher;
|
|
var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next;
|
|
renderLanes = 0;
|
|
hookTypesDev = currentHookNameInDev = workInProgressHook = currentHook = currentlyRenderingFiber = null;
|
|
hookTypesUpdateIndexDev = -1;
|
|
null !== current2 && (current2.flags & 65011712) !== (workInProgress2.flags & 65011712) && console.error(
|
|
"Internal React error: Expected static flag was missing. Please notify the React team."
|
|
);
|
|
didScheduleRenderPhaseUpdate = false;
|
|
thenableIndexCounter = 0;
|
|
thenableState = null;
|
|
if (didRenderTooFewHooks)
|
|
throw Error(
|
|
"Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
|
|
);
|
|
null === current2 || didReceiveUpdate || (current2 = current2.dependencies, null !== current2 && checkIfContextChanged(current2) && (didReceiveUpdate = true));
|
|
needsToResetSuspendedThenableDEV ? (needsToResetSuspendedThenableDEV = false, current2 = true) : current2 = false;
|
|
current2 && (workInProgress2 = getComponentNameFromFiber(workInProgress2) || "Unknown", didWarnAboutUseWrappedInTryCatch.has(workInProgress2) || didWarnAboutAsyncClientComponent.has(workInProgress2) || (didWarnAboutUseWrappedInTryCatch.add(workInProgress2), console.error(
|
|
"`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary."
|
|
)));
|
|
}
|
|
function renderWithHooksAgain(workInProgress2, Component, props, secondArg) {
|
|
currentlyRenderingFiber = workInProgress2;
|
|
var numberOfReRenders = 0;
|
|
do {
|
|
didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null);
|
|
thenableIndexCounter = 0;
|
|
didScheduleRenderPhaseUpdateDuringThisPass = false;
|
|
if (numberOfReRenders >= RE_RENDER_LIMIT)
|
|
throw Error(
|
|
"Too many re-renders. React limits the number of renders to prevent an infinite loop."
|
|
);
|
|
numberOfReRenders += 1;
|
|
ignorePreviousDependencies = false;
|
|
workInProgressHook = currentHook = null;
|
|
if (null != workInProgress2.updateQueue) {
|
|
var children = workInProgress2.updateQueue;
|
|
children.lastEffect = null;
|
|
children.events = null;
|
|
children.stores = null;
|
|
null != children.memoCache && (children.memoCache.index = 0);
|
|
}
|
|
hookTypesUpdateIndexDev = -1;
|
|
ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV;
|
|
children = callComponentInDEV(Component, props, secondArg);
|
|
} while (didScheduleRenderPhaseUpdateDuringThisPass);
|
|
return children;
|
|
}
|
|
function TransitionAwareHostComponent() {
|
|
var dispatcher = ReactSharedInternals.H, maybeThenable = dispatcher.useState()[0];
|
|
maybeThenable = "function" === typeof maybeThenable.then ? useThenable(maybeThenable) : maybeThenable;
|
|
dispatcher = dispatcher.useState()[0];
|
|
(null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && (currentlyRenderingFiber.flags |= 1024);
|
|
return maybeThenable;
|
|
}
|
|
function checkDidRenderIdHook() {
|
|
var didRenderIdHook = 0 !== localIdCounter;
|
|
localIdCounter = 0;
|
|
return didRenderIdHook;
|
|
}
|
|
function bailoutHooks(current2, workInProgress2, lanes) {
|
|
workInProgress2.updateQueue = current2.updateQueue;
|
|
workInProgress2.flags = (workInProgress2.mode & StrictEffectsMode) !== NoMode ? workInProgress2.flags & -402655237 : workInProgress2.flags & -2053;
|
|
current2.lanes &= ~lanes;
|
|
}
|
|
function resetHooksOnUnwind(workInProgress2) {
|
|
if (didScheduleRenderPhaseUpdate) {
|
|
for (workInProgress2 = workInProgress2.memoizedState; null !== workInProgress2; ) {
|
|
var queue = workInProgress2.queue;
|
|
null !== queue && (queue.pending = null);
|
|
workInProgress2 = workInProgress2.next;
|
|
}
|
|
didScheduleRenderPhaseUpdate = false;
|
|
}
|
|
renderLanes = 0;
|
|
hookTypesDev = workInProgressHook = currentHook = currentlyRenderingFiber = null;
|
|
hookTypesUpdateIndexDev = -1;
|
|
currentHookNameInDev = null;
|
|
didScheduleRenderPhaseUpdateDuringThisPass = false;
|
|
thenableIndexCounter = localIdCounter = 0;
|
|
thenableState = null;
|
|
}
|
|
function mountWorkInProgressHook() {
|
|
var hook = {
|
|
memoizedState: null,
|
|
baseState: null,
|
|
baseQueue: null,
|
|
queue: null,
|
|
next: null
|
|
};
|
|
null === workInProgressHook ? currentlyRenderingFiber.memoizedState = workInProgressHook = hook : workInProgressHook = workInProgressHook.next = hook;
|
|
return workInProgressHook;
|
|
}
|
|
function updateWorkInProgressHook() {
|
|
if (null === currentHook) {
|
|
var nextCurrentHook = currentlyRenderingFiber.alternate;
|
|
nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
|
|
} else nextCurrentHook = currentHook.next;
|
|
var nextWorkInProgressHook = null === workInProgressHook ? currentlyRenderingFiber.memoizedState : workInProgressHook.next;
|
|
if (null !== nextWorkInProgressHook)
|
|
workInProgressHook = nextWorkInProgressHook, currentHook = nextCurrentHook;
|
|
else {
|
|
if (null === nextCurrentHook) {
|
|
if (null === currentlyRenderingFiber.alternate)
|
|
throw Error(
|
|
"Update hook called on initial render. This is likely a bug in React. Please file an issue."
|
|
);
|
|
throw Error("Rendered more hooks than during the previous render.");
|
|
}
|
|
currentHook = nextCurrentHook;
|
|
nextCurrentHook = {
|
|
memoizedState: currentHook.memoizedState,
|
|
baseState: currentHook.baseState,
|
|
baseQueue: currentHook.baseQueue,
|
|
queue: currentHook.queue,
|
|
next: null
|
|
};
|
|
null === workInProgressHook ? currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook : workInProgressHook = workInProgressHook.next = nextCurrentHook;
|
|
}
|
|
return workInProgressHook;
|
|
}
|
|
function createFunctionComponentUpdateQueue() {
|
|
return { lastEffect: null, events: null, stores: null, memoCache: null };
|
|
}
|
|
function useThenable(thenable) {
|
|
var index = thenableIndexCounter;
|
|
thenableIndexCounter += 1;
|
|
null === thenableState && (thenableState = createThenableState());
|
|
thenable = trackUsedThenable(thenableState, thenable, index);
|
|
index = currentlyRenderingFiber;
|
|
null === (null === workInProgressHook ? index.memoizedState : workInProgressHook.next) && (index = index.alternate, ReactSharedInternals.H = null !== index && null !== index.memoizedState ? HooksDispatcherOnUpdateInDEV : HooksDispatcherOnMountInDEV);
|
|
return thenable;
|
|
}
|
|
function use(usable) {
|
|
if (null !== usable && "object" === typeof usable) {
|
|
if ("function" === typeof usable.then) return useThenable(usable);
|
|
if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);
|
|
}
|
|
throw Error("An unsupported type was passed to use(): " + String(usable));
|
|
}
|
|
function useMemoCache(size) {
|
|
var memoCache = null, updateQueue = currentlyRenderingFiber.updateQueue;
|
|
null !== updateQueue && (memoCache = updateQueue.memoCache);
|
|
if (null == memoCache) {
|
|
var current2 = currentlyRenderingFiber.alternate;
|
|
null !== current2 && (current2 = current2.updateQueue, null !== current2 && (current2 = current2.memoCache, null != current2 && (memoCache = {
|
|
data: current2.data.map(function(array) {
|
|
return array.slice();
|
|
}),
|
|
index: 0
|
|
})));
|
|
}
|
|
null == memoCache && (memoCache = { data: [], index: 0 });
|
|
null === updateQueue && (updateQueue = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = updateQueue);
|
|
updateQueue.memoCache = memoCache;
|
|
updateQueue = memoCache.data[memoCache.index];
|
|
if (void 0 === updateQueue || ignorePreviousDependencies)
|
|
for (updateQueue = memoCache.data[memoCache.index] = Array(size), current2 = 0; current2 < size; current2++)
|
|
updateQueue[current2] = REACT_MEMO_CACHE_SENTINEL;
|
|
else
|
|
updateQueue.length !== size && console.error(
|
|
"Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",
|
|
updateQueue.length,
|
|
size
|
|
);
|
|
memoCache.index++;
|
|
return updateQueue;
|
|
}
|
|
function basicStateReducer(state, action) {
|
|
return "function" === typeof action ? action(state) : action;
|
|
}
|
|
function mountReducer(reducer, initialArg, init) {
|
|
var hook = mountWorkInProgressHook();
|
|
if (void 0 !== init) {
|
|
var initialState = init(initialArg);
|
|
if (shouldDoubleInvokeUserFnsInHooksDEV) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
init(initialArg);
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
} else initialState = initialArg;
|
|
hook.memoizedState = hook.baseState = initialState;
|
|
reducer = {
|
|
pending: null,
|
|
lanes: 0,
|
|
dispatch: null,
|
|
lastRenderedReducer: reducer,
|
|
lastRenderedState: initialState
|
|
};
|
|
hook.queue = reducer;
|
|
reducer = reducer.dispatch = dispatchReducerAction.bind(
|
|
null,
|
|
currentlyRenderingFiber,
|
|
reducer
|
|
);
|
|
return [hook.memoizedState, reducer];
|
|
}
|
|
function updateReducer(reducer) {
|
|
var hook = updateWorkInProgressHook();
|
|
return updateReducerImpl(hook, currentHook, reducer);
|
|
}
|
|
function updateReducerImpl(hook, current2, reducer) {
|
|
var queue = hook.queue;
|
|
if (null === queue)
|
|
throw Error(
|
|
"Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)"
|
|
);
|
|
queue.lastRenderedReducer = reducer;
|
|
var baseQueue = hook.baseQueue, pendingQueue = queue.pending;
|
|
if (null !== pendingQueue) {
|
|
if (null !== baseQueue) {
|
|
var baseFirst = baseQueue.next;
|
|
baseQueue.next = pendingQueue.next;
|
|
pendingQueue.next = baseFirst;
|
|
}
|
|
current2.baseQueue !== baseQueue && console.error(
|
|
"Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."
|
|
);
|
|
current2.baseQueue = baseQueue = pendingQueue;
|
|
queue.pending = null;
|
|
}
|
|
pendingQueue = hook.baseState;
|
|
if (null === baseQueue) hook.memoizedState = pendingQueue;
|
|
else {
|
|
current2 = baseQueue.next;
|
|
var newBaseQueueFirst = baseFirst = null, newBaseQueueLast = null, update2 = current2, didReadFromEntangledAsyncAction2 = false;
|
|
do {
|
|
var updateLane = update2.lane & -536870913;
|
|
if (updateLane !== update2.lane ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes & updateLane) === updateLane) {
|
|
var revertLane = update2.revertLane;
|
|
if (0 === revertLane)
|
|
null !== newBaseQueueLast && (newBaseQueueLast = newBaseQueueLast.next = {
|
|
lane: 0,
|
|
revertLane: 0,
|
|
gesture: null,
|
|
action: update2.action,
|
|
hasEagerState: update2.hasEagerState,
|
|
eagerState: update2.eagerState,
|
|
next: null
|
|
}), updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction2 = true);
|
|
else if ((renderLanes & revertLane) === revertLane) {
|
|
update2 = update2.next;
|
|
revertLane === currentEntangledLane && (didReadFromEntangledAsyncAction2 = true);
|
|
continue;
|
|
} else
|
|
updateLane = {
|
|
lane: 0,
|
|
revertLane: update2.revertLane,
|
|
gesture: null,
|
|
action: update2.action,
|
|
hasEagerState: update2.hasEagerState,
|
|
eagerState: update2.eagerState,
|
|
next: null
|
|
}, null === newBaseQueueLast ? (newBaseQueueFirst = newBaseQueueLast = updateLane, baseFirst = pendingQueue) : newBaseQueueLast = newBaseQueueLast.next = updateLane, currentlyRenderingFiber.lanes |= revertLane, workInProgressRootSkippedLanes |= revertLane;
|
|
updateLane = update2.action;
|
|
shouldDoubleInvokeUserFnsInHooksDEV && reducer(pendingQueue, updateLane);
|
|
pendingQueue = update2.hasEagerState ? update2.eagerState : reducer(pendingQueue, updateLane);
|
|
} else
|
|
revertLane = {
|
|
lane: updateLane,
|
|
revertLane: update2.revertLane,
|
|
gesture: update2.gesture,
|
|
action: update2.action,
|
|
hasEagerState: update2.hasEagerState,
|
|
eagerState: update2.eagerState,
|
|
next: null
|
|
}, null === newBaseQueueLast ? (newBaseQueueFirst = newBaseQueueLast = revertLane, baseFirst = pendingQueue) : newBaseQueueLast = newBaseQueueLast.next = revertLane, currentlyRenderingFiber.lanes |= updateLane, workInProgressRootSkippedLanes |= updateLane;
|
|
update2 = update2.next;
|
|
} while (null !== update2 && update2 !== current2);
|
|
null === newBaseQueueLast ? baseFirst = pendingQueue : newBaseQueueLast.next = newBaseQueueFirst;
|
|
if (!objectIs(pendingQueue, hook.memoizedState) && (didReceiveUpdate = true, didReadFromEntangledAsyncAction2 && (reducer = currentEntangledActionThenable, null !== reducer)))
|
|
throw reducer;
|
|
hook.memoizedState = pendingQueue;
|
|
hook.baseState = baseFirst;
|
|
hook.baseQueue = newBaseQueueLast;
|
|
queue.lastRenderedState = pendingQueue;
|
|
}
|
|
null === baseQueue && (queue.lanes = 0);
|
|
return [hook.memoizedState, queue.dispatch];
|
|
}
|
|
function rerenderReducer(reducer) {
|
|
var hook = updateWorkInProgressHook(), queue = hook.queue;
|
|
if (null === queue)
|
|
throw Error(
|
|
"Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)"
|
|
);
|
|
queue.lastRenderedReducer = reducer;
|
|
var dispatch = queue.dispatch, lastRenderPhaseUpdate = queue.pending, newState = hook.memoizedState;
|
|
if (null !== lastRenderPhaseUpdate) {
|
|
queue.pending = null;
|
|
var update2 = lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
|
|
do
|
|
newState = reducer(newState, update2.action), update2 = update2.next;
|
|
while (update2 !== lastRenderPhaseUpdate);
|
|
objectIs(newState, hook.memoizedState) || (didReceiveUpdate = true);
|
|
hook.memoizedState = newState;
|
|
null === hook.baseQueue && (hook.baseState = newState);
|
|
queue.lastRenderedState = newState;
|
|
}
|
|
return [newState, dispatch];
|
|
}
|
|
function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook();
|
|
if (isHydrating) {
|
|
if (void 0 === getServerSnapshot)
|
|
throw Error(
|
|
"Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."
|
|
);
|
|
var nextSnapshot = getServerSnapshot();
|
|
didWarnUncachedGetSnapshot || nextSnapshot === getServerSnapshot() || (console.error(
|
|
"The result of getServerSnapshot should be cached to avoid an infinite loop"
|
|
), didWarnUncachedGetSnapshot = true);
|
|
} else {
|
|
nextSnapshot = getSnapshot();
|
|
didWarnUncachedGetSnapshot || (getServerSnapshot = getSnapshot(), objectIs(nextSnapshot, getServerSnapshot) || (console.error(
|
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
), didWarnUncachedGetSnapshot = true));
|
|
if (null === workInProgressRoot)
|
|
throw Error(
|
|
"Expected a work-in-progress root. This is a bug in React. Please file an issue."
|
|
);
|
|
0 !== (workInProgressRootRenderLanes & 127) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
|
|
}
|
|
hook.memoizedState = nextSnapshot;
|
|
getServerSnapshot = { value: nextSnapshot, getSnapshot };
|
|
hook.queue = getServerSnapshot;
|
|
mountEffect(
|
|
subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe),
|
|
[subscribe]
|
|
);
|
|
fiber.flags |= 2048;
|
|
pushSimpleEffect(
|
|
HasEffect | Passive,
|
|
{ destroy: void 0 },
|
|
updateStoreInstance.bind(
|
|
null,
|
|
fiber,
|
|
getServerSnapshot,
|
|
nextSnapshot,
|
|
getSnapshot
|
|
),
|
|
null
|
|
);
|
|
return nextSnapshot;
|
|
}
|
|
function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(), isHydrating$jscomp$0 = isHydrating;
|
|
if (isHydrating$jscomp$0) {
|
|
if (void 0 === getServerSnapshot)
|
|
throw Error(
|
|
"Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."
|
|
);
|
|
getServerSnapshot = getServerSnapshot();
|
|
} else if (getServerSnapshot = getSnapshot(), !didWarnUncachedGetSnapshot) {
|
|
var cachedSnapshot = getSnapshot();
|
|
objectIs(getServerSnapshot, cachedSnapshot) || (console.error(
|
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
), didWarnUncachedGetSnapshot = true);
|
|
}
|
|
if (cachedSnapshot = !objectIs(
|
|
(currentHook || hook).memoizedState,
|
|
getServerSnapshot
|
|
))
|
|
hook.memoizedState = getServerSnapshot, didReceiveUpdate = true;
|
|
hook = hook.queue;
|
|
var create = subscribeToStore.bind(null, fiber, hook, subscribe);
|
|
updateEffectImpl(2048, Passive, create, [subscribe]);
|
|
if (hook.getSnapshot !== getSnapshot || cachedSnapshot || null !== workInProgressHook && workInProgressHook.memoizedState.tag & HasEffect) {
|
|
fiber.flags |= 2048;
|
|
pushSimpleEffect(
|
|
HasEffect | Passive,
|
|
{ destroy: void 0 },
|
|
updateStoreInstance.bind(
|
|
null,
|
|
fiber,
|
|
hook,
|
|
getServerSnapshot,
|
|
getSnapshot
|
|
),
|
|
null
|
|
);
|
|
if (null === workInProgressRoot)
|
|
throw Error(
|
|
"Expected a work-in-progress root. This is a bug in React. Please file an issue."
|
|
);
|
|
isHydrating$jscomp$0 || 0 !== (renderLanes & 127) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
|
|
}
|
|
return getServerSnapshot;
|
|
}
|
|
function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
|
|
fiber.flags |= 16384;
|
|
fiber = { getSnapshot, value: renderedSnapshot };
|
|
getSnapshot = currentlyRenderingFiber.updateQueue;
|
|
null === getSnapshot ? (getSnapshot = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = getSnapshot, getSnapshot.stores = [fiber]) : (renderedSnapshot = getSnapshot.stores, null === renderedSnapshot ? getSnapshot.stores = [fiber] : renderedSnapshot.push(fiber));
|
|
}
|
|
function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
|
|
inst.value = nextSnapshot;
|
|
inst.getSnapshot = getSnapshot;
|
|
checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
|
|
}
|
|
function subscribeToStore(fiber, inst, subscribe) {
|
|
return subscribe(function() {
|
|
checkIfSnapshotChanged(inst) && (startUpdateTimerByLane(2, "updateSyncExternalStore()", fiber), forceStoreRerender(fiber));
|
|
});
|
|
}
|
|
function checkIfSnapshotChanged(inst) {
|
|
var latestGetSnapshot = inst.getSnapshot;
|
|
inst = inst.value;
|
|
try {
|
|
var nextValue = latestGetSnapshot();
|
|
return !objectIs(inst, nextValue);
|
|
} catch (error) {
|
|
return true;
|
|
}
|
|
}
|
|
function forceStoreRerender(fiber) {
|
|
var root2 = enqueueConcurrentRenderForLane(fiber, 2);
|
|
null !== root2 && scheduleUpdateOnFiber(root2, fiber, 2);
|
|
}
|
|
function mountStateImpl(initialState) {
|
|
var hook = mountWorkInProgressHook();
|
|
if ("function" === typeof initialState) {
|
|
var initialStateInitializer = initialState;
|
|
initialState = initialStateInitializer();
|
|
if (shouldDoubleInvokeUserFnsInHooksDEV) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
initialStateInitializer();
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
}
|
|
hook.memoizedState = hook.baseState = initialState;
|
|
hook.queue = {
|
|
pending: null,
|
|
lanes: 0,
|
|
dispatch: null,
|
|
lastRenderedReducer: basicStateReducer,
|
|
lastRenderedState: initialState
|
|
};
|
|
return hook;
|
|
}
|
|
function mountState(initialState) {
|
|
initialState = mountStateImpl(initialState);
|
|
var queue = initialState.queue, dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue);
|
|
queue.dispatch = dispatch;
|
|
return [initialState.memoizedState, dispatch];
|
|
}
|
|
function mountOptimistic(passthrough) {
|
|
var hook = mountWorkInProgressHook();
|
|
hook.memoizedState = hook.baseState = passthrough;
|
|
var queue = {
|
|
pending: null,
|
|
lanes: 0,
|
|
dispatch: null,
|
|
lastRenderedReducer: null,
|
|
lastRenderedState: null
|
|
};
|
|
hook.queue = queue;
|
|
hook = dispatchOptimisticSetState.bind(
|
|
null,
|
|
currentlyRenderingFiber,
|
|
true,
|
|
queue
|
|
);
|
|
queue.dispatch = hook;
|
|
return [passthrough, hook];
|
|
}
|
|
function updateOptimistic(passthrough, reducer) {
|
|
var hook = updateWorkInProgressHook();
|
|
return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
|
|
}
|
|
function updateOptimisticImpl(hook, current2, passthrough, reducer) {
|
|
hook.baseState = passthrough;
|
|
return updateReducerImpl(
|
|
hook,
|
|
currentHook,
|
|
"function" === typeof reducer ? reducer : basicStateReducer
|
|
);
|
|
}
|
|
function rerenderOptimistic(passthrough, reducer) {
|
|
var hook = updateWorkInProgressHook();
|
|
if (null !== currentHook)
|
|
return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
|
|
hook.baseState = passthrough;
|
|
return [passthrough, hook.queue.dispatch];
|
|
}
|
|
function dispatchActionState(fiber, actionQueue, setPendingState, setState, payload) {
|
|
if (isRenderPhaseUpdate(fiber))
|
|
throw Error("Cannot update form state while rendering.");
|
|
fiber = actionQueue.action;
|
|
if (null !== fiber) {
|
|
var actionNode = {
|
|
payload,
|
|
action: fiber,
|
|
next: null,
|
|
isTransition: true,
|
|
status: "pending",
|
|
value: null,
|
|
reason: null,
|
|
listeners: [],
|
|
then: function(listener) {
|
|
actionNode.listeners.push(listener);
|
|
}
|
|
};
|
|
null !== ReactSharedInternals.T ? setPendingState(true) : actionNode.isTransition = false;
|
|
setState(actionNode);
|
|
setPendingState = actionQueue.pending;
|
|
null === setPendingState ? (actionNode.next = actionQueue.pending = actionNode, runActionStateAction(actionQueue, actionNode)) : (actionNode.next = setPendingState.next, actionQueue.pending = setPendingState.next = actionNode);
|
|
}
|
|
}
|
|
function runActionStateAction(actionQueue, node2) {
|
|
var action = node2.action, payload = node2.payload, prevState = actionQueue.state;
|
|
if (node2.isTransition) {
|
|
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
|
currentTransition._updatedFibers = /* @__PURE__ */ new Set();
|
|
ReactSharedInternals.T = currentTransition;
|
|
try {
|
|
var returnValue = action(prevState, payload), onStartTransitionFinish = ReactSharedInternals.S;
|
|
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
|
handleActionReturnValue(actionQueue, node2, returnValue);
|
|
} catch (error) {
|
|
onActionError(actionQueue, node2, error);
|
|
} finally {
|
|
null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
|
|
"We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
|
|
), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition, null === prevTransition && currentTransition._updatedFibers && (actionQueue = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < actionQueue && console.warn(
|
|
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
|
|
));
|
|
}
|
|
} else
|
|
try {
|
|
currentTransition = action(prevState, payload), handleActionReturnValue(actionQueue, node2, currentTransition);
|
|
} catch (error$4) {
|
|
onActionError(actionQueue, node2, error$4);
|
|
}
|
|
}
|
|
function handleActionReturnValue(actionQueue, node2, returnValue) {
|
|
null !== returnValue && "object" === typeof returnValue && "function" === typeof returnValue.then ? (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(
|
|
function(nextState) {
|
|
onActionSuccess(actionQueue, node2, nextState);
|
|
},
|
|
function(error) {
|
|
return onActionError(actionQueue, node2, error);
|
|
}
|
|
), node2.isTransition || console.error(
|
|
"An async function with useActionState was called outside of a transition. This is likely not what you intended (for example, isPending will not update correctly). Either call the returned function inside startTransition, or pass it to an `action` or `formAction` prop."
|
|
)) : onActionSuccess(actionQueue, node2, returnValue);
|
|
}
|
|
function onActionSuccess(actionQueue, actionNode, nextState) {
|
|
actionNode.status = "fulfilled";
|
|
actionNode.value = nextState;
|
|
notifyActionListeners(actionNode);
|
|
actionQueue.state = nextState;
|
|
actionNode = actionQueue.pending;
|
|
null !== actionNode && (nextState = actionNode.next, nextState === actionNode ? actionQueue.pending = null : (nextState = nextState.next, actionNode.next = nextState, runActionStateAction(actionQueue, nextState)));
|
|
}
|
|
function onActionError(actionQueue, actionNode, error) {
|
|
var last = actionQueue.pending;
|
|
actionQueue.pending = null;
|
|
if (null !== last) {
|
|
last = last.next;
|
|
do
|
|
actionNode.status = "rejected", actionNode.reason = error, notifyActionListeners(actionNode), actionNode = actionNode.next;
|
|
while (actionNode !== last);
|
|
}
|
|
actionQueue.action = null;
|
|
}
|
|
function notifyActionListeners(actionNode) {
|
|
actionNode = actionNode.listeners;
|
|
for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();
|
|
}
|
|
function actionStateReducer(oldState, newState) {
|
|
return newState;
|
|
}
|
|
function mountActionState(action, initialStateProp) {
|
|
if (isHydrating) {
|
|
var ssrFormState = workInProgressRoot.formState;
|
|
if (null !== ssrFormState) {
|
|
a: {
|
|
var isMatching = currentlyRenderingFiber;
|
|
if (isHydrating) {
|
|
if (nextHydratableInstance) {
|
|
b: {
|
|
var markerInstance = nextHydratableInstance;
|
|
for (var inRootOrSingleton = rootOrSingletonContext; 8 !== markerInstance.nodeType; ) {
|
|
if (!inRootOrSingleton) {
|
|
markerInstance = null;
|
|
break b;
|
|
}
|
|
markerInstance = getNextHydratable(
|
|
markerInstance.nextSibling
|
|
);
|
|
if (null === markerInstance) {
|
|
markerInstance = null;
|
|
break b;
|
|
}
|
|
}
|
|
inRootOrSingleton = markerInstance.data;
|
|
markerInstance = inRootOrSingleton === FORM_STATE_IS_MATCHING || inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING ? markerInstance : null;
|
|
}
|
|
if (markerInstance) {
|
|
nextHydratableInstance = getNextHydratable(
|
|
markerInstance.nextSibling
|
|
);
|
|
isMatching = markerInstance.data === FORM_STATE_IS_MATCHING;
|
|
break a;
|
|
}
|
|
}
|
|
throwOnHydrationMismatch(isMatching);
|
|
}
|
|
isMatching = false;
|
|
}
|
|
isMatching && (initialStateProp = ssrFormState[0]);
|
|
}
|
|
}
|
|
ssrFormState = mountWorkInProgressHook();
|
|
ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;
|
|
isMatching = {
|
|
pending: null,
|
|
lanes: 0,
|
|
dispatch: null,
|
|
lastRenderedReducer: actionStateReducer,
|
|
lastRenderedState: initialStateProp
|
|
};
|
|
ssrFormState.queue = isMatching;
|
|
ssrFormState = dispatchSetState.bind(
|
|
null,
|
|
currentlyRenderingFiber,
|
|
isMatching
|
|
);
|
|
isMatching.dispatch = ssrFormState;
|
|
isMatching = mountStateImpl(false);
|
|
inRootOrSingleton = dispatchOptimisticSetState.bind(
|
|
null,
|
|
currentlyRenderingFiber,
|
|
false,
|
|
isMatching.queue
|
|
);
|
|
isMatching = mountWorkInProgressHook();
|
|
markerInstance = {
|
|
state: initialStateProp,
|
|
dispatch: null,
|
|
action,
|
|
pending: null
|
|
};
|
|
isMatching.queue = markerInstance;
|
|
ssrFormState = dispatchActionState.bind(
|
|
null,
|
|
currentlyRenderingFiber,
|
|
markerInstance,
|
|
inRootOrSingleton,
|
|
ssrFormState
|
|
);
|
|
markerInstance.dispatch = ssrFormState;
|
|
isMatching.memoizedState = action;
|
|
return [initialStateProp, ssrFormState, false];
|
|
}
|
|
function updateActionState(action) {
|
|
var stateHook = updateWorkInProgressHook();
|
|
return updateActionStateImpl(stateHook, currentHook, action);
|
|
}
|
|
function updateActionStateImpl(stateHook, currentStateHook, action) {
|
|
currentStateHook = updateReducerImpl(
|
|
stateHook,
|
|
currentStateHook,
|
|
actionStateReducer
|
|
)[0];
|
|
stateHook = updateReducer(basicStateReducer)[0];
|
|
if ("object" === typeof currentStateHook && null !== currentStateHook && "function" === typeof currentStateHook.then)
|
|
try {
|
|
var state = useThenable(currentStateHook);
|
|
} catch (x) {
|
|
if (x === SuspenseException) throw SuspenseActionException;
|
|
throw x;
|
|
}
|
|
else state = currentStateHook;
|
|
currentStateHook = updateWorkInProgressHook();
|
|
var actionQueue = currentStateHook.queue, dispatch = actionQueue.dispatch;
|
|
action !== currentStateHook.memoizedState && (currentlyRenderingFiber.flags |= 2048, pushSimpleEffect(
|
|
HasEffect | Passive,
|
|
{ destroy: void 0 },
|
|
actionStateActionEffect.bind(null, actionQueue, action),
|
|
null
|
|
));
|
|
return [state, dispatch, stateHook];
|
|
}
|
|
function actionStateActionEffect(actionQueue, action) {
|
|
actionQueue.action = action;
|
|
}
|
|
function rerenderActionState(action) {
|
|
var stateHook = updateWorkInProgressHook(), currentStateHook = currentHook;
|
|
if (null !== currentStateHook)
|
|
return updateActionStateImpl(stateHook, currentStateHook, action);
|
|
updateWorkInProgressHook();
|
|
stateHook = stateHook.memoizedState;
|
|
currentStateHook = updateWorkInProgressHook();
|
|
var dispatch = currentStateHook.queue.dispatch;
|
|
currentStateHook.memoizedState = action;
|
|
return [stateHook, dispatch, false];
|
|
}
|
|
function pushSimpleEffect(tag, inst, create, deps) {
|
|
tag = { tag, create, deps, inst, next: null };
|
|
inst = currentlyRenderingFiber.updateQueue;
|
|
null === inst && (inst = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = inst);
|
|
create = inst.lastEffect;
|
|
null === create ? inst.lastEffect = tag.next = tag : (deps = create.next, create.next = tag, tag.next = deps, inst.lastEffect = tag);
|
|
return tag;
|
|
}
|
|
function mountRef(initialValue) {
|
|
var hook = mountWorkInProgressHook();
|
|
initialValue = { current: initialValue };
|
|
return hook.memoizedState = initialValue;
|
|
}
|
|
function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
|
|
var hook = mountWorkInProgressHook();
|
|
currentlyRenderingFiber.flags |= fiberFlags;
|
|
hook.memoizedState = pushSimpleEffect(
|
|
HasEffect | hookFlags,
|
|
{ destroy: void 0 },
|
|
create,
|
|
void 0 === deps ? null : deps
|
|
);
|
|
}
|
|
function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
|
|
var hook = updateWorkInProgressHook();
|
|
deps = void 0 === deps ? null : deps;
|
|
var inst = hook.memoizedState.inst;
|
|
null !== currentHook && null !== deps && areHookInputsEqual(deps, currentHook.memoizedState.deps) ? hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps) : (currentlyRenderingFiber.flags |= fiberFlags, hook.memoizedState = pushSimpleEffect(
|
|
HasEffect | hookFlags,
|
|
inst,
|
|
create,
|
|
deps
|
|
));
|
|
}
|
|
function mountEffect(create, deps) {
|
|
(currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode ? mountEffectImpl(276826112, Passive, create, deps) : mountEffectImpl(8390656, Passive, create, deps);
|
|
}
|
|
function useEffectEventImpl(payload) {
|
|
currentlyRenderingFiber.flags |= 4;
|
|
var componentUpdateQueue = currentlyRenderingFiber.updateQueue;
|
|
if (null === componentUpdateQueue)
|
|
componentUpdateQueue = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = componentUpdateQueue, componentUpdateQueue.events = [payload];
|
|
else {
|
|
var events = componentUpdateQueue.events;
|
|
null === events ? componentUpdateQueue.events = [payload] : events.push(payload);
|
|
}
|
|
}
|
|
function mountEvent(callback) {
|
|
var hook = mountWorkInProgressHook(), ref = { impl: callback };
|
|
hook.memoizedState = ref;
|
|
return function() {
|
|
if ((executionContext & RenderContext) !== NoContext)
|
|
throw Error(
|
|
"A function wrapped in useEffectEvent can't be called during rendering."
|
|
);
|
|
return ref.impl.apply(void 0, arguments);
|
|
};
|
|
}
|
|
function updateEvent(callback) {
|
|
var ref = updateWorkInProgressHook().memoizedState;
|
|
useEffectEventImpl({ ref, nextImpl: callback });
|
|
return function() {
|
|
if ((executionContext & RenderContext) !== NoContext)
|
|
throw Error(
|
|
"A function wrapped in useEffectEvent can't be called during rendering."
|
|
);
|
|
return ref.impl.apply(void 0, arguments);
|
|
};
|
|
}
|
|
function mountLayoutEffect(create, deps) {
|
|
var fiberFlags = 4194308;
|
|
(currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && (fiberFlags |= 134217728);
|
|
return mountEffectImpl(fiberFlags, Layout, create, deps);
|
|
}
|
|
function imperativeHandleEffect(create, ref) {
|
|
if ("function" === typeof ref) {
|
|
create = create();
|
|
var refCleanup = ref(create);
|
|
return function() {
|
|
"function" === typeof refCleanup ? refCleanup() : ref(null);
|
|
};
|
|
}
|
|
if (null !== ref && void 0 !== ref)
|
|
return ref.hasOwnProperty("current") || console.error(
|
|
"Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.",
|
|
"an object with keys {" + Object.keys(ref).join(", ") + "}"
|
|
), create = create(), ref.current = create, function() {
|
|
ref.current = null;
|
|
};
|
|
}
|
|
function mountImperativeHandle(ref, create, deps) {
|
|
"function" !== typeof create && console.error(
|
|
"Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",
|
|
null !== create ? typeof create : "null"
|
|
);
|
|
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
|
|
var fiberFlags = 4194308;
|
|
(currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && (fiberFlags |= 134217728);
|
|
mountEffectImpl(
|
|
fiberFlags,
|
|
Layout,
|
|
imperativeHandleEffect.bind(null, create, ref),
|
|
deps
|
|
);
|
|
}
|
|
function updateImperativeHandle(ref, create, deps) {
|
|
"function" !== typeof create && console.error(
|
|
"Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",
|
|
null !== create ? typeof create : "null"
|
|
);
|
|
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
|
|
updateEffectImpl(
|
|
4,
|
|
Layout,
|
|
imperativeHandleEffect.bind(null, create, ref),
|
|
deps
|
|
);
|
|
}
|
|
function mountCallback(callback, deps) {
|
|
mountWorkInProgressHook().memoizedState = [
|
|
callback,
|
|
void 0 === deps ? null : deps
|
|
];
|
|
return callback;
|
|
}
|
|
function updateCallback(callback, deps) {
|
|
var hook = updateWorkInProgressHook();
|
|
deps = void 0 === deps ? null : deps;
|
|
var prevState = hook.memoizedState;
|
|
if (null !== deps && areHookInputsEqual(deps, prevState[1]))
|
|
return prevState[0];
|
|
hook.memoizedState = [callback, deps];
|
|
return callback;
|
|
}
|
|
function mountMemo(nextCreate, deps) {
|
|
var hook = mountWorkInProgressHook();
|
|
deps = void 0 === deps ? null : deps;
|
|
var nextValue = nextCreate();
|
|
if (shouldDoubleInvokeUserFnsInHooksDEV) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
nextCreate();
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
hook.memoizedState = [nextValue, deps];
|
|
return nextValue;
|
|
}
|
|
function updateMemo(nextCreate, deps) {
|
|
var hook = updateWorkInProgressHook();
|
|
deps = void 0 === deps ? null : deps;
|
|
var prevState = hook.memoizedState;
|
|
if (null !== deps && areHookInputsEqual(deps, prevState[1]))
|
|
return prevState[0];
|
|
prevState = nextCreate();
|
|
if (shouldDoubleInvokeUserFnsInHooksDEV) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
nextCreate();
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
hook.memoizedState = [prevState, deps];
|
|
return prevState;
|
|
}
|
|
function mountDeferredValue(value, initialValue) {
|
|
var hook = mountWorkInProgressHook();
|
|
return mountDeferredValueImpl(hook, value, initialValue);
|
|
}
|
|
function updateDeferredValue(value, initialValue) {
|
|
var hook = updateWorkInProgressHook();
|
|
return updateDeferredValueImpl(
|
|
hook,
|
|
currentHook.memoizedState,
|
|
value,
|
|
initialValue
|
|
);
|
|
}
|
|
function rerenderDeferredValue(value, initialValue) {
|
|
var hook = updateWorkInProgressHook();
|
|
return null === currentHook ? mountDeferredValueImpl(hook, value, initialValue) : updateDeferredValueImpl(
|
|
hook,
|
|
currentHook.memoizedState,
|
|
value,
|
|
initialValue
|
|
);
|
|
}
|
|
function mountDeferredValueImpl(hook, value, initialValue) {
|
|
if (void 0 === initialValue || 0 !== (renderLanes & 1073741824) && 0 === (workInProgressRootRenderLanes & 261930))
|
|
return hook.memoizedState = value;
|
|
hook.memoizedState = initialValue;
|
|
hook = requestDeferredLane();
|
|
currentlyRenderingFiber.lanes |= hook;
|
|
workInProgressRootSkippedLanes |= hook;
|
|
return initialValue;
|
|
}
|
|
function updateDeferredValueImpl(hook, prevValue, value, initialValue) {
|
|
if (objectIs(value, prevValue)) return value;
|
|
if (null !== currentTreeHiddenStackCursor.current)
|
|
return hook = mountDeferredValueImpl(hook, value, initialValue), objectIs(hook, prevValue) || (didReceiveUpdate = true), hook;
|
|
if (0 === (renderLanes & 42) || 0 !== (renderLanes & 1073741824) && 0 === (workInProgressRootRenderLanes & 261930))
|
|
return didReceiveUpdate = true, hook.memoizedState = value;
|
|
hook = requestDeferredLane();
|
|
currentlyRenderingFiber.lanes |= hook;
|
|
workInProgressRootSkippedLanes |= hook;
|
|
return prevValue;
|
|
}
|
|
function releaseAsyncTransition() {
|
|
ReactSharedInternals.asyncTransitions--;
|
|
}
|
|
function startTransition(fiber, queue, pendingState, finishedState, callback) {
|
|
var previousPriority = ReactDOMSharedInternals.p;
|
|
ReactDOMSharedInternals.p = 0 !== previousPriority && previousPriority < ContinuousEventPriority ? previousPriority : ContinuousEventPriority;
|
|
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
|
currentTransition._updatedFibers = /* @__PURE__ */ new Set();
|
|
ReactSharedInternals.T = currentTransition;
|
|
dispatchOptimisticSetState(fiber, false, queue, pendingState);
|
|
try {
|
|
var returnValue = callback(), onStartTransitionFinish = ReactSharedInternals.S;
|
|
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
|
if (null !== returnValue && "object" === typeof returnValue && "function" === typeof returnValue.then) {
|
|
ReactSharedInternals.asyncTransitions++;
|
|
returnValue.then(releaseAsyncTransition, releaseAsyncTransition);
|
|
var thenableForFinishedState = chainThenableValue(
|
|
returnValue,
|
|
finishedState
|
|
);
|
|
dispatchSetStateInternal(
|
|
fiber,
|
|
queue,
|
|
thenableForFinishedState,
|
|
requestUpdateLane(fiber)
|
|
);
|
|
} else
|
|
dispatchSetStateInternal(
|
|
fiber,
|
|
queue,
|
|
finishedState,
|
|
requestUpdateLane(fiber)
|
|
);
|
|
} catch (error) {
|
|
dispatchSetStateInternal(
|
|
fiber,
|
|
queue,
|
|
{ then: function() {
|
|
}, status: "rejected", reason: error },
|
|
requestUpdateLane(fiber)
|
|
);
|
|
} finally {
|
|
ReactDOMSharedInternals.p = previousPriority, null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
|
|
"We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
|
|
), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition, null === prevTransition && currentTransition._updatedFibers && (fiber = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < fiber && console.warn(
|
|
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
|
|
));
|
|
}
|
|
}
|
|
function startHostTransition(formFiber, pendingState, action, formData) {
|
|
if (5 !== formFiber.tag)
|
|
throw Error(
|
|
"Expected the form instance to be a HostComponent. This is a bug in React."
|
|
);
|
|
var queue = ensureFormComponentIsStateful(formFiber).queue;
|
|
startHostActionTimer(formFiber);
|
|
startTransition(
|
|
formFiber,
|
|
queue,
|
|
pendingState,
|
|
NotPendingTransition,
|
|
null === action ? noop3 : function() {
|
|
requestFormReset$1(formFiber);
|
|
return action(formData);
|
|
}
|
|
);
|
|
}
|
|
function ensureFormComponentIsStateful(formFiber) {
|
|
var existingStateHook = formFiber.memoizedState;
|
|
if (null !== existingStateHook) return existingStateHook;
|
|
existingStateHook = {
|
|
memoizedState: NotPendingTransition,
|
|
baseState: NotPendingTransition,
|
|
baseQueue: null,
|
|
queue: {
|
|
pending: null,
|
|
lanes: 0,
|
|
dispatch: null,
|
|
lastRenderedReducer: basicStateReducer,
|
|
lastRenderedState: NotPendingTransition
|
|
},
|
|
next: null
|
|
};
|
|
var initialResetState = {};
|
|
existingStateHook.next = {
|
|
memoizedState: initialResetState,
|
|
baseState: initialResetState,
|
|
baseQueue: null,
|
|
queue: {
|
|
pending: null,
|
|
lanes: 0,
|
|
dispatch: null,
|
|
lastRenderedReducer: basicStateReducer,
|
|
lastRenderedState: initialResetState
|
|
},
|
|
next: null
|
|
};
|
|
formFiber.memoizedState = existingStateHook;
|
|
formFiber = formFiber.alternate;
|
|
null !== formFiber && (formFiber.memoizedState = existingStateHook);
|
|
return existingStateHook;
|
|
}
|
|
function requestFormReset$1(formFiber) {
|
|
null === ReactSharedInternals.T && console.error(
|
|
"requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition."
|
|
);
|
|
var stateHook = ensureFormComponentIsStateful(formFiber);
|
|
null === stateHook.next && (stateHook = formFiber.alternate.memoizedState);
|
|
dispatchSetStateInternal(
|
|
formFiber,
|
|
stateHook.next.queue,
|
|
{},
|
|
requestUpdateLane(formFiber)
|
|
);
|
|
}
|
|
function mountTransition() {
|
|
var stateHook = mountStateImpl(false);
|
|
stateHook = startTransition.bind(
|
|
null,
|
|
currentlyRenderingFiber,
|
|
stateHook.queue,
|
|
true,
|
|
false
|
|
);
|
|
mountWorkInProgressHook().memoizedState = stateHook;
|
|
return [false, stateHook];
|
|
}
|
|
function updateTransition() {
|
|
var booleanOrThenable = updateReducer(basicStateReducer)[0], start = updateWorkInProgressHook().memoizedState;
|
|
return [
|
|
"boolean" === typeof booleanOrThenable ? booleanOrThenable : useThenable(booleanOrThenable),
|
|
start
|
|
];
|
|
}
|
|
function rerenderTransition() {
|
|
var booleanOrThenable = rerenderReducer(basicStateReducer)[0], start = updateWorkInProgressHook().memoizedState;
|
|
return [
|
|
"boolean" === typeof booleanOrThenable ? booleanOrThenable : useThenable(booleanOrThenable),
|
|
start
|
|
];
|
|
}
|
|
function useHostTransitionStatus() {
|
|
return readContext(HostTransitionContext);
|
|
}
|
|
function mountId() {
|
|
var hook = mountWorkInProgressHook(), identifierPrefix = workInProgressRoot.identifierPrefix;
|
|
if (isHydrating) {
|
|
var treeId = treeContextOverflow;
|
|
var idWithLeadingBit = treeContextId;
|
|
treeId = (idWithLeadingBit & ~(1 << 32 - clz32(idWithLeadingBit) - 1)).toString(32) + treeId;
|
|
identifierPrefix = "_" + identifierPrefix + "R_" + treeId;
|
|
treeId = localIdCounter++;
|
|
0 < treeId && (identifierPrefix += "H" + treeId.toString(32));
|
|
identifierPrefix += "_";
|
|
} else
|
|
treeId = globalClientIdCounter++, identifierPrefix = "_" + identifierPrefix + "r_" + treeId.toString(32) + "_";
|
|
return hook.memoizedState = identifierPrefix;
|
|
}
|
|
function mountRefresh() {
|
|
return mountWorkInProgressHook().memoizedState = refreshCache.bind(
|
|
null,
|
|
currentlyRenderingFiber
|
|
);
|
|
}
|
|
function refreshCache(fiber, seedKey) {
|
|
for (var provider = fiber.return; null !== provider; ) {
|
|
switch (provider.tag) {
|
|
case 24:
|
|
case 3:
|
|
var lane = requestUpdateLane(provider), refreshUpdate = createUpdate(lane), root2 = enqueueUpdate(provider, refreshUpdate, lane);
|
|
null !== root2 && (startUpdateTimerByLane(lane, "refresh()", fiber), scheduleUpdateOnFiber(root2, provider, lane), entangleTransitions(root2, provider, lane));
|
|
fiber = createCache3();
|
|
null !== seedKey && void 0 !== seedKey && null !== root2 && console.error(
|
|
"The seed argument is not enabled outside experimental channels."
|
|
);
|
|
refreshUpdate.payload = { cache: fiber };
|
|
return;
|
|
}
|
|
provider = provider.return;
|
|
}
|
|
}
|
|
function dispatchReducerAction(fiber, queue, action) {
|
|
var args = arguments;
|
|
"function" === typeof args[3] && console.error(
|
|
"State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
|
|
);
|
|
args = requestUpdateLane(fiber);
|
|
var update2 = {
|
|
lane: args,
|
|
revertLane: 0,
|
|
gesture: null,
|
|
action,
|
|
hasEagerState: false,
|
|
eagerState: null,
|
|
next: null
|
|
};
|
|
isRenderPhaseUpdate(fiber) ? enqueueRenderPhaseUpdate(queue, update2) : (update2 = enqueueConcurrentHookUpdate(fiber, queue, update2, args), null !== update2 && (startUpdateTimerByLane(args, "dispatch()", fiber), scheduleUpdateOnFiber(update2, fiber, args), entangleTransitionUpdate(update2, queue, args)));
|
|
}
|
|
function dispatchSetState(fiber, queue, action) {
|
|
var args = arguments;
|
|
"function" === typeof args[3] && console.error(
|
|
"State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
|
|
);
|
|
args = requestUpdateLane(fiber);
|
|
dispatchSetStateInternal(fiber, queue, action, args) && startUpdateTimerByLane(args, "setState()", fiber);
|
|
}
|
|
function dispatchSetStateInternal(fiber, queue, action, lane) {
|
|
var update2 = {
|
|
lane,
|
|
revertLane: 0,
|
|
gesture: null,
|
|
action,
|
|
hasEagerState: false,
|
|
eagerState: null,
|
|
next: null
|
|
};
|
|
if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update2);
|
|
else {
|
|
var alternate = fiber.alternate;
|
|
if (0 === fiber.lanes && (null === alternate || 0 === alternate.lanes) && (alternate = queue.lastRenderedReducer, null !== alternate)) {
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
var currentState = queue.lastRenderedState, eagerState = alternate(currentState, action);
|
|
update2.hasEagerState = true;
|
|
update2.eagerState = eagerState;
|
|
if (objectIs(eagerState, currentState))
|
|
return enqueueUpdate$1(fiber, queue, update2, 0), null === workInProgressRoot && finishQueueingConcurrentUpdates(), false;
|
|
} catch (error) {
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
}
|
|
action = enqueueConcurrentHookUpdate(fiber, queue, update2, lane);
|
|
if (null !== action)
|
|
return scheduleUpdateOnFiber(action, fiber, lane), entangleTransitionUpdate(action, queue, lane), true;
|
|
}
|
|
return false;
|
|
}
|
|
function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) {
|
|
null === ReactSharedInternals.T && 0 === currentEntangledLane && console.error(
|
|
"An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition."
|
|
);
|
|
action = {
|
|
lane: 2,
|
|
revertLane: requestTransitionLane(),
|
|
gesture: null,
|
|
action,
|
|
hasEagerState: false,
|
|
eagerState: null,
|
|
next: null
|
|
};
|
|
if (isRenderPhaseUpdate(fiber)) {
|
|
if (throwIfDuringRender)
|
|
throw Error("Cannot update optimistic state while rendering.");
|
|
console.error("Cannot call startTransition while rendering.");
|
|
} else
|
|
throwIfDuringRender = enqueueConcurrentHookUpdate(
|
|
fiber,
|
|
queue,
|
|
action,
|
|
2
|
|
), null !== throwIfDuringRender && (startUpdateTimerByLane(2, "setOptimistic()", fiber), scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2));
|
|
}
|
|
function isRenderPhaseUpdate(fiber) {
|
|
var alternate = fiber.alternate;
|
|
return fiber === currentlyRenderingFiber || null !== alternate && alternate === currentlyRenderingFiber;
|
|
}
|
|
function enqueueRenderPhaseUpdate(queue, update2) {
|
|
didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
|
|
var pending = queue.pending;
|
|
null === pending ? update2.next = update2 : (update2.next = pending.next, pending.next = update2);
|
|
queue.pending = update2;
|
|
}
|
|
function entangleTransitionUpdate(root2, queue, lane) {
|
|
if (0 !== (lane & 4194048)) {
|
|
var queueLanes = queue.lanes;
|
|
queueLanes &= root2.pendingLanes;
|
|
lane |= queueLanes;
|
|
queue.lanes = lane;
|
|
markRootEntangled(root2, lane);
|
|
}
|
|
}
|
|
function warnOnInvalidCallback(callback) {
|
|
if (null !== callback && "function" !== typeof callback) {
|
|
var key = String(callback);
|
|
didWarnOnInvalidCallback.has(key) || (didWarnOnInvalidCallback.add(key), console.error(
|
|
"Expected the last optional `callback` argument to be a function. Instead received: %s.",
|
|
callback
|
|
));
|
|
}
|
|
}
|
|
function applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, nextProps) {
|
|
var prevState = workInProgress2.memoizedState, partialState = getDerivedStateFromProps(nextProps, prevState);
|
|
if (workInProgress2.mode & StrictLegacyMode) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
partialState = getDerivedStateFromProps(nextProps, prevState);
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
void 0 === partialState && (ctor = getComponentNameFromType(ctor) || "Component", didWarnAboutUndefinedDerivedState.has(ctor) || (didWarnAboutUndefinedDerivedState.add(ctor), console.error(
|
|
"%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",
|
|
ctor
|
|
)));
|
|
prevState = null === partialState || void 0 === partialState ? prevState : assign2({}, prevState, partialState);
|
|
workInProgress2.memoizedState = prevState;
|
|
0 === workInProgress2.lanes && (workInProgress2.updateQueue.baseState = prevState);
|
|
}
|
|
function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
|
|
var instance = workInProgress2.stateNode;
|
|
if ("function" === typeof instance.shouldComponentUpdate) {
|
|
oldProps = instance.shouldComponentUpdate(
|
|
newProps,
|
|
newState,
|
|
nextContext
|
|
);
|
|
if (workInProgress2.mode & StrictLegacyMode) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
oldProps = instance.shouldComponentUpdate(
|
|
newProps,
|
|
newState,
|
|
nextContext
|
|
);
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
void 0 === oldProps && console.error(
|
|
"%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",
|
|
getComponentNameFromType(ctor) || "Component"
|
|
);
|
|
return oldProps;
|
|
}
|
|
return ctor.prototype && ctor.prototype.isPureReactComponent ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : true;
|
|
}
|
|
function callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext) {
|
|
var oldState = instance.state;
|
|
"function" === typeof instance.componentWillReceiveProps && instance.componentWillReceiveProps(newProps, nextContext);
|
|
"function" === typeof instance.UNSAFE_componentWillReceiveProps && instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
|
|
instance.state !== oldState && (workInProgress2 = getComponentNameFromFiber(workInProgress2) || "Component", didWarnAboutStateAssignmentForComponent.has(workInProgress2) || (didWarnAboutStateAssignmentForComponent.add(workInProgress2), console.error(
|
|
"%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",
|
|
workInProgress2
|
|
)), classComponentUpdater.enqueueReplaceState(
|
|
instance,
|
|
instance.state,
|
|
null
|
|
));
|
|
}
|
|
function resolveClassComponentProps(Component, baseProps) {
|
|
var newProps = baseProps;
|
|
if ("ref" in baseProps) {
|
|
newProps = {};
|
|
for (var propName in baseProps)
|
|
"ref" !== propName && (newProps[propName] = baseProps[propName]);
|
|
}
|
|
if (Component = Component.defaultProps) {
|
|
newProps === baseProps && (newProps = assign2({}, newProps));
|
|
for (var _propName in Component)
|
|
void 0 === newProps[_propName] && (newProps[_propName] = Component[_propName]);
|
|
}
|
|
return newProps;
|
|
}
|
|
function defaultOnUncaughtError(error) {
|
|
reportGlobalError(error);
|
|
console.warn(
|
|
"%s\n\n%s\n",
|
|
componentName ? "An error occurred in the <" + componentName + "> component." : "An error occurred in one of your React components.",
|
|
"Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries."
|
|
);
|
|
}
|
|
function defaultOnCaughtError(error) {
|
|
var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component." : "The above error occurred in one of your React components.", recreateMessage = "React will try to recreate this component tree from scratch using the error boundary you provided, " + ((errorBoundaryName || "Anonymous") + ".");
|
|
if ("object" === typeof error && null !== error && "string" === typeof error.environmentName) {
|
|
var JSCompiler_inline_result = error.environmentName;
|
|
error = [
|
|
"%o\n\n%s\n\n%s\n",
|
|
error,
|
|
componentNameMessage,
|
|
recreateMessage
|
|
].slice(0);
|
|
"string" === typeof error[0] ? error.splice(
|
|
0,
|
|
1,
|
|
badgeFormat + " " + error[0],
|
|
badgeStyle,
|
|
pad + JSCompiler_inline_result + pad,
|
|
resetStyle
|
|
) : error.splice(
|
|
0,
|
|
0,
|
|
badgeFormat,
|
|
badgeStyle,
|
|
pad + JSCompiler_inline_result + pad,
|
|
resetStyle
|
|
);
|
|
error.unshift(console);
|
|
JSCompiler_inline_result = bind.apply(console.error, error);
|
|
JSCompiler_inline_result();
|
|
} else
|
|
console.error(
|
|
"%o\n\n%s\n\n%s\n",
|
|
error,
|
|
componentNameMessage,
|
|
recreateMessage
|
|
);
|
|
}
|
|
function defaultOnRecoverableError(error) {
|
|
reportGlobalError(error);
|
|
}
|
|
function logUncaughtError(root2, errorInfo) {
|
|
try {
|
|
componentName = errorInfo.source ? getComponentNameFromFiber(errorInfo.source) : null;
|
|
errorBoundaryName = null;
|
|
var error = errorInfo.value;
|
|
if (null !== ReactSharedInternals.actQueue)
|
|
ReactSharedInternals.thrownErrors.push(error);
|
|
else {
|
|
var onUncaughtError = root2.onUncaughtError;
|
|
onUncaughtError(error, { componentStack: errorInfo.stack });
|
|
}
|
|
} catch (e$5) {
|
|
setTimeout(function() {
|
|
throw e$5;
|
|
});
|
|
}
|
|
}
|
|
function logCaughtError(root2, boundary, errorInfo) {
|
|
try {
|
|
componentName = errorInfo.source ? getComponentNameFromFiber(errorInfo.source) : null;
|
|
errorBoundaryName = getComponentNameFromFiber(boundary);
|
|
var onCaughtError = root2.onCaughtError;
|
|
onCaughtError(errorInfo.value, {
|
|
componentStack: errorInfo.stack,
|
|
errorBoundary: 1 === boundary.tag ? boundary.stateNode : null
|
|
});
|
|
} catch (e$6) {
|
|
setTimeout(function() {
|
|
throw e$6;
|
|
});
|
|
}
|
|
}
|
|
function createRootErrorUpdate(root2, errorInfo, lane) {
|
|
lane = createUpdate(lane);
|
|
lane.tag = CaptureUpdate;
|
|
lane.payload = { element: null };
|
|
lane.callback = function() {
|
|
runWithFiberInDEV(errorInfo.source, logUncaughtError, root2, errorInfo);
|
|
};
|
|
return lane;
|
|
}
|
|
function createClassErrorUpdate(lane) {
|
|
lane = createUpdate(lane);
|
|
lane.tag = CaptureUpdate;
|
|
return lane;
|
|
}
|
|
function initializeClassErrorUpdate(update2, root2, fiber, errorInfo) {
|
|
var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
|
|
if ("function" === typeof getDerivedStateFromError) {
|
|
var error = errorInfo.value;
|
|
update2.payload = function() {
|
|
return getDerivedStateFromError(error);
|
|
};
|
|
update2.callback = function() {
|
|
markFailedErrorBoundaryForHotReloading(fiber);
|
|
runWithFiberInDEV(
|
|
errorInfo.source,
|
|
logCaughtError,
|
|
root2,
|
|
fiber,
|
|
errorInfo
|
|
);
|
|
};
|
|
}
|
|
var inst = fiber.stateNode;
|
|
null !== inst && "function" === typeof inst.componentDidCatch && (update2.callback = function() {
|
|
markFailedErrorBoundaryForHotReloading(fiber);
|
|
runWithFiberInDEV(
|
|
errorInfo.source,
|
|
logCaughtError,
|
|
root2,
|
|
fiber,
|
|
errorInfo
|
|
);
|
|
"function" !== typeof getDerivedStateFromError && (null === legacyErrorBoundariesThatAlreadyFailed ? legacyErrorBoundariesThatAlreadyFailed = /* @__PURE__ */ new Set([this]) : legacyErrorBoundariesThatAlreadyFailed.add(this));
|
|
callComponentDidCatchInDEV(this, errorInfo);
|
|
"function" === typeof getDerivedStateFromError || 0 === (fiber.lanes & 2) && console.error(
|
|
"%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",
|
|
getComponentNameFromFiber(fiber) || "Unknown"
|
|
);
|
|
});
|
|
}
|
|
function throwException(root2, returnFiber, sourceFiber, value, rootRenderLanes) {
|
|
sourceFiber.flags |= 32768;
|
|
isDevToolsPresent && restorePendingUpdaters(root2, rootRenderLanes);
|
|
if (null !== value && "object" === typeof value && "function" === typeof value.then) {
|
|
returnFiber = sourceFiber.alternate;
|
|
null !== returnFiber && propagateParentContextChanges(
|
|
returnFiber,
|
|
sourceFiber,
|
|
rootRenderLanes,
|
|
true
|
|
);
|
|
isHydrating && (didSuspendOrErrorDEV = true);
|
|
sourceFiber = suspenseHandlerStackCursor.current;
|
|
if (null !== sourceFiber) {
|
|
switch (sourceFiber.tag) {
|
|
case 31:
|
|
case 13:
|
|
return null === shellBoundary ? renderDidSuspendDelayIfPossible() : null === sourceFiber.alternate && workInProgressRootExitStatus === RootInProgress && (workInProgressRootExitStatus = RootSuspended), sourceFiber.flags &= -257, sourceFiber.flags |= 65536, sourceFiber.lanes = rootRenderLanes, value === noopSuspenseyCommitThenable ? sourceFiber.flags |= 16384 : (returnFiber = sourceFiber.updateQueue, null === returnFiber ? sourceFiber.updateQueue = /* @__PURE__ */ new Set([value]) : returnFiber.add(value), attachPingListener(root2, value, rootRenderLanes)), false;
|
|
case 22:
|
|
return sourceFiber.flags |= 65536, value === noopSuspenseyCommitThenable ? sourceFiber.flags |= 16384 : (returnFiber = sourceFiber.updateQueue, null === returnFiber ? (returnFiber = {
|
|
transitions: null,
|
|
markerInstances: null,
|
|
retryQueue: /* @__PURE__ */ new Set([value])
|
|
}, sourceFiber.updateQueue = returnFiber) : (sourceFiber = returnFiber.retryQueue, null === sourceFiber ? returnFiber.retryQueue = /* @__PURE__ */ new Set([value]) : sourceFiber.add(value)), attachPingListener(root2, value, rootRenderLanes)), false;
|
|
}
|
|
throw Error(
|
|
"Unexpected Suspense handler tag (" + sourceFiber.tag + "). This is a bug in React."
|
|
);
|
|
}
|
|
attachPingListener(root2, value, rootRenderLanes);
|
|
renderDidSuspendDelayIfPossible();
|
|
return false;
|
|
}
|
|
if (isHydrating)
|
|
return didSuspendOrErrorDEV = true, returnFiber = suspenseHandlerStackCursor.current, null !== returnFiber ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), returnFiber.flags |= 65536, returnFiber.lanes = rootRenderLanes, value !== HydrationMismatchException && queueHydrationError(
|
|
createCapturedValueAtFiber(
|
|
Error(
|
|
"There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.",
|
|
{ cause: value }
|
|
),
|
|
sourceFiber
|
|
)
|
|
)) : (value !== HydrationMismatchException && queueHydrationError(
|
|
createCapturedValueAtFiber(
|
|
Error(
|
|
"There was an error while hydrating but React was able to recover by instead client rendering the entire root.",
|
|
{ cause: value }
|
|
),
|
|
sourceFiber
|
|
)
|
|
), root2 = root2.current.alternate, root2.flags |= 65536, rootRenderLanes &= -rootRenderLanes, root2.lanes |= rootRenderLanes, value = createCapturedValueAtFiber(value, sourceFiber), rootRenderLanes = createRootErrorUpdate(
|
|
root2.stateNode,
|
|
value,
|
|
rootRenderLanes
|
|
), enqueueCapturedUpdate(root2, rootRenderLanes), workInProgressRootExitStatus !== RootSuspendedWithDelay && (workInProgressRootExitStatus = RootErrored)), false;
|
|
var error = createCapturedValueAtFiber(
|
|
Error(
|
|
"There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.",
|
|
{ cause: value }
|
|
),
|
|
sourceFiber
|
|
);
|
|
null === workInProgressRootConcurrentErrors ? workInProgressRootConcurrentErrors = [error] : workInProgressRootConcurrentErrors.push(error);
|
|
workInProgressRootExitStatus !== RootSuspendedWithDelay && (workInProgressRootExitStatus = RootErrored);
|
|
if (null === returnFiber) return true;
|
|
value = createCapturedValueAtFiber(value, sourceFiber);
|
|
sourceFiber = returnFiber;
|
|
do {
|
|
switch (sourceFiber.tag) {
|
|
case 3:
|
|
return sourceFiber.flags |= 65536, root2 = rootRenderLanes & -rootRenderLanes, sourceFiber.lanes |= root2, root2 = createRootErrorUpdate(
|
|
sourceFiber.stateNode,
|
|
value,
|
|
root2
|
|
), enqueueCapturedUpdate(sourceFiber, root2), false;
|
|
case 1:
|
|
if (returnFiber = sourceFiber.type, error = sourceFiber.stateNode, 0 === (sourceFiber.flags & 128) && ("function" === typeof returnFiber.getDerivedStateFromError || null !== error && "function" === typeof error.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(error))))
|
|
return sourceFiber.flags |= 65536, rootRenderLanes &= -rootRenderLanes, sourceFiber.lanes |= rootRenderLanes, rootRenderLanes = createClassErrorUpdate(rootRenderLanes), initializeClassErrorUpdate(
|
|
rootRenderLanes,
|
|
root2,
|
|
sourceFiber,
|
|
value
|
|
), enqueueCapturedUpdate(sourceFiber, rootRenderLanes), false;
|
|
}
|
|
sourceFiber = sourceFiber.return;
|
|
} while (null !== sourceFiber);
|
|
return false;
|
|
}
|
|
function reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2) {
|
|
workInProgress2.child = null === current2 ? mountChildFibers(workInProgress2, null, nextChildren, renderLanes2) : reconcileChildFibers(
|
|
workInProgress2,
|
|
current2.child,
|
|
nextChildren,
|
|
renderLanes2
|
|
);
|
|
}
|
|
function updateForwardRef(current2, workInProgress2, Component, nextProps, renderLanes2) {
|
|
Component = Component.render;
|
|
var ref = workInProgress2.ref;
|
|
if ("ref" in nextProps) {
|
|
var propsWithoutRef = {};
|
|
for (var key in nextProps)
|
|
"ref" !== key && (propsWithoutRef[key] = nextProps[key]);
|
|
} else propsWithoutRef = nextProps;
|
|
prepareToReadContext(workInProgress2);
|
|
nextProps = renderWithHooks(
|
|
current2,
|
|
workInProgress2,
|
|
Component,
|
|
propsWithoutRef,
|
|
ref,
|
|
renderLanes2
|
|
);
|
|
key = checkDidRenderIdHook();
|
|
if (null !== current2 && !didReceiveUpdate)
|
|
return bailoutHooks(current2, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
isHydrating && key && pushMaterializedTreeId(workInProgress2);
|
|
workInProgress2.flags |= 1;
|
|
reconcileChildren(current2, workInProgress2, nextProps, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function updateMemoComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
|
|
if (null === current2) {
|
|
var type = Component.type;
|
|
if ("function" === typeof type && !shouldConstruct(type) && void 0 === type.defaultProps && null === Component.compare)
|
|
return Component = resolveFunctionForHotReloading(type), workInProgress2.tag = 15, workInProgress2.type = Component, validateFunctionComponentInDev(workInProgress2, type), updateSimpleMemoComponent(
|
|
current2,
|
|
workInProgress2,
|
|
Component,
|
|
nextProps,
|
|
renderLanes2
|
|
);
|
|
current2 = createFiberFromTypeAndProps(
|
|
Component.type,
|
|
null,
|
|
nextProps,
|
|
workInProgress2,
|
|
workInProgress2.mode,
|
|
renderLanes2
|
|
);
|
|
current2.ref = workInProgress2.ref;
|
|
current2.return = workInProgress2;
|
|
return workInProgress2.child = current2;
|
|
}
|
|
type = current2.child;
|
|
if (!checkScheduledUpdateOrContext(current2, renderLanes2)) {
|
|
var prevProps = type.memoizedProps;
|
|
Component = Component.compare;
|
|
Component = null !== Component ? Component : shallowEqual;
|
|
if (Component(prevProps, nextProps) && current2.ref === workInProgress2.ref)
|
|
return bailoutOnAlreadyFinishedWork(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2
|
|
);
|
|
}
|
|
workInProgress2.flags |= 1;
|
|
current2 = createWorkInProgress(type, nextProps);
|
|
current2.ref = workInProgress2.ref;
|
|
current2.return = workInProgress2;
|
|
return workInProgress2.child = current2;
|
|
}
|
|
function updateSimpleMemoComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
|
|
if (null !== current2) {
|
|
var prevProps = current2.memoizedProps;
|
|
if (shallowEqual(prevProps, nextProps) && current2.ref === workInProgress2.ref && workInProgress2.type === current2.type)
|
|
if (didReceiveUpdate = false, workInProgress2.pendingProps = nextProps = prevProps, checkScheduledUpdateOrContext(current2, renderLanes2))
|
|
0 !== (current2.flags & 131072) && (didReceiveUpdate = true);
|
|
else
|
|
return workInProgress2.lanes = current2.lanes, bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
}
|
|
return updateFunctionComponent(
|
|
current2,
|
|
workInProgress2,
|
|
Component,
|
|
nextProps,
|
|
renderLanes2
|
|
);
|
|
}
|
|
function updateOffscreenComponent(current2, workInProgress2, renderLanes2, nextProps) {
|
|
var nextChildren = nextProps.children, prevState = null !== current2 ? current2.memoizedState : null;
|
|
null === current2 && null === workInProgress2.stateNode && (workInProgress2.stateNode = {
|
|
_visibility: OffscreenVisible,
|
|
_pendingMarkers: null,
|
|
_retryCache: null,
|
|
_transitions: null
|
|
});
|
|
if ("hidden" === nextProps.mode) {
|
|
if (0 !== (workInProgress2.flags & 128)) {
|
|
prevState = null !== prevState ? prevState.baseLanes | renderLanes2 : renderLanes2;
|
|
if (null !== current2) {
|
|
nextProps = workInProgress2.child = current2.child;
|
|
for (nextChildren = 0; null !== nextProps; )
|
|
nextChildren = nextChildren | nextProps.lanes | nextProps.childLanes, nextProps = nextProps.sibling;
|
|
nextProps = nextChildren & ~prevState;
|
|
} else nextProps = 0, workInProgress2.child = null;
|
|
return deferHiddenOffscreenComponent(
|
|
current2,
|
|
workInProgress2,
|
|
prevState,
|
|
renderLanes2,
|
|
nextProps
|
|
);
|
|
}
|
|
if (0 !== (renderLanes2 & 536870912))
|
|
workInProgress2.memoizedState = { baseLanes: 0, cachePool: null }, null !== current2 && pushTransition(
|
|
workInProgress2,
|
|
null !== prevState ? prevState.cachePool : null
|
|
), null !== prevState ? pushHiddenContext(workInProgress2, prevState) : reuseHiddenContextOnStack(workInProgress2), pushOffscreenSuspenseHandler(workInProgress2);
|
|
else
|
|
return nextProps = workInProgress2.lanes = 536870912, deferHiddenOffscreenComponent(
|
|
current2,
|
|
workInProgress2,
|
|
null !== prevState ? prevState.baseLanes | renderLanes2 : renderLanes2,
|
|
renderLanes2,
|
|
nextProps
|
|
);
|
|
} else
|
|
null !== prevState ? (pushTransition(workInProgress2, prevState.cachePool), pushHiddenContext(workInProgress2, prevState), reuseSuspenseHandlerOnStack(workInProgress2), workInProgress2.memoizedState = null) : (null !== current2 && pushTransition(workInProgress2, null), reuseHiddenContextOnStack(workInProgress2), reuseSuspenseHandlerOnStack(workInProgress2));
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function bailoutOffscreenComponent(current2, workInProgress2) {
|
|
null !== current2 && 22 === current2.tag || null !== workInProgress2.stateNode || (workInProgress2.stateNode = {
|
|
_visibility: OffscreenVisible,
|
|
_pendingMarkers: null,
|
|
_retryCache: null,
|
|
_transitions: null
|
|
});
|
|
return workInProgress2.sibling;
|
|
}
|
|
function deferHiddenOffscreenComponent(current2, workInProgress2, nextBaseLanes, renderLanes2, remainingChildLanes) {
|
|
var JSCompiler_inline_result = peekCacheFromPool();
|
|
JSCompiler_inline_result = null === JSCompiler_inline_result ? null : {
|
|
parent: CacheContext._currentValue,
|
|
pool: JSCompiler_inline_result
|
|
};
|
|
workInProgress2.memoizedState = {
|
|
baseLanes: nextBaseLanes,
|
|
cachePool: JSCompiler_inline_result
|
|
};
|
|
null !== current2 && pushTransition(workInProgress2, null);
|
|
reuseHiddenContextOnStack(workInProgress2);
|
|
pushOffscreenSuspenseHandler(workInProgress2);
|
|
null !== current2 && propagateParentContextChanges(current2, workInProgress2, renderLanes2, true);
|
|
workInProgress2.childLanes = remainingChildLanes;
|
|
return null;
|
|
}
|
|
function mountActivityChildren(workInProgress2, nextProps) {
|
|
var hiddenProp = nextProps.hidden;
|
|
void 0 !== hiddenProp && console.error(
|
|
`<Activity> doesn't accept a hidden prop. Use mode="hidden" instead.
|
|
- <Activity %s>
|
|
+ <Activity %s>`,
|
|
true === hiddenProp ? "hidden" : false === hiddenProp ? "hidden={false}" : "hidden={...}",
|
|
hiddenProp ? 'mode="hidden"' : 'mode="visible"'
|
|
);
|
|
nextProps = mountWorkInProgressOffscreenFiber(
|
|
{ mode: nextProps.mode, children: nextProps.children },
|
|
workInProgress2.mode
|
|
);
|
|
nextProps.ref = workInProgress2.ref;
|
|
workInProgress2.child = nextProps;
|
|
nextProps.return = workInProgress2;
|
|
return nextProps;
|
|
}
|
|
function retryActivityComponentWithoutHydrating(current2, workInProgress2, renderLanes2) {
|
|
reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
|
|
current2 = mountActivityChildren(
|
|
workInProgress2,
|
|
workInProgress2.pendingProps
|
|
);
|
|
current2.flags |= 2;
|
|
popSuspenseHandler(workInProgress2);
|
|
workInProgress2.memoizedState = null;
|
|
return current2;
|
|
}
|
|
function updateActivityComponent(current2, workInProgress2, renderLanes2) {
|
|
var nextProps = workInProgress2.pendingProps, didSuspend = 0 !== (workInProgress2.flags & 128);
|
|
workInProgress2.flags &= -129;
|
|
if (null === current2) {
|
|
if (isHydrating) {
|
|
if ("hidden" === nextProps.mode)
|
|
return current2 = mountActivityChildren(workInProgress2, nextProps), workInProgress2.lanes = 536870912, bailoutOffscreenComponent(null, current2);
|
|
pushDehydratedActivitySuspenseHandler(workInProgress2);
|
|
(current2 = nextHydratableInstance) ? (renderLanes2 = canHydrateHydrationBoundary(
|
|
current2,
|
|
rootOrSingletonContext
|
|
), renderLanes2 = null !== renderLanes2 && renderLanes2.data === ACTIVITY_START_DATA ? renderLanes2 : null, null !== renderLanes2 && (nextProps = {
|
|
dehydrated: renderLanes2,
|
|
treeContext: getSuspendedTreeContext(),
|
|
retryLane: 536870912,
|
|
hydrationErrors: null
|
|
}, workInProgress2.memoizedState = nextProps, nextProps = createFiberFromDehydratedFragment(renderLanes2), nextProps.return = workInProgress2, workInProgress2.child = nextProps, hydrationParentFiber = workInProgress2, nextHydratableInstance = null)) : renderLanes2 = null;
|
|
if (null === renderLanes2)
|
|
throw warnNonHydratedInstance(workInProgress2, current2), throwOnHydrationMismatch(workInProgress2);
|
|
workInProgress2.lanes = 536870912;
|
|
return null;
|
|
}
|
|
return mountActivityChildren(workInProgress2, nextProps);
|
|
}
|
|
var prevState = current2.memoizedState;
|
|
if (null !== prevState) {
|
|
var activityInstance = prevState.dehydrated;
|
|
pushDehydratedActivitySuspenseHandler(workInProgress2);
|
|
if (didSuspend)
|
|
if (workInProgress2.flags & 256)
|
|
workInProgress2.flags &= -257, workInProgress2 = retryActivityComponentWithoutHydrating(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2
|
|
);
|
|
else if (null !== workInProgress2.memoizedState)
|
|
workInProgress2.child = current2.child, workInProgress2.flags |= 128, workInProgress2 = null;
|
|
else
|
|
throw Error(
|
|
"Client rendering an Activity suspended it again. This is a bug in React."
|
|
);
|
|
else if (warnIfHydrating(), 0 !== (renderLanes2 & 536870912) && markRenderDerivedCause(workInProgress2), didReceiveUpdate || propagateParentContextChanges(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2,
|
|
false
|
|
), didSuspend = 0 !== (renderLanes2 & current2.childLanes), didReceiveUpdate || didSuspend) {
|
|
nextProps = workInProgressRoot;
|
|
if (null !== nextProps && (activityInstance = getBumpedLaneForHydration(
|
|
nextProps,
|
|
renderLanes2
|
|
), 0 !== activityInstance && activityInstance !== prevState.retryLane))
|
|
throw prevState.retryLane = activityInstance, enqueueConcurrentRenderForLane(current2, activityInstance), scheduleUpdateOnFiber(nextProps, current2, activityInstance), SelectiveHydrationException;
|
|
renderDidSuspendDelayIfPossible();
|
|
workInProgress2 = retryActivityComponentWithoutHydrating(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2
|
|
);
|
|
} else
|
|
current2 = prevState.treeContext, nextHydratableInstance = getNextHydratable(
|
|
activityInstance.nextSibling
|
|
), hydrationParentFiber = workInProgress2, isHydrating = true, hydrationErrors = null, didSuspendOrErrorDEV = false, hydrationDiffRootDEV = null, rootOrSingletonContext = false, null !== current2 && restoreSuspendedTreeContext(workInProgress2, current2), workInProgress2 = mountActivityChildren(workInProgress2, nextProps), workInProgress2.flags |= 4096;
|
|
return workInProgress2;
|
|
}
|
|
prevState = current2.child;
|
|
nextProps = { mode: nextProps.mode, children: nextProps.children };
|
|
0 !== (renderLanes2 & 536870912) && 0 !== (renderLanes2 & current2.lanes) && markRenderDerivedCause(workInProgress2);
|
|
current2 = createWorkInProgress(prevState, nextProps);
|
|
current2.ref = workInProgress2.ref;
|
|
workInProgress2.child = current2;
|
|
current2.return = workInProgress2;
|
|
return current2;
|
|
}
|
|
function markRef(current2, workInProgress2) {
|
|
var ref = workInProgress2.ref;
|
|
if (null === ref)
|
|
null !== current2 && null !== current2.ref && (workInProgress2.flags |= 4194816);
|
|
else {
|
|
if ("function" !== typeof ref && "object" !== typeof ref)
|
|
throw Error(
|
|
"Expected ref to be a function, an object returned by React.createRef(), or undefined/null."
|
|
);
|
|
if (null === current2 || current2.ref !== ref)
|
|
workInProgress2.flags |= 4194816;
|
|
}
|
|
}
|
|
function updateFunctionComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
|
|
if (Component.prototype && "function" === typeof Component.prototype.render) {
|
|
var componentName2 = getComponentNameFromType(Component) || "Unknown";
|
|
didWarnAboutBadClass[componentName2] || (console.error(
|
|
"The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",
|
|
componentName2,
|
|
componentName2
|
|
), didWarnAboutBadClass[componentName2] = true);
|
|
}
|
|
workInProgress2.mode & StrictLegacyMode && ReactStrictModeWarnings.recordLegacyContextWarning(
|
|
workInProgress2,
|
|
null
|
|
);
|
|
null === current2 && (validateFunctionComponentInDev(workInProgress2, workInProgress2.type), Component.contextTypes && (componentName2 = getComponentNameFromType(Component) || "Unknown", didWarnAboutContextTypes[componentName2] || (didWarnAboutContextTypes[componentName2] = true, console.error(
|
|
"%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)",
|
|
componentName2
|
|
))));
|
|
prepareToReadContext(workInProgress2);
|
|
Component = renderWithHooks(
|
|
current2,
|
|
workInProgress2,
|
|
Component,
|
|
nextProps,
|
|
void 0,
|
|
renderLanes2
|
|
);
|
|
nextProps = checkDidRenderIdHook();
|
|
if (null !== current2 && !didReceiveUpdate)
|
|
return bailoutHooks(current2, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
isHydrating && nextProps && pushMaterializedTreeId(workInProgress2);
|
|
workInProgress2.flags |= 1;
|
|
reconcileChildren(current2, workInProgress2, Component, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function replayFunctionComponent(current2, workInProgress2, nextProps, Component, secondArg, renderLanes2) {
|
|
prepareToReadContext(workInProgress2);
|
|
hookTypesUpdateIndexDev = -1;
|
|
ignorePreviousDependencies = null !== current2 && current2.type !== workInProgress2.type;
|
|
workInProgress2.updateQueue = null;
|
|
nextProps = renderWithHooksAgain(
|
|
workInProgress2,
|
|
Component,
|
|
nextProps,
|
|
secondArg
|
|
);
|
|
finishRenderingHooks(current2, workInProgress2);
|
|
Component = checkDidRenderIdHook();
|
|
if (null !== current2 && !didReceiveUpdate)
|
|
return bailoutHooks(current2, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
isHydrating && Component && pushMaterializedTreeId(workInProgress2);
|
|
workInProgress2.flags |= 1;
|
|
reconcileChildren(current2, workInProgress2, nextProps, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function updateClassComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
|
|
switch (shouldErrorImpl(workInProgress2)) {
|
|
case false:
|
|
var _instance = workInProgress2.stateNode, state = new workInProgress2.type(
|
|
workInProgress2.memoizedProps,
|
|
_instance.context
|
|
).state;
|
|
_instance.updater.enqueueSetState(_instance, state, null);
|
|
break;
|
|
case true:
|
|
workInProgress2.flags |= 128;
|
|
workInProgress2.flags |= 65536;
|
|
_instance = Error("Simulated error coming from DevTools");
|
|
var lane = renderLanes2 & -renderLanes2;
|
|
workInProgress2.lanes |= lane;
|
|
state = workInProgressRoot;
|
|
if (null === state)
|
|
throw Error(
|
|
"Expected a work-in-progress root. This is a bug in React. Please file an issue."
|
|
);
|
|
lane = createClassErrorUpdate(lane);
|
|
initializeClassErrorUpdate(
|
|
lane,
|
|
state,
|
|
workInProgress2,
|
|
createCapturedValueAtFiber(_instance, workInProgress2)
|
|
);
|
|
enqueueCapturedUpdate(workInProgress2, lane);
|
|
}
|
|
prepareToReadContext(workInProgress2);
|
|
if (null === workInProgress2.stateNode) {
|
|
state = emptyContextObject;
|
|
_instance = Component.contextType;
|
|
"contextType" in Component && null !== _instance && (void 0 === _instance || _instance.$$typeof !== REACT_CONTEXT_TYPE) && !didWarnAboutInvalidateContextType.has(Component) && (didWarnAboutInvalidateContextType.add(Component), lane = void 0 === _instance ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." : "object" !== typeof _instance ? " However, it is set to a " + typeof _instance + "." : _instance.$$typeof === REACT_CONSUMER_TYPE ? " Did you accidentally pass the Context.Consumer instead?" : " However, it is set to an object with keys {" + Object.keys(_instance).join(", ") + "}.", console.error(
|
|
"%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",
|
|
getComponentNameFromType(Component) || "Component",
|
|
lane
|
|
));
|
|
"object" === typeof _instance && null !== _instance && (state = readContext(_instance));
|
|
_instance = new Component(nextProps, state);
|
|
if (workInProgress2.mode & StrictLegacyMode) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
_instance = new Component(nextProps, state);
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
state = workInProgress2.memoizedState = null !== _instance.state && void 0 !== _instance.state ? _instance.state : null;
|
|
_instance.updater = classComponentUpdater;
|
|
workInProgress2.stateNode = _instance;
|
|
_instance._reactInternals = workInProgress2;
|
|
_instance._reactInternalInstance = fakeInternalInstance;
|
|
"function" === typeof Component.getDerivedStateFromProps && null === state && (state = getComponentNameFromType(Component) || "Component", didWarnAboutUninitializedState.has(state) || (didWarnAboutUninitializedState.add(state), console.error(
|
|
"`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",
|
|
state,
|
|
null === _instance.state ? "null" : "undefined",
|
|
state
|
|
)));
|
|
if ("function" === typeof Component.getDerivedStateFromProps || "function" === typeof _instance.getSnapshotBeforeUpdate) {
|
|
var foundWillUpdateName = lane = state = null;
|
|
"function" === typeof _instance.componentWillMount && true !== _instance.componentWillMount.__suppressDeprecationWarning ? state = "componentWillMount" : "function" === typeof _instance.UNSAFE_componentWillMount && (state = "UNSAFE_componentWillMount");
|
|
"function" === typeof _instance.componentWillReceiveProps && true !== _instance.componentWillReceiveProps.__suppressDeprecationWarning ? lane = "componentWillReceiveProps" : "function" === typeof _instance.UNSAFE_componentWillReceiveProps && (lane = "UNSAFE_componentWillReceiveProps");
|
|
"function" === typeof _instance.componentWillUpdate && true !== _instance.componentWillUpdate.__suppressDeprecationWarning ? foundWillUpdateName = "componentWillUpdate" : "function" === typeof _instance.UNSAFE_componentWillUpdate && (foundWillUpdateName = "UNSAFE_componentWillUpdate");
|
|
if (null !== state || null !== lane || null !== foundWillUpdateName) {
|
|
_instance = getComponentNameFromType(Component) || "Component";
|
|
var newApiName = "function" === typeof Component.getDerivedStateFromProps ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
|
|
didWarnAboutLegacyLifecyclesAndDerivedState.has(_instance) || (didWarnAboutLegacyLifecyclesAndDerivedState.add(_instance), console.error(
|
|
"Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles",
|
|
_instance,
|
|
newApiName,
|
|
null !== state ? "\n " + state : "",
|
|
null !== lane ? "\n " + lane : "",
|
|
null !== foundWillUpdateName ? "\n " + foundWillUpdateName : ""
|
|
));
|
|
}
|
|
}
|
|
_instance = workInProgress2.stateNode;
|
|
state = getComponentNameFromType(Component) || "Component";
|
|
_instance.render || (Component.prototype && "function" === typeof Component.prototype.render ? console.error(
|
|
"No `render` method found on the %s instance: did you accidentally return an object from the constructor?",
|
|
state
|
|
) : console.error(
|
|
"No `render` method found on the %s instance: you may have forgotten to define `render`.",
|
|
state
|
|
));
|
|
!_instance.getInitialState || _instance.getInitialState.isReactClassApproved || _instance.state || console.error(
|
|
"getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",
|
|
state
|
|
);
|
|
_instance.getDefaultProps && !_instance.getDefaultProps.isReactClassApproved && console.error(
|
|
"getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",
|
|
state
|
|
);
|
|
_instance.contextType && console.error(
|
|
"contextType was defined as an instance property on %s. Use a static property to define contextType instead.",
|
|
state
|
|
);
|
|
Component.childContextTypes && !didWarnAboutChildContextTypes.has(Component) && (didWarnAboutChildContextTypes.add(Component), console.error(
|
|
"%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",
|
|
state
|
|
));
|
|
Component.contextTypes && !didWarnAboutContextTypes$1.has(Component) && (didWarnAboutContextTypes$1.add(Component), console.error(
|
|
"%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)",
|
|
state
|
|
));
|
|
"function" === typeof _instance.componentShouldUpdate && console.error(
|
|
"%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",
|
|
state
|
|
);
|
|
Component.prototype && Component.prototype.isPureReactComponent && "undefined" !== typeof _instance.shouldComponentUpdate && console.error(
|
|
"%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",
|
|
getComponentNameFromType(Component) || "A pure component"
|
|
);
|
|
"function" === typeof _instance.componentDidUnmount && console.error(
|
|
"%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",
|
|
state
|
|
);
|
|
"function" === typeof _instance.componentDidReceiveProps && console.error(
|
|
"%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",
|
|
state
|
|
);
|
|
"function" === typeof _instance.componentWillRecieveProps && console.error(
|
|
"%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",
|
|
state
|
|
);
|
|
"function" === typeof _instance.UNSAFE_componentWillRecieveProps && console.error(
|
|
"%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",
|
|
state
|
|
);
|
|
lane = _instance.props !== nextProps;
|
|
void 0 !== _instance.props && lane && console.error(
|
|
"When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",
|
|
state
|
|
);
|
|
_instance.defaultProps && console.error(
|
|
"Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",
|
|
state,
|
|
state
|
|
);
|
|
"function" !== typeof _instance.getSnapshotBeforeUpdate || "function" === typeof _instance.componentDidUpdate || didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) || (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component), console.error(
|
|
"%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",
|
|
getComponentNameFromType(Component)
|
|
));
|
|
"function" === typeof _instance.getDerivedStateFromProps && console.error(
|
|
"%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",
|
|
state
|
|
);
|
|
"function" === typeof _instance.getDerivedStateFromError && console.error(
|
|
"%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",
|
|
state
|
|
);
|
|
"function" === typeof Component.getSnapshotBeforeUpdate && console.error(
|
|
"%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",
|
|
state
|
|
);
|
|
(lane = _instance.state) && ("object" !== typeof lane || isArrayImpl(lane)) && console.error("%s.state: must be set to an object or null", state);
|
|
"function" === typeof _instance.getChildContext && "object" !== typeof Component.childContextTypes && console.error(
|
|
"%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",
|
|
state
|
|
);
|
|
_instance = workInProgress2.stateNode;
|
|
_instance.props = nextProps;
|
|
_instance.state = workInProgress2.memoizedState;
|
|
_instance.refs = {};
|
|
initializeUpdateQueue(workInProgress2);
|
|
state = Component.contextType;
|
|
_instance.context = "object" === typeof state && null !== state ? readContext(state) : emptyContextObject;
|
|
_instance.state === nextProps && (state = getComponentNameFromType(Component) || "Component", didWarnAboutDirectlyAssigningPropsToState.has(state) || (didWarnAboutDirectlyAssigningPropsToState.add(state), console.error(
|
|
"%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",
|
|
state
|
|
)));
|
|
workInProgress2.mode & StrictLegacyMode && ReactStrictModeWarnings.recordLegacyContextWarning(
|
|
workInProgress2,
|
|
_instance
|
|
);
|
|
ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(
|
|
workInProgress2,
|
|
_instance
|
|
);
|
|
_instance.state = workInProgress2.memoizedState;
|
|
state = Component.getDerivedStateFromProps;
|
|
"function" === typeof state && (applyDerivedStateFromProps(
|
|
workInProgress2,
|
|
Component,
|
|
state,
|
|
nextProps
|
|
), _instance.state = workInProgress2.memoizedState);
|
|
"function" === typeof Component.getDerivedStateFromProps || "function" === typeof _instance.getSnapshotBeforeUpdate || "function" !== typeof _instance.UNSAFE_componentWillMount && "function" !== typeof _instance.componentWillMount || (state = _instance.state, "function" === typeof _instance.componentWillMount && _instance.componentWillMount(), "function" === typeof _instance.UNSAFE_componentWillMount && _instance.UNSAFE_componentWillMount(), state !== _instance.state && (console.error(
|
|
"%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",
|
|
getComponentNameFromFiber(workInProgress2) || "Component"
|
|
), classComponentUpdater.enqueueReplaceState(
|
|
_instance,
|
|
_instance.state,
|
|
null
|
|
)), processUpdateQueue(workInProgress2, nextProps, _instance, renderLanes2), suspendIfUpdateReadFromEntangledAsyncAction(), _instance.state = workInProgress2.memoizedState);
|
|
"function" === typeof _instance.componentDidMount && (workInProgress2.flags |= 4194308);
|
|
(workInProgress2.mode & StrictEffectsMode) !== NoMode && (workInProgress2.flags |= 134217728);
|
|
_instance = true;
|
|
} else if (null === current2) {
|
|
_instance = workInProgress2.stateNode;
|
|
var unresolvedOldProps = workInProgress2.memoizedProps;
|
|
lane = resolveClassComponentProps(Component, unresolvedOldProps);
|
|
_instance.props = lane;
|
|
var oldContext = _instance.context;
|
|
foundWillUpdateName = Component.contextType;
|
|
state = emptyContextObject;
|
|
"object" === typeof foundWillUpdateName && null !== foundWillUpdateName && (state = readContext(foundWillUpdateName));
|
|
newApiName = Component.getDerivedStateFromProps;
|
|
foundWillUpdateName = "function" === typeof newApiName || "function" === typeof _instance.getSnapshotBeforeUpdate;
|
|
unresolvedOldProps = workInProgress2.pendingProps !== unresolvedOldProps;
|
|
foundWillUpdateName || "function" !== typeof _instance.UNSAFE_componentWillReceiveProps && "function" !== typeof _instance.componentWillReceiveProps || (unresolvedOldProps || oldContext !== state) && callComponentWillReceiveProps(
|
|
workInProgress2,
|
|
_instance,
|
|
nextProps,
|
|
state
|
|
);
|
|
hasForceUpdate = false;
|
|
var oldState = workInProgress2.memoizedState;
|
|
_instance.state = oldState;
|
|
processUpdateQueue(workInProgress2, nextProps, _instance, renderLanes2);
|
|
suspendIfUpdateReadFromEntangledAsyncAction();
|
|
oldContext = workInProgress2.memoizedState;
|
|
unresolvedOldProps || oldState !== oldContext || hasForceUpdate ? ("function" === typeof newApiName && (applyDerivedStateFromProps(
|
|
workInProgress2,
|
|
Component,
|
|
newApiName,
|
|
nextProps
|
|
), oldContext = workInProgress2.memoizedState), (lane = hasForceUpdate || checkShouldComponentUpdate(
|
|
workInProgress2,
|
|
Component,
|
|
lane,
|
|
nextProps,
|
|
oldState,
|
|
oldContext,
|
|
state
|
|
)) ? (foundWillUpdateName || "function" !== typeof _instance.UNSAFE_componentWillMount && "function" !== typeof _instance.componentWillMount || ("function" === typeof _instance.componentWillMount && _instance.componentWillMount(), "function" === typeof _instance.UNSAFE_componentWillMount && _instance.UNSAFE_componentWillMount()), "function" === typeof _instance.componentDidMount && (workInProgress2.flags |= 4194308), (workInProgress2.mode & StrictEffectsMode) !== NoMode && (workInProgress2.flags |= 134217728)) : ("function" === typeof _instance.componentDidMount && (workInProgress2.flags |= 4194308), (workInProgress2.mode & StrictEffectsMode) !== NoMode && (workInProgress2.flags |= 134217728), workInProgress2.memoizedProps = nextProps, workInProgress2.memoizedState = oldContext), _instance.props = nextProps, _instance.state = oldContext, _instance.context = state, _instance = lane) : ("function" === typeof _instance.componentDidMount && (workInProgress2.flags |= 4194308), (workInProgress2.mode & StrictEffectsMode) !== NoMode && (workInProgress2.flags |= 134217728), _instance = false);
|
|
} else {
|
|
_instance = workInProgress2.stateNode;
|
|
cloneUpdateQueue(current2, workInProgress2);
|
|
state = workInProgress2.memoizedProps;
|
|
foundWillUpdateName = resolveClassComponentProps(Component, state);
|
|
_instance.props = foundWillUpdateName;
|
|
newApiName = workInProgress2.pendingProps;
|
|
oldState = _instance.context;
|
|
oldContext = Component.contextType;
|
|
lane = emptyContextObject;
|
|
"object" === typeof oldContext && null !== oldContext && (lane = readContext(oldContext));
|
|
unresolvedOldProps = Component.getDerivedStateFromProps;
|
|
(oldContext = "function" === typeof unresolvedOldProps || "function" === typeof _instance.getSnapshotBeforeUpdate) || "function" !== typeof _instance.UNSAFE_componentWillReceiveProps && "function" !== typeof _instance.componentWillReceiveProps || (state !== newApiName || oldState !== lane) && callComponentWillReceiveProps(
|
|
workInProgress2,
|
|
_instance,
|
|
nextProps,
|
|
lane
|
|
);
|
|
hasForceUpdate = false;
|
|
oldState = workInProgress2.memoizedState;
|
|
_instance.state = oldState;
|
|
processUpdateQueue(workInProgress2, nextProps, _instance, renderLanes2);
|
|
suspendIfUpdateReadFromEntangledAsyncAction();
|
|
var newState = workInProgress2.memoizedState;
|
|
state !== newApiName || oldState !== newState || hasForceUpdate || null !== current2 && null !== current2.dependencies && checkIfContextChanged(current2.dependencies) ? ("function" === typeof unresolvedOldProps && (applyDerivedStateFromProps(
|
|
workInProgress2,
|
|
Component,
|
|
unresolvedOldProps,
|
|
nextProps
|
|
), newState = workInProgress2.memoizedState), (foundWillUpdateName = hasForceUpdate || checkShouldComponentUpdate(
|
|
workInProgress2,
|
|
Component,
|
|
foundWillUpdateName,
|
|
nextProps,
|
|
oldState,
|
|
newState,
|
|
lane
|
|
) || null !== current2 && null !== current2.dependencies && checkIfContextChanged(current2.dependencies)) ? (oldContext || "function" !== typeof _instance.UNSAFE_componentWillUpdate && "function" !== typeof _instance.componentWillUpdate || ("function" === typeof _instance.componentWillUpdate && _instance.componentWillUpdate(nextProps, newState, lane), "function" === typeof _instance.UNSAFE_componentWillUpdate && _instance.UNSAFE_componentWillUpdate(
|
|
nextProps,
|
|
newState,
|
|
lane
|
|
)), "function" === typeof _instance.componentDidUpdate && (workInProgress2.flags |= 4), "function" === typeof _instance.getSnapshotBeforeUpdate && (workInProgress2.flags |= 1024)) : ("function" !== typeof _instance.componentDidUpdate || state === current2.memoizedProps && oldState === current2.memoizedState || (workInProgress2.flags |= 4), "function" !== typeof _instance.getSnapshotBeforeUpdate || state === current2.memoizedProps && oldState === current2.memoizedState || (workInProgress2.flags |= 1024), workInProgress2.memoizedProps = nextProps, workInProgress2.memoizedState = newState), _instance.props = nextProps, _instance.state = newState, _instance.context = lane, _instance = foundWillUpdateName) : ("function" !== typeof _instance.componentDidUpdate || state === current2.memoizedProps && oldState === current2.memoizedState || (workInProgress2.flags |= 4), "function" !== typeof _instance.getSnapshotBeforeUpdate || state === current2.memoizedProps && oldState === current2.memoizedState || (workInProgress2.flags |= 1024), _instance = false);
|
|
}
|
|
lane = _instance;
|
|
markRef(current2, workInProgress2);
|
|
state = 0 !== (workInProgress2.flags & 128);
|
|
if (lane || state) {
|
|
lane = workInProgress2.stateNode;
|
|
setCurrentFiber(workInProgress2);
|
|
if (state && "function" !== typeof Component.getDerivedStateFromError)
|
|
Component = null, profilerStartTime = -1;
|
|
else if (Component = callRenderInDEV(lane), workInProgress2.mode & StrictLegacyMode) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
callRenderInDEV(lane);
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
workInProgress2.flags |= 1;
|
|
null !== current2 && state ? (workInProgress2.child = reconcileChildFibers(
|
|
workInProgress2,
|
|
current2.child,
|
|
null,
|
|
renderLanes2
|
|
), workInProgress2.child = reconcileChildFibers(
|
|
workInProgress2,
|
|
null,
|
|
Component,
|
|
renderLanes2
|
|
)) : reconcileChildren(current2, workInProgress2, Component, renderLanes2);
|
|
workInProgress2.memoizedState = lane.state;
|
|
current2 = workInProgress2.child;
|
|
} else
|
|
current2 = bailoutOnAlreadyFinishedWork(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2
|
|
);
|
|
renderLanes2 = workInProgress2.stateNode;
|
|
_instance && renderLanes2.props !== nextProps && (didWarnAboutReassigningProps || console.error(
|
|
"It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",
|
|
getComponentNameFromFiber(workInProgress2) || "a component"
|
|
), didWarnAboutReassigningProps = true);
|
|
return current2;
|
|
}
|
|
function mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2) {
|
|
resetHydrationState();
|
|
workInProgress2.flags |= 256;
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function validateFunctionComponentInDev(workInProgress2, Component) {
|
|
Component && Component.childContextTypes && console.error(
|
|
"childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...",
|
|
Component.displayName || Component.name || "Component"
|
|
);
|
|
"function" === typeof Component.getDerivedStateFromProps && (workInProgress2 = getComponentNameFromType(Component) || "Unknown", didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress2] || (console.error(
|
|
"%s: Function components do not support getDerivedStateFromProps.",
|
|
workInProgress2
|
|
), didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress2] = true));
|
|
"object" === typeof Component.contextType && null !== Component.contextType && (Component = getComponentNameFromType(Component) || "Unknown", didWarnAboutContextTypeOnFunctionComponent[Component] || (console.error(
|
|
"%s: Function components do not support contextType.",
|
|
Component
|
|
), didWarnAboutContextTypeOnFunctionComponent[Component] = true));
|
|
}
|
|
function mountSuspenseOffscreenState(renderLanes2) {
|
|
return { baseLanes: renderLanes2, cachePool: getSuspendedCache() };
|
|
}
|
|
function getRemainingWorkInPrimaryTree(current2, primaryTreeDidDefer, renderLanes2) {
|
|
current2 = null !== current2 ? current2.childLanes & ~renderLanes2 : 0;
|
|
primaryTreeDidDefer && (current2 |= workInProgressDeferredLane);
|
|
return current2;
|
|
}
|
|
function updateSuspenseComponent(current2, workInProgress2, renderLanes2) {
|
|
var JSCompiler_object_inline_digest_2724;
|
|
var JSCompiler_object_inline_stack_2725 = workInProgress2.pendingProps;
|
|
shouldSuspendImpl(workInProgress2) && (workInProgress2.flags |= 128);
|
|
var JSCompiler_object_inline_message_2723 = false;
|
|
var didSuspend = 0 !== (workInProgress2.flags & 128);
|
|
(JSCompiler_object_inline_digest_2724 = didSuspend) || (JSCompiler_object_inline_digest_2724 = null !== current2 && null === current2.memoizedState ? false : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback));
|
|
JSCompiler_object_inline_digest_2724 && (JSCompiler_object_inline_message_2723 = true, workInProgress2.flags &= -129);
|
|
JSCompiler_object_inline_digest_2724 = 0 !== (workInProgress2.flags & 32);
|
|
workInProgress2.flags &= -33;
|
|
if (null === current2) {
|
|
if (isHydrating) {
|
|
JSCompiler_object_inline_message_2723 ? pushPrimaryTreeSuspenseHandler(workInProgress2) : reuseSuspenseHandlerOnStack(workInProgress2);
|
|
(current2 = nextHydratableInstance) ? (renderLanes2 = canHydrateHydrationBoundary(
|
|
current2,
|
|
rootOrSingletonContext
|
|
), renderLanes2 = null !== renderLanes2 && renderLanes2.data !== ACTIVITY_START_DATA ? renderLanes2 : null, null !== renderLanes2 && (JSCompiler_object_inline_digest_2724 = {
|
|
dehydrated: renderLanes2,
|
|
treeContext: getSuspendedTreeContext(),
|
|
retryLane: 536870912,
|
|
hydrationErrors: null
|
|
}, workInProgress2.memoizedState = JSCompiler_object_inline_digest_2724, JSCompiler_object_inline_digest_2724 = createFiberFromDehydratedFragment(renderLanes2), JSCompiler_object_inline_digest_2724.return = workInProgress2, workInProgress2.child = JSCompiler_object_inline_digest_2724, hydrationParentFiber = workInProgress2, nextHydratableInstance = null)) : renderLanes2 = null;
|
|
if (null === renderLanes2)
|
|
throw warnNonHydratedInstance(workInProgress2, current2), throwOnHydrationMismatch(workInProgress2);
|
|
isSuspenseInstanceFallback(renderLanes2) ? workInProgress2.lanes = 32 : workInProgress2.lanes = 536870912;
|
|
return null;
|
|
}
|
|
var nextPrimaryChildren = JSCompiler_object_inline_stack_2725.children;
|
|
JSCompiler_object_inline_stack_2725 = JSCompiler_object_inline_stack_2725.fallback;
|
|
if (JSCompiler_object_inline_message_2723) {
|
|
reuseSuspenseHandlerOnStack(workInProgress2);
|
|
var mode = workInProgress2.mode;
|
|
nextPrimaryChildren = mountWorkInProgressOffscreenFiber(
|
|
{ mode: "hidden", children: nextPrimaryChildren },
|
|
mode
|
|
);
|
|
JSCompiler_object_inline_stack_2725 = createFiberFromFragment(
|
|
JSCompiler_object_inline_stack_2725,
|
|
mode,
|
|
renderLanes2,
|
|
null
|
|
);
|
|
nextPrimaryChildren.return = workInProgress2;
|
|
JSCompiler_object_inline_stack_2725.return = workInProgress2;
|
|
nextPrimaryChildren.sibling = JSCompiler_object_inline_stack_2725;
|
|
workInProgress2.child = nextPrimaryChildren;
|
|
JSCompiler_object_inline_stack_2725 = workInProgress2.child;
|
|
JSCompiler_object_inline_stack_2725.memoizedState = mountSuspenseOffscreenState(renderLanes2);
|
|
JSCompiler_object_inline_stack_2725.childLanes = getRemainingWorkInPrimaryTree(
|
|
current2,
|
|
JSCompiler_object_inline_digest_2724,
|
|
renderLanes2
|
|
);
|
|
workInProgress2.memoizedState = SUSPENDED_MARKER;
|
|
return bailoutOffscreenComponent(
|
|
null,
|
|
JSCompiler_object_inline_stack_2725
|
|
);
|
|
}
|
|
pushPrimaryTreeSuspenseHandler(workInProgress2);
|
|
return mountSuspensePrimaryChildren(
|
|
workInProgress2,
|
|
nextPrimaryChildren
|
|
);
|
|
}
|
|
var prevState = current2.memoizedState;
|
|
if (null !== prevState) {
|
|
var JSCompiler_object_inline_componentStack_2726 = prevState.dehydrated;
|
|
if (null !== JSCompiler_object_inline_componentStack_2726) {
|
|
if (didSuspend)
|
|
workInProgress2.flags & 256 ? (pushPrimaryTreeSuspenseHandler(workInProgress2), workInProgress2.flags &= -257, workInProgress2 = retrySuspenseComponentWithoutHydrating(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2
|
|
)) : null !== workInProgress2.memoizedState ? (reuseSuspenseHandlerOnStack(workInProgress2), workInProgress2.child = current2.child, workInProgress2.flags |= 128, workInProgress2 = null) : (reuseSuspenseHandlerOnStack(workInProgress2), nextPrimaryChildren = JSCompiler_object_inline_stack_2725.fallback, mode = workInProgress2.mode, JSCompiler_object_inline_stack_2725 = mountWorkInProgressOffscreenFiber(
|
|
{
|
|
mode: "visible",
|
|
children: JSCompiler_object_inline_stack_2725.children
|
|
},
|
|
mode
|
|
), nextPrimaryChildren = createFiberFromFragment(
|
|
nextPrimaryChildren,
|
|
mode,
|
|
renderLanes2,
|
|
null
|
|
), nextPrimaryChildren.flags |= 2, JSCompiler_object_inline_stack_2725.return = workInProgress2, nextPrimaryChildren.return = workInProgress2, JSCompiler_object_inline_stack_2725.sibling = nextPrimaryChildren, workInProgress2.child = JSCompiler_object_inline_stack_2725, reconcileChildFibers(
|
|
workInProgress2,
|
|
current2.child,
|
|
null,
|
|
renderLanes2
|
|
), JSCompiler_object_inline_stack_2725 = workInProgress2.child, JSCompiler_object_inline_stack_2725.memoizedState = mountSuspenseOffscreenState(renderLanes2), JSCompiler_object_inline_stack_2725.childLanes = getRemainingWorkInPrimaryTree(
|
|
current2,
|
|
JSCompiler_object_inline_digest_2724,
|
|
renderLanes2
|
|
), workInProgress2.memoizedState = SUSPENDED_MARKER, workInProgress2 = bailoutOffscreenComponent(
|
|
null,
|
|
JSCompiler_object_inline_stack_2725
|
|
));
|
|
else if (pushPrimaryTreeSuspenseHandler(workInProgress2), warnIfHydrating(), 0 !== (renderLanes2 & 536870912) && markRenderDerivedCause(workInProgress2), isSuspenseInstanceFallback(
|
|
JSCompiler_object_inline_componentStack_2726
|
|
)) {
|
|
JSCompiler_object_inline_digest_2724 = JSCompiler_object_inline_componentStack_2726.nextSibling && JSCompiler_object_inline_componentStack_2726.nextSibling.dataset;
|
|
if (JSCompiler_object_inline_digest_2724) {
|
|
nextPrimaryChildren = JSCompiler_object_inline_digest_2724.dgst;
|
|
var message = JSCompiler_object_inline_digest_2724.msg;
|
|
mode = JSCompiler_object_inline_digest_2724.stck;
|
|
var componentStack = JSCompiler_object_inline_digest_2724.cstck;
|
|
}
|
|
JSCompiler_object_inline_message_2723 = message;
|
|
JSCompiler_object_inline_digest_2724 = nextPrimaryChildren;
|
|
JSCompiler_object_inline_stack_2725 = mode;
|
|
JSCompiler_object_inline_componentStack_2726 = componentStack;
|
|
nextPrimaryChildren = JSCompiler_object_inline_message_2723;
|
|
mode = JSCompiler_object_inline_componentStack_2726;
|
|
nextPrimaryChildren = nextPrimaryChildren ? Error(nextPrimaryChildren) : Error(
|
|
"The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."
|
|
);
|
|
nextPrimaryChildren.stack = JSCompiler_object_inline_stack_2725 || "";
|
|
nextPrimaryChildren.digest = JSCompiler_object_inline_digest_2724;
|
|
JSCompiler_object_inline_digest_2724 = void 0 === mode ? null : mode;
|
|
JSCompiler_object_inline_stack_2725 = {
|
|
value: nextPrimaryChildren,
|
|
source: null,
|
|
stack: JSCompiler_object_inline_digest_2724
|
|
};
|
|
"string" === typeof JSCompiler_object_inline_digest_2724 && CapturedStacks.set(
|
|
nextPrimaryChildren,
|
|
JSCompiler_object_inline_stack_2725
|
|
);
|
|
queueHydrationError(JSCompiler_object_inline_stack_2725);
|
|
workInProgress2 = retrySuspenseComponentWithoutHydrating(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2
|
|
);
|
|
} else if (didReceiveUpdate || propagateParentContextChanges(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2,
|
|
false
|
|
), JSCompiler_object_inline_digest_2724 = 0 !== (renderLanes2 & current2.childLanes), didReceiveUpdate || JSCompiler_object_inline_digest_2724) {
|
|
JSCompiler_object_inline_digest_2724 = workInProgressRoot;
|
|
if (null !== JSCompiler_object_inline_digest_2724 && (JSCompiler_object_inline_stack_2725 = getBumpedLaneForHydration(
|
|
JSCompiler_object_inline_digest_2724,
|
|
renderLanes2
|
|
), 0 !== JSCompiler_object_inline_stack_2725 && JSCompiler_object_inline_stack_2725 !== prevState.retryLane))
|
|
throw prevState.retryLane = JSCompiler_object_inline_stack_2725, enqueueConcurrentRenderForLane(
|
|
current2,
|
|
JSCompiler_object_inline_stack_2725
|
|
), scheduleUpdateOnFiber(
|
|
JSCompiler_object_inline_digest_2724,
|
|
current2,
|
|
JSCompiler_object_inline_stack_2725
|
|
), SelectiveHydrationException;
|
|
isSuspenseInstancePending(
|
|
JSCompiler_object_inline_componentStack_2726
|
|
) || renderDidSuspendDelayIfPossible();
|
|
workInProgress2 = retrySuspenseComponentWithoutHydrating(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2
|
|
);
|
|
} else
|
|
isSuspenseInstancePending(
|
|
JSCompiler_object_inline_componentStack_2726
|
|
) ? (workInProgress2.flags |= 192, workInProgress2.child = current2.child, workInProgress2 = null) : (current2 = prevState.treeContext, nextHydratableInstance = getNextHydratable(
|
|
JSCompiler_object_inline_componentStack_2726.nextSibling
|
|
), hydrationParentFiber = workInProgress2, isHydrating = true, hydrationErrors = null, didSuspendOrErrorDEV = false, hydrationDiffRootDEV = null, rootOrSingletonContext = false, null !== current2 && restoreSuspendedTreeContext(workInProgress2, current2), workInProgress2 = mountSuspensePrimaryChildren(
|
|
workInProgress2,
|
|
JSCompiler_object_inline_stack_2725.children
|
|
), workInProgress2.flags |= 4096);
|
|
return workInProgress2;
|
|
}
|
|
}
|
|
if (JSCompiler_object_inline_message_2723)
|
|
return reuseSuspenseHandlerOnStack(workInProgress2), nextPrimaryChildren = JSCompiler_object_inline_stack_2725.fallback, mode = workInProgress2.mode, componentStack = current2.child, JSCompiler_object_inline_componentStack_2726 = componentStack.sibling, JSCompiler_object_inline_stack_2725 = createWorkInProgress(
|
|
componentStack,
|
|
{
|
|
mode: "hidden",
|
|
children: JSCompiler_object_inline_stack_2725.children
|
|
}
|
|
), JSCompiler_object_inline_stack_2725.subtreeFlags = componentStack.subtreeFlags & 65011712, null !== JSCompiler_object_inline_componentStack_2726 ? nextPrimaryChildren = createWorkInProgress(
|
|
JSCompiler_object_inline_componentStack_2726,
|
|
nextPrimaryChildren
|
|
) : (nextPrimaryChildren = createFiberFromFragment(
|
|
nextPrimaryChildren,
|
|
mode,
|
|
renderLanes2,
|
|
null
|
|
), nextPrimaryChildren.flags |= 2), nextPrimaryChildren.return = workInProgress2, JSCompiler_object_inline_stack_2725.return = workInProgress2, JSCompiler_object_inline_stack_2725.sibling = nextPrimaryChildren, workInProgress2.child = JSCompiler_object_inline_stack_2725, bailoutOffscreenComponent(null, JSCompiler_object_inline_stack_2725), JSCompiler_object_inline_stack_2725 = workInProgress2.child, nextPrimaryChildren = current2.child.memoizedState, null === nextPrimaryChildren ? nextPrimaryChildren = mountSuspenseOffscreenState(renderLanes2) : (mode = nextPrimaryChildren.cachePool, null !== mode ? (componentStack = CacheContext._currentValue, mode = mode.parent !== componentStack ? { parent: componentStack, pool: componentStack } : mode) : mode = getSuspendedCache(), nextPrimaryChildren = {
|
|
baseLanes: nextPrimaryChildren.baseLanes | renderLanes2,
|
|
cachePool: mode
|
|
}), JSCompiler_object_inline_stack_2725.memoizedState = nextPrimaryChildren, JSCompiler_object_inline_stack_2725.childLanes = getRemainingWorkInPrimaryTree(
|
|
current2,
|
|
JSCompiler_object_inline_digest_2724,
|
|
renderLanes2
|
|
), workInProgress2.memoizedState = SUSPENDED_MARKER, bailoutOffscreenComponent(
|
|
current2.child,
|
|
JSCompiler_object_inline_stack_2725
|
|
);
|
|
null !== prevState && (renderLanes2 & 62914560) === renderLanes2 && 0 !== (renderLanes2 & current2.lanes) && markRenderDerivedCause(workInProgress2);
|
|
pushPrimaryTreeSuspenseHandler(workInProgress2);
|
|
renderLanes2 = current2.child;
|
|
current2 = renderLanes2.sibling;
|
|
renderLanes2 = createWorkInProgress(renderLanes2, {
|
|
mode: "visible",
|
|
children: JSCompiler_object_inline_stack_2725.children
|
|
});
|
|
renderLanes2.return = workInProgress2;
|
|
renderLanes2.sibling = null;
|
|
null !== current2 && (JSCompiler_object_inline_digest_2724 = workInProgress2.deletions, null === JSCompiler_object_inline_digest_2724 ? (workInProgress2.deletions = [current2], workInProgress2.flags |= 16) : JSCompiler_object_inline_digest_2724.push(current2));
|
|
workInProgress2.child = renderLanes2;
|
|
workInProgress2.memoizedState = null;
|
|
return renderLanes2;
|
|
}
|
|
function mountSuspensePrimaryChildren(workInProgress2, primaryChildren) {
|
|
primaryChildren = mountWorkInProgressOffscreenFiber(
|
|
{ mode: "visible", children: primaryChildren },
|
|
workInProgress2.mode
|
|
);
|
|
primaryChildren.return = workInProgress2;
|
|
return workInProgress2.child = primaryChildren;
|
|
}
|
|
function mountWorkInProgressOffscreenFiber(offscreenProps, mode) {
|
|
offscreenProps = createFiber(22, offscreenProps, null, mode);
|
|
offscreenProps.lanes = 0;
|
|
return offscreenProps;
|
|
}
|
|
function retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2) {
|
|
reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
|
|
current2 = mountSuspensePrimaryChildren(
|
|
workInProgress2,
|
|
workInProgress2.pendingProps.children
|
|
);
|
|
current2.flags |= 2;
|
|
workInProgress2.memoizedState = null;
|
|
return current2;
|
|
}
|
|
function scheduleSuspenseWorkOnFiber(fiber, renderLanes2, propagationRoot) {
|
|
fiber.lanes |= renderLanes2;
|
|
var alternate = fiber.alternate;
|
|
null !== alternate && (alternate.lanes |= renderLanes2);
|
|
scheduleContextWorkOnParentPath(
|
|
fiber.return,
|
|
renderLanes2,
|
|
propagationRoot
|
|
);
|
|
}
|
|
function initSuspenseListRenderState(workInProgress2, isBackwards, tail, lastContentRow, tailMode, treeForkCount2) {
|
|
var renderState = workInProgress2.memoizedState;
|
|
null === renderState ? workInProgress2.memoizedState = {
|
|
isBackwards,
|
|
rendering: null,
|
|
renderingStartTime: 0,
|
|
last: lastContentRow,
|
|
tail,
|
|
tailMode,
|
|
treeForkCount: treeForkCount2
|
|
} : (renderState.isBackwards = isBackwards, renderState.rendering = null, renderState.renderingStartTime = 0, renderState.last = lastContentRow, renderState.tail = tail, renderState.tailMode = tailMode, renderState.treeForkCount = treeForkCount2);
|
|
}
|
|
function updateSuspenseListComponent(current2, workInProgress2, renderLanes2) {
|
|
var nextProps = workInProgress2.pendingProps, revealOrder = nextProps.revealOrder, tailMode = nextProps.tail, newChildren = nextProps.children, suspenseContext = suspenseStackCursor.current;
|
|
(nextProps = 0 !== (suspenseContext & ForceSuspenseFallback)) ? (suspenseContext = suspenseContext & SubtreeSuspenseContextMask | ForceSuspenseFallback, workInProgress2.flags |= 128) : suspenseContext &= SubtreeSuspenseContextMask;
|
|
push(suspenseStackCursor, suspenseContext, workInProgress2);
|
|
suspenseContext = null == revealOrder ? "null" : revealOrder;
|
|
if ("forwards" !== revealOrder && "unstable_legacy-backwards" !== revealOrder && "together" !== revealOrder && "independent" !== revealOrder && !didWarnAboutRevealOrder[suspenseContext])
|
|
if (didWarnAboutRevealOrder[suspenseContext] = true, null == revealOrder)
|
|
console.error(
|
|
'The default for the <SuspenseList revealOrder="..."> prop is changing. To be future compatible you must explictly specify either "independent" (the current default), "together", "forwards" or "legacy_unstable-backwards".'
|
|
);
|
|
else if ("backwards" === revealOrder)
|
|
console.error(
|
|
'The rendering order of <SuspenseList revealOrder="backwards"> is changing. To be future compatible you must specify revealOrder="legacy_unstable-backwards" instead.'
|
|
);
|
|
else if ("string" === typeof revealOrder)
|
|
switch (revealOrder.toLowerCase()) {
|
|
case "together":
|
|
case "forwards":
|
|
case "backwards":
|
|
case "independent":
|
|
console.error(
|
|
'"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',
|
|
revealOrder,
|
|
revealOrder.toLowerCase()
|
|
);
|
|
break;
|
|
case "forward":
|
|
case "backward":
|
|
console.error(
|
|
'"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',
|
|
revealOrder,
|
|
revealOrder.toLowerCase()
|
|
);
|
|
break;
|
|
default:
|
|
console.error(
|
|
'"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "independent", "together", "forwards" or "backwards"?',
|
|
revealOrder
|
|
);
|
|
}
|
|
else
|
|
console.error(
|
|
'%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "independent", "together", "forwards" or "backwards"?',
|
|
revealOrder
|
|
);
|
|
suspenseContext = null == tailMode ? "null" : tailMode;
|
|
if (!didWarnAboutTailOptions[suspenseContext])
|
|
if (null == tailMode) {
|
|
if ("forwards" === revealOrder || "backwards" === revealOrder || "unstable_legacy-backwards" === revealOrder)
|
|
didWarnAboutTailOptions[suspenseContext] = true, console.error(
|
|
'The default for the <SuspenseList tail="..."> prop is changing. To be future compatible you must explictly specify either "visible" (the current default), "collapsed" or "hidden".'
|
|
);
|
|
} else
|
|
"visible" !== tailMode && "collapsed" !== tailMode && "hidden" !== tailMode ? (didWarnAboutTailOptions[suspenseContext] = true, console.error(
|
|
'"%s" is not a supported value for tail on <SuspenseList />. Did you mean "visible", "collapsed" or "hidden"?',
|
|
tailMode
|
|
)) : "forwards" !== revealOrder && "backwards" !== revealOrder && "unstable_legacy-backwards" !== revealOrder && (didWarnAboutTailOptions[suspenseContext] = true, console.error(
|
|
'<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',
|
|
tailMode
|
|
));
|
|
a: if (("forwards" === revealOrder || "backwards" === revealOrder || "unstable_legacy-backwards" === revealOrder) && void 0 !== newChildren && null !== newChildren && false !== newChildren)
|
|
if (isArrayImpl(newChildren))
|
|
for (suspenseContext = 0; suspenseContext < newChildren.length; suspenseContext++) {
|
|
if (!validateSuspenseListNestedChild(
|
|
newChildren[suspenseContext],
|
|
suspenseContext
|
|
))
|
|
break a;
|
|
}
|
|
else if (suspenseContext = getIteratorFn(newChildren), "function" === typeof suspenseContext) {
|
|
if (suspenseContext = suspenseContext.call(newChildren))
|
|
for (var step = suspenseContext.next(), _i = 0; !step.done; step = suspenseContext.next()) {
|
|
if (!validateSuspenseListNestedChild(step.value, _i)) break a;
|
|
_i++;
|
|
}
|
|
} else
|
|
console.error(
|
|
'A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',
|
|
revealOrder
|
|
);
|
|
reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
|
|
isHydrating ? (warnIfNotHydrating(), newChildren = treeForkCount) : newChildren = 0;
|
|
if (!nextProps && null !== current2 && 0 !== (current2.flags & 128))
|
|
a: for (current2 = workInProgress2.child; null !== current2; ) {
|
|
if (13 === current2.tag)
|
|
null !== current2.memoizedState && scheduleSuspenseWorkOnFiber(current2, renderLanes2, workInProgress2);
|
|
else if (19 === current2.tag)
|
|
scheduleSuspenseWorkOnFiber(current2, renderLanes2, workInProgress2);
|
|
else if (null !== current2.child) {
|
|
current2.child.return = current2;
|
|
current2 = current2.child;
|
|
continue;
|
|
}
|
|
if (current2 === workInProgress2) break a;
|
|
for (; null === current2.sibling; ) {
|
|
if (null === current2.return || current2.return === workInProgress2)
|
|
break a;
|
|
current2 = current2.return;
|
|
}
|
|
current2.sibling.return = current2.return;
|
|
current2 = current2.sibling;
|
|
}
|
|
switch (revealOrder) {
|
|
case "forwards":
|
|
renderLanes2 = workInProgress2.child;
|
|
for (revealOrder = null; null !== renderLanes2; )
|
|
current2 = renderLanes2.alternate, null !== current2 && null === findFirstSuspended(current2) && (revealOrder = renderLanes2), renderLanes2 = renderLanes2.sibling;
|
|
renderLanes2 = revealOrder;
|
|
null === renderLanes2 ? (revealOrder = workInProgress2.child, workInProgress2.child = null) : (revealOrder = renderLanes2.sibling, renderLanes2.sibling = null);
|
|
initSuspenseListRenderState(
|
|
workInProgress2,
|
|
false,
|
|
revealOrder,
|
|
renderLanes2,
|
|
tailMode,
|
|
newChildren
|
|
);
|
|
break;
|
|
case "backwards":
|
|
case "unstable_legacy-backwards":
|
|
renderLanes2 = null;
|
|
revealOrder = workInProgress2.child;
|
|
for (workInProgress2.child = null; null !== revealOrder; ) {
|
|
current2 = revealOrder.alternate;
|
|
if (null !== current2 && null === findFirstSuspended(current2)) {
|
|
workInProgress2.child = revealOrder;
|
|
break;
|
|
}
|
|
current2 = revealOrder.sibling;
|
|
revealOrder.sibling = renderLanes2;
|
|
renderLanes2 = revealOrder;
|
|
revealOrder = current2;
|
|
}
|
|
initSuspenseListRenderState(
|
|
workInProgress2,
|
|
true,
|
|
renderLanes2,
|
|
null,
|
|
tailMode,
|
|
newChildren
|
|
);
|
|
break;
|
|
case "together":
|
|
initSuspenseListRenderState(
|
|
workInProgress2,
|
|
false,
|
|
null,
|
|
null,
|
|
void 0,
|
|
newChildren
|
|
);
|
|
break;
|
|
default:
|
|
workInProgress2.memoizedState = null;
|
|
}
|
|
return workInProgress2.child;
|
|
}
|
|
function bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2) {
|
|
null !== current2 && (workInProgress2.dependencies = current2.dependencies);
|
|
profilerStartTime = -1;
|
|
workInProgressRootSkippedLanes |= workInProgress2.lanes;
|
|
if (0 === (renderLanes2 & workInProgress2.childLanes))
|
|
if (null !== current2) {
|
|
if (propagateParentContextChanges(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2,
|
|
false
|
|
), 0 === (renderLanes2 & workInProgress2.childLanes))
|
|
return null;
|
|
} else return null;
|
|
if (null !== current2 && workInProgress2.child !== current2.child)
|
|
throw Error("Resuming work not yet implemented.");
|
|
if (null !== workInProgress2.child) {
|
|
current2 = workInProgress2.child;
|
|
renderLanes2 = createWorkInProgress(current2, current2.pendingProps);
|
|
workInProgress2.child = renderLanes2;
|
|
for (renderLanes2.return = workInProgress2; null !== current2.sibling; )
|
|
current2 = current2.sibling, renderLanes2 = renderLanes2.sibling = createWorkInProgress(current2, current2.pendingProps), renderLanes2.return = workInProgress2;
|
|
renderLanes2.sibling = null;
|
|
}
|
|
return workInProgress2.child;
|
|
}
|
|
function checkScheduledUpdateOrContext(current2, renderLanes2) {
|
|
if (0 !== (current2.lanes & renderLanes2)) return true;
|
|
current2 = current2.dependencies;
|
|
return null !== current2 && checkIfContextChanged(current2) ? true : false;
|
|
}
|
|
function attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2) {
|
|
switch (workInProgress2.tag) {
|
|
case 3:
|
|
pushHostContainer(
|
|
workInProgress2,
|
|
workInProgress2.stateNode.containerInfo
|
|
);
|
|
pushProvider(
|
|
workInProgress2,
|
|
CacheContext,
|
|
current2.memoizedState.cache
|
|
);
|
|
resetHydrationState();
|
|
break;
|
|
case 27:
|
|
case 5:
|
|
pushHostContext(workInProgress2);
|
|
break;
|
|
case 4:
|
|
pushHostContainer(
|
|
workInProgress2,
|
|
workInProgress2.stateNode.containerInfo
|
|
);
|
|
break;
|
|
case 10:
|
|
pushProvider(
|
|
workInProgress2,
|
|
workInProgress2.type,
|
|
workInProgress2.memoizedProps.value
|
|
);
|
|
break;
|
|
case 12:
|
|
0 !== (renderLanes2 & workInProgress2.childLanes) && (workInProgress2.flags |= 4);
|
|
workInProgress2.flags |= 2048;
|
|
var stateNode = workInProgress2.stateNode;
|
|
stateNode.effectDuration = -0;
|
|
stateNode.passiveEffectDuration = -0;
|
|
break;
|
|
case 31:
|
|
if (null !== workInProgress2.memoizedState)
|
|
return workInProgress2.flags |= 128, pushDehydratedActivitySuspenseHandler(workInProgress2), null;
|
|
break;
|
|
case 13:
|
|
stateNode = workInProgress2.memoizedState;
|
|
if (null !== stateNode) {
|
|
if (null !== stateNode.dehydrated)
|
|
return pushPrimaryTreeSuspenseHandler(workInProgress2), workInProgress2.flags |= 128, null;
|
|
if (0 !== (renderLanes2 & workInProgress2.child.childLanes))
|
|
return updateSuspenseComponent(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2
|
|
);
|
|
pushPrimaryTreeSuspenseHandler(workInProgress2);
|
|
current2 = bailoutOnAlreadyFinishedWork(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2
|
|
);
|
|
return null !== current2 ? current2.sibling : null;
|
|
}
|
|
pushPrimaryTreeSuspenseHandler(workInProgress2);
|
|
break;
|
|
case 19:
|
|
var didSuspendBefore = 0 !== (current2.flags & 128);
|
|
stateNode = 0 !== (renderLanes2 & workInProgress2.childLanes);
|
|
stateNode || (propagateParentContextChanges(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2,
|
|
false
|
|
), stateNode = 0 !== (renderLanes2 & workInProgress2.childLanes));
|
|
if (didSuspendBefore) {
|
|
if (stateNode)
|
|
return updateSuspenseListComponent(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2
|
|
);
|
|
workInProgress2.flags |= 128;
|
|
}
|
|
didSuspendBefore = workInProgress2.memoizedState;
|
|
null !== didSuspendBefore && (didSuspendBefore.rendering = null, didSuspendBefore.tail = null, didSuspendBefore.lastEffect = null);
|
|
push(
|
|
suspenseStackCursor,
|
|
suspenseStackCursor.current,
|
|
workInProgress2
|
|
);
|
|
if (stateNode) break;
|
|
else return null;
|
|
case 22:
|
|
return workInProgress2.lanes = 0, updateOffscreenComponent(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2,
|
|
workInProgress2.pendingProps
|
|
);
|
|
case 24:
|
|
pushProvider(
|
|
workInProgress2,
|
|
CacheContext,
|
|
current2.memoizedState.cache
|
|
);
|
|
}
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
}
|
|
function beginWork(current2, workInProgress2, renderLanes2) {
|
|
if (workInProgress2._debugNeedsRemount && null !== current2) {
|
|
renderLanes2 = createFiberFromTypeAndProps(
|
|
workInProgress2.type,
|
|
workInProgress2.key,
|
|
workInProgress2.pendingProps,
|
|
workInProgress2._debugOwner || null,
|
|
workInProgress2.mode,
|
|
workInProgress2.lanes
|
|
);
|
|
renderLanes2._debugStack = workInProgress2._debugStack;
|
|
renderLanes2._debugTask = workInProgress2._debugTask;
|
|
var returnFiber = workInProgress2.return;
|
|
if (null === returnFiber) throw Error("Cannot swap the root fiber.");
|
|
current2.alternate = null;
|
|
workInProgress2.alternate = null;
|
|
renderLanes2.index = workInProgress2.index;
|
|
renderLanes2.sibling = workInProgress2.sibling;
|
|
renderLanes2.return = workInProgress2.return;
|
|
renderLanes2.ref = workInProgress2.ref;
|
|
renderLanes2._debugInfo = workInProgress2._debugInfo;
|
|
if (workInProgress2 === returnFiber.child)
|
|
returnFiber.child = renderLanes2;
|
|
else {
|
|
var prevSibling = returnFiber.child;
|
|
if (null === prevSibling)
|
|
throw Error("Expected parent to have a child.");
|
|
for (; prevSibling.sibling !== workInProgress2; )
|
|
if (prevSibling = prevSibling.sibling, null === prevSibling)
|
|
throw Error("Expected to find the previous sibling.");
|
|
prevSibling.sibling = renderLanes2;
|
|
}
|
|
workInProgress2 = returnFiber.deletions;
|
|
null === workInProgress2 ? (returnFiber.deletions = [current2], returnFiber.flags |= 16) : workInProgress2.push(current2);
|
|
renderLanes2.flags |= 2;
|
|
return renderLanes2;
|
|
}
|
|
if (null !== current2)
|
|
if (current2.memoizedProps !== workInProgress2.pendingProps || workInProgress2.type !== current2.type)
|
|
didReceiveUpdate = true;
|
|
else {
|
|
if (!checkScheduledUpdateOrContext(current2, renderLanes2) && 0 === (workInProgress2.flags & 128))
|
|
return didReceiveUpdate = false, attemptEarlyBailoutIfNoScheduledUpdate(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2
|
|
);
|
|
didReceiveUpdate = 0 !== (current2.flags & 131072) ? true : false;
|
|
}
|
|
else {
|
|
didReceiveUpdate = false;
|
|
if (returnFiber = isHydrating)
|
|
warnIfNotHydrating(), returnFiber = 0 !== (workInProgress2.flags & 1048576);
|
|
returnFiber && (returnFiber = workInProgress2.index, warnIfNotHydrating(), pushTreeId(workInProgress2, treeForkCount, returnFiber));
|
|
}
|
|
workInProgress2.lanes = 0;
|
|
switch (workInProgress2.tag) {
|
|
case 16:
|
|
a: if (returnFiber = workInProgress2.pendingProps, current2 = resolveLazy(workInProgress2.elementType), workInProgress2.type = current2, "function" === typeof current2)
|
|
shouldConstruct(current2) ? (returnFiber = resolveClassComponentProps(
|
|
current2,
|
|
returnFiber
|
|
), workInProgress2.tag = 1, workInProgress2.type = current2 = resolveFunctionForHotReloading(current2), workInProgress2 = updateClassComponent(
|
|
null,
|
|
workInProgress2,
|
|
current2,
|
|
returnFiber,
|
|
renderLanes2
|
|
)) : (workInProgress2.tag = 0, validateFunctionComponentInDev(workInProgress2, current2), workInProgress2.type = current2 = resolveFunctionForHotReloading(current2), workInProgress2 = updateFunctionComponent(
|
|
null,
|
|
workInProgress2,
|
|
current2,
|
|
returnFiber,
|
|
renderLanes2
|
|
));
|
|
else {
|
|
if (void 0 !== current2 && null !== current2) {
|
|
if (prevSibling = current2.$$typeof, prevSibling === REACT_FORWARD_REF_TYPE) {
|
|
workInProgress2.tag = 11;
|
|
workInProgress2.type = current2 = resolveForwardRefForHotReloading(current2);
|
|
workInProgress2 = updateForwardRef(
|
|
null,
|
|
workInProgress2,
|
|
current2,
|
|
returnFiber,
|
|
renderLanes2
|
|
);
|
|
break a;
|
|
} else if (prevSibling === REACT_MEMO_TYPE) {
|
|
workInProgress2.tag = 14;
|
|
workInProgress2 = updateMemoComponent(
|
|
null,
|
|
workInProgress2,
|
|
current2,
|
|
returnFiber,
|
|
renderLanes2
|
|
);
|
|
break a;
|
|
}
|
|
}
|
|
workInProgress2 = "";
|
|
null !== current2 && "object" === typeof current2 && current2.$$typeof === REACT_LAZY_TYPE && (workInProgress2 = " Did you wrap a component in React.lazy() more than once?");
|
|
renderLanes2 = getComponentNameFromType(current2) || current2;
|
|
throw Error(
|
|
"Element type is invalid. Received a promise that resolves to: " + renderLanes2 + ". Lazy element type must resolve to a class or function." + workInProgress2
|
|
);
|
|
}
|
|
return workInProgress2;
|
|
case 0:
|
|
return updateFunctionComponent(
|
|
current2,
|
|
workInProgress2,
|
|
workInProgress2.type,
|
|
workInProgress2.pendingProps,
|
|
renderLanes2
|
|
);
|
|
case 1:
|
|
return returnFiber = workInProgress2.type, prevSibling = resolveClassComponentProps(
|
|
returnFiber,
|
|
workInProgress2.pendingProps
|
|
), updateClassComponent(
|
|
current2,
|
|
workInProgress2,
|
|
returnFiber,
|
|
prevSibling,
|
|
renderLanes2
|
|
);
|
|
case 3:
|
|
a: {
|
|
pushHostContainer(
|
|
workInProgress2,
|
|
workInProgress2.stateNode.containerInfo
|
|
);
|
|
if (null === current2)
|
|
throw Error(
|
|
"Should have a current fiber. This is a bug in React."
|
|
);
|
|
returnFiber = workInProgress2.pendingProps;
|
|
var prevState = workInProgress2.memoizedState;
|
|
prevSibling = prevState.element;
|
|
cloneUpdateQueue(current2, workInProgress2);
|
|
processUpdateQueue(workInProgress2, returnFiber, null, renderLanes2);
|
|
var nextState = workInProgress2.memoizedState;
|
|
returnFiber = nextState.cache;
|
|
pushProvider(workInProgress2, CacheContext, returnFiber);
|
|
returnFiber !== prevState.cache && propagateContextChanges(
|
|
workInProgress2,
|
|
[CacheContext],
|
|
renderLanes2,
|
|
true
|
|
);
|
|
suspendIfUpdateReadFromEntangledAsyncAction();
|
|
returnFiber = nextState.element;
|
|
if (prevState.isDehydrated)
|
|
if (prevState = {
|
|
element: returnFiber,
|
|
isDehydrated: false,
|
|
cache: nextState.cache
|
|
}, workInProgress2.updateQueue.baseState = prevState, workInProgress2.memoizedState = prevState, workInProgress2.flags & 256) {
|
|
workInProgress2 = mountHostRootWithoutHydrating(
|
|
current2,
|
|
workInProgress2,
|
|
returnFiber,
|
|
renderLanes2
|
|
);
|
|
break a;
|
|
} else if (returnFiber !== prevSibling) {
|
|
prevSibling = createCapturedValueAtFiber(
|
|
Error(
|
|
"This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."
|
|
),
|
|
workInProgress2
|
|
);
|
|
queueHydrationError(prevSibling);
|
|
workInProgress2 = mountHostRootWithoutHydrating(
|
|
current2,
|
|
workInProgress2,
|
|
returnFiber,
|
|
renderLanes2
|
|
);
|
|
break a;
|
|
} else {
|
|
current2 = workInProgress2.stateNode.containerInfo;
|
|
switch (current2.nodeType) {
|
|
case 9:
|
|
current2 = current2.body;
|
|
break;
|
|
default:
|
|
current2 = "HTML" === current2.nodeName ? current2.ownerDocument.body : current2;
|
|
}
|
|
nextHydratableInstance = getNextHydratable(current2.firstChild);
|
|
hydrationParentFiber = workInProgress2;
|
|
isHydrating = true;
|
|
hydrationErrors = null;
|
|
didSuspendOrErrorDEV = false;
|
|
hydrationDiffRootDEV = null;
|
|
rootOrSingletonContext = true;
|
|
renderLanes2 = mountChildFibers(
|
|
workInProgress2,
|
|
null,
|
|
returnFiber,
|
|
renderLanes2
|
|
);
|
|
for (workInProgress2.child = renderLanes2; renderLanes2; )
|
|
renderLanes2.flags = renderLanes2.flags & -3 | 4096, renderLanes2 = renderLanes2.sibling;
|
|
}
|
|
else {
|
|
resetHydrationState();
|
|
if (returnFiber === prevSibling) {
|
|
workInProgress2 = bailoutOnAlreadyFinishedWork(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2
|
|
);
|
|
break a;
|
|
}
|
|
reconcileChildren(
|
|
current2,
|
|
workInProgress2,
|
|
returnFiber,
|
|
renderLanes2
|
|
);
|
|
}
|
|
workInProgress2 = workInProgress2.child;
|
|
}
|
|
return workInProgress2;
|
|
case 26:
|
|
return markRef(current2, workInProgress2), null === current2 ? (renderLanes2 = getResource(
|
|
workInProgress2.type,
|
|
null,
|
|
workInProgress2.pendingProps,
|
|
null
|
|
)) ? workInProgress2.memoizedState = renderLanes2 : isHydrating || (renderLanes2 = workInProgress2.type, current2 = workInProgress2.pendingProps, returnFiber = requiredContext(
|
|
rootInstanceStackCursor.current
|
|
), returnFiber = getOwnerDocumentFromRootContainer(
|
|
returnFiber
|
|
).createElement(renderLanes2), returnFiber[internalInstanceKey] = workInProgress2, returnFiber[internalPropsKey] = current2, setInitialProperties(returnFiber, renderLanes2, current2), markNodeAsHoistable(returnFiber), workInProgress2.stateNode = returnFiber) : workInProgress2.memoizedState = getResource(
|
|
workInProgress2.type,
|
|
current2.memoizedProps,
|
|
workInProgress2.pendingProps,
|
|
current2.memoizedState
|
|
), null;
|
|
case 27:
|
|
return pushHostContext(workInProgress2), null === current2 && isHydrating && (returnFiber = requiredContext(rootInstanceStackCursor.current), prevSibling = getHostContext(), returnFiber = workInProgress2.stateNode = resolveSingletonInstance(
|
|
workInProgress2.type,
|
|
workInProgress2.pendingProps,
|
|
returnFiber,
|
|
prevSibling,
|
|
false
|
|
), didSuspendOrErrorDEV || (prevSibling = diffHydratedProperties(
|
|
returnFiber,
|
|
workInProgress2.type,
|
|
workInProgress2.pendingProps,
|
|
prevSibling
|
|
), null !== prevSibling && (buildHydrationDiffNode(workInProgress2, 0).serverProps = prevSibling)), hydrationParentFiber = workInProgress2, rootOrSingletonContext = true, prevSibling = nextHydratableInstance, isSingletonScope(workInProgress2.type) ? (previousHydratableOnEnteringScopedSingleton = prevSibling, nextHydratableInstance = getNextHydratable(
|
|
returnFiber.firstChild
|
|
)) : nextHydratableInstance = prevSibling), reconcileChildren(
|
|
current2,
|
|
workInProgress2,
|
|
workInProgress2.pendingProps.children,
|
|
renderLanes2
|
|
), markRef(current2, workInProgress2), null === current2 && (workInProgress2.flags |= 4194304), workInProgress2.child;
|
|
case 5:
|
|
return null === current2 && isHydrating && (prevState = getHostContext(), returnFiber = validateDOMNesting(
|
|
workInProgress2.type,
|
|
prevState.ancestorInfo
|
|
), prevSibling = nextHydratableInstance, (nextState = !prevSibling) || (nextState = canHydrateInstance(
|
|
prevSibling,
|
|
workInProgress2.type,
|
|
workInProgress2.pendingProps,
|
|
rootOrSingletonContext
|
|
), null !== nextState ? (workInProgress2.stateNode = nextState, didSuspendOrErrorDEV || (prevState = diffHydratedProperties(
|
|
nextState,
|
|
workInProgress2.type,
|
|
workInProgress2.pendingProps,
|
|
prevState
|
|
), null !== prevState && (buildHydrationDiffNode(workInProgress2, 0).serverProps = prevState)), hydrationParentFiber = workInProgress2, nextHydratableInstance = getNextHydratable(
|
|
nextState.firstChild
|
|
), rootOrSingletonContext = false, prevState = true) : prevState = false, nextState = !prevState), nextState && (returnFiber && warnNonHydratedInstance(workInProgress2, prevSibling), throwOnHydrationMismatch(workInProgress2))), pushHostContext(workInProgress2), prevSibling = workInProgress2.type, prevState = workInProgress2.pendingProps, nextState = null !== current2 ? current2.memoizedProps : null, returnFiber = prevState.children, shouldSetTextContent(prevSibling, prevState) ? returnFiber = null : null !== nextState && shouldSetTextContent(prevSibling, nextState) && (workInProgress2.flags |= 32), null !== workInProgress2.memoizedState && (prevSibling = renderWithHooks(
|
|
current2,
|
|
workInProgress2,
|
|
TransitionAwareHostComponent,
|
|
null,
|
|
null,
|
|
renderLanes2
|
|
), HostTransitionContext._currentValue = prevSibling), markRef(current2, workInProgress2), reconcileChildren(
|
|
current2,
|
|
workInProgress2,
|
|
returnFiber,
|
|
renderLanes2
|
|
), workInProgress2.child;
|
|
case 6:
|
|
return null === current2 && isHydrating && (renderLanes2 = workInProgress2.pendingProps, current2 = getHostContext(), returnFiber = current2.ancestorInfo.current, renderLanes2 = null != returnFiber ? validateTextNesting(
|
|
renderLanes2,
|
|
returnFiber.tag,
|
|
current2.ancestorInfo.implicitRootScope
|
|
) : true, current2 = nextHydratableInstance, (returnFiber = !current2) || (returnFiber = canHydrateTextInstance(
|
|
current2,
|
|
workInProgress2.pendingProps,
|
|
rootOrSingletonContext
|
|
), null !== returnFiber ? (workInProgress2.stateNode = returnFiber, hydrationParentFiber = workInProgress2, nextHydratableInstance = null, returnFiber = true) : returnFiber = false, returnFiber = !returnFiber), returnFiber && (renderLanes2 && warnNonHydratedInstance(workInProgress2, current2), throwOnHydrationMismatch(workInProgress2))), null;
|
|
case 13:
|
|
return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
|
|
case 4:
|
|
return pushHostContainer(
|
|
workInProgress2,
|
|
workInProgress2.stateNode.containerInfo
|
|
), returnFiber = workInProgress2.pendingProps, null === current2 ? workInProgress2.child = reconcileChildFibers(
|
|
workInProgress2,
|
|
null,
|
|
returnFiber,
|
|
renderLanes2
|
|
) : reconcileChildren(
|
|
current2,
|
|
workInProgress2,
|
|
returnFiber,
|
|
renderLanes2
|
|
), workInProgress2.child;
|
|
case 11:
|
|
return updateForwardRef(
|
|
current2,
|
|
workInProgress2,
|
|
workInProgress2.type,
|
|
workInProgress2.pendingProps,
|
|
renderLanes2
|
|
);
|
|
case 7:
|
|
return reconcileChildren(
|
|
current2,
|
|
workInProgress2,
|
|
workInProgress2.pendingProps,
|
|
renderLanes2
|
|
), workInProgress2.child;
|
|
case 8:
|
|
return reconcileChildren(
|
|
current2,
|
|
workInProgress2,
|
|
workInProgress2.pendingProps.children,
|
|
renderLanes2
|
|
), workInProgress2.child;
|
|
case 12:
|
|
return workInProgress2.flags |= 4, workInProgress2.flags |= 2048, returnFiber = workInProgress2.stateNode, returnFiber.effectDuration = -0, returnFiber.passiveEffectDuration = -0, reconcileChildren(
|
|
current2,
|
|
workInProgress2,
|
|
workInProgress2.pendingProps.children,
|
|
renderLanes2
|
|
), workInProgress2.child;
|
|
case 10:
|
|
return returnFiber = workInProgress2.type, prevSibling = workInProgress2.pendingProps, prevState = prevSibling.value, "value" in prevSibling || hasWarnedAboutUsingNoValuePropOnContextProvider || (hasWarnedAboutUsingNoValuePropOnContextProvider = true, console.error(
|
|
"The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"
|
|
)), pushProvider(workInProgress2, returnFiber, prevState), reconcileChildren(
|
|
current2,
|
|
workInProgress2,
|
|
prevSibling.children,
|
|
renderLanes2
|
|
), workInProgress2.child;
|
|
case 9:
|
|
return prevSibling = workInProgress2.type._context, returnFiber = workInProgress2.pendingProps.children, "function" !== typeof returnFiber && console.error(
|
|
"A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."
|
|
), prepareToReadContext(workInProgress2), prevSibling = readContext(prevSibling), returnFiber = callComponentInDEV(
|
|
returnFiber,
|
|
prevSibling,
|
|
void 0
|
|
), workInProgress2.flags |= 1, reconcileChildren(
|
|
current2,
|
|
workInProgress2,
|
|
returnFiber,
|
|
renderLanes2
|
|
), workInProgress2.child;
|
|
case 14:
|
|
return updateMemoComponent(
|
|
current2,
|
|
workInProgress2,
|
|
workInProgress2.type,
|
|
workInProgress2.pendingProps,
|
|
renderLanes2
|
|
);
|
|
case 15:
|
|
return updateSimpleMemoComponent(
|
|
current2,
|
|
workInProgress2,
|
|
workInProgress2.type,
|
|
workInProgress2.pendingProps,
|
|
renderLanes2
|
|
);
|
|
case 19:
|
|
return updateSuspenseListComponent(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2
|
|
);
|
|
case 31:
|
|
return updateActivityComponent(current2, workInProgress2, renderLanes2);
|
|
case 22:
|
|
return updateOffscreenComponent(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2,
|
|
workInProgress2.pendingProps
|
|
);
|
|
case 24:
|
|
return prepareToReadContext(workInProgress2), returnFiber = readContext(CacheContext), null === current2 ? (prevSibling = peekCacheFromPool(), null === prevSibling && (prevSibling = workInProgressRoot, prevState = createCache3(), prevSibling.pooledCache = prevState, retainCache(prevState), null !== prevState && (prevSibling.pooledCacheLanes |= renderLanes2), prevSibling = prevState), workInProgress2.memoizedState = {
|
|
parent: returnFiber,
|
|
cache: prevSibling
|
|
}, initializeUpdateQueue(workInProgress2), pushProvider(workInProgress2, CacheContext, prevSibling)) : (0 !== (current2.lanes & renderLanes2) && (cloneUpdateQueue(current2, workInProgress2), processUpdateQueue(workInProgress2, null, null, renderLanes2), suspendIfUpdateReadFromEntangledAsyncAction()), prevSibling = current2.memoizedState, prevState = workInProgress2.memoizedState, prevSibling.parent !== returnFiber ? (prevSibling = {
|
|
parent: returnFiber,
|
|
cache: returnFiber
|
|
}, workInProgress2.memoizedState = prevSibling, 0 === workInProgress2.lanes && (workInProgress2.memoizedState = workInProgress2.updateQueue.baseState = prevSibling), pushProvider(workInProgress2, CacheContext, returnFiber)) : (returnFiber = prevState.cache, pushProvider(workInProgress2, CacheContext, returnFiber), returnFiber !== prevSibling.cache && propagateContextChanges(
|
|
workInProgress2,
|
|
[CacheContext],
|
|
renderLanes2,
|
|
true
|
|
))), reconcileChildren(
|
|
current2,
|
|
workInProgress2,
|
|
workInProgress2.pendingProps.children,
|
|
renderLanes2
|
|
), workInProgress2.child;
|
|
case 29:
|
|
throw workInProgress2.pendingProps;
|
|
}
|
|
throw Error(
|
|
"Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
}
|
|
function markUpdate(workInProgress2) {
|
|
workInProgress2.flags |= 4;
|
|
}
|
|
function preloadInstanceAndSuspendIfNeeded(workInProgress2, type, oldProps, newProps, renderLanes2) {
|
|
if (type = (workInProgress2.mode & SuspenseyImagesMode) !== NoMode)
|
|
type = false;
|
|
if (type) {
|
|
if (workInProgress2.flags |= 16777216, (renderLanes2 & 335544128) === renderLanes2)
|
|
if (workInProgress2.stateNode.complete) workInProgress2.flags |= 8192;
|
|
else if (shouldRemainOnPreviousScreen()) workInProgress2.flags |= 8192;
|
|
else
|
|
throw suspendedThenable = noopSuspenseyCommitThenable, SuspenseyCommitException;
|
|
} else workInProgress2.flags &= -16777217;
|
|
}
|
|
function preloadResourceAndSuspendIfNeeded(workInProgress2, resource) {
|
|
if ("stylesheet" !== resource.type || (resource.state.loading & Inserted) !== NotLoaded)
|
|
workInProgress2.flags &= -16777217;
|
|
else if (workInProgress2.flags |= 16777216, !preloadResource(resource))
|
|
if (shouldRemainOnPreviousScreen()) workInProgress2.flags |= 8192;
|
|
else
|
|
throw suspendedThenable = noopSuspenseyCommitThenable, SuspenseyCommitException;
|
|
}
|
|
function scheduleRetryEffect(workInProgress2, retryQueue) {
|
|
null !== retryQueue && (workInProgress2.flags |= 4);
|
|
workInProgress2.flags & 16384 && (retryQueue = 22 !== workInProgress2.tag ? claimNextRetryLane() : 536870912, workInProgress2.lanes |= retryQueue, workInProgressSuspendedRetryLanes |= retryQueue);
|
|
}
|
|
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
|
|
if (!isHydrating)
|
|
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 = null; null !== lastTailNode; )
|
|
null !== lastTailNode.alternate && (_lastTailNode = lastTailNode), lastTailNode = lastTailNode.sibling;
|
|
null === _lastTailNode ? hasRenderedATailFallback || null === renderState.tail ? renderState.tail = null : renderState.tail.sibling = null : _lastTailNode.sibling = null;
|
|
}
|
|
}
|
|
function bubbleProperties(completedWork) {
|
|
var didBailout = null !== completedWork.alternate && completedWork.alternate.child === completedWork.child, newChildLanes = 0, subtreeFlags = 0;
|
|
if (didBailout)
|
|
if ((completedWork.mode & ProfileMode) !== NoMode) {
|
|
for (var _treeBaseDuration = completedWork.selfBaseDuration, _child2 = completedWork.child; null !== _child2; )
|
|
newChildLanes |= _child2.lanes | _child2.childLanes, subtreeFlags |= _child2.subtreeFlags & 65011712, subtreeFlags |= _child2.flags & 65011712, _treeBaseDuration += _child2.treeBaseDuration, _child2 = _child2.sibling;
|
|
completedWork.treeBaseDuration = _treeBaseDuration;
|
|
} else
|
|
for (_treeBaseDuration = completedWork.child; null !== _treeBaseDuration; )
|
|
newChildLanes |= _treeBaseDuration.lanes | _treeBaseDuration.childLanes, subtreeFlags |= _treeBaseDuration.subtreeFlags & 65011712, subtreeFlags |= _treeBaseDuration.flags & 65011712, _treeBaseDuration.return = completedWork, _treeBaseDuration = _treeBaseDuration.sibling;
|
|
else if ((completedWork.mode & ProfileMode) !== NoMode) {
|
|
_treeBaseDuration = completedWork.actualDuration;
|
|
_child2 = completedWork.selfBaseDuration;
|
|
for (var child = completedWork.child; null !== child; )
|
|
newChildLanes |= child.lanes | child.childLanes, subtreeFlags |= child.subtreeFlags, subtreeFlags |= child.flags, _treeBaseDuration += child.actualDuration, _child2 += child.treeBaseDuration, child = child.sibling;
|
|
completedWork.actualDuration = _treeBaseDuration;
|
|
completedWork.treeBaseDuration = _child2;
|
|
} else
|
|
for (_treeBaseDuration = completedWork.child; null !== _treeBaseDuration; )
|
|
newChildLanes |= _treeBaseDuration.lanes | _treeBaseDuration.childLanes, subtreeFlags |= _treeBaseDuration.subtreeFlags, subtreeFlags |= _treeBaseDuration.flags, _treeBaseDuration.return = completedWork, _treeBaseDuration = _treeBaseDuration.sibling;
|
|
completedWork.subtreeFlags |= subtreeFlags;
|
|
completedWork.childLanes = newChildLanes;
|
|
return didBailout;
|
|
}
|
|
function completeWork(current2, workInProgress2, renderLanes2) {
|
|
var newProps = workInProgress2.pendingProps;
|
|
popTreeContext(workInProgress2);
|
|
switch (workInProgress2.tag) {
|
|
case 16:
|
|
case 15:
|
|
case 0:
|
|
case 11:
|
|
case 7:
|
|
case 8:
|
|
case 12:
|
|
case 9:
|
|
case 14:
|
|
return bubbleProperties(workInProgress2), null;
|
|
case 1:
|
|
return bubbleProperties(workInProgress2), null;
|
|
case 3:
|
|
renderLanes2 = workInProgress2.stateNode;
|
|
newProps = null;
|
|
null !== current2 && (newProps = current2.memoizedState.cache);
|
|
workInProgress2.memoizedState.cache !== newProps && (workInProgress2.flags |= 2048);
|
|
popProvider(CacheContext, workInProgress2);
|
|
popHostContainer(workInProgress2);
|
|
renderLanes2.pendingContext && (renderLanes2.context = renderLanes2.pendingContext, renderLanes2.pendingContext = null);
|
|
if (null === current2 || null === current2.child)
|
|
popHydrationState(workInProgress2) ? (emitPendingHydrationWarnings(), markUpdate(workInProgress2)) : null === current2 || current2.memoizedState.isDehydrated && 0 === (workInProgress2.flags & 256) || (workInProgress2.flags |= 1024, upgradeHydrationErrorsToRecoverable());
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
case 26:
|
|
var type = workInProgress2.type, nextResource = workInProgress2.memoizedState;
|
|
null === current2 ? (markUpdate(workInProgress2), null !== nextResource ? (bubbleProperties(workInProgress2), preloadResourceAndSuspendIfNeeded(
|
|
workInProgress2,
|
|
nextResource
|
|
)) : (bubbleProperties(workInProgress2), preloadInstanceAndSuspendIfNeeded(
|
|
workInProgress2,
|
|
type,
|
|
null,
|
|
newProps,
|
|
renderLanes2
|
|
))) : nextResource ? nextResource !== current2.memoizedState ? (markUpdate(workInProgress2), bubbleProperties(workInProgress2), preloadResourceAndSuspendIfNeeded(
|
|
workInProgress2,
|
|
nextResource
|
|
)) : (bubbleProperties(workInProgress2), workInProgress2.flags &= -16777217) : (current2 = current2.memoizedProps, current2 !== newProps && markUpdate(workInProgress2), bubbleProperties(workInProgress2), preloadInstanceAndSuspendIfNeeded(
|
|
workInProgress2,
|
|
type,
|
|
current2,
|
|
newProps,
|
|
renderLanes2
|
|
));
|
|
return null;
|
|
case 27:
|
|
popHostContext(workInProgress2);
|
|
renderLanes2 = requiredContext(rootInstanceStackCursor.current);
|
|
type = workInProgress2.type;
|
|
if (null !== current2 && null != workInProgress2.stateNode)
|
|
current2.memoizedProps !== newProps && markUpdate(workInProgress2);
|
|
else {
|
|
if (!newProps) {
|
|
if (null === workInProgress2.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(workInProgress2);
|
|
return null;
|
|
}
|
|
current2 = getHostContext();
|
|
popHydrationState(workInProgress2) ? prepareToHydrateHostInstance(workInProgress2, current2) : (current2 = resolveSingletonInstance(
|
|
type,
|
|
newProps,
|
|
renderLanes2,
|
|
current2,
|
|
true
|
|
), workInProgress2.stateNode = current2, markUpdate(workInProgress2));
|
|
}
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
case 5:
|
|
popHostContext(workInProgress2);
|
|
type = workInProgress2.type;
|
|
if (null !== current2 && null != workInProgress2.stateNode)
|
|
current2.memoizedProps !== newProps && markUpdate(workInProgress2);
|
|
else {
|
|
if (!newProps) {
|
|
if (null === workInProgress2.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(workInProgress2);
|
|
return null;
|
|
}
|
|
var _currentHostContext = getHostContext();
|
|
if (popHydrationState(workInProgress2))
|
|
prepareToHydrateHostInstance(workInProgress2, _currentHostContext);
|
|
else {
|
|
nextResource = requiredContext(rootInstanceStackCursor.current);
|
|
validateDOMNesting(type, _currentHostContext.ancestorInfo);
|
|
_currentHostContext = _currentHostContext.context;
|
|
nextResource = getOwnerDocumentFromRootContainer(nextResource);
|
|
switch (_currentHostContext) {
|
|
case HostContextNamespaceSvg:
|
|
nextResource = nextResource.createElementNS(
|
|
SVG_NAMESPACE,
|
|
type
|
|
);
|
|
break;
|
|
case HostContextNamespaceMath:
|
|
nextResource = nextResource.createElementNS(
|
|
MATH_NAMESPACE,
|
|
type
|
|
);
|
|
break;
|
|
default:
|
|
switch (type) {
|
|
case "svg":
|
|
nextResource = nextResource.createElementNS(
|
|
SVG_NAMESPACE,
|
|
type
|
|
);
|
|
break;
|
|
case "math":
|
|
nextResource = nextResource.createElementNS(
|
|
MATH_NAMESPACE,
|
|
type
|
|
);
|
|
break;
|
|
case "script":
|
|
nextResource = nextResource.createElement("div");
|
|
nextResource.innerHTML = "<script><\/script>";
|
|
nextResource = nextResource.removeChild(
|
|
nextResource.firstChild
|
|
);
|
|
break;
|
|
case "select":
|
|
nextResource = "string" === typeof newProps.is ? nextResource.createElement("select", {
|
|
is: newProps.is
|
|
}) : nextResource.createElement("select");
|
|
newProps.multiple ? nextResource.multiple = true : newProps.size && (nextResource.size = newProps.size);
|
|
break;
|
|
default:
|
|
nextResource = "string" === typeof newProps.is ? nextResource.createElement(type, {
|
|
is: newProps.is
|
|
}) : nextResource.createElement(type), -1 === type.indexOf("-") && (type !== type.toLowerCase() && console.error(
|
|
"<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",
|
|
type
|
|
), "[object HTMLUnknownElement]" !== Object.prototype.toString.call(nextResource) || hasOwnProperty.call(warnedUnknownTags, type) || (warnedUnknownTags[type] = true, console.error(
|
|
"The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.",
|
|
type
|
|
)));
|
|
}
|
|
}
|
|
nextResource[internalInstanceKey] = workInProgress2;
|
|
nextResource[internalPropsKey] = newProps;
|
|
a: for (_currentHostContext = workInProgress2.child; null !== _currentHostContext; ) {
|
|
if (5 === _currentHostContext.tag || 6 === _currentHostContext.tag)
|
|
nextResource.appendChild(_currentHostContext.stateNode);
|
|
else if (4 !== _currentHostContext.tag && 27 !== _currentHostContext.tag && null !== _currentHostContext.child) {
|
|
_currentHostContext.child.return = _currentHostContext;
|
|
_currentHostContext = _currentHostContext.child;
|
|
continue;
|
|
}
|
|
if (_currentHostContext === workInProgress2) break a;
|
|
for (; null === _currentHostContext.sibling; ) {
|
|
if (null === _currentHostContext.return || _currentHostContext.return === workInProgress2)
|
|
break a;
|
|
_currentHostContext = _currentHostContext.return;
|
|
}
|
|
_currentHostContext.sibling.return = _currentHostContext.return;
|
|
_currentHostContext = _currentHostContext.sibling;
|
|
}
|
|
workInProgress2.stateNode = nextResource;
|
|
a: switch (setInitialProperties(nextResource, type, newProps), type) {
|
|
case "button":
|
|
case "input":
|
|
case "select":
|
|
case "textarea":
|
|
newProps = !!newProps.autoFocus;
|
|
break a;
|
|
case "img":
|
|
newProps = true;
|
|
break a;
|
|
default:
|
|
newProps = false;
|
|
}
|
|
newProps && markUpdate(workInProgress2);
|
|
}
|
|
}
|
|
bubbleProperties(workInProgress2);
|
|
preloadInstanceAndSuspendIfNeeded(
|
|
workInProgress2,
|
|
workInProgress2.type,
|
|
null === current2 ? null : current2.memoizedProps,
|
|
workInProgress2.pendingProps,
|
|
renderLanes2
|
|
);
|
|
return null;
|
|
case 6:
|
|
if (current2 && null != workInProgress2.stateNode)
|
|
current2.memoizedProps !== newProps && markUpdate(workInProgress2);
|
|
else {
|
|
if ("string" !== typeof newProps && null === workInProgress2.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."
|
|
);
|
|
current2 = requiredContext(rootInstanceStackCursor.current);
|
|
renderLanes2 = getHostContext();
|
|
if (popHydrationState(workInProgress2)) {
|
|
current2 = workInProgress2.stateNode;
|
|
renderLanes2 = workInProgress2.memoizedProps;
|
|
type = !didSuspendOrErrorDEV;
|
|
newProps = null;
|
|
nextResource = hydrationParentFiber;
|
|
if (null !== nextResource)
|
|
switch (nextResource.tag) {
|
|
case 3:
|
|
type && (type = diffHydratedTextForDevWarnings(
|
|
current2,
|
|
renderLanes2,
|
|
newProps
|
|
), null !== type && (buildHydrationDiffNode(workInProgress2, 0).serverProps = type));
|
|
break;
|
|
case 27:
|
|
case 5:
|
|
newProps = nextResource.memoizedProps, type && (type = diffHydratedTextForDevWarnings(
|
|
current2,
|
|
renderLanes2,
|
|
newProps
|
|
), null !== type && (buildHydrationDiffNode(
|
|
workInProgress2,
|
|
0
|
|
).serverProps = type));
|
|
}
|
|
current2[internalInstanceKey] = workInProgress2;
|
|
current2 = current2.nodeValue === renderLanes2 || null !== newProps && true === newProps.suppressHydrationWarning || checkForUnmatchedText(current2.nodeValue, renderLanes2) ? true : false;
|
|
current2 || throwOnHydrationMismatch(workInProgress2, true);
|
|
} else
|
|
type = renderLanes2.ancestorInfo.current, null != type && validateTextNesting(
|
|
newProps,
|
|
type.tag,
|
|
renderLanes2.ancestorInfo.implicitRootScope
|
|
), current2 = getOwnerDocumentFromRootContainer(current2).createTextNode(
|
|
newProps
|
|
), current2[internalInstanceKey] = workInProgress2, workInProgress2.stateNode = current2;
|
|
}
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
case 31:
|
|
renderLanes2 = workInProgress2.memoizedState;
|
|
if (null === current2 || null !== current2.memoizedState) {
|
|
newProps = popHydrationState(workInProgress2);
|
|
if (null !== renderLanes2) {
|
|
if (null === current2) {
|
|
if (!newProps)
|
|
throw Error(
|
|
"A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React."
|
|
);
|
|
current2 = workInProgress2.memoizedState;
|
|
current2 = null !== current2 ? current2.dehydrated : null;
|
|
if (!current2)
|
|
throw Error(
|
|
"Expected to have a hydrated activity instance. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
current2[internalInstanceKey] = workInProgress2;
|
|
bubbleProperties(workInProgress2);
|
|
(workInProgress2.mode & ProfileMode) !== NoMode && null !== renderLanes2 && (current2 = workInProgress2.child, null !== current2 && (workInProgress2.treeBaseDuration -= current2.treeBaseDuration));
|
|
} else
|
|
emitPendingHydrationWarnings(), resetHydrationState(), 0 === (workInProgress2.flags & 128) && (renderLanes2 = workInProgress2.memoizedState = null), workInProgress2.flags |= 4, bubbleProperties(workInProgress2), (workInProgress2.mode & ProfileMode) !== NoMode && null !== renderLanes2 && (current2 = workInProgress2.child, null !== current2 && (workInProgress2.treeBaseDuration -= current2.treeBaseDuration));
|
|
current2 = false;
|
|
} else
|
|
renderLanes2 = upgradeHydrationErrorsToRecoverable(), null !== current2 && null !== current2.memoizedState && (current2.memoizedState.hydrationErrors = renderLanes2), current2 = true;
|
|
if (!current2) {
|
|
if (workInProgress2.flags & 256)
|
|
return popSuspenseHandler(workInProgress2), workInProgress2;
|
|
popSuspenseHandler(workInProgress2);
|
|
return null;
|
|
}
|
|
if (0 !== (workInProgress2.flags & 128))
|
|
throw Error(
|
|
"Client rendering an Activity suspended it again. This is a bug in React."
|
|
);
|
|
}
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
case 13:
|
|
newProps = workInProgress2.memoizedState;
|
|
if (null === current2 || null !== current2.memoizedState && null !== current2.memoizedState.dehydrated) {
|
|
type = newProps;
|
|
nextResource = popHydrationState(workInProgress2);
|
|
if (null !== type && null !== type.dehydrated) {
|
|
if (null === current2) {
|
|
if (!nextResource)
|
|
throw Error(
|
|
"A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React."
|
|
);
|
|
nextResource = workInProgress2.memoizedState;
|
|
nextResource = null !== nextResource ? nextResource.dehydrated : null;
|
|
if (!nextResource)
|
|
throw Error(
|
|
"Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
nextResource[internalInstanceKey] = workInProgress2;
|
|
bubbleProperties(workInProgress2);
|
|
(workInProgress2.mode & ProfileMode) !== NoMode && null !== type && (type = workInProgress2.child, null !== type && (workInProgress2.treeBaseDuration -= type.treeBaseDuration));
|
|
} else
|
|
emitPendingHydrationWarnings(), resetHydrationState(), 0 === (workInProgress2.flags & 128) && (type = workInProgress2.memoizedState = null), workInProgress2.flags |= 4, bubbleProperties(workInProgress2), (workInProgress2.mode & ProfileMode) !== NoMode && null !== type && (type = workInProgress2.child, null !== type && (workInProgress2.treeBaseDuration -= type.treeBaseDuration));
|
|
type = false;
|
|
} else
|
|
type = upgradeHydrationErrorsToRecoverable(), null !== current2 && null !== current2.memoizedState && (current2.memoizedState.hydrationErrors = type), type = true;
|
|
if (!type) {
|
|
if (workInProgress2.flags & 256)
|
|
return popSuspenseHandler(workInProgress2), workInProgress2;
|
|
popSuspenseHandler(workInProgress2);
|
|
return null;
|
|
}
|
|
}
|
|
popSuspenseHandler(workInProgress2);
|
|
if (0 !== (workInProgress2.flags & 128))
|
|
return workInProgress2.lanes = renderLanes2, (workInProgress2.mode & ProfileMode) !== NoMode && transferActualDuration(workInProgress2), workInProgress2;
|
|
renderLanes2 = null !== newProps;
|
|
current2 = null !== current2 && null !== current2.memoizedState;
|
|
renderLanes2 && (newProps = workInProgress2.child, type = null, null !== newProps.alternate && null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool), nextResource = null, null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && (nextResource = newProps.memoizedState.cachePool.pool), nextResource !== type && (newProps.flags |= 2048));
|
|
renderLanes2 !== current2 && renderLanes2 && (workInProgress2.child.flags |= 8192);
|
|
scheduleRetryEffect(workInProgress2, workInProgress2.updateQueue);
|
|
bubbleProperties(workInProgress2);
|
|
(workInProgress2.mode & ProfileMode) !== NoMode && renderLanes2 && (current2 = workInProgress2.child, null !== current2 && (workInProgress2.treeBaseDuration -= current2.treeBaseDuration));
|
|
return null;
|
|
case 4:
|
|
return popHostContainer(workInProgress2), null === current2 && listenToAllSupportedEvents(
|
|
workInProgress2.stateNode.containerInfo
|
|
), bubbleProperties(workInProgress2), null;
|
|
case 10:
|
|
return popProvider(workInProgress2.type, workInProgress2), bubbleProperties(workInProgress2), null;
|
|
case 19:
|
|
pop(suspenseStackCursor, workInProgress2);
|
|
newProps = workInProgress2.memoizedState;
|
|
if (null === newProps) return bubbleProperties(workInProgress2), null;
|
|
type = 0 !== (workInProgress2.flags & 128);
|
|
nextResource = newProps.rendering;
|
|
if (null === nextResource)
|
|
if (type) cutOffTailIfNeeded(newProps, false);
|
|
else {
|
|
if (workInProgressRootExitStatus !== RootInProgress || null !== current2 && 0 !== (current2.flags & 128))
|
|
for (current2 = workInProgress2.child; null !== current2; ) {
|
|
nextResource = findFirstSuspended(current2);
|
|
if (null !== nextResource) {
|
|
workInProgress2.flags |= 128;
|
|
cutOffTailIfNeeded(newProps, false);
|
|
current2 = nextResource.updateQueue;
|
|
workInProgress2.updateQueue = current2;
|
|
scheduleRetryEffect(workInProgress2, current2);
|
|
workInProgress2.subtreeFlags = 0;
|
|
current2 = renderLanes2;
|
|
for (renderLanes2 = workInProgress2.child; null !== renderLanes2; )
|
|
resetWorkInProgress(renderLanes2, current2), renderLanes2 = renderLanes2.sibling;
|
|
push(
|
|
suspenseStackCursor,
|
|
suspenseStackCursor.current & SubtreeSuspenseContextMask | ForceSuspenseFallback,
|
|
workInProgress2
|
|
);
|
|
isHydrating && pushTreeFork(workInProgress2, newProps.treeForkCount);
|
|
return workInProgress2.child;
|
|
}
|
|
current2 = current2.sibling;
|
|
}
|
|
null !== newProps.tail && now$1() > workInProgressRootRenderTargetTime && (workInProgress2.flags |= 128, type = true, cutOffTailIfNeeded(newProps, false), workInProgress2.lanes = 4194304);
|
|
}
|
|
else {
|
|
if (!type)
|
|
if (current2 = findFirstSuspended(nextResource), null !== current2) {
|
|
if (workInProgress2.flags |= 128, type = true, current2 = current2.updateQueue, workInProgress2.updateQueue = current2, scheduleRetryEffect(workInProgress2, current2), cutOffTailIfNeeded(newProps, true), null === newProps.tail && "hidden" === newProps.tailMode && !nextResource.alternate && !isHydrating)
|
|
return bubbleProperties(workInProgress2), null;
|
|
} else
|
|
2 * now$1() - newProps.renderingStartTime > workInProgressRootRenderTargetTime && 536870912 !== renderLanes2 && (workInProgress2.flags |= 128, type = true, cutOffTailIfNeeded(newProps, false), workInProgress2.lanes = 4194304);
|
|
newProps.isBackwards ? (nextResource.sibling = workInProgress2.child, workInProgress2.child = nextResource) : (current2 = newProps.last, null !== current2 ? current2.sibling = nextResource : workInProgress2.child = nextResource, newProps.last = nextResource);
|
|
}
|
|
if (null !== newProps.tail)
|
|
return current2 = newProps.tail, newProps.rendering = current2, newProps.tail = current2.sibling, newProps.renderingStartTime = now$1(), current2.sibling = null, renderLanes2 = suspenseStackCursor.current, renderLanes2 = type ? renderLanes2 & SubtreeSuspenseContextMask | ForceSuspenseFallback : renderLanes2 & SubtreeSuspenseContextMask, push(suspenseStackCursor, renderLanes2, workInProgress2), isHydrating && pushTreeFork(workInProgress2, newProps.treeForkCount), current2;
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
case 22:
|
|
case 23:
|
|
return popSuspenseHandler(workInProgress2), popHiddenContext(workInProgress2), newProps = null !== workInProgress2.memoizedState, null !== current2 ? null !== current2.memoizedState !== newProps && (workInProgress2.flags |= 8192) : newProps && (workInProgress2.flags |= 8192), newProps ? 0 !== (renderLanes2 & 536870912) && 0 === (workInProgress2.flags & 128) && (bubbleProperties(workInProgress2), workInProgress2.subtreeFlags & 6 && (workInProgress2.flags |= 8192)) : bubbleProperties(workInProgress2), renderLanes2 = workInProgress2.updateQueue, null !== renderLanes2 && scheduleRetryEffect(workInProgress2, renderLanes2.retryQueue), renderLanes2 = null, null !== current2 && null !== current2.memoizedState && null !== current2.memoizedState.cachePool && (renderLanes2 = current2.memoizedState.cachePool.pool), newProps = null, null !== workInProgress2.memoizedState && null !== workInProgress2.memoizedState.cachePool && (newProps = workInProgress2.memoizedState.cachePool.pool), newProps !== renderLanes2 && (workInProgress2.flags |= 2048), null !== current2 && pop(resumedCache, workInProgress2), null;
|
|
case 24:
|
|
return renderLanes2 = null, null !== current2 && (renderLanes2 = current2.memoizedState.cache), workInProgress2.memoizedState.cache !== renderLanes2 && (workInProgress2.flags |= 2048), popProvider(CacheContext, workInProgress2), bubbleProperties(workInProgress2), null;
|
|
case 25:
|
|
return null;
|
|
case 30:
|
|
return null;
|
|
}
|
|
throw Error(
|
|
"Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
}
|
|
function unwindWork(current2, workInProgress2) {
|
|
popTreeContext(workInProgress2);
|
|
switch (workInProgress2.tag) {
|
|
case 1:
|
|
return current2 = workInProgress2.flags, current2 & 65536 ? (workInProgress2.flags = current2 & -65537 | 128, (workInProgress2.mode & ProfileMode) !== NoMode && transferActualDuration(workInProgress2), workInProgress2) : null;
|
|
case 3:
|
|
return popProvider(CacheContext, workInProgress2), popHostContainer(workInProgress2), current2 = workInProgress2.flags, 0 !== (current2 & 65536) && 0 === (current2 & 128) ? (workInProgress2.flags = current2 & -65537 | 128, workInProgress2) : null;
|
|
case 26:
|
|
case 27:
|
|
case 5:
|
|
return popHostContext(workInProgress2), null;
|
|
case 31:
|
|
if (null !== workInProgress2.memoizedState) {
|
|
popSuspenseHandler(workInProgress2);
|
|
if (null === workInProgress2.alternate)
|
|
throw Error(
|
|
"Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue."
|
|
);
|
|
resetHydrationState();
|
|
}
|
|
current2 = workInProgress2.flags;
|
|
return current2 & 65536 ? (workInProgress2.flags = current2 & -65537 | 128, (workInProgress2.mode & ProfileMode) !== NoMode && transferActualDuration(workInProgress2), workInProgress2) : null;
|
|
case 13:
|
|
popSuspenseHandler(workInProgress2);
|
|
current2 = workInProgress2.memoizedState;
|
|
if (null !== current2 && null !== current2.dehydrated) {
|
|
if (null === workInProgress2.alternate)
|
|
throw Error(
|
|
"Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue."
|
|
);
|
|
resetHydrationState();
|
|
}
|
|
current2 = workInProgress2.flags;
|
|
return current2 & 65536 ? (workInProgress2.flags = current2 & -65537 | 128, (workInProgress2.mode & ProfileMode) !== NoMode && transferActualDuration(workInProgress2), workInProgress2) : null;
|
|
case 19:
|
|
return pop(suspenseStackCursor, workInProgress2), null;
|
|
case 4:
|
|
return popHostContainer(workInProgress2), null;
|
|
case 10:
|
|
return popProvider(workInProgress2.type, workInProgress2), null;
|
|
case 22:
|
|
case 23:
|
|
return popSuspenseHandler(workInProgress2), popHiddenContext(workInProgress2), null !== current2 && pop(resumedCache, workInProgress2), current2 = workInProgress2.flags, current2 & 65536 ? (workInProgress2.flags = current2 & -65537 | 128, (workInProgress2.mode & ProfileMode) !== NoMode && transferActualDuration(workInProgress2), workInProgress2) : null;
|
|
case 24:
|
|
return popProvider(CacheContext, workInProgress2), null;
|
|
case 25:
|
|
return null;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
function unwindInterruptedWork(current2, interruptedWork) {
|
|
popTreeContext(interruptedWork);
|
|
switch (interruptedWork.tag) {
|
|
case 3:
|
|
popProvider(CacheContext, interruptedWork);
|
|
popHostContainer(interruptedWork);
|
|
break;
|
|
case 26:
|
|
case 27:
|
|
case 5:
|
|
popHostContext(interruptedWork);
|
|
break;
|
|
case 4:
|
|
popHostContainer(interruptedWork);
|
|
break;
|
|
case 31:
|
|
null !== interruptedWork.memoizedState && popSuspenseHandler(interruptedWork);
|
|
break;
|
|
case 13:
|
|
popSuspenseHandler(interruptedWork);
|
|
break;
|
|
case 19:
|
|
pop(suspenseStackCursor, interruptedWork);
|
|
break;
|
|
case 10:
|
|
popProvider(interruptedWork.type, interruptedWork);
|
|
break;
|
|
case 22:
|
|
case 23:
|
|
popSuspenseHandler(interruptedWork);
|
|
popHiddenContext(interruptedWork);
|
|
null !== current2 && pop(resumedCache, interruptedWork);
|
|
break;
|
|
case 24:
|
|
popProvider(CacheContext, interruptedWork);
|
|
}
|
|
}
|
|
function shouldProfile(current2) {
|
|
return (current2.mode & ProfileMode) !== NoMode;
|
|
}
|
|
function commitHookLayoutEffects(finishedWork, hookFlags) {
|
|
shouldProfile(finishedWork) ? (startEffectTimer(), commitHookEffectListMount(hookFlags, finishedWork), recordEffectDuration()) : commitHookEffectListMount(hookFlags, finishedWork);
|
|
}
|
|
function commitHookLayoutUnmountEffects(finishedWork, nearestMountedAncestor, hookFlags) {
|
|
shouldProfile(finishedWork) ? (startEffectTimer(), commitHookEffectListUnmount(
|
|
hookFlags,
|
|
finishedWork,
|
|
nearestMountedAncestor
|
|
), recordEffectDuration()) : commitHookEffectListUnmount(
|
|
hookFlags,
|
|
finishedWork,
|
|
nearestMountedAncestor
|
|
);
|
|
}
|
|
function commitHookEffectListMount(flags, finishedWork) {
|
|
try {
|
|
var updateQueue = finishedWork.updateQueue, lastEffect = null !== updateQueue ? updateQueue.lastEffect : null;
|
|
if (null !== lastEffect) {
|
|
var firstEffect = lastEffect.next;
|
|
updateQueue = firstEffect;
|
|
do {
|
|
if ((updateQueue.tag & flags) === flags && (lastEffect = void 0, (flags & Insertion5) !== NoFlags && (isRunningInsertionEffect = true), lastEffect = runWithFiberInDEV(
|
|
finishedWork,
|
|
callCreateInDEV,
|
|
updateQueue
|
|
), (flags & Insertion5) !== NoFlags && (isRunningInsertionEffect = false), void 0 !== lastEffect && "function" !== typeof lastEffect)) {
|
|
var hookName = void 0;
|
|
hookName = 0 !== (updateQueue.tag & Layout) ? "useLayoutEffect" : 0 !== (updateQueue.tag & Insertion5) ? "useInsertionEffect" : "useEffect";
|
|
var addendum = void 0;
|
|
addendum = null === lastEffect ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." : "function" === typeof lastEffect.then ? "\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\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" : " You returned: " + lastEffect;
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
function(n, a) {
|
|
console.error(
|
|
"%s must not return anything besides a function, which is used for clean-up.%s",
|
|
n,
|
|
a
|
|
);
|
|
},
|
|
hookName,
|
|
addendum
|
|
);
|
|
}
|
|
updateQueue = updateQueue.next;
|
|
} while (updateQueue !== firstEffect);
|
|
}
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
}
|
|
function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) {
|
|
try {
|
|
var updateQueue = finishedWork.updateQueue, lastEffect = null !== updateQueue ? updateQueue.lastEffect : null;
|
|
if (null !== lastEffect) {
|
|
var firstEffect = lastEffect.next;
|
|
updateQueue = firstEffect;
|
|
do {
|
|
if ((updateQueue.tag & flags) === flags) {
|
|
var inst = updateQueue.inst, destroy = inst.destroy;
|
|
void 0 !== destroy && (inst.destroy = void 0, (flags & Insertion5) !== NoFlags && (isRunningInsertionEffect = true), lastEffect = finishedWork, runWithFiberInDEV(
|
|
lastEffect,
|
|
callDestroyInDEV,
|
|
lastEffect,
|
|
nearestMountedAncestor,
|
|
destroy
|
|
), (flags & Insertion5) !== NoFlags && (isRunningInsertionEffect = false));
|
|
}
|
|
updateQueue = updateQueue.next;
|
|
} while (updateQueue !== firstEffect);
|
|
}
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
}
|
|
function commitHookPassiveMountEffects(finishedWork, hookFlags) {
|
|
shouldProfile(finishedWork) ? (startEffectTimer(), commitHookEffectListMount(hookFlags, finishedWork), recordEffectDuration()) : commitHookEffectListMount(hookFlags, finishedWork);
|
|
}
|
|
function commitHookPassiveUnmountEffects(finishedWork, nearestMountedAncestor, hookFlags) {
|
|
shouldProfile(finishedWork) ? (startEffectTimer(), commitHookEffectListUnmount(
|
|
hookFlags,
|
|
finishedWork,
|
|
nearestMountedAncestor
|
|
), recordEffectDuration()) : commitHookEffectListUnmount(
|
|
hookFlags,
|
|
finishedWork,
|
|
nearestMountedAncestor
|
|
);
|
|
}
|
|
function commitClassCallbacks(finishedWork) {
|
|
var updateQueue = finishedWork.updateQueue;
|
|
if (null !== updateQueue) {
|
|
var instance = finishedWork.stateNode;
|
|
finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || (instance.props !== finishedWork.memoizedProps && console.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"
|
|
), instance.state !== finishedWork.memoizedState && console.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"
|
|
));
|
|
try {
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
commitCallbacks,
|
|
updateQueue,
|
|
instance
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
}
|
|
}
|
|
function callGetSnapshotBeforeUpdates(instance, prevProps, prevState) {
|
|
return instance.getSnapshotBeforeUpdate(prevProps, prevState);
|
|
}
|
|
function commitClassSnapshot(finishedWork, current2) {
|
|
var prevProps = current2.memoizedProps, prevState = current2.memoizedState;
|
|
current2 = finishedWork.stateNode;
|
|
finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || (current2.props !== finishedWork.memoizedProps && console.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"
|
|
), current2.state !== finishedWork.memoizedState && console.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"
|
|
));
|
|
try {
|
|
var resolvedPrevProps = resolveClassComponentProps(
|
|
finishedWork.type,
|
|
prevProps
|
|
);
|
|
var snapshot = runWithFiberInDEV(
|
|
finishedWork,
|
|
callGetSnapshotBeforeUpdates,
|
|
current2,
|
|
resolvedPrevProps,
|
|
prevState
|
|
);
|
|
prevProps = didWarnAboutUndefinedSnapshotBeforeUpdate;
|
|
void 0 !== snapshot || prevProps.has(finishedWork.type) || (prevProps.add(finishedWork.type), runWithFiberInDEV(finishedWork, function() {
|
|
console.error(
|
|
"%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",
|
|
getComponentNameFromFiber(finishedWork)
|
|
);
|
|
}));
|
|
current2.__reactInternalSnapshotBeforeUpdate = snapshot;
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
}
|
|
function safelyCallComponentWillUnmount(current2, nearestMountedAncestor, instance) {
|
|
instance.props = resolveClassComponentProps(
|
|
current2.type,
|
|
current2.memoizedProps
|
|
);
|
|
instance.state = current2.memoizedState;
|
|
shouldProfile(current2) ? (startEffectTimer(), runWithFiberInDEV(
|
|
current2,
|
|
callComponentWillUnmountInDEV,
|
|
current2,
|
|
nearestMountedAncestor,
|
|
instance
|
|
), recordEffectDuration()) : runWithFiberInDEV(
|
|
current2,
|
|
callComponentWillUnmountInDEV,
|
|
current2,
|
|
nearestMountedAncestor,
|
|
instance
|
|
);
|
|
}
|
|
function commitAttachRef(finishedWork) {
|
|
var ref = finishedWork.ref;
|
|
if (null !== ref) {
|
|
switch (finishedWork.tag) {
|
|
case 26:
|
|
case 27:
|
|
case 5:
|
|
var instanceToUse = finishedWork.stateNode;
|
|
break;
|
|
case 30:
|
|
instanceToUse = finishedWork.stateNode;
|
|
break;
|
|
default:
|
|
instanceToUse = finishedWork.stateNode;
|
|
}
|
|
if ("function" === typeof ref)
|
|
if (shouldProfile(finishedWork))
|
|
try {
|
|
startEffectTimer(), finishedWork.refCleanup = ref(instanceToUse);
|
|
} finally {
|
|
recordEffectDuration();
|
|
}
|
|
else finishedWork.refCleanup = ref(instanceToUse);
|
|
else
|
|
"string" === typeof ref ? console.error("String refs are no longer supported.") : ref.hasOwnProperty("current") || console.error(
|
|
"Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",
|
|
getComponentNameFromFiber(finishedWork)
|
|
), ref.current = instanceToUse;
|
|
}
|
|
}
|
|
function safelyAttachRef(current2, nearestMountedAncestor) {
|
|
try {
|
|
runWithFiberInDEV(current2, commitAttachRef, current2);
|
|
} catch (error) {
|
|
captureCommitPhaseError(current2, nearestMountedAncestor, error);
|
|
}
|
|
}
|
|
function safelyDetachRef(current2, nearestMountedAncestor) {
|
|
var ref = current2.ref, refCleanup = current2.refCleanup;
|
|
if (null !== ref)
|
|
if ("function" === typeof refCleanup)
|
|
try {
|
|
if (shouldProfile(current2))
|
|
try {
|
|
startEffectTimer(), runWithFiberInDEV(current2, refCleanup);
|
|
} finally {
|
|
recordEffectDuration(current2);
|
|
}
|
|
else runWithFiberInDEV(current2, refCleanup);
|
|
} catch (error) {
|
|
captureCommitPhaseError(current2, nearestMountedAncestor, error);
|
|
} finally {
|
|
current2.refCleanup = null, current2 = current2.alternate, null != current2 && (current2.refCleanup = null);
|
|
}
|
|
else if ("function" === typeof ref)
|
|
try {
|
|
if (shouldProfile(current2))
|
|
try {
|
|
startEffectTimer(), runWithFiberInDEV(current2, ref, null);
|
|
} finally {
|
|
recordEffectDuration(current2);
|
|
}
|
|
else runWithFiberInDEV(current2, ref, null);
|
|
} catch (error$7) {
|
|
captureCommitPhaseError(current2, nearestMountedAncestor, error$7);
|
|
}
|
|
else ref.current = null;
|
|
}
|
|
function commitProfiler(finishedWork, current2, commitStartTime2, effectDuration) {
|
|
var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onCommit = _finishedWork$memoize.onCommit;
|
|
_finishedWork$memoize = _finishedWork$memoize.onRender;
|
|
current2 = null === current2 ? "mount" : "update";
|
|
currentUpdateIsNested && (current2 = "nested-update");
|
|
"function" === typeof _finishedWork$memoize && _finishedWork$memoize(
|
|
id,
|
|
current2,
|
|
finishedWork.actualDuration,
|
|
finishedWork.treeBaseDuration,
|
|
finishedWork.actualStartTime,
|
|
commitStartTime2
|
|
);
|
|
"function" === typeof onCommit && onCommit(id, current2, effectDuration, commitStartTime2);
|
|
}
|
|
function commitProfilerPostCommitImpl(finishedWork, current2, commitStartTime2, passiveEffectDuration) {
|
|
var _finishedWork$memoize2 = finishedWork.memoizedProps;
|
|
finishedWork = _finishedWork$memoize2.id;
|
|
_finishedWork$memoize2 = _finishedWork$memoize2.onPostCommit;
|
|
current2 = null === current2 ? "mount" : "update";
|
|
currentUpdateIsNested && (current2 = "nested-update");
|
|
"function" === typeof _finishedWork$memoize2 && _finishedWork$memoize2(
|
|
finishedWork,
|
|
current2,
|
|
passiveEffectDuration,
|
|
commitStartTime2
|
|
);
|
|
}
|
|
function commitHostMount(finishedWork) {
|
|
var type = finishedWork.type, props = finishedWork.memoizedProps, instance = finishedWork.stateNode;
|
|
try {
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
commitMount,
|
|
instance,
|
|
type,
|
|
props,
|
|
finishedWork
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
}
|
|
function commitHostUpdate(finishedWork, newProps, oldProps) {
|
|
try {
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
commitUpdate,
|
|
finishedWork.stateNode,
|
|
finishedWork.type,
|
|
oldProps,
|
|
newProps,
|
|
finishedWork
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
}
|
|
function isHostParent(fiber) {
|
|
return 5 === fiber.tag || 3 === fiber.tag || 26 === fiber.tag || 27 === fiber.tag && isSingletonScope(fiber.type) || 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 (27 === fiber.tag && isSingletonScope(fiber.type)) continue a;
|
|
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(node2, before, parent) {
|
|
var tag = node2.tag;
|
|
if (5 === tag || 6 === tag)
|
|
node2 = node2.stateNode, before ? (warnForReactChildrenConflict(parent), (9 === parent.nodeType ? parent.body : "HTML" === parent.nodeName ? parent.ownerDocument.body : parent).insertBefore(node2, before)) : (warnForReactChildrenConflict(parent), before = 9 === parent.nodeType ? parent.body : "HTML" === parent.nodeName ? parent.ownerDocument.body : parent, before.appendChild(node2), parent = parent._reactRootContainer, null !== parent && void 0 !== parent || null !== before.onclick || (before.onclick = noop$1));
|
|
else if (4 !== tag && (27 === tag && isSingletonScope(node2.type) && (parent = node2.stateNode, before = null), node2 = node2.child, null !== node2))
|
|
for (insertOrAppendPlacementNodeIntoContainer(node2, before, parent), node2 = node2.sibling; null !== node2; )
|
|
insertOrAppendPlacementNodeIntoContainer(node2, before, parent), node2 = node2.sibling;
|
|
}
|
|
function insertOrAppendPlacementNode(node2, before, parent) {
|
|
var tag = node2.tag;
|
|
if (5 === tag || 6 === tag)
|
|
node2 = node2.stateNode, before ? parent.insertBefore(node2, before) : parent.appendChild(node2);
|
|
else if (4 !== tag && (27 === tag && isSingletonScope(node2.type) && (parent = node2.stateNode), node2 = node2.child, null !== node2))
|
|
for (insertOrAppendPlacementNode(node2, before, parent), node2 = node2.sibling; null !== node2; )
|
|
insertOrAppendPlacementNode(node2, before, parent), node2 = node2.sibling;
|
|
}
|
|
function commitPlacement(finishedWork) {
|
|
for (var hostParentFiber, parentFiber = finishedWork.return; null !== parentFiber; ) {
|
|
if (isHostParent(parentFiber)) {
|
|
hostParentFiber = parentFiber;
|
|
break;
|
|
}
|
|
parentFiber = parentFiber.return;
|
|
}
|
|
if (null == hostParentFiber)
|
|
throw Error(
|
|
"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
switch (hostParentFiber.tag) {
|
|
case 27:
|
|
hostParentFiber = hostParentFiber.stateNode;
|
|
parentFiber = getHostSibling(finishedWork);
|
|
insertOrAppendPlacementNode(
|
|
finishedWork,
|
|
parentFiber,
|
|
hostParentFiber
|
|
);
|
|
break;
|
|
case 5:
|
|
parentFiber = hostParentFiber.stateNode;
|
|
hostParentFiber.flags & 32 && (resetTextContent(parentFiber), hostParentFiber.flags &= -33);
|
|
hostParentFiber = getHostSibling(finishedWork);
|
|
insertOrAppendPlacementNode(
|
|
finishedWork,
|
|
hostParentFiber,
|
|
parentFiber
|
|
);
|
|
break;
|
|
case 3:
|
|
case 4:
|
|
hostParentFiber = hostParentFiber.stateNode.containerInfo;
|
|
parentFiber = getHostSibling(finishedWork);
|
|
insertOrAppendPlacementNodeIntoContainer(
|
|
finishedWork,
|
|
parentFiber,
|
|
hostParentFiber
|
|
);
|
|
break;
|
|
default:
|
|
throw Error(
|
|
"Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
}
|
|
}
|
|
function commitHostSingletonAcquisition(finishedWork) {
|
|
var singleton = finishedWork.stateNode, props = finishedWork.memoizedProps;
|
|
try {
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
acquireSingletonInstance,
|
|
finishedWork.type,
|
|
props,
|
|
singleton,
|
|
finishedWork
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
}
|
|
function isHydratingParent(current2, finishedWork) {
|
|
return 31 === finishedWork.tag ? (finishedWork = finishedWork.memoizedState, null !== current2.memoizedState && null === finishedWork) : 13 === finishedWork.tag ? (current2 = current2.memoizedState, finishedWork = finishedWork.memoizedState, null !== current2 && null !== current2.dehydrated && (null === finishedWork || null === finishedWork.dehydrated)) : 3 === finishedWork.tag ? current2.memoizedState.isDehydrated && 0 === (finishedWork.flags & 256) : false;
|
|
}
|
|
function commitBeforeMutationEffects(root2, firstChild) {
|
|
root2 = root2.containerInfo;
|
|
eventsEnabled = _enabled;
|
|
root2 = getActiveElementDeep(root2);
|
|
if (hasSelectionCapabilities(root2)) {
|
|
if ("selectionStart" in root2)
|
|
var JSCompiler_temp = {
|
|
start: root2.selectionStart,
|
|
end: root2.selectionEnd
|
|
};
|
|
else
|
|
a: {
|
|
JSCompiler_temp = (JSCompiler_temp = root2.ownerDocument) && JSCompiler_temp.defaultView || window;
|
|
var selection = JSCompiler_temp.getSelection && JSCompiler_temp.getSelection();
|
|
if (selection && 0 !== selection.rangeCount) {
|
|
JSCompiler_temp = selection.anchorNode;
|
|
var anchorOffset = selection.anchorOffset, focusNode = selection.focusNode;
|
|
selection = selection.focusOffset;
|
|
try {
|
|
JSCompiler_temp.nodeType, focusNode.nodeType;
|
|
} catch (e$2) {
|
|
JSCompiler_temp = null;
|
|
break a;
|
|
}
|
|
var length2 = 0, start = -1, end = -1, indexWithinAnchor = 0, indexWithinFocus = 0, node2 = root2, parentNode = null;
|
|
b: for (; ; ) {
|
|
for (var next2; ; ) {
|
|
node2 !== JSCompiler_temp || 0 !== anchorOffset && 3 !== node2.nodeType || (start = length2 + anchorOffset);
|
|
node2 !== focusNode || 0 !== selection && 3 !== node2.nodeType || (end = length2 + selection);
|
|
3 === node2.nodeType && (length2 += node2.nodeValue.length);
|
|
if (null === (next2 = node2.firstChild)) break;
|
|
parentNode = node2;
|
|
node2 = next2;
|
|
}
|
|
for (; ; ) {
|
|
if (node2 === root2) break b;
|
|
parentNode === JSCompiler_temp && ++indexWithinAnchor === anchorOffset && (start = length2);
|
|
parentNode === focusNode && ++indexWithinFocus === selection && (end = length2);
|
|
if (null !== (next2 = node2.nextSibling)) break;
|
|
node2 = parentNode;
|
|
parentNode = node2.parentNode;
|
|
}
|
|
node2 = next2;
|
|
}
|
|
JSCompiler_temp = -1 === start || -1 === end ? null : { start, end };
|
|
} else JSCompiler_temp = null;
|
|
}
|
|
JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 };
|
|
} else JSCompiler_temp = null;
|
|
selectionInformation = {
|
|
focusedElem: root2,
|
|
selectionRange: JSCompiler_temp
|
|
};
|
|
_enabled = false;
|
|
for (nextEffect = firstChild; null !== nextEffect; )
|
|
if (firstChild = nextEffect, root2 = firstChild.child, 0 !== (firstChild.subtreeFlags & 1028) && null !== root2)
|
|
root2.return = firstChild, nextEffect = root2;
|
|
else
|
|
for (; null !== nextEffect; ) {
|
|
root2 = firstChild = nextEffect;
|
|
JSCompiler_temp = root2.alternate;
|
|
anchorOffset = root2.flags;
|
|
switch (root2.tag) {
|
|
case 0:
|
|
if (0 !== (anchorOffset & 4) && (root2 = root2.updateQueue, root2 = null !== root2 ? root2.events : null, null !== root2))
|
|
for (JSCompiler_temp = 0; JSCompiler_temp < root2.length; JSCompiler_temp++)
|
|
anchorOffset = root2[JSCompiler_temp], anchorOffset.ref.impl = anchorOffset.nextImpl;
|
|
break;
|
|
case 11:
|
|
case 15:
|
|
break;
|
|
case 1:
|
|
0 !== (anchorOffset & 1024) && null !== JSCompiler_temp && commitClassSnapshot(root2, JSCompiler_temp);
|
|
break;
|
|
case 3:
|
|
if (0 !== (anchorOffset & 1024)) {
|
|
if (root2 = root2.stateNode.containerInfo, JSCompiler_temp = root2.nodeType, 9 === JSCompiler_temp)
|
|
clearContainerSparingly(root2);
|
|
else if (1 === JSCompiler_temp)
|
|
switch (root2.nodeName) {
|
|
case "HEAD":
|
|
case "HTML":
|
|
case "BODY":
|
|
clearContainerSparingly(root2);
|
|
break;
|
|
default:
|
|
root2.textContent = "";
|
|
}
|
|
}
|
|
break;
|
|
case 5:
|
|
case 26:
|
|
case 27:
|
|
case 6:
|
|
case 4:
|
|
case 17:
|
|
break;
|
|
default:
|
|
if (0 !== (anchorOffset & 1024))
|
|
throw Error(
|
|
"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
}
|
|
root2 = firstChild.sibling;
|
|
if (null !== root2) {
|
|
root2.return = firstChild.return;
|
|
nextEffect = root2;
|
|
break;
|
|
}
|
|
nextEffect = firstChild.return;
|
|
}
|
|
}
|
|
function commitLayoutEffectOnFiber(finishedRoot, current2, finishedWork) {
|
|
var prevEffectStart = pushComponentEffectStart(), prevEffectDuration = pushComponentEffectDuration(), prevEffectErrors = pushComponentEffectErrors(), prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), flags = finishedWork.flags;
|
|
switch (finishedWork.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 15:
|
|
recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
|
|
flags & 4 && commitHookLayoutEffects(finishedWork, Layout | HasEffect);
|
|
break;
|
|
case 1:
|
|
recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
|
|
if (flags & 4)
|
|
if (finishedRoot = finishedWork.stateNode, null === current2)
|
|
finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || (finishedRoot.props !== finishedWork.memoizedProps && console.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"
|
|
), finishedRoot.state !== finishedWork.memoizedState && console.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"
|
|
)), shouldProfile(finishedWork) ? (startEffectTimer(), runWithFiberInDEV(
|
|
finishedWork,
|
|
callComponentDidMountInDEV,
|
|
finishedWork,
|
|
finishedRoot
|
|
), recordEffectDuration()) : runWithFiberInDEV(
|
|
finishedWork,
|
|
callComponentDidMountInDEV,
|
|
finishedWork,
|
|
finishedRoot
|
|
);
|
|
else {
|
|
var prevProps = resolveClassComponentProps(
|
|
finishedWork.type,
|
|
current2.memoizedProps
|
|
);
|
|
current2 = current2.memoizedState;
|
|
finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || (finishedRoot.props !== finishedWork.memoizedProps && console.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"
|
|
), finishedRoot.state !== finishedWork.memoizedState && console.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"
|
|
));
|
|
shouldProfile(finishedWork) ? (startEffectTimer(), runWithFiberInDEV(
|
|
finishedWork,
|
|
callComponentDidUpdateInDEV,
|
|
finishedWork,
|
|
finishedRoot,
|
|
prevProps,
|
|
current2,
|
|
finishedRoot.__reactInternalSnapshotBeforeUpdate
|
|
), recordEffectDuration()) : runWithFiberInDEV(
|
|
finishedWork,
|
|
callComponentDidUpdateInDEV,
|
|
finishedWork,
|
|
finishedRoot,
|
|
prevProps,
|
|
current2,
|
|
finishedRoot.__reactInternalSnapshotBeforeUpdate
|
|
);
|
|
}
|
|
flags & 64 && commitClassCallbacks(finishedWork);
|
|
flags & 512 && safelyAttachRef(finishedWork, finishedWork.return);
|
|
break;
|
|
case 3:
|
|
current2 = pushNestedEffectDurations();
|
|
recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
|
|
if (flags & 64 && (flags = finishedWork.updateQueue, null !== flags)) {
|
|
prevProps = null;
|
|
if (null !== finishedWork.child)
|
|
switch (finishedWork.child.tag) {
|
|
case 27:
|
|
case 5:
|
|
prevProps = finishedWork.child.stateNode;
|
|
break;
|
|
case 1:
|
|
prevProps = finishedWork.child.stateNode;
|
|
}
|
|
try {
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
commitCallbacks,
|
|
flags,
|
|
prevProps
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
}
|
|
finishedRoot.effectDuration += popNestedEffectDurations(current2);
|
|
break;
|
|
case 27:
|
|
null === current2 && flags & 4 && commitHostSingletonAcquisition(finishedWork);
|
|
case 26:
|
|
case 5:
|
|
recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
|
|
if (null === current2) {
|
|
if (flags & 4) commitHostMount(finishedWork);
|
|
else if (flags & 64) {
|
|
finishedRoot = finishedWork.type;
|
|
current2 = finishedWork.memoizedProps;
|
|
prevProps = finishedWork.stateNode;
|
|
try {
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
commitHydratedInstance,
|
|
prevProps,
|
|
finishedRoot,
|
|
current2,
|
|
finishedWork
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(
|
|
finishedWork,
|
|
finishedWork.return,
|
|
error
|
|
);
|
|
}
|
|
}
|
|
}
|
|
flags & 512 && safelyAttachRef(finishedWork, finishedWork.return);
|
|
break;
|
|
case 12:
|
|
if (flags & 4) {
|
|
flags = pushNestedEffectDurations();
|
|
recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
|
|
finishedRoot = finishedWork.stateNode;
|
|
finishedRoot.effectDuration += bubbleNestedEffectDurations(flags);
|
|
try {
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
commitProfiler,
|
|
finishedWork,
|
|
current2,
|
|
commitStartTime,
|
|
finishedRoot.effectDuration
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
} else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
|
|
break;
|
|
case 31:
|
|
recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
|
|
flags & 4 && commitActivityHydrationCallbacks(finishedRoot, finishedWork);
|
|
break;
|
|
case 13:
|
|
recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
|
|
flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
|
|
flags & 64 && (finishedRoot = finishedWork.memoizedState, null !== finishedRoot && (finishedRoot = finishedRoot.dehydrated, null !== finishedRoot && (flags = retryDehydratedSuspenseBoundary.bind(
|
|
null,
|
|
finishedWork
|
|
), registerSuspenseInstanceRetry(finishedRoot, flags))));
|
|
break;
|
|
case 22:
|
|
flags = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden;
|
|
if (!flags) {
|
|
current2 = null !== current2 && null !== current2.memoizedState || offscreenSubtreeWasHidden;
|
|
prevProps = offscreenSubtreeIsHidden;
|
|
var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
|
|
offscreenSubtreeIsHidden = flags;
|
|
(offscreenSubtreeWasHidden = current2) && !prevOffscreenSubtreeWasHidden ? (recursivelyTraverseReappearLayoutEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
0 !== (finishedWork.subtreeFlags & 8772)
|
|
), (finishedWork.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && 0.05 < componentEffectEndTime - componentEffectStartTime && logComponentReappeared(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime
|
|
)) : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
|
|
offscreenSubtreeIsHidden = prevProps;
|
|
offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
|
|
}
|
|
break;
|
|
case 30:
|
|
break;
|
|
default:
|
|
recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
|
|
}
|
|
(finishedWork.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && ((componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && logComponentEffect(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
componentEffectDuration,
|
|
componentEffectErrors
|
|
), null === finishedWork.alternate && null !== finishedWork.return && null !== finishedWork.return.alternate && 0.05 < componentEffectEndTime - componentEffectStartTime && (isHydratingParent(
|
|
finishedWork.return.alternate,
|
|
finishedWork.return
|
|
) || logComponentTrigger(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
"Mount"
|
|
)));
|
|
popComponentEffectStart(prevEffectStart);
|
|
popComponentEffectDuration(prevEffectDuration);
|
|
componentEffectErrors = prevEffectErrors;
|
|
componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate;
|
|
}
|
|
function detachFiberAfterEffects(fiber) {
|
|
var alternate = fiber.alternate;
|
|
null !== alternate && (fiber.alternate = null, detachFiberAfterEffects(alternate));
|
|
fiber.child = null;
|
|
fiber.deletions = null;
|
|
fiber.sibling = null;
|
|
5 === fiber.tag && (alternate = fiber.stateNode, null !== alternate && detachDeletedInstance(alternate));
|
|
fiber.stateNode = null;
|
|
fiber._debugOwner = 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) {
|
|
hasLoggedError || (hasLoggedError = true, console.error(
|
|
"React instrumentation encountered an error: %o",
|
|
err
|
|
));
|
|
}
|
|
var prevEffectStart = pushComponentEffectStart(), prevEffectDuration = pushComponentEffectDuration(), prevEffectErrors = pushComponentEffectErrors(), prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate();
|
|
switch (deletedFiber.tag) {
|
|
case 26:
|
|
offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor);
|
|
recursivelyTraverseDeletionEffects(
|
|
finishedRoot,
|
|
nearestMountedAncestor,
|
|
deletedFiber
|
|
);
|
|
deletedFiber.memoizedState ? deletedFiber.memoizedState.count-- : deletedFiber.stateNode && (finishedRoot = deletedFiber.stateNode, finishedRoot.parentNode.removeChild(finishedRoot));
|
|
break;
|
|
case 27:
|
|
offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor);
|
|
var prevHostParent = hostParent, prevHostParentIsContainer = hostParentIsContainer;
|
|
isSingletonScope(deletedFiber.type) && (hostParent = deletedFiber.stateNode, hostParentIsContainer = false);
|
|
recursivelyTraverseDeletionEffects(
|
|
finishedRoot,
|
|
nearestMountedAncestor,
|
|
deletedFiber
|
|
);
|
|
runWithFiberInDEV(
|
|
deletedFiber,
|
|
releaseSingletonInstance,
|
|
deletedFiber.stateNode
|
|
);
|
|
hostParent = prevHostParent;
|
|
hostParentIsContainer = prevHostParentIsContainer;
|
|
break;
|
|
case 5:
|
|
offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor);
|
|
case 6:
|
|
prevHostParent = hostParent;
|
|
prevHostParentIsContainer = hostParentIsContainer;
|
|
hostParent = null;
|
|
recursivelyTraverseDeletionEffects(
|
|
finishedRoot,
|
|
nearestMountedAncestor,
|
|
deletedFiber
|
|
);
|
|
hostParent = prevHostParent;
|
|
hostParentIsContainer = prevHostParentIsContainer;
|
|
if (null !== hostParent)
|
|
if (hostParentIsContainer)
|
|
try {
|
|
runWithFiberInDEV(
|
|
deletedFiber,
|
|
removeChildFromContainer,
|
|
hostParent,
|
|
deletedFiber.stateNode
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(
|
|
deletedFiber,
|
|
nearestMountedAncestor,
|
|
error
|
|
);
|
|
}
|
|
else
|
|
try {
|
|
runWithFiberInDEV(
|
|
deletedFiber,
|
|
removeChild,
|
|
hostParent,
|
|
deletedFiber.stateNode
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(
|
|
deletedFiber,
|
|
nearestMountedAncestor,
|
|
error
|
|
);
|
|
}
|
|
break;
|
|
case 18:
|
|
null !== hostParent && (hostParentIsContainer ? (finishedRoot = hostParent, clearHydrationBoundary(
|
|
9 === finishedRoot.nodeType ? finishedRoot.body : "HTML" === finishedRoot.nodeName ? finishedRoot.ownerDocument.body : finishedRoot,
|
|
deletedFiber.stateNode
|
|
), retryIfBlockedOn(finishedRoot)) : clearHydrationBoundary(hostParent, deletedFiber.stateNode));
|
|
break;
|
|
case 4:
|
|
prevHostParent = hostParent;
|
|
prevHostParentIsContainer = hostParentIsContainer;
|
|
hostParent = deletedFiber.stateNode.containerInfo;
|
|
hostParentIsContainer = true;
|
|
recursivelyTraverseDeletionEffects(
|
|
finishedRoot,
|
|
nearestMountedAncestor,
|
|
deletedFiber
|
|
);
|
|
hostParent = prevHostParent;
|
|
hostParentIsContainer = prevHostParentIsContainer;
|
|
break;
|
|
case 0:
|
|
case 11:
|
|
case 14:
|
|
case 15:
|
|
commitHookEffectListUnmount(
|
|
Insertion5,
|
|
deletedFiber,
|
|
nearestMountedAncestor
|
|
);
|
|
offscreenSubtreeWasHidden || commitHookLayoutUnmountEffects(
|
|
deletedFiber,
|
|
nearestMountedAncestor,
|
|
Layout
|
|
);
|
|
recursivelyTraverseDeletionEffects(
|
|
finishedRoot,
|
|
nearestMountedAncestor,
|
|
deletedFiber
|
|
);
|
|
break;
|
|
case 1:
|
|
offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), prevHostParent = deletedFiber.stateNode, "function" === typeof prevHostParent.componentWillUnmount && safelyCallComponentWillUnmount(
|
|
deletedFiber,
|
|
nearestMountedAncestor,
|
|
prevHostParent
|
|
));
|
|
recursivelyTraverseDeletionEffects(
|
|
finishedRoot,
|
|
nearestMountedAncestor,
|
|
deletedFiber
|
|
);
|
|
break;
|
|
case 21:
|
|
recursivelyTraverseDeletionEffects(
|
|
finishedRoot,
|
|
nearestMountedAncestor,
|
|
deletedFiber
|
|
);
|
|
break;
|
|
case 22:
|
|
offscreenSubtreeWasHidden = (prevHostParent = offscreenSubtreeWasHidden) || null !== deletedFiber.memoizedState;
|
|
recursivelyTraverseDeletionEffects(
|
|
finishedRoot,
|
|
nearestMountedAncestor,
|
|
deletedFiber
|
|
);
|
|
offscreenSubtreeWasHidden = prevHostParent;
|
|
break;
|
|
default:
|
|
recursivelyTraverseDeletionEffects(
|
|
finishedRoot,
|
|
nearestMountedAncestor,
|
|
deletedFiber
|
|
);
|
|
}
|
|
(deletedFiber.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && logComponentEffect(
|
|
deletedFiber,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
componentEffectDuration,
|
|
componentEffectErrors
|
|
);
|
|
popComponentEffectStart(prevEffectStart);
|
|
popComponentEffectDuration(prevEffectDuration);
|
|
componentEffectErrors = prevEffectErrors;
|
|
componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate;
|
|
}
|
|
function commitActivityHydrationCallbacks(finishedRoot, finishedWork) {
|
|
if (null === finishedWork.memoizedState && (finishedRoot = finishedWork.alternate, null !== finishedRoot && (finishedRoot = finishedRoot.memoizedState, null !== finishedRoot))) {
|
|
finishedRoot = finishedRoot.dehydrated;
|
|
try {
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
commitHydratedActivityInstance,
|
|
finishedRoot
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
}
|
|
}
|
|
function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
|
|
if (null === finishedWork.memoizedState && (finishedRoot = finishedWork.alternate, null !== finishedRoot && (finishedRoot = finishedRoot.memoizedState, null !== finishedRoot && (finishedRoot = finishedRoot.dehydrated, null !== finishedRoot))))
|
|
try {
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
commitHydratedSuspenseInstance,
|
|
finishedRoot
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
}
|
|
function getRetryCache(finishedWork) {
|
|
switch (finishedWork.tag) {
|
|
case 31:
|
|
case 13:
|
|
case 19:
|
|
var retryCache = finishedWork.stateNode;
|
|
null === retryCache && (retryCache = finishedWork.stateNode = new PossiblyWeakSet());
|
|
return retryCache;
|
|
case 22:
|
|
return finishedWork = finishedWork.stateNode, retryCache = finishedWork._retryCache, null === retryCache && (retryCache = finishedWork._retryCache = new PossiblyWeakSet()), retryCache;
|
|
default:
|
|
throw Error(
|
|
"Unexpected Suspense handler tag (" + finishedWork.tag + "). This is a bug in React."
|
|
);
|
|
}
|
|
}
|
|
function attachSuspenseRetryListeners(finishedWork, wakeables) {
|
|
var retryCache = getRetryCache(finishedWork);
|
|
wakeables.forEach(function(wakeable) {
|
|
if (!retryCache.has(wakeable)) {
|
|
retryCache.add(wakeable);
|
|
if (isDevToolsPresent)
|
|
if (null !== inProgressLanes && null !== inProgressRoot)
|
|
restorePendingUpdaters(inProgressRoot, inProgressLanes);
|
|
else
|
|
throw Error(
|
|
"Expected finished root and lanes to be set. This is a bug in React."
|
|
);
|
|
var retry = resolveRetryWakeable.bind(null, finishedWork, 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 root2 = root$jscomp$0, returnFiber = parentFiber, deletedFiber = deletions[i], prevEffectStart = pushComponentEffectStart(), parent = returnFiber;
|
|
a: for (; null !== parent; ) {
|
|
switch (parent.tag) {
|
|
case 27:
|
|
if (isSingletonScope(parent.type)) {
|
|
hostParent = parent.stateNode;
|
|
hostParentIsContainer = false;
|
|
break a;
|
|
}
|
|
break;
|
|
case 5:
|
|
hostParent = parent.stateNode;
|
|
hostParentIsContainer = false;
|
|
break a;
|
|
case 3:
|
|
case 4:
|
|
hostParent = parent.stateNode.containerInfo;
|
|
hostParentIsContainer = true;
|
|
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(root2, returnFiber, deletedFiber);
|
|
hostParent = null;
|
|
hostParentIsContainer = false;
|
|
(deletedFiber.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && 0.05 < componentEffectEndTime - componentEffectStartTime && logComponentTrigger(
|
|
deletedFiber,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
"Unmount"
|
|
);
|
|
popComponentEffectStart(prevEffectStart);
|
|
root2 = deletedFiber;
|
|
returnFiber = root2.alternate;
|
|
null !== returnFiber && (returnFiber.return = null);
|
|
root2.return = null;
|
|
}
|
|
if (parentFiber.subtreeFlags & 13886)
|
|
for (parentFiber = parentFiber.child; null !== parentFiber; )
|
|
commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), parentFiber = parentFiber.sibling;
|
|
}
|
|
function commitMutationEffectsOnFiber(finishedWork, root2) {
|
|
var prevEffectStart = pushComponentEffectStart(), prevEffectDuration = pushComponentEffectDuration(), prevEffectErrors = pushComponentEffectErrors(), prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), current2 = finishedWork.alternate, flags = finishedWork.flags;
|
|
switch (finishedWork.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 14:
|
|
case 15:
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
flags & 4 && (commitHookEffectListUnmount(
|
|
Insertion5 | HasEffect,
|
|
finishedWork,
|
|
finishedWork.return
|
|
), commitHookEffectListMount(Insertion5 | HasEffect, finishedWork), commitHookLayoutUnmountEffects(
|
|
finishedWork,
|
|
finishedWork.return,
|
|
Layout | HasEffect
|
|
));
|
|
break;
|
|
case 1:
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
flags & 512 && (offscreenSubtreeWasHidden || null === current2 || safelyDetachRef(current2, current2.return));
|
|
if (flags & 64 && offscreenSubtreeIsHidden && (flags = finishedWork.updateQueue, null !== flags && (current2 = flags.callbacks, null !== current2))) {
|
|
var existingHiddenCallbacks = flags.shared.hiddenCallbacks;
|
|
flags.shared.hiddenCallbacks = null === existingHiddenCallbacks ? current2 : existingHiddenCallbacks.concat(current2);
|
|
}
|
|
break;
|
|
case 26:
|
|
existingHiddenCallbacks = currentHoistableRoot;
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
flags & 512 && (offscreenSubtreeWasHidden || null === current2 || safelyDetachRef(current2, current2.return));
|
|
if (flags & 4) {
|
|
var currentResource = null !== current2 ? current2.memoizedState : null;
|
|
flags = finishedWork.memoizedState;
|
|
if (null === current2)
|
|
if (null === flags)
|
|
if (null === finishedWork.stateNode) {
|
|
a: {
|
|
flags = finishedWork.type;
|
|
current2 = finishedWork.memoizedProps;
|
|
existingHiddenCallbacks = existingHiddenCallbacks.ownerDocument || existingHiddenCallbacks;
|
|
b: switch (flags) {
|
|
case "title":
|
|
currentResource = existingHiddenCallbacks.getElementsByTagName(
|
|
"title"
|
|
)[0];
|
|
if (!currentResource || currentResource[internalHoistableMarker] || currentResource[internalInstanceKey] || currentResource.namespaceURI === SVG_NAMESPACE || currentResource.hasAttribute("itemprop"))
|
|
currentResource = existingHiddenCallbacks.createElement(flags), existingHiddenCallbacks.head.insertBefore(
|
|
currentResource,
|
|
existingHiddenCallbacks.querySelector(
|
|
"head > title"
|
|
)
|
|
);
|
|
setInitialProperties(currentResource, flags, current2);
|
|
currentResource[internalInstanceKey] = finishedWork;
|
|
markNodeAsHoistable(currentResource);
|
|
flags = currentResource;
|
|
break a;
|
|
case "link":
|
|
var maybeNodes = getHydratableHoistableCache(
|
|
"link",
|
|
"href",
|
|
existingHiddenCallbacks
|
|
).get(flags + (current2.href || ""));
|
|
if (maybeNodes) {
|
|
for (var i = 0; i < maybeNodes.length; i++)
|
|
if (currentResource = maybeNodes[i], currentResource.getAttribute("href") === (null == current2.href || "" === current2.href ? null : current2.href) && currentResource.getAttribute("rel") === (null == current2.rel ? null : current2.rel) && currentResource.getAttribute("title") === (null == current2.title ? null : current2.title) && currentResource.getAttribute("crossorigin") === (null == current2.crossOrigin ? null : current2.crossOrigin)) {
|
|
maybeNodes.splice(i, 1);
|
|
break b;
|
|
}
|
|
}
|
|
currentResource = existingHiddenCallbacks.createElement(flags);
|
|
setInitialProperties(currentResource, flags, current2);
|
|
existingHiddenCallbacks.head.appendChild(
|
|
currentResource
|
|
);
|
|
break;
|
|
case "meta":
|
|
if (maybeNodes = getHydratableHoistableCache(
|
|
"meta",
|
|
"content",
|
|
existingHiddenCallbacks
|
|
).get(flags + (current2.content || ""))) {
|
|
for (i = 0; i < maybeNodes.length; i++)
|
|
if (currentResource = maybeNodes[i], checkAttributeStringCoercion(
|
|
current2.content,
|
|
"content"
|
|
), currentResource.getAttribute("content") === (null == current2.content ? null : "" + current2.content) && currentResource.getAttribute("name") === (null == current2.name ? null : current2.name) && currentResource.getAttribute("property") === (null == current2.property ? null : current2.property) && currentResource.getAttribute("http-equiv") === (null == current2.httpEquiv ? null : current2.httpEquiv) && currentResource.getAttribute("charset") === (null == current2.charSet ? null : current2.charSet)) {
|
|
maybeNodes.splice(i, 1);
|
|
break b;
|
|
}
|
|
}
|
|
currentResource = existingHiddenCallbacks.createElement(flags);
|
|
setInitialProperties(currentResource, flags, current2);
|
|
existingHiddenCallbacks.head.appendChild(
|
|
currentResource
|
|
);
|
|
break;
|
|
default:
|
|
throw Error(
|
|
'getNodesForType encountered a type it did not expect: "' + flags + '". This is a bug in React.'
|
|
);
|
|
}
|
|
currentResource[internalInstanceKey] = finishedWork;
|
|
markNodeAsHoistable(currentResource);
|
|
flags = currentResource;
|
|
}
|
|
finishedWork.stateNode = flags;
|
|
} else
|
|
mountHoistable(
|
|
existingHiddenCallbacks,
|
|
finishedWork.type,
|
|
finishedWork.stateNode
|
|
);
|
|
else
|
|
finishedWork.stateNode = acquireResource(
|
|
existingHiddenCallbacks,
|
|
flags,
|
|
finishedWork.memoizedProps
|
|
);
|
|
else
|
|
currentResource !== flags ? (null === currentResource ? null !== current2.stateNode && (current2 = current2.stateNode, current2.parentNode.removeChild(current2)) : currentResource.count--, null === flags ? mountHoistable(
|
|
existingHiddenCallbacks,
|
|
finishedWork.type,
|
|
finishedWork.stateNode
|
|
) : acquireResource(
|
|
existingHiddenCallbacks,
|
|
flags,
|
|
finishedWork.memoizedProps
|
|
)) : null === flags && null !== finishedWork.stateNode && commitHostUpdate(
|
|
finishedWork,
|
|
finishedWork.memoizedProps,
|
|
current2.memoizedProps
|
|
);
|
|
}
|
|
break;
|
|
case 27:
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
flags & 512 && (offscreenSubtreeWasHidden || null === current2 || safelyDetachRef(current2, current2.return));
|
|
null !== current2 && flags & 4 && commitHostUpdate(
|
|
finishedWork,
|
|
finishedWork.memoizedProps,
|
|
current2.memoizedProps
|
|
);
|
|
break;
|
|
case 5:
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
flags & 512 && (offscreenSubtreeWasHidden || null === current2 || safelyDetachRef(current2, current2.return));
|
|
if (finishedWork.flags & 32) {
|
|
existingHiddenCallbacks = finishedWork.stateNode;
|
|
try {
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
resetTextContent,
|
|
existingHiddenCallbacks
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
}
|
|
flags & 4 && null != finishedWork.stateNode && (existingHiddenCallbacks = finishedWork.memoizedProps, commitHostUpdate(
|
|
finishedWork,
|
|
existingHiddenCallbacks,
|
|
null !== current2 ? current2.memoizedProps : existingHiddenCallbacks
|
|
));
|
|
flags & 1024 && (needsFormReset = true, "form" !== finishedWork.type && console.error(
|
|
"Unexpected host component type. Expected a form. This is a bug in React."
|
|
));
|
|
break;
|
|
case 6:
|
|
recursivelyTraverseMutationEffects(root2, 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."
|
|
);
|
|
flags = finishedWork.memoizedProps;
|
|
current2 = null !== current2 ? current2.memoizedProps : flags;
|
|
existingHiddenCallbacks = finishedWork.stateNode;
|
|
try {
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
commitTextUpdate,
|
|
existingHiddenCallbacks,
|
|
current2,
|
|
flags
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
}
|
|
break;
|
|
case 3:
|
|
existingHiddenCallbacks = pushNestedEffectDurations();
|
|
tagCaches = null;
|
|
currentResource = currentHoistableRoot;
|
|
currentHoistableRoot = getHoistableRoot(root2.containerInfo);
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
currentHoistableRoot = currentResource;
|
|
commitReconciliationEffects(finishedWork);
|
|
if (flags & 4 && null !== current2 && current2.memoizedState.isDehydrated)
|
|
try {
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
commitHydratedContainer,
|
|
root2.containerInfo
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
needsFormReset && (needsFormReset = false, recursivelyResetForms(finishedWork));
|
|
root2.effectDuration += popNestedEffectDurations(
|
|
existingHiddenCallbacks
|
|
);
|
|
break;
|
|
case 4:
|
|
flags = currentHoistableRoot;
|
|
currentHoistableRoot = getHoistableRoot(
|
|
finishedWork.stateNode.containerInfo
|
|
);
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
currentHoistableRoot = flags;
|
|
break;
|
|
case 12:
|
|
flags = pushNestedEffectDurations();
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
finishedWork.stateNode.effectDuration += bubbleNestedEffectDurations(flags);
|
|
break;
|
|
case 31:
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
|
|
break;
|
|
case 13:
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
finishedWork.child.flags & 8192 && null !== finishedWork.memoizedState !== (null !== current2 && null !== current2.memoizedState) && (globalMostRecentFallbackTime = now$1());
|
|
flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
|
|
break;
|
|
case 22:
|
|
existingHiddenCallbacks = null !== finishedWork.memoizedState;
|
|
var wasHidden = null !== current2 && null !== current2.memoizedState, prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
|
|
offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || existingHiddenCallbacks;
|
|
offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || wasHidden;
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
|
|
offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
|
|
wasHidden && !existingHiddenCallbacks && !prevOffscreenSubtreeIsHidden && !prevOffscreenSubtreeWasHidden && (finishedWork.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && 0.05 < componentEffectEndTime - componentEffectStartTime && logComponentReappeared(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime
|
|
);
|
|
commitReconciliationEffects(finishedWork);
|
|
if (flags & 8192)
|
|
a: for (root2 = finishedWork.stateNode, root2._visibility = existingHiddenCallbacks ? root2._visibility & ~OffscreenVisible : root2._visibility | OffscreenVisible, !existingHiddenCallbacks || null === current2 || wasHidden || offscreenSubtreeIsHidden || offscreenSubtreeWasHidden || (recursivelyTraverseDisappearLayoutEffects(finishedWork), (finishedWork.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && 0.05 < componentEffectEndTime - componentEffectStartTime && logComponentTrigger(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
"Disconnect"
|
|
)), current2 = null, root2 = finishedWork; ; ) {
|
|
if (5 === root2.tag || 26 === root2.tag) {
|
|
if (null === current2) {
|
|
wasHidden = current2 = root2;
|
|
try {
|
|
currentResource = wasHidden.stateNode, existingHiddenCallbacks ? runWithFiberInDEV(
|
|
wasHidden,
|
|
hideInstance,
|
|
currentResource
|
|
) : runWithFiberInDEV(
|
|
wasHidden,
|
|
unhideInstance,
|
|
wasHidden.stateNode,
|
|
wasHidden.memoizedProps
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(wasHidden, wasHidden.return, error);
|
|
}
|
|
}
|
|
} else if (6 === root2.tag) {
|
|
if (null === current2) {
|
|
wasHidden = root2;
|
|
try {
|
|
maybeNodes = wasHidden.stateNode, existingHiddenCallbacks ? runWithFiberInDEV(
|
|
wasHidden,
|
|
hideTextInstance,
|
|
maybeNodes
|
|
) : runWithFiberInDEV(
|
|
wasHidden,
|
|
unhideTextInstance,
|
|
maybeNodes,
|
|
wasHidden.memoizedProps
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(wasHidden, wasHidden.return, error);
|
|
}
|
|
}
|
|
} else if (18 === root2.tag) {
|
|
if (null === current2) {
|
|
wasHidden = root2;
|
|
try {
|
|
i = wasHidden.stateNode, existingHiddenCallbacks ? runWithFiberInDEV(
|
|
wasHidden,
|
|
hideDehydratedBoundary,
|
|
i
|
|
) : runWithFiberInDEV(
|
|
wasHidden,
|
|
unhideDehydratedBoundary,
|
|
wasHidden.stateNode
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(wasHidden, wasHidden.return, error);
|
|
}
|
|
}
|
|
} else if ((22 !== root2.tag && 23 !== root2.tag || null === root2.memoizedState || root2 === finishedWork) && null !== root2.child) {
|
|
root2.child.return = root2;
|
|
root2 = root2.child;
|
|
continue;
|
|
}
|
|
if (root2 === finishedWork) break a;
|
|
for (; null === root2.sibling; ) {
|
|
if (null === root2.return || root2.return === finishedWork)
|
|
break a;
|
|
current2 === root2 && (current2 = null);
|
|
root2 = root2.return;
|
|
}
|
|
current2 === root2 && (current2 = null);
|
|
root2.sibling.return = root2.return;
|
|
root2 = root2.sibling;
|
|
}
|
|
flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (current2 = flags.retryQueue, null !== current2 && (flags.retryQueue = null, attachSuspenseRetryListeners(finishedWork, current2))));
|
|
break;
|
|
case 19:
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
|
|
break;
|
|
case 30:
|
|
break;
|
|
case 21:
|
|
break;
|
|
default:
|
|
recursivelyTraverseMutationEffects(root2, finishedWork), commitReconciliationEffects(finishedWork);
|
|
}
|
|
(finishedWork.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && ((componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && logComponentEffect(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
componentEffectDuration,
|
|
componentEffectErrors
|
|
), null === finishedWork.alternate && null !== finishedWork.return && null !== finishedWork.return.alternate && 0.05 < componentEffectEndTime - componentEffectStartTime && (isHydratingParent(
|
|
finishedWork.return.alternate,
|
|
finishedWork.return
|
|
) || logComponentTrigger(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
"Mount"
|
|
)));
|
|
popComponentEffectStart(prevEffectStart);
|
|
popComponentEffectDuration(prevEffectDuration);
|
|
componentEffectErrors = prevEffectErrors;
|
|
componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate;
|
|
}
|
|
function commitReconciliationEffects(finishedWork) {
|
|
var flags = finishedWork.flags;
|
|
if (flags & 2) {
|
|
try {
|
|
runWithFiberInDEV(finishedWork, commitPlacement, finishedWork);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
finishedWork.flags &= -3;
|
|
}
|
|
flags & 4096 && (finishedWork.flags &= -4097);
|
|
}
|
|
function recursivelyResetForms(parentFiber) {
|
|
if (parentFiber.subtreeFlags & 1024)
|
|
for (parentFiber = parentFiber.child; null !== parentFiber; ) {
|
|
var fiber = parentFiber;
|
|
recursivelyResetForms(fiber);
|
|
5 === fiber.tag && fiber.flags & 1024 && fiber.stateNode.reset();
|
|
parentFiber = parentFiber.sibling;
|
|
}
|
|
}
|
|
function recursivelyTraverseLayoutEffects(root2, parentFiber) {
|
|
if (parentFiber.subtreeFlags & 8772)
|
|
for (parentFiber = parentFiber.child; null !== parentFiber; )
|
|
commitLayoutEffectOnFiber(root2, parentFiber.alternate, parentFiber), parentFiber = parentFiber.sibling;
|
|
}
|
|
function disappearLayoutEffects(finishedWork) {
|
|
var prevEffectStart = pushComponentEffectStart(), prevEffectDuration = pushComponentEffectDuration(), prevEffectErrors = pushComponentEffectErrors(), prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate();
|
|
switch (finishedWork.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 14:
|
|
case 15:
|
|
commitHookLayoutUnmountEffects(
|
|
finishedWork,
|
|
finishedWork.return,
|
|
Layout
|
|
);
|
|
recursivelyTraverseDisappearLayoutEffects(finishedWork);
|
|
break;
|
|
case 1:
|
|
safelyDetachRef(finishedWork, finishedWork.return);
|
|
var instance = finishedWork.stateNode;
|
|
"function" === typeof instance.componentWillUnmount && safelyCallComponentWillUnmount(
|
|
finishedWork,
|
|
finishedWork.return,
|
|
instance
|
|
);
|
|
recursivelyTraverseDisappearLayoutEffects(finishedWork);
|
|
break;
|
|
case 27:
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
releaseSingletonInstance,
|
|
finishedWork.stateNode
|
|
);
|
|
case 26:
|
|
case 5:
|
|
safelyDetachRef(finishedWork, finishedWork.return);
|
|
recursivelyTraverseDisappearLayoutEffects(finishedWork);
|
|
break;
|
|
case 22:
|
|
null === finishedWork.memoizedState && recursivelyTraverseDisappearLayoutEffects(finishedWork);
|
|
break;
|
|
case 30:
|
|
recursivelyTraverseDisappearLayoutEffects(finishedWork);
|
|
break;
|
|
default:
|
|
recursivelyTraverseDisappearLayoutEffects(finishedWork);
|
|
}
|
|
(finishedWork.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && logComponentEffect(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
componentEffectDuration,
|
|
componentEffectErrors
|
|
);
|
|
popComponentEffectStart(prevEffectStart);
|
|
popComponentEffectDuration(prevEffectDuration);
|
|
componentEffectErrors = prevEffectErrors;
|
|
componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate;
|
|
}
|
|
function recursivelyTraverseDisappearLayoutEffects(parentFiber) {
|
|
for (parentFiber = parentFiber.child; null !== parentFiber; )
|
|
disappearLayoutEffects(parentFiber), parentFiber = parentFiber.sibling;
|
|
}
|
|
function reappearLayoutEffects(finishedRoot, current2, finishedWork, includeWorkInProgressEffects) {
|
|
var prevEffectStart = pushComponentEffectStart(), prevEffectDuration = pushComponentEffectDuration(), prevEffectErrors = pushComponentEffectErrors(), prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), flags = finishedWork.flags;
|
|
switch (finishedWork.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 15:
|
|
recursivelyTraverseReappearLayoutEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
includeWorkInProgressEffects
|
|
);
|
|
commitHookLayoutEffects(finishedWork, Layout);
|
|
break;
|
|
case 1:
|
|
recursivelyTraverseReappearLayoutEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
includeWorkInProgressEffects
|
|
);
|
|
current2 = finishedWork.stateNode;
|
|
"function" === typeof current2.componentDidMount && runWithFiberInDEV(
|
|
finishedWork,
|
|
callComponentDidMountInDEV,
|
|
finishedWork,
|
|
current2
|
|
);
|
|
current2 = finishedWork.updateQueue;
|
|
if (null !== current2) {
|
|
finishedRoot = finishedWork.stateNode;
|
|
try {
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
commitHiddenCallbacks,
|
|
current2,
|
|
finishedRoot
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
}
|
|
includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork);
|
|
safelyAttachRef(finishedWork, finishedWork.return);
|
|
break;
|
|
case 27:
|
|
commitHostSingletonAcquisition(finishedWork);
|
|
case 26:
|
|
case 5:
|
|
recursivelyTraverseReappearLayoutEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
includeWorkInProgressEffects
|
|
);
|
|
includeWorkInProgressEffects && null === current2 && flags & 4 && commitHostMount(finishedWork);
|
|
safelyAttachRef(finishedWork, finishedWork.return);
|
|
break;
|
|
case 12:
|
|
if (includeWorkInProgressEffects && flags & 4) {
|
|
flags = pushNestedEffectDurations();
|
|
recursivelyTraverseReappearLayoutEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
includeWorkInProgressEffects
|
|
);
|
|
includeWorkInProgressEffects = finishedWork.stateNode;
|
|
includeWorkInProgressEffects.effectDuration += bubbleNestedEffectDurations(flags);
|
|
try {
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
commitProfiler,
|
|
finishedWork,
|
|
current2,
|
|
commitStartTime,
|
|
includeWorkInProgressEffects.effectDuration
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
} else
|
|
recursivelyTraverseReappearLayoutEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
includeWorkInProgressEffects
|
|
);
|
|
break;
|
|
case 31:
|
|
recursivelyTraverseReappearLayoutEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
includeWorkInProgressEffects
|
|
);
|
|
includeWorkInProgressEffects && flags & 4 && commitActivityHydrationCallbacks(finishedRoot, finishedWork);
|
|
break;
|
|
case 13:
|
|
recursivelyTraverseReappearLayoutEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
includeWorkInProgressEffects
|
|
);
|
|
includeWorkInProgressEffects && flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
|
|
break;
|
|
case 22:
|
|
null === finishedWork.memoizedState && recursivelyTraverseReappearLayoutEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
includeWorkInProgressEffects
|
|
);
|
|
safelyAttachRef(finishedWork, finishedWork.return);
|
|
break;
|
|
case 30:
|
|
break;
|
|
default:
|
|
recursivelyTraverseReappearLayoutEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
includeWorkInProgressEffects
|
|
);
|
|
}
|
|
(finishedWork.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && logComponentEffect(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
componentEffectDuration,
|
|
componentEffectErrors
|
|
);
|
|
popComponentEffectStart(prevEffectStart);
|
|
popComponentEffectDuration(prevEffectDuration);
|
|
componentEffectErrors = prevEffectErrors;
|
|
componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate;
|
|
}
|
|
function recursivelyTraverseReappearLayoutEffects(finishedRoot, parentFiber, includeWorkInProgressEffects) {
|
|
includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772);
|
|
for (parentFiber = parentFiber.child; null !== parentFiber; )
|
|
reappearLayoutEffects(
|
|
finishedRoot,
|
|
parentFiber.alternate,
|
|
parentFiber,
|
|
includeWorkInProgressEffects
|
|
), parentFiber = parentFiber.sibling;
|
|
}
|
|
function commitOffscreenPassiveMountEffects(current2, finishedWork) {
|
|
var previousCache = null;
|
|
null !== current2 && null !== current2.memoizedState && null !== current2.memoizedState.cachePool && (previousCache = current2.memoizedState.cachePool.pool);
|
|
current2 = null;
|
|
null !== finishedWork.memoizedState && null !== finishedWork.memoizedState.cachePool && (current2 = finishedWork.memoizedState.cachePool.pool);
|
|
current2 !== previousCache && (null != current2 && retainCache(current2), null != previousCache && releaseCache(previousCache));
|
|
}
|
|
function commitCachePassiveMountEffect(current2, finishedWork) {
|
|
current2 = null;
|
|
null !== finishedWork.alternate && (current2 = finishedWork.alternate.memoizedState.cache);
|
|
finishedWork = finishedWork.memoizedState.cache;
|
|
finishedWork !== current2 && (retainCache(finishedWork), null != current2 && releaseCache(current2));
|
|
}
|
|
function recursivelyTraversePassiveMountEffects(root2, parentFiber, committedLanes, committedTransitions, endTime) {
|
|
if (parentFiber.subtreeFlags & 10256 || 0 !== parentFiber.actualDuration && (null === parentFiber.alternate || parentFiber.alternate.child !== parentFiber.child))
|
|
for (parentFiber = parentFiber.child; null !== parentFiber; ) {
|
|
var nextSibling = parentFiber.sibling;
|
|
commitPassiveMountOnFiber(
|
|
root2,
|
|
parentFiber,
|
|
committedLanes,
|
|
committedTransitions,
|
|
null !== nextSibling ? nextSibling.actualStartTime : endTime
|
|
);
|
|
parentFiber = nextSibling;
|
|
}
|
|
}
|
|
function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions, endTime) {
|
|
var prevEffectStart = pushComponentEffectStart(), prevEffectDuration = pushComponentEffectDuration(), prevEffectErrors = pushComponentEffectErrors(), prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), prevDeepEquality = alreadyWarnedForDeepEquality, flags = finishedWork.flags;
|
|
switch (finishedWork.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 15:
|
|
(finishedWork.mode & ProfileMode) !== NoMode && 0 < finishedWork.actualStartTime && 0 !== (finishedWork.flags & 1) && logComponentRender(
|
|
finishedWork,
|
|
finishedWork.actualStartTime,
|
|
endTime,
|
|
inHydratedSubtree,
|
|
committedLanes
|
|
);
|
|
recursivelyTraversePassiveMountEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
);
|
|
flags & 2048 && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect);
|
|
break;
|
|
case 1:
|
|
(finishedWork.mode & ProfileMode) !== NoMode && 0 < finishedWork.actualStartTime && (0 !== (finishedWork.flags & 128) ? logComponentErrored(
|
|
finishedWork,
|
|
finishedWork.actualStartTime,
|
|
endTime,
|
|
[]
|
|
) : 0 !== (finishedWork.flags & 1) && logComponentRender(
|
|
finishedWork,
|
|
finishedWork.actualStartTime,
|
|
endTime,
|
|
inHydratedSubtree,
|
|
committedLanes
|
|
));
|
|
recursivelyTraversePassiveMountEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
);
|
|
break;
|
|
case 3:
|
|
var prevProfilerEffectDuration = pushNestedEffectDurations(), wasInHydratedSubtree = inHydratedSubtree;
|
|
inHydratedSubtree = null !== finishedWork.alternate && finishedWork.alternate.memoizedState.isDehydrated && 0 === (finishedWork.flags & 256);
|
|
recursivelyTraversePassiveMountEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
);
|
|
inHydratedSubtree = wasInHydratedSubtree;
|
|
flags & 2048 && (committedLanes = null, null !== finishedWork.alternate && (committedLanes = finishedWork.alternate.memoizedState.cache), committedTransitions = finishedWork.memoizedState.cache, committedTransitions !== committedLanes && (retainCache(committedTransitions), null != committedLanes && releaseCache(committedLanes)));
|
|
finishedRoot.passiveEffectDuration += popNestedEffectDurations(
|
|
prevProfilerEffectDuration
|
|
);
|
|
break;
|
|
case 12:
|
|
if (flags & 2048) {
|
|
flags = pushNestedEffectDurations();
|
|
recursivelyTraversePassiveMountEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
);
|
|
finishedRoot = finishedWork.stateNode;
|
|
finishedRoot.passiveEffectDuration += bubbleNestedEffectDurations(flags);
|
|
try {
|
|
runWithFiberInDEV(
|
|
finishedWork,
|
|
commitProfilerPostCommitImpl,
|
|
finishedWork,
|
|
finishedWork.alternate,
|
|
commitStartTime,
|
|
finishedRoot.passiveEffectDuration
|
|
);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
} else
|
|
recursivelyTraversePassiveMountEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
);
|
|
break;
|
|
case 31:
|
|
flags = inHydratedSubtree;
|
|
prevProfilerEffectDuration = null !== finishedWork.alternate ? finishedWork.alternate.memoizedState : null;
|
|
wasInHydratedSubtree = finishedWork.memoizedState;
|
|
null !== prevProfilerEffectDuration && null === wasInHydratedSubtree ? (wasInHydratedSubtree = finishedWork.deletions, null !== wasInHydratedSubtree && 0 < wasInHydratedSubtree.length && 18 === wasInHydratedSubtree[0].tag ? (inHydratedSubtree = false, prevProfilerEffectDuration = prevProfilerEffectDuration.hydrationErrors, null !== prevProfilerEffectDuration && logComponentErrored(
|
|
finishedWork,
|
|
finishedWork.actualStartTime,
|
|
endTime,
|
|
prevProfilerEffectDuration
|
|
)) : inHydratedSubtree = true) : inHydratedSubtree = false;
|
|
recursivelyTraversePassiveMountEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
);
|
|
inHydratedSubtree = flags;
|
|
break;
|
|
case 13:
|
|
flags = inHydratedSubtree;
|
|
prevProfilerEffectDuration = null !== finishedWork.alternate ? finishedWork.alternate.memoizedState : null;
|
|
wasInHydratedSubtree = finishedWork.memoizedState;
|
|
null === prevProfilerEffectDuration || null === prevProfilerEffectDuration.dehydrated || null !== wasInHydratedSubtree && null !== wasInHydratedSubtree.dehydrated ? inHydratedSubtree = false : (wasInHydratedSubtree = finishedWork.deletions, null !== wasInHydratedSubtree && 0 < wasInHydratedSubtree.length && 18 === wasInHydratedSubtree[0].tag ? (inHydratedSubtree = false, prevProfilerEffectDuration = prevProfilerEffectDuration.hydrationErrors, null !== prevProfilerEffectDuration && logComponentErrored(
|
|
finishedWork,
|
|
finishedWork.actualStartTime,
|
|
endTime,
|
|
prevProfilerEffectDuration
|
|
)) : inHydratedSubtree = true);
|
|
recursivelyTraversePassiveMountEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
);
|
|
inHydratedSubtree = flags;
|
|
break;
|
|
case 23:
|
|
break;
|
|
case 22:
|
|
wasInHydratedSubtree = finishedWork.stateNode;
|
|
prevProfilerEffectDuration = finishedWork.alternate;
|
|
null !== finishedWork.memoizedState ? wasInHydratedSubtree._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
) : recursivelyTraverseAtomicPassiveEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
) : wasInHydratedSubtree._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
) : (wasInHydratedSubtree._visibility |= OffscreenPassiveEffectsConnected, recursivelyTraverseReconnectPassiveEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
0 !== (finishedWork.subtreeFlags & 10256) || 0 !== finishedWork.actualDuration && (null === finishedWork.alternate || finishedWork.alternate.child !== finishedWork.child),
|
|
endTime
|
|
), (finishedWork.mode & ProfileMode) === NoMode || inHydratedSubtree || (finishedRoot = finishedWork.actualStartTime, 0 <= finishedRoot && 0.05 < endTime - finishedRoot && logComponentReappeared(finishedWork, finishedRoot, endTime), 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && 0.05 < componentEffectEndTime - componentEffectStartTime && logComponentReappeared(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime
|
|
)));
|
|
flags & 2048 && commitOffscreenPassiveMountEffects(
|
|
prevProfilerEffectDuration,
|
|
finishedWork
|
|
);
|
|
break;
|
|
case 24:
|
|
recursivelyTraversePassiveMountEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
);
|
|
flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
|
|
break;
|
|
default:
|
|
recursivelyTraversePassiveMountEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
);
|
|
}
|
|
if ((finishedWork.mode & ProfileMode) !== NoMode) {
|
|
if (finishedRoot = !inHydratedSubtree && null === finishedWork.alternate && null !== finishedWork.return && null !== finishedWork.return.alternate)
|
|
committedLanes = finishedWork.actualStartTime, 0 <= committedLanes && 0.05 < endTime - committedLanes && logComponentTrigger(
|
|
finishedWork,
|
|
committedLanes,
|
|
endTime,
|
|
"Mount"
|
|
);
|
|
0 <= componentEffectStartTime && 0 <= componentEffectEndTime && ((componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && logComponentEffect(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
componentEffectDuration,
|
|
componentEffectErrors
|
|
), finishedRoot && 0.05 < componentEffectEndTime - componentEffectStartTime && logComponentTrigger(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
"Mount"
|
|
));
|
|
}
|
|
popComponentEffectStart(prevEffectStart);
|
|
popComponentEffectDuration(prevEffectDuration);
|
|
componentEffectErrors = prevEffectErrors;
|
|
componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate;
|
|
alreadyWarnedForDeepEquality = prevDeepEquality;
|
|
}
|
|
function recursivelyTraverseReconnectPassiveEffects(finishedRoot, parentFiber, committedLanes, committedTransitions, includeWorkInProgressEffects, endTime) {
|
|
includeWorkInProgressEffects = includeWorkInProgressEffects && (0 !== (parentFiber.subtreeFlags & 10256) || 0 !== parentFiber.actualDuration && (null === parentFiber.alternate || parentFiber.alternate.child !== parentFiber.child));
|
|
for (parentFiber = parentFiber.child; null !== parentFiber; ) {
|
|
var nextSibling = parentFiber.sibling;
|
|
reconnectPassiveEffects(
|
|
finishedRoot,
|
|
parentFiber,
|
|
committedLanes,
|
|
committedTransitions,
|
|
includeWorkInProgressEffects,
|
|
null !== nextSibling ? nextSibling.actualStartTime : endTime
|
|
);
|
|
parentFiber = nextSibling;
|
|
}
|
|
}
|
|
function reconnectPassiveEffects(finishedRoot, finishedWork, committedLanes, committedTransitions, includeWorkInProgressEffects, endTime) {
|
|
var prevEffectStart = pushComponentEffectStart(), prevEffectDuration = pushComponentEffectDuration(), prevEffectErrors = pushComponentEffectErrors(), prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate(), prevDeepEquality = alreadyWarnedForDeepEquality;
|
|
includeWorkInProgressEffects && (finishedWork.mode & ProfileMode) !== NoMode && 0 < finishedWork.actualStartTime && 0 !== (finishedWork.flags & 1) && logComponentRender(
|
|
finishedWork,
|
|
finishedWork.actualStartTime,
|
|
endTime,
|
|
inHydratedSubtree,
|
|
committedLanes
|
|
);
|
|
var flags = finishedWork.flags;
|
|
switch (finishedWork.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 15:
|
|
recursivelyTraverseReconnectPassiveEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
includeWorkInProgressEffects,
|
|
endTime
|
|
);
|
|
commitHookPassiveMountEffects(finishedWork, Passive);
|
|
break;
|
|
case 23:
|
|
break;
|
|
case 22:
|
|
var _instance2 = finishedWork.stateNode;
|
|
null !== finishedWork.memoizedState ? _instance2._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraverseReconnectPassiveEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
includeWorkInProgressEffects,
|
|
endTime
|
|
) : recursivelyTraverseAtomicPassiveEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
) : (_instance2._visibility |= OffscreenPassiveEffectsConnected, recursivelyTraverseReconnectPassiveEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
includeWorkInProgressEffects,
|
|
endTime
|
|
));
|
|
includeWorkInProgressEffects && flags & 2048 && commitOffscreenPassiveMountEffects(
|
|
finishedWork.alternate,
|
|
finishedWork
|
|
);
|
|
break;
|
|
case 24:
|
|
recursivelyTraverseReconnectPassiveEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
includeWorkInProgressEffects,
|
|
endTime
|
|
);
|
|
includeWorkInProgressEffects && flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
|
|
break;
|
|
default:
|
|
recursivelyTraverseReconnectPassiveEffects(
|
|
finishedRoot,
|
|
finishedWork,
|
|
committedLanes,
|
|
committedTransitions,
|
|
includeWorkInProgressEffects,
|
|
endTime
|
|
);
|
|
}
|
|
(finishedWork.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && logComponentEffect(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
componentEffectDuration,
|
|
componentEffectErrors
|
|
);
|
|
popComponentEffectStart(prevEffectStart);
|
|
popComponentEffectDuration(prevEffectDuration);
|
|
componentEffectErrors = prevEffectErrors;
|
|
componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate;
|
|
alreadyWarnedForDeepEquality = prevDeepEquality;
|
|
}
|
|
function recursivelyTraverseAtomicPassiveEffects(finishedRoot$jscomp$0, parentFiber, committedLanes$jscomp$0, committedTransitions$jscomp$0, endTime$jscomp$0) {
|
|
if (parentFiber.subtreeFlags & 10256 || 0 !== parentFiber.actualDuration && (null === parentFiber.alternate || parentFiber.alternate.child !== parentFiber.child))
|
|
for (var child = parentFiber.child; null !== child; ) {
|
|
parentFiber = child.sibling;
|
|
var finishedRoot = finishedRoot$jscomp$0, committedLanes = committedLanes$jscomp$0, committedTransitions = committedTransitions$jscomp$0, endTime = null !== parentFiber ? parentFiber.actualStartTime : endTime$jscomp$0, prevDeepEquality = alreadyWarnedForDeepEquality;
|
|
(child.mode & ProfileMode) !== NoMode && 0 < child.actualStartTime && 0 !== (child.flags & 1) && logComponentRender(
|
|
child,
|
|
child.actualStartTime,
|
|
endTime,
|
|
inHydratedSubtree,
|
|
committedLanes
|
|
);
|
|
var flags = child.flags;
|
|
switch (child.tag) {
|
|
case 22:
|
|
recursivelyTraverseAtomicPassiveEffects(
|
|
finishedRoot,
|
|
child,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
);
|
|
flags & 2048 && commitOffscreenPassiveMountEffects(child.alternate, child);
|
|
break;
|
|
case 24:
|
|
recursivelyTraverseAtomicPassiveEffects(
|
|
finishedRoot,
|
|
child,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
);
|
|
flags & 2048 && commitCachePassiveMountEffect(child.alternate, child);
|
|
break;
|
|
default:
|
|
recursivelyTraverseAtomicPassiveEffects(
|
|
finishedRoot,
|
|
child,
|
|
committedLanes,
|
|
committedTransitions,
|
|
endTime
|
|
);
|
|
}
|
|
alreadyWarnedForDeepEquality = prevDeepEquality;
|
|
child = parentFiber;
|
|
}
|
|
}
|
|
function recursivelyAccumulateSuspenseyCommit(parentFiber, committedLanes, suspendedState) {
|
|
if (parentFiber.subtreeFlags & suspenseyCommitFlag)
|
|
for (parentFiber = parentFiber.child; null !== parentFiber; )
|
|
accumulateSuspenseyCommitOnFiber(
|
|
parentFiber,
|
|
committedLanes,
|
|
suspendedState
|
|
), parentFiber = parentFiber.sibling;
|
|
}
|
|
function accumulateSuspenseyCommitOnFiber(fiber, committedLanes, suspendedState) {
|
|
switch (fiber.tag) {
|
|
case 26:
|
|
recursivelyAccumulateSuspenseyCommit(
|
|
fiber,
|
|
committedLanes,
|
|
suspendedState
|
|
);
|
|
fiber.flags & suspenseyCommitFlag && null !== fiber.memoizedState && suspendResource(
|
|
suspendedState,
|
|
currentHoistableRoot,
|
|
fiber.memoizedState,
|
|
fiber.memoizedProps
|
|
);
|
|
break;
|
|
case 5:
|
|
recursivelyAccumulateSuspenseyCommit(
|
|
fiber,
|
|
committedLanes,
|
|
suspendedState
|
|
);
|
|
break;
|
|
case 3:
|
|
case 4:
|
|
var previousHoistableRoot = currentHoistableRoot;
|
|
currentHoistableRoot = getHoistableRoot(
|
|
fiber.stateNode.containerInfo
|
|
);
|
|
recursivelyAccumulateSuspenseyCommit(
|
|
fiber,
|
|
committedLanes,
|
|
suspendedState
|
|
);
|
|
currentHoistableRoot = previousHoistableRoot;
|
|
break;
|
|
case 22:
|
|
null === fiber.memoizedState && (previousHoistableRoot = fiber.alternate, null !== previousHoistableRoot && null !== previousHoistableRoot.memoizedState ? (previousHoistableRoot = suspenseyCommitFlag, suspenseyCommitFlag = 16777216, recursivelyAccumulateSuspenseyCommit(
|
|
fiber,
|
|
committedLanes,
|
|
suspendedState
|
|
), suspenseyCommitFlag = previousHoistableRoot) : recursivelyAccumulateSuspenseyCommit(
|
|
fiber,
|
|
committedLanes,
|
|
suspendedState
|
|
));
|
|
break;
|
|
default:
|
|
recursivelyAccumulateSuspenseyCommit(
|
|
fiber,
|
|
committedLanes,
|
|
suspendedState
|
|
);
|
|
}
|
|
}
|
|
function detachAlternateSiblings(parentFiber) {
|
|
var previousFiber = parentFiber.alternate;
|
|
if (null !== previousFiber && (parentFiber = previousFiber.child, null !== parentFiber)) {
|
|
previousFiber.child = null;
|
|
do
|
|
previousFiber = parentFiber.sibling, parentFiber.sibling = null, parentFiber = previousFiber;
|
|
while (null !== parentFiber);
|
|
}
|
|
}
|
|
function recursivelyTraversePassiveUnmountEffects(parentFiber) {
|
|
var deletions = parentFiber.deletions;
|
|
if (0 !== (parentFiber.flags & 16)) {
|
|
if (null !== deletions)
|
|
for (var i = 0; i < deletions.length; i++) {
|
|
var childToDelete = deletions[i], prevEffectStart = pushComponentEffectStart();
|
|
nextEffect = childToDelete;
|
|
commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
|
|
childToDelete,
|
|
parentFiber
|
|
);
|
|
(childToDelete.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && 0.05 < componentEffectEndTime - componentEffectStartTime && logComponentTrigger(
|
|
childToDelete,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
"Unmount"
|
|
);
|
|
popComponentEffectStart(prevEffectStart);
|
|
}
|
|
detachAlternateSiblings(parentFiber);
|
|
}
|
|
if (parentFiber.subtreeFlags & 10256)
|
|
for (parentFiber = parentFiber.child; null !== parentFiber; )
|
|
commitPassiveUnmountOnFiber(parentFiber), parentFiber = parentFiber.sibling;
|
|
}
|
|
function commitPassiveUnmountOnFiber(finishedWork) {
|
|
var prevEffectStart = pushComponentEffectStart(), prevEffectDuration = pushComponentEffectDuration(), prevEffectErrors = pushComponentEffectErrors(), prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate();
|
|
switch (finishedWork.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 15:
|
|
recursivelyTraversePassiveUnmountEffects(finishedWork);
|
|
finishedWork.flags & 2048 && commitHookPassiveUnmountEffects(
|
|
finishedWork,
|
|
finishedWork.return,
|
|
Passive | HasEffect
|
|
);
|
|
break;
|
|
case 3:
|
|
var prevProfilerEffectDuration = pushNestedEffectDurations();
|
|
recursivelyTraversePassiveUnmountEffects(finishedWork);
|
|
finishedWork.stateNode.passiveEffectDuration += popNestedEffectDurations(prevProfilerEffectDuration);
|
|
break;
|
|
case 12:
|
|
prevProfilerEffectDuration = pushNestedEffectDurations();
|
|
recursivelyTraversePassiveUnmountEffects(finishedWork);
|
|
finishedWork.stateNode.passiveEffectDuration += bubbleNestedEffectDurations(prevProfilerEffectDuration);
|
|
break;
|
|
case 22:
|
|
prevProfilerEffectDuration = finishedWork.stateNode;
|
|
null !== finishedWork.memoizedState && prevProfilerEffectDuration._visibility & OffscreenPassiveEffectsConnected && (null === finishedWork.return || 13 !== finishedWork.return.tag) ? (prevProfilerEffectDuration._visibility &= ~OffscreenPassiveEffectsConnected, recursivelyTraverseDisconnectPassiveEffects(finishedWork), (finishedWork.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && 0.05 < componentEffectEndTime - componentEffectStartTime && logComponentTrigger(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
"Disconnect"
|
|
)) : recursivelyTraversePassiveUnmountEffects(finishedWork);
|
|
break;
|
|
default:
|
|
recursivelyTraversePassiveUnmountEffects(finishedWork);
|
|
}
|
|
(finishedWork.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && logComponentEffect(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
componentEffectDuration,
|
|
componentEffectErrors
|
|
);
|
|
popComponentEffectStart(prevEffectStart);
|
|
popComponentEffectDuration(prevEffectDuration);
|
|
componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate;
|
|
componentEffectErrors = prevEffectErrors;
|
|
}
|
|
function recursivelyTraverseDisconnectPassiveEffects(parentFiber) {
|
|
var deletions = parentFiber.deletions;
|
|
if (0 !== (parentFiber.flags & 16)) {
|
|
if (null !== deletions)
|
|
for (var i = 0; i < deletions.length; i++) {
|
|
var childToDelete = deletions[i], prevEffectStart = pushComponentEffectStart();
|
|
nextEffect = childToDelete;
|
|
commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
|
|
childToDelete,
|
|
parentFiber
|
|
);
|
|
(childToDelete.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && 0.05 < componentEffectEndTime - componentEffectStartTime && logComponentTrigger(
|
|
childToDelete,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
"Unmount"
|
|
);
|
|
popComponentEffectStart(prevEffectStart);
|
|
}
|
|
detachAlternateSiblings(parentFiber);
|
|
}
|
|
for (parentFiber = parentFiber.child; null !== parentFiber; )
|
|
disconnectPassiveEffect(parentFiber), parentFiber = parentFiber.sibling;
|
|
}
|
|
function disconnectPassiveEffect(finishedWork) {
|
|
var prevEffectStart = pushComponentEffectStart(), prevEffectDuration = pushComponentEffectDuration(), prevEffectErrors = pushComponentEffectErrors(), prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate();
|
|
switch (finishedWork.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 15:
|
|
commitHookPassiveUnmountEffects(
|
|
finishedWork,
|
|
finishedWork.return,
|
|
Passive
|
|
);
|
|
recursivelyTraverseDisconnectPassiveEffects(finishedWork);
|
|
break;
|
|
case 22:
|
|
var instance = finishedWork.stateNode;
|
|
instance._visibility & OffscreenPassiveEffectsConnected && (instance._visibility &= ~OffscreenPassiveEffectsConnected, recursivelyTraverseDisconnectPassiveEffects(finishedWork));
|
|
break;
|
|
default:
|
|
recursivelyTraverseDisconnectPassiveEffects(finishedWork);
|
|
}
|
|
(finishedWork.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && logComponentEffect(
|
|
finishedWork,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
componentEffectDuration,
|
|
componentEffectErrors
|
|
);
|
|
popComponentEffectStart(prevEffectStart);
|
|
popComponentEffectDuration(prevEffectDuration);
|
|
componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate;
|
|
componentEffectErrors = prevEffectErrors;
|
|
}
|
|
function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor$jscomp$0) {
|
|
for (; null !== nextEffect; ) {
|
|
var fiber = nextEffect, current2 = fiber, nearestMountedAncestor = nearestMountedAncestor$jscomp$0, prevEffectStart = pushComponentEffectStart(), prevEffectDuration = pushComponentEffectDuration(), prevEffectErrors = pushComponentEffectErrors(), prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate();
|
|
switch (current2.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 15:
|
|
commitHookPassiveUnmountEffects(
|
|
current2,
|
|
nearestMountedAncestor,
|
|
Passive
|
|
);
|
|
break;
|
|
case 23:
|
|
case 22:
|
|
null !== current2.memoizedState && null !== current2.memoizedState.cachePool && (nearestMountedAncestor = current2.memoizedState.cachePool.pool, null != nearestMountedAncestor && retainCache(nearestMountedAncestor));
|
|
break;
|
|
case 24:
|
|
releaseCache(current2.memoizedState.cache);
|
|
}
|
|
(current2.mode & ProfileMode) !== NoMode && 0 <= componentEffectStartTime && 0 <= componentEffectEndTime && (componentEffectSpawnedUpdate || 0.05 < componentEffectDuration) && logComponentEffect(
|
|
current2,
|
|
componentEffectStartTime,
|
|
componentEffectEndTime,
|
|
componentEffectDuration,
|
|
componentEffectErrors
|
|
);
|
|
popComponentEffectStart(prevEffectStart);
|
|
popComponentEffectDuration(prevEffectDuration);
|
|
componentEffectSpawnedUpdate = prevEffectDidSpawnUpdate;
|
|
componentEffectErrors = prevEffectErrors;
|
|
current2 = fiber.child;
|
|
if (null !== current2) current2.return = fiber, nextEffect = current2;
|
|
else
|
|
a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) {
|
|
current2 = nextEffect;
|
|
prevEffectStart = current2.sibling;
|
|
prevEffectDuration = current2.return;
|
|
detachFiberAfterEffects(current2);
|
|
if (current2 === fiber) {
|
|
nextEffect = null;
|
|
break a;
|
|
}
|
|
if (null !== prevEffectStart) {
|
|
prevEffectStart.return = prevEffectDuration;
|
|
nextEffect = prevEffectStart;
|
|
break a;
|
|
}
|
|
nextEffect = prevEffectDuration;
|
|
}
|
|
}
|
|
}
|
|
function onCommitRoot() {
|
|
commitHooks.forEach(function(commitHook) {
|
|
return commitHook();
|
|
});
|
|
}
|
|
function isConcurrentActEnvironment() {
|
|
var isReactActEnvironmentGlobal = "undefined" !== typeof IS_REACT_ACT_ENVIRONMENT ? IS_REACT_ACT_ENVIRONMENT : void 0;
|
|
isReactActEnvironmentGlobal || null === ReactSharedInternals.actQueue || console.error(
|
|
"The current testing environment is not configured to support act(...)"
|
|
);
|
|
return isReactActEnvironmentGlobal;
|
|
}
|
|
function requestUpdateLane(fiber) {
|
|
if ((executionContext & RenderContext) !== NoContext && 0 !== workInProgressRootRenderLanes)
|
|
return workInProgressRootRenderLanes & -workInProgressRootRenderLanes;
|
|
var transition = ReactSharedInternals.T;
|
|
return null !== transition ? (transition._updatedFibers || (transition._updatedFibers = /* @__PURE__ */ new Set()), transition._updatedFibers.add(fiber), requestTransitionLane()) : resolveUpdatePriority();
|
|
}
|
|
function requestDeferredLane() {
|
|
if (0 === workInProgressDeferredLane)
|
|
if (0 === (workInProgressRootRenderLanes & 536870912) || isHydrating) {
|
|
var lane = nextTransitionDeferredLane;
|
|
nextTransitionDeferredLane <<= 1;
|
|
0 === (nextTransitionDeferredLane & 3932160) && (nextTransitionDeferredLane = 262144);
|
|
workInProgressDeferredLane = lane;
|
|
} else workInProgressDeferredLane = 536870912;
|
|
lane = suspenseHandlerStackCursor.current;
|
|
null !== lane && (lane.flags |= 32);
|
|
return workInProgressDeferredLane;
|
|
}
|
|
function scheduleUpdateOnFiber(root2, fiber, lane) {
|
|
isRunningInsertionEffect && console.error("useInsertionEffect must not schedule updates.");
|
|
isFlushingPassiveEffects && (didScheduleUpdateDuringPassiveEffects = true);
|
|
if (root2 === workInProgressRoot && (workInProgressSuspendedReason === SuspendedOnData || workInProgressSuspendedReason === SuspendedOnAction) || null !== root2.cancelPendingCommit)
|
|
prepareFreshStack(root2, 0), markRootSuspended(
|
|
root2,
|
|
workInProgressRootRenderLanes,
|
|
workInProgressDeferredLane,
|
|
false
|
|
);
|
|
markRootUpdated$1(root2, lane);
|
|
if ((executionContext & RenderContext) !== NoContext && root2 === workInProgressRoot) {
|
|
if (isRendering)
|
|
switch (fiber.tag) {
|
|
case 0:
|
|
case 11:
|
|
case 15:
|
|
root2 = workInProgress && getComponentNameFromFiber(workInProgress) || "Unknown";
|
|
didWarnAboutUpdateInRenderForAnotherComponent.has(root2) || (didWarnAboutUpdateInRenderForAnotherComponent.add(root2), fiber = getComponentNameFromFiber(fiber) || "Unknown", console.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",
|
|
fiber,
|
|
root2,
|
|
root2
|
|
));
|
|
break;
|
|
case 1:
|
|
didWarnAboutUpdateInRender || (console.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);
|
|
}
|
|
} else
|
|
isDevToolsPresent && addFiberToLanesMap(root2, fiber, lane), warnIfUpdatesNotWrappedWithActDEV(fiber), root2 === workInProgressRoot && ((executionContext & RenderContext) === NoContext && (workInProgressRootInterleavedUpdatedLanes |= lane), workInProgressRootExitStatus === RootSuspendedWithDelay && markRootSuspended(
|
|
root2,
|
|
workInProgressRootRenderLanes,
|
|
workInProgressDeferredLane,
|
|
false
|
|
)), ensureRootIsScheduled(root2);
|
|
}
|
|
function performWorkOnRoot(root2, lanes, forceSync) {
|
|
if ((executionContext & (RenderContext | CommitContext)) !== NoContext)
|
|
throw Error("Should not already be working.");
|
|
if (0 !== workInProgressRootRenderLanes && null !== workInProgress) {
|
|
var yieldedFiber = workInProgress, yieldEndTime = now$1();
|
|
switch (yieldReason) {
|
|
case SuspendedOnImmediate:
|
|
case SuspendedOnData:
|
|
var startTime = yieldStartTime;
|
|
supportsUserTiming && ((yieldedFiber = yieldedFiber._debugTask) ? yieldedFiber.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
"Suspended",
|
|
startTime,
|
|
yieldEndTime,
|
|
COMPONENTS_TRACK,
|
|
void 0,
|
|
"primary-light"
|
|
)
|
|
) : console.timeStamp(
|
|
"Suspended",
|
|
startTime,
|
|
yieldEndTime,
|
|
COMPONENTS_TRACK,
|
|
void 0,
|
|
"primary-light"
|
|
));
|
|
break;
|
|
case SuspendedOnAction:
|
|
startTime = yieldStartTime;
|
|
supportsUserTiming && ((yieldedFiber = yieldedFiber._debugTask) ? yieldedFiber.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
"Action",
|
|
startTime,
|
|
yieldEndTime,
|
|
COMPONENTS_TRACK,
|
|
void 0,
|
|
"primary-light"
|
|
)
|
|
) : console.timeStamp(
|
|
"Action",
|
|
startTime,
|
|
yieldEndTime,
|
|
COMPONENTS_TRACK,
|
|
void 0,
|
|
"primary-light"
|
|
));
|
|
break;
|
|
default:
|
|
supportsUserTiming && (yieldedFiber = yieldEndTime - yieldStartTime, 3 > yieldedFiber || console.timeStamp(
|
|
"Blocked",
|
|
yieldStartTime,
|
|
yieldEndTime,
|
|
COMPONENTS_TRACK,
|
|
void 0,
|
|
5 > yieldedFiber ? "primary-light" : 10 > yieldedFiber ? "primary" : 100 > yieldedFiber ? "primary-dark" : "error"
|
|
));
|
|
}
|
|
}
|
|
startTime = (forceSync = !forceSync && 0 === (lanes & 127) && 0 === (lanes & root2.expiredLanes) || checkIfRootIsPrerendering(root2, lanes)) ? renderRootConcurrent(root2, lanes) : renderRootSync(root2, lanes, true);
|
|
var renderWasConcurrent = forceSync;
|
|
do {
|
|
if (startTime === RootInProgress) {
|
|
workInProgressRootIsPrerendering && !forceSync && markRootSuspended(root2, lanes, 0, false);
|
|
lanes = workInProgressSuspendedReason;
|
|
yieldStartTime = now();
|
|
yieldReason = lanes;
|
|
break;
|
|
} else {
|
|
yieldedFiber = now$1();
|
|
yieldEndTime = root2.current.alternate;
|
|
if (renderWasConcurrent && !isRenderConsistentWithExternalStores(yieldEndTime)) {
|
|
setCurrentTrackFromLanes(lanes);
|
|
yieldEndTime = renderStartTime;
|
|
startTime = yieldedFiber;
|
|
!supportsUserTiming || startTime <= yieldEndTime || (workInProgressUpdateTask ? workInProgressUpdateTask.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
"Teared Render",
|
|
yieldEndTime,
|
|
startTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"error"
|
|
)
|
|
) : console.timeStamp(
|
|
"Teared Render",
|
|
yieldEndTime,
|
|
startTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"error"
|
|
));
|
|
finalizeRender(lanes, yieldedFiber);
|
|
startTime = renderRootSync(root2, lanes, false);
|
|
renderWasConcurrent = false;
|
|
continue;
|
|
}
|
|
if (startTime === RootErrored) {
|
|
renderWasConcurrent = lanes;
|
|
if (root2.errorRecoveryDisabledLanes & renderWasConcurrent)
|
|
var errorRetryLanes = 0;
|
|
else
|
|
errorRetryLanes = root2.pendingLanes & -536870913, errorRetryLanes = 0 !== errorRetryLanes ? errorRetryLanes : errorRetryLanes & 536870912 ? 536870912 : 0;
|
|
if (0 !== errorRetryLanes) {
|
|
setCurrentTrackFromLanes(lanes);
|
|
logErroredRenderPhase(
|
|
renderStartTime,
|
|
yieldedFiber,
|
|
lanes,
|
|
workInProgressUpdateTask
|
|
);
|
|
finalizeRender(lanes, yieldedFiber);
|
|
lanes = errorRetryLanes;
|
|
a: {
|
|
yieldedFiber = root2;
|
|
startTime = renderWasConcurrent;
|
|
renderWasConcurrent = workInProgressRootConcurrentErrors;
|
|
var wasRootDehydrated = yieldedFiber.current.memoizedState.isDehydrated;
|
|
wasRootDehydrated && (prepareFreshStack(yieldedFiber, errorRetryLanes).flags |= 256);
|
|
errorRetryLanes = renderRootSync(
|
|
yieldedFiber,
|
|
errorRetryLanes,
|
|
false
|
|
);
|
|
if (errorRetryLanes !== RootErrored) {
|
|
if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) {
|
|
yieldedFiber.errorRecoveryDisabledLanes |= startTime;
|
|
workInProgressRootInterleavedUpdatedLanes |= startTime;
|
|
startTime = RootSuspendedWithDelay;
|
|
break a;
|
|
}
|
|
yieldedFiber = workInProgressRootRecoverableErrors;
|
|
workInProgressRootRecoverableErrors = renderWasConcurrent;
|
|
null !== yieldedFiber && (null === workInProgressRootRecoverableErrors ? workInProgressRootRecoverableErrors = yieldedFiber : workInProgressRootRecoverableErrors.push.apply(
|
|
workInProgressRootRecoverableErrors,
|
|
yieldedFiber
|
|
));
|
|
}
|
|
startTime = errorRetryLanes;
|
|
}
|
|
renderWasConcurrent = false;
|
|
if (startTime !== RootErrored) continue;
|
|
else yieldedFiber = now$1();
|
|
}
|
|
}
|
|
if (startTime === RootFatalErrored) {
|
|
setCurrentTrackFromLanes(lanes);
|
|
logErroredRenderPhase(
|
|
renderStartTime,
|
|
yieldedFiber,
|
|
lanes,
|
|
workInProgressUpdateTask
|
|
);
|
|
finalizeRender(lanes, yieldedFiber);
|
|
prepareFreshStack(root2, 0);
|
|
markRootSuspended(root2, lanes, 0, true);
|
|
break;
|
|
}
|
|
a: {
|
|
forceSync = root2;
|
|
switch (startTime) {
|
|
case RootInProgress:
|
|
case RootFatalErrored:
|
|
throw Error("Root did not complete. This is a bug in React.");
|
|
case RootSuspendedWithDelay:
|
|
if ((lanes & 4194048) !== lanes) break;
|
|
case RootSuspendedAtTheShell:
|
|
setCurrentTrackFromLanes(lanes);
|
|
logSuspendedRenderPhase(
|
|
renderStartTime,
|
|
yieldedFiber,
|
|
lanes,
|
|
workInProgressUpdateTask
|
|
);
|
|
finalizeRender(lanes, yieldedFiber);
|
|
yieldEndTime = lanes;
|
|
0 !== (yieldEndTime & 127) ? blockingSuspendedTime = yieldedFiber : 0 !== (yieldEndTime & 4194048) && (transitionSuspendedTime = yieldedFiber);
|
|
markRootSuspended(
|
|
forceSync,
|
|
lanes,
|
|
workInProgressDeferredLane,
|
|
!workInProgressRootDidSkipSuspendedSiblings
|
|
);
|
|
break a;
|
|
case RootErrored:
|
|
workInProgressRootRecoverableErrors = null;
|
|
break;
|
|
case RootSuspended:
|
|
case RootCompleted:
|
|
break;
|
|
default:
|
|
throw Error("Unknown root exit status.");
|
|
}
|
|
if (null !== ReactSharedInternals.actQueue)
|
|
commitRoot(
|
|
forceSync,
|
|
yieldEndTime,
|
|
lanes,
|
|
workInProgressRootRecoverableErrors,
|
|
workInProgressTransitions,
|
|
workInProgressRootDidIncludeRecursiveRenderUpdate,
|
|
workInProgressDeferredLane,
|
|
workInProgressRootInterleavedUpdatedLanes,
|
|
workInProgressSuspendedRetryLanes,
|
|
startTime,
|
|
null,
|
|
null,
|
|
renderStartTime,
|
|
yieldedFiber
|
|
);
|
|
else {
|
|
if ((lanes & 62914560) === lanes && (renderWasConcurrent = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now$1(), 10 < renderWasConcurrent)) {
|
|
markRootSuspended(
|
|
forceSync,
|
|
lanes,
|
|
workInProgressDeferredLane,
|
|
!workInProgressRootDidSkipSuspendedSiblings
|
|
);
|
|
if (0 !== getNextLanes(forceSync, 0, true)) break a;
|
|
pendingEffectsLanes = lanes;
|
|
forceSync.timeoutHandle = scheduleTimeout(
|
|
commitRootWhenReady.bind(
|
|
null,
|
|
forceSync,
|
|
yieldEndTime,
|
|
workInProgressRootRecoverableErrors,
|
|
workInProgressTransitions,
|
|
workInProgressRootDidIncludeRecursiveRenderUpdate,
|
|
lanes,
|
|
workInProgressDeferredLane,
|
|
workInProgressRootInterleavedUpdatedLanes,
|
|
workInProgressSuspendedRetryLanes,
|
|
workInProgressRootDidSkipSuspendedSiblings,
|
|
startTime,
|
|
"Throttled",
|
|
renderStartTime,
|
|
yieldedFiber
|
|
),
|
|
renderWasConcurrent
|
|
);
|
|
break a;
|
|
}
|
|
commitRootWhenReady(
|
|
forceSync,
|
|
yieldEndTime,
|
|
workInProgressRootRecoverableErrors,
|
|
workInProgressTransitions,
|
|
workInProgressRootDidIncludeRecursiveRenderUpdate,
|
|
lanes,
|
|
workInProgressDeferredLane,
|
|
workInProgressRootInterleavedUpdatedLanes,
|
|
workInProgressSuspendedRetryLanes,
|
|
workInProgressRootDidSkipSuspendedSiblings,
|
|
startTime,
|
|
null,
|
|
renderStartTime,
|
|
yieldedFiber
|
|
);
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
} while (1);
|
|
ensureRootIsScheduled(root2);
|
|
}
|
|
function commitRootWhenReady(root2, finishedWork, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, lanes, spawnedLane, updatedLanes, suspendedRetryLanes, didSkipSuspendedSiblings, exitStatus, suspendedCommitReason, completedRenderStartTime, completedRenderEndTime) {
|
|
root2.timeoutHandle = noTimeout;
|
|
var subtreeFlags = finishedWork.subtreeFlags, suspendedState = null;
|
|
if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) {
|
|
if (suspendedState = {
|
|
stylesheets: null,
|
|
count: 0,
|
|
imgCount: 0,
|
|
imgBytes: 0,
|
|
suspenseyImages: [],
|
|
waitingForImages: true,
|
|
waitingForViewTransition: false,
|
|
unsuspend: noop$1
|
|
}, accumulateSuspenseyCommitOnFiber(finishedWork, lanes, suspendedState), subtreeFlags = (lanes & 62914560) === lanes ? globalMostRecentFallbackTime - now$1() : (lanes & 4194048) === lanes ? globalMostRecentTransitionTime - now$1() : 0, subtreeFlags = waitForCommitToBeReady(suspendedState, subtreeFlags), null !== subtreeFlags) {
|
|
pendingEffectsLanes = lanes;
|
|
root2.cancelPendingCommit = subtreeFlags(
|
|
commitRoot.bind(
|
|
null,
|
|
root2,
|
|
finishedWork,
|
|
lanes,
|
|
recoverableErrors,
|
|
transitions,
|
|
didIncludeRenderPhaseUpdate,
|
|
spawnedLane,
|
|
updatedLanes,
|
|
suspendedRetryLanes,
|
|
exitStatus,
|
|
suspendedState,
|
|
suspendedState.waitingForViewTransition ? "Waiting for the previous Animation" : 0 < suspendedState.count ? 0 < suspendedState.imgCount ? "Suspended on CSS and Images" : "Suspended on CSS" : 1 === suspendedState.imgCount ? "Suspended on an Image" : 0 < suspendedState.imgCount ? "Suspended on Images" : null,
|
|
completedRenderStartTime,
|
|
completedRenderEndTime
|
|
)
|
|
);
|
|
markRootSuspended(
|
|
root2,
|
|
lanes,
|
|
spawnedLane,
|
|
!didSkipSuspendedSiblings
|
|
);
|
|
return;
|
|
}
|
|
}
|
|
commitRoot(
|
|
root2,
|
|
finishedWork,
|
|
lanes,
|
|
recoverableErrors,
|
|
transitions,
|
|
didIncludeRenderPhaseUpdate,
|
|
spawnedLane,
|
|
updatedLanes,
|
|
suspendedRetryLanes,
|
|
exitStatus,
|
|
suspendedState,
|
|
suspendedCommitReason,
|
|
completedRenderStartTime,
|
|
completedRenderEndTime
|
|
);
|
|
}
|
|
function isRenderConsistentWithExternalStores(finishedWork) {
|
|
for (var node2 = finishedWork; ; ) {
|
|
var tag = node2.tag;
|
|
if ((0 === tag || 11 === tag || 15 === tag) && node2.flags & 16384 && (tag = node2.updateQueue, null !== tag && (tag = tag.stores, null !== tag)))
|
|
for (var i = 0; i < tag.length; i++) {
|
|
var check = tag[i], getSnapshot = check.getSnapshot;
|
|
check = check.value;
|
|
try {
|
|
if (!objectIs(getSnapshot(), check)) return false;
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
}
|
|
tag = node2.child;
|
|
if (node2.subtreeFlags & 16384 && null !== tag)
|
|
tag.return = node2, node2 = tag;
|
|
else {
|
|
if (node2 === finishedWork) break;
|
|
for (; null === node2.sibling; ) {
|
|
if (null === node2.return || node2.return === finishedWork) return true;
|
|
node2 = node2.return;
|
|
}
|
|
node2.sibling.return = node2.return;
|
|
node2 = node2.sibling;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function markRootSuspended(root2, suspendedLanes, spawnedLane, didAttemptEntireTree) {
|
|
suspendedLanes &= ~workInProgressRootPingedLanes;
|
|
suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes;
|
|
root2.suspendedLanes |= suspendedLanes;
|
|
root2.pingedLanes &= ~suspendedLanes;
|
|
didAttemptEntireTree && (root2.warmLanes |= suspendedLanes);
|
|
didAttemptEntireTree = root2.expirationTimes;
|
|
for (var lanes = suspendedLanes; 0 < lanes; ) {
|
|
var index = 31 - clz32(lanes), lane = 1 << index;
|
|
didAttemptEntireTree[index] = -1;
|
|
lanes &= ~lane;
|
|
}
|
|
0 !== spawnedLane && markSpawnedDeferredLane(root2, spawnedLane, suspendedLanes);
|
|
}
|
|
function flushSyncWork$1() {
|
|
return (executionContext & (RenderContext | CommitContext)) === NoContext ? (flushSyncWorkAcrossRoots_impl(0, false), false) : true;
|
|
}
|
|
function resetWorkInProgressStack() {
|
|
if (null !== workInProgress) {
|
|
if (workInProgressSuspendedReason === NotSuspended)
|
|
var interruptedWork = workInProgress.return;
|
|
else
|
|
interruptedWork = workInProgress, resetContextDependencies(), resetHooksOnUnwind(interruptedWork), thenableState$1 = null, thenableIndexCounter$1 = 0, interruptedWork = workInProgress;
|
|
for (; null !== interruptedWork; )
|
|
unwindInterruptedWork(interruptedWork.alternate, interruptedWork), interruptedWork = interruptedWork.return;
|
|
workInProgress = null;
|
|
}
|
|
}
|
|
function finalizeRender(lanes, finalizationTime) {
|
|
0 !== (lanes & 127) && (blockingClampTime = finalizationTime);
|
|
0 !== (lanes & 4194048) && (transitionClampTime = finalizationTime);
|
|
0 !== (lanes & 62914560) && (retryClampTime = finalizationTime);
|
|
0 !== (lanes & 2080374784) && (idleClampTime = finalizationTime);
|
|
}
|
|
function prepareFreshStack(root2, lanes) {
|
|
supportsUserTiming && (console.timeStamp(
|
|
"Blocking Track",
|
|
3e-3,
|
|
3e-3,
|
|
"Blocking",
|
|
LANES_TRACK_GROUP,
|
|
"primary-light"
|
|
), console.timeStamp(
|
|
"Transition Track",
|
|
3e-3,
|
|
3e-3,
|
|
"Transition",
|
|
LANES_TRACK_GROUP,
|
|
"primary-light"
|
|
), console.timeStamp(
|
|
"Suspense Track",
|
|
3e-3,
|
|
3e-3,
|
|
"Suspense",
|
|
LANES_TRACK_GROUP,
|
|
"primary-light"
|
|
), console.timeStamp(
|
|
"Idle Track",
|
|
3e-3,
|
|
3e-3,
|
|
"Idle",
|
|
LANES_TRACK_GROUP,
|
|
"primary-light"
|
|
));
|
|
var previousRenderStartTime = renderStartTime;
|
|
renderStartTime = now();
|
|
if (0 !== workInProgressRootRenderLanes && 0 < previousRenderStartTime) {
|
|
setCurrentTrackFromLanes(workInProgressRootRenderLanes);
|
|
if (workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootSuspendedWithDelay)
|
|
logSuspendedRenderPhase(
|
|
previousRenderStartTime,
|
|
renderStartTime,
|
|
lanes,
|
|
workInProgressUpdateTask
|
|
);
|
|
else {
|
|
var endTime = renderStartTime, debugTask = workInProgressUpdateTask;
|
|
if (supportsUserTiming && !(endTime <= previousRenderStartTime)) {
|
|
var color2 = (lanes & 738197653) === lanes ? "tertiary-dark" : "primary-dark", label = (lanes & 536870912) === lanes ? "Prewarm" : (lanes & 201326741) === lanes ? "Interrupted Hydration" : "Interrupted Render";
|
|
debugTask ? debugTask.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
label,
|
|
previousRenderStartTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
color2
|
|
)
|
|
) : console.timeStamp(
|
|
label,
|
|
previousRenderStartTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
color2
|
|
);
|
|
}
|
|
}
|
|
finalizeRender(workInProgressRootRenderLanes, renderStartTime);
|
|
}
|
|
previousRenderStartTime = workInProgressUpdateTask;
|
|
workInProgressUpdateTask = null;
|
|
if (0 !== (lanes & 127)) {
|
|
workInProgressUpdateTask = blockingUpdateTask;
|
|
debugTask = 0 <= blockingUpdateTime && blockingUpdateTime < blockingClampTime ? blockingClampTime : blockingUpdateTime;
|
|
endTime = 0 <= blockingEventTime && blockingEventTime < blockingClampTime ? blockingClampTime : blockingEventTime;
|
|
color2 = 0 <= endTime ? endTime : 0 <= debugTask ? debugTask : renderStartTime;
|
|
0 <= blockingSuspendedTime ? (setCurrentTrackFromLanes(2), logSuspendedWithDelayPhase(
|
|
blockingSuspendedTime,
|
|
color2,
|
|
lanes,
|
|
previousRenderStartTime
|
|
)) : 0 !== (animatingLanes & 127) && (setCurrentTrackFromLanes(2), logAnimatingPhase(blockingClampTime, color2, animatingTask));
|
|
previousRenderStartTime = debugTask;
|
|
var eventTime = endTime, eventType = blockingEventType, eventIsRepeat = 0 < blockingEventRepeatTime, isSpawnedUpdate = blockingUpdateType === SPAWNED_UPDATE, isPingedUpdate = blockingUpdateType === PINGED_UPDATE;
|
|
debugTask = renderStartTime;
|
|
endTime = blockingUpdateTask;
|
|
color2 = blockingUpdateMethodName;
|
|
label = blockingUpdateComponentName;
|
|
if (supportsUserTiming) {
|
|
currentTrack = "Blocking";
|
|
0 < previousRenderStartTime ? previousRenderStartTime > debugTask && (previousRenderStartTime = debugTask) : previousRenderStartTime = debugTask;
|
|
0 < eventTime ? eventTime > previousRenderStartTime && (eventTime = previousRenderStartTime) : eventTime = previousRenderStartTime;
|
|
if (null !== eventType && previousRenderStartTime > eventTime) {
|
|
var color$jscomp$0 = eventIsRepeat ? "secondary-light" : "warning";
|
|
endTime ? endTime.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
eventIsRepeat ? "Consecutive" : "Event: " + eventType,
|
|
eventTime,
|
|
previousRenderStartTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
color$jscomp$0
|
|
)
|
|
) : console.timeStamp(
|
|
eventIsRepeat ? "Consecutive" : "Event: " + eventType,
|
|
eventTime,
|
|
previousRenderStartTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
color$jscomp$0
|
|
);
|
|
}
|
|
debugTask > previousRenderStartTime && (eventTime = isSpawnedUpdate ? "error" : (lanes & 738197653) === lanes ? "tertiary-light" : "primary-light", isSpawnedUpdate = isPingedUpdate ? "Promise Resolved" : isSpawnedUpdate ? "Cascading Update" : 5 < debugTask - previousRenderStartTime ? "Update Blocked" : "Update", isPingedUpdate = [], null != label && isPingedUpdate.push(["Component name", label]), null != color2 && isPingedUpdate.push(["Method name", color2]), previousRenderStartTime = {
|
|
start: previousRenderStartTime,
|
|
end: debugTask,
|
|
detail: {
|
|
devtools: {
|
|
properties: isPingedUpdate,
|
|
track: currentTrack,
|
|
trackGroup: LANES_TRACK_GROUP,
|
|
color: eventTime
|
|
}
|
|
}
|
|
}, endTime ? endTime.run(
|
|
performance.measure.bind(
|
|
performance,
|
|
isSpawnedUpdate,
|
|
previousRenderStartTime
|
|
)
|
|
) : performance.measure(isSpawnedUpdate, previousRenderStartTime));
|
|
}
|
|
blockingUpdateTime = -1.1;
|
|
blockingUpdateType = 0;
|
|
blockingUpdateComponentName = blockingUpdateMethodName = null;
|
|
blockingSuspendedTime = -1.1;
|
|
blockingEventRepeatTime = blockingEventTime;
|
|
blockingEventTime = -1.1;
|
|
blockingClampTime = now();
|
|
}
|
|
0 !== (lanes & 4194048) && (workInProgressUpdateTask = transitionUpdateTask, debugTask = 0 <= transitionStartTime && transitionStartTime < transitionClampTime ? transitionClampTime : transitionStartTime, previousRenderStartTime = 0 <= transitionUpdateTime && transitionUpdateTime < transitionClampTime ? transitionClampTime : transitionUpdateTime, endTime = 0 <= transitionEventTime && transitionEventTime < transitionClampTime ? transitionClampTime : transitionEventTime, color2 = 0 <= endTime ? endTime : 0 <= previousRenderStartTime ? previousRenderStartTime : renderStartTime, 0 <= transitionSuspendedTime ? (setCurrentTrackFromLanes(256), logSuspendedWithDelayPhase(
|
|
transitionSuspendedTime,
|
|
color2,
|
|
lanes,
|
|
workInProgressUpdateTask
|
|
)) : 0 !== (animatingLanes & 4194048) && (setCurrentTrackFromLanes(256), logAnimatingPhase(transitionClampTime, color2, animatingTask)), isPingedUpdate = endTime, eventTime = transitionEventType, eventType = 0 < transitionEventRepeatTime, eventIsRepeat = transitionUpdateType === PINGED_UPDATE, color2 = renderStartTime, endTime = transitionUpdateTask, label = transitionUpdateMethodName, isSpawnedUpdate = transitionUpdateComponentName, supportsUserTiming && (currentTrack = "Transition", 0 < previousRenderStartTime ? previousRenderStartTime > color2 && (previousRenderStartTime = color2) : previousRenderStartTime = color2, 0 < debugTask ? debugTask > previousRenderStartTime && (debugTask = previousRenderStartTime) : debugTask = previousRenderStartTime, 0 < isPingedUpdate ? isPingedUpdate > debugTask && (isPingedUpdate = debugTask) : isPingedUpdate = debugTask, debugTask > isPingedUpdate && null !== eventTime && (color$jscomp$0 = eventType ? "secondary-light" : "warning", endTime ? endTime.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
eventType ? "Consecutive" : "Event: " + eventTime,
|
|
isPingedUpdate,
|
|
debugTask,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
color$jscomp$0
|
|
)
|
|
) : console.timeStamp(
|
|
eventType ? "Consecutive" : "Event: " + eventTime,
|
|
isPingedUpdate,
|
|
debugTask,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
color$jscomp$0
|
|
)), previousRenderStartTime > debugTask && (endTime ? endTime.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
"Action",
|
|
debugTask,
|
|
previousRenderStartTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"primary-dark"
|
|
)
|
|
) : console.timeStamp(
|
|
"Action",
|
|
debugTask,
|
|
previousRenderStartTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"primary-dark"
|
|
)), color2 > previousRenderStartTime && (debugTask = eventIsRepeat ? "Promise Resolved" : 5 < color2 - previousRenderStartTime ? "Update Blocked" : "Update", isPingedUpdate = [], null != isSpawnedUpdate && isPingedUpdate.push(["Component name", isSpawnedUpdate]), null != label && isPingedUpdate.push(["Method name", label]), previousRenderStartTime = {
|
|
start: previousRenderStartTime,
|
|
end: color2,
|
|
detail: {
|
|
devtools: {
|
|
properties: isPingedUpdate,
|
|
track: currentTrack,
|
|
trackGroup: LANES_TRACK_GROUP,
|
|
color: "primary-light"
|
|
}
|
|
}
|
|
}, endTime ? endTime.run(
|
|
performance.measure.bind(
|
|
performance,
|
|
debugTask,
|
|
previousRenderStartTime
|
|
)
|
|
) : performance.measure(debugTask, previousRenderStartTime))), transitionUpdateTime = transitionStartTime = -1.1, transitionUpdateType = 0, transitionSuspendedTime = -1.1, transitionEventRepeatTime = transitionEventTime, transitionEventTime = -1.1, transitionClampTime = now());
|
|
0 !== (lanes & 62914560) && 0 !== (animatingLanes & 62914560) && (setCurrentTrackFromLanes(4194304), logAnimatingPhase(retryClampTime, renderStartTime, animatingTask));
|
|
0 !== (lanes & 2080374784) && 0 !== (animatingLanes & 2080374784) && (setCurrentTrackFromLanes(268435456), logAnimatingPhase(idleClampTime, renderStartTime, animatingTask));
|
|
previousRenderStartTime = root2.timeoutHandle;
|
|
previousRenderStartTime !== noTimeout && (root2.timeoutHandle = noTimeout, cancelTimeout(previousRenderStartTime));
|
|
previousRenderStartTime = root2.cancelPendingCommit;
|
|
null !== previousRenderStartTime && (root2.cancelPendingCommit = null, previousRenderStartTime());
|
|
pendingEffectsLanes = 0;
|
|
resetWorkInProgressStack();
|
|
workInProgressRoot = root2;
|
|
workInProgress = previousRenderStartTime = createWorkInProgress(
|
|
root2.current,
|
|
null
|
|
);
|
|
workInProgressRootRenderLanes = lanes;
|
|
workInProgressSuspendedReason = NotSuspended;
|
|
workInProgressThrownValue = null;
|
|
workInProgressRootDidSkipSuspendedSiblings = false;
|
|
workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root2, lanes);
|
|
workInProgressRootDidAttachPingListener = false;
|
|
workInProgressRootExitStatus = RootInProgress;
|
|
workInProgressSuspendedRetryLanes = workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = 0;
|
|
workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null;
|
|
workInProgressRootDidIncludeRecursiveRenderUpdate = false;
|
|
0 !== (lanes & 8) && (lanes |= lanes & 32);
|
|
endTime = root2.entangledLanes;
|
|
if (0 !== endTime)
|
|
for (root2 = root2.entanglements, endTime &= lanes; 0 < endTime; )
|
|
debugTask = 31 - clz32(endTime), color2 = 1 << debugTask, lanes |= root2[debugTask], endTime &= ~color2;
|
|
entangledRenderLanes = lanes;
|
|
finishQueueingConcurrentUpdates();
|
|
root2 = getCurrentTime();
|
|
1e3 < root2 - lastResetTime && (ReactSharedInternals.recentlyCreatedOwnerStacks = 0, lastResetTime = root2);
|
|
ReactStrictModeWarnings.discardPendingWarnings();
|
|
return previousRenderStartTime;
|
|
}
|
|
function handleThrow(root2, thrownValue) {
|
|
currentlyRenderingFiber = null;
|
|
ReactSharedInternals.H = ContextOnlyDispatcher;
|
|
ReactSharedInternals.getCurrentStack = null;
|
|
isRendering = false;
|
|
current = null;
|
|
thrownValue === SuspenseException || thrownValue === SuspenseActionException ? (thrownValue = getSuspendedThenable(), workInProgressSuspendedReason = SuspendedOnImmediate) : thrownValue === SuspenseyCommitException ? (thrownValue = getSuspendedThenable(), workInProgressSuspendedReason = SuspendedOnInstance) : workInProgressSuspendedReason = thrownValue === SelectiveHydrationException ? SuspendedOnHydration : null !== thrownValue && "object" === typeof thrownValue && "function" === typeof thrownValue.then ? SuspendedOnDeprecatedThrowPromise : SuspendedOnError;
|
|
workInProgressThrownValue = thrownValue;
|
|
var erroredWork = workInProgress;
|
|
null === erroredWork ? (workInProgressRootExitStatus = RootFatalErrored, logUncaughtError(
|
|
root2,
|
|
createCapturedValueAtFiber(thrownValue, root2.current)
|
|
)) : erroredWork.mode & ProfileMode && stopProfilerTimerIfRunningAndRecordDuration(erroredWork);
|
|
}
|
|
function shouldRemainOnPreviousScreen() {
|
|
var handler = suspenseHandlerStackCursor.current;
|
|
return null === handler ? true : (workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? null === shellBoundary ? true : false : (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes || 0 !== (workInProgressRootRenderLanes & 536870912) ? handler === shellBoundary : false;
|
|
}
|
|
function pushDispatcher() {
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = ContextOnlyDispatcher;
|
|
return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher;
|
|
}
|
|
function pushAsyncDispatcher() {
|
|
var prevAsyncDispatcher = ReactSharedInternals.A;
|
|
ReactSharedInternals.A = DefaultAsyncDispatcher;
|
|
return prevAsyncDispatcher;
|
|
}
|
|
function markRenderDerivedCause(fiber) {
|
|
null === workInProgressUpdateTask && (workInProgressUpdateTask = null == fiber._debugTask ? null : fiber._debugTask);
|
|
}
|
|
function renderDidSuspendDelayIfPossible() {
|
|
workInProgressRootExitStatus = RootSuspendedWithDelay;
|
|
workInProgressRootDidSkipSuspendedSiblings || (workInProgressRootRenderLanes & 4194048) !== workInProgressRootRenderLanes && null !== suspenseHandlerStackCursor.current || (workInProgressRootIsPrerendering = true);
|
|
0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) || null === workInProgressRoot || markRootSuspended(
|
|
workInProgressRoot,
|
|
workInProgressRootRenderLanes,
|
|
workInProgressDeferredLane,
|
|
false
|
|
);
|
|
}
|
|
function renderRootSync(root2, lanes, shouldYieldForPrerendering) {
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= RenderContext;
|
|
var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher();
|
|
if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
|
|
if (isDevToolsPresent) {
|
|
var memoizedUpdaters = root2.memoizedUpdaters;
|
|
0 < memoizedUpdaters.size && (restorePendingUpdaters(root2, workInProgressRootRenderLanes), memoizedUpdaters.clear());
|
|
movePendingFibersToMemoized(root2, lanes);
|
|
}
|
|
workInProgressTransitions = null;
|
|
prepareFreshStack(root2, lanes);
|
|
}
|
|
lanes = false;
|
|
memoizedUpdaters = workInProgressRootExitStatus;
|
|
a: do
|
|
try {
|
|
if (workInProgressSuspendedReason !== NotSuspended && null !== workInProgress) {
|
|
var unitOfWork = workInProgress, thrownValue = workInProgressThrownValue;
|
|
switch (workInProgressSuspendedReason) {
|
|
case SuspendedOnHydration:
|
|
resetWorkInProgressStack();
|
|
memoizedUpdaters = RootSuspendedAtTheShell;
|
|
break a;
|
|
case SuspendedOnImmediate:
|
|
case SuspendedOnData:
|
|
case SuspendedOnAction:
|
|
case SuspendedOnDeprecatedThrowPromise:
|
|
null === suspenseHandlerStackCursor.current && (lanes = true);
|
|
var reason = workInProgressSuspendedReason;
|
|
workInProgressSuspendedReason = NotSuspended;
|
|
workInProgressThrownValue = null;
|
|
throwAndUnwindWorkLoop(root2, unitOfWork, thrownValue, reason);
|
|
if (shouldYieldForPrerendering && workInProgressRootIsPrerendering) {
|
|
memoizedUpdaters = RootInProgress;
|
|
break a;
|
|
}
|
|
break;
|
|
default:
|
|
reason = workInProgressSuspendedReason, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, throwAndUnwindWorkLoop(root2, unitOfWork, thrownValue, reason);
|
|
}
|
|
}
|
|
workLoopSync();
|
|
memoizedUpdaters = workInProgressRootExitStatus;
|
|
break;
|
|
} catch (thrownValue$8) {
|
|
handleThrow(root2, thrownValue$8);
|
|
}
|
|
while (1);
|
|
lanes && root2.shellSuspendCounter++;
|
|
resetContextDependencies();
|
|
executionContext = prevExecutionContext;
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
ReactSharedInternals.A = prevAsyncDispatcher;
|
|
null === workInProgress && (workInProgressRoot = null, workInProgressRootRenderLanes = 0, finishQueueingConcurrentUpdates());
|
|
return memoizedUpdaters;
|
|
}
|
|
function workLoopSync() {
|
|
for (; null !== workInProgress; ) performUnitOfWork(workInProgress);
|
|
}
|
|
function renderRootConcurrent(root2, lanes) {
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= RenderContext;
|
|
var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher();
|
|
if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
|
|
if (isDevToolsPresent) {
|
|
var memoizedUpdaters = root2.memoizedUpdaters;
|
|
0 < memoizedUpdaters.size && (restorePendingUpdaters(root2, workInProgressRootRenderLanes), memoizedUpdaters.clear());
|
|
movePendingFibersToMemoized(root2, lanes);
|
|
}
|
|
workInProgressTransitions = null;
|
|
workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS;
|
|
prepareFreshStack(root2, lanes);
|
|
} else
|
|
workInProgressRootIsPrerendering = checkIfRootIsPrerendering(
|
|
root2,
|
|
lanes
|
|
);
|
|
a: do
|
|
try {
|
|
if (workInProgressSuspendedReason !== NotSuspended && null !== workInProgress)
|
|
b: switch (lanes = workInProgress, memoizedUpdaters = workInProgressThrownValue, workInProgressSuspendedReason) {
|
|
case SuspendedOnError:
|
|
workInProgressSuspendedReason = NotSuspended;
|
|
workInProgressThrownValue = null;
|
|
throwAndUnwindWorkLoop(
|
|
root2,
|
|
lanes,
|
|
memoizedUpdaters,
|
|
SuspendedOnError
|
|
);
|
|
break;
|
|
case SuspendedOnData:
|
|
case SuspendedOnAction:
|
|
if (isThenableResolved(memoizedUpdaters)) {
|
|
workInProgressSuspendedReason = NotSuspended;
|
|
workInProgressThrownValue = null;
|
|
replaySuspendedUnitOfWork(lanes);
|
|
break;
|
|
}
|
|
lanes = function() {
|
|
workInProgressSuspendedReason !== SuspendedOnData && workInProgressSuspendedReason !== SuspendedOnAction || workInProgressRoot !== root2 || (workInProgressSuspendedReason = SuspendedAndReadyToContinue);
|
|
ensureRootIsScheduled(root2);
|
|
};
|
|
memoizedUpdaters.then(lanes, lanes);
|
|
break a;
|
|
case SuspendedOnImmediate:
|
|
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
|
break a;
|
|
case SuspendedOnInstance:
|
|
workInProgressSuspendedReason = SuspendedOnInstanceAndReadyToContinue;
|
|
break a;
|
|
case SuspendedAndReadyToContinue:
|
|
isThenableResolved(memoizedUpdaters) ? (workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, replaySuspendedUnitOfWork(lanes)) : (workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, throwAndUnwindWorkLoop(
|
|
root2,
|
|
lanes,
|
|
memoizedUpdaters,
|
|
SuspendedAndReadyToContinue
|
|
));
|
|
break;
|
|
case SuspendedOnInstanceAndReadyToContinue:
|
|
var resource = null;
|
|
switch (workInProgress.tag) {
|
|
case 26:
|
|
resource = workInProgress.memoizedState;
|
|
case 5:
|
|
case 27:
|
|
var hostFiber = workInProgress;
|
|
if (resource ? preloadResource(resource) : hostFiber.stateNode.complete) {
|
|
workInProgressSuspendedReason = NotSuspended;
|
|
workInProgressThrownValue = null;
|
|
var sibling = hostFiber.sibling;
|
|
if (null !== sibling) workInProgress = sibling;
|
|
else {
|
|
var returnFiber = hostFiber.return;
|
|
null !== returnFiber ? (workInProgress = returnFiber, completeUnitOfWork(returnFiber)) : workInProgress = null;
|
|
}
|
|
break b;
|
|
}
|
|
break;
|
|
default:
|
|
console.error(
|
|
"Unexpected type of fiber triggered a suspensey commit. This is a bug in React."
|
|
);
|
|
}
|
|
workInProgressSuspendedReason = NotSuspended;
|
|
workInProgressThrownValue = null;
|
|
throwAndUnwindWorkLoop(
|
|
root2,
|
|
lanes,
|
|
memoizedUpdaters,
|
|
SuspendedOnInstanceAndReadyToContinue
|
|
);
|
|
break;
|
|
case SuspendedOnDeprecatedThrowPromise:
|
|
workInProgressSuspendedReason = NotSuspended;
|
|
workInProgressThrownValue = null;
|
|
throwAndUnwindWorkLoop(
|
|
root2,
|
|
lanes,
|
|
memoizedUpdaters,
|
|
SuspendedOnDeprecatedThrowPromise
|
|
);
|
|
break;
|
|
case SuspendedOnHydration:
|
|
resetWorkInProgressStack();
|
|
workInProgressRootExitStatus = RootSuspendedAtTheShell;
|
|
break a;
|
|
default:
|
|
throw Error(
|
|
"Unexpected SuspendedReason. This is a bug in React."
|
|
);
|
|
}
|
|
null !== ReactSharedInternals.actQueue ? workLoopSync() : workLoopConcurrentByScheduler();
|
|
break;
|
|
} catch (thrownValue$9) {
|
|
handleThrow(root2, thrownValue$9);
|
|
}
|
|
while (1);
|
|
resetContextDependencies();
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
ReactSharedInternals.A = prevAsyncDispatcher;
|
|
executionContext = prevExecutionContext;
|
|
if (null !== workInProgress) return RootInProgress;
|
|
workInProgressRoot = null;
|
|
workInProgressRootRenderLanes = 0;
|
|
finishQueueingConcurrentUpdates();
|
|
return workInProgressRootExitStatus;
|
|
}
|
|
function workLoopConcurrentByScheduler() {
|
|
for (; null !== workInProgress && !shouldYield(); )
|
|
performUnitOfWork(workInProgress);
|
|
}
|
|
function performUnitOfWork(unitOfWork) {
|
|
var current2 = unitOfWork.alternate;
|
|
(unitOfWork.mode & ProfileMode) !== NoMode ? (startProfilerTimer(unitOfWork), current2 = runWithFiberInDEV(
|
|
unitOfWork,
|
|
beginWork,
|
|
current2,
|
|
unitOfWork,
|
|
entangledRenderLanes
|
|
), stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : current2 = runWithFiberInDEV(
|
|
unitOfWork,
|
|
beginWork,
|
|
current2,
|
|
unitOfWork,
|
|
entangledRenderLanes
|
|
);
|
|
unitOfWork.memoizedProps = unitOfWork.pendingProps;
|
|
null === current2 ? completeUnitOfWork(unitOfWork) : workInProgress = current2;
|
|
}
|
|
function replaySuspendedUnitOfWork(unitOfWork) {
|
|
var next2 = runWithFiberInDEV(unitOfWork, replayBeginWork, unitOfWork);
|
|
unitOfWork.memoizedProps = unitOfWork.pendingProps;
|
|
null === next2 ? completeUnitOfWork(unitOfWork) : workInProgress = next2;
|
|
}
|
|
function replayBeginWork(unitOfWork) {
|
|
var current2 = unitOfWork.alternate, isProfilingMode = (unitOfWork.mode & ProfileMode) !== NoMode;
|
|
isProfilingMode && startProfilerTimer(unitOfWork);
|
|
switch (unitOfWork.tag) {
|
|
case 15:
|
|
case 0:
|
|
current2 = replayFunctionComponent(
|
|
current2,
|
|
unitOfWork,
|
|
unitOfWork.pendingProps,
|
|
unitOfWork.type,
|
|
void 0,
|
|
workInProgressRootRenderLanes
|
|
);
|
|
break;
|
|
case 11:
|
|
current2 = replayFunctionComponent(
|
|
current2,
|
|
unitOfWork,
|
|
unitOfWork.pendingProps,
|
|
unitOfWork.type.render,
|
|
unitOfWork.ref,
|
|
workInProgressRootRenderLanes
|
|
);
|
|
break;
|
|
case 5:
|
|
resetHooksOnUnwind(unitOfWork);
|
|
default:
|
|
unwindInterruptedWork(current2, unitOfWork), unitOfWork = workInProgress = resetWorkInProgress(unitOfWork, entangledRenderLanes), current2 = beginWork(current2, unitOfWork, entangledRenderLanes);
|
|
}
|
|
isProfilingMode && stopProfilerTimerIfRunningAndRecordDuration(unitOfWork);
|
|
return current2;
|
|
}
|
|
function throwAndUnwindWorkLoop(root2, unitOfWork, thrownValue, suspendedReason) {
|
|
resetContextDependencies();
|
|
resetHooksOnUnwind(unitOfWork);
|
|
thenableState$1 = null;
|
|
thenableIndexCounter$1 = 0;
|
|
var returnFiber = unitOfWork.return;
|
|
try {
|
|
if (throwException(
|
|
root2,
|
|
returnFiber,
|
|
unitOfWork,
|
|
thrownValue,
|
|
workInProgressRootRenderLanes
|
|
)) {
|
|
workInProgressRootExitStatus = RootFatalErrored;
|
|
logUncaughtError(
|
|
root2,
|
|
createCapturedValueAtFiber(thrownValue, root2.current)
|
|
);
|
|
workInProgress = null;
|
|
return;
|
|
}
|
|
} catch (error) {
|
|
if (null !== returnFiber) throw workInProgress = returnFiber, error;
|
|
workInProgressRootExitStatus = RootFatalErrored;
|
|
logUncaughtError(
|
|
root2,
|
|
createCapturedValueAtFiber(thrownValue, root2.current)
|
|
);
|
|
workInProgress = null;
|
|
return;
|
|
}
|
|
if (unitOfWork.flags & 32768) {
|
|
if (isHydrating || suspendedReason === SuspendedOnError) root2 = true;
|
|
else if (workInProgressRootIsPrerendering || 0 !== (workInProgressRootRenderLanes & 536870912))
|
|
root2 = false;
|
|
else if (workInProgressRootDidSkipSuspendedSiblings = root2 = true, suspendedReason === SuspendedOnData || suspendedReason === SuspendedOnAction || suspendedReason === SuspendedOnImmediate || suspendedReason === SuspendedOnDeprecatedThrowPromise)
|
|
suspendedReason = suspenseHandlerStackCursor.current, null !== suspendedReason && 13 === suspendedReason.tag && (suspendedReason.flags |= 16384);
|
|
unwindUnitOfWork(unitOfWork, root2);
|
|
} else completeUnitOfWork(unitOfWork);
|
|
}
|
|
function completeUnitOfWork(unitOfWork) {
|
|
var completedWork = unitOfWork;
|
|
do {
|
|
if (0 !== (completedWork.flags & 32768)) {
|
|
unwindUnitOfWork(
|
|
completedWork,
|
|
workInProgressRootDidSkipSuspendedSiblings
|
|
);
|
|
return;
|
|
}
|
|
var current2 = completedWork.alternate;
|
|
unitOfWork = completedWork.return;
|
|
startProfilerTimer(completedWork);
|
|
current2 = runWithFiberInDEV(
|
|
completedWork,
|
|
completeWork,
|
|
current2,
|
|
completedWork,
|
|
entangledRenderLanes
|
|
);
|
|
(completedWork.mode & ProfileMode) !== NoMode && stopProfilerTimerIfRunningAndRecordIncompleteDuration(completedWork);
|
|
if (null !== current2) {
|
|
workInProgress = current2;
|
|
return;
|
|
}
|
|
completedWork = completedWork.sibling;
|
|
if (null !== completedWork) {
|
|
workInProgress = completedWork;
|
|
return;
|
|
}
|
|
workInProgress = completedWork = unitOfWork;
|
|
} while (null !== completedWork);
|
|
workInProgressRootExitStatus === RootInProgress && (workInProgressRootExitStatus = RootCompleted);
|
|
}
|
|
function unwindUnitOfWork(unitOfWork, skipSiblings) {
|
|
do {
|
|
var next2 = unwindWork(unitOfWork.alternate, unitOfWork);
|
|
if (null !== next2) {
|
|
next2.flags &= 32767;
|
|
workInProgress = next2;
|
|
return;
|
|
}
|
|
if ((unitOfWork.mode & ProfileMode) !== NoMode) {
|
|
stopProfilerTimerIfRunningAndRecordIncompleteDuration(unitOfWork);
|
|
next2 = unitOfWork.actualDuration;
|
|
for (var child = unitOfWork.child; null !== child; )
|
|
next2 += child.actualDuration, child = child.sibling;
|
|
unitOfWork.actualDuration = next2;
|
|
}
|
|
next2 = unitOfWork.return;
|
|
null !== next2 && (next2.flags |= 32768, next2.subtreeFlags = 0, next2.deletions = null);
|
|
if (!skipSiblings && (unitOfWork = unitOfWork.sibling, null !== unitOfWork)) {
|
|
workInProgress = unitOfWork;
|
|
return;
|
|
}
|
|
workInProgress = unitOfWork = next2;
|
|
} while (null !== unitOfWork);
|
|
workInProgressRootExitStatus = RootSuspendedAtTheShell;
|
|
workInProgress = null;
|
|
}
|
|
function commitRoot(root2, finishedWork, lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, suspendedRetryLanes, exitStatus, suspendedState, suspendedCommitReason, completedRenderStartTime, completedRenderEndTime) {
|
|
root2.cancelPendingCommit = null;
|
|
do
|
|
flushPendingEffects();
|
|
while (pendingEffectsStatus !== NO_PENDING_EFFECTS);
|
|
ReactStrictModeWarnings.flushLegacyContextWarning();
|
|
ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
|
|
if ((executionContext & (RenderContext | CommitContext)) !== NoContext)
|
|
throw Error("Should not already be working.");
|
|
setCurrentTrackFromLanes(lanes);
|
|
exitStatus === RootErrored ? logErroredRenderPhase(
|
|
completedRenderStartTime,
|
|
completedRenderEndTime,
|
|
lanes,
|
|
workInProgressUpdateTask
|
|
) : null !== recoverableErrors ? logRecoveredRenderPhase(
|
|
completedRenderStartTime,
|
|
completedRenderEndTime,
|
|
lanes,
|
|
recoverableErrors,
|
|
null !== finishedWork && null !== finishedWork.alternate && finishedWork.alternate.memoizedState.isDehydrated && 0 !== (finishedWork.flags & 256),
|
|
workInProgressUpdateTask
|
|
) : logRenderPhase(
|
|
completedRenderStartTime,
|
|
completedRenderEndTime,
|
|
lanes,
|
|
workInProgressUpdateTask
|
|
);
|
|
if (null !== finishedWork) {
|
|
0 === lanes && console.error(
|
|
"finishedLanes should not be empty during a commit. This is a bug in React."
|
|
);
|
|
if (finishedWork === root2.current)
|
|
throw Error(
|
|
"Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
didIncludeRenderPhaseUpdate = finishedWork.lanes | finishedWork.childLanes;
|
|
didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes;
|
|
markRootFinished(
|
|
root2,
|
|
lanes,
|
|
didIncludeRenderPhaseUpdate,
|
|
spawnedLane,
|
|
updatedLanes,
|
|
suspendedRetryLanes
|
|
);
|
|
root2 === workInProgressRoot && (workInProgress = workInProgressRoot = null, workInProgressRootRenderLanes = 0);
|
|
pendingFinishedWork = finishedWork;
|
|
pendingEffectsRoot = root2;
|
|
pendingEffectsLanes = lanes;
|
|
pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate;
|
|
pendingPassiveTransitions = transitions;
|
|
pendingRecoverableErrors = recoverableErrors;
|
|
pendingEffectsRenderEndTime = completedRenderEndTime;
|
|
pendingSuspendedCommitReason = suspendedCommitReason;
|
|
pendingDelayedCommitReason = IMMEDIATE_COMMIT;
|
|
pendingSuspendedViewTransitionReason = null;
|
|
0 !== finishedWork.actualDuration || 0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256) ? (root2.callbackNode = null, root2.callbackPriority = 0, scheduleCallback$1(NormalPriority$1, function() {
|
|
schedulerEvent = window.event;
|
|
pendingDelayedCommitReason === IMMEDIATE_COMMIT && (pendingDelayedCommitReason = DELAYED_PASSIVE_COMMIT);
|
|
flushPassiveEffects();
|
|
return null;
|
|
})) : (root2.callbackNode = null, root2.callbackPriority = 0);
|
|
commitErrors = null;
|
|
commitStartTime = now();
|
|
null !== suspendedCommitReason && logSuspendedCommitPhase(
|
|
completedRenderEndTime,
|
|
commitStartTime,
|
|
suspendedCommitReason,
|
|
workInProgressUpdateTask
|
|
);
|
|
recoverableErrors = 0 !== (finishedWork.flags & 13878);
|
|
if (0 !== (finishedWork.subtreeFlags & 13878) || recoverableErrors) {
|
|
recoverableErrors = ReactSharedInternals.T;
|
|
ReactSharedInternals.T = null;
|
|
transitions = ReactDOMSharedInternals.p;
|
|
ReactDOMSharedInternals.p = DiscreteEventPriority;
|
|
spawnedLane = executionContext;
|
|
executionContext |= CommitContext;
|
|
try {
|
|
commitBeforeMutationEffects(root2, finishedWork, lanes);
|
|
} finally {
|
|
executionContext = spawnedLane, ReactDOMSharedInternals.p = transitions, ReactSharedInternals.T = recoverableErrors;
|
|
}
|
|
}
|
|
pendingEffectsStatus = PENDING_MUTATION_PHASE;
|
|
flushMutationEffects();
|
|
flushLayoutEffects();
|
|
flushSpawnedWork();
|
|
}
|
|
}
|
|
function flushMutationEffects() {
|
|
if (pendingEffectsStatus === PENDING_MUTATION_PHASE) {
|
|
pendingEffectsStatus = NO_PENDING_EFFECTS;
|
|
var root2 = pendingEffectsRoot, finishedWork = pendingFinishedWork, lanes = pendingEffectsLanes, rootMutationHasEffect = 0 !== (finishedWork.flags & 13878);
|
|
if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) {
|
|
rootMutationHasEffect = ReactSharedInternals.T;
|
|
ReactSharedInternals.T = null;
|
|
var previousPriority = ReactDOMSharedInternals.p;
|
|
ReactDOMSharedInternals.p = DiscreteEventPriority;
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= CommitContext;
|
|
try {
|
|
inProgressLanes = lanes;
|
|
inProgressRoot = root2;
|
|
resetComponentEffectTimers();
|
|
commitMutationEffectsOnFiber(finishedWork, root2);
|
|
inProgressRoot = inProgressLanes = null;
|
|
lanes = selectionInformation;
|
|
var curFocusedElem = getActiveElementDeep(root2.containerInfo), priorFocusedElem = lanes.focusedElem, priorSelectionRange = lanes.selectionRange;
|
|
if (curFocusedElem !== priorFocusedElem && priorFocusedElem && priorFocusedElem.ownerDocument && containsNode(
|
|
priorFocusedElem.ownerDocument.documentElement,
|
|
priorFocusedElem
|
|
)) {
|
|
if (null !== priorSelectionRange && hasSelectionCapabilities(priorFocusedElem)) {
|
|
var start = priorSelectionRange.start, end = priorSelectionRange.end;
|
|
void 0 === end && (end = start);
|
|
if ("selectionStart" in priorFocusedElem)
|
|
priorFocusedElem.selectionStart = start, priorFocusedElem.selectionEnd = Math.min(
|
|
end,
|
|
priorFocusedElem.value.length
|
|
);
|
|
else {
|
|
var doc = priorFocusedElem.ownerDocument || document, win = doc && doc.defaultView || window;
|
|
if (win.getSelection) {
|
|
var selection = win.getSelection(), length2 = priorFocusedElem.textContent.length, start$jscomp$0 = Math.min(
|
|
priorSelectionRange.start,
|
|
length2
|
|
), end$jscomp$0 = void 0 === priorSelectionRange.end ? start$jscomp$0 : Math.min(priorSelectionRange.end, length2);
|
|
!selection.extend && start$jscomp$0 > end$jscomp$0 && (curFocusedElem = end$jscomp$0, end$jscomp$0 = start$jscomp$0, start$jscomp$0 = curFocusedElem);
|
|
var startMarker = getNodeForCharacterOffset(
|
|
priorFocusedElem,
|
|
start$jscomp$0
|
|
), endMarker = getNodeForCharacterOffset(
|
|
priorFocusedElem,
|
|
end$jscomp$0
|
|
);
|
|
if (startMarker && endMarker && (1 !== selection.rangeCount || selection.anchorNode !== startMarker.node || selection.anchorOffset !== startMarker.offset || selection.focusNode !== endMarker.node || selection.focusOffset !== endMarker.offset)) {
|
|
var range = doc.createRange();
|
|
range.setStart(startMarker.node, startMarker.offset);
|
|
selection.removeAllRanges();
|
|
start$jscomp$0 > end$jscomp$0 ? (selection.addRange(range), selection.extend(endMarker.node, endMarker.offset)) : (range.setEnd(endMarker.node, endMarker.offset), selection.addRange(range));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
doc = [];
|
|
for (selection = priorFocusedElem; selection = selection.parentNode; )
|
|
1 === selection.nodeType && doc.push({
|
|
element: selection,
|
|
left: selection.scrollLeft,
|
|
top: selection.scrollTop
|
|
});
|
|
"function" === typeof priorFocusedElem.focus && priorFocusedElem.focus();
|
|
for (priorFocusedElem = 0; priorFocusedElem < doc.length; priorFocusedElem++) {
|
|
var info = doc[priorFocusedElem];
|
|
info.element.scrollLeft = info.left;
|
|
info.element.scrollTop = info.top;
|
|
}
|
|
}
|
|
_enabled = !!eventsEnabled;
|
|
selectionInformation = eventsEnabled = null;
|
|
} finally {
|
|
executionContext = prevExecutionContext, ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = rootMutationHasEffect;
|
|
}
|
|
}
|
|
root2.current = finishedWork;
|
|
pendingEffectsStatus = PENDING_LAYOUT_PHASE;
|
|
}
|
|
}
|
|
function flushLayoutEffects() {
|
|
if (pendingEffectsStatus === PENDING_LAYOUT_PHASE) {
|
|
pendingEffectsStatus = NO_PENDING_EFFECTS;
|
|
var suspendedViewTransitionReason = pendingSuspendedViewTransitionReason;
|
|
if (null !== suspendedViewTransitionReason) {
|
|
commitStartTime = now();
|
|
var startTime = commitEndTime, endTime = commitStartTime;
|
|
!supportsUserTiming || endTime <= startTime || (animatingTask ? animatingTask.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
suspendedViewTransitionReason,
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"secondary-light"
|
|
)
|
|
) : console.timeStamp(
|
|
suspendedViewTransitionReason,
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"secondary-light"
|
|
));
|
|
}
|
|
suspendedViewTransitionReason = pendingEffectsRoot;
|
|
startTime = pendingFinishedWork;
|
|
endTime = pendingEffectsLanes;
|
|
var rootHasLayoutEffect = 0 !== (startTime.flags & 8772);
|
|
if (0 !== (startTime.subtreeFlags & 8772) || rootHasLayoutEffect) {
|
|
rootHasLayoutEffect = ReactSharedInternals.T;
|
|
ReactSharedInternals.T = null;
|
|
var _previousPriority = ReactDOMSharedInternals.p;
|
|
ReactDOMSharedInternals.p = DiscreteEventPriority;
|
|
var _prevExecutionContext = executionContext;
|
|
executionContext |= CommitContext;
|
|
try {
|
|
inProgressLanes = endTime, inProgressRoot = suspendedViewTransitionReason, resetComponentEffectTimers(), commitLayoutEffectOnFiber(
|
|
suspendedViewTransitionReason,
|
|
startTime.alternate,
|
|
startTime
|
|
), inProgressRoot = inProgressLanes = null;
|
|
} finally {
|
|
executionContext = _prevExecutionContext, ReactDOMSharedInternals.p = _previousPriority, ReactSharedInternals.T = rootHasLayoutEffect;
|
|
}
|
|
}
|
|
suspendedViewTransitionReason = pendingEffectsRenderEndTime;
|
|
startTime = pendingSuspendedCommitReason;
|
|
commitEndTime = now();
|
|
suspendedViewTransitionReason = null === startTime ? suspendedViewTransitionReason : commitStartTime;
|
|
startTime = commitEndTime;
|
|
endTime = pendingDelayedCommitReason === ABORTED_VIEW_TRANSITION_COMMIT;
|
|
rootHasLayoutEffect = workInProgressUpdateTask;
|
|
null !== commitErrors ? logCommitErrored(
|
|
suspendedViewTransitionReason,
|
|
startTime,
|
|
commitErrors,
|
|
false,
|
|
rootHasLayoutEffect
|
|
) : !supportsUserTiming || startTime <= suspendedViewTransitionReason || (rootHasLayoutEffect ? rootHasLayoutEffect.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
endTime ? "Commit Interrupted View Transition" : "Commit",
|
|
suspendedViewTransitionReason,
|
|
startTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
endTime ? "error" : "secondary-dark"
|
|
)
|
|
) : console.timeStamp(
|
|
endTime ? "Commit Interrupted View Transition" : "Commit",
|
|
suspendedViewTransitionReason,
|
|
startTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
endTime ? "error" : "secondary-dark"
|
|
));
|
|
pendingEffectsStatus = PENDING_AFTER_MUTATION_PHASE;
|
|
}
|
|
}
|
|
function flushSpawnedWork() {
|
|
if (pendingEffectsStatus === PENDING_SPAWNED_WORK || pendingEffectsStatus === PENDING_AFTER_MUTATION_PHASE) {
|
|
if (pendingEffectsStatus === PENDING_SPAWNED_WORK) {
|
|
var startViewTransitionStartTime = commitEndTime;
|
|
commitEndTime = now();
|
|
var endTime = commitEndTime, abortedViewTransition = pendingDelayedCommitReason === ABORTED_VIEW_TRANSITION_COMMIT;
|
|
!supportsUserTiming || endTime <= startViewTransitionStartTime || (animatingTask ? animatingTask.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
abortedViewTransition ? "Interrupted View Transition" : "Starting Animation",
|
|
startViewTransitionStartTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
abortedViewTransition ? "error" : "secondary-light"
|
|
)
|
|
) : console.timeStamp(
|
|
abortedViewTransition ? "Interrupted View Transition" : "Starting Animation",
|
|
startViewTransitionStartTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
abortedViewTransition ? " error" : "secondary-light"
|
|
));
|
|
pendingDelayedCommitReason !== ABORTED_VIEW_TRANSITION_COMMIT && (pendingDelayedCommitReason = ANIMATION_STARTED_COMMIT);
|
|
}
|
|
pendingEffectsStatus = NO_PENDING_EFFECTS;
|
|
requestPaint();
|
|
startViewTransitionStartTime = pendingEffectsRoot;
|
|
var finishedWork = pendingFinishedWork;
|
|
endTime = pendingEffectsLanes;
|
|
abortedViewTransition = pendingRecoverableErrors;
|
|
var rootDidHavePassiveEffects = 0 !== finishedWork.actualDuration || 0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256);
|
|
rootDidHavePassiveEffects ? pendingEffectsStatus = PENDING_PASSIVE_PHASE : (pendingEffectsStatus = NO_PENDING_EFFECTS, pendingFinishedWork = pendingEffectsRoot = null, releaseRootPooledCache(
|
|
startViewTransitionStartTime,
|
|
startViewTransitionStartTime.pendingLanes
|
|
), nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null);
|
|
var remainingLanes = startViewTransitionStartTime.pendingLanes;
|
|
0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null);
|
|
rootDidHavePassiveEffects || commitDoubleInvokeEffectsInDEV(startViewTransitionStartTime);
|
|
remainingLanes = lanesToEventPriority(endTime);
|
|
finishedWork = finishedWork.stateNode;
|
|
if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot)
|
|
try {
|
|
var didError = 128 === (finishedWork.current.flags & 128);
|
|
switch (remainingLanes) {
|
|
case DiscreteEventPriority:
|
|
var schedulerPriority = ImmediatePriority;
|
|
break;
|
|
case ContinuousEventPriority:
|
|
schedulerPriority = UserBlockingPriority;
|
|
break;
|
|
case DefaultEventPriority:
|
|
schedulerPriority = NormalPriority$1;
|
|
break;
|
|
case IdleEventPriority:
|
|
schedulerPriority = IdlePriority;
|
|
break;
|
|
default:
|
|
schedulerPriority = NormalPriority$1;
|
|
}
|
|
injectedHook.onCommitFiberRoot(
|
|
rendererID,
|
|
finishedWork,
|
|
schedulerPriority,
|
|
didError
|
|
);
|
|
} catch (err) {
|
|
hasLoggedError || (hasLoggedError = true, console.error(
|
|
"React instrumentation encountered an error: %o",
|
|
err
|
|
));
|
|
}
|
|
isDevToolsPresent && startViewTransitionStartTime.memoizedUpdaters.clear();
|
|
onCommitRoot();
|
|
if (null !== abortedViewTransition) {
|
|
didError = ReactSharedInternals.T;
|
|
schedulerPriority = ReactDOMSharedInternals.p;
|
|
ReactDOMSharedInternals.p = DiscreteEventPriority;
|
|
ReactSharedInternals.T = null;
|
|
try {
|
|
var onRecoverableError = startViewTransitionStartTime.onRecoverableError;
|
|
for (finishedWork = 0; finishedWork < abortedViewTransition.length; finishedWork++) {
|
|
var recoverableError = abortedViewTransition[finishedWork], errorInfo = makeErrorInfo(recoverableError.stack);
|
|
runWithFiberInDEV(
|
|
recoverableError.source,
|
|
onRecoverableError,
|
|
recoverableError.value,
|
|
errorInfo
|
|
);
|
|
}
|
|
} finally {
|
|
ReactSharedInternals.T = didError, ReactDOMSharedInternals.p = schedulerPriority;
|
|
}
|
|
}
|
|
0 !== (pendingEffectsLanes & 3) && flushPendingEffects();
|
|
ensureRootIsScheduled(startViewTransitionStartTime);
|
|
remainingLanes = startViewTransitionStartTime.pendingLanes;
|
|
0 !== (endTime & 261930) && 0 !== (remainingLanes & 42) ? (nestedUpdateScheduled = true, startViewTransitionStartTime === rootWithNestedUpdates ? nestedUpdateCount++ : (nestedUpdateCount = 0, rootWithNestedUpdates = startViewTransitionStartTime)) : nestedUpdateCount = 0;
|
|
rootDidHavePassiveEffects || finalizeRender(endTime, commitEndTime);
|
|
flushSyncWorkAcrossRoots_impl(0, false);
|
|
}
|
|
}
|
|
function makeErrorInfo(componentStack) {
|
|
componentStack = { componentStack };
|
|
Object.defineProperty(componentStack, "digest", {
|
|
get: function() {
|
|
console.error(
|
|
'You are accessing "digest" from the errorInfo object passed to onRecoverableError. This property is no longer provided as part of errorInfo but can be accessed as a property of the Error instance itself.'
|
|
);
|
|
}
|
|
});
|
|
return componentStack;
|
|
}
|
|
function releaseRootPooledCache(root2, remainingLanes) {
|
|
0 === (root2.pooledCacheLanes &= remainingLanes) && (remainingLanes = root2.pooledCache, null != remainingLanes && (root2.pooledCache = null, releaseCache(remainingLanes)));
|
|
}
|
|
function flushPendingEffects() {
|
|
flushMutationEffects();
|
|
flushLayoutEffects();
|
|
flushSpawnedWork();
|
|
return flushPassiveEffects();
|
|
}
|
|
function flushPassiveEffects() {
|
|
if (pendingEffectsStatus !== PENDING_PASSIVE_PHASE) return false;
|
|
var root2 = pendingEffectsRoot, remainingLanes = pendingEffectsRemainingLanes;
|
|
pendingEffectsRemainingLanes = 0;
|
|
var renderPriority = lanesToEventPriority(pendingEffectsLanes), priority = 0 === DefaultEventPriority || DefaultEventPriority > renderPriority ? DefaultEventPriority : renderPriority;
|
|
renderPriority = ReactSharedInternals.T;
|
|
var previousPriority = ReactDOMSharedInternals.p;
|
|
try {
|
|
ReactDOMSharedInternals.p = priority;
|
|
ReactSharedInternals.T = null;
|
|
var transitions = pendingPassiveTransitions;
|
|
pendingPassiveTransitions = null;
|
|
priority = pendingEffectsRoot;
|
|
var lanes = pendingEffectsLanes;
|
|
pendingEffectsStatus = NO_PENDING_EFFECTS;
|
|
pendingFinishedWork = pendingEffectsRoot = null;
|
|
pendingEffectsLanes = 0;
|
|
if ((executionContext & (RenderContext | CommitContext)) !== NoContext)
|
|
throw Error("Cannot flush passive effects while already rendering.");
|
|
setCurrentTrackFromLanes(lanes);
|
|
isFlushingPassiveEffects = true;
|
|
didScheduleUpdateDuringPassiveEffects = false;
|
|
var passiveEffectStartTime = 0;
|
|
commitErrors = null;
|
|
passiveEffectStartTime = now$1();
|
|
if (pendingDelayedCommitReason === ANIMATION_STARTED_COMMIT)
|
|
logAnimatingPhase(
|
|
commitEndTime,
|
|
passiveEffectStartTime,
|
|
animatingTask
|
|
);
|
|
else {
|
|
var startTime = commitEndTime, endTime = passiveEffectStartTime, delayedUntilPaint = pendingDelayedCommitReason === DELAYED_PASSIVE_COMMIT;
|
|
!supportsUserTiming || endTime <= startTime || (workInProgressUpdateTask ? workInProgressUpdateTask.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
delayedUntilPaint ? "Waiting for Paint" : "Waiting",
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"secondary-light"
|
|
)
|
|
) : console.timeStamp(
|
|
delayedUntilPaint ? "Waiting for Paint" : "Waiting",
|
|
startTime,
|
|
endTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"secondary-light"
|
|
));
|
|
}
|
|
startTime = executionContext;
|
|
executionContext |= CommitContext;
|
|
var finishedWork = priority.current;
|
|
resetComponentEffectTimers();
|
|
commitPassiveUnmountOnFiber(finishedWork);
|
|
var finishedWork$jscomp$0 = priority.current;
|
|
finishedWork = pendingEffectsRenderEndTime;
|
|
resetComponentEffectTimers();
|
|
commitPassiveMountOnFiber(
|
|
priority,
|
|
finishedWork$jscomp$0,
|
|
lanes,
|
|
transitions,
|
|
finishedWork
|
|
);
|
|
commitDoubleInvokeEffectsInDEV(priority);
|
|
executionContext = startTime;
|
|
var passiveEffectsEndTime = now$1();
|
|
finishedWork$jscomp$0 = passiveEffectStartTime;
|
|
finishedWork = workInProgressUpdateTask;
|
|
null !== commitErrors ? logCommitErrored(
|
|
finishedWork$jscomp$0,
|
|
passiveEffectsEndTime,
|
|
commitErrors,
|
|
true,
|
|
finishedWork
|
|
) : !supportsUserTiming || passiveEffectsEndTime <= finishedWork$jscomp$0 || (finishedWork ? finishedWork.run(
|
|
console.timeStamp.bind(
|
|
console,
|
|
"Remaining Effects",
|
|
finishedWork$jscomp$0,
|
|
passiveEffectsEndTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"secondary-dark"
|
|
)
|
|
) : console.timeStamp(
|
|
"Remaining Effects",
|
|
finishedWork$jscomp$0,
|
|
passiveEffectsEndTime,
|
|
currentTrack,
|
|
LANES_TRACK_GROUP,
|
|
"secondary-dark"
|
|
));
|
|
finalizeRender(lanes, passiveEffectsEndTime);
|
|
flushSyncWorkAcrossRoots_impl(0, false);
|
|
didScheduleUpdateDuringPassiveEffects ? priority === rootWithPassiveNestedUpdates ? nestedPassiveUpdateCount++ : (nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = priority) : nestedPassiveUpdateCount = 0;
|
|
didScheduleUpdateDuringPassiveEffects = isFlushingPassiveEffects = false;
|
|
if (injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot)
|
|
try {
|
|
injectedHook.onPostCommitFiberRoot(rendererID, priority);
|
|
} catch (err) {
|
|
hasLoggedError || (hasLoggedError = true, console.error(
|
|
"React instrumentation encountered an error: %o",
|
|
err
|
|
));
|
|
}
|
|
var stateNode = priority.current.stateNode;
|
|
stateNode.effectDuration = 0;
|
|
stateNode.passiveEffectDuration = 0;
|
|
return true;
|
|
} finally {
|
|
ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = renderPriority, releaseRootPooledCache(root2, remainingLanes);
|
|
}
|
|
}
|
|
function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
|
|
sourceFiber = createCapturedValueAtFiber(error, sourceFiber);
|
|
recordEffectError(sourceFiber);
|
|
sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2);
|
|
rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2);
|
|
null !== rootFiber && (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber));
|
|
}
|
|
function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) {
|
|
isRunningInsertionEffect = false;
|
|
if (3 === sourceFiber.tag)
|
|
captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
|
|
else {
|
|
for (; null !== nearestMountedAncestor; ) {
|
|
if (3 === nearestMountedAncestor.tag) {
|
|
captureCommitPhaseErrorOnRoot(
|
|
nearestMountedAncestor,
|
|
sourceFiber,
|
|
error
|
|
);
|
|
return;
|
|
}
|
|
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);
|
|
recordEffectError(sourceFiber);
|
|
error = createClassErrorUpdate(2);
|
|
instance = enqueueUpdate(nearestMountedAncestor, error, 2);
|
|
null !== instance && (initializeClassErrorUpdate(
|
|
error,
|
|
instance,
|
|
nearestMountedAncestor,
|
|
sourceFiber
|
|
), markRootUpdated$1(instance, 2), ensureRootIsScheduled(instance));
|
|
return;
|
|
}
|
|
}
|
|
nearestMountedAncestor = nearestMountedAncestor.return;
|
|
}
|
|
console.error(
|
|
"Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.\n\nError message:\n\n%s",
|
|
error
|
|
);
|
|
}
|
|
}
|
|
function attachPingListener(root2, wakeable, lanes) {
|
|
var pingCache = root2.pingCache;
|
|
if (null === pingCache) {
|
|
pingCache = root2.pingCache = new PossiblyWeakMap();
|
|
var threadIDs = /* @__PURE__ */ new Set();
|
|
pingCache.set(wakeable, threadIDs);
|
|
} else
|
|
threadIDs = pingCache.get(wakeable), void 0 === threadIDs && (threadIDs = /* @__PURE__ */ new Set(), pingCache.set(wakeable, threadIDs));
|
|
threadIDs.has(lanes) || (workInProgressRootDidAttachPingListener = true, threadIDs.add(lanes), pingCache = pingSuspendedRoot.bind(null, root2, wakeable, lanes), isDevToolsPresent && restorePendingUpdaters(root2, lanes), wakeable.then(pingCache, pingCache));
|
|
}
|
|
function pingSuspendedRoot(root2, wakeable, pingedLanes) {
|
|
var pingCache = root2.pingCache;
|
|
null !== pingCache && pingCache.delete(wakeable);
|
|
root2.pingedLanes |= root2.suspendedLanes & pingedLanes;
|
|
root2.warmLanes &= ~pingedLanes;
|
|
0 !== (pingedLanes & 127) ? 0 > blockingUpdateTime && (blockingClampTime = blockingUpdateTime = now(), blockingUpdateTask = createTask("Promise Resolved"), blockingUpdateType = PINGED_UPDATE) : 0 !== (pingedLanes & 4194048) && 0 > transitionUpdateTime && (transitionClampTime = transitionUpdateTime = now(), transitionUpdateTask = createTask("Promise Resolved"), transitionUpdateType = PINGED_UPDATE);
|
|
isConcurrentActEnvironment() && null === ReactSharedInternals.actQueue && console.error(
|
|
"A suspended resource finished loading inside a test, but the event was not wrapped in act(...).\n\nWhen testing, code that resolves suspended data should be wrapped into act(...):\n\nact(() => {\n /* finish loading suspended data */\n});\n/* assert on the output */\n\nThis 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"
|
|
);
|
|
workInProgressRoot === root2 && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes && now$1() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS ? (executionContext & RenderContext) === NoContext && prepareFreshStack(root2, 0) : workInProgressRootPingedLanes |= pingedLanes, workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && (workInProgressSuspendedRetryLanes = 0));
|
|
ensureRootIsScheduled(root2);
|
|
}
|
|
function retryTimedOutBoundary(boundaryFiber, retryLane) {
|
|
0 === retryLane && (retryLane = claimNextRetryLane());
|
|
boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane);
|
|
null !== boundaryFiber && (markRootUpdated$1(boundaryFiber, retryLane), ensureRootIsScheduled(boundaryFiber));
|
|
}
|
|
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 31:
|
|
case 13:
|
|
var retryCache = boundaryFiber.stateNode;
|
|
var suspenseState = boundaryFiber.memoizedState;
|
|
null !== suspenseState && (retryLane = suspenseState.retryLane);
|
|
break;
|
|
case 19:
|
|
retryCache = boundaryFiber.stateNode;
|
|
break;
|
|
case 22:
|
|
retryCache = boundaryFiber.stateNode._retryCache;
|
|
break;
|
|
default:
|
|
throw Error(
|
|
"Pinged unknown suspense boundary type. This is probably a bug in React."
|
|
);
|
|
}
|
|
null !== retryCache && retryCache.delete(wakeable);
|
|
retryTimedOutBoundary(boundaryFiber, retryLane);
|
|
}
|
|
function recursivelyTraverseAndDoubleInvokeEffectsInDEV(root$jscomp$0, parentFiber, isInStrictMode) {
|
|
if (0 !== (parentFiber.subtreeFlags & 67117056))
|
|
for (parentFiber = parentFiber.child; null !== parentFiber; ) {
|
|
var root2 = root$jscomp$0, fiber = parentFiber, isStrictModeFiber = fiber.type === REACT_STRICT_MODE_TYPE;
|
|
isStrictModeFiber = isInStrictMode || isStrictModeFiber;
|
|
22 !== fiber.tag ? fiber.flags & 67108864 ? isStrictModeFiber && runWithFiberInDEV(
|
|
fiber,
|
|
doubleInvokeEffectsOnFiber,
|
|
root2,
|
|
fiber
|
|
) : recursivelyTraverseAndDoubleInvokeEffectsInDEV(
|
|
root2,
|
|
fiber,
|
|
isStrictModeFiber
|
|
) : null === fiber.memoizedState && (isStrictModeFiber && fiber.flags & 8192 ? runWithFiberInDEV(
|
|
fiber,
|
|
doubleInvokeEffectsOnFiber,
|
|
root2,
|
|
fiber
|
|
) : fiber.subtreeFlags & 67108864 && runWithFiberInDEV(
|
|
fiber,
|
|
recursivelyTraverseAndDoubleInvokeEffectsInDEV,
|
|
root2,
|
|
fiber,
|
|
isStrictModeFiber
|
|
));
|
|
parentFiber = parentFiber.sibling;
|
|
}
|
|
}
|
|
function doubleInvokeEffectsOnFiber(root2, fiber) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
disappearLayoutEffects(fiber), disconnectPassiveEffect(fiber), reappearLayoutEffects(root2, fiber.alternate, fiber, false), reconnectPassiveEffects(root2, fiber, 0, null, false, 0);
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
function commitDoubleInvokeEffectsInDEV(root2) {
|
|
var doubleInvokeEffects = true;
|
|
root2.current.mode & (StrictLegacyMode | StrictEffectsMode) || (doubleInvokeEffects = false);
|
|
recursivelyTraverseAndDoubleInvokeEffectsInDEV(
|
|
root2,
|
|
root2.current,
|
|
doubleInvokeEffects
|
|
);
|
|
}
|
|
function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {
|
|
if ((executionContext & RenderContext) === NoContext) {
|
|
var tag = fiber.tag;
|
|
if (3 === tag || 1 === tag || 0 === tag || 11 === tag || 14 === tag || 15 === tag) {
|
|
tag = getComponentNameFromFiber(fiber) || "ReactComponent";
|
|
if (null !== didWarnStateUpdateForNotYetMountedComponent) {
|
|
if (didWarnStateUpdateForNotYetMountedComponent.has(tag)) return;
|
|
didWarnStateUpdateForNotYetMountedComponent.add(tag);
|
|
} else didWarnStateUpdateForNotYetMountedComponent = /* @__PURE__ */ new Set([tag]);
|
|
runWithFiberInDEV(fiber, function() {
|
|
console.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 tries to update the component. Move this work to useEffect instead."
|
|
);
|
|
});
|
|
}
|
|
}
|
|
}
|
|
function restorePendingUpdaters(root2, lanes) {
|
|
isDevToolsPresent && root2.memoizedUpdaters.forEach(function(schedulingFiber) {
|
|
addFiberToLanesMap(root2, schedulingFiber, lanes);
|
|
});
|
|
}
|
|
function scheduleCallback$1(priorityLevel, callback) {
|
|
var actQueue = ReactSharedInternals.actQueue;
|
|
return null !== actQueue ? (actQueue.push(callback), fakeActCallbackNode$1) : scheduleCallback$3(priorityLevel, callback);
|
|
}
|
|
function warnIfUpdatesNotWrappedWithActDEV(fiber) {
|
|
isConcurrentActEnvironment() && null === ReactSharedInternals.actQueue && runWithFiberInDEV(fiber, function() {
|
|
console.error(
|
|
"An update to %s inside a test was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n /* fire events that update state */\n});\n/* assert on the output */\n\nThis 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)
|
|
);
|
|
});
|
|
}
|
|
function ensureRootIsScheduled(root2) {
|
|
root2 !== lastScheduledRoot && null === root2.next && (null === lastScheduledRoot ? firstScheduledRoot = lastScheduledRoot = root2 : lastScheduledRoot = lastScheduledRoot.next = root2);
|
|
mightHavePendingSyncWork = true;
|
|
null !== ReactSharedInternals.actQueue ? didScheduleMicrotask_act || (didScheduleMicrotask_act = true, scheduleImmediateRootScheduleTask()) : didScheduleMicrotask || (didScheduleMicrotask = true, scheduleImmediateRootScheduleTask());
|
|
}
|
|
function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) {
|
|
if (!isFlushingWork && mightHavePendingSyncWork) {
|
|
isFlushingWork = true;
|
|
do {
|
|
var didPerformSomeWork = false;
|
|
for (var root2 = firstScheduledRoot; null !== root2; ) {
|
|
if (!onlyLegacy)
|
|
if (0 !== syncTransitionLanes) {
|
|
var pendingLanes = root2.pendingLanes;
|
|
if (0 === pendingLanes) var nextLanes = 0;
|
|
else {
|
|
var suspendedLanes = root2.suspendedLanes, pingedLanes = root2.pingedLanes;
|
|
nextLanes = (1 << 31 - clz32(42 | syncTransitionLanes) + 1) - 1;
|
|
nextLanes &= pendingLanes & ~(suspendedLanes & ~pingedLanes);
|
|
nextLanes = nextLanes & 201326741 ? nextLanes & 201326741 | 1 : nextLanes ? nextLanes | 2 : 0;
|
|
}
|
|
0 !== nextLanes && (didPerformSomeWork = true, performSyncWorkOnRoot(root2, nextLanes));
|
|
} else
|
|
nextLanes = workInProgressRootRenderLanes, nextLanes = getNextLanes(
|
|
root2,
|
|
root2 === workInProgressRoot ? nextLanes : 0,
|
|
null !== root2.cancelPendingCommit || root2.timeoutHandle !== noTimeout
|
|
), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root2, nextLanes) || (didPerformSomeWork = true, performSyncWorkOnRoot(root2, nextLanes));
|
|
root2 = root2.next;
|
|
}
|
|
} while (didPerformSomeWork);
|
|
isFlushingWork = false;
|
|
}
|
|
}
|
|
function processRootScheduleInImmediateTask() {
|
|
schedulerEvent = window.event;
|
|
processRootScheduleInMicrotask();
|
|
}
|
|
function processRootScheduleInMicrotask() {
|
|
mightHavePendingSyncWork = didScheduleMicrotask_act = didScheduleMicrotask = false;
|
|
var syncTransitionLanes = 0;
|
|
0 !== currentEventTransitionLane && shouldAttemptEagerTransition() && (syncTransitionLanes = currentEventTransitionLane);
|
|
for (var currentTime = now$1(), prev2 = null, root2 = firstScheduledRoot; null !== root2; ) {
|
|
var next2 = root2.next, nextLanes = scheduleTaskForRootDuringMicrotask(root2, currentTime);
|
|
if (0 === nextLanes)
|
|
root2.next = null, null === prev2 ? firstScheduledRoot = next2 : prev2.next = next2, null === next2 && (lastScheduledRoot = prev2);
|
|
else if (prev2 = root2, 0 !== syncTransitionLanes || 0 !== (nextLanes & 3))
|
|
mightHavePendingSyncWork = true;
|
|
root2 = next2;
|
|
}
|
|
pendingEffectsStatus !== NO_PENDING_EFFECTS && pendingEffectsStatus !== PENDING_PASSIVE_PHASE || flushSyncWorkAcrossRoots_impl(syncTransitionLanes, false);
|
|
0 !== currentEventTransitionLane && (currentEventTransitionLane = 0);
|
|
}
|
|
function scheduleTaskForRootDuringMicrotask(root2, currentTime) {
|
|
for (var suspendedLanes = root2.suspendedLanes, pingedLanes = root2.pingedLanes, expirationTimes = root2.expirationTimes, lanes = root2.pendingLanes & -62914561; 0 < lanes; ) {
|
|
var index = 31 - clz32(lanes), lane = 1 << index, expirationTime = expirationTimes[index];
|
|
if (-1 === expirationTime) {
|
|
if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes))
|
|
expirationTimes[index] = computeExpirationTime(lane, currentTime);
|
|
} else expirationTime <= currentTime && (root2.expiredLanes |= lane);
|
|
lanes &= ~lane;
|
|
}
|
|
currentTime = workInProgressRoot;
|
|
suspendedLanes = workInProgressRootRenderLanes;
|
|
suspendedLanes = getNextLanes(
|
|
root2,
|
|
root2 === currentTime ? suspendedLanes : 0,
|
|
null !== root2.cancelPendingCommit || root2.timeoutHandle !== noTimeout
|
|
);
|
|
pingedLanes = root2.callbackNode;
|
|
if (0 === suspendedLanes || root2 === currentTime && (workInProgressSuspendedReason === SuspendedOnData || workInProgressSuspendedReason === SuspendedOnAction) || null !== root2.cancelPendingCommit)
|
|
return null !== pingedLanes && cancelCallback(pingedLanes), root2.callbackNode = null, root2.callbackPriority = 0;
|
|
if (0 === (suspendedLanes & 3) || checkIfRootIsPrerendering(root2, suspendedLanes)) {
|
|
currentTime = suspendedLanes & -suspendedLanes;
|
|
if (currentTime !== root2.callbackPriority || null !== ReactSharedInternals.actQueue && pingedLanes !== fakeActCallbackNode)
|
|
cancelCallback(pingedLanes);
|
|
else return currentTime;
|
|
switch (lanesToEventPriority(suspendedLanes)) {
|
|
case DiscreteEventPriority:
|
|
case ContinuousEventPriority:
|
|
suspendedLanes = UserBlockingPriority;
|
|
break;
|
|
case DefaultEventPriority:
|
|
suspendedLanes = NormalPriority$1;
|
|
break;
|
|
case IdleEventPriority:
|
|
suspendedLanes = IdlePriority;
|
|
break;
|
|
default:
|
|
suspendedLanes = NormalPriority$1;
|
|
}
|
|
pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root2);
|
|
null !== ReactSharedInternals.actQueue ? (ReactSharedInternals.actQueue.push(pingedLanes), suspendedLanes = fakeActCallbackNode) : suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes);
|
|
root2.callbackPriority = currentTime;
|
|
root2.callbackNode = suspendedLanes;
|
|
return currentTime;
|
|
}
|
|
null !== pingedLanes && cancelCallback(pingedLanes);
|
|
root2.callbackPriority = 2;
|
|
root2.callbackNode = null;
|
|
return 2;
|
|
}
|
|
function performWorkOnRootViaSchedulerTask(root2, didTimeout) {
|
|
nestedUpdateScheduled = currentUpdateIsNested = false;
|
|
schedulerEvent = window.event;
|
|
if (pendingEffectsStatus !== NO_PENDING_EFFECTS && pendingEffectsStatus !== PENDING_PASSIVE_PHASE)
|
|
return root2.callbackNode = null, root2.callbackPriority = 0, null;
|
|
var originalCallbackNode = root2.callbackNode;
|
|
pendingDelayedCommitReason === IMMEDIATE_COMMIT && (pendingDelayedCommitReason = DELAYED_PASSIVE_COMMIT);
|
|
if (flushPendingEffects() && root2.callbackNode !== originalCallbackNode)
|
|
return null;
|
|
var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes;
|
|
workInProgressRootRenderLanes$jscomp$0 = getNextLanes(
|
|
root2,
|
|
root2 === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0,
|
|
null !== root2.cancelPendingCommit || root2.timeoutHandle !== noTimeout
|
|
);
|
|
if (0 === workInProgressRootRenderLanes$jscomp$0) return null;
|
|
performWorkOnRoot(
|
|
root2,
|
|
workInProgressRootRenderLanes$jscomp$0,
|
|
didTimeout
|
|
);
|
|
scheduleTaskForRootDuringMicrotask(root2, now$1());
|
|
return null != root2.callbackNode && root2.callbackNode === originalCallbackNode ? performWorkOnRootViaSchedulerTask.bind(null, root2) : null;
|
|
}
|
|
function performSyncWorkOnRoot(root2, lanes) {
|
|
if (flushPendingEffects()) return null;
|
|
currentUpdateIsNested = nestedUpdateScheduled;
|
|
nestedUpdateScheduled = false;
|
|
performWorkOnRoot(root2, lanes, true);
|
|
}
|
|
function cancelCallback(callbackNode) {
|
|
callbackNode !== fakeActCallbackNode && null !== callbackNode && cancelCallback$1(callbackNode);
|
|
}
|
|
function scheduleImmediateRootScheduleTask() {
|
|
null !== ReactSharedInternals.actQueue && ReactSharedInternals.actQueue.push(function() {
|
|
processRootScheduleInMicrotask();
|
|
return null;
|
|
});
|
|
scheduleMicrotask(function() {
|
|
(executionContext & (RenderContext | CommitContext)) !== NoContext ? scheduleCallback$3(
|
|
ImmediatePriority,
|
|
processRootScheduleInImmediateTask
|
|
) : processRootScheduleInMicrotask();
|
|
});
|
|
}
|
|
function requestTransitionLane() {
|
|
if (0 === currentEventTransitionLane) {
|
|
var actionScopeLane = currentEntangledLane;
|
|
0 === actionScopeLane && (actionScopeLane = nextTransitionUpdateLane, nextTransitionUpdateLane <<= 1, 0 === (nextTransitionUpdateLane & 261888) && (nextTransitionUpdateLane = 256));
|
|
currentEventTransitionLane = actionScopeLane;
|
|
}
|
|
return currentEventTransitionLane;
|
|
}
|
|
function coerceFormActionProp(actionProp) {
|
|
if (null == actionProp || "symbol" === typeof actionProp || "boolean" === typeof actionProp)
|
|
return null;
|
|
if ("function" === typeof actionProp) return actionProp;
|
|
checkAttributeStringCoercion(actionProp, "action");
|
|
return sanitizeURL("" + actionProp);
|
|
}
|
|
function createFormDataWithSubmitter(form, submitter) {
|
|
var temp = submitter.ownerDocument.createElement("input");
|
|
temp.name = submitter.name;
|
|
temp.value = submitter.value;
|
|
form.id && temp.setAttribute("form", form.id);
|
|
submitter.parentNode.insertBefore(temp, submitter);
|
|
form = new FormData(form);
|
|
temp.parentNode.removeChild(temp);
|
|
return form;
|
|
}
|
|
function extractEvents$1(dispatchQueue, domEventName, maybeTargetInst, nativeEvent, nativeEventTarget) {
|
|
if ("submit" === domEventName && maybeTargetInst && maybeTargetInst.stateNode === nativeEventTarget) {
|
|
var action = coerceFormActionProp(
|
|
(nativeEventTarget[internalPropsKey] || null).action
|
|
), submitter = nativeEvent.submitter;
|
|
submitter && (domEventName = (domEventName = submitter[internalPropsKey] || null) ? coerceFormActionProp(domEventName.formAction) : submitter.getAttribute("formAction"), null !== domEventName && (action = domEventName, submitter = null));
|
|
var event = new SyntheticEvent(
|
|
"action",
|
|
"action",
|
|
null,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
);
|
|
dispatchQueue.push({
|
|
event,
|
|
listeners: [
|
|
{
|
|
instance: null,
|
|
listener: function() {
|
|
if (nativeEvent.defaultPrevented) {
|
|
if (0 !== currentEventTransitionLane) {
|
|
var formData = submitter ? createFormDataWithSubmitter(
|
|
nativeEventTarget,
|
|
submitter
|
|
) : new FormData(nativeEventTarget), pendingState = {
|
|
pending: true,
|
|
data: formData,
|
|
method: nativeEventTarget.method,
|
|
action
|
|
};
|
|
Object.freeze(pendingState);
|
|
startHostTransition(
|
|
maybeTargetInst,
|
|
pendingState,
|
|
null,
|
|
formData
|
|
);
|
|
}
|
|
} else
|
|
"function" === typeof action && (event.preventDefault(), formData = submitter ? createFormDataWithSubmitter(
|
|
nativeEventTarget,
|
|
submitter
|
|
) : new FormData(nativeEventTarget), pendingState = {
|
|
pending: true,
|
|
data: formData,
|
|
method: nativeEventTarget.method,
|
|
action
|
|
}, Object.freeze(pendingState), startHostTransition(
|
|
maybeTargetInst,
|
|
pendingState,
|
|
action,
|
|
formData
|
|
));
|
|
},
|
|
currentTarget: nativeEventTarget
|
|
}
|
|
]
|
|
});
|
|
}
|
|
}
|
|
function executeDispatch(event, listener, currentTarget) {
|
|
event.currentTarget = currentTarget;
|
|
try {
|
|
listener(event);
|
|
} catch (error) {
|
|
reportGlobalError(error);
|
|
}
|
|
event.currentTarget = null;
|
|
}
|
|
function processDispatchQueue(dispatchQueue, eventSystemFlags) {
|
|
eventSystemFlags = 0 !== (eventSystemFlags & 4);
|
|
for (var i = 0; i < dispatchQueue.length; i++) {
|
|
var _dispatchQueue$i = dispatchQueue[i];
|
|
a: {
|
|
var previousInstance = void 0, event = _dispatchQueue$i.event;
|
|
_dispatchQueue$i = _dispatchQueue$i.listeners;
|
|
if (eventSystemFlags)
|
|
for (var i$jscomp$0 = _dispatchQueue$i.length - 1; 0 <= i$jscomp$0; i$jscomp$0--) {
|
|
var _dispatchListeners$i = _dispatchQueue$i[i$jscomp$0], instance = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget;
|
|
_dispatchListeners$i = _dispatchListeners$i.listener;
|
|
if (instance !== previousInstance && event.isPropagationStopped())
|
|
break a;
|
|
null !== instance ? runWithFiberInDEV(
|
|
instance,
|
|
executeDispatch,
|
|
event,
|
|
_dispatchListeners$i,
|
|
currentTarget
|
|
) : executeDispatch(event, _dispatchListeners$i, currentTarget);
|
|
previousInstance = instance;
|
|
}
|
|
else
|
|
for (i$jscomp$0 = 0; i$jscomp$0 < _dispatchQueue$i.length; i$jscomp$0++) {
|
|
_dispatchListeners$i = _dispatchQueue$i[i$jscomp$0];
|
|
instance = _dispatchListeners$i.instance;
|
|
currentTarget = _dispatchListeners$i.currentTarget;
|
|
_dispatchListeners$i = _dispatchListeners$i.listener;
|
|
if (instance !== previousInstance && event.isPropagationStopped())
|
|
break a;
|
|
null !== instance ? runWithFiberInDEV(
|
|
instance,
|
|
executeDispatch,
|
|
event,
|
|
_dispatchListeners$i,
|
|
currentTarget
|
|
) : executeDispatch(event, _dispatchListeners$i, currentTarget);
|
|
previousInstance = instance;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function listenToNonDelegatedEvent(domEventName, targetElement) {
|
|
nonDelegatedEvents.has(domEventName) || console.error(
|
|
'Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',
|
|
domEventName
|
|
);
|
|
var listenerSet = targetElement[internalEventHandlersKey];
|
|
void 0 === listenerSet && (listenerSet = targetElement[internalEventHandlersKey] = /* @__PURE__ */ new Set());
|
|
var listenerSetKey = domEventName + "__bubble";
|
|
listenerSet.has(listenerSetKey) || (addTrappedEventListener(targetElement, domEventName, 2, false), listenerSet.add(listenerSetKey));
|
|
}
|
|
function listenToNativeEvent(domEventName, isCapturePhaseListener, target) {
|
|
nonDelegatedEvents.has(domEventName) && !isCapturePhaseListener && console.error(
|
|
'Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.',
|
|
domEventName
|
|
);
|
|
var eventSystemFlags = 0;
|
|
isCapturePhaseListener && (eventSystemFlags |= 4);
|
|
addTrappedEventListener(
|
|
target,
|
|
domEventName,
|
|
eventSystemFlags,
|
|
isCapturePhaseListener
|
|
);
|
|
}
|
|
function listenToAllSupportedEvents(rootContainerElement) {
|
|
if (!rootContainerElement[listeningMarker]) {
|
|
rootContainerElement[listeningMarker] = true;
|
|
allNativeEvents.forEach(function(domEventName) {
|
|
"selectionchange" !== domEventName && (nonDelegatedEvents.has(domEventName) || listenToNativeEvent(domEventName, false, rootContainerElement), listenToNativeEvent(domEventName, true, rootContainerElement));
|
|
});
|
|
var ownerDocument = 9 === rootContainerElement.nodeType ? rootContainerElement : rootContainerElement.ownerDocument;
|
|
null === ownerDocument || ownerDocument[listeningMarker] || (ownerDocument[listeningMarker] = true, listenToNativeEvent("selectionchange", false, ownerDocument));
|
|
}
|
|
}
|
|
function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener) {
|
|
switch (getEventPriority(domEventName)) {
|
|
case DiscreteEventPriority:
|
|
var listenerWrapper = dispatchDiscreteEvent;
|
|
break;
|
|
case ContinuousEventPriority:
|
|
listenerWrapper = dispatchContinuousEvent;
|
|
break;
|
|
default:
|
|
listenerWrapper = dispatchEvent;
|
|
}
|
|
eventSystemFlags = listenerWrapper.bind(
|
|
null,
|
|
domEventName,
|
|
eventSystemFlags,
|
|
targetContainer
|
|
);
|
|
listenerWrapper = void 0;
|
|
!passiveBrowserEventsSupported || "touchstart" !== domEventName && "touchmove" !== domEventName && "wheel" !== domEventName || (listenerWrapper = true);
|
|
isCapturePhaseListener ? void 0 !== listenerWrapper ? targetContainer.addEventListener(domEventName, eventSystemFlags, {
|
|
capture: true,
|
|
passive: listenerWrapper
|
|
}) : targetContainer.addEventListener(domEventName, eventSystemFlags, true) : void 0 !== listenerWrapper ? targetContainer.addEventListener(domEventName, eventSystemFlags, {
|
|
passive: listenerWrapper
|
|
}) : targetContainer.addEventListener(
|
|
domEventName,
|
|
eventSystemFlags,
|
|
false
|
|
);
|
|
}
|
|
function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst$jscomp$0, targetContainer) {
|
|
var ancestorInst = targetInst$jscomp$0;
|
|
if (0 === (eventSystemFlags & 1) && 0 === (eventSystemFlags & 2) && null !== targetInst$jscomp$0)
|
|
a: for (; ; ) {
|
|
if (null === targetInst$jscomp$0) return;
|
|
var nodeTag = targetInst$jscomp$0.tag;
|
|
if (3 === nodeTag || 4 === nodeTag) {
|
|
var container = targetInst$jscomp$0.stateNode.containerInfo;
|
|
if (container === targetContainer) break;
|
|
if (4 === nodeTag)
|
|
for (nodeTag = targetInst$jscomp$0.return; null !== nodeTag; ) {
|
|
var grandTag = nodeTag.tag;
|
|
if ((3 === grandTag || 4 === grandTag) && nodeTag.stateNode.containerInfo === targetContainer)
|
|
return;
|
|
nodeTag = nodeTag.return;
|
|
}
|
|
for (; null !== container; ) {
|
|
nodeTag = getClosestInstanceFromNode(container);
|
|
if (null === nodeTag) return;
|
|
grandTag = nodeTag.tag;
|
|
if (5 === grandTag || 6 === grandTag || 26 === grandTag || 27 === grandTag) {
|
|
targetInst$jscomp$0 = ancestorInst = nodeTag;
|
|
continue a;
|
|
}
|
|
container = container.parentNode;
|
|
}
|
|
}
|
|
targetInst$jscomp$0 = targetInst$jscomp$0.return;
|
|
}
|
|
batchedUpdates$1(function() {
|
|
var targetInst = ancestorInst, nativeEventTarget = getEventTarget(nativeEvent), dispatchQueue = [];
|
|
a: {
|
|
var reactName = topLevelEventsToReactNames.get(domEventName);
|
|
if (void 0 !== reactName) {
|
|
var SyntheticEventCtor = SyntheticEvent, reactEventType = domEventName;
|
|
switch (domEventName) {
|
|
case "keypress":
|
|
if (0 === getEventCharCode(nativeEvent)) break a;
|
|
case "keydown":
|
|
case "keyup":
|
|
SyntheticEventCtor = SyntheticKeyboardEvent;
|
|
break;
|
|
case "focusin":
|
|
reactEventType = "focus";
|
|
SyntheticEventCtor = SyntheticFocusEvent;
|
|
break;
|
|
case "focusout":
|
|
reactEventType = "blur";
|
|
SyntheticEventCtor = SyntheticFocusEvent;
|
|
break;
|
|
case "beforeblur":
|
|
case "afterblur":
|
|
SyntheticEventCtor = SyntheticFocusEvent;
|
|
break;
|
|
case "click":
|
|
if (2 === nativeEvent.button) break a;
|
|
case "auxclick":
|
|
case "dblclick":
|
|
case "mousedown":
|
|
case "mousemove":
|
|
case "mouseup":
|
|
case "mouseout":
|
|
case "mouseover":
|
|
case "contextmenu":
|
|
SyntheticEventCtor = SyntheticMouseEvent;
|
|
break;
|
|
case "drag":
|
|
case "dragend":
|
|
case "dragenter":
|
|
case "dragexit":
|
|
case "dragleave":
|
|
case "dragover":
|
|
case "dragstart":
|
|
case "drop":
|
|
SyntheticEventCtor = SyntheticDragEvent;
|
|
break;
|
|
case "touchcancel":
|
|
case "touchend":
|
|
case "touchmove":
|
|
case "touchstart":
|
|
SyntheticEventCtor = SyntheticTouchEvent;
|
|
break;
|
|
case ANIMATION_END:
|
|
case ANIMATION_ITERATION:
|
|
case ANIMATION_START:
|
|
SyntheticEventCtor = SyntheticAnimationEvent;
|
|
break;
|
|
case TRANSITION_END:
|
|
SyntheticEventCtor = SyntheticTransitionEvent;
|
|
break;
|
|
case "scroll":
|
|
case "scrollend":
|
|
SyntheticEventCtor = SyntheticUIEvent;
|
|
break;
|
|
case "wheel":
|
|
SyntheticEventCtor = SyntheticWheelEvent;
|
|
break;
|
|
case "copy":
|
|
case "cut":
|
|
case "paste":
|
|
SyntheticEventCtor = SyntheticClipboardEvent;
|
|
break;
|
|
case "gotpointercapture":
|
|
case "lostpointercapture":
|
|
case "pointercancel":
|
|
case "pointerdown":
|
|
case "pointermove":
|
|
case "pointerout":
|
|
case "pointerover":
|
|
case "pointerup":
|
|
SyntheticEventCtor = SyntheticPointerEvent;
|
|
break;
|
|
case "toggle":
|
|
case "beforetoggle":
|
|
SyntheticEventCtor = SyntheticToggleEvent;
|
|
}
|
|
var inCapturePhase = 0 !== (eventSystemFlags & 4), accumulateTargetOnly = !inCapturePhase && ("scroll" === domEventName || "scrollend" === domEventName), reactEventName = inCapturePhase ? null !== reactName ? reactName + "Capture" : null : reactName;
|
|
inCapturePhase = [];
|
|
for (var instance = targetInst, lastHostComponent; null !== instance; ) {
|
|
var _instance2 = instance;
|
|
lastHostComponent = _instance2.stateNode;
|
|
_instance2 = _instance2.tag;
|
|
5 !== _instance2 && 26 !== _instance2 && 27 !== _instance2 || null === lastHostComponent || null === reactEventName || (_instance2 = getListener(instance, reactEventName), null != _instance2 && inCapturePhase.push(
|
|
createDispatchListener(
|
|
instance,
|
|
_instance2,
|
|
lastHostComponent
|
|
)
|
|
));
|
|
if (accumulateTargetOnly) break;
|
|
instance = instance.return;
|
|
}
|
|
0 < inCapturePhase.length && (reactName = new SyntheticEventCtor(
|
|
reactName,
|
|
reactEventType,
|
|
null,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
), dispatchQueue.push({
|
|
event: reactName,
|
|
listeners: inCapturePhase
|
|
}));
|
|
}
|
|
}
|
|
if (0 === (eventSystemFlags & 7)) {
|
|
a: {
|
|
reactName = "mouseover" === domEventName || "pointerover" === domEventName;
|
|
SyntheticEventCtor = "mouseout" === domEventName || "pointerout" === domEventName;
|
|
if (reactName && nativeEvent !== currentReplayingEvent && (reactEventType = nativeEvent.relatedTarget || nativeEvent.fromElement) && (getClosestInstanceFromNode(reactEventType) || reactEventType[internalContainerInstanceKey]))
|
|
break a;
|
|
if (SyntheticEventCtor || reactName) {
|
|
reactName = nativeEventTarget.window === nativeEventTarget ? nativeEventTarget : (reactName = nativeEventTarget.ownerDocument) ? reactName.defaultView || reactName.parentWindow : window;
|
|
if (SyntheticEventCtor) {
|
|
if (reactEventType = nativeEvent.relatedTarget || nativeEvent.toElement, SyntheticEventCtor = targetInst, reactEventType = reactEventType ? getClosestInstanceFromNode(reactEventType) : null, null !== reactEventType && (accumulateTargetOnly = getNearestMountedFiber(reactEventType), inCapturePhase = reactEventType.tag, reactEventType !== accumulateTargetOnly || 5 !== inCapturePhase && 27 !== inCapturePhase && 6 !== inCapturePhase))
|
|
reactEventType = null;
|
|
} else SyntheticEventCtor = null, reactEventType = targetInst;
|
|
if (SyntheticEventCtor !== reactEventType) {
|
|
inCapturePhase = SyntheticMouseEvent;
|
|
_instance2 = "onMouseLeave";
|
|
reactEventName = "onMouseEnter";
|
|
instance = "mouse";
|
|
if ("pointerout" === domEventName || "pointerover" === domEventName)
|
|
inCapturePhase = SyntheticPointerEvent, _instance2 = "onPointerLeave", reactEventName = "onPointerEnter", instance = "pointer";
|
|
accumulateTargetOnly = null == SyntheticEventCtor ? reactName : getNodeFromInstance(SyntheticEventCtor);
|
|
lastHostComponent = null == reactEventType ? reactName : getNodeFromInstance(reactEventType);
|
|
reactName = new inCapturePhase(
|
|
_instance2,
|
|
instance + "leave",
|
|
SyntheticEventCtor,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
);
|
|
reactName.target = accumulateTargetOnly;
|
|
reactName.relatedTarget = lastHostComponent;
|
|
_instance2 = null;
|
|
getClosestInstanceFromNode(nativeEventTarget) === targetInst && (inCapturePhase = new inCapturePhase(
|
|
reactEventName,
|
|
instance + "enter",
|
|
reactEventType,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
), inCapturePhase.target = lastHostComponent, inCapturePhase.relatedTarget = accumulateTargetOnly, _instance2 = inCapturePhase);
|
|
accumulateTargetOnly = _instance2;
|
|
if (SyntheticEventCtor && reactEventType)
|
|
b: {
|
|
inCapturePhase = getParent;
|
|
reactEventName = SyntheticEventCtor;
|
|
instance = reactEventType;
|
|
lastHostComponent = 0;
|
|
for (_instance2 = reactEventName; _instance2; _instance2 = inCapturePhase(_instance2))
|
|
lastHostComponent++;
|
|
_instance2 = 0;
|
|
for (var tempB = instance; tempB; tempB = inCapturePhase(tempB))
|
|
_instance2++;
|
|
for (; 0 < lastHostComponent - _instance2; )
|
|
reactEventName = inCapturePhase(reactEventName), lastHostComponent--;
|
|
for (; 0 < _instance2 - lastHostComponent; )
|
|
instance = inCapturePhase(instance), _instance2--;
|
|
for (; lastHostComponent--; ) {
|
|
if (reactEventName === instance || null !== instance && reactEventName === instance.alternate) {
|
|
inCapturePhase = reactEventName;
|
|
break b;
|
|
}
|
|
reactEventName = inCapturePhase(reactEventName);
|
|
instance = inCapturePhase(instance);
|
|
}
|
|
inCapturePhase = null;
|
|
}
|
|
else inCapturePhase = null;
|
|
null !== SyntheticEventCtor && accumulateEnterLeaveListenersForEvent(
|
|
dispatchQueue,
|
|
reactName,
|
|
SyntheticEventCtor,
|
|
inCapturePhase,
|
|
false
|
|
);
|
|
null !== reactEventType && null !== accumulateTargetOnly && accumulateEnterLeaveListenersForEvent(
|
|
dispatchQueue,
|
|
accumulateTargetOnly,
|
|
reactEventType,
|
|
inCapturePhase,
|
|
true
|
|
);
|
|
}
|
|
}
|
|
}
|
|
a: {
|
|
reactName = targetInst ? getNodeFromInstance(targetInst) : window;
|
|
SyntheticEventCtor = reactName.nodeName && reactName.nodeName.toLowerCase();
|
|
if ("select" === SyntheticEventCtor || "input" === SyntheticEventCtor && "file" === reactName.type)
|
|
var getTargetInstFunc = getTargetInstForChangeEvent;
|
|
else if (isTextInputElement(reactName))
|
|
if (isInputEventSupported)
|
|
getTargetInstFunc = getTargetInstForInputOrChangeEvent;
|
|
else {
|
|
getTargetInstFunc = getTargetInstForInputEventPolyfill;
|
|
var handleEventFunc = handleEventsForInputEventPolyfill;
|
|
}
|
|
else
|
|
SyntheticEventCtor = reactName.nodeName, !SyntheticEventCtor || "input" !== SyntheticEventCtor.toLowerCase() || "checkbox" !== reactName.type && "radio" !== reactName.type ? targetInst && isCustomElement(targetInst.elementType) && (getTargetInstFunc = getTargetInstForChangeEvent) : getTargetInstFunc = getTargetInstForClickEvent;
|
|
if (getTargetInstFunc && (getTargetInstFunc = getTargetInstFunc(domEventName, targetInst))) {
|
|
createAndAccumulateChangeEvent(
|
|
dispatchQueue,
|
|
getTargetInstFunc,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
);
|
|
break a;
|
|
}
|
|
handleEventFunc && handleEventFunc(domEventName, reactName, targetInst);
|
|
"focusout" === domEventName && targetInst && "number" === reactName.type && null != targetInst.memoizedProps.value && setDefaultValue(reactName, "number", reactName.value);
|
|
}
|
|
handleEventFunc = targetInst ? getNodeFromInstance(targetInst) : window;
|
|
switch (domEventName) {
|
|
case "focusin":
|
|
if (isTextInputElement(handleEventFunc) || "true" === handleEventFunc.contentEditable)
|
|
activeElement = handleEventFunc, activeElementInst = targetInst, lastSelection = null;
|
|
break;
|
|
case "focusout":
|
|
lastSelection = activeElementInst = activeElement = null;
|
|
break;
|
|
case "mousedown":
|
|
mouseDown = true;
|
|
break;
|
|
case "contextmenu":
|
|
case "mouseup":
|
|
case "dragend":
|
|
mouseDown = false;
|
|
constructSelectEvent(
|
|
dispatchQueue,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
);
|
|
break;
|
|
case "selectionchange":
|
|
if (skipSelectionChangeEvent) break;
|
|
case "keydown":
|
|
case "keyup":
|
|
constructSelectEvent(
|
|
dispatchQueue,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
);
|
|
}
|
|
var fallbackData;
|
|
if (canUseCompositionEvent)
|
|
b: {
|
|
switch (domEventName) {
|
|
case "compositionstart":
|
|
var eventType = "onCompositionStart";
|
|
break b;
|
|
case "compositionend":
|
|
eventType = "onCompositionEnd";
|
|
break b;
|
|
case "compositionupdate":
|
|
eventType = "onCompositionUpdate";
|
|
break b;
|
|
}
|
|
eventType = void 0;
|
|
}
|
|
else
|
|
isComposing ? isFallbackCompositionEnd(domEventName, nativeEvent) && (eventType = "onCompositionEnd") : "keydown" === domEventName && nativeEvent.keyCode === START_KEYCODE && (eventType = "onCompositionStart");
|
|
eventType && (useFallbackCompositionData && "ko" !== nativeEvent.locale && (isComposing || "onCompositionStart" !== eventType ? "onCompositionEnd" === eventType && isComposing && (fallbackData = getData()) : (root = nativeEventTarget, startText = "value" in root ? root.value : root.textContent, isComposing = true)), handleEventFunc = accumulateTwoPhaseListeners(
|
|
targetInst,
|
|
eventType
|
|
), 0 < handleEventFunc.length && (eventType = new SyntheticCompositionEvent(
|
|
eventType,
|
|
domEventName,
|
|
null,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
), dispatchQueue.push({
|
|
event: eventType,
|
|
listeners: handleEventFunc
|
|
}), fallbackData ? eventType.data = fallbackData : (fallbackData = getDataFromCustomEvent(nativeEvent), null !== fallbackData && (eventType.data = fallbackData))));
|
|
if (fallbackData = canUseTextInputEvent ? getNativeBeforeInputChars(domEventName, nativeEvent) : getFallbackBeforeInputChars(domEventName, nativeEvent))
|
|
eventType = accumulateTwoPhaseListeners(
|
|
targetInst,
|
|
"onBeforeInput"
|
|
), 0 < eventType.length && (handleEventFunc = new SyntheticInputEvent(
|
|
"onBeforeInput",
|
|
"beforeinput",
|
|
null,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
), dispatchQueue.push({
|
|
event: handleEventFunc,
|
|
listeners: eventType
|
|
}), handleEventFunc.data = fallbackData);
|
|
extractEvents$1(
|
|
dispatchQueue,
|
|
domEventName,
|
|
targetInst,
|
|
nativeEvent,
|
|
nativeEventTarget
|
|
);
|
|
}
|
|
processDispatchQueue(dispatchQueue, eventSystemFlags);
|
|
});
|
|
}
|
|
function createDispatchListener(instance, listener, currentTarget) {
|
|
return {
|
|
instance,
|
|
listener,
|
|
currentTarget
|
|
};
|
|
}
|
|
function accumulateTwoPhaseListeners(targetFiber, reactName) {
|
|
for (var captureName = reactName + "Capture", listeners = []; null !== targetFiber; ) {
|
|
var _instance3 = targetFiber, stateNode = _instance3.stateNode;
|
|
_instance3 = _instance3.tag;
|
|
5 !== _instance3 && 26 !== _instance3 && 27 !== _instance3 || null === stateNode || (_instance3 = getListener(targetFiber, captureName), null != _instance3 && listeners.unshift(
|
|
createDispatchListener(targetFiber, _instance3, stateNode)
|
|
), _instance3 = getListener(targetFiber, reactName), null != _instance3 && listeners.push(
|
|
createDispatchListener(targetFiber, _instance3, stateNode)
|
|
));
|
|
if (3 === targetFiber.tag) return listeners;
|
|
targetFiber = targetFiber.return;
|
|
}
|
|
return [];
|
|
}
|
|
function getParent(inst) {
|
|
if (null === inst) return null;
|
|
do
|
|
inst = inst.return;
|
|
while (inst && 5 !== inst.tag && 27 !== inst.tag);
|
|
return inst ? inst : null;
|
|
}
|
|
function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common2, inCapturePhase) {
|
|
for (var registrationName = event._reactName, listeners = []; null !== target && target !== common2; ) {
|
|
var _instance4 = target, alternate = _instance4.alternate, stateNode = _instance4.stateNode;
|
|
_instance4 = _instance4.tag;
|
|
if (null !== alternate && alternate === common2) break;
|
|
5 !== _instance4 && 26 !== _instance4 && 27 !== _instance4 || null === stateNode || (alternate = stateNode, inCapturePhase ? (stateNode = getListener(target, registrationName), null != stateNode && listeners.unshift(
|
|
createDispatchListener(target, stateNode, alternate)
|
|
)) : inCapturePhase || (stateNode = getListener(target, registrationName), null != stateNode && listeners.push(
|
|
createDispatchListener(target, stateNode, alternate)
|
|
)));
|
|
target = target.return;
|
|
}
|
|
0 !== listeners.length && dispatchQueue.push({ event, listeners });
|
|
}
|
|
function validatePropertiesInDevelopment(type, props) {
|
|
validateProperties$2(type, props);
|
|
"input" !== type && "textarea" !== type && "select" !== type || null == props || null !== props.value || didWarnValueNull || (didWarnValueNull = true, "select" === type && props.multiple ? console.error(
|
|
"`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",
|
|
type
|
|
) : console.error(
|
|
"`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",
|
|
type
|
|
));
|
|
var eventRegistry = {
|
|
registrationNameDependencies,
|
|
possibleRegistrationNames
|
|
};
|
|
isCustomElement(type) || "string" === typeof props.is || warnUnknownProperties(type, props, eventRegistry);
|
|
props.contentEditable && !props.suppressContentEditableWarning && null != props.children && console.error(
|
|
"A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."
|
|
);
|
|
}
|
|
function warnForPropDifference(propName, serverValue, clientValue, serverDifferences) {
|
|
serverValue !== clientValue && (clientValue = normalizeMarkupForTextOrAttribute(clientValue), normalizeMarkupForTextOrAttribute(serverValue) !== clientValue && (serverDifferences[propName] = serverValue));
|
|
}
|
|
function warnForExtraAttributes(domElement, attributeNames, serverDifferences) {
|
|
attributeNames.forEach(function(attributeName) {
|
|
serverDifferences[getPropNameFromAttributeName(attributeName)] = "style" === attributeName ? getStylesObjectFromElement(domElement) : domElement.getAttribute(attributeName);
|
|
});
|
|
}
|
|
function warnForInvalidEventListener(registrationName, listener) {
|
|
false === listener ? console.error(
|
|
"Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",
|
|
registrationName,
|
|
registrationName,
|
|
registrationName
|
|
) : console.error(
|
|
"Expected `%s` listener to be a function, instead got a value of `%s` type.",
|
|
registrationName,
|
|
typeof listener
|
|
);
|
|
}
|
|
function normalizeHTML(parent, html) {
|
|
parent = parent.namespaceURI === MATH_NAMESPACE || parent.namespaceURI === SVG_NAMESPACE ? parent.ownerDocument.createElementNS(
|
|
parent.namespaceURI,
|
|
parent.tagName
|
|
) : parent.ownerDocument.createElement(parent.tagName);
|
|
parent.innerHTML = html;
|
|
return parent.innerHTML;
|
|
}
|
|
function normalizeMarkupForTextOrAttribute(markup) {
|
|
willCoercionThrow(markup) && (console.error(
|
|
"The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before using it here.",
|
|
typeName(markup)
|
|
), testStringCoercion(markup));
|
|
return ("string" === typeof markup ? markup : "" + markup).replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
|
|
}
|
|
function checkForUnmatchedText(serverText, clientText) {
|
|
clientText = normalizeMarkupForTextOrAttribute(clientText);
|
|
return normalizeMarkupForTextOrAttribute(serverText) === clientText ? true : false;
|
|
}
|
|
function setProp(domElement, tag, key, value, props, prevValue) {
|
|
switch (key) {
|
|
case "children":
|
|
if ("string" === typeof value)
|
|
validateTextNesting(value, tag, false), "body" === tag || "textarea" === tag && "" === value || setTextContent(domElement, value);
|
|
else if ("number" === typeof value || "bigint" === typeof value)
|
|
validateTextNesting("" + value, tag, false), "body" !== tag && setTextContent(domElement, "" + value);
|
|
break;
|
|
case "className":
|
|
setValueForKnownAttribute(domElement, "class", value);
|
|
break;
|
|
case "tabIndex":
|
|
setValueForKnownAttribute(domElement, "tabindex", value);
|
|
break;
|
|
case "dir":
|
|
case "role":
|
|
case "viewBox":
|
|
case "width":
|
|
case "height":
|
|
setValueForKnownAttribute(domElement, key, value);
|
|
break;
|
|
case "style":
|
|
setValueForStyles(domElement, value, prevValue);
|
|
break;
|
|
case "data":
|
|
if ("object" !== tag) {
|
|
setValueForKnownAttribute(domElement, "data", value);
|
|
break;
|
|
}
|
|
case "src":
|
|
case "href":
|
|
if ("" === value && ("a" !== tag || "href" !== key)) {
|
|
"src" === key ? console.error(
|
|
'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
|
|
key,
|
|
key
|
|
) : console.error(
|
|
'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
|
|
key,
|
|
key
|
|
);
|
|
domElement.removeAttribute(key);
|
|
break;
|
|
}
|
|
if (null == value || "function" === typeof value || "symbol" === typeof value || "boolean" === typeof value) {
|
|
domElement.removeAttribute(key);
|
|
break;
|
|
}
|
|
checkAttributeStringCoercion(value, key);
|
|
value = sanitizeURL("" + value);
|
|
domElement.setAttribute(key, value);
|
|
break;
|
|
case "action":
|
|
case "formAction":
|
|
null != value && ("form" === tag ? "formAction" === key ? console.error(
|
|
"You can only pass the formAction prop to <input> or <button>. Use the action prop on <form>."
|
|
) : "function" === typeof value && (null == props.encType && null == props.method || didWarnFormActionMethod || (didWarnFormActionMethod = true, console.error(
|
|
"Cannot specify a encType or method for a form that specifies a function as the action. React provides those automatically. They will get overridden."
|
|
)), null == props.target || didWarnFormActionTarget || (didWarnFormActionTarget = true, console.error(
|
|
"Cannot specify a target for a form that specifies a function as the action. The function will always be executed in the same window."
|
|
))) : "input" === tag || "button" === tag ? "action" === key ? console.error(
|
|
"You can only pass the action prop to <form>. Use the formAction prop on <input> or <button>."
|
|
) : "input" !== tag || "submit" === props.type || "image" === props.type || didWarnFormActionType ? "button" !== tag || null == props.type || "submit" === props.type || didWarnFormActionType ? "function" === typeof value && (null == props.name || didWarnFormActionName || (didWarnFormActionName = true, console.error(
|
|
'Cannot specify a "name" prop for a button that specifies a function as a formAction. React needs it to encode which action should be invoked. It will get overridden.'
|
|
)), null == props.formEncType && null == props.formMethod || didWarnFormActionMethod || (didWarnFormActionMethod = true, console.error(
|
|
"Cannot specify a formEncType or formMethod for a button that specifies a function as a formAction. React provides those automatically. They will get overridden."
|
|
)), null == props.formTarget || didWarnFormActionTarget || (didWarnFormActionTarget = true, console.error(
|
|
"Cannot specify a formTarget for a button that specifies a function as a formAction. The function will always be executed in the same window."
|
|
))) : (didWarnFormActionType = true, console.error(
|
|
'A button can only specify a formAction along with type="submit" or no type.'
|
|
)) : (didWarnFormActionType = true, console.error(
|
|
'An input can only specify a formAction along with type="submit" or type="image".'
|
|
)) : "action" === key ? console.error(
|
|
"You can only pass the action prop to <form>."
|
|
) : console.error(
|
|
"You can only pass the formAction prop to <input> or <button>."
|
|
));
|
|
if ("function" === typeof value) {
|
|
domElement.setAttribute(
|
|
key,
|
|
"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')"
|
|
);
|
|
break;
|
|
} else
|
|
"function" === typeof prevValue && ("formAction" === key ? ("input" !== tag && setProp(domElement, tag, "name", props.name, props, null), setProp(
|
|
domElement,
|
|
tag,
|
|
"formEncType",
|
|
props.formEncType,
|
|
props,
|
|
null
|
|
), setProp(
|
|
domElement,
|
|
tag,
|
|
"formMethod",
|
|
props.formMethod,
|
|
props,
|
|
null
|
|
), setProp(
|
|
domElement,
|
|
tag,
|
|
"formTarget",
|
|
props.formTarget,
|
|
props,
|
|
null
|
|
)) : (setProp(
|
|
domElement,
|
|
tag,
|
|
"encType",
|
|
props.encType,
|
|
props,
|
|
null
|
|
), setProp(domElement, tag, "method", props.method, props, null), setProp(
|
|
domElement,
|
|
tag,
|
|
"target",
|
|
props.target,
|
|
props,
|
|
null
|
|
)));
|
|
if (null == value || "symbol" === typeof value || "boolean" === typeof value) {
|
|
domElement.removeAttribute(key);
|
|
break;
|
|
}
|
|
checkAttributeStringCoercion(value, key);
|
|
value = sanitizeURL("" + value);
|
|
domElement.setAttribute(key, value);
|
|
break;
|
|
case "onClick":
|
|
null != value && ("function" !== typeof value && warnForInvalidEventListener(key, value), domElement.onclick = noop$1);
|
|
break;
|
|
case "onScroll":
|
|
null != value && ("function" !== typeof value && warnForInvalidEventListener(key, value), listenToNonDelegatedEvent("scroll", domElement));
|
|
break;
|
|
case "onScrollEnd":
|
|
null != value && ("function" !== typeof value && warnForInvalidEventListener(key, value), listenToNonDelegatedEvent("scrollend", domElement));
|
|
break;
|
|
case "dangerouslySetInnerHTML":
|
|
if (null != value) {
|
|
if ("object" !== typeof value || !("__html" in value))
|
|
throw Error(
|
|
"`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information."
|
|
);
|
|
key = value.__html;
|
|
if (null != key) {
|
|
if (null != props.children)
|
|
throw Error(
|
|
"Can only set one of `children` or `props.dangerouslySetInnerHTML`."
|
|
);
|
|
domElement.innerHTML = key;
|
|
}
|
|
}
|
|
break;
|
|
case "multiple":
|
|
domElement.multiple = value && "function" !== typeof value && "symbol" !== typeof value;
|
|
break;
|
|
case "muted":
|
|
domElement.muted = value && "function" !== typeof value && "symbol" !== typeof value;
|
|
break;
|
|
case "suppressContentEditableWarning":
|
|
case "suppressHydrationWarning":
|
|
case "defaultValue":
|
|
case "defaultChecked":
|
|
case "innerHTML":
|
|
case "ref":
|
|
break;
|
|
case "autoFocus":
|
|
break;
|
|
case "xlinkHref":
|
|
if (null == value || "function" === typeof value || "boolean" === typeof value || "symbol" === typeof value) {
|
|
domElement.removeAttribute("xlink:href");
|
|
break;
|
|
}
|
|
checkAttributeStringCoercion(value, key);
|
|
key = sanitizeURL("" + value);
|
|
domElement.setAttributeNS(xlinkNamespace, "xlink:href", key);
|
|
break;
|
|
case "contentEditable":
|
|
case "spellCheck":
|
|
case "draggable":
|
|
case "value":
|
|
case "autoReverse":
|
|
case "externalResourcesRequired":
|
|
case "focusable":
|
|
case "preserveAlpha":
|
|
null != value && "function" !== typeof value && "symbol" !== typeof value ? (checkAttributeStringCoercion(value, key), domElement.setAttribute(key, "" + value)) : domElement.removeAttribute(key);
|
|
break;
|
|
case "inert":
|
|
"" !== value || didWarnForNewBooleanPropsWithEmptyValue[key] || (didWarnForNewBooleanPropsWithEmptyValue[key] = true, console.error(
|
|
"Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
|
|
key
|
|
));
|
|
case "allowFullScreen":
|
|
case "async":
|
|
case "autoPlay":
|
|
case "controls":
|
|
case "default":
|
|
case "defer":
|
|
case "disabled":
|
|
case "disablePictureInPicture":
|
|
case "disableRemotePlayback":
|
|
case "formNoValidate":
|
|
case "hidden":
|
|
case "loop":
|
|
case "noModule":
|
|
case "noValidate":
|
|
case "open":
|
|
case "playsInline":
|
|
case "readOnly":
|
|
case "required":
|
|
case "reversed":
|
|
case "scoped":
|
|
case "seamless":
|
|
case "itemScope":
|
|
value && "function" !== typeof value && "symbol" !== typeof value ? domElement.setAttribute(key, "") : domElement.removeAttribute(key);
|
|
break;
|
|
case "capture":
|
|
case "download":
|
|
true === value ? domElement.setAttribute(key, "") : false !== value && null != value && "function" !== typeof value && "symbol" !== typeof value ? (checkAttributeStringCoercion(value, key), domElement.setAttribute(key, value)) : domElement.removeAttribute(key);
|
|
break;
|
|
case "cols":
|
|
case "rows":
|
|
case "size":
|
|
case "span":
|
|
null != value && "function" !== typeof value && "symbol" !== typeof value && !isNaN(value) && 1 <= value ? (checkAttributeStringCoercion(value, key), domElement.setAttribute(key, value)) : domElement.removeAttribute(key);
|
|
break;
|
|
case "rowSpan":
|
|
case "start":
|
|
null == value || "function" === typeof value || "symbol" === typeof value || isNaN(value) ? domElement.removeAttribute(key) : (checkAttributeStringCoercion(value, key), domElement.setAttribute(key, value));
|
|
break;
|
|
case "popover":
|
|
listenToNonDelegatedEvent("beforetoggle", domElement);
|
|
listenToNonDelegatedEvent("toggle", domElement);
|
|
setValueForAttribute(domElement, "popover", value);
|
|
break;
|
|
case "xlinkActuate":
|
|
setValueForNamespacedAttribute(
|
|
domElement,
|
|
xlinkNamespace,
|
|
"xlink:actuate",
|
|
value
|
|
);
|
|
break;
|
|
case "xlinkArcrole":
|
|
setValueForNamespacedAttribute(
|
|
domElement,
|
|
xlinkNamespace,
|
|
"xlink:arcrole",
|
|
value
|
|
);
|
|
break;
|
|
case "xlinkRole":
|
|
setValueForNamespacedAttribute(
|
|
domElement,
|
|
xlinkNamespace,
|
|
"xlink:role",
|
|
value
|
|
);
|
|
break;
|
|
case "xlinkShow":
|
|
setValueForNamespacedAttribute(
|
|
domElement,
|
|
xlinkNamespace,
|
|
"xlink:show",
|
|
value
|
|
);
|
|
break;
|
|
case "xlinkTitle":
|
|
setValueForNamespacedAttribute(
|
|
domElement,
|
|
xlinkNamespace,
|
|
"xlink:title",
|
|
value
|
|
);
|
|
break;
|
|
case "xlinkType":
|
|
setValueForNamespacedAttribute(
|
|
domElement,
|
|
xlinkNamespace,
|
|
"xlink:type",
|
|
value
|
|
);
|
|
break;
|
|
case "xmlBase":
|
|
setValueForNamespacedAttribute(
|
|
domElement,
|
|
xmlNamespace,
|
|
"xml:base",
|
|
value
|
|
);
|
|
break;
|
|
case "xmlLang":
|
|
setValueForNamespacedAttribute(
|
|
domElement,
|
|
xmlNamespace,
|
|
"xml:lang",
|
|
value
|
|
);
|
|
break;
|
|
case "xmlSpace":
|
|
setValueForNamespacedAttribute(
|
|
domElement,
|
|
xmlNamespace,
|
|
"xml:space",
|
|
value
|
|
);
|
|
break;
|
|
case "is":
|
|
null != prevValue && console.error(
|
|
'Cannot update the "is" prop after it has been initialized.'
|
|
);
|
|
setValueForAttribute(domElement, "is", value);
|
|
break;
|
|
case "innerText":
|
|
case "textContent":
|
|
break;
|
|
case "popoverTarget":
|
|
didWarnPopoverTargetObject || null == value || "object" !== typeof value || (didWarnPopoverTargetObject = true, console.error(
|
|
"The `popoverTarget` prop expects the ID of an Element as a string. Received %s instead.",
|
|
value
|
|
));
|
|
default:
|
|
!(2 < key.length) || "o" !== key[0] && "O" !== key[0] || "n" !== key[1] && "N" !== key[1] ? (key = getAttributeAlias(key), setValueForAttribute(domElement, key, value)) : registrationNameDependencies.hasOwnProperty(key) && null != value && "function" !== typeof value && warnForInvalidEventListener(key, value);
|
|
}
|
|
}
|
|
function setPropOnCustomElement(domElement, tag, key, value, props, prevValue) {
|
|
switch (key) {
|
|
case "style":
|
|
setValueForStyles(domElement, value, prevValue);
|
|
break;
|
|
case "dangerouslySetInnerHTML":
|
|
if (null != value) {
|
|
if ("object" !== typeof value || !("__html" in value))
|
|
throw Error(
|
|
"`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information."
|
|
);
|
|
key = value.__html;
|
|
if (null != key) {
|
|
if (null != props.children)
|
|
throw Error(
|
|
"Can only set one of `children` or `props.dangerouslySetInnerHTML`."
|
|
);
|
|
domElement.innerHTML = key;
|
|
}
|
|
}
|
|
break;
|
|
case "children":
|
|
"string" === typeof value ? setTextContent(domElement, value) : ("number" === typeof value || "bigint" === typeof value) && setTextContent(domElement, "" + value);
|
|
break;
|
|
case "onScroll":
|
|
null != value && ("function" !== typeof value && warnForInvalidEventListener(key, value), listenToNonDelegatedEvent("scroll", domElement));
|
|
break;
|
|
case "onScrollEnd":
|
|
null != value && ("function" !== typeof value && warnForInvalidEventListener(key, value), listenToNonDelegatedEvent("scrollend", domElement));
|
|
break;
|
|
case "onClick":
|
|
null != value && ("function" !== typeof value && warnForInvalidEventListener(key, value), domElement.onclick = noop$1);
|
|
break;
|
|
case "suppressContentEditableWarning":
|
|
case "suppressHydrationWarning":
|
|
case "innerHTML":
|
|
case "ref":
|
|
break;
|
|
case "innerText":
|
|
case "textContent":
|
|
break;
|
|
default:
|
|
if (registrationNameDependencies.hasOwnProperty(key))
|
|
null != value && "function" !== typeof value && warnForInvalidEventListener(key, value);
|
|
else
|
|
a: {
|
|
if ("o" === key[0] && "n" === key[1] && (props = key.endsWith("Capture"), tag = key.slice(2, props ? key.length - 7 : void 0), prevValue = domElement[internalPropsKey] || null, prevValue = null != prevValue ? prevValue[key] : null, "function" === typeof prevValue && domElement.removeEventListener(tag, prevValue, props), "function" === typeof value)) {
|
|
"function" !== typeof prevValue && null !== prevValue && (key in domElement ? domElement[key] = null : domElement.hasAttribute(key) && domElement.removeAttribute(key));
|
|
domElement.addEventListener(tag, value, props);
|
|
break a;
|
|
}
|
|
key in domElement ? domElement[key] = value : true === value ? domElement.setAttribute(key, "") : setValueForAttribute(domElement, key, value);
|
|
}
|
|
}
|
|
}
|
|
function setInitialProperties(domElement, tag, props) {
|
|
validatePropertiesInDevelopment(tag, props);
|
|
switch (tag) {
|
|
case "div":
|
|
case "span":
|
|
case "svg":
|
|
case "path":
|
|
case "a":
|
|
case "g":
|
|
case "p":
|
|
case "li":
|
|
break;
|
|
case "img":
|
|
listenToNonDelegatedEvent("error", domElement);
|
|
listenToNonDelegatedEvent("load", domElement);
|
|
var hasSrc = false, hasSrcSet = false, propKey;
|
|
for (propKey in props)
|
|
if (props.hasOwnProperty(propKey)) {
|
|
var propValue = props[propKey];
|
|
if (null != propValue)
|
|
switch (propKey) {
|
|
case "src":
|
|
hasSrc = true;
|
|
break;
|
|
case "srcSet":
|
|
hasSrcSet = true;
|
|
break;
|
|
case "children":
|
|
case "dangerouslySetInnerHTML":
|
|
throw Error(
|
|
tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
|
|
);
|
|
default:
|
|
setProp(domElement, tag, propKey, propValue, props, null);
|
|
}
|
|
}
|
|
hasSrcSet && setProp(domElement, tag, "srcSet", props.srcSet, props, null);
|
|
hasSrc && setProp(domElement, tag, "src", props.src, props, null);
|
|
return;
|
|
case "input":
|
|
checkControlledValueProps("input", props);
|
|
listenToNonDelegatedEvent("invalid", domElement);
|
|
var defaultValue = propKey = propValue = hasSrcSet = null, checked = null, defaultChecked = null;
|
|
for (hasSrc in props)
|
|
if (props.hasOwnProperty(hasSrc)) {
|
|
var _propValue = props[hasSrc];
|
|
if (null != _propValue)
|
|
switch (hasSrc) {
|
|
case "name":
|
|
hasSrcSet = _propValue;
|
|
break;
|
|
case "type":
|
|
propValue = _propValue;
|
|
break;
|
|
case "checked":
|
|
checked = _propValue;
|
|
break;
|
|
case "defaultChecked":
|
|
defaultChecked = _propValue;
|
|
break;
|
|
case "value":
|
|
propKey = _propValue;
|
|
break;
|
|
case "defaultValue":
|
|
defaultValue = _propValue;
|
|
break;
|
|
case "children":
|
|
case "dangerouslySetInnerHTML":
|
|
if (null != _propValue)
|
|
throw Error(
|
|
tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
|
|
);
|
|
break;
|
|
default:
|
|
setProp(domElement, tag, hasSrc, _propValue, props, null);
|
|
}
|
|
}
|
|
validateInputProps(domElement, props);
|
|
initInput(
|
|
domElement,
|
|
propKey,
|
|
defaultValue,
|
|
checked,
|
|
defaultChecked,
|
|
propValue,
|
|
hasSrcSet,
|
|
false
|
|
);
|
|
return;
|
|
case "select":
|
|
checkControlledValueProps("select", props);
|
|
listenToNonDelegatedEvent("invalid", domElement);
|
|
hasSrc = propValue = propKey = null;
|
|
for (hasSrcSet in props)
|
|
if (props.hasOwnProperty(hasSrcSet) && (defaultValue = props[hasSrcSet], null != defaultValue))
|
|
switch (hasSrcSet) {
|
|
case "value":
|
|
propKey = defaultValue;
|
|
break;
|
|
case "defaultValue":
|
|
propValue = defaultValue;
|
|
break;
|
|
case "multiple":
|
|
hasSrc = defaultValue;
|
|
default:
|
|
setProp(
|
|
domElement,
|
|
tag,
|
|
hasSrcSet,
|
|
defaultValue,
|
|
props,
|
|
null
|
|
);
|
|
}
|
|
validateSelectProps(domElement, props);
|
|
tag = propKey;
|
|
props = propValue;
|
|
domElement.multiple = !!hasSrc;
|
|
null != tag ? updateOptions(domElement, !!hasSrc, tag, false) : null != props && updateOptions(domElement, !!hasSrc, props, true);
|
|
return;
|
|
case "textarea":
|
|
checkControlledValueProps("textarea", props);
|
|
listenToNonDelegatedEvent("invalid", domElement);
|
|
propKey = hasSrcSet = hasSrc = null;
|
|
for (propValue in props)
|
|
if (props.hasOwnProperty(propValue) && (defaultValue = props[propValue], null != defaultValue))
|
|
switch (propValue) {
|
|
case "value":
|
|
hasSrc = defaultValue;
|
|
break;
|
|
case "defaultValue":
|
|
hasSrcSet = defaultValue;
|
|
break;
|
|
case "children":
|
|
propKey = defaultValue;
|
|
break;
|
|
case "dangerouslySetInnerHTML":
|
|
if (null != defaultValue)
|
|
throw Error(
|
|
"`dangerouslySetInnerHTML` does not make sense on <textarea>."
|
|
);
|
|
break;
|
|
default:
|
|
setProp(
|
|
domElement,
|
|
tag,
|
|
propValue,
|
|
defaultValue,
|
|
props,
|
|
null
|
|
);
|
|
}
|
|
validateTextareaProps(domElement, props);
|
|
initTextarea(domElement, hasSrc, hasSrcSet, propKey);
|
|
return;
|
|
case "option":
|
|
validateOptionProps(domElement, props);
|
|
for (checked in props)
|
|
if (props.hasOwnProperty(checked) && (hasSrc = props[checked], null != hasSrc))
|
|
switch (checked) {
|
|
case "selected":
|
|
domElement.selected = hasSrc && "function" !== typeof hasSrc && "symbol" !== typeof hasSrc;
|
|
break;
|
|
default:
|
|
setProp(domElement, tag, checked, hasSrc, props, null);
|
|
}
|
|
return;
|
|
case "dialog":
|
|
listenToNonDelegatedEvent("beforetoggle", domElement);
|
|
listenToNonDelegatedEvent("toggle", domElement);
|
|
listenToNonDelegatedEvent("cancel", domElement);
|
|
listenToNonDelegatedEvent("close", domElement);
|
|
break;
|
|
case "iframe":
|
|
case "object":
|
|
listenToNonDelegatedEvent("load", domElement);
|
|
break;
|
|
case "video":
|
|
case "audio":
|
|
for (hasSrc = 0; hasSrc < mediaEventTypes.length; hasSrc++)
|
|
listenToNonDelegatedEvent(mediaEventTypes[hasSrc], domElement);
|
|
break;
|
|
case "image":
|
|
listenToNonDelegatedEvent("error", domElement);
|
|
listenToNonDelegatedEvent("load", domElement);
|
|
break;
|
|
case "details":
|
|
listenToNonDelegatedEvent("toggle", domElement);
|
|
break;
|
|
case "embed":
|
|
case "source":
|
|
case "link":
|
|
listenToNonDelegatedEvent("error", domElement), listenToNonDelegatedEvent("load", domElement);
|
|
case "area":
|
|
case "base":
|
|
case "br":
|
|
case "col":
|
|
case "hr":
|
|
case "keygen":
|
|
case "meta":
|
|
case "param":
|
|
case "track":
|
|
case "wbr":
|
|
case "menuitem":
|
|
for (defaultChecked in props)
|
|
if (props.hasOwnProperty(defaultChecked) && (hasSrc = props[defaultChecked], null != hasSrc))
|
|
switch (defaultChecked) {
|
|
case "children":
|
|
case "dangerouslySetInnerHTML":
|
|
throw Error(
|
|
tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
|
|
);
|
|
default:
|
|
setProp(domElement, tag, defaultChecked, hasSrc, props, null);
|
|
}
|
|
return;
|
|
default:
|
|
if (isCustomElement(tag)) {
|
|
for (_propValue in props)
|
|
props.hasOwnProperty(_propValue) && (hasSrc = props[_propValue], void 0 !== hasSrc && setPropOnCustomElement(
|
|
domElement,
|
|
tag,
|
|
_propValue,
|
|
hasSrc,
|
|
props,
|
|
void 0
|
|
));
|
|
return;
|
|
}
|
|
}
|
|
for (defaultValue in props)
|
|
props.hasOwnProperty(defaultValue) && (hasSrc = props[defaultValue], null != hasSrc && setProp(domElement, tag, defaultValue, hasSrc, props, null));
|
|
}
|
|
function updateProperties(domElement, tag, lastProps, nextProps) {
|
|
validatePropertiesInDevelopment(tag, nextProps);
|
|
switch (tag) {
|
|
case "div":
|
|
case "span":
|
|
case "svg":
|
|
case "path":
|
|
case "a":
|
|
case "g":
|
|
case "p":
|
|
case "li":
|
|
break;
|
|
case "input":
|
|
var name = null, type = null, value = null, defaultValue = null, lastDefaultValue = null, checked = null, defaultChecked = null;
|
|
for (propKey in lastProps) {
|
|
var lastProp = lastProps[propKey];
|
|
if (lastProps.hasOwnProperty(propKey) && null != lastProp)
|
|
switch (propKey) {
|
|
case "checked":
|
|
break;
|
|
case "value":
|
|
break;
|
|
case "defaultValue":
|
|
lastDefaultValue = lastProp;
|
|
default:
|
|
nextProps.hasOwnProperty(propKey) || setProp(
|
|
domElement,
|
|
tag,
|
|
propKey,
|
|
null,
|
|
nextProps,
|
|
lastProp
|
|
);
|
|
}
|
|
}
|
|
for (var _propKey8 in nextProps) {
|
|
var propKey = nextProps[_propKey8];
|
|
lastProp = lastProps[_propKey8];
|
|
if (nextProps.hasOwnProperty(_propKey8) && (null != propKey || null != lastProp))
|
|
switch (_propKey8) {
|
|
case "type":
|
|
type = propKey;
|
|
break;
|
|
case "name":
|
|
name = propKey;
|
|
break;
|
|
case "checked":
|
|
checked = propKey;
|
|
break;
|
|
case "defaultChecked":
|
|
defaultChecked = propKey;
|
|
break;
|
|
case "value":
|
|
value = propKey;
|
|
break;
|
|
case "defaultValue":
|
|
defaultValue = propKey;
|
|
break;
|
|
case "children":
|
|
case "dangerouslySetInnerHTML":
|
|
if (null != propKey)
|
|
throw Error(
|
|
tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
|
|
);
|
|
break;
|
|
default:
|
|
propKey !== lastProp && setProp(
|
|
domElement,
|
|
tag,
|
|
_propKey8,
|
|
propKey,
|
|
nextProps,
|
|
lastProp
|
|
);
|
|
}
|
|
}
|
|
tag = "checkbox" === lastProps.type || "radio" === lastProps.type ? null != lastProps.checked : null != lastProps.value;
|
|
nextProps = "checkbox" === nextProps.type || "radio" === nextProps.type ? null != nextProps.checked : null != nextProps.value;
|
|
tag || !nextProps || didWarnUncontrolledToControlled || (console.error(
|
|
"A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"
|
|
), didWarnUncontrolledToControlled = true);
|
|
!tag || nextProps || didWarnControlledToUncontrolled || (console.error(
|
|
"A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"
|
|
), didWarnControlledToUncontrolled = true);
|
|
updateInput(
|
|
domElement,
|
|
value,
|
|
defaultValue,
|
|
lastDefaultValue,
|
|
checked,
|
|
defaultChecked,
|
|
type,
|
|
name
|
|
);
|
|
return;
|
|
case "select":
|
|
propKey = value = defaultValue = _propKey8 = null;
|
|
for (type in lastProps)
|
|
if (lastDefaultValue = lastProps[type], lastProps.hasOwnProperty(type) && null != lastDefaultValue)
|
|
switch (type) {
|
|
case "value":
|
|
break;
|
|
case "multiple":
|
|
propKey = lastDefaultValue;
|
|
default:
|
|
nextProps.hasOwnProperty(type) || setProp(
|
|
domElement,
|
|
tag,
|
|
type,
|
|
null,
|
|
nextProps,
|
|
lastDefaultValue
|
|
);
|
|
}
|
|
for (name in nextProps)
|
|
if (type = nextProps[name], lastDefaultValue = lastProps[name], nextProps.hasOwnProperty(name) && (null != type || null != lastDefaultValue))
|
|
switch (name) {
|
|
case "value":
|
|
_propKey8 = type;
|
|
break;
|
|
case "defaultValue":
|
|
defaultValue = type;
|
|
break;
|
|
case "multiple":
|
|
value = type;
|
|
default:
|
|
type !== lastDefaultValue && setProp(
|
|
domElement,
|
|
tag,
|
|
name,
|
|
type,
|
|
nextProps,
|
|
lastDefaultValue
|
|
);
|
|
}
|
|
nextProps = defaultValue;
|
|
tag = value;
|
|
lastProps = propKey;
|
|
null != _propKey8 ? updateOptions(domElement, !!tag, _propKey8, false) : !!lastProps !== !!tag && (null != nextProps ? updateOptions(domElement, !!tag, nextProps, true) : updateOptions(domElement, !!tag, tag ? [] : "", false));
|
|
return;
|
|
case "textarea":
|
|
propKey = _propKey8 = null;
|
|
for (defaultValue in lastProps)
|
|
if (name = lastProps[defaultValue], lastProps.hasOwnProperty(defaultValue) && null != name && !nextProps.hasOwnProperty(defaultValue))
|
|
switch (defaultValue) {
|
|
case "value":
|
|
break;
|
|
case "children":
|
|
break;
|
|
default:
|
|
setProp(domElement, tag, defaultValue, null, nextProps, name);
|
|
}
|
|
for (value in nextProps)
|
|
if (name = nextProps[value], type = lastProps[value], nextProps.hasOwnProperty(value) && (null != name || null != type))
|
|
switch (value) {
|
|
case "value":
|
|
_propKey8 = name;
|
|
break;
|
|
case "defaultValue":
|
|
propKey = name;
|
|
break;
|
|
case "children":
|
|
break;
|
|
case "dangerouslySetInnerHTML":
|
|
if (null != name)
|
|
throw Error(
|
|
"`dangerouslySetInnerHTML` does not make sense on <textarea>."
|
|
);
|
|
break;
|
|
default:
|
|
name !== type && setProp(domElement, tag, value, name, nextProps, type);
|
|
}
|
|
updateTextarea(domElement, _propKey8, propKey);
|
|
return;
|
|
case "option":
|
|
for (var _propKey13 in lastProps)
|
|
if (_propKey8 = lastProps[_propKey13], lastProps.hasOwnProperty(_propKey13) && null != _propKey8 && !nextProps.hasOwnProperty(_propKey13))
|
|
switch (_propKey13) {
|
|
case "selected":
|
|
domElement.selected = false;
|
|
break;
|
|
default:
|
|
setProp(
|
|
domElement,
|
|
tag,
|
|
_propKey13,
|
|
null,
|
|
nextProps,
|
|
_propKey8
|
|
);
|
|
}
|
|
for (lastDefaultValue in nextProps)
|
|
if (_propKey8 = nextProps[lastDefaultValue], propKey = lastProps[lastDefaultValue], nextProps.hasOwnProperty(lastDefaultValue) && _propKey8 !== propKey && (null != _propKey8 || null != propKey))
|
|
switch (lastDefaultValue) {
|
|
case "selected":
|
|
domElement.selected = _propKey8 && "function" !== typeof _propKey8 && "symbol" !== typeof _propKey8;
|
|
break;
|
|
default:
|
|
setProp(
|
|
domElement,
|
|
tag,
|
|
lastDefaultValue,
|
|
_propKey8,
|
|
nextProps,
|
|
propKey
|
|
);
|
|
}
|
|
return;
|
|
case "img":
|
|
case "link":
|
|
case "area":
|
|
case "base":
|
|
case "br":
|
|
case "col":
|
|
case "embed":
|
|
case "hr":
|
|
case "keygen":
|
|
case "meta":
|
|
case "param":
|
|
case "source":
|
|
case "track":
|
|
case "wbr":
|
|
case "menuitem":
|
|
for (var _propKey15 in lastProps)
|
|
_propKey8 = lastProps[_propKey15], lastProps.hasOwnProperty(_propKey15) && null != _propKey8 && !nextProps.hasOwnProperty(_propKey15) && setProp(
|
|
domElement,
|
|
tag,
|
|
_propKey15,
|
|
null,
|
|
nextProps,
|
|
_propKey8
|
|
);
|
|
for (checked in nextProps)
|
|
if (_propKey8 = nextProps[checked], propKey = lastProps[checked], nextProps.hasOwnProperty(checked) && _propKey8 !== propKey && (null != _propKey8 || null != propKey))
|
|
switch (checked) {
|
|
case "children":
|
|
case "dangerouslySetInnerHTML":
|
|
if (null != _propKey8)
|
|
throw Error(
|
|
tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
|
|
);
|
|
break;
|
|
default:
|
|
setProp(
|
|
domElement,
|
|
tag,
|
|
checked,
|
|
_propKey8,
|
|
nextProps,
|
|
propKey
|
|
);
|
|
}
|
|
return;
|
|
default:
|
|
if (isCustomElement(tag)) {
|
|
for (var _propKey17 in lastProps)
|
|
_propKey8 = lastProps[_propKey17], lastProps.hasOwnProperty(_propKey17) && void 0 !== _propKey8 && !nextProps.hasOwnProperty(_propKey17) && setPropOnCustomElement(
|
|
domElement,
|
|
tag,
|
|
_propKey17,
|
|
void 0,
|
|
nextProps,
|
|
_propKey8
|
|
);
|
|
for (defaultChecked in nextProps)
|
|
_propKey8 = nextProps[defaultChecked], propKey = lastProps[defaultChecked], !nextProps.hasOwnProperty(defaultChecked) || _propKey8 === propKey || void 0 === _propKey8 && void 0 === propKey || setPropOnCustomElement(
|
|
domElement,
|
|
tag,
|
|
defaultChecked,
|
|
_propKey8,
|
|
nextProps,
|
|
propKey
|
|
);
|
|
return;
|
|
}
|
|
}
|
|
for (var _propKey19 in lastProps)
|
|
_propKey8 = lastProps[_propKey19], lastProps.hasOwnProperty(_propKey19) && null != _propKey8 && !nextProps.hasOwnProperty(_propKey19) && setProp(domElement, tag, _propKey19, null, nextProps, _propKey8);
|
|
for (lastProp in nextProps)
|
|
_propKey8 = nextProps[lastProp], propKey = lastProps[lastProp], !nextProps.hasOwnProperty(lastProp) || _propKey8 === propKey || null == _propKey8 && null == propKey || setProp(domElement, tag, lastProp, _propKey8, nextProps, propKey);
|
|
}
|
|
function getPropNameFromAttributeName(attrName) {
|
|
switch (attrName) {
|
|
case "class":
|
|
return "className";
|
|
case "for":
|
|
return "htmlFor";
|
|
default:
|
|
return attrName;
|
|
}
|
|
}
|
|
function getStylesObjectFromElement(domElement) {
|
|
var serverValueInObjectForm = {};
|
|
domElement = domElement.style;
|
|
for (var i = 0; i < domElement.length; i++) {
|
|
var styleName = domElement[i];
|
|
serverValueInObjectForm[styleName] = domElement.getPropertyValue(styleName);
|
|
}
|
|
return serverValueInObjectForm;
|
|
}
|
|
function diffHydratedStyles(domElement, value$jscomp$0, serverDifferences) {
|
|
if (null != value$jscomp$0 && "object" !== typeof value$jscomp$0)
|
|
console.error(
|
|
"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX."
|
|
);
|
|
else {
|
|
var clientValue;
|
|
var delimiter2 = clientValue = "", styleName;
|
|
for (styleName in value$jscomp$0)
|
|
if (value$jscomp$0.hasOwnProperty(styleName)) {
|
|
var value = value$jscomp$0[styleName];
|
|
null != value && "boolean" !== typeof value && "" !== value && (0 === styleName.indexOf("--") ? (checkCSSPropertyStringCoercion(value, styleName), clientValue += delimiter2 + styleName + ":" + ("" + value).trim()) : "number" !== typeof value || 0 === value || unitlessNumbers.has(styleName) ? (checkCSSPropertyStringCoercion(value, styleName), clientValue += delimiter2 + styleName.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern$1, "-ms-") + ":" + ("" + value).trim()) : clientValue += delimiter2 + styleName.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern$1, "-ms-") + ":" + value + "px", delimiter2 = ";");
|
|
}
|
|
clientValue = clientValue || null;
|
|
value$jscomp$0 = domElement.getAttribute("style");
|
|
value$jscomp$0 !== clientValue && (clientValue = normalizeMarkupForTextOrAttribute(clientValue), normalizeMarkupForTextOrAttribute(value$jscomp$0) !== clientValue && (serverDifferences.style = getStylesObjectFromElement(domElement)));
|
|
}
|
|
}
|
|
function hydrateAttribute(domElement, propKey, attributeName, value, extraAttributes, serverDifferences) {
|
|
extraAttributes.delete(attributeName);
|
|
domElement = domElement.getAttribute(attributeName);
|
|
if (null === domElement)
|
|
switch (typeof value) {
|
|
case "undefined":
|
|
case "function":
|
|
case "symbol":
|
|
case "boolean":
|
|
return;
|
|
}
|
|
else if (null != value)
|
|
switch (typeof value) {
|
|
case "function":
|
|
case "symbol":
|
|
case "boolean":
|
|
break;
|
|
default:
|
|
if (checkAttributeStringCoercion(value, propKey), domElement === "" + value)
|
|
return;
|
|
}
|
|
warnForPropDifference(propKey, domElement, value, serverDifferences);
|
|
}
|
|
function hydrateBooleanAttribute(domElement, propKey, attributeName, value, extraAttributes, serverDifferences) {
|
|
extraAttributes.delete(attributeName);
|
|
domElement = domElement.getAttribute(attributeName);
|
|
if (null === domElement) {
|
|
switch (typeof value) {
|
|
case "function":
|
|
case "symbol":
|
|
return;
|
|
}
|
|
if (!value) return;
|
|
} else
|
|
switch (typeof value) {
|
|
case "function":
|
|
case "symbol":
|
|
break;
|
|
default:
|
|
if (value) return;
|
|
}
|
|
warnForPropDifference(propKey, domElement, value, serverDifferences);
|
|
}
|
|
function hydrateBooleanishAttribute(domElement, propKey, attributeName, value, extraAttributes, serverDifferences) {
|
|
extraAttributes.delete(attributeName);
|
|
domElement = domElement.getAttribute(attributeName);
|
|
if (null === domElement)
|
|
switch (typeof value) {
|
|
case "undefined":
|
|
case "function":
|
|
case "symbol":
|
|
return;
|
|
}
|
|
else if (null != value)
|
|
switch (typeof value) {
|
|
case "function":
|
|
case "symbol":
|
|
break;
|
|
default:
|
|
if (checkAttributeStringCoercion(value, attributeName), domElement === "" + value)
|
|
return;
|
|
}
|
|
warnForPropDifference(propKey, domElement, value, serverDifferences);
|
|
}
|
|
function hydrateNumericAttribute(domElement, propKey, attributeName, value, extraAttributes, serverDifferences) {
|
|
extraAttributes.delete(attributeName);
|
|
domElement = domElement.getAttribute(attributeName);
|
|
if (null === domElement)
|
|
switch (typeof value) {
|
|
case "undefined":
|
|
case "function":
|
|
case "symbol":
|
|
case "boolean":
|
|
return;
|
|
default:
|
|
if (isNaN(value)) return;
|
|
}
|
|
else if (null != value)
|
|
switch (typeof value) {
|
|
case "function":
|
|
case "symbol":
|
|
case "boolean":
|
|
break;
|
|
default:
|
|
if (!isNaN(value) && (checkAttributeStringCoercion(value, propKey), domElement === "" + value))
|
|
return;
|
|
}
|
|
warnForPropDifference(propKey, domElement, value, serverDifferences);
|
|
}
|
|
function hydrateSanitizedAttribute(domElement, propKey, attributeName, value, extraAttributes, serverDifferences) {
|
|
extraAttributes.delete(attributeName);
|
|
domElement = domElement.getAttribute(attributeName);
|
|
if (null === domElement)
|
|
switch (typeof value) {
|
|
case "undefined":
|
|
case "function":
|
|
case "symbol":
|
|
case "boolean":
|
|
return;
|
|
}
|
|
else if (null != value)
|
|
switch (typeof value) {
|
|
case "function":
|
|
case "symbol":
|
|
case "boolean":
|
|
break;
|
|
default:
|
|
if (checkAttributeStringCoercion(value, propKey), attributeName = sanitizeURL("" + value), domElement === attributeName)
|
|
return;
|
|
}
|
|
warnForPropDifference(propKey, domElement, value, serverDifferences);
|
|
}
|
|
function diffHydratedProperties(domElement, tag, props, hostContext) {
|
|
for (var serverDifferences = {}, extraAttributes = /* @__PURE__ */ new Set(), attributes = domElement.attributes, i = 0; i < attributes.length; i++)
|
|
switch (attributes[i].name.toLowerCase()) {
|
|
case "value":
|
|
break;
|
|
case "checked":
|
|
break;
|
|
case "selected":
|
|
break;
|
|
default:
|
|
extraAttributes.add(attributes[i].name);
|
|
}
|
|
if (isCustomElement(tag))
|
|
for (var propKey in props) {
|
|
if (props.hasOwnProperty(propKey)) {
|
|
var value = props[propKey];
|
|
if (null != value) {
|
|
if (registrationNameDependencies.hasOwnProperty(propKey))
|
|
"function" !== typeof value && warnForInvalidEventListener(propKey, value);
|
|
else if (true !== props.suppressHydrationWarning)
|
|
switch (propKey) {
|
|
case "children":
|
|
"string" !== typeof value && "number" !== typeof value || warnForPropDifference(
|
|
"children",
|
|
domElement.textContent,
|
|
value,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "suppressContentEditableWarning":
|
|
case "suppressHydrationWarning":
|
|
case "defaultValue":
|
|
case "defaultChecked":
|
|
case "innerHTML":
|
|
case "ref":
|
|
continue;
|
|
case "dangerouslySetInnerHTML":
|
|
attributes = domElement.innerHTML;
|
|
value = value ? value.__html : void 0;
|
|
null != value && (value = normalizeHTML(domElement, value), warnForPropDifference(
|
|
propKey,
|
|
attributes,
|
|
value,
|
|
serverDifferences
|
|
));
|
|
continue;
|
|
case "style":
|
|
extraAttributes.delete(propKey);
|
|
diffHydratedStyles(domElement, value, serverDifferences);
|
|
continue;
|
|
case "offsetParent":
|
|
case "offsetTop":
|
|
case "offsetLeft":
|
|
case "offsetWidth":
|
|
case "offsetHeight":
|
|
case "isContentEditable":
|
|
case "outerText":
|
|
case "outerHTML":
|
|
extraAttributes.delete(propKey.toLowerCase());
|
|
console.error(
|
|
"Assignment to read-only property will result in a no-op: `%s`",
|
|
propKey
|
|
);
|
|
continue;
|
|
case "className":
|
|
extraAttributes.delete("class");
|
|
attributes = getValueForAttributeOnCustomComponent(
|
|
domElement,
|
|
"class",
|
|
value
|
|
);
|
|
warnForPropDifference(
|
|
"className",
|
|
attributes,
|
|
value,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
default:
|
|
hostContext.context === HostContextNamespaceNone && "svg" !== tag && "math" !== tag ? extraAttributes.delete(propKey.toLowerCase()) : extraAttributes.delete(propKey), attributes = getValueForAttributeOnCustomComponent(
|
|
domElement,
|
|
propKey,
|
|
value
|
|
), warnForPropDifference(
|
|
propKey,
|
|
attributes,
|
|
value,
|
|
serverDifferences
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
for (value in props)
|
|
if (props.hasOwnProperty(value) && (propKey = props[value], null != propKey)) {
|
|
if (registrationNameDependencies.hasOwnProperty(value))
|
|
"function" !== typeof propKey && warnForInvalidEventListener(value, propKey);
|
|
else if (true !== props.suppressHydrationWarning)
|
|
switch (value) {
|
|
case "children":
|
|
"string" !== typeof propKey && "number" !== typeof propKey || warnForPropDifference(
|
|
"children",
|
|
domElement.textContent,
|
|
propKey,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "suppressContentEditableWarning":
|
|
case "suppressHydrationWarning":
|
|
case "value":
|
|
case "checked":
|
|
case "selected":
|
|
case "defaultValue":
|
|
case "defaultChecked":
|
|
case "innerHTML":
|
|
case "ref":
|
|
continue;
|
|
case "dangerouslySetInnerHTML":
|
|
attributes = domElement.innerHTML;
|
|
propKey = propKey ? propKey.__html : void 0;
|
|
null != propKey && (propKey = normalizeHTML(domElement, propKey), attributes !== propKey && (serverDifferences[value] = { __html: attributes }));
|
|
continue;
|
|
case "className":
|
|
hydrateAttribute(
|
|
domElement,
|
|
value,
|
|
"class",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "tabIndex":
|
|
hydrateAttribute(
|
|
domElement,
|
|
value,
|
|
"tabindex",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "style":
|
|
extraAttributes.delete(value);
|
|
diffHydratedStyles(domElement, propKey, serverDifferences);
|
|
continue;
|
|
case "multiple":
|
|
extraAttributes.delete(value);
|
|
warnForPropDifference(
|
|
value,
|
|
domElement.multiple,
|
|
propKey,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "muted":
|
|
extraAttributes.delete(value);
|
|
warnForPropDifference(
|
|
value,
|
|
domElement.muted,
|
|
propKey,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "autoFocus":
|
|
extraAttributes.delete("autofocus");
|
|
warnForPropDifference(
|
|
value,
|
|
domElement.autofocus,
|
|
propKey,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "data":
|
|
if ("object" !== tag) {
|
|
extraAttributes.delete(value);
|
|
attributes = domElement.getAttribute("data");
|
|
warnForPropDifference(
|
|
value,
|
|
attributes,
|
|
propKey,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
}
|
|
case "src":
|
|
case "href":
|
|
if (!("" !== propKey || "a" === tag && "href" === value || "object" === tag && "data" === value)) {
|
|
"src" === value ? console.error(
|
|
'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
|
|
value,
|
|
value
|
|
) : console.error(
|
|
'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
|
|
value,
|
|
value
|
|
);
|
|
continue;
|
|
}
|
|
hydrateSanitizedAttribute(
|
|
domElement,
|
|
value,
|
|
value,
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "action":
|
|
case "formAction":
|
|
attributes = domElement.getAttribute(value);
|
|
if ("function" === typeof propKey) {
|
|
extraAttributes.delete(value.toLowerCase());
|
|
"formAction" === value ? (extraAttributes.delete("name"), extraAttributes.delete("formenctype"), extraAttributes.delete("formmethod"), extraAttributes.delete("formtarget")) : (extraAttributes.delete("enctype"), extraAttributes.delete("method"), extraAttributes.delete("target"));
|
|
continue;
|
|
} else if (attributes === EXPECTED_FORM_ACTION_URL) {
|
|
extraAttributes.delete(value.toLowerCase());
|
|
warnForPropDifference(
|
|
value,
|
|
"function",
|
|
propKey,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
}
|
|
hydrateSanitizedAttribute(
|
|
domElement,
|
|
value,
|
|
value.toLowerCase(),
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "xlinkHref":
|
|
hydrateSanitizedAttribute(
|
|
domElement,
|
|
value,
|
|
"xlink:href",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "contentEditable":
|
|
hydrateBooleanishAttribute(
|
|
domElement,
|
|
value,
|
|
"contenteditable",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "spellCheck":
|
|
hydrateBooleanishAttribute(
|
|
domElement,
|
|
value,
|
|
"spellcheck",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "draggable":
|
|
case "autoReverse":
|
|
case "externalResourcesRequired":
|
|
case "focusable":
|
|
case "preserveAlpha":
|
|
hydrateBooleanishAttribute(
|
|
domElement,
|
|
value,
|
|
value,
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "allowFullScreen":
|
|
case "async":
|
|
case "autoPlay":
|
|
case "controls":
|
|
case "default":
|
|
case "defer":
|
|
case "disabled":
|
|
case "disablePictureInPicture":
|
|
case "disableRemotePlayback":
|
|
case "formNoValidate":
|
|
case "hidden":
|
|
case "loop":
|
|
case "noModule":
|
|
case "noValidate":
|
|
case "open":
|
|
case "playsInline":
|
|
case "readOnly":
|
|
case "required":
|
|
case "reversed":
|
|
case "scoped":
|
|
case "seamless":
|
|
case "itemScope":
|
|
hydrateBooleanAttribute(
|
|
domElement,
|
|
value,
|
|
value.toLowerCase(),
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "capture":
|
|
case "download":
|
|
a: {
|
|
i = domElement;
|
|
var attributeName = attributes = value, serverDifferences$jscomp$0 = serverDifferences;
|
|
extraAttributes.delete(attributeName);
|
|
i = i.getAttribute(attributeName);
|
|
if (null === i)
|
|
switch (typeof propKey) {
|
|
case "undefined":
|
|
case "function":
|
|
case "symbol":
|
|
break a;
|
|
default:
|
|
if (false === propKey) break a;
|
|
}
|
|
else if (null != propKey)
|
|
switch (typeof propKey) {
|
|
case "function":
|
|
case "symbol":
|
|
break;
|
|
case "boolean":
|
|
if (true === propKey && "" === i) break a;
|
|
break;
|
|
default:
|
|
if (checkAttributeStringCoercion(propKey, attributes), i === "" + propKey)
|
|
break a;
|
|
}
|
|
warnForPropDifference(
|
|
attributes,
|
|
i,
|
|
propKey,
|
|
serverDifferences$jscomp$0
|
|
);
|
|
}
|
|
continue;
|
|
case "cols":
|
|
case "rows":
|
|
case "size":
|
|
case "span":
|
|
a: {
|
|
i = domElement;
|
|
attributeName = attributes = value;
|
|
serverDifferences$jscomp$0 = serverDifferences;
|
|
extraAttributes.delete(attributeName);
|
|
i = i.getAttribute(attributeName);
|
|
if (null === i)
|
|
switch (typeof propKey) {
|
|
case "undefined":
|
|
case "function":
|
|
case "symbol":
|
|
case "boolean":
|
|
break a;
|
|
default:
|
|
if (isNaN(propKey) || 1 > propKey) break a;
|
|
}
|
|
else if (null != propKey)
|
|
switch (typeof propKey) {
|
|
case "function":
|
|
case "symbol":
|
|
case "boolean":
|
|
break;
|
|
default:
|
|
if (!(isNaN(propKey) || 1 > propKey) && (checkAttributeStringCoercion(propKey, attributes), i === "" + propKey))
|
|
break a;
|
|
}
|
|
warnForPropDifference(
|
|
attributes,
|
|
i,
|
|
propKey,
|
|
serverDifferences$jscomp$0
|
|
);
|
|
}
|
|
continue;
|
|
case "rowSpan":
|
|
hydrateNumericAttribute(
|
|
domElement,
|
|
value,
|
|
"rowspan",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "start":
|
|
hydrateNumericAttribute(
|
|
domElement,
|
|
value,
|
|
value,
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "xHeight":
|
|
hydrateAttribute(
|
|
domElement,
|
|
value,
|
|
"x-height",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "xlinkActuate":
|
|
hydrateAttribute(
|
|
domElement,
|
|
value,
|
|
"xlink:actuate",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "xlinkArcrole":
|
|
hydrateAttribute(
|
|
domElement,
|
|
value,
|
|
"xlink:arcrole",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "xlinkRole":
|
|
hydrateAttribute(
|
|
domElement,
|
|
value,
|
|
"xlink:role",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "xlinkShow":
|
|
hydrateAttribute(
|
|
domElement,
|
|
value,
|
|
"xlink:show",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "xlinkTitle":
|
|
hydrateAttribute(
|
|
domElement,
|
|
value,
|
|
"xlink:title",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "xlinkType":
|
|
hydrateAttribute(
|
|
domElement,
|
|
value,
|
|
"xlink:type",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "xmlBase":
|
|
hydrateAttribute(
|
|
domElement,
|
|
value,
|
|
"xml:base",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "xmlLang":
|
|
hydrateAttribute(
|
|
domElement,
|
|
value,
|
|
"xml:lang",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "xmlSpace":
|
|
hydrateAttribute(
|
|
domElement,
|
|
value,
|
|
"xml:space",
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
case "inert":
|
|
"" !== propKey || didWarnForNewBooleanPropsWithEmptyValue[value] || (didWarnForNewBooleanPropsWithEmptyValue[value] = true, console.error(
|
|
"Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
|
|
value
|
|
));
|
|
hydrateBooleanAttribute(
|
|
domElement,
|
|
value,
|
|
value,
|
|
propKey,
|
|
extraAttributes,
|
|
serverDifferences
|
|
);
|
|
continue;
|
|
default:
|
|
if (!(2 < value.length) || "o" !== value[0] && "O" !== value[0] || "n" !== value[1] && "N" !== value[1]) {
|
|
i = getAttributeAlias(value);
|
|
attributes = false;
|
|
hostContext.context === HostContextNamespaceNone && "svg" !== tag && "math" !== tag ? extraAttributes.delete(i.toLowerCase()) : (attributeName = value.toLowerCase(), attributeName = possibleStandardNames.hasOwnProperty(
|
|
attributeName
|
|
) ? possibleStandardNames[attributeName] || null : null, null !== attributeName && attributeName !== value && (attributes = true, extraAttributes.delete(attributeName)), extraAttributes.delete(i));
|
|
a: if (attributeName = domElement, serverDifferences$jscomp$0 = i, i = propKey, isAttributeNameSafe(serverDifferences$jscomp$0))
|
|
if (attributeName.hasAttribute(serverDifferences$jscomp$0))
|
|
attributeName = attributeName.getAttribute(
|
|
serverDifferences$jscomp$0
|
|
), checkAttributeStringCoercion(
|
|
i,
|
|
serverDifferences$jscomp$0
|
|
), i = attributeName === "" + i ? i : attributeName;
|
|
else {
|
|
switch (typeof i) {
|
|
case "function":
|
|
case "symbol":
|
|
break a;
|
|
case "boolean":
|
|
if (attributeName = serverDifferences$jscomp$0.toLowerCase().slice(0, 5), "data-" !== attributeName && "aria-" !== attributeName)
|
|
break a;
|
|
}
|
|
i = void 0 === i ? void 0 : null;
|
|
}
|
|
else i = void 0;
|
|
attributes || warnForPropDifference(
|
|
value,
|
|
i,
|
|
propKey,
|
|
serverDifferences
|
|
);
|
|
}
|
|
}
|
|
}
|
|
0 < extraAttributes.size && true !== props.suppressHydrationWarning && warnForExtraAttributes(domElement, extraAttributes, serverDifferences);
|
|
return 0 === Object.keys(serverDifferences).length ? null : serverDifferences;
|
|
}
|
|
function propNamesListJoin(list, combinator) {
|
|
switch (list.length) {
|
|
case 0:
|
|
return "";
|
|
case 1:
|
|
return list[0];
|
|
case 2:
|
|
return list[0] + " " + combinator + " " + list[1];
|
|
default:
|
|
return list.slice(0, -1).join(", ") + ", " + combinator + " " + list[list.length - 1];
|
|
}
|
|
}
|
|
function isLikelyStaticResource(initiatorType) {
|
|
switch (initiatorType) {
|
|
case "css":
|
|
case "script":
|
|
case "font":
|
|
case "img":
|
|
case "image":
|
|
case "input":
|
|
case "link":
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
function estimateBandwidth() {
|
|
if ("function" === typeof performance.getEntriesByType) {
|
|
for (var count = 0, bits = 0, resourceEntries = performance.getEntriesByType("resource"), i = 0; i < resourceEntries.length; i++) {
|
|
var entry = resourceEntries[i], transferSize = entry.transferSize, initiatorType = entry.initiatorType, duration2 = entry.duration;
|
|
if (transferSize && duration2 && isLikelyStaticResource(initiatorType)) {
|
|
initiatorType = 0;
|
|
duration2 = entry.responseEnd;
|
|
for (i += 1; i < resourceEntries.length; i++) {
|
|
var overlapEntry = resourceEntries[i], overlapStartTime = overlapEntry.startTime;
|
|
if (overlapStartTime > duration2) break;
|
|
var overlapTransferSize = overlapEntry.transferSize, overlapInitiatorType = overlapEntry.initiatorType;
|
|
overlapTransferSize && isLikelyStaticResource(overlapInitiatorType) && (overlapEntry = overlapEntry.responseEnd, initiatorType += overlapTransferSize * (overlapEntry < duration2 ? 1 : (duration2 - overlapStartTime) / (overlapEntry - overlapStartTime)));
|
|
}
|
|
--i;
|
|
bits += 8 * (transferSize + initiatorType) / (entry.duration / 1e3);
|
|
count++;
|
|
if (10 < count) break;
|
|
}
|
|
}
|
|
if (0 < count) return bits / count / 1e6;
|
|
}
|
|
return navigator.connection && (count = navigator.connection.downlink, "number" === typeof count) ? count : 5;
|
|
}
|
|
function getOwnerDocumentFromRootContainer(rootContainerElement) {
|
|
return 9 === rootContainerElement.nodeType ? rootContainerElement : rootContainerElement.ownerDocument;
|
|
}
|
|
function getOwnHostContext(namespaceURI) {
|
|
switch (namespaceURI) {
|
|
case SVG_NAMESPACE:
|
|
return HostContextNamespaceSvg;
|
|
case MATH_NAMESPACE:
|
|
return HostContextNamespaceMath;
|
|
default:
|
|
return HostContextNamespaceNone;
|
|
}
|
|
}
|
|
function getChildHostContextProd(parentNamespace, type) {
|
|
if (parentNamespace === HostContextNamespaceNone)
|
|
switch (type) {
|
|
case "svg":
|
|
return HostContextNamespaceSvg;
|
|
case "math":
|
|
return HostContextNamespaceMath;
|
|
default:
|
|
return HostContextNamespaceNone;
|
|
}
|
|
return parentNamespace === HostContextNamespaceSvg && "foreignObject" === type ? HostContextNamespaceNone : parentNamespace;
|
|
}
|
|
function shouldSetTextContent(type, props) {
|
|
return "textarea" === type || "noscript" === type || "string" === typeof props.children || "number" === typeof props.children || "bigint" === typeof props.children || "object" === typeof props.dangerouslySetInnerHTML && null !== props.dangerouslySetInnerHTML && null != props.dangerouslySetInnerHTML.__html;
|
|
}
|
|
function shouldAttemptEagerTransition() {
|
|
var event = window.event;
|
|
if (event && "popstate" === event.type) {
|
|
if (event === currentPopstateTransitionEvent) return false;
|
|
currentPopstateTransitionEvent = event;
|
|
return true;
|
|
}
|
|
currentPopstateTransitionEvent = null;
|
|
return false;
|
|
}
|
|
function resolveEventType() {
|
|
var event = window.event;
|
|
return event && event !== schedulerEvent ? event.type : null;
|
|
}
|
|
function resolveEventTimeStamp() {
|
|
var event = window.event;
|
|
return event && event !== schedulerEvent ? event.timeStamp : -1.1;
|
|
}
|
|
function handleErrorInNextTick(error) {
|
|
setTimeout(function() {
|
|
throw error;
|
|
});
|
|
}
|
|
function commitMount(domElement, type, newProps) {
|
|
switch (type) {
|
|
case "button":
|
|
case "input":
|
|
case "select":
|
|
case "textarea":
|
|
newProps.autoFocus && domElement.focus();
|
|
break;
|
|
case "img":
|
|
newProps.src ? domElement.src = newProps.src : newProps.srcSet && (domElement.srcset = newProps.srcSet);
|
|
}
|
|
}
|
|
function commitHydratedInstance() {
|
|
}
|
|
function commitUpdate(domElement, type, oldProps, newProps) {
|
|
updateProperties(domElement, type, oldProps, newProps);
|
|
domElement[internalPropsKey] = newProps;
|
|
}
|
|
function resetTextContent(domElement) {
|
|
setTextContent(domElement, "");
|
|
}
|
|
function commitTextUpdate(textInstance, oldText, newText) {
|
|
textInstance.nodeValue = newText;
|
|
}
|
|
function warnForReactChildrenConflict(container) {
|
|
if (!container.__reactWarnedAboutChildrenConflict) {
|
|
var props = container[internalPropsKey] || null;
|
|
if (null !== props) {
|
|
var fiber = getInstanceFromNode(container);
|
|
null !== fiber && ("string" === typeof props.children || "number" === typeof props.children ? (container.__reactWarnedAboutChildrenConflict = true, runWithFiberInDEV(fiber, function() {
|
|
console.error(
|
|
'Cannot use a ref on a React element as a container to `createRoot` or `createPortal` if that element also sets "children" text content using React. It should be a leaf with no children. Otherwise it\'s ambiguous which children should be used.'
|
|
);
|
|
})) : null != props.dangerouslySetInnerHTML && (container.__reactWarnedAboutChildrenConflict = true, runWithFiberInDEV(fiber, function() {
|
|
console.error(
|
|
'Cannot use a ref on a React element as a container to `createRoot` or `createPortal` if that element also sets "dangerouslySetInnerHTML" using React. It should be a leaf with no children. Otherwise it\'s ambiguous which children should be used.'
|
|
);
|
|
})));
|
|
}
|
|
}
|
|
}
|
|
function isSingletonScope(type) {
|
|
return "head" === type;
|
|
}
|
|
function removeChild(parentInstance, child) {
|
|
parentInstance.removeChild(child);
|
|
}
|
|
function removeChildFromContainer(container, child) {
|
|
(9 === container.nodeType ? container.body : "HTML" === container.nodeName ? container.ownerDocument.body : container).removeChild(child);
|
|
}
|
|
function clearHydrationBoundary(parentInstance, hydrationInstance) {
|
|
var node2 = hydrationInstance, depth = 0;
|
|
do {
|
|
var nextNode = node2.nextSibling;
|
|
parentInstance.removeChild(node2);
|
|
if (nextNode && 8 === nextNode.nodeType)
|
|
if (node2 = nextNode.data, node2 === SUSPENSE_END_DATA || node2 === ACTIVITY_END_DATA) {
|
|
if (0 === depth) {
|
|
parentInstance.removeChild(nextNode);
|
|
retryIfBlockedOn(hydrationInstance);
|
|
return;
|
|
}
|
|
depth--;
|
|
} else if (node2 === SUSPENSE_START_DATA || node2 === SUSPENSE_PENDING_START_DATA || node2 === SUSPENSE_QUEUED_START_DATA || node2 === SUSPENSE_FALLBACK_START_DATA || node2 === ACTIVITY_START_DATA)
|
|
depth++;
|
|
else if (node2 === PREAMBLE_CONTRIBUTION_HTML)
|
|
releaseSingletonInstance(
|
|
parentInstance.ownerDocument.documentElement
|
|
);
|
|
else if (node2 === PREAMBLE_CONTRIBUTION_HEAD) {
|
|
node2 = parentInstance.ownerDocument.head;
|
|
releaseSingletonInstance(node2);
|
|
for (var node$jscomp$0 = node2.firstChild; node$jscomp$0; ) {
|
|
var nextNode$jscomp$0 = node$jscomp$0.nextSibling, nodeName = node$jscomp$0.nodeName;
|
|
node$jscomp$0[internalHoistableMarker] || "SCRIPT" === nodeName || "STYLE" === nodeName || "LINK" === nodeName && "stylesheet" === node$jscomp$0.rel.toLowerCase() || node2.removeChild(node$jscomp$0);
|
|
node$jscomp$0 = nextNode$jscomp$0;
|
|
}
|
|
} else
|
|
node2 === PREAMBLE_CONTRIBUTION_BODY && releaseSingletonInstance(parentInstance.ownerDocument.body);
|
|
node2 = nextNode;
|
|
} while (node2);
|
|
retryIfBlockedOn(hydrationInstance);
|
|
}
|
|
function hideOrUnhideDehydratedBoundary(suspenseInstance, isHidden) {
|
|
var node2 = suspenseInstance;
|
|
suspenseInstance = 0;
|
|
do {
|
|
var nextNode = node2.nextSibling;
|
|
1 === node2.nodeType ? isHidden ? (node2._stashedDisplay = node2.style.display, node2.style.display = "none") : (node2.style.display = node2._stashedDisplay || "", "" === node2.getAttribute("style") && node2.removeAttribute("style")) : 3 === node2.nodeType && (isHidden ? (node2._stashedText = node2.nodeValue, node2.nodeValue = "") : node2.nodeValue = node2._stashedText || "");
|
|
if (nextNode && 8 === nextNode.nodeType)
|
|
if (node2 = nextNode.data, node2 === SUSPENSE_END_DATA)
|
|
if (0 === suspenseInstance) break;
|
|
else suspenseInstance--;
|
|
else
|
|
node2 !== SUSPENSE_START_DATA && node2 !== SUSPENSE_PENDING_START_DATA && node2 !== SUSPENSE_QUEUED_START_DATA && node2 !== SUSPENSE_FALLBACK_START_DATA || suspenseInstance++;
|
|
node2 = nextNode;
|
|
} while (node2);
|
|
}
|
|
function hideDehydratedBoundary(suspenseInstance) {
|
|
hideOrUnhideDehydratedBoundary(suspenseInstance, true);
|
|
}
|
|
function hideInstance(instance) {
|
|
instance = instance.style;
|
|
"function" === typeof instance.setProperty ? instance.setProperty("display", "none", "important") : instance.display = "none";
|
|
}
|
|
function hideTextInstance(textInstance) {
|
|
textInstance.nodeValue = "";
|
|
}
|
|
function unhideDehydratedBoundary(dehydratedInstance) {
|
|
hideOrUnhideDehydratedBoundary(dehydratedInstance, false);
|
|
}
|
|
function unhideInstance(instance, props) {
|
|
props = props[STYLE];
|
|
props = void 0 !== props && null !== props && props.hasOwnProperty("display") ? props.display : null;
|
|
instance.style.display = null == props || "boolean" === typeof props ? "" : ("" + props).trim();
|
|
}
|
|
function unhideTextInstance(textInstance, text) {
|
|
textInstance.nodeValue = text;
|
|
}
|
|
function clearContainerSparingly(container) {
|
|
var nextNode = container.firstChild;
|
|
nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling);
|
|
for (; nextNode; ) {
|
|
var node2 = nextNode;
|
|
nextNode = nextNode.nextSibling;
|
|
switch (node2.nodeName) {
|
|
case "HTML":
|
|
case "HEAD":
|
|
case "BODY":
|
|
clearContainerSparingly(node2);
|
|
detachDeletedInstance(node2);
|
|
continue;
|
|
case "SCRIPT":
|
|
case "STYLE":
|
|
continue;
|
|
case "LINK":
|
|
if ("stylesheet" === node2.rel.toLowerCase()) continue;
|
|
}
|
|
container.removeChild(node2);
|
|
}
|
|
}
|
|
function canHydrateInstance(instance, type, props, inRootOrSingleton) {
|
|
for (; 1 === instance.nodeType; ) {
|
|
var anyProps = props;
|
|
if (instance.nodeName.toLowerCase() !== type.toLowerCase()) {
|
|
if (!inRootOrSingleton && ("INPUT" !== instance.nodeName || "hidden" !== instance.type))
|
|
break;
|
|
} else if (!inRootOrSingleton)
|
|
if ("input" === type && "hidden" === instance.type) {
|
|
checkAttributeStringCoercion(anyProps.name, "name");
|
|
var name = null == anyProps.name ? null : "" + anyProps.name;
|
|
if ("hidden" === anyProps.type && instance.getAttribute("name") === name)
|
|
return instance;
|
|
} else return instance;
|
|
else if (!instance[internalHoistableMarker])
|
|
switch (type) {
|
|
case "meta":
|
|
if (!instance.hasAttribute("itemprop")) break;
|
|
return instance;
|
|
case "link":
|
|
name = instance.getAttribute("rel");
|
|
if ("stylesheet" === name && instance.hasAttribute("data-precedence"))
|
|
break;
|
|
else if (name !== anyProps.rel || instance.getAttribute("href") !== (null == anyProps.href || "" === anyProps.href ? null : anyProps.href) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin) || instance.getAttribute("title") !== (null == anyProps.title ? null : anyProps.title))
|
|
break;
|
|
return instance;
|
|
case "style":
|
|
if (instance.hasAttribute("data-precedence")) break;
|
|
return instance;
|
|
case "script":
|
|
name = instance.getAttribute("src");
|
|
if ((name !== (null == anyProps.src ? null : anyProps.src) || instance.getAttribute("type") !== (null == anyProps.type ? null : anyProps.type) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin)) && name && instance.hasAttribute("async") && !instance.hasAttribute("itemprop"))
|
|
break;
|
|
return instance;
|
|
default:
|
|
return instance;
|
|
}
|
|
instance = getNextHydratable(instance.nextSibling);
|
|
if (null === instance) break;
|
|
}
|
|
return null;
|
|
}
|
|
function canHydrateTextInstance(instance, text, inRootOrSingleton) {
|
|
if ("" === text) return null;
|
|
for (; 3 !== instance.nodeType; ) {
|
|
if ((1 !== instance.nodeType || "INPUT" !== instance.nodeName || "hidden" !== instance.type) && !inRootOrSingleton)
|
|
return null;
|
|
instance = getNextHydratable(instance.nextSibling);
|
|
if (null === instance) return null;
|
|
}
|
|
return instance;
|
|
}
|
|
function canHydrateHydrationBoundary(instance, inRootOrSingleton) {
|
|
for (; 8 !== instance.nodeType; ) {
|
|
if ((1 !== instance.nodeType || "INPUT" !== instance.nodeName || "hidden" !== instance.type) && !inRootOrSingleton)
|
|
return null;
|
|
instance = getNextHydratable(instance.nextSibling);
|
|
if (null === instance) return null;
|
|
}
|
|
return instance;
|
|
}
|
|
function isSuspenseInstancePending(instance) {
|
|
return instance.data === SUSPENSE_PENDING_START_DATA || instance.data === SUSPENSE_QUEUED_START_DATA;
|
|
}
|
|
function isSuspenseInstanceFallback(instance) {
|
|
return instance.data === SUSPENSE_FALLBACK_START_DATA || instance.data === SUSPENSE_PENDING_START_DATA && instance.ownerDocument.readyState !== DOCUMENT_READY_STATE_LOADING;
|
|
}
|
|
function registerSuspenseInstanceRetry(instance, callback) {
|
|
var ownerDocument = instance.ownerDocument;
|
|
if (instance.data === SUSPENSE_QUEUED_START_DATA)
|
|
instance._reactRetry = callback;
|
|
else if (instance.data !== SUSPENSE_PENDING_START_DATA || ownerDocument.readyState !== DOCUMENT_READY_STATE_LOADING)
|
|
callback();
|
|
else {
|
|
var listener = function() {
|
|
callback();
|
|
ownerDocument.removeEventListener("DOMContentLoaded", listener);
|
|
};
|
|
ownerDocument.addEventListener("DOMContentLoaded", listener);
|
|
instance._reactRetry = listener;
|
|
}
|
|
}
|
|
function getNextHydratable(node2) {
|
|
for (; null != node2; node2 = node2.nextSibling) {
|
|
var nodeType = node2.nodeType;
|
|
if (1 === nodeType || 3 === nodeType) break;
|
|
if (8 === nodeType) {
|
|
nodeType = node2.data;
|
|
if (nodeType === SUSPENSE_START_DATA || nodeType === SUSPENSE_FALLBACK_START_DATA || nodeType === SUSPENSE_PENDING_START_DATA || nodeType === SUSPENSE_QUEUED_START_DATA || nodeType === ACTIVITY_START_DATA || nodeType === FORM_STATE_IS_MATCHING || nodeType === FORM_STATE_IS_NOT_MATCHING)
|
|
break;
|
|
if (nodeType === SUSPENSE_END_DATA || nodeType === ACTIVITY_END_DATA)
|
|
return null;
|
|
}
|
|
}
|
|
return node2;
|
|
}
|
|
function describeHydratableInstanceForDevWarnings(instance) {
|
|
if (1 === instance.nodeType) {
|
|
for (var JSCompiler_temp_const = instance.nodeName.toLowerCase(), serverDifferences = {}, attributes = instance.attributes, i = 0; i < attributes.length; i++) {
|
|
var attr = attributes[i];
|
|
serverDifferences[getPropNameFromAttributeName(attr.name)] = "style" === attr.name.toLowerCase() ? getStylesObjectFromElement(instance) : attr.value;
|
|
}
|
|
return { type: JSCompiler_temp_const, props: serverDifferences };
|
|
}
|
|
return 8 === instance.nodeType ? instance.data === ACTIVITY_START_DATA ? { type: "Activity", props: {} } : { type: "Suspense", props: {} } : instance.nodeValue;
|
|
}
|
|
function diffHydratedTextForDevWarnings(textInstance, text, parentProps) {
|
|
return null === parentProps || true !== parentProps[SUPPRESS_HYDRATION_WARNING] ? (textInstance.nodeValue === text ? textInstance = null : (text = normalizeMarkupForTextOrAttribute(text), textInstance = normalizeMarkupForTextOrAttribute(textInstance.nodeValue) === text ? null : textInstance.nodeValue), textInstance) : null;
|
|
}
|
|
function getNextHydratableInstanceAfterHydrationBoundary(hydrationInstance) {
|
|
hydrationInstance = hydrationInstance.nextSibling;
|
|
for (var depth = 0; hydrationInstance; ) {
|
|
if (8 === hydrationInstance.nodeType) {
|
|
var data = hydrationInstance.data;
|
|
if (data === SUSPENSE_END_DATA || data === ACTIVITY_END_DATA) {
|
|
if (0 === depth)
|
|
return getNextHydratable(hydrationInstance.nextSibling);
|
|
depth--;
|
|
} else
|
|
data !== SUSPENSE_START_DATA && data !== SUSPENSE_FALLBACK_START_DATA && data !== SUSPENSE_PENDING_START_DATA && data !== SUSPENSE_QUEUED_START_DATA && data !== ACTIVITY_START_DATA || depth++;
|
|
}
|
|
hydrationInstance = hydrationInstance.nextSibling;
|
|
}
|
|
return null;
|
|
}
|
|
function getParentHydrationBoundary(targetInstance) {
|
|
targetInstance = targetInstance.previousSibling;
|
|
for (var depth = 0; targetInstance; ) {
|
|
if (8 === targetInstance.nodeType) {
|
|
var data = targetInstance.data;
|
|
if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA || data === SUSPENSE_QUEUED_START_DATA || data === ACTIVITY_START_DATA) {
|
|
if (0 === depth) return targetInstance;
|
|
depth--;
|
|
} else
|
|
data !== SUSPENSE_END_DATA && data !== ACTIVITY_END_DATA || depth++;
|
|
}
|
|
targetInstance = targetInstance.previousSibling;
|
|
}
|
|
return null;
|
|
}
|
|
function commitHydratedContainer(container) {
|
|
retryIfBlockedOn(container);
|
|
}
|
|
function commitHydratedActivityInstance(activityInstance) {
|
|
retryIfBlockedOn(activityInstance);
|
|
}
|
|
function commitHydratedSuspenseInstance(suspenseInstance) {
|
|
retryIfBlockedOn(suspenseInstance);
|
|
}
|
|
function resolveSingletonInstance(type, props, rootContainerInstance, hostContext, validateDOMNestingDev) {
|
|
validateDOMNestingDev && validateDOMNesting(type, hostContext.ancestorInfo);
|
|
props = getOwnerDocumentFromRootContainer(rootContainerInstance);
|
|
switch (type) {
|
|
case "html":
|
|
type = props.documentElement;
|
|
if (!type)
|
|
throw Error(
|
|
"React expected an <html> element (document.documentElement) to exist in the Document but one was not found. React never removes the documentElement for any Document it renders into so the cause is likely in some other script running on this page."
|
|
);
|
|
return type;
|
|
case "head":
|
|
type = props.head;
|
|
if (!type)
|
|
throw Error(
|
|
"React expected a <head> element (document.head) to exist in the Document but one was not found. React never removes the head for any Document it renders into so the cause is likely in some other script running on this page."
|
|
);
|
|
return type;
|
|
case "body":
|
|
type = props.body;
|
|
if (!type)
|
|
throw Error(
|
|
"React expected a <body> element (document.body) to exist in the Document but one was not found. React never removes the body for any Document it renders into so the cause is likely in some other script running on this page."
|
|
);
|
|
return type;
|
|
default:
|
|
throw Error(
|
|
"resolveSingletonInstance was called with an element type that is not supported. This is a bug in React."
|
|
);
|
|
}
|
|
}
|
|
function acquireSingletonInstance(type, props, instance, internalInstanceHandle) {
|
|
if (!instance[internalContainerInstanceKey] && getInstanceFromNode(instance)) {
|
|
var tagName = instance.tagName.toLowerCase();
|
|
console.error(
|
|
"You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.",
|
|
tagName,
|
|
tagName,
|
|
tagName
|
|
);
|
|
}
|
|
switch (type) {
|
|
case "html":
|
|
case "head":
|
|
case "body":
|
|
break;
|
|
default:
|
|
console.error(
|
|
"acquireSingletonInstance was called with an element type that is not supported. This is a bug in React."
|
|
);
|
|
}
|
|
for (tagName = instance.attributes; tagName.length; )
|
|
instance.removeAttributeNode(tagName[0]);
|
|
setInitialProperties(instance, type, props);
|
|
instance[internalInstanceKey] = internalInstanceHandle;
|
|
instance[internalPropsKey] = props;
|
|
}
|
|
function releaseSingletonInstance(instance) {
|
|
for (var attributes = instance.attributes; attributes.length; )
|
|
instance.removeAttributeNode(attributes[0]);
|
|
detachDeletedInstance(instance);
|
|
}
|
|
function getHoistableRoot(container) {
|
|
return "function" === typeof container.getRootNode ? container.getRootNode() : 9 === container.nodeType ? container : container.ownerDocument;
|
|
}
|
|
function preconnectAs(rel, href, crossOrigin) {
|
|
var ownerDocument = globalDocument;
|
|
if (ownerDocument && "string" === typeof href && href) {
|
|
var limitedEscapedHref = escapeSelectorAttributeValueInsideDoubleQuotes(href);
|
|
limitedEscapedHref = 'link[rel="' + rel + '"][href="' + limitedEscapedHref + '"]';
|
|
"string" === typeof crossOrigin && (limitedEscapedHref += '[crossorigin="' + crossOrigin + '"]');
|
|
preconnectsSet.has(limitedEscapedHref) || (preconnectsSet.add(limitedEscapedHref), rel = { rel, crossOrigin, href }, null === ownerDocument.querySelector(limitedEscapedHref) && (href = ownerDocument.createElement("link"), setInitialProperties(href, "link", rel), markNodeAsHoistable(href), ownerDocument.head.appendChild(href)));
|
|
}
|
|
}
|
|
function getResource(type, currentProps, pendingProps, currentResource) {
|
|
var resourceRoot = (resourceRoot = rootInstanceStackCursor.current) ? getHoistableRoot(resourceRoot) : null;
|
|
if (!resourceRoot)
|
|
throw Error(
|
|
'"resourceRoot" was expected to exist. This is a bug in React.'
|
|
);
|
|
switch (type) {
|
|
case "meta":
|
|
case "title":
|
|
return null;
|
|
case "style":
|
|
return "string" === typeof pendingProps.precedence && "string" === typeof pendingProps.href ? (pendingProps = getStyleKey(pendingProps.href), currentProps = getResourcesFromRoot(resourceRoot).hoistableStyles, currentResource = currentProps.get(pendingProps), currentResource || (currentResource = {
|
|
type: "style",
|
|
instance: null,
|
|
count: 0,
|
|
state: null
|
|
}, currentProps.set(pendingProps, currentResource)), currentResource) : { type: "void", instance: null, count: 0, state: null };
|
|
case "link":
|
|
if ("stylesheet" === pendingProps.rel && "string" === typeof pendingProps.href && "string" === typeof pendingProps.precedence) {
|
|
type = getStyleKey(pendingProps.href);
|
|
var _styles = getResourcesFromRoot(resourceRoot).hoistableStyles, _resource = _styles.get(type);
|
|
if (!_resource && (resourceRoot = resourceRoot.ownerDocument || resourceRoot, _resource = {
|
|
type: "stylesheet",
|
|
instance: null,
|
|
count: 0,
|
|
state: { loading: NotLoaded, preload: null }
|
|
}, _styles.set(type, _resource), (_styles = resourceRoot.querySelector(
|
|
getStylesheetSelectorFromKey(type)
|
|
)) && !_styles._p && (_resource.instance = _styles, _resource.state.loading = Loaded | Inserted), !preloadPropsMap.has(type))) {
|
|
var preloadProps = {
|
|
rel: "preload",
|
|
as: "style",
|
|
href: pendingProps.href,
|
|
crossOrigin: pendingProps.crossOrigin,
|
|
integrity: pendingProps.integrity,
|
|
media: pendingProps.media,
|
|
hrefLang: pendingProps.hrefLang,
|
|
referrerPolicy: pendingProps.referrerPolicy
|
|
};
|
|
preloadPropsMap.set(type, preloadProps);
|
|
_styles || preloadStylesheet(
|
|
resourceRoot,
|
|
type,
|
|
preloadProps,
|
|
_resource.state
|
|
);
|
|
}
|
|
if (currentProps && null === currentResource)
|
|
throw pendingProps = "\n\n - " + describeLinkForResourceErrorDEV(currentProps) + "\n + " + describeLinkForResourceErrorDEV(pendingProps), Error(
|
|
"Expected <link> not to update to be updated to a stylesheet with precedence. Check the `rel`, `href`, and `precedence` props of this component. Alternatively, check whether two different <link> components render in the same slot or share the same key." + pendingProps
|
|
);
|
|
return _resource;
|
|
}
|
|
if (currentProps && null !== currentResource)
|
|
throw pendingProps = "\n\n - " + describeLinkForResourceErrorDEV(currentProps) + "\n + " + describeLinkForResourceErrorDEV(pendingProps), Error(
|
|
"Expected stylesheet with precedence to not be updated to a different kind of <link>. Check the `rel`, `href`, and `precedence` props of this component. Alternatively, check whether two different <link> components render in the same slot or share the same key." + pendingProps
|
|
);
|
|
return null;
|
|
case "script":
|
|
return currentProps = pendingProps.async, pendingProps = pendingProps.src, "string" === typeof pendingProps && currentProps && "function" !== typeof currentProps && "symbol" !== typeof currentProps ? (pendingProps = getScriptKey(pendingProps), currentProps = getResourcesFromRoot(resourceRoot).hoistableScripts, currentResource = currentProps.get(pendingProps), currentResource || (currentResource = {
|
|
type: "script",
|
|
instance: null,
|
|
count: 0,
|
|
state: null
|
|
}, currentProps.set(pendingProps, currentResource)), currentResource) : { type: "void", instance: null, count: 0, state: null };
|
|
default:
|
|
throw Error(
|
|
'getResource encountered a type it did not expect: "' + type + '". this is a bug in React.'
|
|
);
|
|
}
|
|
}
|
|
function describeLinkForResourceErrorDEV(props) {
|
|
var describedProps = 0, description = "<link";
|
|
"string" === typeof props.rel ? (describedProps++, description += ' rel="' + props.rel + '"') : hasOwnProperty.call(props, "rel") && (describedProps++, description += ' rel="' + (null === props.rel ? "null" : "invalid type " + typeof props.rel) + '"');
|
|
"string" === typeof props.href ? (describedProps++, description += ' href="' + props.href + '"') : hasOwnProperty.call(props, "href") && (describedProps++, description += ' href="' + (null === props.href ? "null" : "invalid type " + typeof props.href) + '"');
|
|
"string" === typeof props.precedence ? (describedProps++, description += ' precedence="' + props.precedence + '"') : hasOwnProperty.call(props, "precedence") && (describedProps++, description += " precedence={" + (null === props.precedence ? "null" : "invalid type " + typeof props.precedence) + "}");
|
|
Object.getOwnPropertyNames(props).length > describedProps && (description += " ...");
|
|
return description + " />";
|
|
}
|
|
function getStyleKey(href) {
|
|
return 'href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"';
|
|
}
|
|
function getStylesheetSelectorFromKey(key) {
|
|
return 'link[rel="stylesheet"][' + key + "]";
|
|
}
|
|
function stylesheetPropsFromRawProps(rawProps) {
|
|
return assign2({}, rawProps, {
|
|
"data-precedence": rawProps.precedence,
|
|
precedence: null
|
|
});
|
|
}
|
|
function preloadStylesheet(ownerDocument, key, preloadProps, state) {
|
|
ownerDocument.querySelector(
|
|
'link[rel="preload"][as="style"][' + key + "]"
|
|
) ? state.loading = Loaded : (key = ownerDocument.createElement("link"), state.preload = key, key.addEventListener("load", function() {
|
|
return state.loading |= Loaded;
|
|
}), key.addEventListener("error", function() {
|
|
return state.loading |= Errored;
|
|
}), setInitialProperties(key, "link", preloadProps), markNodeAsHoistable(key), ownerDocument.head.appendChild(key));
|
|
}
|
|
function getScriptKey(src) {
|
|
return '[src="' + escapeSelectorAttributeValueInsideDoubleQuotes(src) + '"]';
|
|
}
|
|
function getScriptSelectorFromKey(key) {
|
|
return "script[async]" + key;
|
|
}
|
|
function acquireResource(hoistableRoot, resource, props) {
|
|
resource.count++;
|
|
if (null === resource.instance)
|
|
switch (resource.type) {
|
|
case "style":
|
|
var instance = hoistableRoot.querySelector(
|
|
'style[data-href~="' + escapeSelectorAttributeValueInsideDoubleQuotes(props.href) + '"]'
|
|
);
|
|
if (instance)
|
|
return resource.instance = instance, markNodeAsHoistable(instance), instance;
|
|
var styleProps = assign2({}, props, {
|
|
"data-href": props.href,
|
|
"data-precedence": props.precedence,
|
|
href: null,
|
|
precedence: null
|
|
});
|
|
instance = (hoistableRoot.ownerDocument || hoistableRoot).createElement("style");
|
|
markNodeAsHoistable(instance);
|
|
setInitialProperties(instance, "style", styleProps);
|
|
insertStylesheet(instance, props.precedence, hoistableRoot);
|
|
return resource.instance = instance;
|
|
case "stylesheet":
|
|
styleProps = getStyleKey(props.href);
|
|
var _instance = hoistableRoot.querySelector(
|
|
getStylesheetSelectorFromKey(styleProps)
|
|
);
|
|
if (_instance)
|
|
return resource.state.loading |= Inserted, resource.instance = _instance, markNodeAsHoistable(_instance), _instance;
|
|
instance = stylesheetPropsFromRawProps(props);
|
|
(styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps);
|
|
_instance = (hoistableRoot.ownerDocument || hoistableRoot).createElement("link");
|
|
markNodeAsHoistable(_instance);
|
|
var linkInstance = _instance;
|
|
linkInstance._p = new Promise(function(resolve, reject) {
|
|
linkInstance.onload = resolve;
|
|
linkInstance.onerror = reject;
|
|
});
|
|
setInitialProperties(_instance, "link", instance);
|
|
resource.state.loading |= Inserted;
|
|
insertStylesheet(_instance, props.precedence, hoistableRoot);
|
|
return resource.instance = _instance;
|
|
case "script":
|
|
_instance = getScriptKey(props.src);
|
|
if (styleProps = hoistableRoot.querySelector(
|
|
getScriptSelectorFromKey(_instance)
|
|
))
|
|
return resource.instance = styleProps, markNodeAsHoistable(styleProps), styleProps;
|
|
instance = props;
|
|
if (styleProps = preloadPropsMap.get(_instance))
|
|
instance = assign2({}, props), adoptPreloadPropsForScript(instance, styleProps);
|
|
hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
|
|
styleProps = hoistableRoot.createElement("script");
|
|
markNodeAsHoistable(styleProps);
|
|
setInitialProperties(styleProps, "link", instance);
|
|
hoistableRoot.head.appendChild(styleProps);
|
|
return resource.instance = styleProps;
|
|
case "void":
|
|
return null;
|
|
default:
|
|
throw Error(
|
|
'acquireResource encountered a resource type it did not expect: "' + resource.type + '". this is a bug in React.'
|
|
);
|
|
}
|
|
else
|
|
"stylesheet" === resource.type && (resource.state.loading & Inserted) === NotLoaded && (instance = resource.instance, resource.state.loading |= Inserted, insertStylesheet(instance, props.precedence, hoistableRoot));
|
|
return resource.instance;
|
|
}
|
|
function insertStylesheet(instance, precedence, root2) {
|
|
for (var nodes = root2.querySelectorAll(
|
|
'link[rel="stylesheet"][data-precedence],style[data-precedence]'
|
|
), last = nodes.length ? nodes[nodes.length - 1] : null, prior = last, i = 0; i < nodes.length; i++) {
|
|
var node2 = nodes[i];
|
|
if (node2.dataset.precedence === precedence) prior = node2;
|
|
else if (prior !== last) break;
|
|
}
|
|
prior ? prior.parentNode.insertBefore(instance, prior.nextSibling) : (precedence = 9 === root2.nodeType ? root2.head : root2, precedence.insertBefore(instance, precedence.firstChild));
|
|
}
|
|
function adoptPreloadPropsForStylesheet(stylesheetProps, preloadProps) {
|
|
null == stylesheetProps.crossOrigin && (stylesheetProps.crossOrigin = preloadProps.crossOrigin);
|
|
null == stylesheetProps.referrerPolicy && (stylesheetProps.referrerPolicy = preloadProps.referrerPolicy);
|
|
null == stylesheetProps.title && (stylesheetProps.title = preloadProps.title);
|
|
}
|
|
function adoptPreloadPropsForScript(scriptProps, preloadProps) {
|
|
null == scriptProps.crossOrigin && (scriptProps.crossOrigin = preloadProps.crossOrigin);
|
|
null == scriptProps.referrerPolicy && (scriptProps.referrerPolicy = preloadProps.referrerPolicy);
|
|
null == scriptProps.integrity && (scriptProps.integrity = preloadProps.integrity);
|
|
}
|
|
function getHydratableHoistableCache(type, keyAttribute, ownerDocument) {
|
|
if (null === tagCaches) {
|
|
var cache = /* @__PURE__ */ new Map();
|
|
var caches = tagCaches = /* @__PURE__ */ new Map();
|
|
caches.set(ownerDocument, cache);
|
|
} else
|
|
caches = tagCaches, cache = caches.get(ownerDocument), cache || (cache = /* @__PURE__ */ new Map(), caches.set(ownerDocument, cache));
|
|
if (cache.has(type)) return cache;
|
|
cache.set(type, null);
|
|
ownerDocument = ownerDocument.getElementsByTagName(type);
|
|
for (caches = 0; caches < ownerDocument.length; caches++) {
|
|
var node2 = ownerDocument[caches];
|
|
if (!(node2[internalHoistableMarker] || node2[internalInstanceKey] || "link" === type && "stylesheet" === node2.getAttribute("rel")) && node2.namespaceURI !== SVG_NAMESPACE) {
|
|
var nodeKey = node2.getAttribute(keyAttribute) || "";
|
|
nodeKey = type + nodeKey;
|
|
var existing = cache.get(nodeKey);
|
|
existing ? existing.push(node2) : cache.set(nodeKey, [node2]);
|
|
}
|
|
}
|
|
return cache;
|
|
}
|
|
function mountHoistable(hoistableRoot, type, instance) {
|
|
hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
|
|
hoistableRoot.head.insertBefore(
|
|
instance,
|
|
"title" === type ? hoistableRoot.querySelector("head > title") : null
|
|
);
|
|
}
|
|
function isHostHoistableType(type, props, hostContext) {
|
|
var outsideHostContainerContext = !hostContext.ancestorInfo.containerTagInScope;
|
|
if (hostContext.context === HostContextNamespaceSvg || null != props.itemProp)
|
|
return !outsideHostContainerContext || null == props.itemProp || "meta" !== type && "title" !== type && "style" !== type && "link" !== type && "script" !== type || console.error(
|
|
"Cannot render a <%s> outside the main document if it has an `itemProp` prop. `itemProp` suggests the tag belongs to an `itemScope` which can appear anywhere in the DOM. If you were intending for React to hoist this <%s> remove the `itemProp` prop. Otherwise, try moving this tag into the <head> or <body> of the Document.",
|
|
type,
|
|
type
|
|
), false;
|
|
switch (type) {
|
|
case "meta":
|
|
case "title":
|
|
return true;
|
|
case "style":
|
|
if ("string" !== typeof props.precedence || "string" !== typeof props.href || "" === props.href) {
|
|
outsideHostContainerContext && console.error(
|
|
'Cannot render a <style> outside the main document without knowing its precedence and a unique href key. React can hoist and deduplicate <style> tags if you provide a `precedence` prop along with an `href` prop that does not conflict with the `href` values used in any other hoisted <style> or <link rel="stylesheet" ...> tags. Note that hoisting <style> tags is considered an advanced feature that most will not use directly. Consider moving the <style> tag to the <head> or consider adding a `precedence="default"` and `href="some unique resource identifier"`.'
|
|
);
|
|
break;
|
|
}
|
|
return true;
|
|
case "link":
|
|
if ("string" !== typeof props.rel || "string" !== typeof props.href || "" === props.href || props.onLoad || props.onError) {
|
|
if ("stylesheet" === props.rel && "string" === typeof props.precedence) {
|
|
type = props.href;
|
|
var onError = props.onError, disabled = props.disabled;
|
|
hostContext = [];
|
|
props.onLoad && hostContext.push("`onLoad`");
|
|
onError && hostContext.push("`onError`");
|
|
null != disabled && hostContext.push("`disabled`");
|
|
onError = propNamesListJoin(hostContext, "and");
|
|
onError += 1 === hostContext.length ? " prop" : " props";
|
|
disabled = 1 === hostContext.length ? "an " + onError : "the " + onError;
|
|
hostContext.length && console.error(
|
|
'React encountered a <link rel="stylesheet" href="%s" ... /> with a `precedence` prop that also included %s. The presence of loading and error handlers indicates an intent to manage the stylesheet loading state from your from your Component code and React will not hoist or deduplicate this stylesheet. If your intent was to have React hoist and deduplciate this stylesheet using the `precedence` prop remove the %s, otherwise remove the `precedence` prop.',
|
|
type,
|
|
disabled,
|
|
onError
|
|
);
|
|
}
|
|
outsideHostContainerContext && ("string" !== typeof props.rel || "string" !== typeof props.href || "" === props.href ? console.error(
|
|
"Cannot render a <link> outside the main document without a `rel` and `href` prop. Try adding a `rel` and/or `href` prop to this <link> or moving the link into the <head> tag"
|
|
) : (props.onError || props.onLoad) && console.error(
|
|
"Cannot render a <link> with onLoad or onError listeners outside the main document. Try removing onLoad={...} and onError={...} or moving it into the root <head> tag or somewhere in the <body>."
|
|
));
|
|
break;
|
|
}
|
|
switch (props.rel) {
|
|
case "stylesheet":
|
|
return type = props.precedence, props = props.disabled, "string" !== typeof type && outsideHostContainerContext && console.error(
|
|
'Cannot render a <link rel="stylesheet" /> outside the main document without knowing its precedence. Consider adding precedence="default" or moving it into the root <head> tag.'
|
|
), "string" === typeof type && null == props;
|
|
default:
|
|
return true;
|
|
}
|
|
case "script":
|
|
type = props.async && "function" !== typeof props.async && "symbol" !== typeof props.async;
|
|
if (!type || props.onLoad || props.onError || !props.src || "string" !== typeof props.src) {
|
|
outsideHostContainerContext && (type ? props.onLoad || props.onError ? console.error(
|
|
"Cannot render a <script> with onLoad or onError listeners outside the main document. Try removing onLoad={...} and onError={...} or moving it into the root <head> tag or somewhere in the <body>."
|
|
) : console.error(
|
|
"Cannot render a <script> outside the main document without `async={true}` and a non-empty `src` prop. Ensure there is a valid `src` and either make the script async or move it into the root <head> tag or somewhere in the <body>."
|
|
) : console.error(
|
|
'Cannot render a sync or defer <script> outside the main document without knowing its order. Try adding async="" or moving it into the root <head> tag.'
|
|
));
|
|
break;
|
|
}
|
|
return true;
|
|
case "noscript":
|
|
case "template":
|
|
outsideHostContainerContext && console.error(
|
|
"Cannot render <%s> outside the main document. Try moving it into the root <head> tag.",
|
|
type
|
|
);
|
|
}
|
|
return false;
|
|
}
|
|
function preloadResource(resource) {
|
|
return "stylesheet" === resource.type && (resource.state.loading & Settled) === NotLoaded ? false : true;
|
|
}
|
|
function suspendResource(state, hoistableRoot, resource, props) {
|
|
if ("stylesheet" === resource.type && ("string" !== typeof props.media || false !== matchMedia(props.media).matches) && (resource.state.loading & Inserted) === NotLoaded) {
|
|
if (null === resource.instance) {
|
|
var key = getStyleKey(props.href), instance = hoistableRoot.querySelector(
|
|
getStylesheetSelectorFromKey(key)
|
|
);
|
|
if (instance) {
|
|
hoistableRoot = instance._p;
|
|
null !== hoistableRoot && "object" === typeof hoistableRoot && "function" === typeof hoistableRoot.then && (state.count++, state = onUnsuspend.bind(state), hoistableRoot.then(state, state));
|
|
resource.state.loading |= Inserted;
|
|
resource.instance = instance;
|
|
markNodeAsHoistable(instance);
|
|
return;
|
|
}
|
|
instance = hoistableRoot.ownerDocument || hoistableRoot;
|
|
props = stylesheetPropsFromRawProps(props);
|
|
(key = preloadPropsMap.get(key)) && adoptPreloadPropsForStylesheet(props, key);
|
|
instance = instance.createElement("link");
|
|
markNodeAsHoistable(instance);
|
|
var linkInstance = instance;
|
|
linkInstance._p = new Promise(function(resolve, reject) {
|
|
linkInstance.onload = resolve;
|
|
linkInstance.onerror = reject;
|
|
});
|
|
setInitialProperties(instance, "link", props);
|
|
resource.instance = instance;
|
|
}
|
|
null === state.stylesheets && (state.stylesheets = /* @__PURE__ */ new Map());
|
|
state.stylesheets.set(resource, hoistableRoot);
|
|
(hoistableRoot = resource.state.preload) && (resource.state.loading & Settled) === NotLoaded && (state.count++, resource = onUnsuspend.bind(state), hoistableRoot.addEventListener("load", resource), hoistableRoot.addEventListener("error", resource));
|
|
}
|
|
}
|
|
function waitForCommitToBeReady(state, timeoutOffset) {
|
|
state.stylesheets && 0 === state.count && insertSuspendedStylesheets(state, state.stylesheets);
|
|
return 0 < state.count || 0 < state.imgCount ? function(commit) {
|
|
var stylesheetTimer = setTimeout(function() {
|
|
state.stylesheets && insertSuspendedStylesheets(state, state.stylesheets);
|
|
if (state.unsuspend) {
|
|
var unsuspend = state.unsuspend;
|
|
state.unsuspend = null;
|
|
unsuspend();
|
|
}
|
|
}, SUSPENSEY_STYLESHEET_TIMEOUT + timeoutOffset);
|
|
0 < state.imgBytes && 0 === estimatedBytesWithinLimit && (estimatedBytesWithinLimit = 125 * estimateBandwidth() * SUSPENSEY_IMAGE_TIME_ESTIMATE);
|
|
var imgTimer = setTimeout(
|
|
function() {
|
|
state.waitingForImages = false;
|
|
if (0 === state.count && (state.stylesheets && insertSuspendedStylesheets(state, state.stylesheets), state.unsuspend)) {
|
|
var unsuspend = state.unsuspend;
|
|
state.unsuspend = null;
|
|
unsuspend();
|
|
}
|
|
},
|
|
(state.imgBytes > estimatedBytesWithinLimit ? 50 : SUSPENSEY_IMAGE_TIMEOUT) + timeoutOffset
|
|
);
|
|
state.unsuspend = commit;
|
|
return function() {
|
|
state.unsuspend = null;
|
|
clearTimeout(stylesheetTimer);
|
|
clearTimeout(imgTimer);
|
|
};
|
|
} : null;
|
|
}
|
|
function onUnsuspend() {
|
|
this.count--;
|
|
if (0 === this.count && (0 === this.imgCount || !this.waitingForImages)) {
|
|
if (this.stylesheets)
|
|
insertSuspendedStylesheets(this, this.stylesheets);
|
|
else if (this.unsuspend) {
|
|
var unsuspend = this.unsuspend;
|
|
this.unsuspend = null;
|
|
unsuspend();
|
|
}
|
|
}
|
|
}
|
|
function insertSuspendedStylesheets(state, resources) {
|
|
state.stylesheets = null;
|
|
null !== state.unsuspend && (state.count++, precedencesByRoot = /* @__PURE__ */ new Map(), resources.forEach(insertStylesheetIntoRoot, state), precedencesByRoot = null, onUnsuspend.call(state));
|
|
}
|
|
function insertStylesheetIntoRoot(root2, resource) {
|
|
if (!(resource.state.loading & Inserted)) {
|
|
var precedences = precedencesByRoot.get(root2);
|
|
if (precedences) var last = precedences.get(LAST_PRECEDENCE);
|
|
else {
|
|
precedences = /* @__PURE__ */ new Map();
|
|
precedencesByRoot.set(root2, precedences);
|
|
for (var nodes = root2.querySelectorAll(
|
|
"link[data-precedence],style[data-precedence]"
|
|
), i = 0; i < nodes.length; i++) {
|
|
var node2 = nodes[i];
|
|
if ("LINK" === node2.nodeName || "not all" !== node2.getAttribute("media"))
|
|
precedences.set(node2.dataset.precedence, node2), last = node2;
|
|
}
|
|
last && precedences.set(LAST_PRECEDENCE, last);
|
|
}
|
|
nodes = resource.instance;
|
|
node2 = nodes.getAttribute("data-precedence");
|
|
i = precedences.get(node2) || last;
|
|
i === last && precedences.set(LAST_PRECEDENCE, nodes);
|
|
precedences.set(node2, nodes);
|
|
this.count++;
|
|
last = onUnsuspend.bind(this);
|
|
nodes.addEventListener("load", last);
|
|
nodes.addEventListener("error", last);
|
|
i ? i.parentNode.insertBefore(nodes, i.nextSibling) : (root2 = 9 === root2.nodeType ? root2.head : root2, root2.insertBefore(nodes, root2.firstChild));
|
|
resource.state.loading |= Inserted;
|
|
}
|
|
}
|
|
function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, onDefaultTransitionIndicator, formState) {
|
|
this.tag = 1;
|
|
this.containerInfo = containerInfo;
|
|
this.pingCache = this.current = this.pendingChildren = null;
|
|
this.timeoutHandle = noTimeout;
|
|
this.callbackNode = this.next = this.pendingContext = this.context = this.cancelPendingCommit = null;
|
|
this.callbackPriority = 0;
|
|
this.expirationTimes = createLaneMap(-1);
|
|
this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0;
|
|
this.entanglements = createLaneMap(0);
|
|
this.hiddenUpdates = createLaneMap(null);
|
|
this.identifierPrefix = identifierPrefix;
|
|
this.onUncaughtError = onUncaughtError;
|
|
this.onCaughtError = onCaughtError;
|
|
this.onRecoverableError = onRecoverableError;
|
|
this.pooledCache = null;
|
|
this.pooledCacheLanes = 0;
|
|
this.formState = formState;
|
|
this.incompleteTransitions = /* @__PURE__ */ new Map();
|
|
this.passiveEffectDuration = this.effectDuration = -0;
|
|
this.memoizedUpdaters = /* @__PURE__ */ new Set();
|
|
containerInfo = this.pendingUpdatersLaneMap = [];
|
|
for (tag = 0; 31 > tag; tag++) containerInfo.push(/* @__PURE__ */ new Set());
|
|
this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()";
|
|
}
|
|
function createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, identifierPrefix, formState, onUncaughtError, onCaughtError, onRecoverableError, onDefaultTransitionIndicator) {
|
|
containerInfo = new FiberRootNode(
|
|
containerInfo,
|
|
tag,
|
|
hydrate,
|
|
identifierPrefix,
|
|
onUncaughtError,
|
|
onCaughtError,
|
|
onRecoverableError,
|
|
onDefaultTransitionIndicator,
|
|
formState
|
|
);
|
|
tag = ConcurrentMode;
|
|
true === isStrictMode && (tag |= StrictLegacyMode | StrictEffectsMode);
|
|
tag |= ProfileMode;
|
|
isStrictMode = createFiber(3, null, null, tag);
|
|
containerInfo.current = isStrictMode;
|
|
isStrictMode.stateNode = containerInfo;
|
|
tag = createCache3();
|
|
retainCache(tag);
|
|
containerInfo.pooledCache = tag;
|
|
retainCache(tag);
|
|
isStrictMode.memoizedState = {
|
|
element: initialChildren,
|
|
isDehydrated: hydrate,
|
|
cache: tag
|
|
};
|
|
initializeUpdateQueue(isStrictMode);
|
|
return containerInfo;
|
|
}
|
|
function getContextForSubtree(parentComponent) {
|
|
if (!parentComponent) return emptyContextObject;
|
|
parentComponent = emptyContextObject;
|
|
return parentComponent;
|
|
}
|
|
function updateContainerImpl(rootFiber, lane, element, container, parentComponent, callback) {
|
|
if (injectedHook && "function" === typeof injectedHook.onScheduleFiberRoot)
|
|
try {
|
|
injectedHook.onScheduleFiberRoot(rendererID, container, element);
|
|
} catch (err) {
|
|
hasLoggedError || (hasLoggedError = true, console.error(
|
|
"React instrumentation encountered an error: %o",
|
|
err
|
|
));
|
|
}
|
|
parentComponent = getContextForSubtree(parentComponent);
|
|
null === container.context ? container.context = parentComponent : container.pendingContext = parentComponent;
|
|
isRendering && null !== current && !didWarnAboutNestedUpdates && (didWarnAboutNestedUpdates = true, console.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\nCheck the render method of %s.",
|
|
getComponentNameFromFiber(current) || "Unknown"
|
|
));
|
|
container = createUpdate(lane);
|
|
container.payload = { element };
|
|
callback = void 0 === callback ? null : callback;
|
|
null !== callback && ("function" !== typeof callback && console.error(
|
|
"Expected the last optional `callback` argument to be a function. Instead received: %s.",
|
|
callback
|
|
), container.callback = callback);
|
|
element = enqueueUpdate(rootFiber, container, lane);
|
|
null !== element && (startUpdateTimerByLane(lane, "root.render()", null), scheduleUpdateOnFiber(element, rootFiber, lane), entangleTransitions(element, rootFiber, lane));
|
|
}
|
|
function markRetryLaneImpl(fiber, retryLane) {
|
|
fiber = fiber.memoizedState;
|
|
if (null !== fiber && null !== fiber.dehydrated) {
|
|
var a = fiber.retryLane;
|
|
fiber.retryLane = 0 !== a && a < retryLane ? a : retryLane;
|
|
}
|
|
}
|
|
function markRetryLaneIfNotHydrated(fiber, retryLane) {
|
|
markRetryLaneImpl(fiber, retryLane);
|
|
(fiber = fiber.alternate) && markRetryLaneImpl(fiber, retryLane);
|
|
}
|
|
function attemptContinuousHydration(fiber) {
|
|
if (13 === fiber.tag || 31 === fiber.tag) {
|
|
var root2 = enqueueConcurrentRenderForLane(fiber, 67108864);
|
|
null !== root2 && scheduleUpdateOnFiber(root2, fiber, 67108864);
|
|
markRetryLaneIfNotHydrated(fiber, 67108864);
|
|
}
|
|
}
|
|
function attemptHydrationAtCurrentPriority(fiber) {
|
|
if (13 === fiber.tag || 31 === fiber.tag) {
|
|
var lane = requestUpdateLane(fiber);
|
|
lane = getBumpedLaneForHydrationByLane(lane);
|
|
var root2 = enqueueConcurrentRenderForLane(fiber, lane);
|
|
null !== root2 && scheduleUpdateOnFiber(root2, fiber, lane);
|
|
markRetryLaneIfNotHydrated(fiber, lane);
|
|
}
|
|
}
|
|
function getCurrentFiberForDevTools() {
|
|
return current;
|
|
}
|
|
function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
|
|
var prevTransition = ReactSharedInternals.T;
|
|
ReactSharedInternals.T = null;
|
|
var previousPriority = ReactDOMSharedInternals.p;
|
|
try {
|
|
ReactDOMSharedInternals.p = DiscreteEventPriority, dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
|
|
} finally {
|
|
ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition;
|
|
}
|
|
}
|
|
function dispatchContinuousEvent(domEventName, eventSystemFlags, container, nativeEvent) {
|
|
var prevTransition = ReactSharedInternals.T;
|
|
ReactSharedInternals.T = null;
|
|
var previousPriority = ReactDOMSharedInternals.p;
|
|
try {
|
|
ReactDOMSharedInternals.p = ContinuousEventPriority, dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
|
|
} finally {
|
|
ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition;
|
|
}
|
|
}
|
|
function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
|
|
if (_enabled) {
|
|
var blockedOn = findInstanceBlockingEvent(nativeEvent);
|
|
if (null === blockedOn)
|
|
dispatchEventForPluginEventSystem(
|
|
domEventName,
|
|
eventSystemFlags,
|
|
nativeEvent,
|
|
return_targetInst,
|
|
targetContainer
|
|
), clearIfContinuousEvent(domEventName, nativeEvent);
|
|
else if (queueIfContinuousEvent(
|
|
blockedOn,
|
|
domEventName,
|
|
eventSystemFlags,
|
|
targetContainer,
|
|
nativeEvent
|
|
))
|
|
nativeEvent.stopPropagation();
|
|
else if (clearIfContinuousEvent(domEventName, nativeEvent), eventSystemFlags & 4 && -1 < discreteReplayableEvents.indexOf(domEventName)) {
|
|
for (; null !== blockedOn; ) {
|
|
var fiber = getInstanceFromNode(blockedOn);
|
|
if (null !== fiber)
|
|
switch (fiber.tag) {
|
|
case 3:
|
|
fiber = fiber.stateNode;
|
|
if (fiber.current.memoizedState.isDehydrated) {
|
|
var lanes = getHighestPriorityLanes(fiber.pendingLanes);
|
|
if (0 !== lanes) {
|
|
var root2 = fiber;
|
|
root2.pendingLanes |= 2;
|
|
for (root2.entangledLanes |= 2; lanes; ) {
|
|
var lane = 1 << 31 - clz32(lanes);
|
|
root2.entanglements[1] |= lane;
|
|
lanes &= ~lane;
|
|
}
|
|
ensureRootIsScheduled(fiber);
|
|
(executionContext & (RenderContext | CommitContext)) === NoContext && (workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS, flushSyncWorkAcrossRoots_impl(0, false));
|
|
}
|
|
}
|
|
break;
|
|
case 31:
|
|
case 13:
|
|
root2 = enqueueConcurrentRenderForLane(fiber, 2), null !== root2 && scheduleUpdateOnFiber(root2, fiber, 2), flushSyncWork$1(), markRetryLaneIfNotHydrated(fiber, 2);
|
|
}
|
|
fiber = findInstanceBlockingEvent(nativeEvent);
|
|
null === fiber && dispatchEventForPluginEventSystem(
|
|
domEventName,
|
|
eventSystemFlags,
|
|
nativeEvent,
|
|
return_targetInst,
|
|
targetContainer
|
|
);
|
|
if (fiber === blockedOn) break;
|
|
blockedOn = fiber;
|
|
}
|
|
null !== blockedOn && nativeEvent.stopPropagation();
|
|
} else
|
|
dispatchEventForPluginEventSystem(
|
|
domEventName,
|
|
eventSystemFlags,
|
|
nativeEvent,
|
|
null,
|
|
targetContainer
|
|
);
|
|
}
|
|
}
|
|
function findInstanceBlockingEvent(nativeEvent) {
|
|
nativeEvent = getEventTarget(nativeEvent);
|
|
return findInstanceBlockingTarget(nativeEvent);
|
|
}
|
|
function findInstanceBlockingTarget(targetNode) {
|
|
return_targetInst = null;
|
|
targetNode = getClosestInstanceFromNode(targetNode);
|
|
if (null !== targetNode) {
|
|
var nearestMounted = getNearestMountedFiber(targetNode);
|
|
if (null === nearestMounted) targetNode = null;
|
|
else {
|
|
var tag = nearestMounted.tag;
|
|
if (13 === tag) {
|
|
targetNode = getSuspenseInstanceFromFiber(nearestMounted);
|
|
if (null !== targetNode) return targetNode;
|
|
targetNode = null;
|
|
} else if (31 === tag) {
|
|
targetNode = getActivityInstanceFromFiber(nearestMounted);
|
|
if (null !== targetNode) return targetNode;
|
|
targetNode = null;
|
|
} else if (3 === tag) {
|
|
if (nearestMounted.stateNode.current.memoizedState.isDehydrated)
|
|
return 3 === nearestMounted.tag ? nearestMounted.stateNode.containerInfo : null;
|
|
targetNode = null;
|
|
} else nearestMounted !== targetNode && (targetNode = null);
|
|
}
|
|
}
|
|
return_targetInst = targetNode;
|
|
return null;
|
|
}
|
|
function getEventPriority(domEventName) {
|
|
switch (domEventName) {
|
|
case "beforetoggle":
|
|
case "cancel":
|
|
case "click":
|
|
case "close":
|
|
case "contextmenu":
|
|
case "copy":
|
|
case "cut":
|
|
case "auxclick":
|
|
case "dblclick":
|
|
case "dragend":
|
|
case "dragstart":
|
|
case "drop":
|
|
case "focusin":
|
|
case "focusout":
|
|
case "input":
|
|
case "invalid":
|
|
case "keydown":
|
|
case "keypress":
|
|
case "keyup":
|
|
case "mousedown":
|
|
case "mouseup":
|
|
case "paste":
|
|
case "pause":
|
|
case "play":
|
|
case "pointercancel":
|
|
case "pointerdown":
|
|
case "pointerup":
|
|
case "ratechange":
|
|
case "reset":
|
|
case "resize":
|
|
case "seeked":
|
|
case "submit":
|
|
case "toggle":
|
|
case "touchcancel":
|
|
case "touchend":
|
|
case "touchstart":
|
|
case "volumechange":
|
|
case "change":
|
|
case "selectionchange":
|
|
case "textInput":
|
|
case "compositionstart":
|
|
case "compositionend":
|
|
case "compositionupdate":
|
|
case "beforeblur":
|
|
case "afterblur":
|
|
case "beforeinput":
|
|
case "blur":
|
|
case "fullscreenchange":
|
|
case "focus":
|
|
case "hashchange":
|
|
case "popstate":
|
|
case "select":
|
|
case "selectstart":
|
|
return DiscreteEventPriority;
|
|
case "drag":
|
|
case "dragenter":
|
|
case "dragexit":
|
|
case "dragleave":
|
|
case "dragover":
|
|
case "mousemove":
|
|
case "mouseout":
|
|
case "mouseover":
|
|
case "pointermove":
|
|
case "pointerout":
|
|
case "pointerover":
|
|
case "scroll":
|
|
case "touchmove":
|
|
case "wheel":
|
|
case "mouseenter":
|
|
case "mouseleave":
|
|
case "pointerenter":
|
|
case "pointerleave":
|
|
return ContinuousEventPriority;
|
|
case "message":
|
|
switch (getCurrentPriorityLevel()) {
|
|
case ImmediatePriority:
|
|
return DiscreteEventPriority;
|
|
case UserBlockingPriority:
|
|
return ContinuousEventPriority;
|
|
case NormalPriority$1:
|
|
case LowPriority:
|
|
return DefaultEventPriority;
|
|
case IdlePriority:
|
|
return IdleEventPriority;
|
|
default:
|
|
return DefaultEventPriority;
|
|
}
|
|
default:
|
|
return DefaultEventPriority;
|
|
}
|
|
}
|
|
function clearIfContinuousEvent(domEventName, nativeEvent) {
|
|
switch (domEventName) {
|
|
case "focusin":
|
|
case "focusout":
|
|
queuedFocus = null;
|
|
break;
|
|
case "dragenter":
|
|
case "dragleave":
|
|
queuedDrag = null;
|
|
break;
|
|
case "mouseover":
|
|
case "mouseout":
|
|
queuedMouse = null;
|
|
break;
|
|
case "pointerover":
|
|
case "pointerout":
|
|
queuedPointers.delete(nativeEvent.pointerId);
|
|
break;
|
|
case "gotpointercapture":
|
|
case "lostpointercapture":
|
|
queuedPointerCaptures.delete(nativeEvent.pointerId);
|
|
}
|
|
}
|
|
function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
|
|
if (null === existingQueuedEvent || existingQueuedEvent.nativeEvent !== nativeEvent)
|
|
return existingQueuedEvent = {
|
|
blockedOn,
|
|
domEventName,
|
|
eventSystemFlags,
|
|
nativeEvent,
|
|
targetContainers: [targetContainer]
|
|
}, null !== blockedOn && (blockedOn = getInstanceFromNode(blockedOn), null !== blockedOn && attemptContinuousHydration(blockedOn)), existingQueuedEvent;
|
|
existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
|
|
blockedOn = existingQueuedEvent.targetContainers;
|
|
null !== targetContainer && -1 === blockedOn.indexOf(targetContainer) && blockedOn.push(targetContainer);
|
|
return existingQueuedEvent;
|
|
}
|
|
function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
|
|
switch (domEventName) {
|
|
case "focusin":
|
|
return queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(
|
|
queuedFocus,
|
|
blockedOn,
|
|
domEventName,
|
|
eventSystemFlags,
|
|
targetContainer,
|
|
nativeEvent
|
|
), true;
|
|
case "dragenter":
|
|
return queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(
|
|
queuedDrag,
|
|
blockedOn,
|
|
domEventName,
|
|
eventSystemFlags,
|
|
targetContainer,
|
|
nativeEvent
|
|
), true;
|
|
case "mouseover":
|
|
return queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(
|
|
queuedMouse,
|
|
blockedOn,
|
|
domEventName,
|
|
eventSystemFlags,
|
|
targetContainer,
|
|
nativeEvent
|
|
), true;
|
|
case "pointerover":
|
|
var pointerId = nativeEvent.pointerId;
|
|
queuedPointers.set(
|
|
pointerId,
|
|
accumulateOrCreateContinuousQueuedReplayableEvent(
|
|
queuedPointers.get(pointerId) || null,
|
|
blockedOn,
|
|
domEventName,
|
|
eventSystemFlags,
|
|
targetContainer,
|
|
nativeEvent
|
|
)
|
|
);
|
|
return true;
|
|
case "gotpointercapture":
|
|
return pointerId = nativeEvent.pointerId, queuedPointerCaptures.set(
|
|
pointerId,
|
|
accumulateOrCreateContinuousQueuedReplayableEvent(
|
|
queuedPointerCaptures.get(pointerId) || null,
|
|
blockedOn,
|
|
domEventName,
|
|
eventSystemFlags,
|
|
targetContainer,
|
|
nativeEvent
|
|
)
|
|
), true;
|
|
}
|
|
return false;
|
|
}
|
|
function attemptExplicitHydrationTarget(queuedTarget) {
|
|
var targetInst = getClosestInstanceFromNode(queuedTarget.target);
|
|
if (null !== targetInst) {
|
|
var nearestMounted = getNearestMountedFiber(targetInst);
|
|
if (null !== nearestMounted) {
|
|
if (targetInst = nearestMounted.tag, 13 === targetInst) {
|
|
if (targetInst = getSuspenseInstanceFromFiber(nearestMounted), null !== targetInst) {
|
|
queuedTarget.blockedOn = targetInst;
|
|
runWithPriority(queuedTarget.priority, function() {
|
|
attemptHydrationAtCurrentPriority(nearestMounted);
|
|
});
|
|
return;
|
|
}
|
|
} else if (31 === targetInst) {
|
|
if (targetInst = getActivityInstanceFromFiber(nearestMounted), null !== targetInst) {
|
|
queuedTarget.blockedOn = targetInst;
|
|
runWithPriority(queuedTarget.priority, function() {
|
|
attemptHydrationAtCurrentPriority(nearestMounted);
|
|
});
|
|
return;
|
|
}
|
|
} else if (3 === targetInst && nearestMounted.stateNode.current.memoizedState.isDehydrated) {
|
|
queuedTarget.blockedOn = 3 === nearestMounted.tag ? nearestMounted.stateNode.containerInfo : null;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
queuedTarget.blockedOn = null;
|
|
}
|
|
function attemptReplayContinuousQueuedEvent(queuedEvent) {
|
|
if (null !== queuedEvent.blockedOn) return false;
|
|
for (var targetContainers = queuedEvent.targetContainers; 0 < targetContainers.length; ) {
|
|
var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.nativeEvent);
|
|
if (null === nextBlockedOn) {
|
|
nextBlockedOn = queuedEvent.nativeEvent;
|
|
var nativeEventClone = new nextBlockedOn.constructor(
|
|
nextBlockedOn.type,
|
|
nextBlockedOn
|
|
), event = nativeEventClone;
|
|
null !== currentReplayingEvent && console.error(
|
|
"Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
currentReplayingEvent = event;
|
|
nextBlockedOn.target.dispatchEvent(nativeEventClone);
|
|
null === currentReplayingEvent && console.error(
|
|
"Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue."
|
|
);
|
|
currentReplayingEvent = null;
|
|
} else
|
|
return targetContainers = getInstanceFromNode(nextBlockedOn), null !== targetContainers && attemptContinuousHydration(targetContainers), queuedEvent.blockedOn = nextBlockedOn, false;
|
|
targetContainers.shift();
|
|
}
|
|
return true;
|
|
}
|
|
function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
|
|
attemptReplayContinuousQueuedEvent(queuedEvent) && map.delete(key);
|
|
}
|
|
function replayUnblockedEvents() {
|
|
hasScheduledReplayAttempt = false;
|
|
null !== queuedFocus && attemptReplayContinuousQueuedEvent(queuedFocus) && (queuedFocus = null);
|
|
null !== queuedDrag && attemptReplayContinuousQueuedEvent(queuedDrag) && (queuedDrag = null);
|
|
null !== queuedMouse && attemptReplayContinuousQueuedEvent(queuedMouse) && (queuedMouse = null);
|
|
queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
|
|
queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
|
|
}
|
|
function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
|
|
queuedEvent.blockedOn === unblocked && (queuedEvent.blockedOn = null, hasScheduledReplayAttempt || (hasScheduledReplayAttempt = true, Scheduler.unstable_scheduleCallback(
|
|
Scheduler.unstable_NormalPriority,
|
|
replayUnblockedEvents
|
|
)));
|
|
}
|
|
function scheduleReplayQueueIfNeeded(formReplayingQueue) {
|
|
lastScheduledReplayQueue !== formReplayingQueue && (lastScheduledReplayQueue = formReplayingQueue, Scheduler.unstable_scheduleCallback(
|
|
Scheduler.unstable_NormalPriority,
|
|
function() {
|
|
lastScheduledReplayQueue === formReplayingQueue && (lastScheduledReplayQueue = null);
|
|
for (var i = 0; i < formReplayingQueue.length; i += 3) {
|
|
var form = formReplayingQueue[i], submitterOrAction = formReplayingQueue[i + 1], formData = formReplayingQueue[i + 2];
|
|
if ("function" !== typeof submitterOrAction)
|
|
if (null === findInstanceBlockingTarget(submitterOrAction || form))
|
|
continue;
|
|
else break;
|
|
var formInst = getInstanceFromNode(form);
|
|
null !== formInst && (formReplayingQueue.splice(i, 3), i -= 3, form = {
|
|
pending: true,
|
|
data: formData,
|
|
method: form.method,
|
|
action: submitterOrAction
|
|
}, Object.freeze(form), startHostTransition(
|
|
formInst,
|
|
form,
|
|
submitterOrAction,
|
|
formData
|
|
));
|
|
}
|
|
}
|
|
));
|
|
}
|
|
function retryIfBlockedOn(unblocked) {
|
|
function unblock(queuedEvent) {
|
|
return scheduleCallbackIfUnblocked(queuedEvent, unblocked);
|
|
}
|
|
null !== queuedFocus && scheduleCallbackIfUnblocked(queuedFocus, unblocked);
|
|
null !== queuedDrag && scheduleCallbackIfUnblocked(queuedDrag, unblocked);
|
|
null !== queuedMouse && scheduleCallbackIfUnblocked(queuedMouse, unblocked);
|
|
queuedPointers.forEach(unblock);
|
|
queuedPointerCaptures.forEach(unblock);
|
|
for (var i = 0; i < queuedExplicitHydrationTargets.length; i++) {
|
|
var queuedTarget = queuedExplicitHydrationTargets[i];
|
|
queuedTarget.blockedOn === unblocked && (queuedTarget.blockedOn = null);
|
|
}
|
|
for (; 0 < queuedExplicitHydrationTargets.length && (i = queuedExplicitHydrationTargets[0], null === i.blockedOn); )
|
|
attemptExplicitHydrationTarget(i), null === i.blockedOn && queuedExplicitHydrationTargets.shift();
|
|
i = (unblocked.ownerDocument || unblocked).$$reactFormReplay;
|
|
if (null != i)
|
|
for (queuedTarget = 0; queuedTarget < i.length; queuedTarget += 3) {
|
|
var form = i[queuedTarget], submitterOrAction = i[queuedTarget + 1], formProps = form[internalPropsKey] || null;
|
|
if ("function" === typeof submitterOrAction)
|
|
formProps || scheduleReplayQueueIfNeeded(i);
|
|
else if (formProps) {
|
|
var action = null;
|
|
if (submitterOrAction && submitterOrAction.hasAttribute("formAction"))
|
|
if (form = submitterOrAction, formProps = submitterOrAction[internalPropsKey] || null)
|
|
action = formProps.formAction;
|
|
else {
|
|
if (null !== findInstanceBlockingTarget(form)) continue;
|
|
}
|
|
else action = formProps.action;
|
|
"function" === typeof action ? i[queuedTarget + 1] = action : (i.splice(queuedTarget, 3), queuedTarget -= 3);
|
|
scheduleReplayQueueIfNeeded(i);
|
|
}
|
|
}
|
|
}
|
|
function defaultOnDefaultTransitionIndicator() {
|
|
function handleNavigate(event) {
|
|
event.canIntercept && "react-transition" === event.info && event.intercept({
|
|
handler: function() {
|
|
return new Promise(function(resolve) {
|
|
return pendingResolve = resolve;
|
|
});
|
|
},
|
|
focusReset: "manual",
|
|
scroll: "manual"
|
|
});
|
|
}
|
|
function handleNavigateComplete() {
|
|
null !== pendingResolve && (pendingResolve(), pendingResolve = null);
|
|
isCancelled || setTimeout(startFakeNavigation, 20);
|
|
}
|
|
function startFakeNavigation() {
|
|
if (!isCancelled && !navigation.transition) {
|
|
var currentEntry = navigation.currentEntry;
|
|
currentEntry && null != currentEntry.url && navigation.navigate(currentEntry.url, {
|
|
state: currentEntry.getState(),
|
|
info: "react-transition",
|
|
history: "replace"
|
|
});
|
|
}
|
|
}
|
|
if ("object" === typeof navigation) {
|
|
var isCancelled = false, pendingResolve = null;
|
|
navigation.addEventListener("navigate", handleNavigate);
|
|
navigation.addEventListener("navigatesuccess", handleNavigateComplete);
|
|
navigation.addEventListener("navigateerror", handleNavigateComplete);
|
|
setTimeout(startFakeNavigation, 100);
|
|
return function() {
|
|
isCancelled = true;
|
|
navigation.removeEventListener("navigate", handleNavigate);
|
|
navigation.removeEventListener(
|
|
"navigatesuccess",
|
|
handleNavigateComplete
|
|
);
|
|
navigation.removeEventListener(
|
|
"navigateerror",
|
|
handleNavigateComplete
|
|
);
|
|
null !== pendingResolve && (pendingResolve(), pendingResolve = null);
|
|
};
|
|
}
|
|
}
|
|
function ReactDOMRoot(internalRoot) {
|
|
this._internalRoot = internalRoot;
|
|
}
|
|
function ReactDOMHydrationRoot(internalRoot) {
|
|
this._internalRoot = internalRoot;
|
|
}
|
|
function warnIfReactDOMContainerInDEV(container) {
|
|
container[internalContainerInstanceKey] && (container._reactRootContainer ? console.error(
|
|
"You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported."
|
|
) : console.error(
|
|
"You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."
|
|
));
|
|
}
|
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
var Scheduler = require_scheduler(), React58 = require_react(), ReactDOM2 = require_react_dom(), assign2 = Object.assign, REACT_LEGACY_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element"), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
/* @__PURE__ */ Symbol.for("react.scope");
|
|
var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
|
|
/* @__PURE__ */ Symbol.for("react.legacy_hidden");
|
|
/* @__PURE__ */ Symbol.for("react.tracing_marker");
|
|
var REACT_MEMO_CACHE_SENTINEL = /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel");
|
|
/* @__PURE__ */ Symbol.for("react.view_transition");
|
|
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals = React58.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ReactDOMSharedInternals = ReactDOM2.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, NotPending = Object.freeze({
|
|
pending: false,
|
|
data: null,
|
|
method: null,
|
|
action: null
|
|
}), valueStack = [];
|
|
var fiberStack = [];
|
|
var index$jscomp$0 = -1, contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null), disabledDepth = 0, prevLog, prevInfo, prevWarn, prevError, prevGroup, prevGroupCollapsed, prevGroupEnd;
|
|
disabledLog.__reactDisabledLog = true;
|
|
var prefix2, suffix, reentry = false;
|
|
var componentFrameCache = new ("function" === typeof WeakMap ? WeakMap : Map)();
|
|
var current = null, isRendering = false, hasOwnProperty = Object.prototype.hasOwnProperty, scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, now$1 = Scheduler.unstable_now, getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel, ImmediatePriority = Scheduler.unstable_ImmediatePriority, UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, NormalPriority$1 = Scheduler.unstable_NormalPriority, LowPriority = Scheduler.unstable_LowPriority, IdlePriority = Scheduler.unstable_IdlePriority, log$1 = Scheduler.log, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null, hasLoggedError = false, isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__, clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log = Math.log, LN2 = Math.LN2, nextTransitionUpdateLane = 256, nextTransitionDeferredLane = 262144, nextRetryLane = 4194304, DiscreteEventPriority = 2, ContinuousEventPriority = 8, DefaultEventPriority = 32, IdleEventPriority = 268435456, randomKey = Math.random().toString(36).slice(2), internalInstanceKey = "__reactFiber$" + randomKey, internalPropsKey = "__reactProps$" + randomKey, internalContainerInstanceKey = "__reactContainer$" + randomKey, internalEventHandlersKey = "__reactEvents$" + randomKey, internalEventHandlerListenersKey = "__reactListeners$" + randomKey, internalEventHandlesSetKey = "__reactHandles$" + randomKey, internalRootNodeResourcesKey = "__reactResources$" + randomKey, internalHoistableMarker = "__reactMarker$" + randomKey, allNativeEvents = /* @__PURE__ */ new Set(), registrationNameDependencies = {}, possibleRegistrationNames = {}, hasReadOnlyValue = {
|
|
button: true,
|
|
checkbox: true,
|
|
image: true,
|
|
hidden: true,
|
|
radio: true,
|
|
reset: true,
|
|
submit: true
|
|
}, VALID_ATTRIBUTE_NAME_REGEX = RegExp(
|
|
"^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
|
|
), illegalAttributeNameCache = {}, validatedAttributeNameCache = {}, escapeSelectorAttributeValueInsideDoubleQuotesRegex = /[\n"\\]/g, didWarnValueDefaultValue$1 = false, didWarnCheckedDefaultChecked = false, didWarnSelectedSetOnOption = false, didWarnInvalidChild = false, didWarnInvalidInnerHTML = false;
|
|
var didWarnValueDefaultValue = false;
|
|
var valuePropNames = ["value", "defaultValue"], didWarnValDefaultVal = false, needsEscaping = /["'&<>\n\t]|^\s|\s$/, specialTags = "address applet area article aside base basefont bgsound blockquote body br button caption center col colgroup dd details dir div dl dt embed fieldset figcaption figure footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html iframe img input isindex li link listing main marquee menu menuitem meta nav noembed noframes noscript object ol p param plaintext pre script section select source style summary table tbody td template textarea tfoot th thead title tr track ul wbr xmp".split(
|
|
" "
|
|
), inScopeTags = "applet caption html table td th marquee object template foreignObject desc title".split(
|
|
" "
|
|
), buttonScopeTags = inScopeTags.concat(["button"]), impliedEndTags = "dd dt li option optgroup p rp rt".split(" "), emptyAncestorInfoDev = {
|
|
current: null,
|
|
formTag: null,
|
|
aTagInScope: null,
|
|
buttonTagInScope: null,
|
|
nobrTagInScope: null,
|
|
pTagInButtonScope: null,
|
|
listItemTagAutoclosing: null,
|
|
dlItemTagAutoclosing: null,
|
|
containerTagInScope: null,
|
|
implicitRootScope: false
|
|
}, didWarn = {}, shorthandToLonghand = {
|
|
animation: "animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationPlayState animationTimingFunction".split(
|
|
" "
|
|
),
|
|
background: "backgroundAttachment backgroundClip backgroundColor backgroundImage backgroundOrigin backgroundPositionX backgroundPositionY backgroundRepeat backgroundSize".split(
|
|
" "
|
|
),
|
|
backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
|
|
border: "borderBottomColor borderBottomStyle borderBottomWidth borderImageOutset borderImageRepeat borderImageSlice borderImageSource borderImageWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderTopColor borderTopStyle borderTopWidth".split(
|
|
" "
|
|
),
|
|
borderBlockEnd: [
|
|
"borderBlockEndColor",
|
|
"borderBlockEndStyle",
|
|
"borderBlockEndWidth"
|
|
],
|
|
borderBlockStart: [
|
|
"borderBlockStartColor",
|
|
"borderBlockStartStyle",
|
|
"borderBlockStartWidth"
|
|
],
|
|
borderBottom: [
|
|
"borderBottomColor",
|
|
"borderBottomStyle",
|
|
"borderBottomWidth"
|
|
],
|
|
borderColor: [
|
|
"borderBottomColor",
|
|
"borderLeftColor",
|
|
"borderRightColor",
|
|
"borderTopColor"
|
|
],
|
|
borderImage: [
|
|
"borderImageOutset",
|
|
"borderImageRepeat",
|
|
"borderImageSlice",
|
|
"borderImageSource",
|
|
"borderImageWidth"
|
|
],
|
|
borderInlineEnd: [
|
|
"borderInlineEndColor",
|
|
"borderInlineEndStyle",
|
|
"borderInlineEndWidth"
|
|
],
|
|
borderInlineStart: [
|
|
"borderInlineStartColor",
|
|
"borderInlineStartStyle",
|
|
"borderInlineStartWidth"
|
|
],
|
|
borderLeft: ["borderLeftColor", "borderLeftStyle", "borderLeftWidth"],
|
|
borderRadius: [
|
|
"borderBottomLeftRadius",
|
|
"borderBottomRightRadius",
|
|
"borderTopLeftRadius",
|
|
"borderTopRightRadius"
|
|
],
|
|
borderRight: [
|
|
"borderRightColor",
|
|
"borderRightStyle",
|
|
"borderRightWidth"
|
|
],
|
|
borderStyle: [
|
|
"borderBottomStyle",
|
|
"borderLeftStyle",
|
|
"borderRightStyle",
|
|
"borderTopStyle"
|
|
],
|
|
borderTop: ["borderTopColor", "borderTopStyle", "borderTopWidth"],
|
|
borderWidth: [
|
|
"borderBottomWidth",
|
|
"borderLeftWidth",
|
|
"borderRightWidth",
|
|
"borderTopWidth"
|
|
],
|
|
columnRule: ["columnRuleColor", "columnRuleStyle", "columnRuleWidth"],
|
|
columns: ["columnCount", "columnWidth"],
|
|
flex: ["flexBasis", "flexGrow", "flexShrink"],
|
|
flexFlow: ["flexDirection", "flexWrap"],
|
|
font: "fontFamily fontFeatureSettings fontKerning fontLanguageOverride fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontVariantAlternates fontVariantCaps fontVariantEastAsian fontVariantLigatures fontVariantNumeric fontVariantPosition fontWeight lineHeight".split(
|
|
" "
|
|
),
|
|
fontVariant: "fontVariantAlternates fontVariantCaps fontVariantEastAsian fontVariantLigatures fontVariantNumeric fontVariantPosition".split(
|
|
" "
|
|
),
|
|
gap: ["columnGap", "rowGap"],
|
|
grid: "gridAutoColumns gridAutoFlow gridAutoRows gridTemplateAreas gridTemplateColumns gridTemplateRows".split(
|
|
" "
|
|
),
|
|
gridArea: [
|
|
"gridColumnEnd",
|
|
"gridColumnStart",
|
|
"gridRowEnd",
|
|
"gridRowStart"
|
|
],
|
|
gridColumn: ["gridColumnEnd", "gridColumnStart"],
|
|
gridColumnGap: ["columnGap"],
|
|
gridGap: ["columnGap", "rowGap"],
|
|
gridRow: ["gridRowEnd", "gridRowStart"],
|
|
gridRowGap: ["rowGap"],
|
|
gridTemplate: [
|
|
"gridTemplateAreas",
|
|
"gridTemplateColumns",
|
|
"gridTemplateRows"
|
|
],
|
|
listStyle: ["listStyleImage", "listStylePosition", "listStyleType"],
|
|
margin: ["marginBottom", "marginLeft", "marginRight", "marginTop"],
|
|
marker: ["markerEnd", "markerMid", "markerStart"],
|
|
mask: "maskClip maskComposite maskImage maskMode maskOrigin maskPositionX maskPositionY maskRepeat maskSize".split(
|
|
" "
|
|
),
|
|
maskPosition: ["maskPositionX", "maskPositionY"],
|
|
outline: ["outlineColor", "outlineStyle", "outlineWidth"],
|
|
overflow: ["overflowX", "overflowY"],
|
|
padding: ["paddingBottom", "paddingLeft", "paddingRight", "paddingTop"],
|
|
placeContent: ["alignContent", "justifyContent"],
|
|
placeItems: ["alignItems", "justifyItems"],
|
|
placeSelf: ["alignSelf", "justifySelf"],
|
|
textDecoration: [
|
|
"textDecorationColor",
|
|
"textDecorationLine",
|
|
"textDecorationStyle"
|
|
],
|
|
textEmphasis: ["textEmphasisColor", "textEmphasisStyle"],
|
|
transition: [
|
|
"transitionDelay",
|
|
"transitionDuration",
|
|
"transitionProperty",
|
|
"transitionTimingFunction"
|
|
],
|
|
wordWrap: ["overflowWrap"]
|
|
}, uppercasePattern = /([A-Z])/g, msPattern$1 = /^ms-/, badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/, msPattern = /^-ms-/, hyphenPattern = /-(.)/g, badStyleValueWithSemicolonPattern = /;\s*$/, warnedStyleNames = {}, warnedStyleValues = {}, warnedForNaNValue = false, warnedForInfinityValue = false, unitlessNumbers = new Set(
|
|
"animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(
|
|
" "
|
|
)
|
|
), MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML", SVG_NAMESPACE = "http://www.w3.org/2000/svg", aliases2 = /* @__PURE__ */ new Map([
|
|
["acceptCharset", "accept-charset"],
|
|
["htmlFor", "for"],
|
|
["httpEquiv", "http-equiv"],
|
|
["crossOrigin", "crossorigin"],
|
|
["accentHeight", "accent-height"],
|
|
["alignmentBaseline", "alignment-baseline"],
|
|
["arabicForm", "arabic-form"],
|
|
["baselineShift", "baseline-shift"],
|
|
["capHeight", "cap-height"],
|
|
["clipPath", "clip-path"],
|
|
["clipRule", "clip-rule"],
|
|
["colorInterpolation", "color-interpolation"],
|
|
["colorInterpolationFilters", "color-interpolation-filters"],
|
|
["colorProfile", "color-profile"],
|
|
["colorRendering", "color-rendering"],
|
|
["dominantBaseline", "dominant-baseline"],
|
|
["enableBackground", "enable-background"],
|
|
["fillOpacity", "fill-opacity"],
|
|
["fillRule", "fill-rule"],
|
|
["floodColor", "flood-color"],
|
|
["floodOpacity", "flood-opacity"],
|
|
["fontFamily", "font-family"],
|
|
["fontSize", "font-size"],
|
|
["fontSizeAdjust", "font-size-adjust"],
|
|
["fontStretch", "font-stretch"],
|
|
["fontStyle", "font-style"],
|
|
["fontVariant", "font-variant"],
|
|
["fontWeight", "font-weight"],
|
|
["glyphName", "glyph-name"],
|
|
["glyphOrientationHorizontal", "glyph-orientation-horizontal"],
|
|
["glyphOrientationVertical", "glyph-orientation-vertical"],
|
|
["horizAdvX", "horiz-adv-x"],
|
|
["horizOriginX", "horiz-origin-x"],
|
|
["imageRendering", "image-rendering"],
|
|
["letterSpacing", "letter-spacing"],
|
|
["lightingColor", "lighting-color"],
|
|
["markerEnd", "marker-end"],
|
|
["markerMid", "marker-mid"],
|
|
["markerStart", "marker-start"],
|
|
["overlinePosition", "overline-position"],
|
|
["overlineThickness", "overline-thickness"],
|
|
["paintOrder", "paint-order"],
|
|
["panose-1", "panose-1"],
|
|
["pointerEvents", "pointer-events"],
|
|
["renderingIntent", "rendering-intent"],
|
|
["shapeRendering", "shape-rendering"],
|
|
["stopColor", "stop-color"],
|
|
["stopOpacity", "stop-opacity"],
|
|
["strikethroughPosition", "strikethrough-position"],
|
|
["strikethroughThickness", "strikethrough-thickness"],
|
|
["strokeDasharray", "stroke-dasharray"],
|
|
["strokeDashoffset", "stroke-dashoffset"],
|
|
["strokeLinecap", "stroke-linecap"],
|
|
["strokeLinejoin", "stroke-linejoin"],
|
|
["strokeMiterlimit", "stroke-miterlimit"],
|
|
["strokeOpacity", "stroke-opacity"],
|
|
["strokeWidth", "stroke-width"],
|
|
["textAnchor", "text-anchor"],
|
|
["textDecoration", "text-decoration"],
|
|
["textRendering", "text-rendering"],
|
|
["transformOrigin", "transform-origin"],
|
|
["underlinePosition", "underline-position"],
|
|
["underlineThickness", "underline-thickness"],
|
|
["unicodeBidi", "unicode-bidi"],
|
|
["unicodeRange", "unicode-range"],
|
|
["unitsPerEm", "units-per-em"],
|
|
["vAlphabetic", "v-alphabetic"],
|
|
["vHanging", "v-hanging"],
|
|
["vIdeographic", "v-ideographic"],
|
|
["vMathematical", "v-mathematical"],
|
|
["vectorEffect", "vector-effect"],
|
|
["vertAdvY", "vert-adv-y"],
|
|
["vertOriginX", "vert-origin-x"],
|
|
["vertOriginY", "vert-origin-y"],
|
|
["wordSpacing", "word-spacing"],
|
|
["writingMode", "writing-mode"],
|
|
["xmlnsXlink", "xmlns:xlink"],
|
|
["xHeight", "x-height"]
|
|
]), possibleStandardNames = {
|
|
accept: "accept",
|
|
acceptcharset: "acceptCharset",
|
|
"accept-charset": "acceptCharset",
|
|
accesskey: "accessKey",
|
|
action: "action",
|
|
allowfullscreen: "allowFullScreen",
|
|
alt: "alt",
|
|
as: "as",
|
|
async: "async",
|
|
autocapitalize: "autoCapitalize",
|
|
autocomplete: "autoComplete",
|
|
autocorrect: "autoCorrect",
|
|
autofocus: "autoFocus",
|
|
autoplay: "autoPlay",
|
|
autosave: "autoSave",
|
|
capture: "capture",
|
|
cellpadding: "cellPadding",
|
|
cellspacing: "cellSpacing",
|
|
challenge: "challenge",
|
|
charset: "charSet",
|
|
checked: "checked",
|
|
children: "children",
|
|
cite: "cite",
|
|
class: "className",
|
|
classid: "classID",
|
|
classname: "className",
|
|
cols: "cols",
|
|
colspan: "colSpan",
|
|
content: "content",
|
|
contenteditable: "contentEditable",
|
|
contextmenu: "contextMenu",
|
|
controls: "controls",
|
|
controlslist: "controlsList",
|
|
coords: "coords",
|
|
crossorigin: "crossOrigin",
|
|
dangerouslysetinnerhtml: "dangerouslySetInnerHTML",
|
|
data: "data",
|
|
datetime: "dateTime",
|
|
default: "default",
|
|
defaultchecked: "defaultChecked",
|
|
defaultvalue: "defaultValue",
|
|
defer: "defer",
|
|
dir: "dir",
|
|
disabled: "disabled",
|
|
disablepictureinpicture: "disablePictureInPicture",
|
|
disableremoteplayback: "disableRemotePlayback",
|
|
download: "download",
|
|
draggable: "draggable",
|
|
enctype: "encType",
|
|
enterkeyhint: "enterKeyHint",
|
|
fetchpriority: "fetchPriority",
|
|
for: "htmlFor",
|
|
form: "form",
|
|
formmethod: "formMethod",
|
|
formaction: "formAction",
|
|
formenctype: "formEncType",
|
|
formnovalidate: "formNoValidate",
|
|
formtarget: "formTarget",
|
|
frameborder: "frameBorder",
|
|
headers: "headers",
|
|
height: "height",
|
|
hidden: "hidden",
|
|
high: "high",
|
|
href: "href",
|
|
hreflang: "hrefLang",
|
|
htmlfor: "htmlFor",
|
|
httpequiv: "httpEquiv",
|
|
"http-equiv": "httpEquiv",
|
|
icon: "icon",
|
|
id: "id",
|
|
imagesizes: "imageSizes",
|
|
imagesrcset: "imageSrcSet",
|
|
inert: "inert",
|
|
innerhtml: "innerHTML",
|
|
inputmode: "inputMode",
|
|
integrity: "integrity",
|
|
is: "is",
|
|
itemid: "itemID",
|
|
itemprop: "itemProp",
|
|
itemref: "itemRef",
|
|
itemscope: "itemScope",
|
|
itemtype: "itemType",
|
|
keyparams: "keyParams",
|
|
keytype: "keyType",
|
|
kind: "kind",
|
|
label: "label",
|
|
lang: "lang",
|
|
list: "list",
|
|
loop: "loop",
|
|
low: "low",
|
|
manifest: "manifest",
|
|
marginwidth: "marginWidth",
|
|
marginheight: "marginHeight",
|
|
max: "max",
|
|
maxlength: "maxLength",
|
|
media: "media",
|
|
mediagroup: "mediaGroup",
|
|
method: "method",
|
|
min: "min",
|
|
minlength: "minLength",
|
|
multiple: "multiple",
|
|
muted: "muted",
|
|
name: "name",
|
|
nomodule: "noModule",
|
|
nonce: "nonce",
|
|
novalidate: "noValidate",
|
|
open: "open",
|
|
optimum: "optimum",
|
|
pattern: "pattern",
|
|
placeholder: "placeholder",
|
|
playsinline: "playsInline",
|
|
poster: "poster",
|
|
preload: "preload",
|
|
profile: "profile",
|
|
radiogroup: "radioGroup",
|
|
readonly: "readOnly",
|
|
referrerpolicy: "referrerPolicy",
|
|
rel: "rel",
|
|
required: "required",
|
|
reversed: "reversed",
|
|
role: "role",
|
|
rows: "rows",
|
|
rowspan: "rowSpan",
|
|
sandbox: "sandbox",
|
|
scope: "scope",
|
|
scoped: "scoped",
|
|
scrolling: "scrolling",
|
|
seamless: "seamless",
|
|
selected: "selected",
|
|
shape: "shape",
|
|
size: "size",
|
|
sizes: "sizes",
|
|
span: "span",
|
|
spellcheck: "spellCheck",
|
|
src: "src",
|
|
srcdoc: "srcDoc",
|
|
srclang: "srcLang",
|
|
srcset: "srcSet",
|
|
start: "start",
|
|
step: "step",
|
|
style: "style",
|
|
summary: "summary",
|
|
tabindex: "tabIndex",
|
|
target: "target",
|
|
title: "title",
|
|
type: "type",
|
|
usemap: "useMap",
|
|
value: "value",
|
|
width: "width",
|
|
wmode: "wmode",
|
|
wrap: "wrap",
|
|
about: "about",
|
|
accentheight: "accentHeight",
|
|
"accent-height": "accentHeight",
|
|
accumulate: "accumulate",
|
|
additive: "additive",
|
|
alignmentbaseline: "alignmentBaseline",
|
|
"alignment-baseline": "alignmentBaseline",
|
|
allowreorder: "allowReorder",
|
|
alphabetic: "alphabetic",
|
|
amplitude: "amplitude",
|
|
arabicform: "arabicForm",
|
|
"arabic-form": "arabicForm",
|
|
ascent: "ascent",
|
|
attributename: "attributeName",
|
|
attributetype: "attributeType",
|
|
autoreverse: "autoReverse",
|
|
azimuth: "azimuth",
|
|
basefrequency: "baseFrequency",
|
|
baselineshift: "baselineShift",
|
|
"baseline-shift": "baselineShift",
|
|
baseprofile: "baseProfile",
|
|
bbox: "bbox",
|
|
begin: "begin",
|
|
bias: "bias",
|
|
by: "by",
|
|
calcmode: "calcMode",
|
|
capheight: "capHeight",
|
|
"cap-height": "capHeight",
|
|
clip: "clip",
|
|
clippath: "clipPath",
|
|
"clip-path": "clipPath",
|
|
clippathunits: "clipPathUnits",
|
|
cliprule: "clipRule",
|
|
"clip-rule": "clipRule",
|
|
color: "color",
|
|
colorinterpolation: "colorInterpolation",
|
|
"color-interpolation": "colorInterpolation",
|
|
colorinterpolationfilters: "colorInterpolationFilters",
|
|
"color-interpolation-filters": "colorInterpolationFilters",
|
|
colorprofile: "colorProfile",
|
|
"color-profile": "colorProfile",
|
|
colorrendering: "colorRendering",
|
|
"color-rendering": "colorRendering",
|
|
contentscripttype: "contentScriptType",
|
|
contentstyletype: "contentStyleType",
|
|
cursor: "cursor",
|
|
cx: "cx",
|
|
cy: "cy",
|
|
d: "d",
|
|
datatype: "datatype",
|
|
decelerate: "decelerate",
|
|
descent: "descent",
|
|
diffuseconstant: "diffuseConstant",
|
|
direction: "direction",
|
|
display: "display",
|
|
divisor: "divisor",
|
|
dominantbaseline: "dominantBaseline",
|
|
"dominant-baseline": "dominantBaseline",
|
|
dur: "dur",
|
|
dx: "dx",
|
|
dy: "dy",
|
|
edgemode: "edgeMode",
|
|
elevation: "elevation",
|
|
enablebackground: "enableBackground",
|
|
"enable-background": "enableBackground",
|
|
end: "end",
|
|
exponent: "exponent",
|
|
externalresourcesrequired: "externalResourcesRequired",
|
|
fill: "fill",
|
|
fillopacity: "fillOpacity",
|
|
"fill-opacity": "fillOpacity",
|
|
fillrule: "fillRule",
|
|
"fill-rule": "fillRule",
|
|
filter: "filter",
|
|
filterres: "filterRes",
|
|
filterunits: "filterUnits",
|
|
floodopacity: "floodOpacity",
|
|
"flood-opacity": "floodOpacity",
|
|
floodcolor: "floodColor",
|
|
"flood-color": "floodColor",
|
|
focusable: "focusable",
|
|
fontfamily: "fontFamily",
|
|
"font-family": "fontFamily",
|
|
fontsize: "fontSize",
|
|
"font-size": "fontSize",
|
|
fontsizeadjust: "fontSizeAdjust",
|
|
"font-size-adjust": "fontSizeAdjust",
|
|
fontstretch: "fontStretch",
|
|
"font-stretch": "fontStretch",
|
|
fontstyle: "fontStyle",
|
|
"font-style": "fontStyle",
|
|
fontvariant: "fontVariant",
|
|
"font-variant": "fontVariant",
|
|
fontweight: "fontWeight",
|
|
"font-weight": "fontWeight",
|
|
format: "format",
|
|
from: "from",
|
|
fx: "fx",
|
|
fy: "fy",
|
|
g1: "g1",
|
|
g2: "g2",
|
|
glyphname: "glyphName",
|
|
"glyph-name": "glyphName",
|
|
glyphorientationhorizontal: "glyphOrientationHorizontal",
|
|
"glyph-orientation-horizontal": "glyphOrientationHorizontal",
|
|
glyphorientationvertical: "glyphOrientationVertical",
|
|
"glyph-orientation-vertical": "glyphOrientationVertical",
|
|
glyphref: "glyphRef",
|
|
gradienttransform: "gradientTransform",
|
|
gradientunits: "gradientUnits",
|
|
hanging: "hanging",
|
|
horizadvx: "horizAdvX",
|
|
"horiz-adv-x": "horizAdvX",
|
|
horizoriginx: "horizOriginX",
|
|
"horiz-origin-x": "horizOriginX",
|
|
ideographic: "ideographic",
|
|
imagerendering: "imageRendering",
|
|
"image-rendering": "imageRendering",
|
|
in2: "in2",
|
|
in: "in",
|
|
inlist: "inlist",
|
|
intercept: "intercept",
|
|
k1: "k1",
|
|
k2: "k2",
|
|
k3: "k3",
|
|
k4: "k4",
|
|
k: "k",
|
|
kernelmatrix: "kernelMatrix",
|
|
kernelunitlength: "kernelUnitLength",
|
|
kerning: "kerning",
|
|
keypoints: "keyPoints",
|
|
keysplines: "keySplines",
|
|
keytimes: "keyTimes",
|
|
lengthadjust: "lengthAdjust",
|
|
letterspacing: "letterSpacing",
|
|
"letter-spacing": "letterSpacing",
|
|
lightingcolor: "lightingColor",
|
|
"lighting-color": "lightingColor",
|
|
limitingconeangle: "limitingConeAngle",
|
|
local: "local",
|
|
markerend: "markerEnd",
|
|
"marker-end": "markerEnd",
|
|
markerheight: "markerHeight",
|
|
markermid: "markerMid",
|
|
"marker-mid": "markerMid",
|
|
markerstart: "markerStart",
|
|
"marker-start": "markerStart",
|
|
markerunits: "markerUnits",
|
|
markerwidth: "markerWidth",
|
|
mask: "mask",
|
|
maskcontentunits: "maskContentUnits",
|
|
maskunits: "maskUnits",
|
|
mathematical: "mathematical",
|
|
mode: "mode",
|
|
numoctaves: "numOctaves",
|
|
offset: "offset",
|
|
opacity: "opacity",
|
|
operator: "operator",
|
|
order: "order",
|
|
orient: "orient",
|
|
orientation: "orientation",
|
|
origin: "origin",
|
|
overflow: "overflow",
|
|
overlineposition: "overlinePosition",
|
|
"overline-position": "overlinePosition",
|
|
overlinethickness: "overlineThickness",
|
|
"overline-thickness": "overlineThickness",
|
|
paintorder: "paintOrder",
|
|
"paint-order": "paintOrder",
|
|
panose1: "panose1",
|
|
"panose-1": "panose1",
|
|
pathlength: "pathLength",
|
|
patterncontentunits: "patternContentUnits",
|
|
patterntransform: "patternTransform",
|
|
patternunits: "patternUnits",
|
|
pointerevents: "pointerEvents",
|
|
"pointer-events": "pointerEvents",
|
|
points: "points",
|
|
pointsatx: "pointsAtX",
|
|
pointsaty: "pointsAtY",
|
|
pointsatz: "pointsAtZ",
|
|
popover: "popover",
|
|
popovertarget: "popoverTarget",
|
|
popovertargetaction: "popoverTargetAction",
|
|
prefix: "prefix",
|
|
preservealpha: "preserveAlpha",
|
|
preserveaspectratio: "preserveAspectRatio",
|
|
primitiveunits: "primitiveUnits",
|
|
property: "property",
|
|
r: "r",
|
|
radius: "radius",
|
|
refx: "refX",
|
|
refy: "refY",
|
|
renderingintent: "renderingIntent",
|
|
"rendering-intent": "renderingIntent",
|
|
repeatcount: "repeatCount",
|
|
repeatdur: "repeatDur",
|
|
requiredextensions: "requiredExtensions",
|
|
requiredfeatures: "requiredFeatures",
|
|
resource: "resource",
|
|
restart: "restart",
|
|
result: "result",
|
|
results: "results",
|
|
rotate: "rotate",
|
|
rx: "rx",
|
|
ry: "ry",
|
|
scale: "scale",
|
|
security: "security",
|
|
seed: "seed",
|
|
shaperendering: "shapeRendering",
|
|
"shape-rendering": "shapeRendering",
|
|
slope: "slope",
|
|
spacing: "spacing",
|
|
specularconstant: "specularConstant",
|
|
specularexponent: "specularExponent",
|
|
speed: "speed",
|
|
spreadmethod: "spreadMethod",
|
|
startoffset: "startOffset",
|
|
stddeviation: "stdDeviation",
|
|
stemh: "stemh",
|
|
stemv: "stemv",
|
|
stitchtiles: "stitchTiles",
|
|
stopcolor: "stopColor",
|
|
"stop-color": "stopColor",
|
|
stopopacity: "stopOpacity",
|
|
"stop-opacity": "stopOpacity",
|
|
strikethroughposition: "strikethroughPosition",
|
|
"strikethrough-position": "strikethroughPosition",
|
|
strikethroughthickness: "strikethroughThickness",
|
|
"strikethrough-thickness": "strikethroughThickness",
|
|
string: "string",
|
|
stroke: "stroke",
|
|
strokedasharray: "strokeDasharray",
|
|
"stroke-dasharray": "strokeDasharray",
|
|
strokedashoffset: "strokeDashoffset",
|
|
"stroke-dashoffset": "strokeDashoffset",
|
|
strokelinecap: "strokeLinecap",
|
|
"stroke-linecap": "strokeLinecap",
|
|
strokelinejoin: "strokeLinejoin",
|
|
"stroke-linejoin": "strokeLinejoin",
|
|
strokemiterlimit: "strokeMiterlimit",
|
|
"stroke-miterlimit": "strokeMiterlimit",
|
|
strokewidth: "strokeWidth",
|
|
"stroke-width": "strokeWidth",
|
|
strokeopacity: "strokeOpacity",
|
|
"stroke-opacity": "strokeOpacity",
|
|
suppresscontenteditablewarning: "suppressContentEditableWarning",
|
|
suppresshydrationwarning: "suppressHydrationWarning",
|
|
surfacescale: "surfaceScale",
|
|
systemlanguage: "systemLanguage",
|
|
tablevalues: "tableValues",
|
|
targetx: "targetX",
|
|
targety: "targetY",
|
|
textanchor: "textAnchor",
|
|
"text-anchor": "textAnchor",
|
|
textdecoration: "textDecoration",
|
|
"text-decoration": "textDecoration",
|
|
textlength: "textLength",
|
|
textrendering: "textRendering",
|
|
"text-rendering": "textRendering",
|
|
to: "to",
|
|
transform: "transform",
|
|
transformorigin: "transformOrigin",
|
|
"transform-origin": "transformOrigin",
|
|
typeof: "typeof",
|
|
u1: "u1",
|
|
u2: "u2",
|
|
underlineposition: "underlinePosition",
|
|
"underline-position": "underlinePosition",
|
|
underlinethickness: "underlineThickness",
|
|
"underline-thickness": "underlineThickness",
|
|
unicode: "unicode",
|
|
unicodebidi: "unicodeBidi",
|
|
"unicode-bidi": "unicodeBidi",
|
|
unicoderange: "unicodeRange",
|
|
"unicode-range": "unicodeRange",
|
|
unitsperem: "unitsPerEm",
|
|
"units-per-em": "unitsPerEm",
|
|
unselectable: "unselectable",
|
|
valphabetic: "vAlphabetic",
|
|
"v-alphabetic": "vAlphabetic",
|
|
values: "values",
|
|
vectoreffect: "vectorEffect",
|
|
"vector-effect": "vectorEffect",
|
|
version: "version",
|
|
vertadvy: "vertAdvY",
|
|
"vert-adv-y": "vertAdvY",
|
|
vertoriginx: "vertOriginX",
|
|
"vert-origin-x": "vertOriginX",
|
|
vertoriginy: "vertOriginY",
|
|
"vert-origin-y": "vertOriginY",
|
|
vhanging: "vHanging",
|
|
"v-hanging": "vHanging",
|
|
videographic: "vIdeographic",
|
|
"v-ideographic": "vIdeographic",
|
|
viewbox: "viewBox",
|
|
viewtarget: "viewTarget",
|
|
visibility: "visibility",
|
|
vmathematical: "vMathematical",
|
|
"v-mathematical": "vMathematical",
|
|
vocab: "vocab",
|
|
widths: "widths",
|
|
wordspacing: "wordSpacing",
|
|
"word-spacing": "wordSpacing",
|
|
writingmode: "writingMode",
|
|
"writing-mode": "writingMode",
|
|
x1: "x1",
|
|
x2: "x2",
|
|
x: "x",
|
|
xchannelselector: "xChannelSelector",
|
|
xheight: "xHeight",
|
|
"x-height": "xHeight",
|
|
xlinkactuate: "xlinkActuate",
|
|
"xlink:actuate": "xlinkActuate",
|
|
xlinkarcrole: "xlinkArcrole",
|
|
"xlink:arcrole": "xlinkArcrole",
|
|
xlinkhref: "xlinkHref",
|
|
"xlink:href": "xlinkHref",
|
|
xlinkrole: "xlinkRole",
|
|
"xlink:role": "xlinkRole",
|
|
xlinkshow: "xlinkShow",
|
|
"xlink:show": "xlinkShow",
|
|
xlinktitle: "xlinkTitle",
|
|
"xlink:title": "xlinkTitle",
|
|
xlinktype: "xlinkType",
|
|
"xlink:type": "xlinkType",
|
|
xmlbase: "xmlBase",
|
|
"xml:base": "xmlBase",
|
|
xmllang: "xmlLang",
|
|
"xml:lang": "xmlLang",
|
|
xmlns: "xmlns",
|
|
"xml:space": "xmlSpace",
|
|
xmlnsxlink: "xmlnsXlink",
|
|
"xmlns:xlink": "xmlnsXlink",
|
|
xmlspace: "xmlSpace",
|
|
y1: "y1",
|
|
y2: "y2",
|
|
y: "y",
|
|
ychannelselector: "yChannelSelector",
|
|
z: "z",
|
|
zoomandpan: "zoomAndPan"
|
|
}, ariaProperties = {
|
|
"aria-current": 0,
|
|
"aria-description": 0,
|
|
"aria-details": 0,
|
|
"aria-disabled": 0,
|
|
"aria-hidden": 0,
|
|
"aria-invalid": 0,
|
|
"aria-keyshortcuts": 0,
|
|
"aria-label": 0,
|
|
"aria-roledescription": 0,
|
|
"aria-autocomplete": 0,
|
|
"aria-checked": 0,
|
|
"aria-expanded": 0,
|
|
"aria-haspopup": 0,
|
|
"aria-level": 0,
|
|
"aria-modal": 0,
|
|
"aria-multiline": 0,
|
|
"aria-multiselectable": 0,
|
|
"aria-orientation": 0,
|
|
"aria-placeholder": 0,
|
|
"aria-pressed": 0,
|
|
"aria-readonly": 0,
|
|
"aria-required": 0,
|
|
"aria-selected": 0,
|
|
"aria-sort": 0,
|
|
"aria-valuemax": 0,
|
|
"aria-valuemin": 0,
|
|
"aria-valuenow": 0,
|
|
"aria-valuetext": 0,
|
|
"aria-atomic": 0,
|
|
"aria-busy": 0,
|
|
"aria-live": 0,
|
|
"aria-relevant": 0,
|
|
"aria-dropeffect": 0,
|
|
"aria-grabbed": 0,
|
|
"aria-activedescendant": 0,
|
|
"aria-colcount": 0,
|
|
"aria-colindex": 0,
|
|
"aria-colspan": 0,
|
|
"aria-controls": 0,
|
|
"aria-describedby": 0,
|
|
"aria-errormessage": 0,
|
|
"aria-flowto": 0,
|
|
"aria-labelledby": 0,
|
|
"aria-owns": 0,
|
|
"aria-posinset": 0,
|
|
"aria-rowcount": 0,
|
|
"aria-rowindex": 0,
|
|
"aria-rowspan": 0,
|
|
"aria-setsize": 0,
|
|
"aria-braillelabel": 0,
|
|
"aria-brailleroledescription": 0,
|
|
"aria-colindextext": 0,
|
|
"aria-rowindextext": 0
|
|
}, warnedProperties$1 = {}, rARIA$1 = RegExp(
|
|
"^(aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
|
|
), rARIACamel$1 = RegExp(
|
|
"^(aria)[A-Z][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
|
|
), didWarnValueNull = false, warnedProperties = {}, EVENT_NAME_REGEX = /^on./, INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/, rARIA = RegExp(
|
|
"^(aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
|
|
), rARIACamel = RegExp(
|
|
"^(aria)[A-Z][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
|
|
), isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i, currentReplayingEvent = null, restoreTarget = null, restoreQueue = null, isInsideEventHandler = false, canUseDOM = !("undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement), passiveBrowserEventsSupported = false;
|
|
if (canUseDOM)
|
|
try {
|
|
var options$jscomp$0 = {};
|
|
Object.defineProperty(options$jscomp$0, "passive", {
|
|
get: function() {
|
|
passiveBrowserEventsSupported = true;
|
|
}
|
|
});
|
|
window.addEventListener("test", options$jscomp$0, options$jscomp$0);
|
|
window.removeEventListener("test", options$jscomp$0, options$jscomp$0);
|
|
} catch (e) {
|
|
passiveBrowserEventsSupported = false;
|
|
}
|
|
var root = null, startText = null, fallbackText = null, EventInterface = {
|
|
eventPhase: 0,
|
|
bubbles: 0,
|
|
cancelable: 0,
|
|
timeStamp: function(event) {
|
|
return event.timeStamp || Date.now();
|
|
},
|
|
defaultPrevented: 0,
|
|
isTrusted: 0
|
|
}, SyntheticEvent = createSyntheticEvent(EventInterface), UIEventInterface = assign2({}, EventInterface, { view: 0, detail: 0 }), SyntheticUIEvent = createSyntheticEvent(UIEventInterface), lastMovementX, lastMovementY, lastMouseEvent, MouseEventInterface = assign2({}, UIEventInterface, {
|
|
screenX: 0,
|
|
screenY: 0,
|
|
clientX: 0,
|
|
clientY: 0,
|
|
pageX: 0,
|
|
pageY: 0,
|
|
ctrlKey: 0,
|
|
shiftKey: 0,
|
|
altKey: 0,
|
|
metaKey: 0,
|
|
getModifierState: getEventModifierState,
|
|
button: 0,
|
|
buttons: 0,
|
|
relatedTarget: function(event) {
|
|
return void 0 === event.relatedTarget ? event.fromElement === event.srcElement ? event.toElement : event.fromElement : event.relatedTarget;
|
|
},
|
|
movementX: function(event) {
|
|
if ("movementX" in event) return event.movementX;
|
|
event !== lastMouseEvent && (lastMouseEvent && "mousemove" === event.type ? (lastMovementX = event.screenX - lastMouseEvent.screenX, lastMovementY = event.screenY - lastMouseEvent.screenY) : lastMovementY = lastMovementX = 0, lastMouseEvent = event);
|
|
return lastMovementX;
|
|
},
|
|
movementY: function(event) {
|
|
return "movementY" in event ? event.movementY : lastMovementY;
|
|
}
|
|
}), SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface), DragEventInterface = assign2({}, MouseEventInterface, { dataTransfer: 0 }), SyntheticDragEvent = createSyntheticEvent(DragEventInterface), FocusEventInterface = assign2({}, UIEventInterface, { relatedTarget: 0 }), SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface), AnimationEventInterface = assign2({}, EventInterface, {
|
|
animationName: 0,
|
|
elapsedTime: 0,
|
|
pseudoElement: 0
|
|
}), SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface), ClipboardEventInterface = assign2({}, EventInterface, {
|
|
clipboardData: function(event) {
|
|
return "clipboardData" in event ? event.clipboardData : window.clipboardData;
|
|
}
|
|
}), SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface), CompositionEventInterface = assign2({}, EventInterface, { data: 0 }), SyntheticCompositionEvent = createSyntheticEvent(
|
|
CompositionEventInterface
|
|
), SyntheticInputEvent = SyntheticCompositionEvent, normalizeKey = {
|
|
Esc: "Escape",
|
|
Spacebar: " ",
|
|
Left: "ArrowLeft",
|
|
Up: "ArrowUp",
|
|
Right: "ArrowRight",
|
|
Down: "ArrowDown",
|
|
Del: "Delete",
|
|
Win: "OS",
|
|
Menu: "ContextMenu",
|
|
Apps: "ContextMenu",
|
|
Scroll: "ScrollLock",
|
|
MozPrintableKey: "Unidentified"
|
|
}, translateToKey = {
|
|
8: "Backspace",
|
|
9: "Tab",
|
|
12: "Clear",
|
|
13: "Enter",
|
|
16: "Shift",
|
|
17: "Control",
|
|
18: "Alt",
|
|
19: "Pause",
|
|
20: "CapsLock",
|
|
27: "Escape",
|
|
32: " ",
|
|
33: "PageUp",
|
|
34: "PageDown",
|
|
35: "End",
|
|
36: "Home",
|
|
37: "ArrowLeft",
|
|
38: "ArrowUp",
|
|
39: "ArrowRight",
|
|
40: "ArrowDown",
|
|
45: "Insert",
|
|
46: "Delete",
|
|
112: "F1",
|
|
113: "F2",
|
|
114: "F3",
|
|
115: "F4",
|
|
116: "F5",
|
|
117: "F6",
|
|
118: "F7",
|
|
119: "F8",
|
|
120: "F9",
|
|
121: "F10",
|
|
122: "F11",
|
|
123: "F12",
|
|
144: "NumLock",
|
|
145: "ScrollLock",
|
|
224: "Meta"
|
|
}, modifierKeyToProp = {
|
|
Alt: "altKey",
|
|
Control: "ctrlKey",
|
|
Meta: "metaKey",
|
|
Shift: "shiftKey"
|
|
}, KeyboardEventInterface = assign2({}, UIEventInterface, {
|
|
key: function(nativeEvent) {
|
|
if (nativeEvent.key) {
|
|
var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
|
|
if ("Unidentified" !== key) return key;
|
|
}
|
|
return "keypress" === nativeEvent.type ? (nativeEvent = getEventCharCode(nativeEvent), 13 === nativeEvent ? "Enter" : String.fromCharCode(nativeEvent)) : "keydown" === nativeEvent.type || "keyup" === nativeEvent.type ? translateToKey[nativeEvent.keyCode] || "Unidentified" : "";
|
|
},
|
|
code: 0,
|
|
location: 0,
|
|
ctrlKey: 0,
|
|
shiftKey: 0,
|
|
altKey: 0,
|
|
metaKey: 0,
|
|
repeat: 0,
|
|
locale: 0,
|
|
getModifierState: getEventModifierState,
|
|
charCode: function(event) {
|
|
return "keypress" === event.type ? getEventCharCode(event) : 0;
|
|
},
|
|
keyCode: function(event) {
|
|
return "keydown" === event.type || "keyup" === event.type ? event.keyCode : 0;
|
|
},
|
|
which: function(event) {
|
|
return "keypress" === event.type ? getEventCharCode(event) : "keydown" === event.type || "keyup" === event.type ? event.keyCode : 0;
|
|
}
|
|
}), SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface), PointerEventInterface = assign2({}, MouseEventInterface, {
|
|
pointerId: 0,
|
|
width: 0,
|
|
height: 0,
|
|
pressure: 0,
|
|
tangentialPressure: 0,
|
|
tiltX: 0,
|
|
tiltY: 0,
|
|
twist: 0,
|
|
pointerType: 0,
|
|
isPrimary: 0
|
|
}), SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface), TouchEventInterface = assign2({}, UIEventInterface, {
|
|
touches: 0,
|
|
targetTouches: 0,
|
|
changedTouches: 0,
|
|
altKey: 0,
|
|
metaKey: 0,
|
|
ctrlKey: 0,
|
|
shiftKey: 0,
|
|
getModifierState: getEventModifierState
|
|
}), SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface), TransitionEventInterface = assign2({}, EventInterface, {
|
|
propertyName: 0,
|
|
elapsedTime: 0,
|
|
pseudoElement: 0
|
|
}), SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface), WheelEventInterface = assign2({}, MouseEventInterface, {
|
|
deltaX: function(event) {
|
|
return "deltaX" in event ? event.deltaX : "wheelDeltaX" in event ? -event.wheelDeltaX : 0;
|
|
},
|
|
deltaY: function(event) {
|
|
return "deltaY" in event ? event.deltaY : "wheelDeltaY" in event ? -event.wheelDeltaY : "wheelDelta" in event ? -event.wheelDelta : 0;
|
|
},
|
|
deltaZ: 0,
|
|
deltaMode: 0
|
|
}), SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface), ToggleEventInterface = assign2({}, EventInterface, {
|
|
newState: 0,
|
|
oldState: 0
|
|
}), SyntheticToggleEvent = createSyntheticEvent(ToggleEventInterface), END_KEYCODES = [9, 13, 27, 32], START_KEYCODE = 229, canUseCompositionEvent = canUseDOM && "CompositionEvent" in window, documentMode = null;
|
|
canUseDOM && "documentMode" in document && (documentMode = document.documentMode);
|
|
var canUseTextInputEvent = canUseDOM && "TextEvent" in window && !documentMode, useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && 8 < documentMode && 11 >= documentMode), SPACEBAR_CODE = 32, SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE), hasSpaceKeypress = false, isComposing = false, supportedInputTypes = {
|
|
color: true,
|
|
date: true,
|
|
datetime: true,
|
|
"datetime-local": true,
|
|
email: true,
|
|
month: true,
|
|
number: true,
|
|
password: true,
|
|
range: true,
|
|
search: true,
|
|
tel: true,
|
|
text: true,
|
|
time: true,
|
|
url: true,
|
|
week: true
|
|
}, activeElement$1 = null, activeElementInst$1 = null, isInputEventSupported = false;
|
|
canUseDOM && (isInputEventSupported = isEventSupported("input") && (!document.documentMode || 9 < document.documentMode));
|
|
var objectIs = "function" === typeof Object.is ? Object.is : is2, skipSelectionChangeEvent = canUseDOM && "documentMode" in document && 11 >= document.documentMode, activeElement = null, activeElementInst = null, lastSelection = null, mouseDown = false, vendorPrefixes = {
|
|
animationend: makePrefixMap("Animation", "AnimationEnd"),
|
|
animationiteration: makePrefixMap("Animation", "AnimationIteration"),
|
|
animationstart: makePrefixMap("Animation", "AnimationStart"),
|
|
transitionrun: makePrefixMap("Transition", "TransitionRun"),
|
|
transitionstart: makePrefixMap("Transition", "TransitionStart"),
|
|
transitioncancel: makePrefixMap("Transition", "TransitionCancel"),
|
|
transitionend: makePrefixMap("Transition", "TransitionEnd")
|
|
}, prefixedEventNames = {}, style3 = {};
|
|
canUseDOM && (style3 = document.createElement("div").style, "AnimationEvent" in window || (delete vendorPrefixes.animationend.animation, delete vendorPrefixes.animationiteration.animation, delete vendorPrefixes.animationstart.animation), "TransitionEvent" in window || delete vendorPrefixes.transitionend.transition);
|
|
var ANIMATION_END = getVendorPrefixedEventName("animationend"), ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration"), ANIMATION_START = getVendorPrefixedEventName("animationstart"), TRANSITION_RUN = getVendorPrefixedEventName("transitionrun"), TRANSITION_START = getVendorPrefixedEventName("transitionstart"), TRANSITION_CANCEL = getVendorPrefixedEventName("transitioncancel"), TRANSITION_END = getVendorPrefixedEventName("transitionend"), topLevelEventsToReactNames = /* @__PURE__ */ new Map(), simpleEventPluginEvents = "abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(
|
|
" "
|
|
);
|
|
simpleEventPluginEvents.push("scrollEnd");
|
|
var lastResetTime = 0;
|
|
if ("object" === typeof performance && "function" === typeof performance.now) {
|
|
var localPerformance = performance;
|
|
var getCurrentTime = function() {
|
|
return localPerformance.now();
|
|
};
|
|
} else {
|
|
var localDate = Date;
|
|
getCurrentTime = function() {
|
|
return localDate.now();
|
|
};
|
|
}
|
|
var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
|
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
|
var event = new window.ErrorEvent("error", {
|
|
bubbles: true,
|
|
cancelable: true,
|
|
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
|
error
|
|
});
|
|
if (!window.dispatchEvent(event)) return;
|
|
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
|
process.emit("uncaughtException", error);
|
|
return;
|
|
}
|
|
console.error(error);
|
|
}, OMITTED_PROP_ERROR = "This object has been omitted by React in the console log to avoid sending too much data from the server. Try logging smaller or more specific objects.", EMPTY_ARRAY2 = 0, COMPLEX_ARRAY = 1, PRIMITIVE_ARRAY = 2, ENTRIES_ARRAY = 3, REMOVED = "\u2013\xA0", ADDED = "+\xA0", UNCHANGED = "\u2007\xA0", supportsUserTiming = "undefined" !== typeof console && "function" === typeof console.timeStamp && "undefined" !== typeof performance && "function" === typeof performance.measure, COMPONENTS_TRACK = "Components \u269B", LANES_TRACK_GROUP = "Scheduler \u269B", currentTrack = "Blocking", alreadyWarnedForDeepEquality = false, reusableComponentDevToolDetails = {
|
|
color: "primary",
|
|
properties: null,
|
|
tooltipText: "",
|
|
track: COMPONENTS_TRACK
|
|
}, reusableComponentOptions = {
|
|
start: -0,
|
|
end: -0,
|
|
detail: { devtools: reusableComponentDevToolDetails }
|
|
}, resuableChangedPropsEntry = ["Changed Props", ""], DEEP_EQUALITY_WARNING = "This component received deeply equal props. It might benefit from useMemo or the React Compiler in its owner.", reusableDeeplyEqualPropsEntry = ["Changed Props", DEEP_EQUALITY_WARNING], OffscreenVisible = 1, OffscreenPassiveEffectsConnected = 2, concurrentQueues = [], concurrentQueuesIndex = 0, concurrentlyUpdatedLanes = 0, emptyContextObject = {};
|
|
Object.freeze(emptyContextObject);
|
|
var resolveFamily = null, failedBoundaries = null, NoMode = 0, ConcurrentMode = 1, ProfileMode = 2, StrictLegacyMode = 8, StrictEffectsMode = 16, SuspenseyImagesMode = 32;
|
|
var hasBadMapPolyfill = false;
|
|
try {
|
|
var nonExtensibleObject = Object.preventExtensions({});
|
|
/* @__PURE__ */ new Map([[nonExtensibleObject, null]]);
|
|
/* @__PURE__ */ new Set([nonExtensibleObject]);
|
|
} catch (e$3) {
|
|
hasBadMapPolyfill = true;
|
|
}
|
|
var CapturedStacks = /* @__PURE__ */ new WeakMap(), forkStack = [], forkStackIndex = 0, treeForkProvider = null, treeForkCount = 0, idStack = [], idStackIndex = 0, treeContextProvider = null, treeContextId = 1, treeContextOverflow = "", hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = false, didSuspendOrErrorDEV = false, hydrationDiffRootDEV = null, hydrationErrors = null, rootOrSingletonContext = false, HydrationMismatchException = Error(
|
|
"Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."
|
|
), valueCursor = createCursor(null);
|
|
var rendererCursorDEV = createCursor(null);
|
|
var rendererSigil = {};
|
|
var currentlyRenderingFiber$1 = null, lastContextDependency = null, isDisallowedContextReadInDEV = false, AbortControllerLocal = "undefined" !== typeof AbortController ? AbortController : function() {
|
|
var listeners = [], signal = this.signal = {
|
|
aborted: false,
|
|
addEventListener: function(type, listener) {
|
|
listeners.push(listener);
|
|
}
|
|
};
|
|
this.abort = function() {
|
|
signal.aborted = true;
|
|
listeners.forEach(function(listener) {
|
|
return listener();
|
|
});
|
|
};
|
|
}, scheduleCallback$2 = Scheduler.unstable_scheduleCallback, NormalPriority = Scheduler.unstable_NormalPriority, CacheContext = {
|
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
Consumer: null,
|
|
Provider: null,
|
|
_currentValue: null,
|
|
_currentValue2: null,
|
|
_threadCount: 0,
|
|
_currentRenderer: null,
|
|
_currentRenderer2: null
|
|
}, now = Scheduler.unstable_now, createTask = console.createTask ? console.createTask : function() {
|
|
return null;
|
|
}, SPAWNED_UPDATE = 1, PINGED_UPDATE = 2, renderStartTime = -0, commitStartTime = -0, commitEndTime = -0, commitErrors = null, profilerStartTime = -1.1, profilerEffectDuration = -0, componentEffectDuration = -0, componentEffectStartTime = -1.1, componentEffectEndTime = -1.1, componentEffectErrors = null, componentEffectSpawnedUpdate = false, blockingClampTime = -0, blockingUpdateTime = -1.1, blockingUpdateTask = null, blockingUpdateType = 0, blockingUpdateMethodName = null, blockingUpdateComponentName = null, blockingEventTime = -1.1, blockingEventType = null, blockingEventRepeatTime = -1.1, blockingSuspendedTime = -1.1, transitionClampTime = -0, transitionStartTime = -1.1, transitionUpdateTime = -1.1, transitionUpdateType = 0, transitionUpdateTask = null, transitionUpdateMethodName = null, transitionUpdateComponentName = null, transitionEventTime = -1.1, transitionEventType = null, transitionEventRepeatTime = -1.1, transitionSuspendedTime = -1.1, retryClampTime = -0, idleClampTime = -0, animatingLanes = 0, animatingTask = null, yieldReason = 0, yieldStartTime = -1.1, currentUpdateIsNested = false, nestedUpdateScheduled = false, currentEntangledListeners = null, currentEntangledPendingCount = 0, currentEntangledLane = 0, currentEntangledActionThenable = null, prevOnStartTransitionFinish = ReactSharedInternals.S;
|
|
ReactSharedInternals.S = function(transition, returnValue) {
|
|
globalMostRecentTransitionTime = now$1();
|
|
if ("object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then) {
|
|
if (0 > transitionStartTime && 0 > transitionUpdateTime) {
|
|
transitionStartTime = now();
|
|
var newEventTime = resolveEventTimeStamp(), newEventType = resolveEventType();
|
|
if (newEventTime !== transitionEventRepeatTime || newEventType !== transitionEventType)
|
|
transitionEventRepeatTime = -1.1;
|
|
transitionEventTime = newEventTime;
|
|
transitionEventType = newEventType;
|
|
}
|
|
entangleAsyncAction(transition, returnValue);
|
|
}
|
|
null !== prevOnStartTransitionFinish && prevOnStartTransitionFinish(transition, returnValue);
|
|
};
|
|
var resumedCache = createCursor(null), ReactStrictModeWarnings = {
|
|
recordUnsafeLifecycleWarnings: function() {
|
|
},
|
|
flushPendingUnsafeLifecycleWarnings: function() {
|
|
},
|
|
recordLegacyContextWarning: function() {
|
|
},
|
|
flushLegacyContextWarning: function() {
|
|
},
|
|
discardPendingWarnings: function() {
|
|
}
|
|
}, pendingComponentWillMountWarnings = [], pendingUNSAFE_ComponentWillMountWarnings = [], pendingComponentWillReceivePropsWarnings = [], pendingUNSAFE_ComponentWillReceivePropsWarnings = [], pendingComponentWillUpdateWarnings = [], pendingUNSAFE_ComponentWillUpdateWarnings = [], didWarnAboutUnsafeLifecycles = /* @__PURE__ */ new Set();
|
|
ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function(fiber, instance) {
|
|
didWarnAboutUnsafeLifecycles.has(fiber.type) || ("function" === typeof instance.componentWillMount && true !== instance.componentWillMount.__suppressDeprecationWarning && pendingComponentWillMountWarnings.push(fiber), fiber.mode & StrictLegacyMode && "function" === typeof instance.UNSAFE_componentWillMount && pendingUNSAFE_ComponentWillMountWarnings.push(fiber), "function" === typeof instance.componentWillReceiveProps && true !== instance.componentWillReceiveProps.__suppressDeprecationWarning && pendingComponentWillReceivePropsWarnings.push(fiber), fiber.mode & StrictLegacyMode && "function" === typeof instance.UNSAFE_componentWillReceiveProps && pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber), "function" === typeof instance.componentWillUpdate && true !== instance.componentWillUpdate.__suppressDeprecationWarning && pendingComponentWillUpdateWarnings.push(fiber), fiber.mode & StrictLegacyMode && "function" === typeof instance.UNSAFE_componentWillUpdate && pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber));
|
|
};
|
|
ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function() {
|
|
var componentWillMountUniqueNames = /* @__PURE__ */ new Set();
|
|
0 < pendingComponentWillMountWarnings.length && (pendingComponentWillMountWarnings.forEach(function(fiber) {
|
|
componentWillMountUniqueNames.add(
|
|
getComponentNameFromFiber(fiber) || "Component"
|
|
);
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
}), pendingComponentWillMountWarnings = []);
|
|
var UNSAFE_componentWillMountUniqueNames = /* @__PURE__ */ new Set();
|
|
0 < pendingUNSAFE_ComponentWillMountWarnings.length && (pendingUNSAFE_ComponentWillMountWarnings.forEach(function(fiber) {
|
|
UNSAFE_componentWillMountUniqueNames.add(
|
|
getComponentNameFromFiber(fiber) || "Component"
|
|
);
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
}), pendingUNSAFE_ComponentWillMountWarnings = []);
|
|
var componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
|
|
0 < pendingComponentWillReceivePropsWarnings.length && (pendingComponentWillReceivePropsWarnings.forEach(function(fiber) {
|
|
componentWillReceivePropsUniqueNames.add(
|
|
getComponentNameFromFiber(fiber) || "Component"
|
|
);
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
}), pendingComponentWillReceivePropsWarnings = []);
|
|
var UNSAFE_componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
|
|
0 < pendingUNSAFE_ComponentWillReceivePropsWarnings.length && (pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(
|
|
function(fiber) {
|
|
UNSAFE_componentWillReceivePropsUniqueNames.add(
|
|
getComponentNameFromFiber(fiber) || "Component"
|
|
);
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
}
|
|
), pendingUNSAFE_ComponentWillReceivePropsWarnings = []);
|
|
var componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
|
|
0 < pendingComponentWillUpdateWarnings.length && (pendingComponentWillUpdateWarnings.forEach(function(fiber) {
|
|
componentWillUpdateUniqueNames.add(
|
|
getComponentNameFromFiber(fiber) || "Component"
|
|
);
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
}), pendingComponentWillUpdateWarnings = []);
|
|
var UNSAFE_componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
|
|
0 < pendingUNSAFE_ComponentWillUpdateWarnings.length && (pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function(fiber) {
|
|
UNSAFE_componentWillUpdateUniqueNames.add(
|
|
getComponentNameFromFiber(fiber) || "Component"
|
|
);
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
}), pendingUNSAFE_ComponentWillUpdateWarnings = []);
|
|
if (0 < UNSAFE_componentWillMountUniqueNames.size) {
|
|
var sortedNames = setToSortedString(
|
|
UNSAFE_componentWillMountUniqueNames
|
|
);
|
|
console.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
|
|
);
|
|
}
|
|
0 < UNSAFE_componentWillReceivePropsUniqueNames.size && (sortedNames = setToSortedString(
|
|
UNSAFE_componentWillReceivePropsUniqueNames
|
|
), console.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
|
|
));
|
|
0 < UNSAFE_componentWillUpdateUniqueNames.size && (sortedNames = setToSortedString(
|
|
UNSAFE_componentWillUpdateUniqueNames
|
|
), console.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",
|
|
sortedNames
|
|
));
|
|
0 < componentWillMountUniqueNames.size && (sortedNames = setToSortedString(componentWillMountUniqueNames), console.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",
|
|
sortedNames
|
|
));
|
|
0 < componentWillReceivePropsUniqueNames.size && (sortedNames = setToSortedString(
|
|
componentWillReceivePropsUniqueNames
|
|
), console.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",
|
|
sortedNames
|
|
));
|
|
0 < componentWillUpdateUniqueNames.size && (sortedNames = setToSortedString(componentWillUpdateUniqueNames), console.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",
|
|
sortedNames
|
|
));
|
|
};
|
|
var pendingLegacyContextWarning = /* @__PURE__ */ new Map(), didWarnAboutLegacyContext = /* @__PURE__ */ new Set();
|
|
ReactStrictModeWarnings.recordLegacyContextWarning = function(fiber, instance) {
|
|
var strictRoot = null;
|
|
for (var node2 = fiber; null !== node2; )
|
|
node2.mode & StrictLegacyMode && (strictRoot = node2), node2 = node2.return;
|
|
null === strictRoot ? console.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."
|
|
) : !didWarnAboutLegacyContext.has(fiber.type) && (node2 = pendingLegacyContextWarning.get(strictRoot), null != fiber.type.contextTypes || null != fiber.type.childContextTypes || null !== instance && "function" === typeof instance.getChildContext) && (void 0 === node2 && (node2 = [], pendingLegacyContextWarning.set(strictRoot, node2)), node2.push(fiber));
|
|
};
|
|
ReactStrictModeWarnings.flushLegacyContextWarning = function() {
|
|
pendingLegacyContextWarning.forEach(function(fiberArray) {
|
|
if (0 !== fiberArray.length) {
|
|
var firstFiber = fiberArray[0], uniqueNames = /* @__PURE__ */ new Set();
|
|
fiberArray.forEach(function(fiber) {
|
|
uniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
|
|
didWarnAboutLegacyContext.add(fiber.type);
|
|
});
|
|
var sortedNames = setToSortedString(uniqueNames);
|
|
runWithFiberInDEV(firstFiber, function() {
|
|
console.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
|
|
);
|
|
});
|
|
}
|
|
});
|
|
};
|
|
ReactStrictModeWarnings.discardPendingWarnings = function() {
|
|
pendingComponentWillMountWarnings = [];
|
|
pendingUNSAFE_ComponentWillMountWarnings = [];
|
|
pendingComponentWillReceivePropsWarnings = [];
|
|
pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
|
|
pendingComponentWillUpdateWarnings = [];
|
|
pendingUNSAFE_ComponentWillUpdateWarnings = [];
|
|
pendingLegacyContextWarning = /* @__PURE__ */ new Map();
|
|
};
|
|
var callComponent = {
|
|
react_stack_bottom_frame: function(Component, props, secondArg) {
|
|
var wasRendering = isRendering;
|
|
isRendering = true;
|
|
try {
|
|
return Component(props, secondArg);
|
|
} finally {
|
|
isRendering = wasRendering;
|
|
}
|
|
}
|
|
}, callComponentInDEV = callComponent.react_stack_bottom_frame.bind(callComponent), callRender = {
|
|
react_stack_bottom_frame: function(instance) {
|
|
var wasRendering = isRendering;
|
|
isRendering = true;
|
|
try {
|
|
return instance.render();
|
|
} finally {
|
|
isRendering = wasRendering;
|
|
}
|
|
}
|
|
}, callRenderInDEV = callRender.react_stack_bottom_frame.bind(callRender), callComponentDidMount = {
|
|
react_stack_bottom_frame: function(finishedWork, instance) {
|
|
try {
|
|
instance.componentDidMount();
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
}
|
|
}, callComponentDidMountInDEV = callComponentDidMount.react_stack_bottom_frame.bind(
|
|
callComponentDidMount
|
|
), callComponentDidUpdate = {
|
|
react_stack_bottom_frame: function(finishedWork, instance, prevProps, prevState, snapshot) {
|
|
try {
|
|
instance.componentDidUpdate(prevProps, prevState, snapshot);
|
|
} catch (error) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
|
}
|
|
}
|
|
}, callComponentDidUpdateInDEV = callComponentDidUpdate.react_stack_bottom_frame.bind(
|
|
callComponentDidUpdate
|
|
), callComponentDidCatch = {
|
|
react_stack_bottom_frame: function(instance, errorInfo) {
|
|
var stack = errorInfo.stack;
|
|
instance.componentDidCatch(errorInfo.value, {
|
|
componentStack: null !== stack ? stack : ""
|
|
});
|
|
}
|
|
}, callComponentDidCatchInDEV = callComponentDidCatch.react_stack_bottom_frame.bind(
|
|
callComponentDidCatch
|
|
), callComponentWillUnmount = {
|
|
react_stack_bottom_frame: function(current2, nearestMountedAncestor, instance) {
|
|
try {
|
|
instance.componentWillUnmount();
|
|
} catch (error) {
|
|
captureCommitPhaseError(current2, nearestMountedAncestor, error);
|
|
}
|
|
}
|
|
}, callComponentWillUnmountInDEV = callComponentWillUnmount.react_stack_bottom_frame.bind(
|
|
callComponentWillUnmount
|
|
), callCreate = {
|
|
react_stack_bottom_frame: function(effect) {
|
|
var create = effect.create;
|
|
effect = effect.inst;
|
|
create = create();
|
|
return effect.destroy = create;
|
|
}
|
|
}, callCreateInDEV = callCreate.react_stack_bottom_frame.bind(callCreate), callDestroy = {
|
|
react_stack_bottom_frame: function(current2, nearestMountedAncestor, destroy) {
|
|
try {
|
|
destroy();
|
|
} catch (error) {
|
|
captureCommitPhaseError(current2, nearestMountedAncestor, error);
|
|
}
|
|
}
|
|
}, callDestroyInDEV = callDestroy.react_stack_bottom_frame.bind(callDestroy), callLazyInit = {
|
|
react_stack_bottom_frame: function(lazy) {
|
|
var init = lazy._init;
|
|
return init(lazy._payload);
|
|
}
|
|
}, callLazyInitInDEV = callLazyInit.react_stack_bottom_frame.bind(callLazyInit), SuspenseException = Error(
|
|
"Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."
|
|
), SuspenseyCommitException = Error(
|
|
"Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."
|
|
), SuspenseActionException = Error(
|
|
"Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary."
|
|
), noopSuspenseyCommitThenable = {
|
|
then: function() {
|
|
console.error(
|
|
'Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.'
|
|
);
|
|
}
|
|
}, suspendedThenable = null, needsToResetSuspendedThenableDEV = false, thenableState$1 = null, thenableIndexCounter$1 = 0, currentDebugInfo = null, didWarnAboutMaps;
|
|
var didWarnAboutGenerators = didWarnAboutMaps = false;
|
|
var ownerHasKeyUseWarning = {};
|
|
var ownerHasFunctionTypeWarning = {};
|
|
var ownerHasSymbolTypeWarning = {};
|
|
warnForMissingKey = function(returnFiber, workInProgress2, child) {
|
|
if (null !== child && "object" === typeof child && child._store && (!child._store.validated && null == child.key || 2 === child._store.validated)) {
|
|
if ("object" !== typeof child._store)
|
|
throw 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 = 1;
|
|
var componentName2 = getComponentNameFromFiber(returnFiber), componentKey = componentName2 || "null";
|
|
if (!ownerHasKeyUseWarning[componentKey]) {
|
|
ownerHasKeyUseWarning[componentKey] = true;
|
|
child = child._owner;
|
|
returnFiber = returnFiber._debugOwner;
|
|
var currentComponentErrorInfo = "";
|
|
returnFiber && "number" === typeof returnFiber.tag && (componentKey = getComponentNameFromFiber(returnFiber)) && (currentComponentErrorInfo = "\n\nCheck the render method of `" + componentKey + "`.");
|
|
currentComponentErrorInfo || componentName2 && (currentComponentErrorInfo = "\n\nCheck the top-level render call using <" + componentName2 + ">.");
|
|
var childOwnerAppendix = "";
|
|
null != child && returnFiber !== child && (componentName2 = null, "number" === typeof child.tag ? componentName2 = getComponentNameFromFiber(child) : "string" === typeof child.name && (componentName2 = child.name), componentName2 && (childOwnerAppendix = " It was passed a child from " + componentName2 + "."));
|
|
runWithFiberInDEV(workInProgress2, function() {
|
|
console.error(
|
|
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
|
|
currentComponentErrorInfo,
|
|
childOwnerAppendix
|
|
);
|
|
});
|
|
}
|
|
}
|
|
};
|
|
var reconcileChildFibers = createChildReconciler(true), mountChildFibers = createChildReconciler(false), UpdateState = 0, ReplaceState = 1, ForceUpdate = 2, CaptureUpdate = 3, hasForceUpdate = false;
|
|
var didWarnUpdateInsideUpdate = false;
|
|
var currentlyProcessingQueue = null;
|
|
var didReadFromEntangledAsyncAction = false, currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0), suspenseHandlerStackCursor = createCursor(null), shellBoundary = null, SubtreeSuspenseContextMask = 1, ForceSuspenseFallback = 2, suspenseStackCursor = createCursor(0), NoFlags = 0, HasEffect = 1, Insertion5 = 2, Layout = 4, Passive = 8, didWarnUncachedGetSnapshot;
|
|
var didWarnAboutMismatchedHooksForComponent = /* @__PURE__ */ new Set();
|
|
var didWarnAboutUseWrappedInTryCatch = /* @__PURE__ */ new Set();
|
|
var didWarnAboutAsyncClientComponent = /* @__PURE__ */ new Set();
|
|
var didWarnAboutUseFormState = /* @__PURE__ */ new Set();
|
|
var renderLanes = 0, currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = false, didScheduleRenderPhaseUpdateDuringThisPass = false, shouldDoubleInvokeUserFnsInHooksDEV = false, localIdCounter = 0, thenableIndexCounter = 0, thenableState = null, globalClientIdCounter = 0, RE_RENDER_LIMIT = 25, currentHookNameInDev = null, hookTypesDev = null, hookTypesUpdateIndexDev = -1, ignorePreviousDependencies = false, ContextOnlyDispatcher = {
|
|
readContext,
|
|
use,
|
|
useCallback: throwInvalidHookError,
|
|
useContext: throwInvalidHookError,
|
|
useEffect: throwInvalidHookError,
|
|
useImperativeHandle: throwInvalidHookError,
|
|
useLayoutEffect: throwInvalidHookError,
|
|
useInsertionEffect: throwInvalidHookError,
|
|
useMemo: throwInvalidHookError,
|
|
useReducer: throwInvalidHookError,
|
|
useRef: throwInvalidHookError,
|
|
useState: throwInvalidHookError,
|
|
useDebugValue: throwInvalidHookError,
|
|
useDeferredValue: throwInvalidHookError,
|
|
useTransition: throwInvalidHookError,
|
|
useSyncExternalStore: throwInvalidHookError,
|
|
useId: throwInvalidHookError,
|
|
useHostTransitionStatus: throwInvalidHookError,
|
|
useFormState: throwInvalidHookError,
|
|
useActionState: throwInvalidHookError,
|
|
useOptimistic: throwInvalidHookError,
|
|
useMemoCache: throwInvalidHookError,
|
|
useCacheRefresh: throwInvalidHookError
|
|
};
|
|
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
|
|
var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, HooksDispatcherOnRerenderInDEV = null, InvalidNestedHooksDispatcherOnMountInDEV = null, InvalidNestedHooksDispatcherOnUpdateInDEV = null, InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
HooksDispatcherOnMountInDEV = {
|
|
readContext: function(context) {
|
|
return readContext(context);
|
|
},
|
|
use,
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
return mountCallback(callback, deps);
|
|
},
|
|
useContext: function(context) {
|
|
currentHookNameInDev = "useContext";
|
|
mountHookTypesDev();
|
|
return readContext(context);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
return mountEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
return mountImperativeHandle(ref, create, deps);
|
|
},
|
|
useInsertionEffect: function(create, deps) {
|
|
currentHookNameInDev = "useInsertionEffect";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
mountEffectImpl(4, Insertion5, create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
return mountLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountMemo(create, deps);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
mountHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
mountHookTypesDev();
|
|
return mountRef(initialValue);
|
|
},
|
|
useState: function(initialState) {
|
|
currentHookNameInDev = "useState";
|
|
mountHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountState(initialState);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function() {
|
|
currentHookNameInDev = "useDebugValue";
|
|
mountHookTypesDev();
|
|
},
|
|
useDeferredValue: function(value, initialValue) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
mountHookTypesDev();
|
|
return mountDeferredValue(value, initialValue);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
mountHookTypesDev();
|
|
return mountTransition();
|
|
},
|
|
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
currentHookNameInDev = "useSyncExternalStore";
|
|
mountHookTypesDev();
|
|
return mountSyncExternalStore(
|
|
subscribe,
|
|
getSnapshot,
|
|
getServerSnapshot
|
|
);
|
|
},
|
|
useId: function() {
|
|
currentHookNameInDev = "useId";
|
|
mountHookTypesDev();
|
|
return mountId();
|
|
},
|
|
useFormState: function(action, initialState) {
|
|
currentHookNameInDev = "useFormState";
|
|
mountHookTypesDev();
|
|
warnOnUseFormStateInDev();
|
|
return mountActionState(action, initialState);
|
|
},
|
|
useActionState: function(action, initialState) {
|
|
currentHookNameInDev = "useActionState";
|
|
mountHookTypesDev();
|
|
return mountActionState(action, initialState);
|
|
},
|
|
useOptimistic: function(passthrough) {
|
|
currentHookNameInDev = "useOptimistic";
|
|
mountHookTypesDev();
|
|
return mountOptimistic(passthrough);
|
|
},
|
|
useHostTransitionStatus,
|
|
useMemoCache,
|
|
useCacheRefresh: function() {
|
|
currentHookNameInDev = "useCacheRefresh";
|
|
mountHookTypesDev();
|
|
return mountRefresh();
|
|
},
|
|
useEffectEvent: function(callback) {
|
|
currentHookNameInDev = "useEffectEvent";
|
|
mountHookTypesDev();
|
|
return mountEvent(callback);
|
|
}
|
|
};
|
|
HooksDispatcherOnMountWithHookTypesInDEV = {
|
|
readContext: function(context) {
|
|
return readContext(context);
|
|
},
|
|
use,
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
updateHookTypesDev();
|
|
return mountCallback(callback, deps);
|
|
},
|
|
useContext: function(context) {
|
|
currentHookNameInDev = "useContext";
|
|
updateHookTypesDev();
|
|
return readContext(context);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
updateHookTypesDev();
|
|
return mountEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
updateHookTypesDev();
|
|
return mountImperativeHandle(ref, create, deps);
|
|
},
|
|
useInsertionEffect: function(create, deps) {
|
|
currentHookNameInDev = "useInsertionEffect";
|
|
updateHookTypesDev();
|
|
mountEffectImpl(4, Insertion5, create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
updateHookTypesDev();
|
|
return mountLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountMemo(create, deps);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
updateHookTypesDev();
|
|
return mountRef(initialValue);
|
|
},
|
|
useState: function(initialState) {
|
|
currentHookNameInDev = "useState";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountState(initialState);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function() {
|
|
currentHookNameInDev = "useDebugValue";
|
|
updateHookTypesDev();
|
|
},
|
|
useDeferredValue: function(value, initialValue) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
updateHookTypesDev();
|
|
return mountDeferredValue(value, initialValue);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
updateHookTypesDev();
|
|
return mountTransition();
|
|
},
|
|
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
currentHookNameInDev = "useSyncExternalStore";
|
|
updateHookTypesDev();
|
|
return mountSyncExternalStore(
|
|
subscribe,
|
|
getSnapshot,
|
|
getServerSnapshot
|
|
);
|
|
},
|
|
useId: function() {
|
|
currentHookNameInDev = "useId";
|
|
updateHookTypesDev();
|
|
return mountId();
|
|
},
|
|
useActionState: function(action, initialState) {
|
|
currentHookNameInDev = "useActionState";
|
|
updateHookTypesDev();
|
|
return mountActionState(action, initialState);
|
|
},
|
|
useFormState: function(action, initialState) {
|
|
currentHookNameInDev = "useFormState";
|
|
updateHookTypesDev();
|
|
warnOnUseFormStateInDev();
|
|
return mountActionState(action, initialState);
|
|
},
|
|
useOptimistic: function(passthrough) {
|
|
currentHookNameInDev = "useOptimistic";
|
|
updateHookTypesDev();
|
|
return mountOptimistic(passthrough);
|
|
},
|
|
useHostTransitionStatus,
|
|
useMemoCache,
|
|
useCacheRefresh: function() {
|
|
currentHookNameInDev = "useCacheRefresh";
|
|
updateHookTypesDev();
|
|
return mountRefresh();
|
|
},
|
|
useEffectEvent: function(callback) {
|
|
currentHookNameInDev = "useEffectEvent";
|
|
updateHookTypesDev();
|
|
return mountEvent(callback);
|
|
}
|
|
};
|
|
HooksDispatcherOnUpdateInDEV = {
|
|
readContext: function(context) {
|
|
return readContext(context);
|
|
},
|
|
use,
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
updateHookTypesDev();
|
|
return updateCallback(callback, deps);
|
|
},
|
|
useContext: function(context) {
|
|
currentHookNameInDev = "useContext";
|
|
updateHookTypesDev();
|
|
return readContext(context);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
updateHookTypesDev();
|
|
updateEffectImpl(2048, Passive, create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
updateHookTypesDev();
|
|
return updateImperativeHandle(ref, create, deps);
|
|
},
|
|
useInsertionEffect: function(create, deps) {
|
|
currentHookNameInDev = "useInsertionEffect";
|
|
updateHookTypesDev();
|
|
return updateEffectImpl(4, Insertion5, create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
updateHookTypesDev();
|
|
return updateEffectImpl(4, Layout, create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateMemo(create, deps);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function() {
|
|
currentHookNameInDev = "useRef";
|
|
updateHookTypesDev();
|
|
return updateWorkInProgressHook().memoizedState;
|
|
},
|
|
useState: function() {
|
|
currentHookNameInDev = "useState";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateReducer(basicStateReducer);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function() {
|
|
currentHookNameInDev = "useDebugValue";
|
|
updateHookTypesDev();
|
|
},
|
|
useDeferredValue: function(value, initialValue) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
updateHookTypesDev();
|
|
return updateDeferredValue(value, initialValue);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
updateHookTypesDev();
|
|
return updateTransition();
|
|
},
|
|
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
currentHookNameInDev = "useSyncExternalStore";
|
|
updateHookTypesDev();
|
|
return updateSyncExternalStore(
|
|
subscribe,
|
|
getSnapshot,
|
|
getServerSnapshot
|
|
);
|
|
},
|
|
useId: function() {
|
|
currentHookNameInDev = "useId";
|
|
updateHookTypesDev();
|
|
return updateWorkInProgressHook().memoizedState;
|
|
},
|
|
useFormState: function(action) {
|
|
currentHookNameInDev = "useFormState";
|
|
updateHookTypesDev();
|
|
warnOnUseFormStateInDev();
|
|
return updateActionState(action);
|
|
},
|
|
useActionState: function(action) {
|
|
currentHookNameInDev = "useActionState";
|
|
updateHookTypesDev();
|
|
return updateActionState(action);
|
|
},
|
|
useOptimistic: function(passthrough, reducer) {
|
|
currentHookNameInDev = "useOptimistic";
|
|
updateHookTypesDev();
|
|
return updateOptimistic(passthrough, reducer);
|
|
},
|
|
useHostTransitionStatus,
|
|
useMemoCache,
|
|
useCacheRefresh: function() {
|
|
currentHookNameInDev = "useCacheRefresh";
|
|
updateHookTypesDev();
|
|
return updateWorkInProgressHook().memoizedState;
|
|
},
|
|
useEffectEvent: function(callback) {
|
|
currentHookNameInDev = "useEffectEvent";
|
|
updateHookTypesDev();
|
|
return updateEvent(callback);
|
|
}
|
|
};
|
|
HooksDispatcherOnRerenderInDEV = {
|
|
readContext: function(context) {
|
|
return readContext(context);
|
|
},
|
|
use,
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
updateHookTypesDev();
|
|
return updateCallback(callback, deps);
|
|
},
|
|
useContext: function(context) {
|
|
currentHookNameInDev = "useContext";
|
|
updateHookTypesDev();
|
|
return readContext(context);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
updateHookTypesDev();
|
|
updateEffectImpl(2048, Passive, create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
updateHookTypesDev();
|
|
return updateImperativeHandle(ref, create, deps);
|
|
},
|
|
useInsertionEffect: function(create, deps) {
|
|
currentHookNameInDev = "useInsertionEffect";
|
|
updateHookTypesDev();
|
|
return updateEffectImpl(4, Insertion5, create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
updateHookTypesDev();
|
|
return updateEffectImpl(4, Layout, create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnRerenderInDEV;
|
|
try {
|
|
return updateMemo(create, deps);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnRerenderInDEV;
|
|
try {
|
|
return rerenderReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function() {
|
|
currentHookNameInDev = "useRef";
|
|
updateHookTypesDev();
|
|
return updateWorkInProgressHook().memoizedState;
|
|
},
|
|
useState: function() {
|
|
currentHookNameInDev = "useState";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnRerenderInDEV;
|
|
try {
|
|
return rerenderReducer(basicStateReducer);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function() {
|
|
currentHookNameInDev = "useDebugValue";
|
|
updateHookTypesDev();
|
|
},
|
|
useDeferredValue: function(value, initialValue) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
updateHookTypesDev();
|
|
return rerenderDeferredValue(value, initialValue);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
updateHookTypesDev();
|
|
return rerenderTransition();
|
|
},
|
|
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
currentHookNameInDev = "useSyncExternalStore";
|
|
updateHookTypesDev();
|
|
return updateSyncExternalStore(
|
|
subscribe,
|
|
getSnapshot,
|
|
getServerSnapshot
|
|
);
|
|
},
|
|
useId: function() {
|
|
currentHookNameInDev = "useId";
|
|
updateHookTypesDev();
|
|
return updateWorkInProgressHook().memoizedState;
|
|
},
|
|
useFormState: function(action) {
|
|
currentHookNameInDev = "useFormState";
|
|
updateHookTypesDev();
|
|
warnOnUseFormStateInDev();
|
|
return rerenderActionState(action);
|
|
},
|
|
useActionState: function(action) {
|
|
currentHookNameInDev = "useActionState";
|
|
updateHookTypesDev();
|
|
return rerenderActionState(action);
|
|
},
|
|
useOptimistic: function(passthrough, reducer) {
|
|
currentHookNameInDev = "useOptimistic";
|
|
updateHookTypesDev();
|
|
return rerenderOptimistic(passthrough, reducer);
|
|
},
|
|
useHostTransitionStatus,
|
|
useMemoCache,
|
|
useCacheRefresh: function() {
|
|
currentHookNameInDev = "useCacheRefresh";
|
|
updateHookTypesDev();
|
|
return updateWorkInProgressHook().memoizedState;
|
|
},
|
|
useEffectEvent: function(callback) {
|
|
currentHookNameInDev = "useEffectEvent";
|
|
updateHookTypesDev();
|
|
return updateEvent(callback);
|
|
}
|
|
};
|
|
InvalidNestedHooksDispatcherOnMountInDEV = {
|
|
readContext: function(context) {
|
|
warnInvalidContextAccess();
|
|
return readContext(context);
|
|
},
|
|
use: function(usable) {
|
|
warnInvalidHookAccess();
|
|
return use(usable);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountCallback(callback, deps);
|
|
},
|
|
useContext: function(context) {
|
|
currentHookNameInDev = "useContext";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return readContext(context);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountImperativeHandle(ref, create, deps);
|
|
},
|
|
useInsertionEffect: function(create, deps) {
|
|
currentHookNameInDev = "useInsertionEffect";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
mountEffectImpl(4, Insertion5, create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountMemo(create, deps);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountRef(initialValue);
|
|
},
|
|
useState: function(initialState) {
|
|
currentHookNameInDev = "useState";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountState(initialState);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function() {
|
|
currentHookNameInDev = "useDebugValue";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
},
|
|
useDeferredValue: function(value, initialValue) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountDeferredValue(value, initialValue);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountTransition();
|
|
},
|
|
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
currentHookNameInDev = "useSyncExternalStore";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountSyncExternalStore(
|
|
subscribe,
|
|
getSnapshot,
|
|
getServerSnapshot
|
|
);
|
|
},
|
|
useId: function() {
|
|
currentHookNameInDev = "useId";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountId();
|
|
},
|
|
useFormState: function(action, initialState) {
|
|
currentHookNameInDev = "useFormState";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountActionState(action, initialState);
|
|
},
|
|
useActionState: function(action, initialState) {
|
|
currentHookNameInDev = "useActionState";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountActionState(action, initialState);
|
|
},
|
|
useOptimistic: function(passthrough) {
|
|
currentHookNameInDev = "useOptimistic";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountOptimistic(passthrough);
|
|
},
|
|
useMemoCache: function(size) {
|
|
warnInvalidHookAccess();
|
|
return useMemoCache(size);
|
|
},
|
|
useHostTransitionStatus,
|
|
useCacheRefresh: function() {
|
|
currentHookNameInDev = "useCacheRefresh";
|
|
mountHookTypesDev();
|
|
return mountRefresh();
|
|
},
|
|
useEffectEvent: function(callback) {
|
|
currentHookNameInDev = "useEffectEvent";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountEvent(callback);
|
|
}
|
|
};
|
|
InvalidNestedHooksDispatcherOnUpdateInDEV = {
|
|
readContext: function(context) {
|
|
warnInvalidContextAccess();
|
|
return readContext(context);
|
|
},
|
|
use: function(usable) {
|
|
warnInvalidHookAccess();
|
|
return use(usable);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateCallback(callback, deps);
|
|
},
|
|
useContext: function(context) {
|
|
currentHookNameInDev = "useContext";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return readContext(context);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
updateEffectImpl(2048, Passive, create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateImperativeHandle(ref, create, deps);
|
|
},
|
|
useInsertionEffect: function(create, deps) {
|
|
currentHookNameInDev = "useInsertionEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateEffectImpl(4, Insertion5, create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateEffectImpl(4, Layout, create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateMemo(create, deps);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function() {
|
|
currentHookNameInDev = "useRef";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateWorkInProgressHook().memoizedState;
|
|
},
|
|
useState: function() {
|
|
currentHookNameInDev = "useState";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateReducer(basicStateReducer);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function() {
|
|
currentHookNameInDev = "useDebugValue";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
},
|
|
useDeferredValue: function(value, initialValue) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateDeferredValue(value, initialValue);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateTransition();
|
|
},
|
|
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
currentHookNameInDev = "useSyncExternalStore";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateSyncExternalStore(
|
|
subscribe,
|
|
getSnapshot,
|
|
getServerSnapshot
|
|
);
|
|
},
|
|
useId: function() {
|
|
currentHookNameInDev = "useId";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateWorkInProgressHook().memoizedState;
|
|
},
|
|
useFormState: function(action) {
|
|
currentHookNameInDev = "useFormState";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateActionState(action);
|
|
},
|
|
useActionState: function(action) {
|
|
currentHookNameInDev = "useActionState";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateActionState(action);
|
|
},
|
|
useOptimistic: function(passthrough, reducer) {
|
|
currentHookNameInDev = "useOptimistic";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateOptimistic(passthrough, reducer);
|
|
},
|
|
useMemoCache: function(size) {
|
|
warnInvalidHookAccess();
|
|
return useMemoCache(size);
|
|
},
|
|
useHostTransitionStatus,
|
|
useCacheRefresh: function() {
|
|
currentHookNameInDev = "useCacheRefresh";
|
|
updateHookTypesDev();
|
|
return updateWorkInProgressHook().memoizedState;
|
|
},
|
|
useEffectEvent: function(callback) {
|
|
currentHookNameInDev = "useEffectEvent";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateEvent(callback);
|
|
}
|
|
};
|
|
InvalidNestedHooksDispatcherOnRerenderInDEV = {
|
|
readContext: function(context) {
|
|
warnInvalidContextAccess();
|
|
return readContext(context);
|
|
},
|
|
use: function(usable) {
|
|
warnInvalidHookAccess();
|
|
return use(usable);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateCallback(callback, deps);
|
|
},
|
|
useContext: function(context) {
|
|
currentHookNameInDev = "useContext";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return readContext(context);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
updateEffectImpl(2048, Passive, create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateImperativeHandle(ref, create, deps);
|
|
},
|
|
useInsertionEffect: function(create, deps) {
|
|
currentHookNameInDev = "useInsertionEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateEffectImpl(4, Insertion5, create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateEffectImpl(4, Layout, create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateMemo(create, deps);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return rerenderReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function() {
|
|
currentHookNameInDev = "useRef";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateWorkInProgressHook().memoizedState;
|
|
},
|
|
useState: function() {
|
|
currentHookNameInDev = "useState";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactSharedInternals.H;
|
|
ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return rerenderReducer(basicStateReducer);
|
|
} finally {
|
|
ReactSharedInternals.H = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function() {
|
|
currentHookNameInDev = "useDebugValue";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
},
|
|
useDeferredValue: function(value, initialValue) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return rerenderDeferredValue(value, initialValue);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return rerenderTransition();
|
|
},
|
|
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
currentHookNameInDev = "useSyncExternalStore";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateSyncExternalStore(
|
|
subscribe,
|
|
getSnapshot,
|
|
getServerSnapshot
|
|
);
|
|
},
|
|
useId: function() {
|
|
currentHookNameInDev = "useId";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateWorkInProgressHook().memoizedState;
|
|
},
|
|
useFormState: function(action) {
|
|
currentHookNameInDev = "useFormState";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return rerenderActionState(action);
|
|
},
|
|
useActionState: function(action) {
|
|
currentHookNameInDev = "useActionState";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return rerenderActionState(action);
|
|
},
|
|
useOptimistic: function(passthrough, reducer) {
|
|
currentHookNameInDev = "useOptimistic";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return rerenderOptimistic(passthrough, reducer);
|
|
},
|
|
useMemoCache: function(size) {
|
|
warnInvalidHookAccess();
|
|
return useMemoCache(size);
|
|
},
|
|
useHostTransitionStatus,
|
|
useCacheRefresh: function() {
|
|
currentHookNameInDev = "useCacheRefresh";
|
|
updateHookTypesDev();
|
|
return updateWorkInProgressHook().memoizedState;
|
|
},
|
|
useEffectEvent: function(callback) {
|
|
currentHookNameInDev = "useEffectEvent";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateEvent(callback);
|
|
}
|
|
};
|
|
var fakeInternalInstance = {};
|
|
var didWarnAboutStateAssignmentForComponent = /* @__PURE__ */ new Set();
|
|
var didWarnAboutUninitializedState = /* @__PURE__ */ new Set();
|
|
var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = /* @__PURE__ */ new Set();
|
|
var didWarnAboutLegacyLifecyclesAndDerivedState = /* @__PURE__ */ new Set();
|
|
var didWarnAboutDirectlyAssigningPropsToState = /* @__PURE__ */ new Set();
|
|
var didWarnAboutUndefinedDerivedState = /* @__PURE__ */ new Set();
|
|
var didWarnAboutContextTypes$1 = /* @__PURE__ */ new Set();
|
|
var didWarnAboutChildContextTypes = /* @__PURE__ */ new Set();
|
|
var didWarnAboutInvalidateContextType = /* @__PURE__ */ new Set();
|
|
var didWarnOnInvalidCallback = /* @__PURE__ */ new Set();
|
|
Object.freeze(fakeInternalInstance);
|
|
var classComponentUpdater = {
|
|
enqueueSetState: function(inst, payload, callback) {
|
|
inst = inst._reactInternals;
|
|
var lane = requestUpdateLane(inst), update2 = createUpdate(lane);
|
|
update2.payload = payload;
|
|
void 0 !== callback && null !== callback && (warnOnInvalidCallback(callback), update2.callback = callback);
|
|
payload = enqueueUpdate(inst, update2, lane);
|
|
null !== payload && (startUpdateTimerByLane(lane, "this.setState()", inst), scheduleUpdateOnFiber(payload, inst, lane), entangleTransitions(payload, inst, lane));
|
|
},
|
|
enqueueReplaceState: function(inst, payload, callback) {
|
|
inst = inst._reactInternals;
|
|
var lane = requestUpdateLane(inst), update2 = createUpdate(lane);
|
|
update2.tag = ReplaceState;
|
|
update2.payload = payload;
|
|
void 0 !== callback && null !== callback && (warnOnInvalidCallback(callback), update2.callback = callback);
|
|
payload = enqueueUpdate(inst, update2, lane);
|
|
null !== payload && (startUpdateTimerByLane(lane, "this.replaceState()", inst), scheduleUpdateOnFiber(payload, inst, lane), entangleTransitions(payload, inst, lane));
|
|
},
|
|
enqueueForceUpdate: function(inst, callback) {
|
|
inst = inst._reactInternals;
|
|
var lane = requestUpdateLane(inst), update2 = createUpdate(lane);
|
|
update2.tag = ForceUpdate;
|
|
void 0 !== callback && null !== callback && (warnOnInvalidCallback(callback), update2.callback = callback);
|
|
callback = enqueueUpdate(inst, update2, lane);
|
|
null !== callback && (startUpdateTimerByLane(lane, "this.forceUpdate()", inst), scheduleUpdateOnFiber(callback, inst, lane), entangleTransitions(callback, inst, lane));
|
|
}
|
|
}, componentName = null, errorBoundaryName = null, SelectiveHydrationException = Error(
|
|
"This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue."
|
|
), didReceiveUpdate = false;
|
|
var didWarnAboutBadClass = {};
|
|
var didWarnAboutContextTypeOnFunctionComponent = {};
|
|
var didWarnAboutContextTypes = {};
|
|
var didWarnAboutGetDerivedStateOnFunctionComponent = {};
|
|
var didWarnAboutReassigningProps = false;
|
|
var didWarnAboutRevealOrder = {};
|
|
var didWarnAboutTailOptions = {};
|
|
var SUSPENDED_MARKER = {
|
|
dehydrated: null,
|
|
treeContext: null,
|
|
retryLane: 0,
|
|
hydrationErrors: null
|
|
}, hasWarnedAboutUsingNoValuePropOnContextProvider = false, didWarnAboutUndefinedSnapshotBeforeUpdate = null;
|
|
didWarnAboutUndefinedSnapshotBeforeUpdate = /* @__PURE__ */ new Set();
|
|
var offscreenSubtreeIsHidden = false, offscreenSubtreeWasHidden = false, needsFormReset = false, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, nextEffect = null, inProgressLanes = null, inProgressRoot = null, hostParent = null, hostParentIsContainer = false, currentHoistableRoot = null, inHydratedSubtree = false, suspenseyCommitFlag = 8192, DefaultAsyncDispatcher = {
|
|
getCacheForType: function(resourceType) {
|
|
var cache = readContext(CacheContext), cacheForType = cache.data.get(resourceType);
|
|
void 0 === cacheForType && (cacheForType = resourceType(), cache.data.set(resourceType, cacheForType));
|
|
return cacheForType;
|
|
},
|
|
cacheSignal: function() {
|
|
return readContext(CacheContext).controller.signal;
|
|
},
|
|
getOwner: function() {
|
|
return current;
|
|
}
|
|
};
|
|
if ("function" === typeof Symbol && Symbol.for) {
|
|
var symbolFor = Symbol.for;
|
|
symbolFor("selector.component");
|
|
symbolFor("selector.has_pseudo_class");
|
|
symbolFor("selector.role");
|
|
symbolFor("selector.test_id");
|
|
symbolFor("selector.text");
|
|
}
|
|
var commitHooks = [], PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, NoContext = 0, RenderContext = 2, CommitContext = 4, RootInProgress = 0, RootFatalErrored = 1, RootErrored = 2, RootSuspended = 3, RootSuspendedWithDelay = 4, RootSuspendedAtTheShell = 6, RootCompleted = 5, executionContext = NoContext, workInProgressRoot = null, workInProgress = null, workInProgressRootRenderLanes = 0, NotSuspended = 0, SuspendedOnError = 1, SuspendedOnData = 2, SuspendedOnImmediate = 3, SuspendedOnInstance = 4, SuspendedOnInstanceAndReadyToContinue = 5, SuspendedOnDeprecatedThrowPromise = 6, SuspendedAndReadyToContinue = 7, SuspendedOnHydration = 8, SuspendedOnAction = 9, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, workInProgressRootDidSkipSuspendedSiblings = false, workInProgressRootIsPrerendering = false, workInProgressRootDidAttachPingListener = false, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, workInProgressRootSkippedLanes = 0, workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = false, globalMostRecentFallbackTime = 0, globalMostRecentTransitionTime = 0, FALLBACK_THROTTLE_MS = 300, workInProgressRootRenderTargetTime = Infinity, RENDER_TIMEOUT_MS = 500, workInProgressTransitions = null, workInProgressUpdateTask = null, legacyErrorBoundariesThatAlreadyFailed = null, IMMEDIATE_COMMIT = 0, ABORTED_VIEW_TRANSITION_COMMIT = 1, DELAYED_PASSIVE_COMMIT = 2, ANIMATION_STARTED_COMMIT = 3, NO_PENDING_EFFECTS = 0, PENDING_MUTATION_PHASE = 1, PENDING_LAYOUT_PHASE = 2, PENDING_AFTER_MUTATION_PHASE = 3, PENDING_SPAWNED_WORK = 4, PENDING_PASSIVE_PHASE = 5, pendingEffectsStatus = 0, pendingEffectsRoot = null, pendingFinishedWork = null, pendingEffectsLanes = 0, pendingEffectsRemainingLanes = 0, pendingEffectsRenderEndTime = -0, pendingPassiveTransitions = null, pendingRecoverableErrors = null, pendingSuspendedCommitReason = null, pendingDelayedCommitReason = IMMEDIATE_COMMIT, pendingSuspendedViewTransitionReason = null, NESTED_UPDATE_LIMIT = 50, nestedUpdateCount = 0, rootWithNestedUpdates = null, isFlushingPassiveEffects = false, didScheduleUpdateDuringPassiveEffects = false, NESTED_PASSIVE_UPDATE_LIMIT = 50, nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = false, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = false;
|
|
var didWarnAboutUpdateInRenderForAnotherComponent = /* @__PURE__ */ new Set();
|
|
var fakeActCallbackNode$1 = {}, firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = false, didScheduleMicrotask_act = false, mightHavePendingSyncWork = false, isFlushingWork = false, currentEventTransitionLane = 0, fakeActCallbackNode = {};
|
|
(function() {
|
|
for (var i = 0; i < simpleEventPluginEvents.length; i++) {
|
|
var eventName = simpleEventPluginEvents[i], domEventName = eventName.toLowerCase();
|
|
eventName = eventName[0].toUpperCase() + eventName.slice(1);
|
|
registerSimpleEvent(domEventName, "on" + eventName);
|
|
}
|
|
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
|
|
registerSimpleEvent(ANIMATION_ITERATION, "onAnimationIteration");
|
|
registerSimpleEvent(ANIMATION_START, "onAnimationStart");
|
|
registerSimpleEvent("dblclick", "onDoubleClick");
|
|
registerSimpleEvent("focusin", "onFocus");
|
|
registerSimpleEvent("focusout", "onBlur");
|
|
registerSimpleEvent(TRANSITION_RUN, "onTransitionRun");
|
|
registerSimpleEvent(TRANSITION_START, "onTransitionStart");
|
|
registerSimpleEvent(TRANSITION_CANCEL, "onTransitionCancel");
|
|
registerSimpleEvent(TRANSITION_END, "onTransitionEnd");
|
|
})();
|
|
registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]);
|
|
registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]);
|
|
registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]);
|
|
registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]);
|
|
registerTwoPhaseEvent(
|
|
"onChange",
|
|
"change click focusin focusout input keydown keyup selectionchange".split(
|
|
" "
|
|
)
|
|
);
|
|
registerTwoPhaseEvent(
|
|
"onSelect",
|
|
"focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(
|
|
" "
|
|
)
|
|
);
|
|
registerTwoPhaseEvent("onBeforeInput", [
|
|
"compositionend",
|
|
"keypress",
|
|
"textInput",
|
|
"paste"
|
|
]);
|
|
registerTwoPhaseEvent(
|
|
"onCompositionEnd",
|
|
"compositionend focusout keydown keypress keyup mousedown".split(" ")
|
|
);
|
|
registerTwoPhaseEvent(
|
|
"onCompositionStart",
|
|
"compositionstart focusout keydown keypress keyup mousedown".split(" ")
|
|
);
|
|
registerTwoPhaseEvent(
|
|
"onCompositionUpdate",
|
|
"compositionupdate focusout keydown keypress keyup mousedown".split(" ")
|
|
);
|
|
var mediaEventTypes = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(
|
|
" "
|
|
), nonDelegatedEvents = new Set(
|
|
"beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mediaEventTypes)
|
|
), listeningMarker = "_reactListening" + Math.random().toString(36).slice(2), didWarnControlledToUncontrolled = false, didWarnUncontrolledToControlled = false, didWarnFormActionType = false, didWarnFormActionName = false, didWarnFormActionTarget = false, didWarnFormActionMethod = false, didWarnPopoverTargetObject = false;
|
|
var didWarnForNewBooleanPropsWithEmptyValue = {};
|
|
var NORMALIZE_NEWLINES_REGEX = /\r\n?/g, NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g, xlinkNamespace = "http://www.w3.org/1999/xlink", xmlNamespace = "http://www.w3.org/XML/1998/namespace", EXPECTED_FORM_ACTION_URL = "javascript:throw new Error('React form unexpectedly submitted.')", SUPPRESS_HYDRATION_WARNING = "suppressHydrationWarning", ACTIVITY_START_DATA = "&", ACTIVITY_END_DATA = "/&", SUSPENSE_START_DATA = "$", SUSPENSE_END_DATA = "/$", SUSPENSE_PENDING_START_DATA = "$?", SUSPENSE_QUEUED_START_DATA = "$~", SUSPENSE_FALLBACK_START_DATA = "$!", PREAMBLE_CONTRIBUTION_HTML = "html", PREAMBLE_CONTRIBUTION_BODY = "body", PREAMBLE_CONTRIBUTION_HEAD = "head", FORM_STATE_IS_MATCHING = "F!", FORM_STATE_IS_NOT_MATCHING = "F", DOCUMENT_READY_STATE_LOADING = "loading", STYLE = "style", HostContextNamespaceNone = 0, HostContextNamespaceSvg = 1, HostContextNamespaceMath = 2, eventsEnabled = null, selectionInformation = null, warnedUnknownTags = { dialog: true, webview: true }, currentPopstateTransitionEvent = null, schedulerEvent = void 0, scheduleTimeout = "function" === typeof setTimeout ? setTimeout : void 0, cancelTimeout = "function" === typeof clearTimeout ? clearTimeout : void 0, noTimeout = -1, localPromise = "function" === typeof Promise ? Promise : void 0, scheduleMicrotask = "function" === typeof queueMicrotask ? queueMicrotask : "undefined" !== typeof localPromise ? function(callback) {
|
|
return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick);
|
|
} : scheduleTimeout, previousHydratableOnEnteringScopedSingleton = null, NotLoaded = 0, Loaded = 1, Errored = 2, Settled = 3, Inserted = 4, preloadPropsMap = /* @__PURE__ */ new Map(), preconnectsSet = /* @__PURE__ */ new Set(), previousDispatcher = ReactDOMSharedInternals.d;
|
|
ReactDOMSharedInternals.d = {
|
|
f: function() {
|
|
var previousWasRendering = previousDispatcher.f(), wasRendering = flushSyncWork$1();
|
|
return previousWasRendering || wasRendering;
|
|
},
|
|
r: function(form) {
|
|
var formInst = getInstanceFromNode(form);
|
|
null !== formInst && 5 === formInst.tag && "form" === formInst.type ? requestFormReset$1(formInst) : previousDispatcher.r(form);
|
|
},
|
|
D: function(href) {
|
|
previousDispatcher.D(href);
|
|
preconnectAs("dns-prefetch", href, null);
|
|
},
|
|
C: function(href, crossOrigin) {
|
|
previousDispatcher.C(href, crossOrigin);
|
|
preconnectAs("preconnect", href, crossOrigin);
|
|
},
|
|
L: function(href, as, options) {
|
|
previousDispatcher.L(href, as, options);
|
|
var ownerDocument = globalDocument;
|
|
if (ownerDocument && href && as) {
|
|
var preloadSelector = 'link[rel="preload"][as="' + escapeSelectorAttributeValueInsideDoubleQuotes(as) + '"]';
|
|
"image" === as ? options && options.imageSrcSet ? (preloadSelector += '[imagesrcset="' + escapeSelectorAttributeValueInsideDoubleQuotes(
|
|
options.imageSrcSet
|
|
) + '"]', "string" === typeof options.imageSizes && (preloadSelector += '[imagesizes="' + escapeSelectorAttributeValueInsideDoubleQuotes(
|
|
options.imageSizes
|
|
) + '"]')) : preloadSelector += '[href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"]' : preloadSelector += '[href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"]';
|
|
var key = preloadSelector;
|
|
switch (as) {
|
|
case "style":
|
|
key = getStyleKey(href);
|
|
break;
|
|
case "script":
|
|
key = getScriptKey(href);
|
|
}
|
|
preloadPropsMap.has(key) || (href = assign2(
|
|
{
|
|
rel: "preload",
|
|
href: "image" === as && options && options.imageSrcSet ? void 0 : href,
|
|
as
|
|
},
|
|
options
|
|
), preloadPropsMap.set(key, href), null !== ownerDocument.querySelector(preloadSelector) || "style" === as && ownerDocument.querySelector(
|
|
getStylesheetSelectorFromKey(key)
|
|
) || "script" === as && ownerDocument.querySelector(getScriptSelectorFromKey(key)) || (as = ownerDocument.createElement("link"), setInitialProperties(as, "link", href), markNodeAsHoistable(as), ownerDocument.head.appendChild(as)));
|
|
}
|
|
},
|
|
m: function(href, options) {
|
|
previousDispatcher.m(href, options);
|
|
var ownerDocument = globalDocument;
|
|
if (ownerDocument && href) {
|
|
var as = options && "string" === typeof options.as ? options.as : "script", preloadSelector = 'link[rel="modulepreload"][as="' + escapeSelectorAttributeValueInsideDoubleQuotes(as) + '"][href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"]', key = preloadSelector;
|
|
switch (as) {
|
|
case "audioworklet":
|
|
case "paintworklet":
|
|
case "serviceworker":
|
|
case "sharedworker":
|
|
case "worker":
|
|
case "script":
|
|
key = getScriptKey(href);
|
|
}
|
|
if (!preloadPropsMap.has(key) && (href = assign2({ rel: "modulepreload", href }, options), preloadPropsMap.set(key, href), null === ownerDocument.querySelector(preloadSelector))) {
|
|
switch (as) {
|
|
case "audioworklet":
|
|
case "paintworklet":
|
|
case "serviceworker":
|
|
case "sharedworker":
|
|
case "worker":
|
|
case "script":
|
|
if (ownerDocument.querySelector(getScriptSelectorFromKey(key)))
|
|
return;
|
|
}
|
|
as = ownerDocument.createElement("link");
|
|
setInitialProperties(as, "link", href);
|
|
markNodeAsHoistable(as);
|
|
ownerDocument.head.appendChild(as);
|
|
}
|
|
}
|
|
},
|
|
X: function(src, options) {
|
|
previousDispatcher.X(src, options);
|
|
var ownerDocument = globalDocument;
|
|
if (ownerDocument && src) {
|
|
var scripts = getResourcesFromRoot(ownerDocument).hoistableScripts, key = getScriptKey(src), resource = scripts.get(key);
|
|
resource || (resource = ownerDocument.querySelector(
|
|
getScriptSelectorFromKey(key)
|
|
), resource || (src = assign2({ src, async: true }, options), (options = preloadPropsMap.get(key)) && adoptPreloadPropsForScript(src, options), resource = ownerDocument.createElement("script"), markNodeAsHoistable(resource), setInitialProperties(resource, "link", src), ownerDocument.head.appendChild(resource)), resource = {
|
|
type: "script",
|
|
instance: resource,
|
|
count: 1,
|
|
state: null
|
|
}, scripts.set(key, resource));
|
|
}
|
|
},
|
|
S: function(href, precedence, options) {
|
|
previousDispatcher.S(href, precedence, options);
|
|
var ownerDocument = globalDocument;
|
|
if (ownerDocument && href) {
|
|
var styles = getResourcesFromRoot(ownerDocument).hoistableStyles, key = getStyleKey(href);
|
|
precedence = precedence || "default";
|
|
var resource = styles.get(key);
|
|
if (!resource) {
|
|
var state = { loading: NotLoaded, preload: null };
|
|
if (resource = ownerDocument.querySelector(
|
|
getStylesheetSelectorFromKey(key)
|
|
))
|
|
state.loading = Loaded | Inserted;
|
|
else {
|
|
href = assign2(
|
|
{
|
|
rel: "stylesheet",
|
|
href,
|
|
"data-precedence": precedence
|
|
},
|
|
options
|
|
);
|
|
(options = preloadPropsMap.get(key)) && adoptPreloadPropsForStylesheet(href, options);
|
|
var link = resource = ownerDocument.createElement("link");
|
|
markNodeAsHoistable(link);
|
|
setInitialProperties(link, "link", href);
|
|
link._p = new Promise(function(resolve, reject) {
|
|
link.onload = resolve;
|
|
link.onerror = reject;
|
|
});
|
|
link.addEventListener("load", function() {
|
|
state.loading |= Loaded;
|
|
});
|
|
link.addEventListener("error", function() {
|
|
state.loading |= Errored;
|
|
});
|
|
state.loading |= Inserted;
|
|
insertStylesheet(resource, precedence, ownerDocument);
|
|
}
|
|
resource = {
|
|
type: "stylesheet",
|
|
instance: resource,
|
|
count: 1,
|
|
state
|
|
};
|
|
styles.set(key, resource);
|
|
}
|
|
}
|
|
},
|
|
M: function(src, options) {
|
|
previousDispatcher.M(src, options);
|
|
var ownerDocument = globalDocument;
|
|
if (ownerDocument && src) {
|
|
var scripts = getResourcesFromRoot(ownerDocument).hoistableScripts, key = getScriptKey(src), resource = scripts.get(key);
|
|
resource || (resource = ownerDocument.querySelector(
|
|
getScriptSelectorFromKey(key)
|
|
), resource || (src = assign2({ src, async: true, type: "module" }, options), (options = preloadPropsMap.get(key)) && adoptPreloadPropsForScript(src, options), resource = ownerDocument.createElement("script"), markNodeAsHoistable(resource), setInitialProperties(resource, "link", src), ownerDocument.head.appendChild(resource)), resource = {
|
|
type: "script",
|
|
instance: resource,
|
|
count: 1,
|
|
state: null
|
|
}, scripts.set(key, resource));
|
|
}
|
|
}
|
|
};
|
|
var globalDocument = "undefined" === typeof document ? null : document, tagCaches = null, SUSPENSEY_STYLESHEET_TIMEOUT = 6e4, SUSPENSEY_IMAGE_TIMEOUT = 800, SUSPENSEY_IMAGE_TIME_ESTIMATE = 500, estimatedBytesWithinLimit = 0, LAST_PRECEDENCE = null, precedencesByRoot = null, NotPendingTransition = NotPending, HostTransitionContext = {
|
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
Provider: null,
|
|
Consumer: null,
|
|
_currentValue: NotPendingTransition,
|
|
_currentValue2: NotPendingTransition,
|
|
_threadCount: 0
|
|
}, badgeFormat = "%c%s%c", badgeStyle = "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", resetStyle = "", pad = " ", bind = Function.prototype.bind;
|
|
var didWarnAboutNestedUpdates = false;
|
|
var overrideHookState = null, overrideHookStateDeletePath = null, overrideHookStateRenamePath = null, overrideProps = null, overridePropsDeletePath = null, overridePropsRenamePath = null, scheduleUpdate = null, scheduleRetry = null, setErrorHandler = null, setSuspenseHandler = null;
|
|
overrideHookState = function(fiber, id, path, value) {
|
|
id = findHook(fiber, id);
|
|
null !== id && (path = copyWithSetImpl(id.memoizedState, path, 0, value), id.memoizedState = path, id.baseState = path, fiber.memoizedProps = assign2({}, fiber.memoizedProps), path = enqueueConcurrentRenderForLane(fiber, 2), null !== path && scheduleUpdateOnFiber(path, fiber, 2));
|
|
};
|
|
overrideHookStateDeletePath = function(fiber, id, path) {
|
|
id = findHook(fiber, id);
|
|
null !== id && (path = copyWithDeleteImpl(id.memoizedState, path, 0), id.memoizedState = path, id.baseState = path, fiber.memoizedProps = assign2({}, fiber.memoizedProps), path = enqueueConcurrentRenderForLane(fiber, 2), null !== path && scheduleUpdateOnFiber(path, fiber, 2));
|
|
};
|
|
overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) {
|
|
id = findHook(fiber, id);
|
|
null !== id && (oldPath = copyWithRename(id.memoizedState, oldPath, newPath), id.memoizedState = oldPath, id.baseState = oldPath, fiber.memoizedProps = assign2({}, fiber.memoizedProps), oldPath = enqueueConcurrentRenderForLane(fiber, 2), null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2));
|
|
};
|
|
overrideProps = function(fiber, path, value) {
|
|
fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path, 0, value);
|
|
fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
|
|
path = enqueueConcurrentRenderForLane(fiber, 2);
|
|
null !== path && scheduleUpdateOnFiber(path, fiber, 2);
|
|
};
|
|
overridePropsDeletePath = function(fiber, path) {
|
|
fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path, 0);
|
|
fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
|
|
path = enqueueConcurrentRenderForLane(fiber, 2);
|
|
null !== path && scheduleUpdateOnFiber(path, fiber, 2);
|
|
};
|
|
overridePropsRenamePath = function(fiber, oldPath, newPath) {
|
|
fiber.pendingProps = copyWithRename(
|
|
fiber.memoizedProps,
|
|
oldPath,
|
|
newPath
|
|
);
|
|
fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
|
|
oldPath = enqueueConcurrentRenderForLane(fiber, 2);
|
|
null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2);
|
|
};
|
|
scheduleUpdate = function(fiber) {
|
|
var root2 = enqueueConcurrentRenderForLane(fiber, 2);
|
|
null !== root2 && scheduleUpdateOnFiber(root2, fiber, 2);
|
|
};
|
|
scheduleRetry = function(fiber) {
|
|
var lane = claimNextRetryLane(), root2 = enqueueConcurrentRenderForLane(fiber, lane);
|
|
null !== root2 && scheduleUpdateOnFiber(root2, fiber, lane);
|
|
};
|
|
setErrorHandler = function(newShouldErrorImpl) {
|
|
shouldErrorImpl = newShouldErrorImpl;
|
|
};
|
|
setSuspenseHandler = function(newShouldSuspendImpl) {
|
|
shouldSuspendImpl = newShouldSuspendImpl;
|
|
};
|
|
var _enabled = true, return_targetInst = null, hasScheduledReplayAttempt = false, queuedFocus = null, queuedDrag = null, queuedMouse = null, queuedPointers = /* @__PURE__ */ new Map(), queuedPointerCaptures = /* @__PURE__ */ new Map(), queuedExplicitHydrationTargets = [], discreteReplayableEvents = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(
|
|
" "
|
|
), lastScheduledReplayQueue = null;
|
|
ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function(children) {
|
|
var root2 = this._internalRoot;
|
|
if (null === root2) throw Error("Cannot update an unmounted root.");
|
|
var args = arguments;
|
|
"function" === typeof args[1] ? console.error(
|
|
"does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."
|
|
) : isValidContainer(args[1]) ? console.error(
|
|
"You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root."
|
|
) : "undefined" !== typeof args[1] && console.error(
|
|
"You passed a second argument to root.render(...) but it only accepts one argument."
|
|
);
|
|
args = children;
|
|
var current2 = root2.current, lane = requestUpdateLane(current2);
|
|
updateContainerImpl(current2, lane, args, root2, null, null);
|
|
};
|
|
ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function() {
|
|
var args = arguments;
|
|
"function" === typeof args[0] && console.error(
|
|
"does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."
|
|
);
|
|
args = this._internalRoot;
|
|
if (null !== args) {
|
|
this._internalRoot = null;
|
|
var container = args.containerInfo;
|
|
(executionContext & (RenderContext | CommitContext)) !== NoContext && console.error(
|
|
"Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."
|
|
);
|
|
updateContainerImpl(args.current, 2, null, args, null, null);
|
|
flushSyncWork$1();
|
|
container[internalContainerInstanceKey] = null;
|
|
}
|
|
};
|
|
ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function(target) {
|
|
if (target) {
|
|
var updatePriority = resolveUpdatePriority();
|
|
target = { blockedOn: null, target, priority: updatePriority };
|
|
for (var i = 0; i < queuedExplicitHydrationTargets.length && 0 !== updatePriority && updatePriority < queuedExplicitHydrationTargets[i].priority; i++) ;
|
|
queuedExplicitHydrationTargets.splice(i, 0, target);
|
|
0 === i && attemptExplicitHydrationTarget(target);
|
|
}
|
|
};
|
|
(function() {
|
|
var isomorphicReactPackageVersion = React58.version;
|
|
if ("19.2.7" !== isomorphicReactPackageVersion)
|
|
throw Error(
|
|
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + "\n - react-dom: 19.2.7\nLearn more: https://react.dev/warnings/version-mismatch")
|
|
);
|
|
})();
|
|
"function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error(
|
|
"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://react.dev/link/react-polyfills"
|
|
);
|
|
ReactDOMSharedInternals.findDOMNode = function(componentOrElement) {
|
|
var fiber = componentOrElement._reactInternals;
|
|
if (void 0 === fiber) {
|
|
if ("function" === typeof componentOrElement.render)
|
|
throw Error("Unable to find node on an unmounted component.");
|
|
componentOrElement = Object.keys(componentOrElement).join(",");
|
|
throw Error(
|
|
"Argument appears to not be a ReactComponent. Keys: " + componentOrElement
|
|
);
|
|
}
|
|
componentOrElement = findCurrentFiberUsingSlowPath(fiber);
|
|
componentOrElement = null !== componentOrElement ? findCurrentHostFiberImpl(componentOrElement) : null;
|
|
componentOrElement = null === componentOrElement ? null : componentOrElement.stateNode;
|
|
return componentOrElement;
|
|
};
|
|
if (!(function() {
|
|
var internals = {
|
|
bundleType: 1,
|
|
version: "19.2.7",
|
|
rendererPackageName: "react-dom",
|
|
currentDispatcherRef: ReactSharedInternals,
|
|
reconcilerVersion: "19.2.7"
|
|
};
|
|
internals.overrideHookState = overrideHookState;
|
|
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
|
|
internals.overrideHookStateRenamePath = overrideHookStateRenamePath;
|
|
internals.overrideProps = overrideProps;
|
|
internals.overridePropsDeletePath = overridePropsDeletePath;
|
|
internals.overridePropsRenamePath = overridePropsRenamePath;
|
|
internals.scheduleUpdate = scheduleUpdate;
|
|
internals.scheduleRetry = scheduleRetry;
|
|
internals.setErrorHandler = setErrorHandler;
|
|
internals.setSuspenseHandler = setSuspenseHandler;
|
|
internals.scheduleRefresh = scheduleRefresh;
|
|
internals.scheduleRoot = scheduleRoot;
|
|
internals.setRefreshHandler = setRefreshHandler;
|
|
internals.getCurrentFiber = getCurrentFiberForDevTools;
|
|
return injectInternals(internals);
|
|
})() && canUseDOM && window.top === window.self && (-1 < navigator.userAgent.indexOf("Chrome") && -1 === navigator.userAgent.indexOf("Edge") || -1 < navigator.userAgent.indexOf("Firefox"))) {
|
|
var protocol = window.location.protocol;
|
|
/^(https?|file):$/.test(protocol) && console.info(
|
|
"%cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools" + ("file:" === protocol ? "\nYou might need to use a local HTTP server (instead of file://): https://react.dev/link/react-devtools-faq" : ""),
|
|
"font-weight:bold"
|
|
);
|
|
}
|
|
exports.createRoot = function(container, options) {
|
|
if (!isValidContainer(container))
|
|
throw Error("Target container is not a DOM element.");
|
|
warnIfReactDOMContainerInDEV(container);
|
|
var isStrictMode = false, identifierPrefix = "", onUncaughtError = defaultOnUncaughtError, onCaughtError = defaultOnCaughtError, onRecoverableError = defaultOnRecoverableError;
|
|
null !== options && void 0 !== options && (options.hydrate ? console.warn(
|
|
"hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead."
|
|
) : "object" === typeof options && null !== options && options.$$typeof === REACT_ELEMENT_TYPE && console.error(
|
|
"You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:\n\n let root = createRoot(domContainer);\n root.render(<App />);"
|
|
), true === options.unstable_strictMode && (isStrictMode = true), void 0 !== options.identifierPrefix && (identifierPrefix = options.identifierPrefix), void 0 !== options.onUncaughtError && (onUncaughtError = options.onUncaughtError), void 0 !== options.onCaughtError && (onCaughtError = options.onCaughtError), void 0 !== options.onRecoverableError && (onRecoverableError = options.onRecoverableError));
|
|
options = createFiberRoot(
|
|
container,
|
|
1,
|
|
false,
|
|
null,
|
|
null,
|
|
isStrictMode,
|
|
identifierPrefix,
|
|
null,
|
|
onUncaughtError,
|
|
onCaughtError,
|
|
onRecoverableError,
|
|
defaultOnDefaultTransitionIndicator
|
|
);
|
|
container[internalContainerInstanceKey] = options.current;
|
|
listenToAllSupportedEvents(container);
|
|
return new ReactDOMRoot(options);
|
|
};
|
|
exports.hydrateRoot = function(container, initialChildren, options) {
|
|
if (!isValidContainer(container))
|
|
throw Error("Target container is not a DOM element.");
|
|
warnIfReactDOMContainerInDEV(container);
|
|
void 0 === initialChildren && console.error(
|
|
"Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)"
|
|
);
|
|
var isStrictMode = false, identifierPrefix = "", onUncaughtError = defaultOnUncaughtError, onCaughtError = defaultOnCaughtError, onRecoverableError = defaultOnRecoverableError, formState = null;
|
|
null !== options && void 0 !== options && (true === options.unstable_strictMode && (isStrictMode = true), void 0 !== options.identifierPrefix && (identifierPrefix = options.identifierPrefix), void 0 !== options.onUncaughtError && (onUncaughtError = options.onUncaughtError), void 0 !== options.onCaughtError && (onCaughtError = options.onCaughtError), void 0 !== options.onRecoverableError && (onRecoverableError = options.onRecoverableError), void 0 !== options.formState && (formState = options.formState));
|
|
initialChildren = createFiberRoot(
|
|
container,
|
|
1,
|
|
true,
|
|
initialChildren,
|
|
null != options ? options : null,
|
|
isStrictMode,
|
|
identifierPrefix,
|
|
formState,
|
|
onUncaughtError,
|
|
onCaughtError,
|
|
onRecoverableError,
|
|
defaultOnDefaultTransitionIndicator
|
|
);
|
|
initialChildren.context = getContextForSubtree(null);
|
|
options = initialChildren.current;
|
|
isStrictMode = requestUpdateLane(options);
|
|
isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode);
|
|
identifierPrefix = createUpdate(isStrictMode);
|
|
identifierPrefix.callback = null;
|
|
enqueueUpdate(options, identifierPrefix, isStrictMode);
|
|
startUpdateTimerByLane(isStrictMode, "hydrateRoot()", null);
|
|
options = isStrictMode;
|
|
initialChildren.current.lanes = options;
|
|
markRootUpdated$1(initialChildren, options);
|
|
ensureRootIsScheduled(initialChildren);
|
|
container[internalContainerInstanceKey] = initialChildren.current;
|
|
listenToAllSupportedEvents(container);
|
|
return new ReactDOMHydrationRoot(initialChildren);
|
|
};
|
|
exports.version = "19.2.7";
|
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
})();
|
|
}
|
|
});
|
|
|
|
// node_modules/react-dom/client.js
|
|
var require_client = __commonJS({
|
|
"node_modules/react-dom/client.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
checkDCE();
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_dom_client_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
|
|
var require_react_is_development = __commonJS({
|
|
"node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(function() {
|
|
"use strict";
|
|
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
var REACT_ELEMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
|
|
var REACT_PORTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.portal") : 60106;
|
|
var REACT_FRAGMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107;
|
|
var REACT_STRICT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108;
|
|
var REACT_PROFILER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114;
|
|
var REACT_PROVIDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.provider") : 60109;
|
|
var REACT_CONTEXT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.context") : 60110;
|
|
var REACT_ASYNC_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111;
|
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111;
|
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112;
|
|
var REACT_SUSPENSE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113;
|
|
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120;
|
|
var REACT_MEMO_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.memo") : 60115;
|
|
var REACT_LAZY_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116;
|
|
var REACT_BLOCK_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.block") : 60121;
|
|
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117;
|
|
var REACT_RESPONDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.responder") : 60118;
|
|
var REACT_SCOPE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
|
|
function isValidElementType2(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 void 0;
|
|
}
|
|
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
var Element2 = REACT_ELEMENT_TYPE;
|
|
var ForwardRef2 = REACT_FORWARD_REF_TYPE;
|
|
var Fragment6 = REACT_FRAGMENT_TYPE;
|
|
var Lazy = REACT_LAZY_TYPE;
|
|
var Memo2 = 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;
|
|
function isAsyncMode(object) {
|
|
{
|
|
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
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 = Element2;
|
|
exports.ForwardRef = ForwardRef2;
|
|
exports.Fragment = Fragment6;
|
|
exports.Lazy = Lazy;
|
|
exports.Memo = Memo2;
|
|
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 = isValidElementType2;
|
|
exports.typeOf = typeOf;
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/node_modules/react-is/index.js
|
|
var require_react_is = __commonJS({
|
|
"node_modules/prop-types/node_modules/react-is/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_is_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/object-assign/index.js
|
|
var require_object_assign = __commonJS({
|
|
"node_modules/object-assign/index.js"(exports, module2) {
|
|
"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;
|
|
}
|
|
}
|
|
module2.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
|
var from2;
|
|
var to = toObject(target);
|
|
var symbols;
|
|
for (var s = 1; s < arguments.length; s++) {
|
|
from2 = Object(arguments[s]);
|
|
for (var key in from2) {
|
|
if (hasOwnProperty.call(from2, key)) {
|
|
to[key] = from2[key];
|
|
}
|
|
}
|
|
if (getOwnPropertySymbols) {
|
|
symbols = getOwnPropertySymbols(from2);
|
|
for (var i = 0; i < symbols.length; i++) {
|
|
if (propIsEnumerable.call(from2, symbols[i])) {
|
|
to[symbols[i]] = from2[symbols[i]];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return to;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/lib/ReactPropTypesSecret.js
|
|
var require_ReactPropTypesSecret = __commonJS({
|
|
"node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module2) {
|
|
"use strict";
|
|
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
module2.exports = ReactPropTypesSecret;
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/lib/has.js
|
|
var require_has = __commonJS({
|
|
"node_modules/prop-types/lib/has.js"(exports, module2) {
|
|
module2.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/checkPropTypes.js
|
|
var require_checkPropTypes = __commonJS({
|
|
"node_modules/prop-types/checkPropTypes.js"(exports, module2) {
|
|
"use strict";
|
|
var printWarning = function() {
|
|
};
|
|
if (true) {
|
|
ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
loggedTypeFailures = {};
|
|
has = require_has();
|
|
printWarning = function(text) {
|
|
var message = "Warning: " + text;
|
|
if (typeof console !== "undefined") {
|
|
console.error(message);
|
|
}
|
|
try {
|
|
throw new Error(message);
|
|
} catch (x) {
|
|
}
|
|
};
|
|
}
|
|
var ReactPropTypesSecret;
|
|
var loggedTypeFailures;
|
|
var has;
|
|
function checkPropTypes(typeSpecs, values3, location, componentName, getStack) {
|
|
if (true) {
|
|
for (var typeSpecName in typeSpecs) {
|
|
if (has(typeSpecs, typeSpecName)) {
|
|
var error;
|
|
try {
|
|
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](values3, 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)) {
|
|
loggedTypeFailures[error.message] = true;
|
|
var stack = getStack ? getStack() : "";
|
|
printWarning(
|
|
"Failed " + location + " type: " + error.message + (stack != null ? stack : "")
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
checkPropTypes.resetWarningCache = function() {
|
|
if (true) {
|
|
loggedTypeFailures = {};
|
|
}
|
|
};
|
|
module2.exports = checkPropTypes;
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/factoryWithTypeCheckers.js
|
|
var require_factoryWithTypeCheckers = __commonJS({
|
|
"node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module2) {
|
|
"use strict";
|
|
var ReactIs = require_react_is();
|
|
var assign2 = require_object_assign();
|
|
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
var has = require_has();
|
|
var checkPropTypes = require_checkPropTypes();
|
|
var printWarning = function() {
|
|
};
|
|
if (true) {
|
|
printWarning = function(text) {
|
|
var message = "Warning: " + text;
|
|
if (typeof console !== "undefined") {
|
|
console.error(message);
|
|
}
|
|
try {
|
|
throw new Error(message);
|
|
} catch (x) {
|
|
}
|
|
};
|
|
}
|
|
function emptyFunctionThatReturnsNull() {
|
|
return null;
|
|
}
|
|
module2.exports = function(isValidElement5, throwOnDirectAccess) {
|
|
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
function getIteratorFn(maybeIterable) {
|
|
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
if (typeof iteratorFn === "function") {
|
|
return iteratorFn;
|
|
}
|
|
}
|
|
var ANONYMOUS = "<<anonymous>>";
|
|
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
|
|
};
|
|
function is2(x, y) {
|
|
if (x === y) {
|
|
return x !== 0 || 1 / x === 1 / y;
|
|
} else {
|
|
return x !== x && y !== y;
|
|
}
|
|
}
|
|
function PropTypeError(message, data) {
|
|
this.message = message;
|
|
this.data = data && typeof data === "object" ? data : {};
|
|
this.stack = "";
|
|
}
|
|
PropTypeError.prototype = Error.prototype;
|
|
function createChainableTypeChecker(validate) {
|
|
if (true) {
|
|
var manualPropTypeCallCache = {};
|
|
var manualPropTypeWarningCount = 0;
|
|
}
|
|
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
componentName = componentName || ANONYMOUS;
|
|
propFullName = propFullName || propName;
|
|
if (secret !== ReactPropTypesSecret) {
|
|
if (throwOnDirectAccess) {
|
|
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 (typeof console !== "undefined") {
|
|
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) {
|
|
var preciseType = getPreciseType(propValue);
|
|
return new PropTypeError(
|
|
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + 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 + "]", 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 (!isValidElement5(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 (!ReactIs.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 (true) {
|
|
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 (is2(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 (has(propValue, key)) {
|
|
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
if (error instanceof Error) {
|
|
return error;
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
true ? 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 i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
|
|
var checker2 = arrayOfTypeCheckers[i2];
|
|
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
if (checkerResult == null) {
|
|
return null;
|
|
}
|
|
if (checkerResult.data && 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, 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`."));
|
|
}
|
|
var allKeys = assign2({}, props[propName], shapeTypes);
|
|
for (var key in allKeys) {
|
|
var checker = shapeTypes[key];
|
|
if (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, 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 || isValidElement5(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 {
|
|
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) {
|
|
if (propType === "symbol") {
|
|
return true;
|
|
}
|
|
if (!propValue) {
|
|
return false;
|
|
}
|
|
if (propValue["@@toStringTag"] === "Symbol") {
|
|
return true;
|
|
}
|
|
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function getPropType(propValue) {
|
|
var propType = typeof propValue;
|
|
if (Array.isArray(propValue)) {
|
|
return "array";
|
|
}
|
|
if (propValue instanceof RegExp) {
|
|
return "object";
|
|
}
|
|
if (isSymbol(propType, propValue)) {
|
|
return "symbol";
|
|
}
|
|
return propType;
|
|
}
|
|
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;
|
|
}
|
|
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;
|
|
}
|
|
}
|
|
function getClassName(propValue) {
|
|
if (!propValue.constructor || !propValue.constructor.name) {
|
|
return ANONYMOUS;
|
|
}
|
|
return propValue.constructor.name;
|
|
}
|
|
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
return ReactPropTypes;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/index.js
|
|
var require_prop_types = __commonJS({
|
|
"node_modules/prop-types/index.js"(exports, module2) {
|
|
if (true) {
|
|
ReactIs = require_react_is();
|
|
throwOnDirectAccess = true;
|
|
module2.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
} else {
|
|
module2.exports = null();
|
|
}
|
|
var ReactIs;
|
|
var throwOnDirectAccess;
|
|
}
|
|
});
|
|
|
|
// node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
|
|
var require_use_sync_external_store_shim_development = __commonJS({
|
|
"node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
|
|
"use strict";
|
|
(function() {
|
|
function is2(x, y) {
|
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
}
|
|
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
didWarnOld18Alpha || void 0 === React58.startTransition || (didWarnOld18Alpha = true, console.error(
|
|
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
));
|
|
var value = getSnapshot();
|
|
if (!didWarnUncachedGetSnapshot) {
|
|
var cachedValue = getSnapshot();
|
|
objectIs(value, cachedValue) || (console.error(
|
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
), didWarnUncachedGetSnapshot = true);
|
|
}
|
|
cachedValue = useState9({
|
|
inst: { value, getSnapshot }
|
|
});
|
|
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
|
|
useLayoutEffect4(
|
|
function() {
|
|
inst.value = value;
|
|
inst.getSnapshot = getSnapshot;
|
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
},
|
|
[subscribe, value, getSnapshot]
|
|
);
|
|
useEffect12(
|
|
function() {
|
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
return subscribe(function() {
|
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
});
|
|
},
|
|
[subscribe]
|
|
);
|
|
useDebugValue2(value);
|
|
return value;
|
|
}
|
|
function checkIfSnapshotChanged(inst) {
|
|
var latestGetSnapshot = inst.getSnapshot;
|
|
inst = inst.value;
|
|
try {
|
|
var nextValue = latestGetSnapshot();
|
|
return !objectIs(inst, nextValue);
|
|
} catch (error) {
|
|
return true;
|
|
}
|
|
}
|
|
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
return getSnapshot();
|
|
}
|
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
var React58 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is2, useState9 = React58.useState, useEffect12 = React58.useEffect, useLayoutEffect4 = React58.useLayoutEffect, useDebugValue2 = React58.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
exports.useSyncExternalStore = void 0 !== React58.useSyncExternalStore ? React58.useSyncExternalStore : shim;
|
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
})();
|
|
}
|
|
});
|
|
|
|
// node_modules/use-sync-external-store/shim/index.js
|
|
var require_shim = __commonJS({
|
|
"node_modules/use-sync-external-store/shim/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_use_sync_external_store_shim_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
|
|
var require_with_selector_development = __commonJS({
|
|
"node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) {
|
|
"use strict";
|
|
(function() {
|
|
function is2(x, y) {
|
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
}
|
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
var React58 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is2, useSyncExternalStore2 = shim.useSyncExternalStore, useRef12 = React58.useRef, useEffect12 = React58.useEffect, useMemo7 = React58.useMemo, useDebugValue2 = React58.useDebugValue;
|
|
exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
var instRef = useRef12(null);
|
|
if (null === instRef.current) {
|
|
var inst = { hasValue: false, value: null };
|
|
instRef.current = inst;
|
|
} else inst = instRef.current;
|
|
instRef = useMemo7(
|
|
function() {
|
|
function memoizedSelector(nextSnapshot) {
|
|
if (!hasMemo) {
|
|
hasMemo = true;
|
|
memoizedSnapshot = nextSnapshot;
|
|
nextSnapshot = selector(nextSnapshot);
|
|
if (void 0 !== isEqual && inst.hasValue) {
|
|
var currentSelection = inst.value;
|
|
if (isEqual(currentSelection, nextSnapshot))
|
|
return memoizedSelection = currentSelection;
|
|
}
|
|
return memoizedSelection = nextSnapshot;
|
|
}
|
|
currentSelection = memoizedSelection;
|
|
if (objectIs(memoizedSnapshot, nextSnapshot))
|
|
return currentSelection;
|
|
var nextSelection = selector(nextSnapshot);
|
|
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
|
|
return memoizedSnapshot = nextSnapshot, currentSelection;
|
|
memoizedSnapshot = nextSnapshot;
|
|
return memoizedSelection = nextSelection;
|
|
}
|
|
var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
|
|
return [
|
|
function() {
|
|
return memoizedSelector(getSnapshot());
|
|
},
|
|
null === maybeGetServerSnapshot ? void 0 : function() {
|
|
return memoizedSelector(maybeGetServerSnapshot());
|
|
}
|
|
];
|
|
},
|
|
[getSnapshot, getServerSnapshot, selector, isEqual]
|
|
);
|
|
var value = useSyncExternalStore2(subscribe, instRef[0], instRef[1]);
|
|
useEffect12(
|
|
function() {
|
|
inst.hasValue = true;
|
|
inst.value = value;
|
|
},
|
|
[value]
|
|
);
|
|
useDebugValue2(value);
|
|
return value;
|
|
};
|
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
})();
|
|
}
|
|
});
|
|
|
|
// node_modules/use-sync-external-store/shim/with-selector.js
|
|
var require_with_selector = __commonJS({
|
|
"node_modules/use-sync-external-store/shim/with-selector.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_with_selector_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react-is/cjs/react-is.development.js
|
|
var require_react_is_development2 = __commonJS({
|
|
"node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
"use strict";
|
|
(function() {
|
|
function typeOf(object) {
|
|
if ("object" === typeof object && null !== object) {
|
|
var $$typeof = object.$$typeof;
|
|
switch ($$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
switch (object = object.type, object) {
|
|
case REACT_FRAGMENT_TYPE:
|
|
case REACT_PROFILER_TYPE:
|
|
case REACT_STRICT_MODE_TYPE:
|
|
case REACT_SUSPENSE_TYPE:
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
case REACT_VIEW_TRANSITION_TYPE:
|
|
return object;
|
|
default:
|
|
switch (object = object && object.$$typeof, object) {
|
|
case REACT_CONTEXT_TYPE:
|
|
case REACT_FORWARD_REF_TYPE:
|
|
case REACT_LAZY_TYPE:
|
|
case REACT_MEMO_TYPE:
|
|
return object;
|
|
case REACT_CONSUMER_TYPE:
|
|
return object;
|
|
default:
|
|
return $$typeof;
|
|
}
|
|
}
|
|
case REACT_PORTAL_TYPE:
|
|
return $$typeof;
|
|
}
|
|
}
|
|
}
|
|
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = /* @__PURE__ */ Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference");
|
|
exports.ContextConsumer = REACT_CONSUMER_TYPE;
|
|
exports.ContextProvider = REACT_CONTEXT_TYPE;
|
|
exports.Element = REACT_ELEMENT_TYPE;
|
|
exports.ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
exports.Lazy = REACT_LAZY_TYPE;
|
|
exports.Memo = REACT_MEMO_TYPE;
|
|
exports.Portal = REACT_PORTAL_TYPE;
|
|
exports.Profiler = REACT_PROFILER_TYPE;
|
|
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
exports.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
exports.isContextConsumer = function(object) {
|
|
return typeOf(object) === REACT_CONSUMER_TYPE;
|
|
};
|
|
exports.isContextProvider = function(object) {
|
|
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
};
|
|
exports.isElement = function(object) {
|
|
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
};
|
|
exports.isForwardRef = function(object) {
|
|
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
};
|
|
exports.isFragment = function(object) {
|
|
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
};
|
|
exports.isLazy = function(object) {
|
|
return typeOf(object) === REACT_LAZY_TYPE;
|
|
};
|
|
exports.isMemo = function(object) {
|
|
return typeOf(object) === REACT_MEMO_TYPE;
|
|
};
|
|
exports.isPortal = function(object) {
|
|
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
};
|
|
exports.isProfiler = function(object) {
|
|
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
};
|
|
exports.isStrictMode = function(object) {
|
|
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
};
|
|
exports.isSuspense = function(object) {
|
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
};
|
|
exports.isSuspenseList = function(object) {
|
|
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
};
|
|
exports.isValidElementType = function(type) {
|
|
return "string" === typeof type || "function" === typeof type || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || "object" === typeof type && null !== type && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || void 0 !== type.getModuleId) ? true : false;
|
|
};
|
|
exports.typeOf = typeOf;
|
|
})();
|
|
}
|
|
});
|
|
|
|
// node_modules/react-is/index.js
|
|
var require_react_is2 = __commonJS({
|
|
"node_modules/react-is/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_is_development2();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js
|
|
var require_react_is_development3 = __commonJS({
|
|
"node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(function() {
|
|
"use strict";
|
|
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
var REACT_ELEMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
|
|
var REACT_PORTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.portal") : 60106;
|
|
var REACT_FRAGMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107;
|
|
var REACT_STRICT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108;
|
|
var REACT_PROFILER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114;
|
|
var REACT_PROVIDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.provider") : 60109;
|
|
var REACT_CONTEXT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.context") : 60110;
|
|
var REACT_ASYNC_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111;
|
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111;
|
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112;
|
|
var REACT_SUSPENSE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113;
|
|
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120;
|
|
var REACT_MEMO_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.memo") : 60115;
|
|
var REACT_LAZY_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116;
|
|
var REACT_BLOCK_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.block") : 60121;
|
|
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117;
|
|
var REACT_RESPONDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.responder") : 60118;
|
|
var REACT_SCOPE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
|
|
function isValidElementType2(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 void 0;
|
|
}
|
|
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
var Element2 = REACT_ELEMENT_TYPE;
|
|
var ForwardRef2 = REACT_FORWARD_REF_TYPE;
|
|
var Fragment6 = REACT_FRAGMENT_TYPE;
|
|
var Lazy = REACT_LAZY_TYPE;
|
|
var Memo2 = 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;
|
|
function isAsyncMode(object) {
|
|
{
|
|
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
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 = Element2;
|
|
exports.ForwardRef = ForwardRef2;
|
|
exports.Fragment = Fragment6;
|
|
exports.Lazy = Lazy;
|
|
exports.Memo = Memo2;
|
|
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 = isValidElementType2;
|
|
exports.typeOf = typeOf;
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/hoist-non-react-statics/node_modules/react-is/index.js
|
|
var require_react_is3 = __commonJS({
|
|
"node_modules/hoist-non-react-statics/node_modules/react-is/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_is_development3();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
|
|
var require_hoist_non_react_statics_cjs = __commonJS({
|
|
"node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"(exports, module2) {
|
|
"use strict";
|
|
var reactIs = require_react_is3();
|
|
var REACT_STATICS = {
|
|
childContextTypes: true,
|
|
contextType: true,
|
|
contextTypes: true,
|
|
defaultProps: true,
|
|
displayName: true,
|
|
getDefaultProps: true,
|
|
getDerivedStateFromError: true,
|
|
getDerivedStateFromProps: true,
|
|
mixins: true,
|
|
propTypes: true,
|
|
type: true
|
|
};
|
|
var KNOWN_STATICS = {
|
|
name: true,
|
|
length: true,
|
|
prototype: true,
|
|
caller: true,
|
|
callee: true,
|
|
arguments: true,
|
|
arity: true
|
|
};
|
|
var FORWARD_REF_STATICS = {
|
|
"$$typeof": true,
|
|
render: true,
|
|
defaultProps: true,
|
|
displayName: true,
|
|
propTypes: true
|
|
};
|
|
var MEMO_STATICS = {
|
|
"$$typeof": true,
|
|
compare: true,
|
|
defaultProps: true,
|
|
displayName: true,
|
|
propTypes: true,
|
|
type: true
|
|
};
|
|
var TYPE_STATICS = {};
|
|
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
|
function getStatics(component) {
|
|
if (reactIs.isMemo(component)) {
|
|
return MEMO_STATICS;
|
|
}
|
|
return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS;
|
|
}
|
|
var defineProperty = Object.defineProperty;
|
|
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
var getPrototypeOf = Object.getPrototypeOf;
|
|
var objectPrototype = Object.prototype;
|
|
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
|
if (typeof sourceComponent !== "string") {
|
|
if (objectPrototype) {
|
|
var inheritedComponent = getPrototypeOf(sourceComponent);
|
|
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
|
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
|
}
|
|
}
|
|
var keys = getOwnPropertyNames(sourceComponent);
|
|
if (getOwnPropertySymbols) {
|
|
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
|
}
|
|
var targetStatics = getStatics(targetComponent);
|
|
var sourceStatics = getStatics(sourceComponent);
|
|
for (var i = 0; i < keys.length; ++i) {
|
|
var key = keys[i];
|
|
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
|
|
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
|
try {
|
|
defineProperty(targetComponent, key, descriptor);
|
|
} catch (e) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return targetComponent;
|
|
}
|
|
module2.exports = hoistNonReactStatics;
|
|
}
|
|
});
|
|
|
|
// node_modules/react/cjs/react-jsx-runtime.development.js
|
|
var require_react_jsx_runtime_development = __commonJS({
|
|
"node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
|
"use strict";
|
|
(function() {
|
|
function getComponentNameFromType(type) {
|
|
if (null == type) return null;
|
|
if ("function" === typeof type)
|
|
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
if ("string" === typeof type) return type;
|
|
switch (type) {
|
|
case REACT_FRAGMENT_TYPE:
|
|
return "Fragment";
|
|
case REACT_PROFILER_TYPE:
|
|
return "Profiler";
|
|
case REACT_STRICT_MODE_TYPE:
|
|
return "StrictMode";
|
|
case REACT_SUSPENSE_TYPE:
|
|
return "Suspense";
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return "SuspenseList";
|
|
case REACT_ACTIVITY_TYPE:
|
|
return "Activity";
|
|
}
|
|
if ("object" === typeof type)
|
|
switch ("number" === typeof type.tag && console.error(
|
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
), type.$$typeof) {
|
|
case REACT_PORTAL_TYPE:
|
|
return "Portal";
|
|
case REACT_CONTEXT_TYPE:
|
|
return type.displayName || "Context";
|
|
case REACT_CONSUMER_TYPE:
|
|
return (type._context.displayName || "Context") + ".Consumer";
|
|
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 testStringCoercion(value) {
|
|
return "" + value;
|
|
}
|
|
function checkKeyStringCoercion(value) {
|
|
try {
|
|
testStringCoercion(value);
|
|
var JSCompiler_inline_result = false;
|
|
} catch (e) {
|
|
JSCompiler_inline_result = true;
|
|
}
|
|
if (JSCompiler_inline_result) {
|
|
JSCompiler_inline_result = console;
|
|
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
JSCompiler_temp_const.call(
|
|
JSCompiler_inline_result,
|
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
JSCompiler_inline_result$jscomp$0
|
|
);
|
|
return testStringCoercion(value);
|
|
}
|
|
}
|
|
function getTaskName(type) {
|
|
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
|
return "<...>";
|
|
try {
|
|
var name = getComponentNameFromType(type);
|
|
return name ? "<" + name + ">" : "<...>";
|
|
} catch (x) {
|
|
return "<...>";
|
|
}
|
|
}
|
|
function getOwner() {
|
|
var dispatcher = ReactSharedInternals.A;
|
|
return null === dispatcher ? null : dispatcher.getOwner();
|
|
}
|
|
function UnknownOwner() {
|
|
return Error("react-stack-top-frame");
|
|
}
|
|
function hasValidKey(config) {
|
|
if (hasOwnProperty.call(config, "key")) {
|
|
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
if (getter && getter.isReactWarning) return false;
|
|
}
|
|
return void 0 !== config.key;
|
|
}
|
|
function defineKeyPropWarningGetter(props, displayName) {
|
|
function warnAboutAccessingKey() {
|
|
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.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://react.dev/link/special-props)",
|
|
displayName
|
|
));
|
|
}
|
|
warnAboutAccessingKey.isReactWarning = true;
|
|
Object.defineProperty(props, "key", {
|
|
get: warnAboutAccessingKey,
|
|
configurable: true
|
|
});
|
|
}
|
|
function elementRefGetterWithDeprecationWarning() {
|
|
var componentName = getComponentNameFromType(this.type);
|
|
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
));
|
|
componentName = this.props.ref;
|
|
return void 0 !== componentName ? componentName : null;
|
|
}
|
|
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
var refProp = props.ref;
|
|
type = {
|
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
type,
|
|
key,
|
|
props,
|
|
_owner: owner
|
|
};
|
|
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
|
enumerable: false,
|
|
get: elementRefGetterWithDeprecationWarning
|
|
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
type._store = {};
|
|
Object.defineProperty(type._store, "validated", {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: true,
|
|
value: 0
|
|
});
|
|
Object.defineProperty(type, "_debugInfo", {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: true,
|
|
value: null
|
|
});
|
|
Object.defineProperty(type, "_debugStack", {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: true,
|
|
value: debugStack
|
|
});
|
|
Object.defineProperty(type, "_debugTask", {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: true,
|
|
value: debugTask
|
|
});
|
|
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
return type;
|
|
}
|
|
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
|
|
var children = config.children;
|
|
if (void 0 !== children)
|
|
if (isStaticChildren)
|
|
if (isArrayImpl(children)) {
|
|
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
|
|
validateChildKeys(children[isStaticChildren]);
|
|
Object.freeze && Object.freeze(children);
|
|
} else
|
|
console.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);
|
|
if (hasOwnProperty.call(config, "key")) {
|
|
children = getComponentNameFromType(type);
|
|
var keys = Object.keys(config).filter(function(k) {
|
|
return "key" !== k;
|
|
});
|
|
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
isStaticChildren,
|
|
children,
|
|
keys,
|
|
children
|
|
), didWarnAboutKeySpread[children + isStaticChildren] = true);
|
|
}
|
|
children = null;
|
|
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
|
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
|
if ("key" in config) {
|
|
maybeKey = {};
|
|
for (var propName in config)
|
|
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
} else maybeKey = config;
|
|
children && defineKeyPropWarningGetter(
|
|
maybeKey,
|
|
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
|
);
|
|
return ReactElement(
|
|
type,
|
|
children,
|
|
maybeKey,
|
|
getOwner(),
|
|
debugStack,
|
|
debugTask
|
|
);
|
|
}
|
|
function validateChildKeys(node2) {
|
|
isValidElement5(node2) ? node2._store && (node2._store.validated = 1) : "object" === typeof node2 && null !== node2 && node2.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node2._payload.status ? isValidElement5(node2._payload.value) && node2._payload.value._store && (node2._payload.value._store.validated = 1) : node2._store && (node2._store.validated = 1));
|
|
}
|
|
function isValidElement5(object) {
|
|
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
}
|
|
var React58 = require_react(), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = React58.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
|
return null;
|
|
};
|
|
React58 = {
|
|
react_stack_bottom_frame: function(callStackForError) {
|
|
return callStackForError();
|
|
}
|
|
};
|
|
var specialPropKeyWarningShown;
|
|
var didWarnAboutElementRef = {};
|
|
var unknownOwnerDebugStack = React58.react_stack_bottom_frame.bind(
|
|
React58,
|
|
UnknownOwner
|
|
)();
|
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
var didWarnAboutKeySpread = {};
|
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
exports.jsx = function(type, config, maybeKey) {
|
|
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
return jsxDEVImpl(
|
|
type,
|
|
config,
|
|
maybeKey,
|
|
false,
|
|
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
);
|
|
};
|
|
exports.jsxs = function(type, config, maybeKey) {
|
|
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
return jsxDEVImpl(
|
|
type,
|
|
config,
|
|
maybeKey,
|
|
true,
|
|
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
);
|
|
};
|
|
})();
|
|
}
|
|
});
|
|
|
|
// node_modules/react/jsx-runtime.js
|
|
var require_jsx_runtime = __commonJS({
|
|
"node_modules/react/jsx-runtime.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_jsx_runtime_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// main.ts
|
|
var main_exports = {};
|
|
__export(main_exports, {
|
|
default: () => Flowershow
|
|
});
|
|
module.exports = __toCommonJS(main_exports);
|
|
var import_obsidian6 = require("obsidian");
|
|
|
|
// src/components/PublishStatusModal.tsx
|
|
var React57 = __toESM(require_react());
|
|
var import_client = __toESM(require_client());
|
|
var import_obsidian = require("obsidian");
|
|
|
|
// src/settings.ts
|
|
var DEFAULT_SETTINGS = {
|
|
flowershowToken: "",
|
|
siteName: "",
|
|
rootDir: "",
|
|
excludePatterns: ["\\.excalidraw(\\.(md|excalidraw))?$"],
|
|
lastSeenVersion: ""
|
|
};
|
|
var API_URL = "https://cloud.flowershow.app";
|
|
|
|
// node_modules/@babel/runtime/helpers/esm/extends.js
|
|
function _extends() {
|
|
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
for (var e = 1; e < arguments.length; e++) {
|
|
var t = arguments[e];
|
|
for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]);
|
|
}
|
|
return n;
|
|
}, _extends.apply(null, arguments);
|
|
}
|
|
|
|
// node_modules/@mui/x-tree-view/RichTreeView/RichTreeView.mjs
|
|
var React56 = __toESM(require_react(), 1);
|
|
var import_prop_types26 = __toESM(require_prop_types(), 1);
|
|
|
|
// node_modules/@base-ui/utils/esm/useRefWithInit.js
|
|
var React = __toESM(require_react(), 1);
|
|
var UNINITIALIZED = {};
|
|
function useRefWithInit(init, initArg) {
|
|
const ref = React.useRef(UNINITIALIZED);
|
|
if (ref.current === UNINITIALIZED) {
|
|
ref.current = init(initArg);
|
|
}
|
|
return ref;
|
|
}
|
|
|
|
// node_modules/@base-ui/utils/esm/useMergedRefs.js
|
|
function useMergedRefs(a, b, c, d) {
|
|
const forkRef = useRefWithInit(createForkRef).current;
|
|
if (didChange(forkRef, a, b, c, d)) {
|
|
update(forkRef, [a, b, c, d]);
|
|
}
|
|
return forkRef.callback;
|
|
}
|
|
function createForkRef() {
|
|
return {
|
|
callback: null,
|
|
cleanup: null,
|
|
refs: []
|
|
};
|
|
}
|
|
function didChange(forkRef, a, b, c, d) {
|
|
return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
|
|
}
|
|
function update(forkRef, refs) {
|
|
forkRef.refs = refs;
|
|
if (refs.every((ref) => ref == null)) {
|
|
forkRef.callback = null;
|
|
return;
|
|
}
|
|
forkRef.callback = (instance) => {
|
|
if (forkRef.cleanup) {
|
|
forkRef.cleanup();
|
|
forkRef.cleanup = null;
|
|
}
|
|
if (instance != null) {
|
|
const cleanupCallbacks = Array(refs.length).fill(null);
|
|
for (let i = 0; i < refs.length; i += 1) {
|
|
const ref = refs[i];
|
|
if (ref == null) {
|
|
continue;
|
|
}
|
|
switch (typeof ref) {
|
|
case "function": {
|
|
const refCleanup = ref(instance);
|
|
if (typeof refCleanup === "function") {
|
|
cleanupCallbacks[i] = refCleanup;
|
|
}
|
|
break;
|
|
}
|
|
case "object": {
|
|
ref.current = instance;
|
|
break;
|
|
}
|
|
default:
|
|
}
|
|
}
|
|
forkRef.cleanup = () => {
|
|
for (let i = 0; i < refs.length; i += 1) {
|
|
const ref = refs[i];
|
|
if (ref == null) {
|
|
continue;
|
|
}
|
|
switch (typeof ref) {
|
|
case "function": {
|
|
const cleanupCallback = cleanupCallbacks[i];
|
|
if (typeof cleanupCallback === "function") {
|
|
cleanupCallback();
|
|
} else {
|
|
ref(null);
|
|
}
|
|
break;
|
|
}
|
|
case "object": {
|
|
ref.current = null;
|
|
break;
|
|
}
|
|
default:
|
|
}
|
|
}
|
|
};
|
|
}
|
|
};
|
|
}
|
|
|
|
// node_modules/reselect/dist/reselect.mjs
|
|
var runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => {
|
|
if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) {
|
|
let isInputSameAsOutput = false;
|
|
try {
|
|
const emptyObject = {};
|
|
if (resultFunc(emptyObject) === emptyObject) isInputSameAsOutput = true;
|
|
} catch (e) {
|
|
}
|
|
if (isInputSameAsOutput) {
|
|
let stack = void 0;
|
|
try {
|
|
throw new Error();
|
|
} catch (e) {
|
|
;
|
|
({ stack } = e);
|
|
}
|
|
console.warn(
|
|
"The result function returned its own inputs without modification. e.g\n`createSelector([state => state.todos], todos => todos)`\nThis could lead to inefficient memoization and unnecessary re-renders.\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.",
|
|
{ stack }
|
|
);
|
|
}
|
|
}
|
|
};
|
|
var runInputStabilityCheck = (inputSelectorResultsObject, options, inputSelectorArgs) => {
|
|
const { memoize: memoize3, memoizeOptions } = options;
|
|
const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject;
|
|
const createAnEmptyObject = memoize3(() => ({}), ...memoizeOptions);
|
|
const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy);
|
|
if (!areInputSelectorResultsEqual) {
|
|
let stack = void 0;
|
|
try {
|
|
throw new Error();
|
|
} catch (e) {
|
|
;
|
|
({ stack } = e);
|
|
}
|
|
console.warn(
|
|
"An input selector returned a different result when passed same arguments.\nThis means your output selector will likely run more frequently than intended.\nAvoid returning a new reference inside your input selector, e.g.\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`",
|
|
{
|
|
arguments: inputSelectorArgs,
|
|
firstInputs: inputSelectorResults,
|
|
secondInputs: inputSelectorResultsCopy,
|
|
stack
|
|
}
|
|
);
|
|
}
|
|
};
|
|
var globalDevModeChecks = {
|
|
inputStabilityCheck: "once",
|
|
identityFunctionCheck: "once"
|
|
};
|
|
var NOT_FOUND = /* @__PURE__ */ Symbol("NOT_FOUND");
|
|
function assertIsFunction(func, errorMessage = `expected a function, instead received ${typeof func}`) {
|
|
if (typeof func !== "function") {
|
|
throw new TypeError(errorMessage);
|
|
}
|
|
}
|
|
function assertIsArrayOfFunctions(array, errorMessage = `expected all items to be functions, instead received the following types: `) {
|
|
if (!array.every((item) => typeof item === "function")) {
|
|
const itemTypes = array.map(
|
|
(item) => typeof item === "function" ? `function ${item.name || "unnamed"}()` : typeof item
|
|
).join(", ");
|
|
throw new TypeError(`${errorMessage}[${itemTypes}]`);
|
|
}
|
|
}
|
|
var ensureIsArray = (item) => {
|
|
return Array.isArray(item) ? item : [item];
|
|
};
|
|
function getDependencies(createSelectorArgs) {
|
|
const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs;
|
|
assertIsArrayOfFunctions(
|
|
dependencies,
|
|
`createSelector expects all input-selectors to be functions, but received the following types: `
|
|
);
|
|
return dependencies;
|
|
}
|
|
function collectInputSelectorResults(dependencies, inputSelectorArgs) {
|
|
const inputSelectorResults = [];
|
|
const { length: length2 } = dependencies;
|
|
for (let i = 0; i < length2; i++) {
|
|
inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs));
|
|
}
|
|
return inputSelectorResults;
|
|
}
|
|
var getDevModeChecksExecutionInfo = (firstRun, devModeChecks) => {
|
|
const { identityFunctionCheck, inputStabilityCheck } = __spreadValues(__spreadValues({}, globalDevModeChecks), devModeChecks);
|
|
return {
|
|
identityFunctionCheck: {
|
|
shouldRun: identityFunctionCheck === "always" || identityFunctionCheck === "once" && firstRun,
|
|
run: runIdentityFunctionCheck
|
|
},
|
|
inputStabilityCheck: {
|
|
shouldRun: inputStabilityCheck === "always" || inputStabilityCheck === "once" && firstRun,
|
|
run: runInputStabilityCheck
|
|
}
|
|
};
|
|
};
|
|
function createSingletonCache(equals) {
|
|
let entry;
|
|
return {
|
|
get(key) {
|
|
if (entry && equals(entry.key, key)) {
|
|
return entry.value;
|
|
}
|
|
return NOT_FOUND;
|
|
},
|
|
put(key, value) {
|
|
entry = { key, value };
|
|
},
|
|
getEntries() {
|
|
return entry ? [entry] : [];
|
|
},
|
|
clear() {
|
|
entry = void 0;
|
|
}
|
|
};
|
|
}
|
|
function createLruCache(maxSize, equals) {
|
|
let entries = [];
|
|
function get(key) {
|
|
const cacheIndex = entries.findIndex((entry) => equals(key, entry.key));
|
|
if (cacheIndex > -1) {
|
|
const entry = entries[cacheIndex];
|
|
if (cacheIndex > 0) {
|
|
entries.splice(cacheIndex, 1);
|
|
entries.unshift(entry);
|
|
}
|
|
return entry.value;
|
|
}
|
|
return NOT_FOUND;
|
|
}
|
|
function put(key, value) {
|
|
if (get(key) === NOT_FOUND) {
|
|
entries.unshift({ key, value });
|
|
if (entries.length > maxSize) {
|
|
entries.pop();
|
|
}
|
|
}
|
|
}
|
|
function getEntries() {
|
|
return entries;
|
|
}
|
|
function clear() {
|
|
entries = [];
|
|
}
|
|
return { get, put, getEntries, clear };
|
|
}
|
|
var referenceEqualityCheck = (a, b) => a === b;
|
|
function createCacheKeyComparator(equalityCheck) {
|
|
return function areArgumentsShallowlyEqual(prev2, next2) {
|
|
if (prev2 === null || next2 === null || prev2.length !== next2.length) {
|
|
return false;
|
|
}
|
|
const { length: length2 } = prev2;
|
|
for (let i = 0; i < length2; i++) {
|
|
if (!equalityCheck(prev2[i], next2[i])) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
};
|
|
}
|
|
function lruMemoize(func, equalityCheckOrOptions) {
|
|
const providedOptions = typeof equalityCheckOrOptions === "object" ? equalityCheckOrOptions : { equalityCheck: equalityCheckOrOptions };
|
|
const {
|
|
equalityCheck = referenceEqualityCheck,
|
|
maxSize = 1,
|
|
resultEqualityCheck
|
|
} = providedOptions;
|
|
const comparator = createCacheKeyComparator(equalityCheck);
|
|
let resultsCount = 0;
|
|
const cache = maxSize <= 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator);
|
|
function memoized() {
|
|
let value = cache.get(arguments);
|
|
if (value === NOT_FOUND) {
|
|
value = func.apply(null, arguments);
|
|
resultsCount++;
|
|
if (resultEqualityCheck) {
|
|
const entries = cache.getEntries();
|
|
const matchingEntry = entries.find(
|
|
(entry) => resultEqualityCheck(entry.value, value)
|
|
);
|
|
if (matchingEntry) {
|
|
value = matchingEntry.value;
|
|
resultsCount !== 0 && resultsCount--;
|
|
}
|
|
}
|
|
cache.put(arguments, value);
|
|
}
|
|
return value;
|
|
}
|
|
memoized.clearCache = () => {
|
|
cache.clear();
|
|
memoized.resetResultsCount();
|
|
};
|
|
memoized.resultsCount = () => resultsCount;
|
|
memoized.resetResultsCount = () => {
|
|
resultsCount = 0;
|
|
};
|
|
return memoized;
|
|
}
|
|
var StrongRef = class {
|
|
constructor(value) {
|
|
this.value = value;
|
|
}
|
|
deref() {
|
|
return this.value;
|
|
}
|
|
};
|
|
var getWeakRef = () => typeof WeakRef === "undefined" ? StrongRef : WeakRef;
|
|
var Ref = /* @__PURE__ */ getWeakRef();
|
|
var UNTERMINATED = 0;
|
|
var TERMINATED = 1;
|
|
function createCacheNode() {
|
|
return {
|
|
s: UNTERMINATED,
|
|
v: void 0,
|
|
o: null,
|
|
p: null
|
|
};
|
|
}
|
|
function maybeDeref(r2) {
|
|
if (r2 instanceof Ref) {
|
|
return r2.deref();
|
|
}
|
|
return r2;
|
|
}
|
|
function weakMapMemoize(func, options = {}) {
|
|
let fnNode = createCacheNode();
|
|
const { resultEqualityCheck } = options;
|
|
let lastResult;
|
|
let resultsCount = 0;
|
|
function memoized() {
|
|
let cacheNode = fnNode;
|
|
const { length: length2 } = arguments;
|
|
for (let i = 0, l = length2; i < l; i++) {
|
|
const arg2 = arguments[i];
|
|
if (typeof arg2 === "function" || typeof arg2 === "object" && arg2 !== null) {
|
|
let objectCache = cacheNode.o;
|
|
if (objectCache === null) {
|
|
cacheNode.o = objectCache = /* @__PURE__ */ new WeakMap();
|
|
}
|
|
const objectNode = objectCache.get(arg2);
|
|
if (objectNode === void 0) {
|
|
cacheNode = createCacheNode();
|
|
objectCache.set(arg2, cacheNode);
|
|
} else {
|
|
cacheNode = objectNode;
|
|
}
|
|
} else {
|
|
let primitiveCache = cacheNode.p;
|
|
if (primitiveCache === null) {
|
|
cacheNode.p = primitiveCache = /* @__PURE__ */ new Map();
|
|
}
|
|
const primitiveNode = primitiveCache.get(arg2);
|
|
if (primitiveNode === void 0) {
|
|
cacheNode = createCacheNode();
|
|
primitiveCache.set(arg2, cacheNode);
|
|
} else {
|
|
cacheNode = primitiveNode;
|
|
}
|
|
}
|
|
}
|
|
const terminatedNode = cacheNode;
|
|
let result;
|
|
if (cacheNode.s === TERMINATED) {
|
|
result = cacheNode.v;
|
|
} else {
|
|
result = func.apply(null, arguments);
|
|
resultsCount++;
|
|
if (resultEqualityCheck) {
|
|
const lastResultValue = maybeDeref(lastResult);
|
|
if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) {
|
|
result = lastResultValue;
|
|
resultsCount !== 0 && resultsCount--;
|
|
}
|
|
const needsWeakRef = typeof result === "object" && result !== null || typeof result === "function";
|
|
lastResult = needsWeakRef ? /* @__PURE__ */ new Ref(result) : result;
|
|
}
|
|
}
|
|
terminatedNode.s = TERMINATED;
|
|
terminatedNode.v = result;
|
|
return result;
|
|
}
|
|
memoized.clearCache = () => {
|
|
fnNode = createCacheNode();
|
|
memoized.resetResultsCount();
|
|
};
|
|
memoized.resultsCount = () => resultsCount;
|
|
memoized.resetResultsCount = () => {
|
|
resultsCount = 0;
|
|
};
|
|
return memoized;
|
|
}
|
|
function createSelectorCreator(memoizeOrOptions, ...memoizeOptionsFromArgs) {
|
|
const createSelectorCreatorOptions = typeof memoizeOrOptions === "function" ? {
|
|
memoize: memoizeOrOptions,
|
|
memoizeOptions: memoizeOptionsFromArgs
|
|
} : memoizeOrOptions;
|
|
const createSelector2 = (...createSelectorArgs) => {
|
|
let recomputations = 0;
|
|
let dependencyRecomputations = 0;
|
|
let lastResult;
|
|
let directlyPassedOptions = {};
|
|
let resultFunc = createSelectorArgs.pop();
|
|
if (typeof resultFunc === "object") {
|
|
directlyPassedOptions = resultFunc;
|
|
resultFunc = createSelectorArgs.pop();
|
|
}
|
|
assertIsFunction(
|
|
resultFunc,
|
|
`createSelector expects an output function after the inputs, but received: [${typeof resultFunc}]`
|
|
);
|
|
const combinedOptions = __spreadValues(__spreadValues({}, createSelectorCreatorOptions), directlyPassedOptions);
|
|
const {
|
|
memoize: memoize3,
|
|
memoizeOptions = [],
|
|
argsMemoize = weakMapMemoize,
|
|
argsMemoizeOptions = []
|
|
} = combinedOptions;
|
|
const finalMemoizeOptions = ensureIsArray(memoizeOptions);
|
|
const finalArgsMemoizeOptions = ensureIsArray(argsMemoizeOptions);
|
|
const dependencies = getDependencies(createSelectorArgs);
|
|
const memoizedResultFunc = memoize3(function recomputationWrapper() {
|
|
recomputations++;
|
|
return resultFunc.apply(
|
|
null,
|
|
arguments
|
|
);
|
|
}, ...finalMemoizeOptions);
|
|
let firstRun = true;
|
|
const selector = argsMemoize(function dependenciesChecker() {
|
|
dependencyRecomputations++;
|
|
const inputSelectorResults = collectInputSelectorResults(
|
|
dependencies,
|
|
arguments
|
|
);
|
|
lastResult = memoizedResultFunc.apply(null, inputSelectorResults);
|
|
if (true) {
|
|
const { devModeChecks = {} } = combinedOptions;
|
|
const { identityFunctionCheck, inputStabilityCheck } = getDevModeChecksExecutionInfo(firstRun, devModeChecks);
|
|
if (identityFunctionCheck.shouldRun) {
|
|
identityFunctionCheck.run(
|
|
resultFunc,
|
|
inputSelectorResults,
|
|
lastResult
|
|
);
|
|
}
|
|
if (inputStabilityCheck.shouldRun) {
|
|
const inputSelectorResultsCopy = collectInputSelectorResults(
|
|
dependencies,
|
|
arguments
|
|
);
|
|
inputStabilityCheck.run(
|
|
{ inputSelectorResults, inputSelectorResultsCopy },
|
|
{ memoize: memoize3, memoizeOptions: finalMemoizeOptions },
|
|
arguments
|
|
);
|
|
}
|
|
if (firstRun) firstRun = false;
|
|
}
|
|
return lastResult;
|
|
}, ...finalArgsMemoizeOptions);
|
|
return Object.assign(selector, {
|
|
resultFunc,
|
|
memoizedResultFunc,
|
|
dependencies,
|
|
dependencyRecomputations: () => dependencyRecomputations,
|
|
resetDependencyRecomputations: () => {
|
|
dependencyRecomputations = 0;
|
|
},
|
|
lastResult: () => lastResult,
|
|
recomputations: () => recomputations,
|
|
resetRecomputations: () => {
|
|
recomputations = 0;
|
|
},
|
|
memoize: memoize3,
|
|
argsMemoize
|
|
});
|
|
};
|
|
Object.assign(createSelector2, {
|
|
withTypes: () => createSelector2
|
|
});
|
|
return createSelector2;
|
|
}
|
|
|
|
// node_modules/@mui/x-internals/store/createSelector.mjs
|
|
var reselectCreateSelector = createSelectorCreator({
|
|
memoize: lruMemoize,
|
|
memoizeOptions: {
|
|
maxSize: 1,
|
|
equalityCheck: Object.is
|
|
}
|
|
});
|
|
var createSelector = (a, b, c, d, e, f, g, h, ...other) => {
|
|
if (other.length > 0) {
|
|
throw new Error("Unsupported number of selectors");
|
|
}
|
|
let selector;
|
|
if (a && b && c && d && e && f && g && h) {
|
|
selector = (state, a1, a2, a3) => {
|
|
const va = a(state, a1, a2, a3);
|
|
const vb = b(state, a1, a2, a3);
|
|
const vc = c(state, a1, a2, a3);
|
|
const vd = d(state, a1, a2, a3);
|
|
const ve = e(state, a1, a2, a3);
|
|
const vf = f(state, a1, a2, a3);
|
|
const vg = g(state, a1, a2, a3);
|
|
return h(va, vb, vc, vd, ve, vf, vg, a1, a2, a3);
|
|
};
|
|
} else if (a && b && c && d && e && f && g) {
|
|
selector = (state, a1, a2, a3) => {
|
|
const va = a(state, a1, a2, a3);
|
|
const vb = b(state, a1, a2, a3);
|
|
const vc = c(state, a1, a2, a3);
|
|
const vd = d(state, a1, a2, a3);
|
|
const ve = e(state, a1, a2, a3);
|
|
const vf = f(state, a1, a2, a3);
|
|
return g(va, vb, vc, vd, ve, vf, a1, a2, a3);
|
|
};
|
|
} else if (a && b && c && d && e && f) {
|
|
selector = (state, a1, a2, a3) => {
|
|
const va = a(state, a1, a2, a3);
|
|
const vb = b(state, a1, a2, a3);
|
|
const vc = c(state, a1, a2, a3);
|
|
const vd = d(state, a1, a2, a3);
|
|
const ve = e(state, a1, a2, a3);
|
|
return f(va, vb, vc, vd, ve, a1, a2, a3);
|
|
};
|
|
} else if (a && b && c && d && e) {
|
|
selector = (state, a1, a2, a3) => {
|
|
const va = a(state, a1, a2, a3);
|
|
const vb = b(state, a1, a2, a3);
|
|
const vc = c(state, a1, a2, a3);
|
|
const vd = d(state, a1, a2, a3);
|
|
return e(va, vb, vc, vd, a1, a2, a3);
|
|
};
|
|
} else if (a && b && c && d) {
|
|
selector = (state, a1, a2, a3) => {
|
|
const va = a(state, a1, a2, a3);
|
|
const vb = b(state, a1, a2, a3);
|
|
const vc = c(state, a1, a2, a3);
|
|
return d(va, vb, vc, a1, a2, a3);
|
|
};
|
|
} else if (a && b && c) {
|
|
selector = (state, a1, a2, a3) => {
|
|
const va = a(state, a1, a2, a3);
|
|
const vb = b(state, a1, a2, a3);
|
|
return c(va, vb, a1, a2, a3);
|
|
};
|
|
} else if (a && b) {
|
|
selector = (state, a1, a2, a3) => {
|
|
const va = a(state, a1, a2, a3);
|
|
return b(va, a1, a2, a3);
|
|
};
|
|
} else if (a) {
|
|
selector = a;
|
|
} else {
|
|
throw new Error("Missing arguments");
|
|
}
|
|
return selector;
|
|
};
|
|
var createSelectorMemoizedWithOptions = (options) => (...inputs) => {
|
|
const cache = /* @__PURE__ */ new WeakMap();
|
|
let nextCacheId = 1;
|
|
const combiner = inputs[inputs.length - 1];
|
|
const nSelectors = inputs.length - 1 || 1;
|
|
const argsLength = Math.max(combiner.length - nSelectors, 0);
|
|
if (argsLength > 3) {
|
|
throw new Error("Unsupported number of arguments");
|
|
}
|
|
const selector = (state, a1, a2, a3) => {
|
|
let cacheKey = state.__cacheKey__;
|
|
if (!cacheKey) {
|
|
cacheKey = {
|
|
id: nextCacheId
|
|
};
|
|
state.__cacheKey__ = cacheKey;
|
|
nextCacheId += 1;
|
|
}
|
|
let fn = cache.get(cacheKey);
|
|
if (!fn) {
|
|
const selectors = inputs.length === 1 ? [(x) => x, combiner] : inputs;
|
|
let reselectArgs = inputs;
|
|
const selectorArgs = [void 0, void 0, void 0];
|
|
switch (argsLength) {
|
|
case 0:
|
|
break;
|
|
case 1: {
|
|
reselectArgs = [...selectors.slice(0, -1), () => selectorArgs[0], combiner];
|
|
break;
|
|
}
|
|
case 2: {
|
|
reselectArgs = [...selectors.slice(0, -1), () => selectorArgs[0], () => selectorArgs[1], combiner];
|
|
break;
|
|
}
|
|
case 3: {
|
|
reselectArgs = [...selectors.slice(0, -1), () => selectorArgs[0], () => selectorArgs[1], () => selectorArgs[2], combiner];
|
|
break;
|
|
}
|
|
default:
|
|
throw new Error("Unsupported number of arguments");
|
|
}
|
|
if (options) {
|
|
reselectArgs = [...reselectArgs, options];
|
|
}
|
|
fn = reselectCreateSelector(...reselectArgs);
|
|
fn.selectorArgs = selectorArgs;
|
|
cache.set(cacheKey, fn);
|
|
}
|
|
switch (argsLength) {
|
|
case 3:
|
|
fn.selectorArgs[2] = a3;
|
|
case 2:
|
|
fn.selectorArgs[1] = a2;
|
|
case 1:
|
|
fn.selectorArgs[0] = a1;
|
|
case 0:
|
|
default:
|
|
}
|
|
switch (argsLength) {
|
|
case 0:
|
|
return fn(state);
|
|
case 1:
|
|
return fn(state, a1);
|
|
case 2:
|
|
return fn(state, a1, a2);
|
|
case 3:
|
|
return fn(state, a1, a2, a3);
|
|
default:
|
|
throw new Error("unreachable");
|
|
}
|
|
};
|
|
return selector;
|
|
};
|
|
var createSelectorMemoized = createSelectorMemoizedWithOptions();
|
|
|
|
// node_modules/@mui/x-internals/store/useStore.mjs
|
|
var React3 = __toESM(require_react(), 1);
|
|
var import_shim = __toESM(require_shim(), 1);
|
|
var import_with_selector = __toESM(require_with_selector(), 1);
|
|
|
|
// node_modules/@mui/x-internals/reactMajor/index.mjs
|
|
var React2 = __toESM(require_react(), 1);
|
|
var reactMajor_default = parseInt(React2.version, 10);
|
|
|
|
// node_modules/@mui/x-internals/store/useStore.mjs
|
|
var canUseRawUseSyncExternalStore = reactMajor_default >= 19;
|
|
var useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreR19 : useStoreLegacy;
|
|
function useStore(store, selector, a1, a2, a3) {
|
|
return useStoreImplementation(store, selector, a1, a2, a3);
|
|
}
|
|
function useStoreR19(store, selector, a1, a2, a3) {
|
|
const getSelection = React3.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]);
|
|
return (0, import_shim.useSyncExternalStore)(store.subscribe, getSelection, getSelection);
|
|
}
|
|
function useStoreLegacy(store, selector, a1, a2, a3) {
|
|
return (0, import_with_selector.useSyncExternalStoreWithSelector)(store.subscribe, store.getSnapshot, store.getSnapshot, (state) => selector(state, a1, a2, a3));
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/useLazyRef/useLazyRef.js
|
|
var React4 = __toESM(require_react(), 1);
|
|
var UNINITIALIZED2 = {};
|
|
function useLazyRef(init, initArg) {
|
|
const ref = React4.useRef(UNINITIALIZED2);
|
|
if (ref.current === UNINITIALIZED2) {
|
|
ref.current = init(initArg);
|
|
}
|
|
return ref;
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/useOnMount/useOnMount.js
|
|
var React5 = __toESM(require_react(), 1);
|
|
var EMPTY = [];
|
|
function useOnMount(fn) {
|
|
React5.useEffect(fn, EMPTY);
|
|
}
|
|
|
|
// node_modules/@mui/x-internals/store/Store.mjs
|
|
var Store = class _Store {
|
|
constructor(state) {
|
|
__publicField(this, "subscribe", (fn) => {
|
|
this.listeners.add(fn);
|
|
return () => {
|
|
this.listeners.delete(fn);
|
|
};
|
|
});
|
|
/**
|
|
* Returns the current state snapshot. Meant for usage with `useSyncExternalStore`.
|
|
* If you want to access the state, use the `state` property instead.
|
|
*/
|
|
__publicField(this, "getSnapshot", () => {
|
|
return this.state;
|
|
});
|
|
__publicField(this, "use", /* @__PURE__ */ (() => (selector, a1, a2, a3) => {
|
|
return useStore(this, selector, a1, a2, a3);
|
|
})());
|
|
this.state = state;
|
|
this.listeners = /* @__PURE__ */ new Set();
|
|
this.updateTick = 0;
|
|
}
|
|
// HACK: `any` fixes adding listeners that accept partial state.
|
|
// Internal state to handle recursive `setState()` calls
|
|
static create(state) {
|
|
return new _Store(state);
|
|
}
|
|
setState(newState) {
|
|
this.state = newState;
|
|
this.updateTick += 1;
|
|
const currentTick = this.updateTick;
|
|
const it = this.listeners.values();
|
|
let result;
|
|
while (result = it.next(), !result.done) {
|
|
if (currentTick !== this.updateTick) {
|
|
return;
|
|
}
|
|
const listener = result.value;
|
|
listener(newState);
|
|
}
|
|
}
|
|
update(changes) {
|
|
for (const key in changes) {
|
|
if (!Object.is(this.state[key], changes[key])) {
|
|
this.setState(_extends({}, this.state, changes));
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
set(key, value) {
|
|
if (!Object.is(this.state[key], value)) {
|
|
this.setState(_extends({}, this.state, {
|
|
[key]: value
|
|
}));
|
|
}
|
|
}
|
|
};
|
|
|
|
// node_modules/@mui/material/esm/Alert/Alert.js
|
|
var React35 = __toESM(require_react(), 1);
|
|
var import_prop_types17 = __toESM(require_prop_types(), 1);
|
|
|
|
// node_modules/clsx/dist/clsx.mjs
|
|
function r(e) {
|
|
var t, f, n = "";
|
|
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
var o = e.length;
|
|
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
return n;
|
|
}
|
|
function clsx() {
|
|
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
return n;
|
|
}
|
|
var clsx_default = clsx;
|
|
|
|
// node_modules/@mui/utils/esm/composeClasses/composeClasses.js
|
|
function composeClasses(slots, getUtilityClass, classes = void 0) {
|
|
const output = {};
|
|
for (const slotName in slots) {
|
|
const slot = slots[slotName];
|
|
let buffer = "";
|
|
let start = true;
|
|
for (let i = 0; i < slot.length; i += 1) {
|
|
const value = slot[i];
|
|
if (value) {
|
|
buffer += (start === true ? "" : " ") + getUtilityClass(value);
|
|
start = false;
|
|
if (classes && classes[value]) {
|
|
buffer += " " + classes[value];
|
|
}
|
|
}
|
|
}
|
|
output[slotName] = buffer;
|
|
}
|
|
return output;
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/capitalize/capitalize.js
|
|
function capitalize(string) {
|
|
if (typeof string !== "string") {
|
|
throw new Error(true ? "MUI: `capitalize(string)` expects a string argument." : formatMuiErrorMessage(7));
|
|
}
|
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/deepmerge/deepmerge.js
|
|
var React6 = __toESM(require_react(), 1);
|
|
var import_react_is = __toESM(require_react_is2(), 1);
|
|
function isPlainObject(item) {
|
|
if (typeof item !== "object" || item === null) {
|
|
return false;
|
|
}
|
|
const prototype = Object.getPrototypeOf(item);
|
|
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);
|
|
}
|
|
function deepClone(source) {
|
|
if (/* @__PURE__ */ React6.isValidElement(source) || (0, import_react_is.isValidElementType)(source) || !isPlainObject(source)) {
|
|
return source;
|
|
}
|
|
const output = {};
|
|
Object.keys(source).forEach((key) => {
|
|
output[key] = deepClone(source[key]);
|
|
});
|
|
return output;
|
|
}
|
|
function deepmerge(target, source, options = {
|
|
clone: true
|
|
}) {
|
|
const output = options.clone ? __spreadValues({}, target) : target;
|
|
if (isPlainObject(target) && isPlainObject(source)) {
|
|
Object.keys(source).forEach((key) => {
|
|
if (/* @__PURE__ */ React6.isValidElement(source[key]) || (0, import_react_is.isValidElementType)(source[key])) {
|
|
output[key] = source[key];
|
|
} else if (isPlainObject(source[key]) && // Avoid prototype pollution
|
|
Object.prototype.hasOwnProperty.call(target, key) && isPlainObject(target[key])) {
|
|
output[key] = deepmerge(target[key], source[key], options);
|
|
} else if (options.clone) {
|
|
output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];
|
|
} else {
|
|
output[key] = source[key];
|
|
}
|
|
});
|
|
}
|
|
return output;
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/merge/merge.js
|
|
function merge(acc, item) {
|
|
if (!item) {
|
|
return acc;
|
|
}
|
|
return deepmerge(acc, item, {
|
|
clone: false
|
|
// No need to clone deep, it's way faster.
|
|
});
|
|
}
|
|
var merge_default = merge;
|
|
|
|
// node_modules/@mui/system/esm/responsivePropType/responsivePropType.js
|
|
var import_prop_types = __toESM(require_prop_types(), 1);
|
|
var responsivePropType = true ? import_prop_types.default.oneOfType([import_prop_types.default.number, import_prop_types.default.string, import_prop_types.default.object, import_prop_types.default.array]) : {};
|
|
var responsivePropType_default = responsivePropType;
|
|
|
|
// node_modules/@mui/system/esm/cssContainerQueries/cssContainerQueries.js
|
|
function sortContainerQueries(theme, css2) {
|
|
if (!theme.containerQueries) {
|
|
return css2;
|
|
}
|
|
const sorted = Object.keys(css2).filter((key) => key.startsWith("@container")).sort((a, b) => {
|
|
var _a, _b;
|
|
const regex = /min-width:\s*([0-9.]+)/;
|
|
return +(((_a = a.match(regex)) == null ? void 0 : _a[1]) || 0) - +(((_b = b.match(regex)) == null ? void 0 : _b[1]) || 0);
|
|
});
|
|
if (!sorted.length) {
|
|
return css2;
|
|
}
|
|
return sorted.reduce((acc, key) => {
|
|
const value = css2[key];
|
|
delete acc[key];
|
|
acc[key] = value;
|
|
return acc;
|
|
}, __spreadValues({}, css2));
|
|
}
|
|
function isCqShorthand(breakpointKeys, value) {
|
|
return value === "@" || value.startsWith("@") && (breakpointKeys.some((key) => value.startsWith(`@${key}`)) || !!value.match(/^@\d/));
|
|
}
|
|
function getContainerQuery(theme, shorthand) {
|
|
const matches = shorthand.match(/^@([^/]+)?\/?(.+)?$/);
|
|
if (!matches) {
|
|
if (true) {
|
|
throw (
|
|
/* minify-error */
|
|
new Error(`MUI: The provided shorthand ${`(${shorthand})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
|
|
For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`)
|
|
);
|
|
}
|
|
return null;
|
|
}
|
|
const [, containerQuery, containerName] = matches;
|
|
const value = Number.isNaN(+containerQuery) ? containerQuery || 0 : +containerQuery;
|
|
return theme.containerQueries(containerName).up(value);
|
|
}
|
|
function cssContainerQueries(themeInput) {
|
|
const toContainerQuery = (mediaQuery, name) => mediaQuery.replace("@media", name ? `@container ${name}` : "@container");
|
|
function attachCq(node3, name) {
|
|
node3.up = (...args) => toContainerQuery(themeInput.breakpoints.up(...args), name);
|
|
node3.down = (...args) => toContainerQuery(themeInput.breakpoints.down(...args), name);
|
|
node3.between = (...args) => toContainerQuery(themeInput.breakpoints.between(...args), name);
|
|
node3.only = (...args) => toContainerQuery(themeInput.breakpoints.only(...args), name);
|
|
node3.not = (...args) => {
|
|
const result = toContainerQuery(themeInput.breakpoints.not(...args), name);
|
|
if (result.includes("not all and")) {
|
|
return result.replace("not all and ", "").replace("min-width:", "width<").replace("max-width:", "width>").replace("and", "or");
|
|
}
|
|
return result;
|
|
};
|
|
}
|
|
const node2 = {};
|
|
const containerQueries = (name) => {
|
|
attachCq(node2, name);
|
|
return node2;
|
|
};
|
|
attachCq(containerQueries);
|
|
return __spreadProps(__spreadValues({}, themeInput), {
|
|
containerQueries
|
|
});
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/breakpoints/breakpoints.js
|
|
var values = {
|
|
xs: 0,
|
|
// phone
|
|
sm: 600,
|
|
// tablet
|
|
md: 900,
|
|
// small laptop
|
|
lg: 1200,
|
|
// desktop
|
|
xl: 1536
|
|
// large screen
|
|
};
|
|
var defaultBreakpoints = {
|
|
// Sorted ASC by size. That's important.
|
|
// It can't be configured as it's used statically for propTypes.
|
|
keys: ["xs", "sm", "md", "lg", "xl"],
|
|
up: (key) => `@media (min-width:${values[key]}px)`
|
|
};
|
|
var defaultContainerQueries = {
|
|
containerQueries: (containerName) => ({
|
|
up: (key) => {
|
|
let result = typeof key === "number" ? key : values[key] || key;
|
|
if (typeof result === "number") {
|
|
result = `${result}px`;
|
|
}
|
|
return containerName ? `@container ${containerName} (min-width:${result})` : `@container (min-width:${result})`;
|
|
}
|
|
})
|
|
};
|
|
function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
const theme = props.theme || {};
|
|
if (Array.isArray(propValue)) {
|
|
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
return propValue.reduce((acc, item, index) => {
|
|
acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
|
|
return acc;
|
|
}, {});
|
|
}
|
|
if (typeof propValue === "object") {
|
|
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
return Object.keys(propValue).reduce((acc, breakpoint) => {
|
|
if (isCqShorthand(themeBreakpoints.keys, breakpoint)) {
|
|
const containerKey = getContainerQuery(theme.containerQueries ? theme : defaultContainerQueries, breakpoint);
|
|
if (containerKey) {
|
|
acc[containerKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
|
|
}
|
|
} else if (Object.keys(themeBreakpoints.values || values).includes(breakpoint)) {
|
|
const mediaKey = themeBreakpoints.up(breakpoint);
|
|
acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
|
|
} else {
|
|
const cssKey = breakpoint;
|
|
acc[cssKey] = propValue[cssKey];
|
|
}
|
|
return acc;
|
|
}, {});
|
|
}
|
|
const output = styleFromPropValue(propValue);
|
|
return output;
|
|
}
|
|
function createEmptyBreakpointObject(breakpointsInput = {}) {
|
|
var _a;
|
|
const breakpointsInOrder = (_a = breakpointsInput.keys) == null ? void 0 : _a.reduce((acc, key) => {
|
|
const breakpointStyleKey = breakpointsInput.up(key);
|
|
acc[breakpointStyleKey] = {};
|
|
return acc;
|
|
}, {});
|
|
return breakpointsInOrder || {};
|
|
}
|
|
function removeUnusedBreakpoints(breakpointKeys, style3) {
|
|
return breakpointKeys.reduce((acc, key) => {
|
|
const breakpointOutput = acc[key];
|
|
const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;
|
|
if (isBreakpointUnused) {
|
|
delete acc[key];
|
|
}
|
|
return acc;
|
|
}, style3);
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/style/style.js
|
|
function getPath(obj, path, checkVars = true) {
|
|
if (!path || typeof path !== "string") {
|
|
return null;
|
|
}
|
|
if (obj && obj.vars && checkVars) {
|
|
const val = `vars.${path}`.split(".").reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
|
|
if (val != null) {
|
|
return val;
|
|
}
|
|
}
|
|
return path.split(".").reduce((acc, item) => {
|
|
if (acc && acc[item] != null) {
|
|
return acc[item];
|
|
}
|
|
return null;
|
|
}, obj);
|
|
}
|
|
function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
|
|
let value;
|
|
if (typeof themeMapping === "function") {
|
|
value = themeMapping(propValueFinal);
|
|
} else if (Array.isArray(themeMapping)) {
|
|
value = themeMapping[propValueFinal] || userValue;
|
|
} else {
|
|
value = getPath(themeMapping, propValueFinal) || userValue;
|
|
}
|
|
if (transform) {
|
|
value = transform(value, userValue, themeMapping);
|
|
}
|
|
return value;
|
|
}
|
|
function style(options) {
|
|
const {
|
|
prop,
|
|
cssProperty = options.prop,
|
|
themeKey,
|
|
transform
|
|
} = options;
|
|
const fn = (props) => {
|
|
if (props[prop] == null) {
|
|
return null;
|
|
}
|
|
const propValue = props[prop];
|
|
const theme = props.theme;
|
|
const themeMapping = getPath(theme, themeKey) || {};
|
|
const styleFromPropValue = (propValueFinal) => {
|
|
let value = getStyleValue(themeMapping, transform, propValueFinal);
|
|
if (propValueFinal === value && typeof propValueFinal === "string") {
|
|
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize(propValueFinal)}`, propValueFinal);
|
|
}
|
|
if (cssProperty === false) {
|
|
return value;
|
|
}
|
|
return {
|
|
[cssProperty]: value
|
|
};
|
|
};
|
|
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
};
|
|
fn.propTypes = true ? {
|
|
[prop]: responsivePropType_default
|
|
} : {};
|
|
fn.filterProps = [prop];
|
|
return fn;
|
|
}
|
|
var style_default = style;
|
|
|
|
// node_modules/@mui/system/esm/memoize/memoize.js
|
|
function memoize(fn) {
|
|
const cache = {};
|
|
return (arg2) => {
|
|
if (cache[arg2] === void 0) {
|
|
cache[arg2] = fn(arg2);
|
|
}
|
|
return cache[arg2];
|
|
};
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/spacing/spacing.js
|
|
var properties = {
|
|
m: "margin",
|
|
p: "padding"
|
|
};
|
|
var directions = {
|
|
t: "Top",
|
|
r: "Right",
|
|
b: "Bottom",
|
|
l: "Left",
|
|
x: ["Left", "Right"],
|
|
y: ["Top", "Bottom"]
|
|
};
|
|
var aliases = {
|
|
marginX: "mx",
|
|
marginY: "my",
|
|
paddingX: "px",
|
|
paddingY: "py"
|
|
};
|
|
var getCssProperties = memoize((prop) => {
|
|
if (prop.length > 2) {
|
|
if (aliases[prop]) {
|
|
prop = aliases[prop];
|
|
} else {
|
|
return [prop];
|
|
}
|
|
}
|
|
const [a, b] = prop.split("");
|
|
const property = properties[a];
|
|
const direction = directions[b] || "";
|
|
return Array.isArray(direction) ? direction.map((dir) => property + dir) : [property + direction];
|
|
});
|
|
var marginKeys = ["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "marginInline", "marginInlineStart", "marginInlineEnd", "marginBlock", "marginBlockStart", "marginBlockEnd"];
|
|
var paddingKeys = ["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"];
|
|
var spacingKeys = [...marginKeys, ...paddingKeys];
|
|
function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
var _a;
|
|
const themeSpacing = (_a = getPath(theme, themeKey, true)) != null ? _a : defaultValue;
|
|
if (typeof themeSpacing === "number" || typeof themeSpacing === "string") {
|
|
return (val) => {
|
|
if (typeof val === "string") {
|
|
return val;
|
|
}
|
|
if (true) {
|
|
if (typeof val !== "number") {
|
|
console.error(`MUI: Expected ${propName} argument to be a number or a string, got ${val}.`);
|
|
}
|
|
}
|
|
if (typeof themeSpacing === "string") {
|
|
if (themeSpacing.startsWith("var(") && val === 0) {
|
|
return 0;
|
|
}
|
|
if (themeSpacing.startsWith("var(") && val === 1) {
|
|
return themeSpacing;
|
|
}
|
|
return `calc(${val} * ${themeSpacing})`;
|
|
}
|
|
return themeSpacing * val;
|
|
};
|
|
}
|
|
if (Array.isArray(themeSpacing)) {
|
|
return (val) => {
|
|
if (typeof val === "string") {
|
|
return val;
|
|
}
|
|
const abs2 = Math.abs(val);
|
|
if (true) {
|
|
if (!Number.isInteger(abs2)) {
|
|
console.error([`MUI: The \`theme.${themeKey}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${themeKey}\` as a number.`].join("\n"));
|
|
} else if (abs2 > themeSpacing.length - 1) {
|
|
console.error([`MUI: The value provided (${abs2}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs2} > ${themeSpacing.length - 1}, you need to add the missing values.`].join("\n"));
|
|
}
|
|
}
|
|
const transformed = themeSpacing[abs2];
|
|
if (val >= 0) {
|
|
return transformed;
|
|
}
|
|
if (typeof transformed === "number") {
|
|
return -transformed;
|
|
}
|
|
if (typeof transformed === "string" && transformed.startsWith("var(")) {
|
|
return `calc(-1 * ${transformed})`;
|
|
}
|
|
return `-${transformed}`;
|
|
};
|
|
}
|
|
if (typeof themeSpacing === "function") {
|
|
return themeSpacing;
|
|
}
|
|
if (true) {
|
|
console.error([`MUI: The \`theme.${themeKey}\` value (${themeSpacing}) is invalid.`, "It should be a number, an array or a function."].join("\n"));
|
|
}
|
|
return () => void 0;
|
|
}
|
|
function createUnarySpacing(theme) {
|
|
return createUnaryUnit(theme, "spacing", 8, "spacing");
|
|
}
|
|
function getValue(transformer, propValue) {
|
|
if (typeof propValue === "string" || propValue == null) {
|
|
return propValue;
|
|
}
|
|
return transformer(propValue);
|
|
}
|
|
function getStyleFromPropValue(cssProperties, transformer) {
|
|
return (propValue) => cssProperties.reduce((acc, cssProperty) => {
|
|
acc[cssProperty] = getValue(transformer, propValue);
|
|
return acc;
|
|
}, {});
|
|
}
|
|
function resolveCssProperty(props, keys, prop, transformer) {
|
|
if (!keys.includes(prop)) {
|
|
return null;
|
|
}
|
|
const cssProperties = getCssProperties(prop);
|
|
const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
|
|
const propValue = props[prop];
|
|
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
}
|
|
function style2(props, keys) {
|
|
const transformer = createUnarySpacing(props.theme);
|
|
return Object.keys(props).map((prop) => resolveCssProperty(props, keys, prop, transformer)).reduce(merge_default, {});
|
|
}
|
|
function margin(props) {
|
|
return style2(props, marginKeys);
|
|
}
|
|
margin.propTypes = true ? marginKeys.reduce((obj, key) => {
|
|
obj[key] = responsivePropType_default;
|
|
return obj;
|
|
}, {}) : {};
|
|
margin.filterProps = marginKeys;
|
|
function padding(props) {
|
|
return style2(props, paddingKeys);
|
|
}
|
|
padding.propTypes = true ? paddingKeys.reduce((obj, key) => {
|
|
obj[key] = responsivePropType_default;
|
|
return obj;
|
|
}, {}) : {};
|
|
padding.filterProps = paddingKeys;
|
|
function spacing(props) {
|
|
return style2(props, spacingKeys);
|
|
}
|
|
spacing.propTypes = true ? spacingKeys.reduce((obj, key) => {
|
|
obj[key] = responsivePropType_default;
|
|
return obj;
|
|
}, {}) : {};
|
|
spacing.filterProps = spacingKeys;
|
|
|
|
// node_modules/@mui/system/esm/compose/compose.js
|
|
function compose(...styles) {
|
|
const handlers = styles.reduce((acc, style3) => {
|
|
style3.filterProps.forEach((prop) => {
|
|
acc[prop] = style3;
|
|
});
|
|
return acc;
|
|
}, {});
|
|
const fn = (props) => {
|
|
return Object.keys(props).reduce((acc, prop) => {
|
|
if (handlers[prop]) {
|
|
return merge_default(acc, handlers[prop](props));
|
|
}
|
|
return acc;
|
|
}, {});
|
|
};
|
|
fn.propTypes = true ? styles.reduce((acc, style3) => Object.assign(acc, style3.propTypes), {}) : {};
|
|
fn.filterProps = styles.reduce((acc, style3) => acc.concat(style3.filterProps), []);
|
|
return fn;
|
|
}
|
|
var compose_default = compose;
|
|
|
|
// node_modules/@mui/system/esm/borders/borders.js
|
|
function borderTransform(value) {
|
|
if (typeof value !== "number") {
|
|
return value;
|
|
}
|
|
return `${value}px solid`;
|
|
}
|
|
function createBorderStyle(prop, transform) {
|
|
return style_default({
|
|
prop,
|
|
themeKey: "borders",
|
|
transform
|
|
});
|
|
}
|
|
var border = createBorderStyle("border", borderTransform);
|
|
var borderTop = createBorderStyle("borderTop", borderTransform);
|
|
var borderRight = createBorderStyle("borderRight", borderTransform);
|
|
var borderBottom = createBorderStyle("borderBottom", borderTransform);
|
|
var borderLeft = createBorderStyle("borderLeft", borderTransform);
|
|
var borderColor = createBorderStyle("borderColor");
|
|
var borderTopColor = createBorderStyle("borderTopColor");
|
|
var borderRightColor = createBorderStyle("borderRightColor");
|
|
var borderBottomColor = createBorderStyle("borderBottomColor");
|
|
var borderLeftColor = createBorderStyle("borderLeftColor");
|
|
var outline = createBorderStyle("outline", borderTransform);
|
|
var outlineColor = createBorderStyle("outlineColor");
|
|
var borderRadius = (props) => {
|
|
if (props.borderRadius !== void 0 && props.borderRadius !== null) {
|
|
const transformer = createUnaryUnit(props.theme, "shape.borderRadius", 4, "borderRadius");
|
|
const styleFromPropValue = (propValue) => ({
|
|
borderRadius: getValue(transformer, propValue)
|
|
});
|
|
return handleBreakpoints(props, props.borderRadius, styleFromPropValue);
|
|
}
|
|
return null;
|
|
};
|
|
borderRadius.propTypes = true ? {
|
|
borderRadius: responsivePropType_default
|
|
} : {};
|
|
borderRadius.filterProps = ["borderRadius"];
|
|
var borders = compose_default(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius, outline, outlineColor);
|
|
|
|
// node_modules/@mui/system/esm/cssGrid/cssGrid.js
|
|
var gap = (props) => {
|
|
if (props.gap !== void 0 && props.gap !== null) {
|
|
const transformer = createUnaryUnit(props.theme, "spacing", 8, "gap");
|
|
const styleFromPropValue = (propValue) => ({
|
|
gap: getValue(transformer, propValue)
|
|
});
|
|
return handleBreakpoints(props, props.gap, styleFromPropValue);
|
|
}
|
|
return null;
|
|
};
|
|
gap.propTypes = true ? {
|
|
gap: responsivePropType_default
|
|
} : {};
|
|
gap.filterProps = ["gap"];
|
|
var columnGap = (props) => {
|
|
if (props.columnGap !== void 0 && props.columnGap !== null) {
|
|
const transformer = createUnaryUnit(props.theme, "spacing", 8, "columnGap");
|
|
const styleFromPropValue = (propValue) => ({
|
|
columnGap: getValue(transformer, propValue)
|
|
});
|
|
return handleBreakpoints(props, props.columnGap, styleFromPropValue);
|
|
}
|
|
return null;
|
|
};
|
|
columnGap.propTypes = true ? {
|
|
columnGap: responsivePropType_default
|
|
} : {};
|
|
columnGap.filterProps = ["columnGap"];
|
|
var rowGap = (props) => {
|
|
if (props.rowGap !== void 0 && props.rowGap !== null) {
|
|
const transformer = createUnaryUnit(props.theme, "spacing", 8, "rowGap");
|
|
const styleFromPropValue = (propValue) => ({
|
|
rowGap: getValue(transformer, propValue)
|
|
});
|
|
return handleBreakpoints(props, props.rowGap, styleFromPropValue);
|
|
}
|
|
return null;
|
|
};
|
|
rowGap.propTypes = true ? {
|
|
rowGap: responsivePropType_default
|
|
} : {};
|
|
rowGap.filterProps = ["rowGap"];
|
|
var gridColumn = style_default({
|
|
prop: "gridColumn"
|
|
});
|
|
var gridRow = style_default({
|
|
prop: "gridRow"
|
|
});
|
|
var gridAutoFlow = style_default({
|
|
prop: "gridAutoFlow"
|
|
});
|
|
var gridAutoColumns = style_default({
|
|
prop: "gridAutoColumns"
|
|
});
|
|
var gridAutoRows = style_default({
|
|
prop: "gridAutoRows"
|
|
});
|
|
var gridTemplateColumns = style_default({
|
|
prop: "gridTemplateColumns"
|
|
});
|
|
var gridTemplateRows = style_default({
|
|
prop: "gridTemplateRows"
|
|
});
|
|
var gridTemplateAreas = style_default({
|
|
prop: "gridTemplateAreas"
|
|
});
|
|
var gridArea = style_default({
|
|
prop: "gridArea"
|
|
});
|
|
var grid = compose_default(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);
|
|
|
|
// node_modules/@mui/system/esm/palette/palette.js
|
|
function paletteTransform(value, userValue) {
|
|
if (userValue === "grey") {
|
|
return userValue;
|
|
}
|
|
return value;
|
|
}
|
|
var color = style_default({
|
|
prop: "color",
|
|
themeKey: "palette",
|
|
transform: paletteTransform
|
|
});
|
|
var bgcolor = style_default({
|
|
prop: "bgcolor",
|
|
cssProperty: "backgroundColor",
|
|
themeKey: "palette",
|
|
transform: paletteTransform
|
|
});
|
|
var backgroundColor = style_default({
|
|
prop: "backgroundColor",
|
|
themeKey: "palette",
|
|
transform: paletteTransform
|
|
});
|
|
var palette = compose_default(color, bgcolor, backgroundColor);
|
|
|
|
// node_modules/@mui/system/esm/sizing/sizing.js
|
|
function sizingTransform(value) {
|
|
return value <= 1 && value !== 0 ? `${value * 100}%` : value;
|
|
}
|
|
var width = style_default({
|
|
prop: "width",
|
|
transform: sizingTransform
|
|
});
|
|
var maxWidth = (props) => {
|
|
if (props.maxWidth !== void 0 && props.maxWidth !== null) {
|
|
const styleFromPropValue = (propValue) => {
|
|
var _a, _b, _c, _d, _e;
|
|
const breakpoint = ((_c = (_b = (_a = props.theme) == null ? void 0 : _a.breakpoints) == null ? void 0 : _b.values) == null ? void 0 : _c[propValue]) || values[propValue];
|
|
if (!breakpoint) {
|
|
return {
|
|
maxWidth: sizingTransform(propValue)
|
|
};
|
|
}
|
|
if (((_e = (_d = props.theme) == null ? void 0 : _d.breakpoints) == null ? void 0 : _e.unit) !== "px") {
|
|
return {
|
|
maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`
|
|
};
|
|
}
|
|
return {
|
|
maxWidth: breakpoint
|
|
};
|
|
};
|
|
return handleBreakpoints(props, props.maxWidth, styleFromPropValue);
|
|
}
|
|
return null;
|
|
};
|
|
maxWidth.filterProps = ["maxWidth"];
|
|
var minWidth = style_default({
|
|
prop: "minWidth",
|
|
transform: sizingTransform
|
|
});
|
|
var height = style_default({
|
|
prop: "height",
|
|
transform: sizingTransform
|
|
});
|
|
var maxHeight = style_default({
|
|
prop: "maxHeight",
|
|
transform: sizingTransform
|
|
});
|
|
var minHeight = style_default({
|
|
prop: "minHeight",
|
|
transform: sizingTransform
|
|
});
|
|
var sizeWidth = style_default({
|
|
prop: "size",
|
|
cssProperty: "width",
|
|
transform: sizingTransform
|
|
});
|
|
var sizeHeight = style_default({
|
|
prop: "size",
|
|
cssProperty: "height",
|
|
transform: sizingTransform
|
|
});
|
|
var boxSizing = style_default({
|
|
prop: "boxSizing"
|
|
});
|
|
var sizing = compose_default(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);
|
|
|
|
// node_modules/@mui/system/esm/styleFunctionSx/defaultSxConfig.js
|
|
var defaultSxConfig = {
|
|
// borders
|
|
border: {
|
|
themeKey: "borders",
|
|
transform: borderTransform
|
|
},
|
|
borderTop: {
|
|
themeKey: "borders",
|
|
transform: borderTransform
|
|
},
|
|
borderRight: {
|
|
themeKey: "borders",
|
|
transform: borderTransform
|
|
},
|
|
borderBottom: {
|
|
themeKey: "borders",
|
|
transform: borderTransform
|
|
},
|
|
borderLeft: {
|
|
themeKey: "borders",
|
|
transform: borderTransform
|
|
},
|
|
borderColor: {
|
|
themeKey: "palette"
|
|
},
|
|
borderTopColor: {
|
|
themeKey: "palette"
|
|
},
|
|
borderRightColor: {
|
|
themeKey: "palette"
|
|
},
|
|
borderBottomColor: {
|
|
themeKey: "palette"
|
|
},
|
|
borderLeftColor: {
|
|
themeKey: "palette"
|
|
},
|
|
outline: {
|
|
themeKey: "borders",
|
|
transform: borderTransform
|
|
},
|
|
outlineColor: {
|
|
themeKey: "palette"
|
|
},
|
|
borderRadius: {
|
|
themeKey: "shape.borderRadius",
|
|
style: borderRadius
|
|
},
|
|
// palette
|
|
color: {
|
|
themeKey: "palette",
|
|
transform: paletteTransform
|
|
},
|
|
bgcolor: {
|
|
themeKey: "palette",
|
|
cssProperty: "backgroundColor",
|
|
transform: paletteTransform
|
|
},
|
|
backgroundColor: {
|
|
themeKey: "palette",
|
|
transform: paletteTransform
|
|
},
|
|
// spacing
|
|
p: {
|
|
style: padding
|
|
},
|
|
pt: {
|
|
style: padding
|
|
},
|
|
pr: {
|
|
style: padding
|
|
},
|
|
pb: {
|
|
style: padding
|
|
},
|
|
pl: {
|
|
style: padding
|
|
},
|
|
px: {
|
|
style: padding
|
|
},
|
|
py: {
|
|
style: padding
|
|
},
|
|
padding: {
|
|
style: padding
|
|
},
|
|
paddingTop: {
|
|
style: padding
|
|
},
|
|
paddingRight: {
|
|
style: padding
|
|
},
|
|
paddingBottom: {
|
|
style: padding
|
|
},
|
|
paddingLeft: {
|
|
style: padding
|
|
},
|
|
paddingX: {
|
|
style: padding
|
|
},
|
|
paddingY: {
|
|
style: padding
|
|
},
|
|
paddingInline: {
|
|
style: padding
|
|
},
|
|
paddingInlineStart: {
|
|
style: padding
|
|
},
|
|
paddingInlineEnd: {
|
|
style: padding
|
|
},
|
|
paddingBlock: {
|
|
style: padding
|
|
},
|
|
paddingBlockStart: {
|
|
style: padding
|
|
},
|
|
paddingBlockEnd: {
|
|
style: padding
|
|
},
|
|
m: {
|
|
style: margin
|
|
},
|
|
mt: {
|
|
style: margin
|
|
},
|
|
mr: {
|
|
style: margin
|
|
},
|
|
mb: {
|
|
style: margin
|
|
},
|
|
ml: {
|
|
style: margin
|
|
},
|
|
mx: {
|
|
style: margin
|
|
},
|
|
my: {
|
|
style: margin
|
|
},
|
|
margin: {
|
|
style: margin
|
|
},
|
|
marginTop: {
|
|
style: margin
|
|
},
|
|
marginRight: {
|
|
style: margin
|
|
},
|
|
marginBottom: {
|
|
style: margin
|
|
},
|
|
marginLeft: {
|
|
style: margin
|
|
},
|
|
marginX: {
|
|
style: margin
|
|
},
|
|
marginY: {
|
|
style: margin
|
|
},
|
|
marginInline: {
|
|
style: margin
|
|
},
|
|
marginInlineStart: {
|
|
style: margin
|
|
},
|
|
marginInlineEnd: {
|
|
style: margin
|
|
},
|
|
marginBlock: {
|
|
style: margin
|
|
},
|
|
marginBlockStart: {
|
|
style: margin
|
|
},
|
|
marginBlockEnd: {
|
|
style: margin
|
|
},
|
|
// display
|
|
displayPrint: {
|
|
cssProperty: false,
|
|
transform: (value) => ({
|
|
"@media print": {
|
|
display: value
|
|
}
|
|
})
|
|
},
|
|
display: {},
|
|
overflow: {},
|
|
textOverflow: {},
|
|
visibility: {},
|
|
whiteSpace: {},
|
|
// flexbox
|
|
flexBasis: {},
|
|
flexDirection: {},
|
|
flexWrap: {},
|
|
justifyContent: {},
|
|
alignItems: {},
|
|
alignContent: {},
|
|
order: {},
|
|
flex: {},
|
|
flexGrow: {},
|
|
flexShrink: {},
|
|
alignSelf: {},
|
|
justifyItems: {},
|
|
justifySelf: {},
|
|
// grid
|
|
gap: {
|
|
style: gap
|
|
},
|
|
rowGap: {
|
|
style: rowGap
|
|
},
|
|
columnGap: {
|
|
style: columnGap
|
|
},
|
|
gridColumn: {},
|
|
gridRow: {},
|
|
gridAutoFlow: {},
|
|
gridAutoColumns: {},
|
|
gridAutoRows: {},
|
|
gridTemplateColumns: {},
|
|
gridTemplateRows: {},
|
|
gridTemplateAreas: {},
|
|
gridArea: {},
|
|
// positions
|
|
position: {},
|
|
zIndex: {
|
|
themeKey: "zIndex"
|
|
},
|
|
top: {},
|
|
right: {},
|
|
bottom: {},
|
|
left: {},
|
|
// shadows
|
|
boxShadow: {
|
|
themeKey: "shadows"
|
|
},
|
|
// sizing
|
|
width: {
|
|
transform: sizingTransform
|
|
},
|
|
maxWidth: {
|
|
style: maxWidth
|
|
},
|
|
minWidth: {
|
|
transform: sizingTransform
|
|
},
|
|
height: {
|
|
transform: sizingTransform
|
|
},
|
|
maxHeight: {
|
|
transform: sizingTransform
|
|
},
|
|
minHeight: {
|
|
transform: sizingTransform
|
|
},
|
|
boxSizing: {},
|
|
// typography
|
|
font: {
|
|
themeKey: "font"
|
|
},
|
|
fontFamily: {
|
|
themeKey: "typography"
|
|
},
|
|
fontSize: {
|
|
themeKey: "typography"
|
|
},
|
|
fontStyle: {
|
|
themeKey: "typography"
|
|
},
|
|
fontWeight: {
|
|
themeKey: "typography"
|
|
},
|
|
letterSpacing: {},
|
|
textTransform: {},
|
|
lineHeight: {},
|
|
textAlign: {},
|
|
typography: {
|
|
cssProperty: false,
|
|
themeKey: "typography"
|
|
}
|
|
};
|
|
var defaultSxConfig_default = defaultSxConfig;
|
|
|
|
// node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js
|
|
function objectsHaveSameKeys(...objects) {
|
|
const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);
|
|
const union = new Set(allKeys);
|
|
return objects.every((object) => union.size === Object.keys(object).length);
|
|
}
|
|
function callIfFn(maybeFn, arg2) {
|
|
return typeof maybeFn === "function" ? maybeFn(arg2) : maybeFn;
|
|
}
|
|
function unstable_createStyleFunctionSx() {
|
|
function getThemeValue(prop, val, theme, config) {
|
|
const props = {
|
|
[prop]: val,
|
|
theme
|
|
};
|
|
const options = config[prop];
|
|
if (!options) {
|
|
return {
|
|
[prop]: val
|
|
};
|
|
}
|
|
const {
|
|
cssProperty = prop,
|
|
themeKey,
|
|
transform,
|
|
style: style3
|
|
} = options;
|
|
if (val == null) {
|
|
return null;
|
|
}
|
|
if (themeKey === "typography" && val === "inherit") {
|
|
return {
|
|
[prop]: val
|
|
};
|
|
}
|
|
const themeMapping = getPath(theme, themeKey) || {};
|
|
if (style3) {
|
|
return style3(props);
|
|
}
|
|
const styleFromPropValue = (propValueFinal) => {
|
|
let value = getStyleValue(themeMapping, transform, propValueFinal);
|
|
if (propValueFinal === value && typeof propValueFinal === "string") {
|
|
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize(propValueFinal)}`, propValueFinal);
|
|
}
|
|
if (cssProperty === false) {
|
|
return value;
|
|
}
|
|
return {
|
|
[cssProperty]: value
|
|
};
|
|
};
|
|
return handleBreakpoints(props, val, styleFromPropValue);
|
|
}
|
|
function styleFunctionSx2(props) {
|
|
var _a;
|
|
const {
|
|
sx,
|
|
theme = {},
|
|
nested
|
|
} = props || {};
|
|
if (!sx) {
|
|
return null;
|
|
}
|
|
const config = (_a = theme.unstable_sxConfig) != null ? _a : defaultSxConfig_default;
|
|
function traverse(sxInput) {
|
|
let sxObject = sxInput;
|
|
if (typeof sxInput === "function") {
|
|
sxObject = sxInput(theme);
|
|
} else if (typeof sxInput !== "object") {
|
|
return sxInput;
|
|
}
|
|
if (!sxObject) {
|
|
return null;
|
|
}
|
|
const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);
|
|
const breakpointsKeys = Object.keys(emptyBreakpoints);
|
|
let css2 = emptyBreakpoints;
|
|
Object.keys(sxObject).forEach((styleKey) => {
|
|
const value = callIfFn(sxObject[styleKey], theme);
|
|
if (value !== null && value !== void 0) {
|
|
if (typeof value === "object") {
|
|
if (config[styleKey]) {
|
|
css2 = merge_default(css2, getThemeValue(styleKey, value, theme, config));
|
|
} else {
|
|
const breakpointsValues = handleBreakpoints({
|
|
theme
|
|
}, value, (x) => ({
|
|
[styleKey]: x
|
|
}));
|
|
if (objectsHaveSameKeys(breakpointsValues, value)) {
|
|
css2[styleKey] = styleFunctionSx2({
|
|
sx: value,
|
|
theme,
|
|
nested: true
|
|
});
|
|
} else {
|
|
css2 = merge_default(css2, breakpointsValues);
|
|
}
|
|
}
|
|
} else {
|
|
css2 = merge_default(css2, getThemeValue(styleKey, value, theme, config));
|
|
}
|
|
}
|
|
});
|
|
if (!nested && theme.modularCssLayers) {
|
|
return {
|
|
"@layer sx": sortContainerQueries(theme, removeUnusedBreakpoints(breakpointsKeys, css2))
|
|
};
|
|
}
|
|
return sortContainerQueries(theme, removeUnusedBreakpoints(breakpointsKeys, css2));
|
|
}
|
|
return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
|
|
}
|
|
return styleFunctionSx2;
|
|
}
|
|
var styleFunctionSx = unstable_createStyleFunctionSx();
|
|
styleFunctionSx.filterProps = ["sx"];
|
|
var styleFunctionSx_default = styleFunctionSx;
|
|
|
|
// node_modules/@mui/system/esm/styleFunctionSx/extendSxProp.js
|
|
var splitProps = (props) => {
|
|
var _a, _b;
|
|
const result = {
|
|
systemProps: {},
|
|
otherProps: {}
|
|
};
|
|
const config = (_b = (_a = props == null ? void 0 : props.theme) == null ? void 0 : _a.unstable_sxConfig) != null ? _b : defaultSxConfig_default;
|
|
Object.keys(props).forEach((prop) => {
|
|
if (config[prop]) {
|
|
result.systemProps[prop] = props[prop];
|
|
} else {
|
|
result.otherProps[prop] = props[prop];
|
|
}
|
|
});
|
|
return result;
|
|
};
|
|
function extendSxProp(props) {
|
|
const _a = props, {
|
|
sx: inSx
|
|
} = _a, other = __objRest(_a, [
|
|
"sx"
|
|
]);
|
|
const {
|
|
systemProps,
|
|
otherProps
|
|
} = splitProps(other);
|
|
let finalSx;
|
|
if (Array.isArray(inSx)) {
|
|
finalSx = [systemProps, ...inSx];
|
|
} else if (typeof inSx === "function") {
|
|
finalSx = (...args) => {
|
|
const result = inSx(...args);
|
|
if (!isPlainObject(result)) {
|
|
return systemProps;
|
|
}
|
|
return __spreadValues(__spreadValues({}, systemProps), result);
|
|
};
|
|
} else {
|
|
finalSx = __spreadValues(__spreadValues({}, systemProps), inSx);
|
|
}
|
|
return __spreadProps(__spreadValues({}, otherProps), {
|
|
sx: finalSx
|
|
});
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/useTheme.js
|
|
var React17 = __toESM(require_react(), 1);
|
|
|
|
// node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js
|
|
var React8 = __toESM(require_react());
|
|
var import_react = __toESM(require_react());
|
|
|
|
// node_modules/@emotion/sheet/dist/emotion-sheet.esm.js
|
|
var isDevelopment = false;
|
|
function sheetForTag(tag) {
|
|
if (tag.sheet) {
|
|
return tag.sheet;
|
|
}
|
|
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
if (document.styleSheets[i].ownerNode === tag) {
|
|
return document.styleSheets[i];
|
|
}
|
|
}
|
|
return void 0;
|
|
}
|
|
function createStyleElement(options) {
|
|
var tag = document.createElement("style");
|
|
tag.setAttribute("data-emotion", options.key);
|
|
if (options.nonce !== void 0) {
|
|
tag.setAttribute("nonce", options.nonce);
|
|
}
|
|
tag.appendChild(document.createTextNode(""));
|
|
tag.setAttribute("data-s", "");
|
|
return tag;
|
|
}
|
|
var StyleSheet = /* @__PURE__ */ (function() {
|
|
function StyleSheet2(options) {
|
|
var _this = this;
|
|
this._insertTag = function(tag) {
|
|
var before;
|
|
if (_this.tags.length === 0) {
|
|
if (_this.insertionPoint) {
|
|
before = _this.insertionPoint.nextSibling;
|
|
} else if (_this.prepend) {
|
|
before = _this.container.firstChild;
|
|
} else {
|
|
before = _this.before;
|
|
}
|
|
} else {
|
|
before = _this.tags[_this.tags.length - 1].nextSibling;
|
|
}
|
|
_this.container.insertBefore(tag, before);
|
|
_this.tags.push(tag);
|
|
};
|
|
this.isSpeedy = options.speedy === void 0 ? !isDevelopment : options.speedy;
|
|
this.tags = [];
|
|
this.ctr = 0;
|
|
this.nonce = options.nonce;
|
|
this.key = options.key;
|
|
this.container = options.container;
|
|
this.prepend = options.prepend;
|
|
this.insertionPoint = options.insertionPoint;
|
|
this.before = null;
|
|
}
|
|
var _proto = StyleSheet2.prototype;
|
|
_proto.hydrate = function hydrate(nodes) {
|
|
nodes.forEach(this._insertTag);
|
|
};
|
|
_proto.insert = function insert(rule) {
|
|
if (this.ctr % (this.isSpeedy ? 65e3 : 1) === 0) {
|
|
this._insertTag(createStyleElement(this));
|
|
}
|
|
var tag = this.tags[this.tags.length - 1];
|
|
if (this.isSpeedy) {
|
|
var sheet = sheetForTag(tag);
|
|
try {
|
|
sheet.insertRule(rule, sheet.cssRules.length);
|
|
} catch (e) {
|
|
}
|
|
} else {
|
|
tag.appendChild(document.createTextNode(rule));
|
|
}
|
|
this.ctr++;
|
|
};
|
|
_proto.flush = function flush() {
|
|
this.tags.forEach(function(tag) {
|
|
var _tag$parentNode;
|
|
return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
|
|
});
|
|
this.tags = [];
|
|
this.ctr = 0;
|
|
};
|
|
return StyleSheet2;
|
|
})();
|
|
|
|
// node_modules/stylis/src/Enum.js
|
|
var MS = "-ms-";
|
|
var MOZ = "-moz-";
|
|
var WEBKIT = "-webkit-";
|
|
var COMMENT = "comm";
|
|
var RULESET = "rule";
|
|
var DECLARATION = "decl";
|
|
var IMPORT = "@import";
|
|
var KEYFRAMES = "@keyframes";
|
|
var LAYER = "@layer";
|
|
|
|
// node_modules/stylis/src/Utility.js
|
|
var abs = Math.abs;
|
|
var from = String.fromCharCode;
|
|
var assign = Object.assign;
|
|
function hash(value, length2) {
|
|
return charat(value, 0) ^ 45 ? (((length2 << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
|
|
}
|
|
function trim(value) {
|
|
return value.trim();
|
|
}
|
|
function match(value, pattern) {
|
|
return (value = pattern.exec(value)) ? value[0] : value;
|
|
}
|
|
function replace(value, pattern, replacement) {
|
|
return value.replace(pattern, replacement);
|
|
}
|
|
function indexof(value, search) {
|
|
return value.indexOf(search);
|
|
}
|
|
function charat(value, index) {
|
|
return value.charCodeAt(index) | 0;
|
|
}
|
|
function substr(value, begin, end) {
|
|
return value.slice(begin, end);
|
|
}
|
|
function strlen(value) {
|
|
return value.length;
|
|
}
|
|
function sizeof(value) {
|
|
return value.length;
|
|
}
|
|
function append(value, array) {
|
|
return array.push(value), value;
|
|
}
|
|
function combine(array, callback) {
|
|
return array.map(callback).join("");
|
|
}
|
|
|
|
// node_modules/stylis/src/Tokenizer.js
|
|
var line = 1;
|
|
var column = 1;
|
|
var length = 0;
|
|
var position = 0;
|
|
var character = 0;
|
|
var characters = "";
|
|
function node(value, root, parent, type, props, children, length2) {
|
|
return { value, root, parent, type, props, children, line, column, length: length2, return: "" };
|
|
}
|
|
function copy(root, props) {
|
|
return assign(node("", null, null, "", null, null, 0), root, { length: -root.length }, props);
|
|
}
|
|
function char() {
|
|
return character;
|
|
}
|
|
function prev() {
|
|
character = position > 0 ? charat(characters, --position) : 0;
|
|
if (column--, character === 10)
|
|
column = 1, line--;
|
|
return character;
|
|
}
|
|
function next() {
|
|
character = position < length ? charat(characters, position++) : 0;
|
|
if (column++, character === 10)
|
|
column = 1, line++;
|
|
return character;
|
|
}
|
|
function peek() {
|
|
return charat(characters, position);
|
|
}
|
|
function caret() {
|
|
return position;
|
|
}
|
|
function slice(begin, end) {
|
|
return substr(characters, begin, end);
|
|
}
|
|
function token(type) {
|
|
switch (type) {
|
|
// \0 \t \n \r \s whitespace token
|
|
case 0:
|
|
case 9:
|
|
case 10:
|
|
case 13:
|
|
case 32:
|
|
return 5;
|
|
// ! + , / > @ ~ isolate token
|
|
case 33:
|
|
case 43:
|
|
case 44:
|
|
case 47:
|
|
case 62:
|
|
case 64:
|
|
case 126:
|
|
// ; { } breakpoint token
|
|
case 59:
|
|
case 123:
|
|
case 125:
|
|
return 4;
|
|
// : accompanied token
|
|
case 58:
|
|
return 3;
|
|
// " ' ( [ opening delimit token
|
|
case 34:
|
|
case 39:
|
|
case 40:
|
|
case 91:
|
|
return 2;
|
|
// ) ] closing delimit token
|
|
case 41:
|
|
case 93:
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
function alloc(value) {
|
|
return line = column = 1, length = strlen(characters = value), position = 0, [];
|
|
}
|
|
function dealloc(value) {
|
|
return characters = "", value;
|
|
}
|
|
function delimit(type) {
|
|
return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
|
|
}
|
|
function whitespace(type) {
|
|
while (character = peek())
|
|
if (character < 33)
|
|
next();
|
|
else
|
|
break;
|
|
return token(type) > 2 || token(character) > 3 ? "" : " ";
|
|
}
|
|
function escaping(index, count) {
|
|
while (--count && next())
|
|
if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
|
|
break;
|
|
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
|
|
}
|
|
function delimiter(type) {
|
|
while (next())
|
|
switch (character) {
|
|
// ] ) " '
|
|
case type:
|
|
return position;
|
|
// " '
|
|
case 34:
|
|
case 39:
|
|
if (type !== 34 && type !== 39)
|
|
delimiter(character);
|
|
break;
|
|
// (
|
|
case 40:
|
|
if (type === 41)
|
|
delimiter(type);
|
|
break;
|
|
// \
|
|
case 92:
|
|
next();
|
|
break;
|
|
}
|
|
return position;
|
|
}
|
|
function commenter(type, index) {
|
|
while (next())
|
|
if (type + character === 47 + 10)
|
|
break;
|
|
else if (type + character === 42 + 42 && peek() === 47)
|
|
break;
|
|
return "/*" + slice(index, position - 1) + "*" + from(type === 47 ? type : next());
|
|
}
|
|
function identifier(index) {
|
|
while (!token(peek()))
|
|
next();
|
|
return slice(index, position);
|
|
}
|
|
|
|
// node_modules/stylis/src/Parser.js
|
|
function compile(value) {
|
|
return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
|
|
}
|
|
function parse(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
|
|
var index = 0;
|
|
var offset = 0;
|
|
var length2 = pseudo;
|
|
var atrule = 0;
|
|
var property = 0;
|
|
var previous = 0;
|
|
var variable = 1;
|
|
var scanning = 1;
|
|
var ampersand = 1;
|
|
var character2 = 0;
|
|
var type = "";
|
|
var props = rules;
|
|
var children = rulesets;
|
|
var reference = rule;
|
|
var characters2 = type;
|
|
while (scanning)
|
|
switch (previous = character2, character2 = next()) {
|
|
// (
|
|
case 40:
|
|
if (previous != 108 && charat(characters2, length2 - 1) == 58) {
|
|
if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f") != -1)
|
|
ampersand = -1;
|
|
break;
|
|
}
|
|
// " ' [
|
|
case 34:
|
|
case 39:
|
|
case 91:
|
|
characters2 += delimit(character2);
|
|
break;
|
|
// \t \n \r \s
|
|
case 9:
|
|
case 10:
|
|
case 13:
|
|
case 32:
|
|
characters2 += whitespace(previous);
|
|
break;
|
|
// \
|
|
case 92:
|
|
characters2 += escaping(caret() - 1, 7);
|
|
continue;
|
|
// /
|
|
case 47:
|
|
switch (peek()) {
|
|
case 42:
|
|
case 47:
|
|
append(comment(commenter(next(), caret()), root, parent), declarations);
|
|
break;
|
|
default:
|
|
characters2 += "/";
|
|
}
|
|
break;
|
|
// {
|
|
case 123 * variable:
|
|
points[index++] = strlen(characters2) * ampersand;
|
|
// } ; \0
|
|
case 125 * variable:
|
|
case 59:
|
|
case 0:
|
|
switch (character2) {
|
|
// \0 }
|
|
case 0:
|
|
case 125:
|
|
scanning = 0;
|
|
// ;
|
|
case 59 + offset:
|
|
if (ampersand == -1) characters2 = replace(characters2, /\f/g, "");
|
|
if (property > 0 && strlen(characters2) - length2)
|
|
append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2), declarations);
|
|
break;
|
|
// @ ;
|
|
case 59:
|
|
characters2 += ";";
|
|
// { rule/at-rule
|
|
default:
|
|
append(reference = ruleset(characters2, root, parent, index, offset, rules, points, type, props = [], children = [], length2), rulesets);
|
|
if (character2 === 123)
|
|
if (offset === 0)
|
|
parse(characters2, root, reference, reference, props, rulesets, length2, points, children);
|
|
else
|
|
switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
|
|
// d l m s
|
|
case 100:
|
|
case 108:
|
|
case 109:
|
|
case 115:
|
|
parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length2), children), rules, children, length2, points, rule ? props : children);
|
|
break;
|
|
default:
|
|
parse(characters2, reference, reference, reference, [""], children, 0, points, children);
|
|
}
|
|
}
|
|
index = offset = property = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo;
|
|
break;
|
|
// :
|
|
case 58:
|
|
length2 = 1 + strlen(characters2), property = previous;
|
|
default:
|
|
if (variable < 1) {
|
|
if (character2 == 123)
|
|
--variable;
|
|
else if (character2 == 125 && variable++ == 0 && prev() == 125)
|
|
continue;
|
|
}
|
|
switch (characters2 += from(character2), character2 * variable) {
|
|
// &
|
|
case 38:
|
|
ampersand = offset > 0 ? 1 : (characters2 += "\f", -1);
|
|
break;
|
|
// ,
|
|
case 44:
|
|
points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
|
|
break;
|
|
// @
|
|
case 64:
|
|
if (peek() === 45)
|
|
characters2 += delimit(next());
|
|
atrule = peek(), offset = length2 = strlen(type = characters2 += identifier(caret())), character2++;
|
|
break;
|
|
// -
|
|
case 45:
|
|
if (previous === 45 && strlen(characters2) == 2)
|
|
variable = 0;
|
|
}
|
|
}
|
|
return rulesets;
|
|
}
|
|
function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length2) {
|
|
var post = offset - 1;
|
|
var rule = offset === 0 ? rules : [""];
|
|
var size = sizeof(rule);
|
|
for (var i = 0, j = 0, k = 0; i < index; ++i)
|
|
for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
|
|
if (z = trim(j > 0 ? rule[x] + " " + y : replace(y, /&\f/g, rule[x])))
|
|
props[k++] = z;
|
|
return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length2);
|
|
}
|
|
function comment(value, root, parent) {
|
|
return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0);
|
|
}
|
|
function declaration(value, root, parent, length2) {
|
|
return node(value, root, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2);
|
|
}
|
|
|
|
// node_modules/stylis/src/Serializer.js
|
|
function serialize(children, callback) {
|
|
var output = "";
|
|
var length2 = sizeof(children);
|
|
for (var i = 0; i < length2; i++)
|
|
output += callback(children[i], i, children, callback) || "";
|
|
return output;
|
|
}
|
|
function stringify(element, index, children, callback) {
|
|
switch (element.type) {
|
|
case LAYER:
|
|
if (element.children.length) break;
|
|
case IMPORT:
|
|
case DECLARATION:
|
|
return element.return = element.return || element.value;
|
|
case COMMENT:
|
|
return "";
|
|
case KEYFRAMES:
|
|
return element.return = element.value + "{" + serialize(element.children, callback) + "}";
|
|
case RULESET:
|
|
element.value = element.props.join(",");
|
|
}
|
|
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
|
|
}
|
|
|
|
// node_modules/stylis/src/Middleware.js
|
|
function middleware(collection) {
|
|
var length2 = sizeof(collection);
|
|
return function(element, index, children, callback) {
|
|
var output = "";
|
|
for (var i = 0; i < length2; i++)
|
|
output += collection[i](element, index, children, callback) || "";
|
|
return output;
|
|
};
|
|
}
|
|
function rulesheet(callback) {
|
|
return function(element) {
|
|
if (!element.root) {
|
|
if (element = element.return)
|
|
callback(element);
|
|
}
|
|
};
|
|
}
|
|
|
|
// node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
|
|
function memoize2(fn) {
|
|
var cache = /* @__PURE__ */ Object.create(null);
|
|
return function(arg2) {
|
|
if (cache[arg2] === void 0) cache[arg2] = fn(arg2);
|
|
return cache[arg2];
|
|
};
|
|
}
|
|
|
|
// node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js
|
|
var identifierWithPointTracking = function identifierWithPointTracking2(begin, points, index) {
|
|
var previous = 0;
|
|
var character2 = 0;
|
|
while (true) {
|
|
previous = character2;
|
|
character2 = peek();
|
|
if (previous === 38 && character2 === 12) {
|
|
points[index] = 1;
|
|
}
|
|
if (token(character2)) {
|
|
break;
|
|
}
|
|
next();
|
|
}
|
|
return slice(begin, position);
|
|
};
|
|
var toRules = function toRules2(parsed, points) {
|
|
var index = -1;
|
|
var character2 = 44;
|
|
do {
|
|
switch (token(character2)) {
|
|
case 0:
|
|
if (character2 === 38 && peek() === 12) {
|
|
points[index] = 1;
|
|
}
|
|
parsed[index] += identifierWithPointTracking(position - 1, points, index);
|
|
break;
|
|
case 2:
|
|
parsed[index] += delimit(character2);
|
|
break;
|
|
case 4:
|
|
if (character2 === 44) {
|
|
parsed[++index] = peek() === 58 ? "&\f" : "";
|
|
points[index] = parsed[index].length;
|
|
break;
|
|
}
|
|
// fallthrough
|
|
default:
|
|
parsed[index] += from(character2);
|
|
}
|
|
} while (character2 = next());
|
|
return parsed;
|
|
};
|
|
var getRules = function getRules2(value, points) {
|
|
return dealloc(toRules(alloc(value), points));
|
|
};
|
|
var fixedElements = /* @__PURE__ */ new WeakMap();
|
|
var compat = function compat2(element) {
|
|
if (element.type !== "rule" || !element.parent || // positive .length indicates that this rule contains pseudo
|
|
// negative .length indicates that this rule has been already prefixed
|
|
element.length < 1) {
|
|
return;
|
|
}
|
|
var value = element.value;
|
|
var parent = element.parent;
|
|
var isImplicitRule = element.column === parent.column && element.line === parent.line;
|
|
while (parent.type !== "rule") {
|
|
parent = parent.parent;
|
|
if (!parent) return;
|
|
}
|
|
if (element.props.length === 1 && value.charCodeAt(0) !== 58 && !fixedElements.get(parent)) {
|
|
return;
|
|
}
|
|
if (isImplicitRule) {
|
|
return;
|
|
}
|
|
fixedElements.set(element, true);
|
|
var points = [];
|
|
var rules = getRules(value, points);
|
|
var parentRules = parent.props;
|
|
for (var i = 0, k = 0; i < rules.length; i++) {
|
|
for (var j = 0; j < parentRules.length; j++, k++) {
|
|
element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
|
|
}
|
|
}
|
|
};
|
|
var removeLabel = function removeLabel2(element) {
|
|
if (element.type === "decl") {
|
|
var value = element.value;
|
|
if (
|
|
// charcode for l
|
|
value.charCodeAt(0) === 108 && // charcode for b
|
|
value.charCodeAt(2) === 98
|
|
) {
|
|
element["return"] = "";
|
|
element.value = "";
|
|
}
|
|
}
|
|
};
|
|
function prefix(value, length2) {
|
|
switch (hash(value, length2)) {
|
|
// color-adjust
|
|
case 5103:
|
|
return WEBKIT + "print-" + value + value;
|
|
// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
|
|
case 5737:
|
|
case 4201:
|
|
case 3177:
|
|
case 3433:
|
|
case 1641:
|
|
case 4457:
|
|
case 2921:
|
|
// text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
|
|
case 5572:
|
|
case 6356:
|
|
case 5844:
|
|
case 3191:
|
|
case 6645:
|
|
case 3005:
|
|
// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
|
|
case 6391:
|
|
case 5879:
|
|
case 5623:
|
|
case 6135:
|
|
case 4599:
|
|
case 4855:
|
|
// background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
|
|
case 4215:
|
|
case 6389:
|
|
case 5109:
|
|
case 5365:
|
|
case 5621:
|
|
case 3829:
|
|
return WEBKIT + value + value;
|
|
// appearance, user-select, transform, hyphens, text-size-adjust
|
|
case 5349:
|
|
case 4246:
|
|
case 4810:
|
|
case 6968:
|
|
case 2756:
|
|
return WEBKIT + value + MOZ + value + MS + value + value;
|
|
// flex, flex-direction
|
|
case 6828:
|
|
case 4268:
|
|
return WEBKIT + value + MS + value + value;
|
|
// order
|
|
case 6165:
|
|
return WEBKIT + value + MS + "flex-" + value + value;
|
|
// align-items
|
|
case 5187:
|
|
return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
|
|
// align-self
|
|
case 5443:
|
|
return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/, "") + value;
|
|
// align-content
|
|
case 4675:
|
|
return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/, "") + value;
|
|
// flex-shrink
|
|
case 5548:
|
|
return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
|
|
// flex-basis
|
|
case 5292:
|
|
return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
|
|
// flex-grow
|
|
case 6060:
|
|
return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
|
|
// transition
|
|
case 4554:
|
|
return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
|
|
// cursor
|
|
case 6187:
|
|
return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
|
|
// background, background-image
|
|
case 5495:
|
|
case 3959:
|
|
return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
|
|
// justify-content
|
|
case 4968:
|
|
return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value;
|
|
// (margin|padding)-inline-(start|end)
|
|
case 4095:
|
|
case 3583:
|
|
case 4068:
|
|
case 2532:
|
|
return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
|
|
// (min|max)?(width|height|inline-size|block-size)
|
|
case 8116:
|
|
case 7059:
|
|
case 5753:
|
|
case 5535:
|
|
case 5445:
|
|
case 5701:
|
|
case 4933:
|
|
case 4677:
|
|
case 5533:
|
|
case 5789:
|
|
case 5021:
|
|
case 4765:
|
|
if (strlen(value) - 1 - length2 > 6) switch (charat(value, length2 + 1)) {
|
|
// (m)ax-content, (m)in-content
|
|
case 109:
|
|
if (charat(value, length2 + 4) !== 45) break;
|
|
// (f)ill-available, (f)it-content
|
|
case 102:
|
|
return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value;
|
|
// (s)tretch
|
|
case 115:
|
|
return ~indexof(value, "stretch") ? prefix(replace(value, "stretch", "fill-available"), length2) + value : value;
|
|
}
|
|
break;
|
|
// position: sticky
|
|
case 4949:
|
|
if (charat(value, length2 + 1) !== 115) break;
|
|
// display: (flex|inline-flex)
|
|
case 6444:
|
|
switch (charat(value, strlen(value) - 3 - (~indexof(value, "!important") && 10))) {
|
|
// stic(k)y
|
|
case 107:
|
|
return replace(value, ":", ":" + WEBKIT) + value;
|
|
// (inline-)?fl(e)x
|
|
case 101:
|
|
return replace(value, /(.+:)([^;!]+)(;|!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
|
|
}
|
|
break;
|
|
// writing-mode
|
|
case 5936:
|
|
switch (charat(value, length2 + 11)) {
|
|
// vertical-l(r)
|
|
case 114:
|
|
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
|
|
// vertical-r(l)
|
|
case 108:
|
|
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
|
|
// horizontal(-)tb
|
|
case 45:
|
|
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
|
|
}
|
|
return WEBKIT + value + MS + value + value;
|
|
}
|
|
return value;
|
|
}
|
|
var prefixer = function prefixer2(element, index, children, callback) {
|
|
if (element.length > -1) {
|
|
if (!element["return"]) switch (element.type) {
|
|
case DECLARATION:
|
|
element["return"] = prefix(element.value, element.length);
|
|
break;
|
|
case KEYFRAMES:
|
|
return serialize([copy(element, {
|
|
value: replace(element.value, "@", "@" + WEBKIT)
|
|
})], callback);
|
|
case RULESET:
|
|
if (element.length) return combine(element.props, function(value) {
|
|
switch (match(value, /(::plac\w+|:read-\w+)/)) {
|
|
// :read-(only|write)
|
|
case ":read-only":
|
|
case ":read-write":
|
|
return serialize([copy(element, {
|
|
props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")]
|
|
})], callback);
|
|
// :placeholder
|
|
case "::placeholder":
|
|
return serialize([copy(element, {
|
|
props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")]
|
|
}), copy(element, {
|
|
props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")]
|
|
}), copy(element, {
|
|
props: [replace(value, /:(plac\w+)/, MS + "input-$1")]
|
|
})], callback);
|
|
}
|
|
return "";
|
|
});
|
|
}
|
|
}
|
|
};
|
|
var defaultStylisPlugins = [prefixer];
|
|
var createCache = function createCache2(options) {
|
|
var key = options.key;
|
|
if (key === "css") {
|
|
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
|
|
Array.prototype.forEach.call(ssrStyles, function(node2) {
|
|
var dataEmotionAttribute = node2.getAttribute("data-emotion");
|
|
if (dataEmotionAttribute.indexOf(" ") === -1) {
|
|
return;
|
|
}
|
|
document.head.appendChild(node2);
|
|
node2.setAttribute("data-s", "");
|
|
});
|
|
}
|
|
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
|
|
var inserted = {};
|
|
var container;
|
|
var nodesToHydrate = [];
|
|
{
|
|
container = options.container || document.head;
|
|
Array.prototype.forEach.call(
|
|
// this means we will ignore elements which don't have a space in them which
|
|
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
document.querySelectorAll('style[data-emotion^="' + key + ' "]'),
|
|
function(node2) {
|
|
var attrib = node2.getAttribute("data-emotion").split(" ");
|
|
for (var i = 1; i < attrib.length; i++) {
|
|
inserted[attrib[i]] = true;
|
|
}
|
|
nodesToHydrate.push(node2);
|
|
}
|
|
);
|
|
}
|
|
var _insert;
|
|
var omnipresentPlugins = [compat, removeLabel];
|
|
{
|
|
var currentSheet;
|
|
var finalizingPlugins = [stringify, rulesheet(function(rule) {
|
|
currentSheet.insert(rule);
|
|
})];
|
|
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
|
|
var stylis = function stylis2(styles) {
|
|
return serialize(compile(styles), serializer);
|
|
};
|
|
_insert = function insert(selector, serialized, sheet, shouldCache) {
|
|
currentSheet = sheet;
|
|
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
if (shouldCache) {
|
|
cache.inserted[serialized.name] = true;
|
|
}
|
|
};
|
|
}
|
|
var cache = {
|
|
key,
|
|
sheet: new StyleSheet({
|
|
key,
|
|
container,
|
|
nonce: options.nonce,
|
|
speedy: options.speedy,
|
|
prepend: options.prepend,
|
|
insertionPoint: options.insertionPoint
|
|
}),
|
|
nonce: options.nonce,
|
|
inserted,
|
|
registered: {},
|
|
insert: _insert
|
|
};
|
|
cache.sheet.hydrate(nodesToHydrate);
|
|
return cache;
|
|
};
|
|
|
|
// node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
|
|
var isBrowser = true;
|
|
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
var rawClassName = "";
|
|
classNames.split(" ").forEach(function(className) {
|
|
if (registered[className] !== void 0) {
|
|
registeredStyles.push(registered[className] + ";");
|
|
} else if (className) {
|
|
rawClassName += className + " ";
|
|
}
|
|
});
|
|
return rawClassName;
|
|
}
|
|
var registerStyles = function registerStyles2(cache, serialized, isStringTag2) {
|
|
var className = cache.key + "-" + serialized.name;
|
|
if (
|
|
// we only need to add the styles to the registered cache if the
|
|
// class name could be used further down
|
|
// the tree but if it's a string tag, we know it won't
|
|
// so we don't have to add it to registered cache.
|
|
// this improves memory usage since we can avoid storing the whole style string
|
|
(isStringTag2 === false || // we need to always store it if we're in compat mode and
|
|
// in node since emotion-server relies on whether a style is in
|
|
// the registered cache to know whether a style is global or not
|
|
// also, note that this check will be dead code eliminated in the browser
|
|
isBrowser === false) && cache.registered[className] === void 0
|
|
) {
|
|
cache.registered[className] = serialized.styles;
|
|
}
|
|
};
|
|
var insertStyles = function insertStyles2(cache, serialized, isStringTag2) {
|
|
registerStyles(cache, serialized, isStringTag2);
|
|
var className = cache.key + "-" + serialized.name;
|
|
if (cache.inserted[serialized.name] === void 0) {
|
|
var current = serialized;
|
|
do {
|
|
cache.insert(serialized === current ? "." + className : "", current, cache.sheet, true);
|
|
current = current.next;
|
|
} while (current !== void 0);
|
|
}
|
|
};
|
|
|
|
// node_modules/@emotion/hash/dist/emotion-hash.esm.js
|
|
function murmur2(str) {
|
|
var h = 0;
|
|
var k, i = 0, len = str.length;
|
|
for (; len >= 4; ++i, len -= 4) {
|
|
k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
|
|
k = /* Math.imul(k, m): */
|
|
(k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
|
|
k ^= /* k >>> r: */
|
|
k >>> 24;
|
|
h = /* Math.imul(k, m): */
|
|
(k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
|
|
(h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
|
|
}
|
|
switch (len) {
|
|
case 3:
|
|
h ^= (str.charCodeAt(i + 2) & 255) << 16;
|
|
case 2:
|
|
h ^= (str.charCodeAt(i + 1) & 255) << 8;
|
|
case 1:
|
|
h ^= str.charCodeAt(i) & 255;
|
|
h = /* Math.imul(h, m): */
|
|
(h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
|
|
}
|
|
h ^= h >>> 13;
|
|
h = /* Math.imul(h, m): */
|
|
(h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
|
|
return ((h ^ h >>> 15) >>> 0).toString(36);
|
|
}
|
|
|
|
// node_modules/@emotion/unitless/dist/emotion-unitless.esm.js
|
|
var unitlessKeys = {
|
|
animationIterationCount: 1,
|
|
aspectRatio: 1,
|
|
borderImageOutset: 1,
|
|
borderImageSlice: 1,
|
|
borderImageWidth: 1,
|
|
boxFlex: 1,
|
|
boxFlexGroup: 1,
|
|
boxOrdinalGroup: 1,
|
|
columnCount: 1,
|
|
columns: 1,
|
|
flex: 1,
|
|
flexGrow: 1,
|
|
flexPositive: 1,
|
|
flexShrink: 1,
|
|
flexNegative: 1,
|
|
flexOrder: 1,
|
|
gridRow: 1,
|
|
gridRowEnd: 1,
|
|
gridRowSpan: 1,
|
|
gridRowStart: 1,
|
|
gridColumn: 1,
|
|
gridColumnEnd: 1,
|
|
gridColumnSpan: 1,
|
|
gridColumnStart: 1,
|
|
msGridRow: 1,
|
|
msGridRowSpan: 1,
|
|
msGridColumn: 1,
|
|
msGridColumnSpan: 1,
|
|
fontWeight: 1,
|
|
lineHeight: 1,
|
|
opacity: 1,
|
|
order: 1,
|
|
orphans: 1,
|
|
scale: 1,
|
|
tabSize: 1,
|
|
widows: 1,
|
|
zIndex: 1,
|
|
zoom: 1,
|
|
WebkitLineClamp: 1,
|
|
// SVG-related properties
|
|
fillOpacity: 1,
|
|
floodOpacity: 1,
|
|
stopOpacity: 1,
|
|
strokeDasharray: 1,
|
|
strokeDashoffset: 1,
|
|
strokeMiterlimit: 1,
|
|
strokeOpacity: 1,
|
|
strokeWidth: 1
|
|
};
|
|
|
|
// node_modules/@emotion/serialize/dist/emotion-serialize.esm.js
|
|
var isDevelopment2 = false;
|
|
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
var isCustomProperty = function isCustomProperty2(property) {
|
|
return property.charCodeAt(1) === 45;
|
|
};
|
|
var isProcessableValue = function isProcessableValue2(value) {
|
|
return value != null && typeof value !== "boolean";
|
|
};
|
|
var processStyleName = /* @__PURE__ */ memoize2(function(styleName) {
|
|
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
|
|
});
|
|
var processStyleValue = function processStyleValue2(key, value) {
|
|
switch (key) {
|
|
case "animation":
|
|
case "animationName": {
|
|
if (typeof value === "string") {
|
|
return value.replace(animationRegex, function(match2, p1, p2) {
|
|
cursor = {
|
|
name: p1,
|
|
styles: p2,
|
|
next: cursor
|
|
};
|
|
return p1;
|
|
});
|
|
}
|
|
}
|
|
}
|
|
if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === "number" && value !== 0) {
|
|
return value + "px";
|
|
}
|
|
return value;
|
|
};
|
|
var noComponentSelectorMessage = "Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";
|
|
function handleInterpolation(mergedProps, registered, interpolation) {
|
|
if (interpolation == null) {
|
|
return "";
|
|
}
|
|
var componentSelector = interpolation;
|
|
if (componentSelector.__emotion_styles !== void 0) {
|
|
return componentSelector;
|
|
}
|
|
switch (typeof interpolation) {
|
|
case "boolean": {
|
|
return "";
|
|
}
|
|
case "object": {
|
|
var keyframes2 = interpolation;
|
|
if (keyframes2.anim === 1) {
|
|
cursor = {
|
|
name: keyframes2.name,
|
|
styles: keyframes2.styles,
|
|
next: cursor
|
|
};
|
|
return keyframes2.name;
|
|
}
|
|
var serializedStyles = interpolation;
|
|
if (serializedStyles.styles !== void 0) {
|
|
var next2 = serializedStyles.next;
|
|
if (next2 !== void 0) {
|
|
while (next2 !== void 0) {
|
|
cursor = {
|
|
name: next2.name,
|
|
styles: next2.styles,
|
|
next: cursor
|
|
};
|
|
next2 = next2.next;
|
|
}
|
|
}
|
|
var styles = serializedStyles.styles + ";";
|
|
return styles;
|
|
}
|
|
return createStringFromObject(mergedProps, registered, interpolation);
|
|
}
|
|
case "function": {
|
|
if (mergedProps !== void 0) {
|
|
var previousCursor = cursor;
|
|
var result = interpolation(mergedProps);
|
|
cursor = previousCursor;
|
|
return handleInterpolation(mergedProps, registered, result);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
var asString = interpolation;
|
|
if (registered == null) {
|
|
return asString;
|
|
}
|
|
var cached = registered[asString];
|
|
return cached !== void 0 ? cached : asString;
|
|
}
|
|
function createStringFromObject(mergedProps, registered, obj) {
|
|
var string = "";
|
|
if (Array.isArray(obj)) {
|
|
for (var i = 0; i < obj.length; i++) {
|
|
string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
|
|
}
|
|
} else {
|
|
for (var key in obj) {
|
|
var value = obj[key];
|
|
if (typeof value !== "object") {
|
|
var asString = value;
|
|
if (registered != null && registered[asString] !== void 0) {
|
|
string += key + "{" + registered[asString] + "}";
|
|
} else if (isProcessableValue(asString)) {
|
|
string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
|
|
}
|
|
} else {
|
|
if (key === "NO_COMPONENT_SELECTOR" && isDevelopment2) {
|
|
throw new Error(noComponentSelectorMessage);
|
|
}
|
|
if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
|
|
for (var _i = 0; _i < value.length; _i++) {
|
|
if (isProcessableValue(value[_i])) {
|
|
string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
|
|
}
|
|
}
|
|
} else {
|
|
var interpolated = handleInterpolation(mergedProps, registered, value);
|
|
switch (key) {
|
|
case "animation":
|
|
case "animationName": {
|
|
string += processStyleName(key) + ":" + interpolated + ";";
|
|
break;
|
|
}
|
|
default: {
|
|
string += key + "{" + interpolated + "}";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return string;
|
|
}
|
|
var labelPattern = /label:\s*([^\s;{]+)\s*(;|$)/g;
|
|
var cursor;
|
|
function serializeStyles(args, registered, mergedProps) {
|
|
if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) {
|
|
return args[0];
|
|
}
|
|
var stringMode = true;
|
|
var styles = "";
|
|
cursor = void 0;
|
|
var strings = args[0];
|
|
if (strings == null || strings.raw === void 0) {
|
|
stringMode = false;
|
|
styles += handleInterpolation(mergedProps, registered, strings);
|
|
} else {
|
|
var asTemplateStringsArr = strings;
|
|
styles += asTemplateStringsArr[0];
|
|
}
|
|
for (var i = 1; i < args.length; i++) {
|
|
styles += handleInterpolation(mergedProps, registered, args[i]);
|
|
if (stringMode) {
|
|
var templateStringsArr = strings;
|
|
styles += templateStringsArr[i];
|
|
}
|
|
}
|
|
labelPattern.lastIndex = 0;
|
|
var identifierName = "";
|
|
var match2;
|
|
while ((match2 = labelPattern.exec(styles)) !== null) {
|
|
identifierName += "-" + match2[1];
|
|
}
|
|
var name = murmur2(styles) + identifierName;
|
|
return {
|
|
name,
|
|
styles,
|
|
next: cursor
|
|
};
|
|
}
|
|
|
|
// node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js
|
|
var React7 = __toESM(require_react());
|
|
var syncFallback = function syncFallback2(create) {
|
|
return create();
|
|
};
|
|
var useInsertionEffect2 = React7["useInsertionEffect"] ? React7["useInsertionEffect"] : false;
|
|
var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect2 || syncFallback;
|
|
|
|
// node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js
|
|
var isDevelopment3 = false;
|
|
var EmotionCacheContext = /* @__PURE__ */ React8.createContext(
|
|
// we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
// because this module is primarily intended for the browser and node
|
|
// but it's also required in react native and similar environments sometimes
|
|
// and we could have a special build just for that
|
|
// but this is much easier and the native packages
|
|
// might use a different theme context in the future anyway
|
|
typeof HTMLElement !== "undefined" ? /* @__PURE__ */ createCache({
|
|
key: "css"
|
|
}) : null
|
|
);
|
|
var CacheProvider = EmotionCacheContext.Provider;
|
|
var withEmotionCache = function withEmotionCache2(func) {
|
|
return /* @__PURE__ */ (0, import_react.forwardRef)(function(props, ref) {
|
|
var cache = (0, import_react.useContext)(EmotionCacheContext);
|
|
return func(props, cache, ref);
|
|
});
|
|
};
|
|
var ThemeContext = /* @__PURE__ */ React8.createContext({});
|
|
var hasOwn = {}.hasOwnProperty;
|
|
var typePropName = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__";
|
|
var createEmotionProps = function createEmotionProps2(type, props) {
|
|
var newProps = {};
|
|
for (var _key in props) {
|
|
if (hasOwn.call(props, _key)) {
|
|
newProps[_key] = props[_key];
|
|
}
|
|
}
|
|
newProps[typePropName] = type;
|
|
return newProps;
|
|
};
|
|
var Insertion = function Insertion2(_ref) {
|
|
var cache = _ref.cache, serialized = _ref.serialized, isStringTag2 = _ref.isStringTag;
|
|
registerStyles(cache, serialized, isStringTag2);
|
|
useInsertionEffectAlwaysWithSyncFallback(function() {
|
|
return insertStyles(cache, serialized, isStringTag2);
|
|
});
|
|
return null;
|
|
};
|
|
var Emotion = /* @__PURE__ */ withEmotionCache(function(props, cache, ref) {
|
|
var cssProp = props.css;
|
|
if (typeof cssProp === "string" && cache.registered[cssProp] !== void 0) {
|
|
cssProp = cache.registered[cssProp];
|
|
}
|
|
var WrappedComponent = props[typePropName];
|
|
var registeredStyles = [cssProp];
|
|
var className = "";
|
|
if (typeof props.className === "string") {
|
|
className = getRegisteredStyles(cache.registered, registeredStyles, props.className);
|
|
} else if (props.className != null) {
|
|
className = props.className + " ";
|
|
}
|
|
var serialized = serializeStyles(registeredStyles, void 0, React8.useContext(ThemeContext));
|
|
className += cache.key + "-" + serialized.name;
|
|
var newProps = {};
|
|
for (var _key2 in props) {
|
|
if (hasOwn.call(props, _key2) && _key2 !== "css" && _key2 !== typePropName && !isDevelopment3) {
|
|
newProps[_key2] = props[_key2];
|
|
}
|
|
}
|
|
newProps.className = className;
|
|
if (ref) {
|
|
newProps.ref = ref;
|
|
}
|
|
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(Insertion, {
|
|
cache,
|
|
serialized,
|
|
isStringTag: typeof WrappedComponent === "string"
|
|
}), /* @__PURE__ */ React8.createElement(WrappedComponent, newProps));
|
|
});
|
|
var Emotion$1 = Emotion;
|
|
|
|
// node_modules/@emotion/react/dist/emotion-react.browser.esm.js
|
|
var React9 = __toESM(require_react());
|
|
var import_hoist_non_react_statics = __toESM(require_hoist_non_react_statics_cjs());
|
|
var jsx = function jsx2(type, props) {
|
|
var args = arguments;
|
|
if (props == null || !hasOwn.call(props, "css")) {
|
|
return React9.createElement.apply(void 0, args);
|
|
}
|
|
var argsLength = args.length;
|
|
var createElementArgArray = new Array(argsLength);
|
|
createElementArgArray[0] = Emotion$1;
|
|
createElementArgArray[1] = createEmotionProps(type, props);
|
|
for (var i = 2; i < argsLength; i++) {
|
|
createElementArgArray[i] = args[i];
|
|
}
|
|
return React9.createElement.apply(null, createElementArgArray);
|
|
};
|
|
(function(_jsx37) {
|
|
var JSX;
|
|
/* @__PURE__ */ (function(_JSX) {
|
|
})(JSX || (JSX = _jsx37.JSX || (_jsx37.JSX = {})));
|
|
})(jsx || (jsx = {}));
|
|
function css() {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return serializeStyles(args);
|
|
}
|
|
function keyframes() {
|
|
var insertable = css.apply(void 0, arguments);
|
|
var name = "animation-" + insertable.name;
|
|
return {
|
|
name,
|
|
styles: "@keyframes " + name + "{" + insertable.styles + "}",
|
|
anim: 1,
|
|
toString: function toString() {
|
|
return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
|
|
}
|
|
};
|
|
}
|
|
|
|
// node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js
|
|
var React10 = __toESM(require_react());
|
|
|
|
// node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
|
|
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
|
|
var isPropValid = /* @__PURE__ */ memoize2(
|
|
function(prop) {
|
|
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
|
|
}
|
|
/* Z+1 */
|
|
);
|
|
|
|
// node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js
|
|
var isDevelopment4 = false;
|
|
var testOmitPropsOnStringTag = isPropValid;
|
|
var testOmitPropsOnComponent = function testOmitPropsOnComponent2(key) {
|
|
return key !== "theme";
|
|
};
|
|
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp2(tag) {
|
|
return typeof tag === "string" && // 96 is one less than the char code
|
|
// for "a" so this is checking that
|
|
// it's a lowercase character
|
|
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
|
|
};
|
|
var composeShouldForwardProps = function composeShouldForwardProps2(tag, options, isReal) {
|
|
var shouldForwardProp2;
|
|
if (options) {
|
|
var optionsShouldForwardProp = options.shouldForwardProp;
|
|
shouldForwardProp2 = tag.__emotion_forwardProp && optionsShouldForwardProp ? function(propName) {
|
|
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
|
|
} : optionsShouldForwardProp;
|
|
}
|
|
if (typeof shouldForwardProp2 !== "function" && isReal) {
|
|
shouldForwardProp2 = tag.__emotion_forwardProp;
|
|
}
|
|
return shouldForwardProp2;
|
|
};
|
|
var Insertion3 = function Insertion4(_ref) {
|
|
var cache = _ref.cache, serialized = _ref.serialized, isStringTag2 = _ref.isStringTag;
|
|
registerStyles(cache, serialized, isStringTag2);
|
|
useInsertionEffectAlwaysWithSyncFallback(function() {
|
|
return insertStyles(cache, serialized, isStringTag2);
|
|
});
|
|
return null;
|
|
};
|
|
var createStyled = function createStyled2(tag, options) {
|
|
var isReal = tag.__emotion_real === tag;
|
|
var baseTag = isReal && tag.__emotion_base || tag;
|
|
var identifierName;
|
|
var targetClassName;
|
|
if (options !== void 0) {
|
|
identifierName = options.label;
|
|
targetClassName = options.target;
|
|
}
|
|
var shouldForwardProp2 = composeShouldForwardProps(tag, options, isReal);
|
|
var defaultShouldForwardProp = shouldForwardProp2 || getDefaultShouldForwardProp(baseTag);
|
|
var shouldUseAs = !defaultShouldForwardProp("as");
|
|
return function() {
|
|
var args = arguments;
|
|
var styles = isReal && tag.__emotion_styles !== void 0 ? tag.__emotion_styles.slice(0) : [];
|
|
if (identifierName !== void 0) {
|
|
styles.push("label:" + identifierName + ";");
|
|
}
|
|
if (args[0] == null || args[0].raw === void 0) {
|
|
styles.push.apply(styles, args);
|
|
} else {
|
|
var templateStringsArr = args[0];
|
|
styles.push(templateStringsArr[0]);
|
|
var len = args.length;
|
|
var i = 1;
|
|
for (; i < len; i++) {
|
|
styles.push(args[i], templateStringsArr[i]);
|
|
}
|
|
}
|
|
var Styled = withEmotionCache(function(props, cache, ref) {
|
|
var FinalTag = shouldUseAs && props.as || baseTag;
|
|
var className = "";
|
|
var classInterpolations = [];
|
|
var mergedProps = props;
|
|
if (props.theme == null) {
|
|
mergedProps = {};
|
|
for (var key in props) {
|
|
mergedProps[key] = props[key];
|
|
}
|
|
mergedProps.theme = React10.useContext(ThemeContext);
|
|
}
|
|
if (typeof props.className === "string") {
|
|
className = getRegisteredStyles(cache.registered, classInterpolations, props.className);
|
|
} else if (props.className != null) {
|
|
className = props.className + " ";
|
|
}
|
|
var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
|
|
className += cache.key + "-" + serialized.name;
|
|
if (targetClassName !== void 0) {
|
|
className += " " + targetClassName;
|
|
}
|
|
var finalShouldForwardProp = shouldUseAs && shouldForwardProp2 === void 0 ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
|
|
var newProps = {};
|
|
for (var _key in props) {
|
|
if (shouldUseAs && _key === "as") continue;
|
|
if (finalShouldForwardProp(_key)) {
|
|
newProps[_key] = props[_key];
|
|
}
|
|
}
|
|
newProps.className = className;
|
|
if (ref) {
|
|
newProps.ref = ref;
|
|
}
|
|
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(Insertion3, {
|
|
cache,
|
|
serialized,
|
|
isStringTag: typeof FinalTag === "string"
|
|
}), /* @__PURE__ */ React10.createElement(FinalTag, newProps));
|
|
});
|
|
Styled.displayName = identifierName !== void 0 ? identifierName : "Styled(" + (typeof baseTag === "string" ? baseTag : baseTag.displayName || baseTag.name || "Component") + ")";
|
|
Styled.defaultProps = tag.defaultProps;
|
|
Styled.__emotion_real = Styled;
|
|
Styled.__emotion_base = baseTag;
|
|
Styled.__emotion_styles = styles;
|
|
Styled.__emotion_forwardProp = shouldForwardProp2;
|
|
Object.defineProperty(Styled, "toString", {
|
|
value: function value() {
|
|
if (targetClassName === void 0 && isDevelopment4) {
|
|
return "NO_COMPONENT_SELECTOR";
|
|
}
|
|
return "." + targetClassName;
|
|
}
|
|
});
|
|
Styled.withComponent = function(nextTag, nextOptions) {
|
|
var newStyled = createStyled2(nextTag, _extends({}, options, nextOptions, {
|
|
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
|
|
}));
|
|
return newStyled.apply(void 0, styles);
|
|
};
|
|
return Styled;
|
|
};
|
|
};
|
|
|
|
// node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js
|
|
var import_react3 = __toESM(require_react());
|
|
var tags = [
|
|
"a",
|
|
"abbr",
|
|
"address",
|
|
"area",
|
|
"article",
|
|
"aside",
|
|
"audio",
|
|
"b",
|
|
"base",
|
|
"bdi",
|
|
"bdo",
|
|
"big",
|
|
"blockquote",
|
|
"body",
|
|
"br",
|
|
"button",
|
|
"canvas",
|
|
"caption",
|
|
"cite",
|
|
"code",
|
|
"col",
|
|
"colgroup",
|
|
"data",
|
|
"datalist",
|
|
"dd",
|
|
"del",
|
|
"details",
|
|
"dfn",
|
|
"dialog",
|
|
"div",
|
|
"dl",
|
|
"dt",
|
|
"em",
|
|
"embed",
|
|
"fieldset",
|
|
"figcaption",
|
|
"figure",
|
|
"footer",
|
|
"form",
|
|
"h1",
|
|
"h2",
|
|
"h3",
|
|
"h4",
|
|
"h5",
|
|
"h6",
|
|
"head",
|
|
"header",
|
|
"hgroup",
|
|
"hr",
|
|
"html",
|
|
"i",
|
|
"iframe",
|
|
"img",
|
|
"input",
|
|
"ins",
|
|
"kbd",
|
|
"keygen",
|
|
"label",
|
|
"legend",
|
|
"li",
|
|
"link",
|
|
"main",
|
|
"map",
|
|
"mark",
|
|
"marquee",
|
|
"menu",
|
|
"menuitem",
|
|
"meta",
|
|
"meter",
|
|
"nav",
|
|
"noscript",
|
|
"object",
|
|
"ol",
|
|
"optgroup",
|
|
"option",
|
|
"output",
|
|
"p",
|
|
"param",
|
|
"picture",
|
|
"pre",
|
|
"progress",
|
|
"q",
|
|
"rp",
|
|
"rt",
|
|
"ruby",
|
|
"s",
|
|
"samp",
|
|
"script",
|
|
"section",
|
|
"select",
|
|
"small",
|
|
"source",
|
|
"span",
|
|
"strong",
|
|
"style",
|
|
"sub",
|
|
"summary",
|
|
"sup",
|
|
"table",
|
|
"tbody",
|
|
"td",
|
|
"textarea",
|
|
"tfoot",
|
|
"th",
|
|
"thead",
|
|
"time",
|
|
"title",
|
|
"tr",
|
|
"track",
|
|
"u",
|
|
"ul",
|
|
"var",
|
|
"video",
|
|
"wbr",
|
|
// SVG
|
|
"circle",
|
|
"clipPath",
|
|
"defs",
|
|
"ellipse",
|
|
"foreignObject",
|
|
"g",
|
|
"image",
|
|
"line",
|
|
"linearGradient",
|
|
"mask",
|
|
"path",
|
|
"pattern",
|
|
"polygon",
|
|
"polyline",
|
|
"radialGradient",
|
|
"rect",
|
|
"stop",
|
|
"svg",
|
|
"text",
|
|
"tspan"
|
|
];
|
|
var styled = createStyled.bind(null);
|
|
tags.forEach(function(tagName) {
|
|
styled[tagName] = styled(tagName);
|
|
});
|
|
|
|
// node_modules/@mui/styled-engine/esm/index.js
|
|
function styled2(tag, options) {
|
|
const stylesFactory = styled(tag, options);
|
|
if (true) {
|
|
return (...styles) => {
|
|
const component = typeof tag === "string" ? `"${tag}"` : "component";
|
|
if (styles.length === 0) {
|
|
console.error([`MUI: Seems like you called \`styled(${component})()\` without a \`style\` argument.`, 'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join("\n"));
|
|
} else if (styles.some((style3) => style3 === void 0)) {
|
|
console.error(`MUI: the styled(${component})(...args) API requires all its args to be defined.`);
|
|
}
|
|
return stylesFactory(...styles);
|
|
};
|
|
}
|
|
return stylesFactory;
|
|
}
|
|
function internal_mutateStyles(tag, processor) {
|
|
if (Array.isArray(tag.__emotion_styles)) {
|
|
tag.__emotion_styles = processor(tag.__emotion_styles);
|
|
}
|
|
}
|
|
var wrapper = [];
|
|
function internal_serializeStyles(styles) {
|
|
wrapper[0] = styles;
|
|
return serializeStyles(wrapper);
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/createBreakpoints/createBreakpoints.js
|
|
var sortBreakpointsValues = (values3) => {
|
|
const breakpointsAsArray = Object.keys(values3).map((key) => ({
|
|
key,
|
|
val: values3[key]
|
|
})) || [];
|
|
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
|
|
return breakpointsAsArray.reduce((acc, obj) => {
|
|
return __spreadProps(__spreadValues({}, acc), {
|
|
[obj.key]: obj.val
|
|
});
|
|
}, {});
|
|
};
|
|
function createBreakpoints(breakpoints) {
|
|
const _a = breakpoints, {
|
|
values: values3 = {
|
|
xs: 0,
|
|
// phone
|
|
sm: 600,
|
|
// tablet
|
|
md: 900,
|
|
// small laptop
|
|
lg: 1200,
|
|
// desktop
|
|
xl: 1536
|
|
// large screen
|
|
},
|
|
unit = "px",
|
|
step = 5
|
|
} = _a, other = __objRest(_a, [
|
|
// The breakpoint **start** at this value.
|
|
// For instance with the first breakpoint xs: [xs, sm).
|
|
"values",
|
|
"unit",
|
|
"step"
|
|
]);
|
|
const sortedValues = sortBreakpointsValues(values3);
|
|
const keys = Object.keys(sortedValues);
|
|
function up(key) {
|
|
const value = typeof values3[key] === "number" ? values3[key] : key;
|
|
return `@media (min-width:${value}${unit})`;
|
|
}
|
|
function down(key) {
|
|
const value = typeof values3[key] === "number" ? values3[key] : key;
|
|
return `@media (max-width:${value - step / 100}${unit})`;
|
|
}
|
|
function between(start, end) {
|
|
const endIndex = keys.indexOf(end);
|
|
return `@media (min-width:${typeof values3[start] === "number" ? values3[start] : start}${unit}) and (max-width:${(endIndex !== -1 && typeof values3[keys[endIndex]] === "number" ? values3[keys[endIndex]] : end) - step / 100}${unit})`;
|
|
}
|
|
function only(key) {
|
|
if (keys.indexOf(key) + 1 < keys.length) {
|
|
return between(key, keys[keys.indexOf(key) + 1]);
|
|
}
|
|
return up(key);
|
|
}
|
|
function not(key) {
|
|
const keyIndex = keys.indexOf(key);
|
|
if (keyIndex === 0) {
|
|
return up(keys[1]);
|
|
}
|
|
if (keyIndex === keys.length - 1) {
|
|
return down(keys[keyIndex]);
|
|
}
|
|
return between(key, keys[keys.indexOf(key) + 1]).replace("@media", "@media not all and");
|
|
}
|
|
return __spreadValues({
|
|
keys,
|
|
values: sortedValues,
|
|
up,
|
|
down,
|
|
between,
|
|
only,
|
|
not,
|
|
unit
|
|
}, other);
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/createTheme/shape.js
|
|
var shape = {
|
|
borderRadius: 4
|
|
};
|
|
var shape_default = shape;
|
|
|
|
// node_modules/@mui/system/esm/createTheme/createSpacing.js
|
|
function createSpacing(spacingInput = 8, transform = createUnarySpacing({
|
|
spacing: spacingInput
|
|
})) {
|
|
if (spacingInput.mui) {
|
|
return spacingInput;
|
|
}
|
|
const spacing2 = (...argsInput) => {
|
|
if (true) {
|
|
if (!(argsInput.length <= 4)) {
|
|
console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);
|
|
}
|
|
}
|
|
const args = argsInput.length === 0 ? [1] : argsInput;
|
|
return args.map((argument) => {
|
|
const output = transform(argument);
|
|
return typeof output === "number" ? `${output}px` : output;
|
|
}).join(" ");
|
|
};
|
|
spacing2.mui = true;
|
|
return spacing2;
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/createTheme/applyStyles.js
|
|
function applyStyles(key, styles) {
|
|
var _a;
|
|
const theme = this;
|
|
if (theme.vars) {
|
|
if (!((_a = theme.colorSchemes) == null ? void 0 : _a[key]) || typeof theme.getColorSchemeSelector !== "function") {
|
|
return {};
|
|
}
|
|
let selector = theme.getColorSchemeSelector(key);
|
|
if (selector === "&") {
|
|
return styles;
|
|
}
|
|
if (selector.includes("data-") || selector.includes(".")) {
|
|
selector = `*:where(${selector.replace(/\s*&$/, "")}) &`;
|
|
}
|
|
return {
|
|
[selector]: styles
|
|
};
|
|
}
|
|
if (theme.palette.mode === key) {
|
|
return styles;
|
|
}
|
|
return {};
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/createTheme/createTheme.js
|
|
function createTheme(options = {}, ...args) {
|
|
const _a = options, {
|
|
breakpoints: breakpointsInput = {},
|
|
palette: paletteInput = {},
|
|
spacing: spacingInput,
|
|
shape: shapeInput = {}
|
|
} = _a, other = __objRest(_a, [
|
|
"breakpoints",
|
|
"palette",
|
|
"spacing",
|
|
"shape"
|
|
]);
|
|
const breakpoints = createBreakpoints(breakpointsInput);
|
|
const spacing2 = createSpacing(spacingInput);
|
|
let muiTheme = deepmerge({
|
|
breakpoints,
|
|
direction: "ltr",
|
|
components: {},
|
|
// Inject component definitions.
|
|
palette: __spreadValues({
|
|
mode: "light"
|
|
}, paletteInput),
|
|
spacing: spacing2,
|
|
shape: __spreadValues(__spreadValues({}, shape_default), shapeInput)
|
|
}, other);
|
|
muiTheme = cssContainerQueries(muiTheme);
|
|
muiTheme.applyStyles = applyStyles;
|
|
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
muiTheme.unstable_sxConfig = __spreadValues(__spreadValues({}, defaultSxConfig_default), other == null ? void 0 : other.unstable_sxConfig);
|
|
muiTheme.unstable_sx = function sx(props) {
|
|
return styleFunctionSx_default({
|
|
sx: props,
|
|
theme: this
|
|
});
|
|
};
|
|
return muiTheme;
|
|
}
|
|
var createTheme_default = createTheme;
|
|
|
|
// node_modules/@mui/system/esm/useThemeWithoutDefault/useThemeWithoutDefault.js
|
|
var React11 = __toESM(require_react(), 1);
|
|
function isObjectEmpty(obj) {
|
|
return Object.keys(obj).length === 0;
|
|
}
|
|
function useTheme2(defaultTheme3 = null) {
|
|
const contextTheme = React11.useContext(ThemeContext);
|
|
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme3 : contextTheme;
|
|
}
|
|
var useThemeWithoutDefault_default = useTheme2;
|
|
|
|
// node_modules/@mui/system/esm/useTheme/useTheme.js
|
|
var systemDefaultTheme = createTheme_default();
|
|
function useTheme3(defaultTheme3 = systemDefaultTheme) {
|
|
return useThemeWithoutDefault_default(defaultTheme3);
|
|
}
|
|
var useTheme_default = useTheme3;
|
|
|
|
// node_modules/@mui/utils/esm/ClassNameGenerator/ClassNameGenerator.js
|
|
var defaultGenerator = (componentName) => componentName;
|
|
var createClassNameGenerator = () => {
|
|
let generate = defaultGenerator;
|
|
return {
|
|
configure(generator) {
|
|
generate = generator;
|
|
},
|
|
generate(componentName) {
|
|
return generate(componentName);
|
|
},
|
|
reset() {
|
|
generate = defaultGenerator;
|
|
}
|
|
};
|
|
};
|
|
var ClassNameGenerator = createClassNameGenerator();
|
|
var ClassNameGenerator_default = ClassNameGenerator;
|
|
|
|
// node_modules/@mui/system/esm/createBox/createBox.js
|
|
var React12 = __toESM(require_react(), 1);
|
|
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
function createBox(options = {}) {
|
|
const {
|
|
themeId,
|
|
defaultTheme: defaultTheme3,
|
|
defaultClassName = "MuiBox-root",
|
|
generateClassName
|
|
} = options;
|
|
const BoxRoot = styled2("div", {
|
|
shouldForwardProp: (prop) => prop !== "theme" && prop !== "sx" && prop !== "as"
|
|
})(styleFunctionSx_default);
|
|
const Box2 = /* @__PURE__ */ React12.forwardRef(function Box3(inProps, ref) {
|
|
const theme = useTheme_default(defaultTheme3);
|
|
const _a = extendSxProp(inProps), {
|
|
className,
|
|
component = "div"
|
|
} = _a, other = __objRest(_a, [
|
|
"className",
|
|
"component"
|
|
]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BoxRoot, __spreadValues({
|
|
as: component,
|
|
ref,
|
|
className: clsx_default(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),
|
|
theme: themeId ? theme[themeId] || theme : theme
|
|
}, other));
|
|
});
|
|
return Box2;
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/generateUtilityClass/generateUtilityClass.js
|
|
var globalStateClasses = {
|
|
active: "active",
|
|
checked: "checked",
|
|
completed: "completed",
|
|
disabled: "disabled",
|
|
error: "error",
|
|
expanded: "expanded",
|
|
focused: "focused",
|
|
focusVisible: "focusVisible",
|
|
open: "open",
|
|
readOnly: "readOnly",
|
|
required: "required",
|
|
selected: "selected"
|
|
};
|
|
function generateUtilityClass(componentName, slot, globalStatePrefix = "Mui") {
|
|
const globalStateClass = globalStateClasses[slot];
|
|
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator_default.generate(componentName)}-${slot}`;
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/generateUtilityClasses/generateUtilityClasses.js
|
|
function generateUtilityClasses(componentName, slots, globalStatePrefix = "Mui") {
|
|
const result = {};
|
|
slots.forEach((slot) => {
|
|
result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
|
|
});
|
|
return result;
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/getDisplayName/getDisplayName.js
|
|
var import_react_is2 = __toESM(require_react_is2(), 1);
|
|
function getFunctionComponentName(Component, fallback = "") {
|
|
return Component.displayName || Component.name || fallback;
|
|
}
|
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
const functionName = getFunctionComponentName(innerType);
|
|
return outerType.displayName || (functionName !== "" ? `${wrapperName}(${functionName})` : wrapperName);
|
|
}
|
|
function getDisplayName(Component) {
|
|
if (Component == null) {
|
|
return void 0;
|
|
}
|
|
if (typeof Component === "string") {
|
|
return Component;
|
|
}
|
|
if (typeof Component === "function") {
|
|
return getFunctionComponentName(Component, "Component");
|
|
}
|
|
if (typeof Component === "object") {
|
|
switch (Component.$$typeof) {
|
|
case import_react_is2.ForwardRef:
|
|
return getWrappedName(Component, Component.render, "ForwardRef");
|
|
case import_react_is2.Memo:
|
|
return getWrappedName(Component, Component.type, "memo");
|
|
default:
|
|
return void 0;
|
|
}
|
|
}
|
|
return void 0;
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/preprocessStyles.js
|
|
function preprocessStyles(input) {
|
|
const _a = input, {
|
|
variants
|
|
} = _a, style3 = __objRest(_a, [
|
|
"variants"
|
|
]);
|
|
const result = {
|
|
variants,
|
|
style: internal_serializeStyles(style3),
|
|
isProcessed: true
|
|
};
|
|
if (result.style === style3) {
|
|
return result;
|
|
}
|
|
if (variants) {
|
|
variants.forEach((variant) => {
|
|
if (typeof variant.style !== "function") {
|
|
variant.style = internal_serializeStyles(variant.style);
|
|
}
|
|
});
|
|
}
|
|
return result;
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/createStyled/createStyled.js
|
|
var systemDefaultTheme2 = createTheme_default();
|
|
function shouldForwardProp(prop) {
|
|
return prop !== "ownerState" && prop !== "theme" && prop !== "sx" && prop !== "as";
|
|
}
|
|
function shallowLayer(serialized, layerName) {
|
|
if (layerName && serialized && typeof serialized === "object" && serialized.styles && !serialized.styles.startsWith("@layer")) {
|
|
serialized.styles = `@layer ${layerName}{${String(serialized.styles)}}`;
|
|
}
|
|
return serialized;
|
|
}
|
|
function defaultOverridesResolver(slot) {
|
|
if (!slot) {
|
|
return null;
|
|
}
|
|
return (_props, styles) => styles[slot];
|
|
}
|
|
function attachTheme(props, themeId, defaultTheme3) {
|
|
props.theme = isObjectEmpty2(props.theme) ? defaultTheme3 : props.theme[themeId] || props.theme;
|
|
}
|
|
function processStyle(props, style3, layerName) {
|
|
const resolvedStyle = typeof style3 === "function" ? style3(props) : style3;
|
|
if (Array.isArray(resolvedStyle)) {
|
|
return resolvedStyle.flatMap((subStyle) => processStyle(props, subStyle, layerName));
|
|
}
|
|
if (Array.isArray(resolvedStyle == null ? void 0 : resolvedStyle.variants)) {
|
|
let rootStyle;
|
|
if (resolvedStyle.isProcessed) {
|
|
rootStyle = layerName ? shallowLayer(resolvedStyle.style, layerName) : resolvedStyle.style;
|
|
} else {
|
|
const _a = resolvedStyle, {
|
|
variants
|
|
} = _a, otherStyles = __objRest(_a, [
|
|
"variants"
|
|
]);
|
|
rootStyle = layerName ? shallowLayer(internal_serializeStyles(otherStyles), layerName) : otherStyles;
|
|
}
|
|
return processStyleVariants(props, resolvedStyle.variants, [rootStyle], layerName);
|
|
}
|
|
if (resolvedStyle == null ? void 0 : resolvedStyle.isProcessed) {
|
|
return layerName ? shallowLayer(internal_serializeStyles(resolvedStyle.style), layerName) : resolvedStyle.style;
|
|
}
|
|
return layerName ? shallowLayer(internal_serializeStyles(resolvedStyle), layerName) : resolvedStyle;
|
|
}
|
|
function processStyleVariants(props, variants, results = [], layerName = void 0) {
|
|
var _a;
|
|
let mergedState;
|
|
variantLoop: for (let i = 0; i < variants.length; i += 1) {
|
|
const variant = variants[i];
|
|
if (typeof variant.props === "function") {
|
|
mergedState != null ? mergedState : mergedState = __spreadProps(__spreadValues(__spreadValues({}, props), props.ownerState), {
|
|
ownerState: props.ownerState
|
|
});
|
|
if (!variant.props(mergedState)) {
|
|
continue;
|
|
}
|
|
} else {
|
|
for (const key in variant.props) {
|
|
if (props[key] !== variant.props[key] && ((_a = props.ownerState) == null ? void 0 : _a[key]) !== variant.props[key]) {
|
|
continue variantLoop;
|
|
}
|
|
}
|
|
}
|
|
if (typeof variant.style === "function") {
|
|
mergedState != null ? mergedState : mergedState = __spreadProps(__spreadValues(__spreadValues({}, props), props.ownerState), {
|
|
ownerState: props.ownerState
|
|
});
|
|
results.push(layerName ? shallowLayer(internal_serializeStyles(variant.style(mergedState)), layerName) : variant.style(mergedState));
|
|
} else {
|
|
results.push(layerName ? shallowLayer(internal_serializeStyles(variant.style), layerName) : variant.style);
|
|
}
|
|
}
|
|
return results;
|
|
}
|
|
function createStyled3(input = {}) {
|
|
const {
|
|
themeId,
|
|
defaultTheme: defaultTheme3 = systemDefaultTheme2,
|
|
rootShouldForwardProp: rootShouldForwardProp2 = shouldForwardProp,
|
|
slotShouldForwardProp: slotShouldForwardProp2 = shouldForwardProp
|
|
} = input;
|
|
function styleAttachTheme(props) {
|
|
attachTheme(props, themeId, defaultTheme3);
|
|
}
|
|
const styled4 = (tag, inputOptions = {}) => {
|
|
internal_mutateStyles(tag, (styles) => styles.filter((style3) => style3 !== styleFunctionSx_default));
|
|
const _a = inputOptions, {
|
|
name: componentName,
|
|
slot: componentSlot,
|
|
skipVariantsResolver: inputSkipVariantsResolver,
|
|
skipSx: inputSkipSx,
|
|
overridesResolver: overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))
|
|
} = _a, options = __objRest(_a, [
|
|
"name",
|
|
"slot",
|
|
"skipVariantsResolver",
|
|
"skipSx",
|
|
// TODO v6: remove `lowercaseFirstLetter()` in the next major release
|
|
// For more details: https://github.com/mui/material-ui/pull/37908
|
|
"overridesResolver"
|
|
]);
|
|
const layerName = componentName && componentName.startsWith("Mui") || !!componentSlot ? "components" : "custom";
|
|
const skipVariantsResolver = inputSkipVariantsResolver !== void 0 ? inputSkipVariantsResolver : (
|
|
// TODO v6: remove `Root` in the next major release
|
|
// For more details: https://github.com/mui/material-ui/pull/37908
|
|
componentSlot && componentSlot !== "Root" && componentSlot !== "root" || false
|
|
);
|
|
const skipSx = inputSkipSx || false;
|
|
let shouldForwardPropOption = shouldForwardProp;
|
|
if (componentSlot === "Root" || componentSlot === "root") {
|
|
shouldForwardPropOption = rootShouldForwardProp2;
|
|
} else if (componentSlot) {
|
|
shouldForwardPropOption = slotShouldForwardProp2;
|
|
} else if (isStringTag(tag)) {
|
|
shouldForwardPropOption = void 0;
|
|
}
|
|
const defaultStyledResolver = styled2(tag, __spreadValues({
|
|
shouldForwardProp: shouldForwardPropOption,
|
|
label: generateStyledLabel(componentName, componentSlot)
|
|
}, options));
|
|
const transformStyle = (style3) => {
|
|
if (style3.__emotion_real === style3) {
|
|
return style3;
|
|
}
|
|
if (typeof style3 === "function") {
|
|
return function styleFunctionProcessor(props) {
|
|
return processStyle(props, style3, props.theme.modularCssLayers ? layerName : void 0);
|
|
};
|
|
}
|
|
if (isPlainObject(style3)) {
|
|
const serialized = preprocessStyles(style3);
|
|
return function styleObjectProcessor(props) {
|
|
if (!serialized.variants) {
|
|
return props.theme.modularCssLayers ? shallowLayer(serialized.style, layerName) : serialized.style;
|
|
}
|
|
return processStyle(props, serialized, props.theme.modularCssLayers ? layerName : void 0);
|
|
};
|
|
}
|
|
return style3;
|
|
};
|
|
const muiStyledResolver = (...expressionsInput) => {
|
|
const expressionsHead = [];
|
|
const expressionsBody = expressionsInput.map(transformStyle);
|
|
const expressionsTail = [];
|
|
expressionsHead.push(styleAttachTheme);
|
|
if (componentName && overridesResolver) {
|
|
expressionsTail.push(function styleThemeOverrides(props) {
|
|
var _a2, _b;
|
|
const theme = props.theme;
|
|
const styleOverrides = (_b = (_a2 = theme.components) == null ? void 0 : _a2[componentName]) == null ? void 0 : _b.styleOverrides;
|
|
if (!styleOverrides) {
|
|
return null;
|
|
}
|
|
const resolvedStyleOverrides = {};
|
|
for (const slotKey in styleOverrides) {
|
|
resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey], props.theme.modularCssLayers ? "theme" : void 0);
|
|
}
|
|
return overridesResolver(props, resolvedStyleOverrides);
|
|
});
|
|
}
|
|
if (componentName && !skipVariantsResolver) {
|
|
expressionsTail.push(function styleThemeVariants(props) {
|
|
var _a2, _b;
|
|
const theme = props.theme;
|
|
const themeVariants = (_b = (_a2 = theme == null ? void 0 : theme.components) == null ? void 0 : _a2[componentName]) == null ? void 0 : _b.variants;
|
|
if (!themeVariants) {
|
|
return null;
|
|
}
|
|
return processStyleVariants(props, themeVariants, [], props.theme.modularCssLayers ? "theme" : void 0);
|
|
});
|
|
}
|
|
if (!skipSx) {
|
|
expressionsTail.push(styleFunctionSx_default);
|
|
}
|
|
if (Array.isArray(expressionsBody[0])) {
|
|
const inputStrings = expressionsBody.shift();
|
|
const placeholdersHead = new Array(expressionsHead.length).fill("");
|
|
const placeholdersTail = new Array(expressionsTail.length).fill("");
|
|
let outputStrings;
|
|
{
|
|
outputStrings = [...placeholdersHead, ...inputStrings, ...placeholdersTail];
|
|
outputStrings.raw = [...placeholdersHead, ...inputStrings.raw, ...placeholdersTail];
|
|
}
|
|
expressionsHead.unshift(outputStrings);
|
|
}
|
|
const expressions = [...expressionsHead, ...expressionsBody, ...expressionsTail];
|
|
const Component = defaultStyledResolver(...expressions);
|
|
if (tag.muiName) {
|
|
Component.muiName = tag.muiName;
|
|
}
|
|
if (true) {
|
|
Component.displayName = generateDisplayName(componentName, componentSlot, tag);
|
|
}
|
|
return Component;
|
|
};
|
|
if (defaultStyledResolver.withConfig) {
|
|
muiStyledResolver.withConfig = defaultStyledResolver.withConfig;
|
|
}
|
|
return muiStyledResolver;
|
|
};
|
|
return styled4;
|
|
}
|
|
function generateDisplayName(componentName, componentSlot, tag) {
|
|
if (componentName) {
|
|
return `${componentName}${capitalize(componentSlot || "")}`;
|
|
}
|
|
return `Styled(${getDisplayName(tag)})`;
|
|
}
|
|
function generateStyledLabel(componentName, componentSlot) {
|
|
let label;
|
|
if (true) {
|
|
if (componentName) {
|
|
label = `${componentName}-${lowercaseFirstLetter(componentSlot || "Root")}`;
|
|
}
|
|
}
|
|
return label;
|
|
}
|
|
function isObjectEmpty2(object) {
|
|
for (const _ in object) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function isStringTag(tag) {
|
|
return typeof tag === "string" && // 96 is one less than the char code
|
|
// for "a" so this is checking that
|
|
// it's a lowercase character
|
|
tag.charCodeAt(0) > 96;
|
|
}
|
|
function lowercaseFirstLetter(string) {
|
|
if (!string) {
|
|
return string;
|
|
}
|
|
return string.charAt(0).toLowerCase() + string.slice(1);
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/resolveProps/resolveProps.js
|
|
function resolveProps(defaultProps2, props, mergeClassNameAndStyle = false) {
|
|
const output = __spreadValues({}, props);
|
|
for (const key in defaultProps2) {
|
|
if (Object.prototype.hasOwnProperty.call(defaultProps2, key)) {
|
|
const propName = key;
|
|
if (propName === "components" || propName === "slots") {
|
|
output[propName] = __spreadValues(__spreadValues({}, defaultProps2[propName]), output[propName]);
|
|
} else if (propName === "componentsProps" || propName === "slotProps") {
|
|
const defaultSlotProps = defaultProps2[propName];
|
|
const slotProps = props[propName];
|
|
if (!slotProps) {
|
|
output[propName] = defaultSlotProps || {};
|
|
} else if (!defaultSlotProps) {
|
|
output[propName] = slotProps;
|
|
} else {
|
|
output[propName] = __spreadValues({}, slotProps);
|
|
for (const slotKey in defaultSlotProps) {
|
|
if (Object.prototype.hasOwnProperty.call(defaultSlotProps, slotKey)) {
|
|
const slotPropName = slotKey;
|
|
output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName], mergeClassNameAndStyle);
|
|
}
|
|
}
|
|
}
|
|
} else if (propName === "className" && mergeClassNameAndStyle && props.className) {
|
|
output.className = clsx_default(defaultProps2 == null ? void 0 : defaultProps2.className, props == null ? void 0 : props.className);
|
|
} else if (propName === "style" && mergeClassNameAndStyle && props.style) {
|
|
output.style = __spreadValues(__spreadValues({}, defaultProps2 == null ? void 0 : defaultProps2.style), props == null ? void 0 : props.style);
|
|
} else if (output[propName] === void 0) {
|
|
output[propName] = defaultProps2[propName];
|
|
}
|
|
}
|
|
}
|
|
return output;
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/useThemeProps/getThemeProps.js
|
|
function getThemeProps(params) {
|
|
const {
|
|
theme,
|
|
name,
|
|
props
|
|
} = params;
|
|
if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {
|
|
return props;
|
|
}
|
|
return resolveProps(theme.components[name].defaultProps, props);
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/useThemeProps/useThemeProps.js
|
|
function useThemeProps({
|
|
props,
|
|
name,
|
|
defaultTheme: defaultTheme3,
|
|
themeId
|
|
}) {
|
|
let theme = useTheme_default(defaultTheme3);
|
|
if (themeId) {
|
|
theme = theme[themeId] || theme;
|
|
}
|
|
return getThemeProps({
|
|
theme,
|
|
name,
|
|
props
|
|
});
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js
|
|
var React13 = __toESM(require_react(), 1);
|
|
var useEnhancedEffect = typeof window !== "undefined" ? React13.useLayoutEffect : React13.useEffect;
|
|
var useEnhancedEffect_default = useEnhancedEffect;
|
|
|
|
// node_modules/@mui/utils/esm/clamp/clamp.js
|
|
function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
|
|
return Math.max(min, Math.min(val, max));
|
|
}
|
|
var clamp_default = clamp;
|
|
|
|
// node_modules/@mui/system/esm/colorManipulator/colorManipulator.js
|
|
function clampWrapper(value, min = 0, max = 1) {
|
|
if (true) {
|
|
if (value < min || value > max) {
|
|
console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);
|
|
}
|
|
}
|
|
return clamp_default(value, min, max);
|
|
}
|
|
function hexToRgb(color2) {
|
|
color2 = color2.slice(1);
|
|
const re = new RegExp(`.{1,${color2.length >= 6 ? 2 : 1}}`, "g");
|
|
let colors = color2.match(re);
|
|
if (colors && colors[0].length === 1) {
|
|
colors = colors.map((n) => n + n);
|
|
}
|
|
if (true) {
|
|
if (color2.length !== color2.trim().length) {
|
|
console.error(`MUI: The color: "${color2}" is invalid. Make sure the color input doesn't contain leading/trailing space.`);
|
|
}
|
|
}
|
|
return colors ? `rgb${colors.length === 4 ? "a" : ""}(${colors.map((n, index) => {
|
|
return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1e3) / 1e3;
|
|
}).join(", ")})` : "";
|
|
}
|
|
function decomposeColor(color2) {
|
|
if (color2.type) {
|
|
return color2;
|
|
}
|
|
if (color2.charAt(0) === "#") {
|
|
return decomposeColor(hexToRgb(color2));
|
|
}
|
|
const marker = color2.indexOf("(");
|
|
const type = color2.substring(0, marker);
|
|
if (!["rgb", "rgba", "hsl", "hsla", "color"].includes(type)) {
|
|
throw new Error(true ? `MUI: Unsupported \`${color2}\` color.
|
|
The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : formatMuiErrorMessage(9, color2));
|
|
}
|
|
let values3 = color2.substring(marker + 1, color2.length - 1);
|
|
let colorSpace;
|
|
if (type === "color") {
|
|
values3 = values3.split(" ");
|
|
colorSpace = values3.shift();
|
|
if (values3.length === 4 && values3[3].charAt(0) === "/") {
|
|
values3[3] = values3[3].slice(1);
|
|
}
|
|
if (!["srgb", "display-p3", "a98-rgb", "prophoto-rgb", "rec-2020"].includes(colorSpace)) {
|
|
throw new Error(true ? `MUI: unsupported \`${colorSpace}\` color space.
|
|
The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : formatMuiErrorMessage(10, colorSpace));
|
|
}
|
|
} else {
|
|
values3 = values3.split(",");
|
|
}
|
|
values3 = values3.map((value) => parseFloat(value));
|
|
return {
|
|
type,
|
|
values: values3,
|
|
colorSpace
|
|
};
|
|
}
|
|
var colorChannel = (color2) => {
|
|
const decomposedColor = decomposeColor(color2);
|
|
return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.includes("hsl") && idx !== 0 ? `${val}%` : val).join(" ");
|
|
};
|
|
var private_safeColorChannel = (color2, warning) => {
|
|
try {
|
|
return colorChannel(color2);
|
|
} catch (error) {
|
|
if (warning && true) {
|
|
console.warn(warning);
|
|
}
|
|
return color2;
|
|
}
|
|
};
|
|
function recomposeColor(color2) {
|
|
const {
|
|
type,
|
|
colorSpace
|
|
} = color2;
|
|
let {
|
|
values: values3
|
|
} = color2;
|
|
if (type.includes("rgb")) {
|
|
values3 = values3.map((n, i) => i < 3 ? parseInt(n, 10) : n);
|
|
} else if (type.includes("hsl")) {
|
|
values3[1] = `${values3[1]}%`;
|
|
values3[2] = `${values3[2]}%`;
|
|
}
|
|
if (type.includes("color")) {
|
|
values3 = `${colorSpace} ${values3.join(" ")}`;
|
|
} else {
|
|
values3 = `${values3.join(", ")}`;
|
|
}
|
|
return `${type}(${values3})`;
|
|
}
|
|
function hslToRgb(color2) {
|
|
color2 = decomposeColor(color2);
|
|
const {
|
|
values: values3
|
|
} = color2;
|
|
const h = values3[0];
|
|
const s = values3[1] / 100;
|
|
const l = values3[2] / 100;
|
|
const a = s * Math.min(l, 1 - l);
|
|
const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
|
|
let type = "rgb";
|
|
const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];
|
|
if (color2.type === "hsla") {
|
|
type += "a";
|
|
rgb.push(values3[3]);
|
|
}
|
|
return recomposeColor({
|
|
type,
|
|
values: rgb
|
|
});
|
|
}
|
|
function getLuminance(color2) {
|
|
color2 = decomposeColor(color2);
|
|
let rgb = color2.type === "hsl" || color2.type === "hsla" ? decomposeColor(hslToRgb(color2)).values : color2.values;
|
|
rgb = rgb.map((val) => {
|
|
if (color2.type !== "color") {
|
|
val /= 255;
|
|
}
|
|
return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;
|
|
});
|
|
return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));
|
|
}
|
|
function getContrastRatio(foreground, background) {
|
|
const lumA = getLuminance(foreground);
|
|
const lumB = getLuminance(background);
|
|
return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);
|
|
}
|
|
function alpha(color2, value) {
|
|
color2 = decomposeColor(color2);
|
|
value = clampWrapper(value);
|
|
if (color2.type === "rgb" || color2.type === "hsl") {
|
|
color2.type += "a";
|
|
}
|
|
if (color2.type === "color") {
|
|
color2.values[3] = `/${value}`;
|
|
} else {
|
|
color2.values[3] = value;
|
|
}
|
|
return recomposeColor(color2);
|
|
}
|
|
function private_safeAlpha(color2, value, warning) {
|
|
try {
|
|
return alpha(color2, value);
|
|
} catch (error) {
|
|
if (warning && true) {
|
|
console.warn(warning);
|
|
}
|
|
return color2;
|
|
}
|
|
}
|
|
function darken(color2, coefficient) {
|
|
color2 = decomposeColor(color2);
|
|
coefficient = clampWrapper(coefficient);
|
|
if (color2.type.includes("hsl")) {
|
|
color2.values[2] *= 1 - coefficient;
|
|
} else if (color2.type.includes("rgb") || color2.type.includes("color")) {
|
|
for (let i = 0; i < 3; i += 1) {
|
|
color2.values[i] *= 1 - coefficient;
|
|
}
|
|
}
|
|
return recomposeColor(color2);
|
|
}
|
|
function private_safeDarken(color2, coefficient, warning) {
|
|
try {
|
|
return darken(color2, coefficient);
|
|
} catch (error) {
|
|
if (warning && true) {
|
|
console.warn(warning);
|
|
}
|
|
return color2;
|
|
}
|
|
}
|
|
function lighten(color2, coefficient) {
|
|
color2 = decomposeColor(color2);
|
|
coefficient = clampWrapper(coefficient);
|
|
if (color2.type.includes("hsl")) {
|
|
color2.values[2] += (100 - color2.values[2]) * coefficient;
|
|
} else if (color2.type.includes("rgb")) {
|
|
for (let i = 0; i < 3; i += 1) {
|
|
color2.values[i] += (255 - color2.values[i]) * coefficient;
|
|
}
|
|
} else if (color2.type.includes("color")) {
|
|
for (let i = 0; i < 3; i += 1) {
|
|
color2.values[i] += (1 - color2.values[i]) * coefficient;
|
|
}
|
|
}
|
|
return recomposeColor(color2);
|
|
}
|
|
function private_safeLighten(color2, coefficient, warning) {
|
|
try {
|
|
return lighten(color2, coefficient);
|
|
} catch (error) {
|
|
if (warning && true) {
|
|
console.warn(warning);
|
|
}
|
|
return color2;
|
|
}
|
|
}
|
|
function emphasize(color2, coefficient = 0.15) {
|
|
return getLuminance(color2) > 0.5 ? darken(color2, coefficient) : lighten(color2, coefficient);
|
|
}
|
|
function private_safeEmphasize(color2, coefficient, warning) {
|
|
try {
|
|
return emphasize(color2, coefficient);
|
|
} catch (error) {
|
|
if (warning && true) {
|
|
console.warn(warning);
|
|
}
|
|
return color2;
|
|
}
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/RtlProvider/index.js
|
|
var React14 = __toESM(require_react(), 1);
|
|
var import_prop_types2 = __toESM(require_prop_types(), 1);
|
|
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
|
var RtlContext = /* @__PURE__ */ React14.createContext();
|
|
function RtlProvider(_a) {
|
|
var _b = _a, {
|
|
value
|
|
} = _b, props = __objRest(_b, [
|
|
"value"
|
|
]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RtlContext.Provider, __spreadValues({
|
|
value: value != null ? value : true
|
|
}, props));
|
|
}
|
|
true ? RtlProvider.propTypes = {
|
|
children: import_prop_types2.default.node,
|
|
value: import_prop_types2.default.bool
|
|
} : void 0;
|
|
var useRtl = () => {
|
|
const value = React14.useContext(RtlContext);
|
|
return value != null ? value : false;
|
|
};
|
|
|
|
// node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider.js
|
|
var React15 = __toESM(require_react(), 1);
|
|
var import_prop_types3 = __toESM(require_prop_types(), 1);
|
|
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
var PropsContext = /* @__PURE__ */ React15.createContext(void 0);
|
|
function DefaultPropsProvider({
|
|
value,
|
|
children
|
|
}) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PropsContext.Provider, {
|
|
value,
|
|
children
|
|
});
|
|
}
|
|
true ? DefaultPropsProvider.propTypes = {
|
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
/**
|
|
* @ignore
|
|
*/
|
|
children: import_prop_types3.default.node,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
value: import_prop_types3.default.object
|
|
} : void 0;
|
|
function getThemeProps2(params) {
|
|
const {
|
|
theme,
|
|
name,
|
|
props
|
|
} = params;
|
|
if (!theme || !theme.components || !theme.components[name]) {
|
|
return props;
|
|
}
|
|
const config = theme.components[name];
|
|
if (config.defaultProps) {
|
|
return resolveProps(config.defaultProps, props, theme.components.mergeClassNameAndStyle);
|
|
}
|
|
if (!config.styleOverrides && !config.variants) {
|
|
return resolveProps(config, props, theme.components.mergeClassNameAndStyle);
|
|
}
|
|
return props;
|
|
}
|
|
function useDefaultProps({
|
|
props,
|
|
name
|
|
}) {
|
|
const ctx = React15.useContext(PropsContext);
|
|
return getThemeProps2({
|
|
props,
|
|
name,
|
|
theme: {
|
|
components: ctx
|
|
}
|
|
});
|
|
}
|
|
var DefaultPropsProvider_default = DefaultPropsProvider;
|
|
|
|
// node_modules/@mui/utils/esm/useId/useId.js
|
|
var React16 = __toESM(require_react(), 1);
|
|
var globalId = 0;
|
|
function useGlobalId(idOverride) {
|
|
const [defaultId, setDefaultId] = React16.useState(idOverride);
|
|
const id = idOverride || defaultId;
|
|
React16.useEffect(() => {
|
|
if (defaultId == null) {
|
|
globalId += 1;
|
|
setDefaultId(`mui-${globalId}`);
|
|
}
|
|
}, [defaultId]);
|
|
return id;
|
|
}
|
|
var safeReact = __spreadValues({}, React16);
|
|
var maybeReactUseId = safeReact.useId;
|
|
function useId(idOverride) {
|
|
if (maybeReactUseId !== void 0) {
|
|
const reactId = maybeReactUseId();
|
|
return idOverride != null ? idOverride : reactId;
|
|
}
|
|
return useGlobalId(idOverride);
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/memoTheme.js
|
|
var arg = {
|
|
theme: void 0
|
|
};
|
|
function unstable_memoTheme(styleFn) {
|
|
let lastValue;
|
|
let lastTheme;
|
|
return function styleMemoized(props) {
|
|
let value = lastValue;
|
|
if (value === void 0 || props.theme !== lastTheme) {
|
|
arg.theme = props.theme;
|
|
value = preprocessStyles(styleFn(arg));
|
|
lastValue = value;
|
|
lastTheme = props.theme;
|
|
}
|
|
return value;
|
|
};
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/cssVars/createGetCssVar.js
|
|
function createGetCssVar(prefix2 = "") {
|
|
function appendVar(...vars) {
|
|
if (!vars.length) {
|
|
return "";
|
|
}
|
|
const value = vars[0];
|
|
if (typeof value === "string" && !value.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)) {
|
|
return `, var(--${prefix2 ? `${prefix2}-` : ""}${value}${appendVar(...vars.slice(1))})`;
|
|
}
|
|
return `, ${value}`;
|
|
}
|
|
const getCssVar = (field, ...fallbacks) => {
|
|
return `var(--${prefix2 ? `${prefix2}-` : ""}${field}${appendVar(...fallbacks)})`;
|
|
};
|
|
return getCssVar;
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/cssVars/cssVarsParser.js
|
|
var assignNestedKeys = (obj, keys, value, arrayKeys = []) => {
|
|
let temp = obj;
|
|
keys.forEach((k, index) => {
|
|
if (index === keys.length - 1) {
|
|
if (Array.isArray(temp)) {
|
|
temp[Number(k)] = value;
|
|
} else if (temp && typeof temp === "object") {
|
|
temp[k] = value;
|
|
}
|
|
} else if (temp && typeof temp === "object") {
|
|
if (!temp[k]) {
|
|
temp[k] = arrayKeys.includes(k) ? [] : {};
|
|
}
|
|
temp = temp[k];
|
|
}
|
|
});
|
|
};
|
|
var walkObjectDeep = (obj, callback, shouldSkipPaths) => {
|
|
function recurse(object, parentKeys = [], arrayKeys = []) {
|
|
Object.entries(object).forEach(([key, value]) => {
|
|
if (!shouldSkipPaths || shouldSkipPaths && !shouldSkipPaths([...parentKeys, key])) {
|
|
if (value !== void 0 && value !== null) {
|
|
if (typeof value === "object" && Object.keys(value).length > 0) {
|
|
recurse(value, [...parentKeys, key], Array.isArray(value) ? [...arrayKeys, key] : arrayKeys);
|
|
} else {
|
|
callback([...parentKeys, key], value, arrayKeys);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
recurse(obj);
|
|
};
|
|
var getCssValue = (keys, value) => {
|
|
if (typeof value === "number") {
|
|
if (["lineHeight", "fontWeight", "opacity", "zIndex"].some((prop) => keys.includes(prop))) {
|
|
return value;
|
|
}
|
|
const lastKey = keys[keys.length - 1];
|
|
if (lastKey.toLowerCase().includes("opacity")) {
|
|
return value;
|
|
}
|
|
return `${value}px`;
|
|
}
|
|
return value;
|
|
};
|
|
function cssVarsParser(theme, options) {
|
|
const {
|
|
prefix: prefix2,
|
|
shouldSkipGeneratingVar: shouldSkipGeneratingVar2
|
|
} = options || {};
|
|
const css2 = {};
|
|
const vars = {};
|
|
const varsWithDefaults = {};
|
|
walkObjectDeep(
|
|
theme,
|
|
(keys, value, arrayKeys) => {
|
|
if (typeof value === "string" || typeof value === "number") {
|
|
if (!shouldSkipGeneratingVar2 || !shouldSkipGeneratingVar2(keys, value)) {
|
|
const cssVar = `--${prefix2 ? `${prefix2}-` : ""}${keys.join("-")}`;
|
|
const resolvedValue = getCssValue(keys, value);
|
|
Object.assign(css2, {
|
|
[cssVar]: resolvedValue
|
|
});
|
|
assignNestedKeys(vars, keys, `var(${cssVar})`, arrayKeys);
|
|
assignNestedKeys(varsWithDefaults, keys, `var(${cssVar}, ${resolvedValue})`, arrayKeys);
|
|
}
|
|
}
|
|
},
|
|
(keys) => keys[0] === "vars"
|
|
// skip 'vars/*' paths
|
|
);
|
|
return {
|
|
css: css2,
|
|
vars,
|
|
varsWithDefaults
|
|
};
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/cssVars/prepareCssVars.js
|
|
function prepareCssVars(theme, parserConfig = {}) {
|
|
const {
|
|
getSelector = defaultGetSelector,
|
|
disableCssColorScheme,
|
|
colorSchemeSelector: selector,
|
|
enableContrastVars
|
|
} = parserConfig;
|
|
const _a = theme, {
|
|
colorSchemes = {},
|
|
components,
|
|
defaultColorScheme = "light"
|
|
} = _a, otherTheme = __objRest(_a, [
|
|
"colorSchemes",
|
|
"components",
|
|
"defaultColorScheme"
|
|
]);
|
|
const {
|
|
vars: rootVars,
|
|
css: rootCss,
|
|
varsWithDefaults: rootVarsWithDefaults
|
|
} = cssVarsParser(otherTheme, parserConfig);
|
|
let themeVars = rootVarsWithDefaults;
|
|
const colorSchemesMap = {};
|
|
const _b = colorSchemes, {
|
|
[defaultColorScheme]: defaultScheme
|
|
} = _b, otherColorSchemes = __objRest(_b, [
|
|
__restKey(defaultColorScheme)
|
|
]);
|
|
Object.entries(otherColorSchemes || {}).forEach(([key, scheme]) => {
|
|
const {
|
|
vars,
|
|
css: css2,
|
|
varsWithDefaults
|
|
} = cssVarsParser(scheme, parserConfig);
|
|
themeVars = deepmerge(themeVars, varsWithDefaults);
|
|
colorSchemesMap[key] = {
|
|
css: css2,
|
|
vars
|
|
};
|
|
});
|
|
if (defaultScheme) {
|
|
const {
|
|
css: css2,
|
|
vars,
|
|
varsWithDefaults
|
|
} = cssVarsParser(defaultScheme, parserConfig);
|
|
themeVars = deepmerge(themeVars, varsWithDefaults);
|
|
colorSchemesMap[defaultColorScheme] = {
|
|
css: css2,
|
|
vars
|
|
};
|
|
}
|
|
function defaultGetSelector(colorScheme, cssObject) {
|
|
var _a2, _b2;
|
|
let rule = selector;
|
|
if (selector === "class") {
|
|
rule = ".%s";
|
|
}
|
|
if (selector === "data") {
|
|
rule = "[data-%s]";
|
|
}
|
|
if ((selector == null ? void 0 : selector.startsWith("data-")) && !selector.includes("%s")) {
|
|
rule = `[${selector}="%s"]`;
|
|
}
|
|
if (colorScheme) {
|
|
if (rule === "media") {
|
|
if (theme.defaultColorScheme === colorScheme) {
|
|
return ":root";
|
|
}
|
|
const mode = ((_b2 = (_a2 = colorSchemes[colorScheme]) == null ? void 0 : _a2.palette) == null ? void 0 : _b2.mode) || colorScheme;
|
|
return {
|
|
[`@media (prefers-color-scheme: ${mode})`]: {
|
|
":root": cssObject
|
|
}
|
|
};
|
|
}
|
|
if (rule) {
|
|
if (theme.defaultColorScheme === colorScheme) {
|
|
return `:root, ${rule.replace("%s", String(colorScheme))}`;
|
|
}
|
|
return rule.replace("%s", String(colorScheme));
|
|
}
|
|
}
|
|
return ":root";
|
|
}
|
|
const generateThemeVars = () => {
|
|
let vars = __spreadValues({}, rootVars);
|
|
Object.entries(colorSchemesMap).forEach(([, {
|
|
vars: schemeVars
|
|
}]) => {
|
|
vars = deepmerge(vars, schemeVars);
|
|
});
|
|
return vars;
|
|
};
|
|
const generateStyleSheets = () => {
|
|
var _b2, _c;
|
|
const stylesheets = [];
|
|
const colorScheme = theme.defaultColorScheme || "light";
|
|
function insertStyleSheet(key, css2) {
|
|
if (Object.keys(css2).length) {
|
|
stylesheets.push(typeof key === "string" ? {
|
|
[key]: __spreadValues({}, css2)
|
|
} : key);
|
|
}
|
|
}
|
|
insertStyleSheet(getSelector(void 0, __spreadValues({}, rootCss)), rootCss);
|
|
const _a2 = colorSchemesMap, {
|
|
[colorScheme]: defaultSchemeVal
|
|
} = _a2, other = __objRest(_a2, [
|
|
__restKey(colorScheme)
|
|
]);
|
|
if (defaultSchemeVal) {
|
|
const {
|
|
css: css2
|
|
} = defaultSchemeVal;
|
|
const cssColorSheme = (_c = (_b2 = colorSchemes[colorScheme]) == null ? void 0 : _b2.palette) == null ? void 0 : _c.mode;
|
|
const finalCss = !disableCssColorScheme && cssColorSheme ? __spreadValues({
|
|
colorScheme: cssColorSheme
|
|
}, css2) : __spreadValues({}, css2);
|
|
insertStyleSheet(getSelector(colorScheme, __spreadValues({}, finalCss)), finalCss);
|
|
}
|
|
Object.entries(other).forEach(([key, {
|
|
css: css2
|
|
}]) => {
|
|
var _a3, _b3;
|
|
const cssColorSheme = (_b3 = (_a3 = colorSchemes[key]) == null ? void 0 : _a3.palette) == null ? void 0 : _b3.mode;
|
|
const finalCss = !disableCssColorScheme && cssColorSheme ? __spreadValues({
|
|
colorScheme: cssColorSheme
|
|
}, css2) : __spreadValues({}, css2);
|
|
insertStyleSheet(getSelector(key, __spreadValues({}, finalCss)), finalCss);
|
|
});
|
|
if (enableContrastVars) {
|
|
stylesheets.push({
|
|
":root": {
|
|
// use double underscore to indicate that these are private variables
|
|
"--__l-threshold": "0.7",
|
|
"--__l": "clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)",
|
|
"--__a": "clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"
|
|
// 0.87 is the default alpha value for black text.
|
|
}
|
|
});
|
|
}
|
|
return stylesheets;
|
|
};
|
|
return {
|
|
vars: themeVars,
|
|
generateThemeVars,
|
|
generateStyleSheets
|
|
};
|
|
}
|
|
var prepareCssVars_default = prepareCssVars;
|
|
|
|
// node_modules/@mui/system/esm/cssVars/getColorSchemeSelector.js
|
|
function createGetColorSchemeSelector(selector) {
|
|
return function getColorSchemeSelector(colorScheme) {
|
|
if (selector === "media") {
|
|
if (true) {
|
|
if (colorScheme !== "light" && colorScheme !== "dark") {
|
|
console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${colorScheme}'.`);
|
|
}
|
|
}
|
|
return `@media (prefers-color-scheme: ${colorScheme})`;
|
|
}
|
|
if (selector) {
|
|
if (selector.startsWith("data-") && !selector.includes("%s")) {
|
|
return `[${selector}="${colorScheme}"] &`;
|
|
}
|
|
if (selector === "class") {
|
|
return `.${colorScheme} &`;
|
|
}
|
|
if (selector === "data") {
|
|
return `[data-${colorScheme}] &`;
|
|
}
|
|
return `${selector.replace("%s", colorScheme)} &`;
|
|
}
|
|
return "&";
|
|
};
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/colors/common.js
|
|
var common = {
|
|
black: "#000",
|
|
white: "#fff"
|
|
};
|
|
var common_default = common;
|
|
|
|
// node_modules/@mui/material/esm/colors/grey.js
|
|
var grey = {
|
|
50: "#fafafa",
|
|
100: "#f5f5f5",
|
|
200: "#eeeeee",
|
|
300: "#e0e0e0",
|
|
400: "#bdbdbd",
|
|
500: "#9e9e9e",
|
|
600: "#757575",
|
|
700: "#616161",
|
|
800: "#424242",
|
|
900: "#212121",
|
|
A100: "#f5f5f5",
|
|
A200: "#eeeeee",
|
|
A400: "#bdbdbd",
|
|
A700: "#616161"
|
|
};
|
|
var grey_default = grey;
|
|
|
|
// node_modules/@mui/material/esm/colors/purple.js
|
|
var purple = {
|
|
50: "#f3e5f5",
|
|
100: "#e1bee7",
|
|
200: "#ce93d8",
|
|
300: "#ba68c8",
|
|
400: "#ab47bc",
|
|
500: "#9c27b0",
|
|
600: "#8e24aa",
|
|
700: "#7b1fa2",
|
|
800: "#6a1b9a",
|
|
900: "#4a148c",
|
|
A100: "#ea80fc",
|
|
A200: "#e040fb",
|
|
A400: "#d500f9",
|
|
A700: "#aa00ff"
|
|
};
|
|
var purple_default = purple;
|
|
|
|
// node_modules/@mui/material/esm/colors/red.js
|
|
var red = {
|
|
50: "#ffebee",
|
|
100: "#ffcdd2",
|
|
200: "#ef9a9a",
|
|
300: "#e57373",
|
|
400: "#ef5350",
|
|
500: "#f44336",
|
|
600: "#e53935",
|
|
700: "#d32f2f",
|
|
800: "#c62828",
|
|
900: "#b71c1c",
|
|
A100: "#ff8a80",
|
|
A200: "#ff5252",
|
|
A400: "#ff1744",
|
|
A700: "#d50000"
|
|
};
|
|
var red_default = red;
|
|
|
|
// node_modules/@mui/material/esm/colors/orange.js
|
|
var orange = {
|
|
50: "#fff3e0",
|
|
100: "#ffe0b2",
|
|
200: "#ffcc80",
|
|
300: "#ffb74d",
|
|
400: "#ffa726",
|
|
500: "#ff9800",
|
|
600: "#fb8c00",
|
|
700: "#f57c00",
|
|
800: "#ef6c00",
|
|
900: "#e65100",
|
|
A100: "#ffd180",
|
|
A200: "#ffab40",
|
|
A400: "#ff9100",
|
|
A700: "#ff6d00"
|
|
};
|
|
var orange_default = orange;
|
|
|
|
// node_modules/@mui/material/esm/colors/blue.js
|
|
var blue = {
|
|
50: "#e3f2fd",
|
|
100: "#bbdefb",
|
|
200: "#90caf9",
|
|
300: "#64b5f6",
|
|
400: "#42a5f5",
|
|
500: "#2196f3",
|
|
600: "#1e88e5",
|
|
700: "#1976d2",
|
|
800: "#1565c0",
|
|
900: "#0d47a1",
|
|
A100: "#82b1ff",
|
|
A200: "#448aff",
|
|
A400: "#2979ff",
|
|
A700: "#2962ff"
|
|
};
|
|
var blue_default = blue;
|
|
|
|
// node_modules/@mui/material/esm/colors/lightBlue.js
|
|
var lightBlue = {
|
|
50: "#e1f5fe",
|
|
100: "#b3e5fc",
|
|
200: "#81d4fa",
|
|
300: "#4fc3f7",
|
|
400: "#29b6f6",
|
|
500: "#03a9f4",
|
|
600: "#039be5",
|
|
700: "#0288d1",
|
|
800: "#0277bd",
|
|
900: "#01579b",
|
|
A100: "#80d8ff",
|
|
A200: "#40c4ff",
|
|
A400: "#00b0ff",
|
|
A700: "#0091ea"
|
|
};
|
|
var lightBlue_default = lightBlue;
|
|
|
|
// node_modules/@mui/material/esm/colors/green.js
|
|
var green = {
|
|
50: "#e8f5e9",
|
|
100: "#c8e6c9",
|
|
200: "#a5d6a7",
|
|
300: "#81c784",
|
|
400: "#66bb6a",
|
|
500: "#4caf50",
|
|
600: "#43a047",
|
|
700: "#388e3c",
|
|
800: "#2e7d32",
|
|
900: "#1b5e20",
|
|
A100: "#b9f6ca",
|
|
A200: "#69f0ae",
|
|
A400: "#00e676",
|
|
A700: "#00c853"
|
|
};
|
|
var green_default = green;
|
|
|
|
// node_modules/@mui/material/esm/styles/createPalette.js
|
|
function getLight() {
|
|
return {
|
|
// The colors used to style the text.
|
|
text: {
|
|
// The most important text.
|
|
primary: "rgba(0, 0, 0, 0.87)",
|
|
// Secondary text.
|
|
secondary: "rgba(0, 0, 0, 0.6)",
|
|
// Disabled text have even lower visual prominence.
|
|
disabled: "rgba(0, 0, 0, 0.38)"
|
|
},
|
|
// The color used to divide different elements.
|
|
divider: "rgba(0, 0, 0, 0.12)",
|
|
// The background colors used to style the surfaces.
|
|
// Consistency between these values is important.
|
|
background: {
|
|
paper: common_default.white,
|
|
default: common_default.white
|
|
},
|
|
// The colors used to style the action elements.
|
|
action: {
|
|
// The color of an active action like an icon button.
|
|
active: "rgba(0, 0, 0, 0.54)",
|
|
// The color of an hovered action.
|
|
hover: "rgba(0, 0, 0, 0.04)",
|
|
hoverOpacity: 0.04,
|
|
// The color of a selected action.
|
|
selected: "rgba(0, 0, 0, 0.08)",
|
|
selectedOpacity: 0.08,
|
|
// The color of a disabled action.
|
|
disabled: "rgba(0, 0, 0, 0.26)",
|
|
// The background color of a disabled action.
|
|
disabledBackground: "rgba(0, 0, 0, 0.12)",
|
|
disabledOpacity: 0.38,
|
|
focus: "rgba(0, 0, 0, 0.12)",
|
|
focusOpacity: 0.12,
|
|
activatedOpacity: 0.12
|
|
}
|
|
};
|
|
}
|
|
var light = getLight();
|
|
function getDark() {
|
|
return {
|
|
text: {
|
|
primary: common_default.white,
|
|
secondary: "rgba(255, 255, 255, 0.7)",
|
|
disabled: "rgba(255, 255, 255, 0.5)",
|
|
icon: "rgba(255, 255, 255, 0.5)"
|
|
},
|
|
divider: "rgba(255, 255, 255, 0.12)",
|
|
background: {
|
|
paper: "#121212",
|
|
default: "#121212"
|
|
},
|
|
action: {
|
|
active: common_default.white,
|
|
hover: "rgba(255, 255, 255, 0.08)",
|
|
hoverOpacity: 0.08,
|
|
selected: "rgba(255, 255, 255, 0.16)",
|
|
selectedOpacity: 0.16,
|
|
disabled: "rgba(255, 255, 255, 0.3)",
|
|
disabledBackground: "rgba(255, 255, 255, 0.12)",
|
|
disabledOpacity: 0.38,
|
|
focus: "rgba(255, 255, 255, 0.12)",
|
|
focusOpacity: 0.12,
|
|
activatedOpacity: 0.24
|
|
}
|
|
};
|
|
}
|
|
var dark = getDark();
|
|
function addLightOrDark(intent, direction, shade, tonalOffset) {
|
|
const tonalOffsetLight = tonalOffset.light || tonalOffset;
|
|
const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
|
|
if (!intent[direction]) {
|
|
if (intent.hasOwnProperty(shade)) {
|
|
intent[direction] = intent[shade];
|
|
} else if (direction === "light") {
|
|
intent.light = lighten(intent.main, tonalOffsetLight);
|
|
} else if (direction === "dark") {
|
|
intent.dark = darken(intent.main, tonalOffsetDark);
|
|
}
|
|
}
|
|
}
|
|
function mixLightOrDark(colorSpace, intent, direction, shade, tonalOffset) {
|
|
const tonalOffsetLight = tonalOffset.light || tonalOffset;
|
|
const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
|
|
if (!intent[direction]) {
|
|
if (intent.hasOwnProperty(shade)) {
|
|
intent[direction] = intent[shade];
|
|
} else if (direction === "light") {
|
|
intent.light = `color-mix(in ${colorSpace}, ${intent.main}, #fff ${(tonalOffsetLight * 100).toFixed(0)}%)`;
|
|
} else if (direction === "dark") {
|
|
intent.dark = `color-mix(in ${colorSpace}, ${intent.main}, #000 ${(tonalOffsetDark * 100).toFixed(0)}%)`;
|
|
}
|
|
}
|
|
}
|
|
function getDefaultPrimary(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: blue_default[200],
|
|
light: blue_default[50],
|
|
dark: blue_default[400]
|
|
};
|
|
}
|
|
return {
|
|
main: blue_default[700],
|
|
light: blue_default[400],
|
|
dark: blue_default[800]
|
|
};
|
|
}
|
|
function getDefaultSecondary(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: purple_default[200],
|
|
light: purple_default[50],
|
|
dark: purple_default[400]
|
|
};
|
|
}
|
|
return {
|
|
main: purple_default[500],
|
|
light: purple_default[300],
|
|
dark: purple_default[700]
|
|
};
|
|
}
|
|
function getDefaultError(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: red_default[500],
|
|
light: red_default[300],
|
|
dark: red_default[700]
|
|
};
|
|
}
|
|
return {
|
|
main: red_default[700],
|
|
light: red_default[400],
|
|
dark: red_default[800]
|
|
};
|
|
}
|
|
function getDefaultInfo(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: lightBlue_default[400],
|
|
light: lightBlue_default[300],
|
|
dark: lightBlue_default[700]
|
|
};
|
|
}
|
|
return {
|
|
main: lightBlue_default[700],
|
|
light: lightBlue_default[500],
|
|
dark: lightBlue_default[900]
|
|
};
|
|
}
|
|
function getDefaultSuccess(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: green_default[400],
|
|
light: green_default[300],
|
|
dark: green_default[700]
|
|
};
|
|
}
|
|
return {
|
|
main: green_default[800],
|
|
light: green_default[500],
|
|
dark: green_default[900]
|
|
};
|
|
}
|
|
function getDefaultWarning(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: orange_default[400],
|
|
light: orange_default[300],
|
|
dark: orange_default[700]
|
|
};
|
|
}
|
|
return {
|
|
main: "#ed6c02",
|
|
// closest to orange[800] that pass 3:1.
|
|
light: orange_default[500],
|
|
dark: orange_default[900]
|
|
};
|
|
}
|
|
function contrastColor(background) {
|
|
return `oklch(from ${background} var(--__l) 0 h / var(--__a))`;
|
|
}
|
|
function createPalette(palette2) {
|
|
const _a = palette2, {
|
|
mode = "light",
|
|
contrastThreshold = 3,
|
|
tonalOffset = 0.2,
|
|
colorSpace
|
|
} = _a, other = __objRest(_a, [
|
|
"mode",
|
|
"contrastThreshold",
|
|
"tonalOffset",
|
|
"colorSpace"
|
|
]);
|
|
const primary = palette2.primary || getDefaultPrimary(mode);
|
|
const secondary = palette2.secondary || getDefaultSecondary(mode);
|
|
const error = palette2.error || getDefaultError(mode);
|
|
const info = palette2.info || getDefaultInfo(mode);
|
|
const success = palette2.success || getDefaultSuccess(mode);
|
|
const warning = palette2.warning || getDefaultWarning(mode);
|
|
function getContrastText(background) {
|
|
if (colorSpace) {
|
|
return contrastColor(background);
|
|
}
|
|
const contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;
|
|
if (true) {
|
|
const contrast = getContrastRatio(background, contrastText);
|
|
if (contrast < 3) {
|
|
console.error([`MUI: The contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, "falls below the WCAG recommended absolute minimum contrast ratio of 3:1.", "https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join("\n"));
|
|
}
|
|
}
|
|
return contrastText;
|
|
}
|
|
const augmentColor = ({
|
|
color: color2,
|
|
name,
|
|
mainShade = 500,
|
|
lightShade = 300,
|
|
darkShade = 700
|
|
}) => {
|
|
color2 = __spreadValues({}, color2);
|
|
if (!color2.main && color2[mainShade]) {
|
|
color2.main = color2[mainShade];
|
|
}
|
|
if (!color2.hasOwnProperty("main")) {
|
|
throw new Error(true ? `MUI: The color${name ? ` (${name})` : ""} provided to augmentColor(color) is invalid.
|
|
The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : formatMuiErrorMessage(11, name ? ` (${name})` : "", mainShade));
|
|
}
|
|
if (typeof color2.main !== "string") {
|
|
throw new Error(true ? `MUI: The color${name ? ` (${name})` : ""} provided to augmentColor(color) is invalid.
|
|
\`color.main\` should be a string, but \`${JSON.stringify(color2.main)}\` was provided instead.
|
|
|
|
Did you intend to use one of the following approaches?
|
|
|
|
import { green } from "@mui/material/colors";
|
|
|
|
const theme1 = createTheme({ palette: {
|
|
primary: green,
|
|
} });
|
|
|
|
const theme2 = createTheme({ palette: {
|
|
primary: { main: green[500] },
|
|
} });` : formatMuiErrorMessage(12, name ? ` (${name})` : "", JSON.stringify(color2.main)));
|
|
}
|
|
if (colorSpace) {
|
|
mixLightOrDark(colorSpace, color2, "light", lightShade, tonalOffset);
|
|
mixLightOrDark(colorSpace, color2, "dark", darkShade, tonalOffset);
|
|
} else {
|
|
addLightOrDark(color2, "light", lightShade, tonalOffset);
|
|
addLightOrDark(color2, "dark", darkShade, tonalOffset);
|
|
}
|
|
if (!color2.contrastText) {
|
|
color2.contrastText = getContrastText(color2.main);
|
|
}
|
|
return color2;
|
|
};
|
|
let modeHydrated;
|
|
if (mode === "light") {
|
|
modeHydrated = getLight();
|
|
} else if (mode === "dark") {
|
|
modeHydrated = getDark();
|
|
}
|
|
if (true) {
|
|
if (!modeHydrated) {
|
|
console.error(`MUI: The palette mode \`${mode}\` is not supported.`);
|
|
}
|
|
}
|
|
const paletteOutput = deepmerge(__spreadValues({
|
|
// A collection of common colors.
|
|
common: __spreadValues({}, common_default),
|
|
// prevent mutable object.
|
|
// The palette mode, can be light or dark.
|
|
mode,
|
|
// The colors used to represent primary interface elements for a user.
|
|
primary: augmentColor({
|
|
color: primary,
|
|
name: "primary"
|
|
}),
|
|
// The colors used to represent secondary interface elements for a user.
|
|
secondary: augmentColor({
|
|
color: secondary,
|
|
name: "secondary",
|
|
mainShade: "A400",
|
|
lightShade: "A200",
|
|
darkShade: "A700"
|
|
}),
|
|
// The colors used to represent interface elements that the user should be made aware of.
|
|
error: augmentColor({
|
|
color: error,
|
|
name: "error"
|
|
}),
|
|
// The colors used to represent potentially dangerous actions or important messages.
|
|
warning: augmentColor({
|
|
color: warning,
|
|
name: "warning"
|
|
}),
|
|
// The colors used to present information to the user that is neutral and not necessarily important.
|
|
info: augmentColor({
|
|
color: info,
|
|
name: "info"
|
|
}),
|
|
// The colors used to indicate the successful completion of an action that user triggered.
|
|
success: augmentColor({
|
|
color: success,
|
|
name: "success"
|
|
}),
|
|
// The grey colors.
|
|
grey: grey_default,
|
|
// Used by `getContrastText()` to maximize the contrast between
|
|
// the background and the text.
|
|
contrastThreshold,
|
|
// Takes a background color and returns the text color that maximizes the contrast.
|
|
getContrastText,
|
|
// Generate a rich color object.
|
|
augmentColor,
|
|
// Used by the functions below to shift a color's luminance by approximately
|
|
// two indexes within its tonal palette.
|
|
// E.g., shift from Red 500 to Red 300 or Red 700.
|
|
tonalOffset
|
|
}, modeHydrated), other);
|
|
return paletteOutput;
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/cssVars/prepareTypographyVars.js
|
|
function prepareTypographyVars(typography) {
|
|
const vars = {};
|
|
const entries = Object.entries(typography);
|
|
entries.forEach((entry) => {
|
|
const [key, value] = entry;
|
|
if (typeof value === "object") {
|
|
vars[key] = `${value.fontStyle ? `${value.fontStyle} ` : ""}${value.fontVariant ? `${value.fontVariant} ` : ""}${value.fontWeight ? `${value.fontWeight} ` : ""}${value.fontStretch ? `${value.fontStretch} ` : ""}${value.fontSize || ""}${value.lineHeight ? `/${value.lineHeight} ` : ""}${value.fontFamily || ""}`;
|
|
}
|
|
});
|
|
return vars;
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/createMixins.js
|
|
function createMixins(breakpoints, mixins) {
|
|
return __spreadValues({
|
|
toolbar: {
|
|
minHeight: 56,
|
|
[breakpoints.up("xs")]: {
|
|
"@media (orientation: landscape)": {
|
|
minHeight: 48
|
|
}
|
|
},
|
|
[breakpoints.up("sm")]: {
|
|
minHeight: 64
|
|
}
|
|
}
|
|
}, mixins);
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/createTypography.js
|
|
function round(value) {
|
|
return Math.round(value * 1e5) / 1e5;
|
|
}
|
|
var caseAllCaps = {
|
|
textTransform: "uppercase"
|
|
};
|
|
var defaultFontFamily = '"Roboto", "Helvetica", "Arial", sans-serif';
|
|
function createTypography(palette2, typography) {
|
|
const _a = typeof typography === "function" ? typography(palette2) : typography, {
|
|
fontFamily = defaultFontFamily,
|
|
fontSize: fontSize = 14,
|
|
fontWeightLight: fontWeightLight = 300,
|
|
fontWeightRegular = 400,
|
|
fontWeightMedium = 500,
|
|
fontWeightBold = 700,
|
|
htmlFontSize: htmlFontSize = 16,
|
|
allVariants: allVariants,
|
|
pxToRem: pxToRem2
|
|
} = _a, other = __objRest(_a, [
|
|
"fontFamily",
|
|
// The default font size of the Material Specification.
|
|
"fontSize",
|
|
// px
|
|
"fontWeightLight",
|
|
"fontWeightRegular",
|
|
"fontWeightMedium",
|
|
"fontWeightBold",
|
|
// Tell MUI what's the font-size on the html element.
|
|
// 16px is the default font-size used by browsers.
|
|
"htmlFontSize",
|
|
// Apply the CSS properties to all the variants.
|
|
"allVariants",
|
|
"pxToRem"
|
|
]);
|
|
if (true) {
|
|
if (typeof fontSize !== "number") {
|
|
console.error("MUI: `fontSize` is required to be a number.");
|
|
}
|
|
if (typeof htmlFontSize !== "number") {
|
|
console.error("MUI: `htmlFontSize` is required to be a number.");
|
|
}
|
|
}
|
|
const coef = fontSize / 14;
|
|
const pxToRem = pxToRem2 || ((size) => `${size / htmlFontSize * coef}rem`);
|
|
const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => __spreadValues(__spreadValues(__spreadValues({
|
|
fontFamily,
|
|
fontWeight,
|
|
fontSize: pxToRem(size),
|
|
// Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
|
|
lineHeight
|
|
}, fontFamily === defaultFontFamily ? {
|
|
letterSpacing: `${round(letterSpacing / size)}em`
|
|
} : {}), casing), allVariants);
|
|
const variants = {
|
|
h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),
|
|
h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),
|
|
h3: buildVariant(fontWeightRegular, 48, 1.167, 0),
|
|
h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),
|
|
h5: buildVariant(fontWeightRegular, 24, 1.334, 0),
|
|
h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),
|
|
subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),
|
|
subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),
|
|
body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),
|
|
body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),
|
|
button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),
|
|
caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),
|
|
overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps),
|
|
// TODO v6: Remove handling of 'inherit' variant from the theme as it is already handled in Material UI's Typography component. Also, remember to remove the associated types.
|
|
inherit: {
|
|
fontFamily: "inherit",
|
|
fontWeight: "inherit",
|
|
fontSize: "inherit",
|
|
lineHeight: "inherit",
|
|
letterSpacing: "inherit"
|
|
}
|
|
};
|
|
return deepmerge(__spreadValues({
|
|
htmlFontSize,
|
|
pxToRem,
|
|
fontFamily,
|
|
fontSize,
|
|
fontWeightLight,
|
|
fontWeightRegular,
|
|
fontWeightMedium,
|
|
fontWeightBold
|
|
}, variants), other, {
|
|
clone: false
|
|
// No need to clone deep
|
|
});
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/shadows.js
|
|
var shadowKeyUmbraOpacity = 0.2;
|
|
var shadowKeyPenumbraOpacity = 0.14;
|
|
var shadowAmbientShadowOpacity = 0.12;
|
|
function createShadow(...px) {
|
|
return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(",");
|
|
}
|
|
var shadows = ["none", createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
|
|
var shadows_default = shadows;
|
|
|
|
// node_modules/@mui/material/esm/styles/createTransitions.js
|
|
var easing = {
|
|
// This is the most common easing curve.
|
|
easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
// Objects enter the screen at full velocity from off-screen and
|
|
// slowly decelerate to a resting point.
|
|
easeOut: "cubic-bezier(0.0, 0, 0.2, 1)",
|
|
// Objects leave the screen at full velocity. They do not decelerate when off-screen.
|
|
easeIn: "cubic-bezier(0.4, 0, 1, 1)",
|
|
// The sharp curve is used by objects that may return to the screen at any time.
|
|
sharp: "cubic-bezier(0.4, 0, 0.6, 1)"
|
|
};
|
|
var duration = {
|
|
shortest: 150,
|
|
shorter: 200,
|
|
short: 250,
|
|
// most basic recommended timing
|
|
standard: 300,
|
|
// this is to be used in complex animations
|
|
complex: 375,
|
|
// recommended when something is entering screen
|
|
enteringScreen: 225,
|
|
// recommended when something is leaving screen
|
|
leavingScreen: 195
|
|
};
|
|
function formatMs(milliseconds) {
|
|
return `${Math.round(milliseconds)}ms`;
|
|
}
|
|
function getAutoHeightDuration(height2) {
|
|
if (!height2) {
|
|
return 0;
|
|
}
|
|
const constant = height2 / 36;
|
|
return Math.min(Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10), 3e3);
|
|
}
|
|
function createTransitions(inputTransitions) {
|
|
const mergedEasing = __spreadValues(__spreadValues({}, easing), inputTransitions.easing);
|
|
const mergedDuration = __spreadValues(__spreadValues({}, duration), inputTransitions.duration);
|
|
const create = (props = ["all"], options = {}) => {
|
|
const _a = options, {
|
|
duration: durationOption = mergedDuration.standard,
|
|
easing: easingOption = mergedEasing.easeInOut,
|
|
delay = 0
|
|
} = _a, other = __objRest(_a, [
|
|
"duration",
|
|
"easing",
|
|
"delay"
|
|
]);
|
|
if (true) {
|
|
const isString = (value) => typeof value === "string";
|
|
const isNumber = (value) => !Number.isNaN(parseFloat(value));
|
|
if (!isString(props) && !Array.isArray(props)) {
|
|
console.error('MUI: Argument "props" must be a string or Array.');
|
|
}
|
|
if (!isNumber(durationOption) && !isString(durationOption)) {
|
|
console.error(`MUI: Argument "duration" must be a number or a string but found ${durationOption}.`);
|
|
}
|
|
if (!isString(easingOption)) {
|
|
console.error('MUI: Argument "easing" must be a string.');
|
|
}
|
|
if (!isNumber(delay) && !isString(delay)) {
|
|
console.error('MUI: Argument "delay" must be a number or a string.');
|
|
}
|
|
if (typeof options !== "object") {
|
|
console.error(["MUI: Secong argument of transition.create must be an object.", "Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join("\n"));
|
|
}
|
|
if (Object.keys(other).length !== 0) {
|
|
console.error(`MUI: Unrecognized argument(s) [${Object.keys(other).join(",")}].`);
|
|
}
|
|
}
|
|
return (Array.isArray(props) ? props : [props]).map((animatedProp) => `${animatedProp} ${typeof durationOption === "string" ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === "string" ? delay : formatMs(delay)}`).join(",");
|
|
};
|
|
return __spreadProps(__spreadValues({
|
|
getAutoHeightDuration,
|
|
create
|
|
}, inputTransitions), {
|
|
easing: mergedEasing,
|
|
duration: mergedDuration
|
|
});
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/zIndex.js
|
|
var zIndex = {
|
|
mobileStepper: 1e3,
|
|
fab: 1050,
|
|
speedDial: 1050,
|
|
appBar: 1100,
|
|
drawer: 1200,
|
|
modal: 1300,
|
|
snackbar: 1400,
|
|
tooltip: 1500
|
|
};
|
|
var zIndex_default = zIndex;
|
|
|
|
// node_modules/@mui/material/esm/styles/stringifyTheme.js
|
|
function isSerializable(val) {
|
|
return isPlainObject(val) || typeof val === "undefined" || typeof val === "string" || typeof val === "boolean" || typeof val === "number" || Array.isArray(val);
|
|
}
|
|
function stringifyTheme(baseTheme = {}) {
|
|
const serializableTheme = __spreadValues({}, baseTheme);
|
|
function serializeTheme(object) {
|
|
const array = Object.entries(object);
|
|
for (let index = 0; index < array.length; index++) {
|
|
const [key, value] = array[index];
|
|
if (!isSerializable(value) || key.startsWith("unstable_")) {
|
|
delete object[key];
|
|
} else if (isPlainObject(value)) {
|
|
object[key] = __spreadValues({}, value);
|
|
serializeTheme(object[key]);
|
|
}
|
|
}
|
|
}
|
|
serializeTheme(serializableTheme);
|
|
return `import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
|
|
const theme = ${JSON.stringify(serializableTheme, null, 2)};
|
|
|
|
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
theme.transitions = createTransitions(theme.transitions || {});
|
|
|
|
export default theme;`;
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/createThemeNoVars.js
|
|
function coefficientToPercentage(coefficient) {
|
|
if (typeof coefficient === "number") {
|
|
return `${(coefficient * 100).toFixed(0)}%`;
|
|
}
|
|
return `calc((${coefficient}) * 100%)`;
|
|
}
|
|
var parseAddition = (str) => {
|
|
if (!Number.isNaN(+str)) {
|
|
return +str;
|
|
}
|
|
const numbers = str.match(/\d*\.?\d+/g);
|
|
if (!numbers) {
|
|
return 0;
|
|
}
|
|
let sum = 0;
|
|
for (let i = 0; i < numbers.length; i += 1) {
|
|
sum += +numbers[i];
|
|
}
|
|
return sum;
|
|
};
|
|
function attachColorManipulators(theme) {
|
|
Object.assign(theme, {
|
|
alpha(color2, coefficient) {
|
|
const obj = this || theme;
|
|
if (obj.colorSpace) {
|
|
return `oklch(from ${color2} l c h / ${typeof coefficient === "string" ? `calc(${coefficient})` : coefficient})`;
|
|
}
|
|
if (obj.vars) {
|
|
return `rgba(${color2.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g, "var(--$1Channel)")} / ${typeof coefficient === "string" ? `calc(${coefficient})` : coefficient})`;
|
|
}
|
|
return alpha(color2, parseAddition(coefficient));
|
|
},
|
|
lighten(color2, coefficient) {
|
|
const obj = this || theme;
|
|
if (obj.colorSpace) {
|
|
return `color-mix(in ${obj.colorSpace}, ${color2}, #fff ${coefficientToPercentage(coefficient)})`;
|
|
}
|
|
return lighten(color2, coefficient);
|
|
},
|
|
darken(color2, coefficient) {
|
|
const obj = this || theme;
|
|
if (obj.colorSpace) {
|
|
return `color-mix(in ${obj.colorSpace}, ${color2}, #000 ${coefficientToPercentage(coefficient)})`;
|
|
}
|
|
return darken(color2, coefficient);
|
|
}
|
|
});
|
|
}
|
|
function createThemeNoVars(options = {}, ...args) {
|
|
const _a = options, {
|
|
breakpoints: breakpointsInput,
|
|
mixins: mixinsInput = {},
|
|
spacing: spacingInput,
|
|
palette: paletteInput = {},
|
|
transitions: transitionsInput = {},
|
|
typography: typographyInput = {},
|
|
shape: shapeInput,
|
|
colorSpace
|
|
} = _a, other = __objRest(_a, [
|
|
"breakpoints",
|
|
"mixins",
|
|
"spacing",
|
|
"palette",
|
|
"transitions",
|
|
"typography",
|
|
"shape",
|
|
"colorSpace"
|
|
]);
|
|
if (options.vars && // The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
|
|
// `generateThemeVars` is the closest identifier for checking that the `options` is a result of `createTheme` with CSS variables so that user can create new theme for nested ThemeProvider.
|
|
options.generateThemeVars === void 0) {
|
|
throw new Error(true ? "MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://v7.mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature." : formatMuiErrorMessage(20));
|
|
}
|
|
const palette2 = createPalette(__spreadProps(__spreadValues({}, paletteInput), {
|
|
colorSpace
|
|
}));
|
|
const systemTheme = createTheme_default(options);
|
|
let muiTheme = deepmerge(systemTheme, {
|
|
mixins: createMixins(systemTheme.breakpoints, mixinsInput),
|
|
palette: palette2,
|
|
// Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
|
|
shadows: shadows_default.slice(),
|
|
typography: createTypography(palette2, typographyInput),
|
|
transitions: createTransitions(transitionsInput),
|
|
zIndex: __spreadValues({}, zIndex_default)
|
|
});
|
|
muiTheme = deepmerge(muiTheme, other);
|
|
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
if (true) {
|
|
const stateClasses = ["active", "checked", "completed", "disabled", "error", "expanded", "focused", "focusVisible", "required", "selected"];
|
|
const traverse = (node2, component) => {
|
|
let key;
|
|
for (key in node2) {
|
|
const child = node2[key];
|
|
if (stateClasses.includes(key) && Object.keys(child).length > 0) {
|
|
if (true) {
|
|
const stateClass = generateUtilityClass("", key);
|
|
console.error([`MUI: The \`${component}\` component increases the CSS specificity of the \`${key}\` internal state.`, "You can not override it like this: ", JSON.stringify(node2, null, 2), "", `Instead, you need to use the '&.${stateClass}' syntax:`, JSON.stringify({
|
|
root: {
|
|
[`&.${stateClass}`]: child
|
|
}
|
|
}, null, 2), "", "https://mui.com/r/state-classes-guide"].join("\n"));
|
|
}
|
|
node2[key] = {};
|
|
}
|
|
}
|
|
};
|
|
Object.keys(muiTheme.components).forEach((component) => {
|
|
const styleOverrides = muiTheme.components[component].styleOverrides;
|
|
if (styleOverrides && component.startsWith("Mui")) {
|
|
traverse(styleOverrides, component);
|
|
}
|
|
});
|
|
}
|
|
muiTheme.unstable_sxConfig = __spreadValues(__spreadValues({}, defaultSxConfig_default), other == null ? void 0 : other.unstable_sxConfig);
|
|
muiTheme.unstable_sx = function sx(props) {
|
|
return styleFunctionSx_default({
|
|
sx: props,
|
|
theme: this
|
|
});
|
|
};
|
|
muiTheme.toRuntimeSource = stringifyTheme;
|
|
attachColorManipulators(muiTheme);
|
|
return muiTheme;
|
|
}
|
|
var createThemeNoVars_default = createThemeNoVars;
|
|
|
|
// node_modules/@mui/material/esm/styles/getOverlayAlpha.js
|
|
function getOverlayAlpha(elevation) {
|
|
let alphaValue;
|
|
if (elevation < 1) {
|
|
alphaValue = 5.11916 * elevation ** 2;
|
|
} else {
|
|
alphaValue = 4.5 * Math.log(elevation + 1) + 2;
|
|
}
|
|
return Math.round(alphaValue * 10) / 1e3;
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/createColorScheme.js
|
|
var defaultDarkOverlays = [...Array(25)].map((_, index) => {
|
|
if (index === 0) {
|
|
return "none";
|
|
}
|
|
const overlay = getOverlayAlpha(index);
|
|
return `linear-gradient(rgba(255 255 255 / ${overlay}), rgba(255 255 255 / ${overlay}))`;
|
|
});
|
|
function getOpacity(mode) {
|
|
return {
|
|
inputPlaceholder: mode === "dark" ? 0.5 : 0.42,
|
|
inputUnderline: mode === "dark" ? 0.7 : 0.42,
|
|
switchTrackDisabled: mode === "dark" ? 0.2 : 0.12,
|
|
switchTrack: mode === "dark" ? 0.3 : 0.38
|
|
};
|
|
}
|
|
function getOverlays(mode) {
|
|
return mode === "dark" ? defaultDarkOverlays : [];
|
|
}
|
|
function createColorScheme(options) {
|
|
const _a = options, {
|
|
palette: paletteInput = {
|
|
mode: "light"
|
|
},
|
|
opacity: opacity,
|
|
overlays,
|
|
colorSpace
|
|
} = _a, other = __objRest(_a, [
|
|
"palette",
|
|
// need to cast to avoid module augmentation test
|
|
"opacity",
|
|
"overlays",
|
|
"colorSpace"
|
|
]);
|
|
const palette2 = createPalette(__spreadProps(__spreadValues({}, paletteInput), {
|
|
colorSpace
|
|
}));
|
|
return __spreadValues({
|
|
palette: palette2,
|
|
opacity: __spreadValues(__spreadValues({}, getOpacity(palette2.mode)), opacity),
|
|
overlays: overlays || getOverlays(palette2.mode)
|
|
}, other);
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/shouldSkipGeneratingVar.js
|
|
function shouldSkipGeneratingVar(keys) {
|
|
var _a;
|
|
return !!keys[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) || // ends with sxConfig
|
|
keys[0] === "palette" && !!((_a = keys[1]) == null ? void 0 : _a.match(/(mode|contrastThreshold|tonalOffset)/));
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/excludeVariablesFromRoot.js
|
|
var excludeVariablesFromRoot = (cssVarPrefix) => [...[...Array(25)].map((_, index) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}overlays-${index}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}palette-AppBar-darkColor`];
|
|
var excludeVariablesFromRoot_default = excludeVariablesFromRoot;
|
|
|
|
// node_modules/@mui/material/esm/styles/createGetSelector.js
|
|
var createGetSelector_default = (theme) => (colorScheme, css2) => {
|
|
const root = theme.rootSelector || ":root";
|
|
const selector = theme.colorSchemeSelector;
|
|
let rule = selector;
|
|
if (selector === "class") {
|
|
rule = ".%s";
|
|
}
|
|
if (selector === "data") {
|
|
rule = "[data-%s]";
|
|
}
|
|
if ((selector == null ? void 0 : selector.startsWith("data-")) && !selector.includes("%s")) {
|
|
rule = `[${selector}="%s"]`;
|
|
}
|
|
if (theme.defaultColorScheme === colorScheme) {
|
|
if (colorScheme === "dark") {
|
|
const excludedVariables = {};
|
|
excludeVariablesFromRoot_default(theme.cssVarPrefix).forEach((cssVar) => {
|
|
excludedVariables[cssVar] = css2[cssVar];
|
|
delete css2[cssVar];
|
|
});
|
|
if (rule === "media") {
|
|
return {
|
|
[root]: css2,
|
|
[`@media (prefers-color-scheme: dark)`]: {
|
|
[root]: excludedVariables
|
|
}
|
|
};
|
|
}
|
|
if (rule) {
|
|
return {
|
|
[rule.replace("%s", colorScheme)]: excludedVariables,
|
|
[`${root}, ${rule.replace("%s", colorScheme)}`]: css2
|
|
};
|
|
}
|
|
return {
|
|
[root]: __spreadValues(__spreadValues({}, css2), excludedVariables)
|
|
};
|
|
}
|
|
if (rule && rule !== "media") {
|
|
return `${root}, ${rule.replace("%s", String(colorScheme))}`;
|
|
}
|
|
} else if (colorScheme) {
|
|
if (rule === "media") {
|
|
return {
|
|
[`@media (prefers-color-scheme: ${String(colorScheme)})`]: {
|
|
[root]: css2
|
|
}
|
|
};
|
|
}
|
|
if (rule) {
|
|
return rule.replace("%s", String(colorScheme));
|
|
}
|
|
}
|
|
return root;
|
|
};
|
|
|
|
// node_modules/@mui/material/esm/styles/createThemeWithVars.js
|
|
function assignNode(obj, keys) {
|
|
keys.forEach((k) => {
|
|
if (!obj[k]) {
|
|
obj[k] = {};
|
|
}
|
|
});
|
|
}
|
|
function setColor(obj, key, defaultValue) {
|
|
if (!obj[key] && defaultValue) {
|
|
obj[key] = defaultValue;
|
|
}
|
|
}
|
|
function toRgb(color2) {
|
|
if (typeof color2 !== "string" || !color2.startsWith("hsl")) {
|
|
return color2;
|
|
}
|
|
return hslToRgb(color2);
|
|
}
|
|
function setColorChannel(obj, key) {
|
|
if (!(`${key}Channel` in obj)) {
|
|
obj[`${key}Channel`] = private_safeColorChannel(toRgb(obj[key]), `MUI: Can't create \`palette.${key}Channel\` because \`palette.${key}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
|
|
To suppress this warning, you need to explicitly provide the \`palette.${key}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`);
|
|
}
|
|
}
|
|
function getSpacingVal(spacingInput) {
|
|
if (typeof spacingInput === "number") {
|
|
return `${spacingInput}px`;
|
|
}
|
|
if (typeof spacingInput === "string" || typeof spacingInput === "function" || Array.isArray(spacingInput)) {
|
|
return spacingInput;
|
|
}
|
|
return "8px";
|
|
}
|
|
var silent = (fn) => {
|
|
try {
|
|
return fn();
|
|
} catch (error) {
|
|
}
|
|
return void 0;
|
|
};
|
|
var createGetCssVar2 = (cssVarPrefix = "mui") => createGetCssVar(cssVarPrefix);
|
|
function attachColorScheme(colorSpace, colorSchemes, scheme, restTheme, colorScheme) {
|
|
if (!scheme) {
|
|
return void 0;
|
|
}
|
|
scheme = scheme === true ? {} : scheme;
|
|
const mode = colorScheme === "dark" ? "dark" : "light";
|
|
if (!restTheme) {
|
|
colorSchemes[colorScheme] = createColorScheme(__spreadProps(__spreadValues({}, scheme), {
|
|
palette: __spreadValues({
|
|
mode
|
|
}, scheme == null ? void 0 : scheme.palette),
|
|
colorSpace
|
|
}));
|
|
return void 0;
|
|
}
|
|
const _a = createThemeNoVars_default(__spreadProps(__spreadValues({}, restTheme), {
|
|
palette: __spreadValues({
|
|
mode
|
|
}, scheme == null ? void 0 : scheme.palette),
|
|
colorSpace
|
|
})), {
|
|
palette: palette2
|
|
} = _a, muiTheme = __objRest(_a, [
|
|
"palette"
|
|
]);
|
|
colorSchemes[colorScheme] = __spreadProps(__spreadValues({}, scheme), {
|
|
palette: palette2,
|
|
opacity: __spreadValues(__spreadValues({}, getOpacity(mode)), scheme == null ? void 0 : scheme.opacity),
|
|
overlays: (scheme == null ? void 0 : scheme.overlays) || getOverlays(mode)
|
|
});
|
|
return muiTheme;
|
|
}
|
|
function createThemeWithVars(options = {}, ...args) {
|
|
const _a = options, {
|
|
colorSchemes: colorSchemesInput = {
|
|
light: true
|
|
},
|
|
defaultColorScheme: defaultColorSchemeInput,
|
|
disableCssColorScheme = false,
|
|
cssVarPrefix = "mui",
|
|
nativeColor = false,
|
|
shouldSkipGeneratingVar: shouldSkipGeneratingVar2 = shouldSkipGeneratingVar,
|
|
colorSchemeSelector: selector = colorSchemesInput.light && colorSchemesInput.dark ? "media" : void 0,
|
|
rootSelector = ":root"
|
|
} = _a, input = __objRest(_a, [
|
|
"colorSchemes",
|
|
"defaultColorScheme",
|
|
"disableCssColorScheme",
|
|
"cssVarPrefix",
|
|
"nativeColor",
|
|
"shouldSkipGeneratingVar",
|
|
"colorSchemeSelector",
|
|
"rootSelector"
|
|
]);
|
|
const firstColorScheme = Object.keys(colorSchemesInput)[0];
|
|
const defaultColorScheme = defaultColorSchemeInput || (colorSchemesInput.light && firstColorScheme !== "light" ? "light" : firstColorScheme);
|
|
const getCssVar = createGetCssVar2(cssVarPrefix);
|
|
const _b = colorSchemesInput, {
|
|
[defaultColorScheme]: defaultSchemeInput,
|
|
light: builtInLight,
|
|
dark: builtInDark
|
|
} = _b, customColorSchemes = __objRest(_b, [
|
|
__restKey(defaultColorScheme),
|
|
"light",
|
|
"dark"
|
|
]);
|
|
const colorSchemes = __spreadValues({}, customColorSchemes);
|
|
let defaultScheme = defaultSchemeInput;
|
|
if (defaultColorScheme === "dark" && !("dark" in colorSchemesInput) || defaultColorScheme === "light" && !("light" in colorSchemesInput)) {
|
|
defaultScheme = true;
|
|
}
|
|
if (!defaultScheme) {
|
|
throw new Error(true ? `MUI: The \`colorSchemes.${defaultColorScheme}\` option is either missing or invalid.` : formatMuiErrorMessage(21, defaultColorScheme));
|
|
}
|
|
let colorSpace;
|
|
if (nativeColor) {
|
|
colorSpace = "oklch";
|
|
}
|
|
const muiTheme = attachColorScheme(colorSpace, colorSchemes, defaultScheme, input, defaultColorScheme);
|
|
if (builtInLight && !colorSchemes.light) {
|
|
attachColorScheme(colorSpace, colorSchemes, builtInLight, void 0, "light");
|
|
}
|
|
if (builtInDark && !colorSchemes.dark) {
|
|
attachColorScheme(colorSpace, colorSchemes, builtInDark, void 0, "dark");
|
|
}
|
|
let theme = __spreadProps(__spreadValues({
|
|
defaultColorScheme
|
|
}, muiTheme), {
|
|
cssVarPrefix,
|
|
colorSchemeSelector: selector,
|
|
rootSelector,
|
|
getCssVar,
|
|
colorSchemes,
|
|
font: __spreadValues(__spreadValues({}, prepareTypographyVars(muiTheme.typography)), muiTheme.font),
|
|
spacing: getSpacingVal(input.spacing)
|
|
});
|
|
Object.keys(theme.colorSchemes).forEach((key) => {
|
|
const palette2 = theme.colorSchemes[key].palette;
|
|
const setCssVarColor = (cssVar) => {
|
|
const tokens = cssVar.split("-");
|
|
const color2 = tokens[1];
|
|
const colorToken = tokens[2];
|
|
return getCssVar(cssVar, palette2[color2][colorToken]);
|
|
};
|
|
if (palette2.mode === "light") {
|
|
setColor(palette2.common, "background", "#fff");
|
|
setColor(palette2.common, "onBackground", "#000");
|
|
}
|
|
if (palette2.mode === "dark") {
|
|
setColor(palette2.common, "background", "#000");
|
|
setColor(palette2.common, "onBackground", "#fff");
|
|
}
|
|
function colorMix(method, color2, coefficient) {
|
|
if (colorSpace) {
|
|
let mixer;
|
|
if (method === private_safeAlpha) {
|
|
mixer = `transparent ${((1 - coefficient) * 100).toFixed(0)}%`;
|
|
}
|
|
if (method === private_safeDarken) {
|
|
mixer = `#000 ${(coefficient * 100).toFixed(0)}%`;
|
|
}
|
|
if (method === private_safeLighten) {
|
|
mixer = `#fff ${(coefficient * 100).toFixed(0)}%`;
|
|
}
|
|
return `color-mix(in ${colorSpace}, ${color2}, ${mixer})`;
|
|
}
|
|
return method(color2, coefficient);
|
|
}
|
|
assignNode(palette2, ["Alert", "AppBar", "Avatar", "Button", "Chip", "FilledInput", "LinearProgress", "Skeleton", "Slider", "SnackbarContent", "SpeedDialAction", "StepConnector", "StepContent", "Switch", "TableCell", "Tooltip"]);
|
|
if (palette2.mode === "light") {
|
|
setColor(palette2.Alert, "errorColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-light") : palette2.error.light, 0.6));
|
|
setColor(palette2.Alert, "infoColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-light") : palette2.info.light, 0.6));
|
|
setColor(palette2.Alert, "successColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-light") : palette2.success.light, 0.6));
|
|
setColor(palette2.Alert, "warningColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette2.warning.light, 0.6));
|
|
setColor(palette2.Alert, "errorFilledBg", setCssVarColor("palette-error-main"));
|
|
setColor(palette2.Alert, "infoFilledBg", setCssVarColor("palette-info-main"));
|
|
setColor(palette2.Alert, "successFilledBg", setCssVarColor("palette-success-main"));
|
|
setColor(palette2.Alert, "warningFilledBg", setCssVarColor("palette-warning-main"));
|
|
setColor(palette2.Alert, "errorFilledColor", silent(() => palette2.getContrastText(palette2.error.main)));
|
|
setColor(palette2.Alert, "infoFilledColor", silent(() => palette2.getContrastText(palette2.info.main)));
|
|
setColor(palette2.Alert, "successFilledColor", silent(() => palette2.getContrastText(palette2.success.main)));
|
|
setColor(palette2.Alert, "warningFilledColor", silent(() => palette2.getContrastText(palette2.warning.main)));
|
|
setColor(palette2.Alert, "errorStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-light") : palette2.error.light, 0.9));
|
|
setColor(palette2.Alert, "infoStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-light") : palette2.info.light, 0.9));
|
|
setColor(palette2.Alert, "successStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-light") : palette2.success.light, 0.9));
|
|
setColor(palette2.Alert, "warningStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette2.warning.light, 0.9));
|
|
setColor(palette2.Alert, "errorIconColor", setCssVarColor("palette-error-main"));
|
|
setColor(palette2.Alert, "infoIconColor", setCssVarColor("palette-info-main"));
|
|
setColor(palette2.Alert, "successIconColor", setCssVarColor("palette-success-main"));
|
|
setColor(palette2.Alert, "warningIconColor", setCssVarColor("palette-warning-main"));
|
|
setColor(palette2.AppBar, "defaultBg", setCssVarColor("palette-grey-100"));
|
|
setColor(palette2.Avatar, "defaultBg", setCssVarColor("palette-grey-400"));
|
|
setColor(palette2.Button, "inheritContainedBg", setCssVarColor("palette-grey-300"));
|
|
setColor(palette2.Button, "inheritContainedHoverBg", setCssVarColor("palette-grey-A100"));
|
|
setColor(palette2.Chip, "defaultBorder", setCssVarColor("palette-grey-400"));
|
|
setColor(palette2.Chip, "defaultAvatarColor", setCssVarColor("palette-grey-700"));
|
|
setColor(palette2.Chip, "defaultIconColor", setCssVarColor("palette-grey-700"));
|
|
setColor(palette2.FilledInput, "bg", "rgba(0, 0, 0, 0.06)");
|
|
setColor(palette2.FilledInput, "hoverBg", "rgba(0, 0, 0, 0.09)");
|
|
setColor(palette2.FilledInput, "disabledBg", "rgba(0, 0, 0, 0.12)");
|
|
setColor(palette2.LinearProgress, "primaryBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette2.primary.main, 0.62));
|
|
setColor(palette2.LinearProgress, "secondaryBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette2.secondary.main, 0.62));
|
|
setColor(palette2.LinearProgress, "errorBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette2.error.main, 0.62));
|
|
setColor(palette2.LinearProgress, "infoBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette2.info.main, 0.62));
|
|
setColor(palette2.LinearProgress, "successBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette2.success.main, 0.62));
|
|
setColor(palette2.LinearProgress, "warningBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette2.warning.main, 0.62));
|
|
setColor(palette2.Skeleton, "bg", colorSpace ? colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-text-primary") : palette2.text.primary, 0.11) : `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.11)`);
|
|
setColor(palette2.Slider, "primaryTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette2.primary.main, 0.62));
|
|
setColor(palette2.Slider, "secondaryTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette2.secondary.main, 0.62));
|
|
setColor(palette2.Slider, "errorTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette2.error.main, 0.62));
|
|
setColor(palette2.Slider, "infoTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette2.info.main, 0.62));
|
|
setColor(palette2.Slider, "successTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette2.success.main, 0.62));
|
|
setColor(palette2.Slider, "warningTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-main") : palette2.warning.main, 0.62));
|
|
const snackbarContentBackground = colorSpace ? colorMix(private_safeDarken, nativeColor ? getCssVar("palette-background-default") : palette2.background.default, 0.6825) : private_safeEmphasize(palette2.background.default, 0.8);
|
|
setColor(palette2.SnackbarContent, "bg", snackbarContentBackground);
|
|
setColor(palette2.SnackbarContent, "color", silent(() => colorSpace ? dark.text.primary : palette2.getContrastText(snackbarContentBackground)));
|
|
setColor(palette2.SpeedDialAction, "fabHoverBg", private_safeEmphasize(palette2.background.paper, 0.15));
|
|
setColor(palette2.StepConnector, "border", setCssVarColor("palette-grey-400"));
|
|
setColor(palette2.StepContent, "border", setCssVarColor("palette-grey-400"));
|
|
setColor(palette2.Switch, "defaultColor", setCssVarColor("palette-common-white"));
|
|
setColor(palette2.Switch, "defaultDisabledColor", setCssVarColor("palette-grey-100"));
|
|
setColor(palette2.Switch, "primaryDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette2.primary.main, 0.62));
|
|
setColor(palette2.Switch, "secondaryDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette2.secondary.main, 0.62));
|
|
setColor(palette2.Switch, "errorDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette2.error.main, 0.62));
|
|
setColor(palette2.Switch, "infoDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette2.info.main, 0.62));
|
|
setColor(palette2.Switch, "successDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette2.success.main, 0.62));
|
|
setColor(palette2.Switch, "warningDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-main") : palette2.warning.main, 0.62));
|
|
setColor(palette2.TableCell, "border", colorMix(private_safeLighten, private_safeAlpha(nativeColor ? getCssVar("palette-divider") : palette2.divider, 1), 0.88));
|
|
setColor(palette2.Tooltip, "bg", colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-grey-700") : palette2.grey[700], 0.92));
|
|
}
|
|
if (palette2.mode === "dark") {
|
|
setColor(palette2.Alert, "errorColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-light") : palette2.error.light, 0.6));
|
|
setColor(palette2.Alert, "infoColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-light") : palette2.info.light, 0.6));
|
|
setColor(palette2.Alert, "successColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-light") : palette2.success.light, 0.6));
|
|
setColor(palette2.Alert, "warningColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette2.warning.light, 0.6));
|
|
setColor(palette2.Alert, "errorFilledBg", setCssVarColor("palette-error-dark"));
|
|
setColor(palette2.Alert, "infoFilledBg", setCssVarColor("palette-info-dark"));
|
|
setColor(palette2.Alert, "successFilledBg", setCssVarColor("palette-success-dark"));
|
|
setColor(palette2.Alert, "warningFilledBg", setCssVarColor("palette-warning-dark"));
|
|
setColor(palette2.Alert, "errorFilledColor", silent(() => palette2.getContrastText(palette2.error.dark)));
|
|
setColor(palette2.Alert, "infoFilledColor", silent(() => palette2.getContrastText(palette2.info.dark)));
|
|
setColor(palette2.Alert, "successFilledColor", silent(() => palette2.getContrastText(palette2.success.dark)));
|
|
setColor(palette2.Alert, "warningFilledColor", silent(() => palette2.getContrastText(palette2.warning.dark)));
|
|
setColor(palette2.Alert, "errorStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-light") : palette2.error.light, 0.9));
|
|
setColor(palette2.Alert, "infoStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-light") : palette2.info.light, 0.9));
|
|
setColor(palette2.Alert, "successStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-light") : palette2.success.light, 0.9));
|
|
setColor(palette2.Alert, "warningStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette2.warning.light, 0.9));
|
|
setColor(palette2.Alert, "errorIconColor", setCssVarColor("palette-error-main"));
|
|
setColor(palette2.Alert, "infoIconColor", setCssVarColor("palette-info-main"));
|
|
setColor(palette2.Alert, "successIconColor", setCssVarColor("palette-success-main"));
|
|
setColor(palette2.Alert, "warningIconColor", setCssVarColor("palette-warning-main"));
|
|
setColor(palette2.AppBar, "defaultBg", setCssVarColor("palette-grey-900"));
|
|
setColor(palette2.AppBar, "darkBg", setCssVarColor("palette-background-paper"));
|
|
setColor(palette2.AppBar, "darkColor", setCssVarColor("palette-text-primary"));
|
|
setColor(palette2.Avatar, "defaultBg", setCssVarColor("palette-grey-600"));
|
|
setColor(palette2.Button, "inheritContainedBg", setCssVarColor("palette-grey-800"));
|
|
setColor(palette2.Button, "inheritContainedHoverBg", setCssVarColor("palette-grey-700"));
|
|
setColor(palette2.Chip, "defaultBorder", setCssVarColor("palette-grey-700"));
|
|
setColor(palette2.Chip, "defaultAvatarColor", setCssVarColor("palette-grey-300"));
|
|
setColor(palette2.Chip, "defaultIconColor", setCssVarColor("palette-grey-300"));
|
|
setColor(palette2.FilledInput, "bg", "rgba(255, 255, 255, 0.09)");
|
|
setColor(palette2.FilledInput, "hoverBg", "rgba(255, 255, 255, 0.13)");
|
|
setColor(palette2.FilledInput, "disabledBg", "rgba(255, 255, 255, 0.12)");
|
|
setColor(palette2.LinearProgress, "primaryBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette2.primary.main, 0.5));
|
|
setColor(palette2.LinearProgress, "secondaryBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette2.secondary.main, 0.5));
|
|
setColor(palette2.LinearProgress, "errorBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette2.error.main, 0.5));
|
|
setColor(palette2.LinearProgress, "infoBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette2.info.main, 0.5));
|
|
setColor(palette2.LinearProgress, "successBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette2.success.main, 0.5));
|
|
setColor(palette2.LinearProgress, "warningBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-main") : palette2.warning.main, 0.5));
|
|
setColor(palette2.Skeleton, "bg", colorSpace ? colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-text-primary") : palette2.text.primary, 0.13) : `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.13)`);
|
|
setColor(palette2.Slider, "primaryTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette2.primary.main, 0.5));
|
|
setColor(palette2.Slider, "secondaryTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette2.secondary.main, 0.5));
|
|
setColor(palette2.Slider, "errorTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette2.error.main, 0.5));
|
|
setColor(palette2.Slider, "infoTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette2.info.main, 0.5));
|
|
setColor(palette2.Slider, "successTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette2.success.main, 0.5));
|
|
setColor(palette2.Slider, "warningTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette2.warning.main, 0.5));
|
|
const snackbarContentBackground = colorSpace ? colorMix(private_safeLighten, nativeColor ? getCssVar("palette-background-default") : palette2.background.default, 0.985) : private_safeEmphasize(palette2.background.default, 0.98);
|
|
setColor(palette2.SnackbarContent, "bg", snackbarContentBackground);
|
|
setColor(palette2.SnackbarContent, "color", silent(() => colorSpace ? light.text.primary : palette2.getContrastText(snackbarContentBackground)));
|
|
setColor(palette2.SpeedDialAction, "fabHoverBg", private_safeEmphasize(palette2.background.paper, 0.15));
|
|
setColor(palette2.StepConnector, "border", setCssVarColor("palette-grey-600"));
|
|
setColor(palette2.StepContent, "border", setCssVarColor("palette-grey-600"));
|
|
setColor(palette2.Switch, "defaultColor", setCssVarColor("palette-grey-300"));
|
|
setColor(palette2.Switch, "defaultDisabledColor", setCssVarColor("palette-grey-600"));
|
|
setColor(palette2.Switch, "primaryDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette2.primary.main, 0.55));
|
|
setColor(palette2.Switch, "secondaryDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette2.secondary.main, 0.55));
|
|
setColor(palette2.Switch, "errorDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette2.error.main, 0.55));
|
|
setColor(palette2.Switch, "infoDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette2.info.main, 0.55));
|
|
setColor(palette2.Switch, "successDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette2.success.main, 0.55));
|
|
setColor(palette2.Switch, "warningDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette2.warning.main, 0.55));
|
|
setColor(palette2.TableCell, "border", colorMix(private_safeDarken, private_safeAlpha(nativeColor ? getCssVar("palette-divider") : palette2.divider, 1), 0.68));
|
|
setColor(palette2.Tooltip, "bg", colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-grey-700") : palette2.grey[700], 0.92));
|
|
}
|
|
if (!nativeColor) {
|
|
setColorChannel(palette2.background, "default");
|
|
setColorChannel(palette2.background, "paper");
|
|
setColorChannel(palette2.common, "background");
|
|
setColorChannel(palette2.common, "onBackground");
|
|
setColorChannel(palette2, "divider");
|
|
}
|
|
Object.keys(palette2).forEach((color2) => {
|
|
const colors = palette2[color2];
|
|
if (color2 !== "tonalOffset" && !nativeColor && colors && typeof colors === "object") {
|
|
if (colors.main) {
|
|
setColor(palette2[color2], "mainChannel", private_safeColorChannel(toRgb(colors.main)));
|
|
}
|
|
if (colors.light) {
|
|
setColor(palette2[color2], "lightChannel", private_safeColorChannel(toRgb(colors.light)));
|
|
}
|
|
if (colors.dark) {
|
|
setColor(palette2[color2], "darkChannel", private_safeColorChannel(toRgb(colors.dark)));
|
|
}
|
|
if (colors.contrastText) {
|
|
setColor(palette2[color2], "contrastTextChannel", private_safeColorChannel(toRgb(colors.contrastText)));
|
|
}
|
|
if (color2 === "text") {
|
|
setColorChannel(palette2[color2], "primary");
|
|
setColorChannel(palette2[color2], "secondary");
|
|
}
|
|
if (color2 === "action") {
|
|
if (colors.active) {
|
|
setColorChannel(palette2[color2], "active");
|
|
}
|
|
if (colors.selected) {
|
|
setColorChannel(palette2[color2], "selected");
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
theme = args.reduce((acc, argument) => deepmerge(acc, argument), theme);
|
|
const parserConfig = {
|
|
prefix: cssVarPrefix,
|
|
disableCssColorScheme,
|
|
shouldSkipGeneratingVar: shouldSkipGeneratingVar2,
|
|
getSelector: createGetSelector_default(theme),
|
|
enableContrastVars: nativeColor
|
|
};
|
|
const {
|
|
vars,
|
|
generateThemeVars,
|
|
generateStyleSheets
|
|
} = prepareCssVars_default(theme, parserConfig);
|
|
theme.vars = vars;
|
|
Object.entries(theme.colorSchemes[theme.defaultColorScheme]).forEach(([key, value]) => {
|
|
theme[key] = value;
|
|
});
|
|
theme.generateThemeVars = generateThemeVars;
|
|
theme.generateStyleSheets = generateStyleSheets;
|
|
theme.generateSpacing = function generateSpacing() {
|
|
return createSpacing(input.spacing, createUnarySpacing(this));
|
|
};
|
|
theme.getColorSchemeSelector = createGetColorSchemeSelector(selector);
|
|
theme.spacing = theme.generateSpacing();
|
|
theme.shouldSkipGeneratingVar = shouldSkipGeneratingVar2;
|
|
theme.unstable_sxConfig = __spreadValues(__spreadValues({}, defaultSxConfig_default), input == null ? void 0 : input.unstable_sxConfig);
|
|
theme.unstable_sx = function sx(props) {
|
|
return styleFunctionSx_default({
|
|
sx: props,
|
|
theme: this
|
|
});
|
|
};
|
|
theme.toRuntimeSource = stringifyTheme;
|
|
return theme;
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/createTheme.js
|
|
function attachColorScheme2(theme, scheme, colorScheme) {
|
|
if (!theme.colorSchemes) {
|
|
return void 0;
|
|
}
|
|
if (colorScheme) {
|
|
theme.colorSchemes[scheme] = __spreadProps(__spreadValues({}, colorScheme !== true && colorScheme), {
|
|
palette: createPalette(__spreadProps(__spreadValues({}, colorScheme === true ? {} : colorScheme.palette), {
|
|
mode: scheme
|
|
}))
|
|
// cast type to skip module augmentation test
|
|
});
|
|
}
|
|
}
|
|
function createTheme2(options = {}, ...args) {
|
|
const _a = options, {
|
|
palette: palette2,
|
|
cssVariables = false,
|
|
colorSchemes: initialColorSchemes = !palette2 ? {
|
|
light: true
|
|
} : void 0,
|
|
defaultColorScheme: initialDefaultColorScheme = palette2 == null ? void 0 : palette2.mode
|
|
} = _a, other = __objRest(_a, [
|
|
"palette",
|
|
"cssVariables",
|
|
"colorSchemes",
|
|
"defaultColorScheme"
|
|
]);
|
|
const defaultColorSchemeInput = initialDefaultColorScheme || "light";
|
|
const defaultScheme = initialColorSchemes == null ? void 0 : initialColorSchemes[defaultColorSchemeInput];
|
|
const colorSchemesInput = __spreadValues(__spreadValues({}, initialColorSchemes), palette2 ? {
|
|
[defaultColorSchemeInput]: __spreadProps(__spreadValues({}, typeof defaultScheme !== "boolean" && defaultScheme), {
|
|
palette: palette2
|
|
})
|
|
} : void 0);
|
|
if (cssVariables === false) {
|
|
if (!("colorSchemes" in options)) {
|
|
return createThemeNoVars_default(options, ...args);
|
|
}
|
|
let paletteOptions = palette2;
|
|
if (!("palette" in options)) {
|
|
if (colorSchemesInput[defaultColorSchemeInput]) {
|
|
if (colorSchemesInput[defaultColorSchemeInput] !== true) {
|
|
paletteOptions = colorSchemesInput[defaultColorSchemeInput].palette;
|
|
} else if (defaultColorSchemeInput === "dark") {
|
|
paletteOptions = {
|
|
mode: "dark"
|
|
};
|
|
}
|
|
}
|
|
}
|
|
const theme = createThemeNoVars_default(__spreadProps(__spreadValues({}, options), {
|
|
palette: paletteOptions
|
|
}), ...args);
|
|
theme.defaultColorScheme = defaultColorSchemeInput;
|
|
theme.colorSchemes = colorSchemesInput;
|
|
if (theme.palette.mode === "light") {
|
|
theme.colorSchemes.light = __spreadProps(__spreadValues({}, colorSchemesInput.light !== true && colorSchemesInput.light), {
|
|
palette: theme.palette
|
|
});
|
|
attachColorScheme2(theme, "dark", colorSchemesInput.dark);
|
|
}
|
|
if (theme.palette.mode === "dark") {
|
|
theme.colorSchemes.dark = __spreadProps(__spreadValues({}, colorSchemesInput.dark !== true && colorSchemesInput.dark), {
|
|
palette: theme.palette
|
|
});
|
|
attachColorScheme2(theme, "light", colorSchemesInput.light);
|
|
}
|
|
return theme;
|
|
}
|
|
if (!palette2 && !("light" in colorSchemesInput) && defaultColorSchemeInput === "light") {
|
|
colorSchemesInput.light = true;
|
|
}
|
|
return createThemeWithVars(__spreadValues(__spreadProps(__spreadValues({}, other), {
|
|
colorSchemes: colorSchemesInput,
|
|
defaultColorScheme: defaultColorSchemeInput
|
|
}), typeof cssVariables !== "boolean" && cssVariables), ...args);
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/defaultTheme.js
|
|
var defaultTheme = createTheme2();
|
|
var defaultTheme_default = defaultTheme;
|
|
|
|
// node_modules/@mui/material/esm/styles/identifier.js
|
|
var identifier_default = "$$material";
|
|
|
|
// node_modules/@mui/material/esm/styles/useTheme.js
|
|
function useTheme4() {
|
|
const theme = useTheme_default(defaultTheme_default);
|
|
if (true) {
|
|
React17.useDebugValue(theme);
|
|
}
|
|
return theme[identifier_default] || theme;
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/zero-styled/index.js
|
|
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
|
|
|
|
// node_modules/@mui/material/esm/styles/slotShouldForwardProp.js
|
|
function slotShouldForwardProp(prop) {
|
|
return prop !== "ownerState" && prop !== "theme" && prop !== "sx" && prop !== "as";
|
|
}
|
|
var slotShouldForwardProp_default = slotShouldForwardProp;
|
|
|
|
// node_modules/@mui/material/esm/styles/rootShouldForwardProp.js
|
|
var rootShouldForwardProp = (prop) => slotShouldForwardProp_default(prop) && prop !== "classes";
|
|
var rootShouldForwardProp_default = rootShouldForwardProp;
|
|
|
|
// node_modules/@mui/material/esm/styles/styled.js
|
|
var styled3 = createStyled3({
|
|
themeId: identifier_default,
|
|
defaultTheme: defaultTheme_default,
|
|
rootShouldForwardProp: rootShouldForwardProp_default
|
|
});
|
|
var styled_default = styled3;
|
|
|
|
// node_modules/@mui/material/esm/zero-styled/index.js
|
|
function internal_createExtendSxProp() {
|
|
return extendSxProp;
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/utils/memoTheme.js
|
|
var memoTheme = unstable_memoTheme;
|
|
var memoTheme_default = memoTheme;
|
|
|
|
// node_modules/@mui/material/esm/DefaultPropsProvider/DefaultPropsProvider.js
|
|
var React18 = __toESM(require_react(), 1);
|
|
var import_prop_types4 = __toESM(require_prop_types(), 1);
|
|
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
|
function DefaultPropsProvider2(props) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DefaultPropsProvider_default, __spreadValues({}, props));
|
|
}
|
|
true ? DefaultPropsProvider2.propTypes = {
|
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
/**
|
|
* @ignore
|
|
*/
|
|
children: import_prop_types4.default.node,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
value: import_prop_types4.default.object.isRequired
|
|
} : void 0;
|
|
function useDefaultProps2(params) {
|
|
return useDefaultProps(params);
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/useForkRef/useForkRef.js
|
|
var React19 = __toESM(require_react(), 1);
|
|
function useForkRef(...refs) {
|
|
const cleanupRef = React19.useRef(void 0);
|
|
const refEffect = React19.useCallback((instance) => {
|
|
const cleanups = refs.map((ref) => {
|
|
if (ref == null) {
|
|
return null;
|
|
}
|
|
if (typeof ref === "function") {
|
|
const refCallback = ref;
|
|
const refCleanup = refCallback(instance);
|
|
return typeof refCleanup === "function" ? refCleanup : () => {
|
|
refCallback(null);
|
|
};
|
|
}
|
|
ref.current = instance;
|
|
return () => {
|
|
ref.current = null;
|
|
};
|
|
});
|
|
return () => {
|
|
cleanups.forEach((refCleanup) => refCleanup == null ? void 0 : refCleanup());
|
|
};
|
|
}, refs);
|
|
return React19.useMemo(() => {
|
|
if (refs.every((ref) => ref == null)) {
|
|
return null;
|
|
}
|
|
return (value) => {
|
|
if (cleanupRef.current) {
|
|
cleanupRef.current();
|
|
cleanupRef.current = void 0;
|
|
}
|
|
if (value != null) {
|
|
cleanupRef.current = refEffect(value);
|
|
}
|
|
};
|
|
}, refs);
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/isHostComponent/isHostComponent.js
|
|
function isHostComponent(element) {
|
|
return typeof element === "string";
|
|
}
|
|
var isHostComponent_default = isHostComponent;
|
|
|
|
// node_modules/@mui/utils/esm/appendOwnerState/appendOwnerState.js
|
|
function appendOwnerState(elementType, otherProps, ownerState) {
|
|
if (elementType === void 0 || isHostComponent_default(elementType)) {
|
|
return otherProps;
|
|
}
|
|
return __spreadProps(__spreadValues({}, otherProps), {
|
|
ownerState: __spreadValues(__spreadValues({}, otherProps.ownerState), ownerState)
|
|
});
|
|
}
|
|
var appendOwnerState_default = appendOwnerState;
|
|
|
|
// node_modules/@mui/utils/esm/resolveComponentProps/resolveComponentProps.js
|
|
function resolveComponentProps(componentProps, ownerState, slotState) {
|
|
if (typeof componentProps === "function") {
|
|
return componentProps(ownerState, slotState);
|
|
}
|
|
return componentProps;
|
|
}
|
|
var resolveComponentProps_default = resolveComponentProps;
|
|
|
|
// node_modules/@mui/utils/esm/extractEventHandlers/extractEventHandlers.js
|
|
function extractEventHandlers(object, excludeKeys = []) {
|
|
if (object === void 0) {
|
|
return {};
|
|
}
|
|
const result = {};
|
|
Object.keys(object).filter((prop) => prop.match(/^on[A-Z]/) && typeof object[prop] === "function" && !excludeKeys.includes(prop)).forEach((prop) => {
|
|
result[prop] = object[prop];
|
|
});
|
|
return result;
|
|
}
|
|
var extractEventHandlers_default = extractEventHandlers;
|
|
|
|
// node_modules/@mui/utils/esm/omitEventHandlers/omitEventHandlers.js
|
|
function omitEventHandlers(object) {
|
|
if (object === void 0) {
|
|
return {};
|
|
}
|
|
const result = {};
|
|
Object.keys(object).filter((prop) => !(prop.match(/^on[A-Z]/) && typeof object[prop] === "function")).forEach((prop) => {
|
|
result[prop] = object[prop];
|
|
});
|
|
return result;
|
|
}
|
|
var omitEventHandlers_default = omitEventHandlers;
|
|
|
|
// node_modules/@mui/utils/esm/mergeSlotProps/mergeSlotProps.js
|
|
function mergeSlotProps(parameters) {
|
|
const {
|
|
getSlotProps,
|
|
additionalProps,
|
|
externalSlotProps,
|
|
externalForwardedProps,
|
|
className
|
|
} = parameters;
|
|
if (!getSlotProps) {
|
|
const joinedClasses2 = clsx_default(additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);
|
|
const mergedStyle2 = __spreadValues(__spreadValues(__spreadValues({}, additionalProps == null ? void 0 : additionalProps.style), externalForwardedProps == null ? void 0 : externalForwardedProps.style), externalSlotProps == null ? void 0 : externalSlotProps.style);
|
|
const props2 = __spreadValues(__spreadValues(__spreadValues({}, additionalProps), externalForwardedProps), externalSlotProps);
|
|
if (joinedClasses2.length > 0) {
|
|
props2.className = joinedClasses2;
|
|
}
|
|
if (Object.keys(mergedStyle2).length > 0) {
|
|
props2.style = mergedStyle2;
|
|
}
|
|
return {
|
|
props: props2,
|
|
internalRef: void 0
|
|
};
|
|
}
|
|
const eventHandlers = extractEventHandlers_default(__spreadValues(__spreadValues({}, externalForwardedProps), externalSlotProps));
|
|
const componentsPropsWithoutEventHandlers = omitEventHandlers_default(externalSlotProps);
|
|
const otherPropsWithoutEventHandlers = omitEventHandlers_default(externalForwardedProps);
|
|
const internalSlotProps = getSlotProps(eventHandlers);
|
|
const joinedClasses = clsx_default(internalSlotProps == null ? void 0 : internalSlotProps.className, additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);
|
|
const mergedStyle = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, internalSlotProps == null ? void 0 : internalSlotProps.style), additionalProps == null ? void 0 : additionalProps.style), externalForwardedProps == null ? void 0 : externalForwardedProps.style), externalSlotProps == null ? void 0 : externalSlotProps.style);
|
|
const props = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, internalSlotProps), additionalProps), otherPropsWithoutEventHandlers), componentsPropsWithoutEventHandlers);
|
|
if (joinedClasses.length > 0) {
|
|
props.className = joinedClasses;
|
|
}
|
|
if (Object.keys(mergedStyle).length > 0) {
|
|
props.style = mergedStyle;
|
|
}
|
|
return {
|
|
props,
|
|
internalRef: internalSlotProps.ref
|
|
};
|
|
}
|
|
var mergeSlotProps_default = mergeSlotProps;
|
|
|
|
// node_modules/@mui/material/esm/utils/useSlot.js
|
|
function useSlot(name, parameters) {
|
|
const _a = parameters, {
|
|
className,
|
|
elementType: initialElementType,
|
|
ownerState,
|
|
externalForwardedProps,
|
|
internalForwardedProps,
|
|
shouldForwardComponentProp = false
|
|
} = _a, useSlotPropsParams = __objRest(_a, [
|
|
"className",
|
|
"elementType",
|
|
"ownerState",
|
|
"externalForwardedProps",
|
|
"internalForwardedProps",
|
|
"shouldForwardComponentProp"
|
|
]);
|
|
const _b = externalForwardedProps, {
|
|
component: rootComponent,
|
|
slots = {
|
|
[name]: void 0
|
|
},
|
|
slotProps = {
|
|
[name]: void 0
|
|
}
|
|
} = _b, other = __objRest(_b, [
|
|
"component",
|
|
"slots",
|
|
"slotProps"
|
|
]);
|
|
const elementType = slots[name] || initialElementType;
|
|
const resolvedComponentsProps = resolveComponentProps_default(slotProps[name], ownerState);
|
|
const _c = mergeSlotProps_default(__spreadProps(__spreadValues({
|
|
className
|
|
}, useSlotPropsParams), {
|
|
externalForwardedProps: name === "root" ? other : void 0,
|
|
externalSlotProps: resolvedComponentsProps
|
|
})), {
|
|
props: _d
|
|
} = _c, _e = _d, {
|
|
component: slotComponent
|
|
} = _e, mergedProps = __objRest(_e, [
|
|
"component"
|
|
]), {
|
|
internalRef
|
|
} = _c;
|
|
const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, parameters.ref);
|
|
const LeafComponent = name === "root" ? slotComponent || rootComponent : slotComponent;
|
|
const props = appendOwnerState_default(elementType, __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, name === "root" && !rootComponent && !slots[name] && internalForwardedProps), name !== "root" && !slots[name] && internalForwardedProps), mergedProps), LeafComponent && !shouldForwardComponentProp && {
|
|
as: LeafComponent
|
|
}), LeafComponent && shouldForwardComponentProp && {
|
|
component: LeafComponent
|
|
}), {
|
|
ref
|
|
}), ownerState);
|
|
return [elementType, props];
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/utils/capitalize.js
|
|
var capitalize_default = capitalize;
|
|
|
|
// node_modules/@mui/material/esm/utils/createSimplePaletteValueFilter.js
|
|
function hasCorrectMainProperty(obj) {
|
|
return typeof obj.main === "string";
|
|
}
|
|
function checkSimplePaletteColorValues(obj, additionalPropertiesToCheck = []) {
|
|
if (!hasCorrectMainProperty(obj)) {
|
|
return false;
|
|
}
|
|
for (const value of additionalPropertiesToCheck) {
|
|
if (!obj.hasOwnProperty(value) || typeof obj[value] !== "string") {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function createSimplePaletteValueFilter(additionalPropertiesToCheck = []) {
|
|
return ([, value]) => value && checkSimplePaletteColorValues(value, additionalPropertiesToCheck);
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/Paper/Paper.js
|
|
var React20 = __toESM(require_react(), 1);
|
|
var import_prop_types5 = __toESM(require_prop_types(), 1);
|
|
|
|
// node_modules/@mui/utils/esm/integerPropType/integerPropType.js
|
|
function getTypeByValue(value) {
|
|
const valueType = typeof value;
|
|
switch (valueType) {
|
|
case "number":
|
|
if (Number.isNaN(value)) {
|
|
return "NaN";
|
|
}
|
|
if (!Number.isFinite(value)) {
|
|
return "Infinity";
|
|
}
|
|
if (value !== Math.floor(value)) {
|
|
return "float";
|
|
}
|
|
return "number";
|
|
case "object":
|
|
if (value === null) {
|
|
return "null";
|
|
}
|
|
return value.constructor.name;
|
|
default:
|
|
return valueType;
|
|
}
|
|
}
|
|
function requiredInteger(props, propName, componentName, location) {
|
|
const propValue = props[propName];
|
|
if (propValue == null || !Number.isInteger(propValue)) {
|
|
const propType = getTypeByValue(propValue);
|
|
return new RangeError(`Invalid ${location} \`${propName}\` of type \`${propType}\` supplied to \`${componentName}\`, expected \`integer\`.`);
|
|
}
|
|
return null;
|
|
}
|
|
function validator(props, propName, componentName, location) {
|
|
const propValue = props[propName];
|
|
if (propValue === void 0) {
|
|
return null;
|
|
}
|
|
return requiredInteger(props, propName, componentName, location);
|
|
}
|
|
function validatorNoop() {
|
|
return null;
|
|
}
|
|
validator.isRequired = requiredInteger;
|
|
validatorNoop.isRequired = validatorNoop;
|
|
var integerPropType = false ? validatorNoop : validator;
|
|
var integerPropType_default = integerPropType;
|
|
|
|
// node_modules/@mui/utils/esm/chainPropTypes/chainPropTypes.js
|
|
function chainPropTypes(propType1, propType2) {
|
|
if (false) {
|
|
return () => null;
|
|
}
|
|
return function validate(...args) {
|
|
return propType1(...args) || propType2(...args);
|
|
};
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/Paper/paperClasses.js
|
|
function getPaperUtilityClass(slot) {
|
|
return generateUtilityClass("MuiPaper", slot);
|
|
}
|
|
var paperClasses = generateUtilityClasses("MuiPaper", ["root", "rounded", "outlined", "elevation", "elevation0", "elevation1", "elevation2", "elevation3", "elevation4", "elevation5", "elevation6", "elevation7", "elevation8", "elevation9", "elevation10", "elevation11", "elevation12", "elevation13", "elevation14", "elevation15", "elevation16", "elevation17", "elevation18", "elevation19", "elevation20", "elevation21", "elevation22", "elevation23", "elevation24"]);
|
|
|
|
// node_modules/@mui/material/esm/Paper/Paper.js
|
|
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
|
|
var useUtilityClasses = (ownerState) => {
|
|
const {
|
|
square,
|
|
elevation,
|
|
variant,
|
|
classes
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", variant, !square && "rounded", variant === "elevation" && `elevation${elevation}`]
|
|
};
|
|
return composeClasses(slots, getPaperUtilityClass, classes);
|
|
};
|
|
var PaperRoot = styled_default("div", {
|
|
name: "MuiPaper",
|
|
slot: "Root",
|
|
overridesResolver: (props, styles) => {
|
|
const {
|
|
ownerState
|
|
} = props;
|
|
return [styles.root, styles[ownerState.variant], !ownerState.square && styles.rounded, ownerState.variant === "elevation" && styles[`elevation${ownerState.elevation}`]];
|
|
}
|
|
})(memoTheme_default(({
|
|
theme
|
|
}) => ({
|
|
backgroundColor: (theme.vars || theme).palette.background.paper,
|
|
color: (theme.vars || theme).palette.text.primary,
|
|
transition: theme.transitions.create("box-shadow"),
|
|
variants: [{
|
|
props: ({
|
|
ownerState
|
|
}) => !ownerState.square,
|
|
style: {
|
|
borderRadius: theme.shape.borderRadius
|
|
}
|
|
}, {
|
|
props: {
|
|
variant: "outlined"
|
|
},
|
|
style: {
|
|
border: `1px solid ${(theme.vars || theme).palette.divider}`
|
|
}
|
|
}, {
|
|
props: {
|
|
variant: "elevation"
|
|
},
|
|
style: {
|
|
boxShadow: "var(--Paper-shadow)",
|
|
backgroundImage: "var(--Paper-overlay)"
|
|
}
|
|
}]
|
|
})));
|
|
var Paper = /* @__PURE__ */ React20.forwardRef(function Paper2(inProps, ref) {
|
|
var _b;
|
|
const props = useDefaultProps2({
|
|
props: inProps,
|
|
name: "MuiPaper"
|
|
});
|
|
const theme = useTheme4();
|
|
const _a = props, {
|
|
className,
|
|
component = "div",
|
|
elevation = 1,
|
|
square = false,
|
|
variant = "elevation"
|
|
} = _a, other = __objRest(_a, [
|
|
"className",
|
|
"component",
|
|
"elevation",
|
|
"square",
|
|
"variant"
|
|
]);
|
|
const ownerState = __spreadProps(__spreadValues({}, props), {
|
|
component,
|
|
elevation,
|
|
square,
|
|
variant
|
|
});
|
|
const classes = useUtilityClasses(ownerState);
|
|
if (true) {
|
|
if (theme.shadows[elevation] === void 0) {
|
|
console.error([`MUI: The elevation provided <Paper elevation={${elevation}}> is not available in the theme.`, `Please make sure that \`theme.shadows[${elevation}]\` is defined.`].join("\n"));
|
|
}
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PaperRoot, __spreadProps(__spreadValues({
|
|
as: component,
|
|
ownerState,
|
|
className: clsx_default(classes.root, className),
|
|
ref
|
|
}, other), {
|
|
style: __spreadValues(__spreadValues({}, variant === "elevation" && __spreadValues(__spreadValues({
|
|
"--Paper-shadow": (theme.vars || theme).shadows[elevation]
|
|
}, theme.vars && {
|
|
"--Paper-overlay": (_b = theme.vars.overlays) == null ? void 0 : _b[elevation]
|
|
}), !theme.vars && theme.palette.mode === "dark" && {
|
|
"--Paper-overlay": `linear-gradient(${alpha("#fff", getOverlayAlpha(elevation))}, ${alpha("#fff", getOverlayAlpha(elevation))})`
|
|
})), other.style)
|
|
}));
|
|
});
|
|
true ? Paper.propTypes = {
|
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
/**
|
|
* The content of the component.
|
|
*/
|
|
children: import_prop_types5.default.node,
|
|
/**
|
|
* Override or extend the styles applied to the component.
|
|
*/
|
|
classes: import_prop_types5.default.object,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
className: import_prop_types5.default.string,
|
|
/**
|
|
* The component used for the root node.
|
|
* Either a string to use a HTML element or a component.
|
|
*/
|
|
component: import_prop_types5.default.elementType,
|
|
/**
|
|
* Shadow depth, corresponds to `dp` in the spec.
|
|
* It accepts values between 0 and 24 inclusive.
|
|
* @default 1
|
|
*/
|
|
elevation: chainPropTypes(integerPropType_default, (props) => {
|
|
const {
|
|
elevation,
|
|
variant
|
|
} = props;
|
|
if (elevation > 0 && variant === "outlined") {
|
|
return new Error(`MUI: Combining \`elevation={${elevation}}\` with \`variant="${variant}"\` has no effect. Either use \`elevation={0}\` or use a different \`variant\`.`);
|
|
}
|
|
return null;
|
|
}),
|
|
/**
|
|
* If `true`, rounded corners are disabled.
|
|
* @default false
|
|
*/
|
|
square: import_prop_types5.default.bool,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
style: import_prop_types5.default.object,
|
|
/**
|
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
*/
|
|
sx: import_prop_types5.default.oneOfType([import_prop_types5.default.arrayOf(import_prop_types5.default.oneOfType([import_prop_types5.default.func, import_prop_types5.default.object, import_prop_types5.default.bool])), import_prop_types5.default.func, import_prop_types5.default.object]),
|
|
/**
|
|
* The variant to use.
|
|
* @default 'elevation'
|
|
*/
|
|
variant: import_prop_types5.default.oneOfType([import_prop_types5.default.oneOf(["elevation", "outlined"]), import_prop_types5.default.string])
|
|
} : void 0;
|
|
var Paper_default = Paper;
|
|
|
|
// node_modules/@mui/material/esm/Alert/alertClasses.js
|
|
function getAlertUtilityClass(slot) {
|
|
return generateUtilityClass("MuiAlert", slot);
|
|
}
|
|
var alertClasses = generateUtilityClasses("MuiAlert", ["root", "action", "icon", "message", "filled", "colorSuccess", "colorInfo", "colorWarning", "colorError", "filledSuccess", "filledInfo", "filledWarning", "filledError", "outlined", "outlinedSuccess", "outlinedInfo", "outlinedWarning", "outlinedError", "standard", "standardSuccess", "standardInfo", "standardWarning", "standardError"]);
|
|
var alertClasses_default = alertClasses;
|
|
|
|
// node_modules/@mui/material/esm/IconButton/IconButton.js
|
|
var React34 = __toESM(require_react(), 1);
|
|
var import_prop_types16 = __toESM(require_prop_types(), 1);
|
|
|
|
// node_modules/@mui/material/esm/utils/createSvgIcon.js
|
|
var React22 = __toESM(require_react(), 1);
|
|
|
|
// node_modules/@mui/material/esm/SvgIcon/SvgIcon.js
|
|
var React21 = __toESM(require_react(), 1);
|
|
var import_prop_types6 = __toESM(require_prop_types(), 1);
|
|
|
|
// node_modules/@mui/material/esm/SvgIcon/svgIconClasses.js
|
|
function getSvgIconUtilityClass(slot) {
|
|
return generateUtilityClass("MuiSvgIcon", slot);
|
|
}
|
|
var svgIconClasses = generateUtilityClasses("MuiSvgIcon", ["root", "colorPrimary", "colorSecondary", "colorAction", "colorError", "colorDisabled", "fontSizeInherit", "fontSizeSmall", "fontSizeMedium", "fontSizeLarge"]);
|
|
|
|
// node_modules/@mui/material/esm/SvgIcon/SvgIcon.js
|
|
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
|
|
var useUtilityClasses2 = (ownerState) => {
|
|
const {
|
|
color: color2,
|
|
fontSize,
|
|
classes
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", color2 !== "inherit" && `color${capitalize_default(color2)}`, `fontSize${capitalize_default(fontSize)}`]
|
|
};
|
|
return composeClasses(slots, getSvgIconUtilityClass, classes);
|
|
};
|
|
var SvgIconRoot = styled_default("svg", {
|
|
name: "MuiSvgIcon",
|
|
slot: "Root",
|
|
overridesResolver: (props, styles) => {
|
|
const {
|
|
ownerState
|
|
} = props;
|
|
return [styles.root, ownerState.color !== "inherit" && styles[`color${capitalize_default(ownerState.color)}`], styles[`fontSize${capitalize_default(ownerState.fontSize)}`]];
|
|
}
|
|
})(memoTheme_default(({
|
|
theme
|
|
}) => {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
return {
|
|
userSelect: "none",
|
|
width: "1em",
|
|
height: "1em",
|
|
display: "inline-block",
|
|
flexShrink: 0,
|
|
transition: (_e = (_a = theme.transitions) == null ? void 0 : _a.create) == null ? void 0 : _e.call(_a, "fill", {
|
|
duration: (_d = (_c = ((_b = theme.vars) != null ? _b : theme).transitions) == null ? void 0 : _c.duration) == null ? void 0 : _d.shorter
|
|
}),
|
|
variants: [
|
|
{
|
|
props: (props) => !props.hasSvgAsChild,
|
|
style: {
|
|
// the <svg> will define the property that has `currentColor`
|
|
// for example heroicons uses fill="none" and stroke="currentColor"
|
|
fill: "currentColor"
|
|
}
|
|
},
|
|
{
|
|
props: {
|
|
fontSize: "inherit"
|
|
},
|
|
style: {
|
|
fontSize: "inherit"
|
|
}
|
|
},
|
|
{
|
|
props: {
|
|
fontSize: "small"
|
|
},
|
|
style: {
|
|
fontSize: ((_g = (_f = theme.typography) == null ? void 0 : _f.pxToRem) == null ? void 0 : _g.call(_f, 20)) || "1.25rem"
|
|
}
|
|
},
|
|
{
|
|
props: {
|
|
fontSize: "medium"
|
|
},
|
|
style: {
|
|
fontSize: ((_i = (_h = theme.typography) == null ? void 0 : _h.pxToRem) == null ? void 0 : _i.call(_h, 24)) || "1.5rem"
|
|
}
|
|
},
|
|
{
|
|
props: {
|
|
fontSize: "large"
|
|
},
|
|
style: {
|
|
fontSize: ((_k = (_j = theme.typography) == null ? void 0 : _j.pxToRem) == null ? void 0 : _k.call(_j, 35)) || "2.1875rem"
|
|
}
|
|
},
|
|
// TODO v5 deprecate color prop, v6 remove for sx
|
|
...Object.entries(((_l = theme.vars) != null ? _l : theme).palette).filter(([, value]) => value && value.main).map(([color2]) => {
|
|
var _a2, _b2, _c2;
|
|
return {
|
|
props: {
|
|
color: color2
|
|
},
|
|
style: {
|
|
color: (_c2 = (_b2 = ((_a2 = theme.vars) != null ? _a2 : theme).palette) == null ? void 0 : _b2[color2]) == null ? void 0 : _c2.main
|
|
}
|
|
};
|
|
}),
|
|
{
|
|
props: {
|
|
color: "action"
|
|
},
|
|
style: {
|
|
color: (_o = (_n = ((_m = theme.vars) != null ? _m : theme).palette) == null ? void 0 : _n.action) == null ? void 0 : _o.active
|
|
}
|
|
},
|
|
{
|
|
props: {
|
|
color: "disabled"
|
|
},
|
|
style: {
|
|
color: (_r = (_q = ((_p = theme.vars) != null ? _p : theme).palette) == null ? void 0 : _q.action) == null ? void 0 : _r.disabled
|
|
}
|
|
},
|
|
{
|
|
props: {
|
|
color: "inherit"
|
|
},
|
|
style: {
|
|
color: void 0
|
|
}
|
|
}
|
|
]
|
|
};
|
|
}));
|
|
var SvgIcon = /* @__PURE__ */ React21.forwardRef(function SvgIcon2(inProps, ref) {
|
|
const props = useDefaultProps2({
|
|
props: inProps,
|
|
name: "MuiSvgIcon"
|
|
});
|
|
const _a = props, {
|
|
children,
|
|
className,
|
|
color: color2 = "inherit",
|
|
component = "svg",
|
|
fontSize = "medium",
|
|
htmlColor,
|
|
inheritViewBox = false,
|
|
titleAccess,
|
|
viewBox = "0 0 24 24"
|
|
} = _a, other = __objRest(_a, [
|
|
"children",
|
|
"className",
|
|
"color",
|
|
"component",
|
|
"fontSize",
|
|
"htmlColor",
|
|
"inheritViewBox",
|
|
"titleAccess",
|
|
"viewBox"
|
|
]);
|
|
const hasSvgAsChild = /* @__PURE__ */ React21.isValidElement(children) && children.type === "svg";
|
|
const ownerState = __spreadProps(__spreadValues({}, props), {
|
|
color: color2,
|
|
component,
|
|
fontSize,
|
|
instanceFontSize: inProps.fontSize,
|
|
inheritViewBox,
|
|
viewBox,
|
|
hasSvgAsChild
|
|
});
|
|
const more = {};
|
|
if (!inheritViewBox) {
|
|
more.viewBox = viewBox;
|
|
}
|
|
const classes = useUtilityClasses2(ownerState);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(SvgIconRoot, __spreadProps(__spreadValues(__spreadValues(__spreadValues({
|
|
as: component,
|
|
className: clsx_default(classes.root, className),
|
|
focusable: "false",
|
|
color: htmlColor,
|
|
"aria-hidden": titleAccess ? void 0 : true,
|
|
role: titleAccess ? "img" : void 0,
|
|
ref
|
|
}, more), other), hasSvgAsChild && children.props), {
|
|
ownerState,
|
|
children: [hasSvgAsChild ? children.props.children : children, titleAccess ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("title", {
|
|
children: titleAccess
|
|
}) : null]
|
|
}));
|
|
});
|
|
true ? SvgIcon.propTypes = {
|
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
/**
|
|
* Node passed into the SVG element.
|
|
*/
|
|
children: import_prop_types6.default.node,
|
|
/**
|
|
* Override or extend the styles applied to the component.
|
|
*/
|
|
classes: import_prop_types6.default.object,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
className: import_prop_types6.default.string,
|
|
/**
|
|
* The color of the component.
|
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
* You can use the `htmlColor` prop to apply a color attribute to the SVG element.
|
|
* @default 'inherit'
|
|
*/
|
|
color: import_prop_types6.default.oneOfType([import_prop_types6.default.oneOf(["inherit", "action", "disabled", "primary", "secondary", "error", "info", "success", "warning"]), import_prop_types6.default.string]),
|
|
/**
|
|
* The component used for the root node.
|
|
* Either a string to use a HTML element or a component.
|
|
*/
|
|
component: import_prop_types6.default.elementType,
|
|
/**
|
|
* The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.
|
|
* @default 'medium'
|
|
*/
|
|
fontSize: import_prop_types6.default.oneOfType([import_prop_types6.default.oneOf(["inherit", "large", "medium", "small"]), import_prop_types6.default.string]),
|
|
/**
|
|
* Applies a color attribute to the SVG element.
|
|
*/
|
|
htmlColor: import_prop_types6.default.string,
|
|
/**
|
|
* If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox`
|
|
* prop will be ignored.
|
|
* Useful when you want to reference a custom `component` and have `SvgIcon` pass that
|
|
* `component`'s viewBox to the root node.
|
|
* @default false
|
|
*/
|
|
inheritViewBox: import_prop_types6.default.bool,
|
|
/**
|
|
* The shape-rendering attribute. The behavior of the different options is described on the
|
|
* [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/shape-rendering).
|
|
* If you are having issues with blurry icons you should investigate this prop.
|
|
*/
|
|
shapeRendering: import_prop_types6.default.string,
|
|
/**
|
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
*/
|
|
sx: import_prop_types6.default.oneOfType([import_prop_types6.default.arrayOf(import_prop_types6.default.oneOfType([import_prop_types6.default.func, import_prop_types6.default.object, import_prop_types6.default.bool])), import_prop_types6.default.func, import_prop_types6.default.object]),
|
|
/**
|
|
* Provides a human-readable title for the element that contains it.
|
|
* https://www.w3.org/TR/SVG-access/#Equivalent
|
|
*/
|
|
titleAccess: import_prop_types6.default.string,
|
|
/**
|
|
* Allows you to redefine what the coordinates without units mean inside an SVG element.
|
|
* For example, if the SVG element is 500 (width) by 200 (height),
|
|
* and you pass viewBox="0 0 50 20",
|
|
* this means that the coordinates inside the SVG will go from the top left corner (0,0)
|
|
* to bottom right (50,20) and each unit will be worth 10px.
|
|
* @default '0 0 24 24'
|
|
*/
|
|
viewBox: import_prop_types6.default.string
|
|
} : void 0;
|
|
SvgIcon.muiName = "SvgIcon";
|
|
var SvgIcon_default = SvgIcon;
|
|
|
|
// node_modules/@mui/material/esm/utils/createSvgIcon.js
|
|
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
|
|
function createSvgIcon(path, displayName) {
|
|
function Component(props, ref) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SvgIcon_default, __spreadProps(__spreadValues({
|
|
"data-testid": true ? `${displayName}Icon` : void 0,
|
|
ref
|
|
}, props), {
|
|
children: path
|
|
}));
|
|
}
|
|
if (true) {
|
|
Component.displayName = `${displayName}Icon`;
|
|
}
|
|
Component.muiName = SvgIcon_default.muiName;
|
|
return /* @__PURE__ */ React22.memo(/* @__PURE__ */ React22.forwardRef(Component));
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/utils/useId.js
|
|
var useId_default = useId;
|
|
|
|
// node_modules/@mui/utils/esm/unsupportedProp/unsupportedProp.js
|
|
function unsupportedProp(props, propName, componentName, location, propFullName) {
|
|
if (false) {
|
|
return null;
|
|
}
|
|
const propFullNameSafe = propFullName || propName;
|
|
if (typeof props[propName] !== "undefined") {
|
|
return new Error(`The prop \`${propFullNameSafe}\` is not supported. Please remove it.`);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/useControlled/useControlled.js
|
|
var React23 = __toESM(require_react(), 1);
|
|
function useControlled(props) {
|
|
const {
|
|
controlled,
|
|
default: defaultProp,
|
|
name,
|
|
state = "value"
|
|
} = props;
|
|
const {
|
|
current: isControlled
|
|
} = React23.useRef(controlled !== void 0);
|
|
const [valueState, setValue] = React23.useState(defaultProp);
|
|
const value = isControlled ? controlled : valueState;
|
|
if (true) {
|
|
React23.useEffect(() => {
|
|
if (isControlled !== (controlled !== void 0)) {
|
|
console.error([`MUI: A component is changing the ${isControlled ? "" : "un"}controlled ${state} state of ${name} to be ${isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${name} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join("\n"));
|
|
}
|
|
}, [state, name, controlled]);
|
|
const {
|
|
current: defaultValue
|
|
} = React23.useRef(defaultProp);
|
|
React23.useEffect(() => {
|
|
if (!isControlled && JSON.stringify(defaultProp) !== JSON.stringify(defaultValue)) {
|
|
console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. To suppress this warning opt to use a controlled ${name}.`].join("\n"));
|
|
}
|
|
}, [JSON.stringify(defaultProp)]);
|
|
}
|
|
const setValueIfUncontrolled = React23.useCallback((newValue) => {
|
|
if (!isControlled) {
|
|
setValue(newValue);
|
|
}
|
|
}, []);
|
|
return [value, setValueIfUncontrolled];
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/utils/useControlled.js
|
|
var useControlled_default = useControlled;
|
|
|
|
// node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
|
|
var React24 = __toESM(require_react(), 1);
|
|
function useEventCallback(fn) {
|
|
const ref = React24.useRef(fn);
|
|
useEnhancedEffect_default(() => {
|
|
ref.current = fn;
|
|
});
|
|
return React24.useRef((...args) => (
|
|
// @ts-expect-error hide `this`
|
|
(0, ref.current)(...args)
|
|
)).current;
|
|
}
|
|
var useEventCallback_default = useEventCallback;
|
|
|
|
// node_modules/@mui/material/esm/utils/useEventCallback.js
|
|
var useEventCallback_default2 = useEventCallback_default;
|
|
|
|
// node_modules/@mui/material/esm/utils/useForkRef.js
|
|
var useForkRef_default = useForkRef;
|
|
|
|
// node_modules/@mui/material/esm/utils/mergeSlotProps.js
|
|
function isEventHandler(key, value) {
|
|
const thirdCharCode = key.charCodeAt(2);
|
|
return key[0] === "o" && key[1] === "n" && thirdCharCode >= 65 && thirdCharCode <= 90 && typeof value === "function";
|
|
}
|
|
function mergeSlotProps2(externalSlotProps, defaultSlotProps) {
|
|
if (!externalSlotProps) {
|
|
return defaultSlotProps;
|
|
}
|
|
function extractHandlers(externalSlotPropsValue, defaultSlotPropsValue) {
|
|
const handlers2 = {};
|
|
Object.keys(defaultSlotPropsValue).forEach((key) => {
|
|
if (isEventHandler(key, defaultSlotPropsValue[key]) && typeof externalSlotPropsValue[key] === "function") {
|
|
handlers2[key] = (...args) => {
|
|
externalSlotPropsValue[key](...args);
|
|
defaultSlotPropsValue[key](...args);
|
|
};
|
|
}
|
|
});
|
|
return handlers2;
|
|
}
|
|
if (typeof externalSlotProps === "function" || typeof defaultSlotProps === "function") {
|
|
return (ownerState) => {
|
|
const defaultSlotPropsValue = typeof defaultSlotProps === "function" ? defaultSlotProps(ownerState) : defaultSlotProps;
|
|
const externalSlotPropsValue = typeof externalSlotProps === "function" ? externalSlotProps(__spreadValues(__spreadValues({}, ownerState), defaultSlotPropsValue)) : externalSlotProps;
|
|
const className2 = clsx_default(ownerState == null ? void 0 : ownerState.className, defaultSlotPropsValue == null ? void 0 : defaultSlotPropsValue.className, externalSlotPropsValue == null ? void 0 : externalSlotPropsValue.className);
|
|
const handlers2 = extractHandlers(externalSlotPropsValue, defaultSlotPropsValue);
|
|
return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, defaultSlotPropsValue), externalSlotPropsValue), handlers2), !!className2 && {
|
|
className: className2
|
|
}), (defaultSlotPropsValue == null ? void 0 : defaultSlotPropsValue.style) && (externalSlotPropsValue == null ? void 0 : externalSlotPropsValue.style) && {
|
|
style: __spreadValues(__spreadValues({}, defaultSlotPropsValue.style), externalSlotPropsValue.style)
|
|
}), (defaultSlotPropsValue == null ? void 0 : defaultSlotPropsValue.sx) && (externalSlotPropsValue == null ? void 0 : externalSlotPropsValue.sx) && {
|
|
sx: [...Array.isArray(defaultSlotPropsValue.sx) ? defaultSlotPropsValue.sx : [defaultSlotPropsValue.sx], ...Array.isArray(externalSlotPropsValue.sx) ? externalSlotPropsValue.sx : [externalSlotPropsValue.sx]]
|
|
});
|
|
};
|
|
}
|
|
const typedDefaultSlotProps = defaultSlotProps;
|
|
const handlers = extractHandlers(externalSlotProps, typedDefaultSlotProps);
|
|
const className = clsx_default(typedDefaultSlotProps == null ? void 0 : typedDefaultSlotProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);
|
|
return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, defaultSlotProps), externalSlotProps), handlers), !!className && {
|
|
className
|
|
}), (typedDefaultSlotProps == null ? void 0 : typedDefaultSlotProps.style) && (externalSlotProps == null ? void 0 : externalSlotProps.style) && {
|
|
style: __spreadValues(__spreadValues({}, typedDefaultSlotProps.style), externalSlotProps.style)
|
|
}), (typedDefaultSlotProps == null ? void 0 : typedDefaultSlotProps.sx) && (externalSlotProps == null ? void 0 : externalSlotProps.sx) && {
|
|
sx: [...Array.isArray(typedDefaultSlotProps.sx) ? typedDefaultSlotProps.sx : [typedDefaultSlotProps.sx], ...Array.isArray(externalSlotProps.sx) ? externalSlotProps.sx : [externalSlotProps.sx]]
|
|
});
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/ButtonBase/ButtonBase.js
|
|
var React32 = __toESM(require_react(), 1);
|
|
var import_prop_types14 = __toESM(require_prop_types(), 1);
|
|
|
|
// node_modules/@mui/utils/esm/refType/refType.js
|
|
var import_prop_types7 = __toESM(require_prop_types(), 1);
|
|
var refType = import_prop_types7.default.oneOfType([import_prop_types7.default.func, import_prop_types7.default.object]);
|
|
var refType_default = refType;
|
|
|
|
// node_modules/@mui/utils/esm/elementTypeAcceptingRef/elementTypeAcceptingRef.js
|
|
var import_prop_types8 = __toESM(require_prop_types(), 1);
|
|
var React25 = __toESM(require_react(), 1);
|
|
function isClassComponent(elementType) {
|
|
const {
|
|
prototype = {}
|
|
} = elementType;
|
|
return Boolean(prototype.isReactComponent);
|
|
}
|
|
function elementTypeAcceptingRef(props, propName, componentName, location, propFullName) {
|
|
const propValue = props[propName];
|
|
const safePropName = propFullName || propName;
|
|
if (propValue == null || // When server-side rendering React doesn't warn either.
|
|
// This is not an accurate check for SSR.
|
|
// This is only in place for emotion compat.
|
|
// TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
|
|
typeof window === "undefined") {
|
|
return null;
|
|
}
|
|
let warningHint;
|
|
if (typeof propValue === "function" && !isClassComponent(propValue)) {
|
|
warningHint = "Did you accidentally provide a plain function component instead?";
|
|
}
|
|
if (propValue === React25.Fragment) {
|
|
warningHint = "Did you accidentally provide a React.Fragment instead?";
|
|
}
|
|
if (warningHint !== void 0) {
|
|
return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. Expected an element type that can hold a ref. ${warningHint} For more information see https://v7.mui.com/r/caveat-with-refs-guide`);
|
|
}
|
|
return null;
|
|
}
|
|
var elementTypeAcceptingRef_default = chainPropTypes(import_prop_types8.default.elementType, elementTypeAcceptingRef);
|
|
|
|
// node_modules/@mui/utils/esm/isFocusVisible/isFocusVisible.js
|
|
function isFocusVisible(element) {
|
|
try {
|
|
return element.matches(":focus-visible");
|
|
} catch (error) {
|
|
if (!window.navigator.userAgent.includes("jsdom")) {
|
|
console.warn(["MUI: The `:focus-visible` pseudo class is not supported in this browser.", "Some components rely on this feature to work properly."].join("\n"));
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/useLazyRipple/useLazyRipple.js
|
|
var React26 = __toESM(require_react(), 1);
|
|
var LazyRipple = class _LazyRipple {
|
|
constructor() {
|
|
__publicField(this, "mountEffect", () => {
|
|
if (this.shouldMount && !this.didMount) {
|
|
if (this.ref.current !== null) {
|
|
this.didMount = true;
|
|
this.mounted.resolve();
|
|
}
|
|
}
|
|
});
|
|
this.ref = {
|
|
current: null
|
|
};
|
|
this.mounted = null;
|
|
this.didMount = false;
|
|
this.shouldMount = false;
|
|
this.setShouldMount = null;
|
|
}
|
|
/** React ref to the ripple instance */
|
|
/** If the ripple component should be mounted */
|
|
/** Promise that resolves when the ripple component is mounted */
|
|
/** If the ripple component has been mounted */
|
|
/** React state hook setter */
|
|
static create() {
|
|
return new _LazyRipple();
|
|
}
|
|
static use() {
|
|
const ripple = useLazyRef(_LazyRipple.create).current;
|
|
const [shouldMount, setShouldMount] = React26.useState(false);
|
|
ripple.shouldMount = shouldMount;
|
|
ripple.setShouldMount = setShouldMount;
|
|
React26.useEffect(ripple.mountEffect, [shouldMount]);
|
|
return ripple;
|
|
}
|
|
mount() {
|
|
if (!this.mounted) {
|
|
this.mounted = createControlledPromise();
|
|
this.shouldMount = true;
|
|
this.setShouldMount(this.shouldMount);
|
|
}
|
|
return this.mounted;
|
|
}
|
|
/* Ripple API */
|
|
start(...args) {
|
|
this.mount().then(() => {
|
|
var _a;
|
|
return (_a = this.ref.current) == null ? void 0 : _a.start(...args);
|
|
});
|
|
}
|
|
stop(...args) {
|
|
this.mount().then(() => {
|
|
var _a;
|
|
return (_a = this.ref.current) == null ? void 0 : _a.stop(...args);
|
|
});
|
|
}
|
|
pulsate(...args) {
|
|
this.mount().then(() => {
|
|
var _a;
|
|
return (_a = this.ref.current) == null ? void 0 : _a.pulsate(...args);
|
|
});
|
|
}
|
|
};
|
|
function useLazyRipple() {
|
|
return LazyRipple.use();
|
|
}
|
|
function createControlledPromise() {
|
|
let resolve;
|
|
let reject;
|
|
const p = new Promise((resolveFn, rejectFn) => {
|
|
resolve = resolveFn;
|
|
reject = rejectFn;
|
|
});
|
|
p.resolve = resolve;
|
|
p.reject = reject;
|
|
return p;
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/ButtonBase/TouchRipple.js
|
|
var React31 = __toESM(require_react(), 1);
|
|
var import_prop_types13 = __toESM(require_prop_types(), 1);
|
|
|
|
// node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
|
function _objectWithoutPropertiesLoose(r2, e) {
|
|
if (null == r2) return {};
|
|
var t = {};
|
|
for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) {
|
|
if (-1 !== e.indexOf(n)) continue;
|
|
t[n] = r2[n];
|
|
}
|
|
return t;
|
|
}
|
|
|
|
// node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
|
|
function _setPrototypeOf(t, e) {
|
|
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
|
|
return t2.__proto__ = e2, t2;
|
|
}, _setPrototypeOf(t, e);
|
|
}
|
|
|
|
// node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
|
function _inheritsLoose(t, o) {
|
|
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
}
|
|
|
|
// node_modules/react-transition-group/esm/Transition.js
|
|
var import_prop_types10 = __toESM(require_prop_types());
|
|
var import_react6 = __toESM(require_react());
|
|
var import_react_dom = __toESM(require_react_dom());
|
|
|
|
// node_modules/react-transition-group/esm/config.js
|
|
var config_default = {
|
|
disabled: false
|
|
};
|
|
|
|
// node_modules/react-transition-group/esm/utils/PropTypes.js
|
|
var import_prop_types9 = __toESM(require_prop_types());
|
|
var timeoutsShape = true ? import_prop_types9.default.oneOfType([import_prop_types9.default.number, import_prop_types9.default.shape({
|
|
enter: import_prop_types9.default.number,
|
|
exit: import_prop_types9.default.number,
|
|
appear: import_prop_types9.default.number
|
|
}).isRequired]) : null;
|
|
var classNamesShape = true ? import_prop_types9.default.oneOfType([import_prop_types9.default.string, import_prop_types9.default.shape({
|
|
enter: import_prop_types9.default.string,
|
|
exit: import_prop_types9.default.string,
|
|
active: import_prop_types9.default.string
|
|
}), import_prop_types9.default.shape({
|
|
enter: import_prop_types9.default.string,
|
|
enterDone: import_prop_types9.default.string,
|
|
enterActive: import_prop_types9.default.string,
|
|
exit: import_prop_types9.default.string,
|
|
exitDone: import_prop_types9.default.string,
|
|
exitActive: import_prop_types9.default.string
|
|
})]) : null;
|
|
|
|
// node_modules/react-transition-group/esm/TransitionGroupContext.js
|
|
var import_react5 = __toESM(require_react());
|
|
var TransitionGroupContext_default = import_react5.default.createContext(null);
|
|
|
|
// node_modules/react-transition-group/esm/utils/reflow.js
|
|
var forceReflow = function forceReflow2(node2) {
|
|
return node2.scrollTop;
|
|
};
|
|
|
|
// node_modules/react-transition-group/esm/Transition.js
|
|
var UNMOUNTED = "unmounted";
|
|
var EXITED = "exited";
|
|
var ENTERING = "entering";
|
|
var ENTERED = "entered";
|
|
var EXITING = "exiting";
|
|
var Transition = /* @__PURE__ */ (function(_React$Component) {
|
|
_inheritsLoose(Transition2, _React$Component);
|
|
function Transition2(props, context) {
|
|
var _this;
|
|
_this = _React$Component.call(this, props, context) || this;
|
|
var parentGroup = context;
|
|
var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
|
|
var initialStatus;
|
|
_this.appearStatus = null;
|
|
if (props.in) {
|
|
if (appear) {
|
|
initialStatus = EXITED;
|
|
_this.appearStatus = ENTERING;
|
|
} else {
|
|
initialStatus = ENTERED;
|
|
}
|
|
} else {
|
|
if (props.unmountOnExit || props.mountOnEnter) {
|
|
initialStatus = UNMOUNTED;
|
|
} else {
|
|
initialStatus = EXITED;
|
|
}
|
|
}
|
|
_this.state = {
|
|
status: initialStatus
|
|
};
|
|
_this.nextCallback = null;
|
|
return _this;
|
|
}
|
|
Transition2.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
|
|
var nextIn = _ref.in;
|
|
if (nextIn && prevState.status === UNMOUNTED) {
|
|
return {
|
|
status: EXITED
|
|
};
|
|
}
|
|
return null;
|
|
};
|
|
var _proto = Transition2.prototype;
|
|
_proto.componentDidMount = function componentDidMount() {
|
|
this.updateStatus(true, this.appearStatus);
|
|
};
|
|
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
|
var nextStatus = null;
|
|
if (prevProps !== this.props) {
|
|
var status = this.state.status;
|
|
if (this.props.in) {
|
|
if (status !== ENTERING && status !== ENTERED) {
|
|
nextStatus = ENTERING;
|
|
}
|
|
} else {
|
|
if (status === ENTERING || status === ENTERED) {
|
|
nextStatus = EXITING;
|
|
}
|
|
}
|
|
}
|
|
this.updateStatus(false, nextStatus);
|
|
};
|
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
this.cancelNextCallback();
|
|
};
|
|
_proto.getTimeouts = function getTimeouts() {
|
|
var timeout2 = this.props.timeout;
|
|
var exit, enter, appear;
|
|
exit = enter = appear = timeout2;
|
|
if (timeout2 != null && typeof timeout2 !== "number") {
|
|
exit = timeout2.exit;
|
|
enter = timeout2.enter;
|
|
appear = timeout2.appear !== void 0 ? timeout2.appear : enter;
|
|
}
|
|
return {
|
|
exit,
|
|
enter,
|
|
appear
|
|
};
|
|
};
|
|
_proto.updateStatus = function updateStatus(mounting, nextStatus) {
|
|
if (mounting === void 0) {
|
|
mounting = false;
|
|
}
|
|
if (nextStatus !== null) {
|
|
this.cancelNextCallback();
|
|
if (nextStatus === ENTERING) {
|
|
if (this.props.unmountOnExit || this.props.mountOnEnter) {
|
|
var node2 = this.props.nodeRef ? this.props.nodeRef.current : import_react_dom.default.findDOMNode(this);
|
|
if (node2) forceReflow(node2);
|
|
}
|
|
this.performEnter(mounting);
|
|
} else {
|
|
this.performExit();
|
|
}
|
|
} else if (this.props.unmountOnExit && this.state.status === EXITED) {
|
|
this.setState({
|
|
status: UNMOUNTED
|
|
});
|
|
}
|
|
};
|
|
_proto.performEnter = function performEnter(mounting) {
|
|
var _this2 = this;
|
|
var enter = this.props.enter;
|
|
var appearing = this.context ? this.context.isMounting : mounting;
|
|
var _ref2 = this.props.nodeRef ? [appearing] : [import_react_dom.default.findDOMNode(this), appearing], maybeNode = _ref2[0], maybeAppearing = _ref2[1];
|
|
var timeouts = this.getTimeouts();
|
|
var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
|
|
if (!mounting && !enter || config_default.disabled) {
|
|
this.safeSetState({
|
|
status: ENTERED
|
|
}, function() {
|
|
_this2.props.onEntered(maybeNode);
|
|
});
|
|
return;
|
|
}
|
|
this.props.onEnter(maybeNode, maybeAppearing);
|
|
this.safeSetState({
|
|
status: ENTERING
|
|
}, function() {
|
|
_this2.props.onEntering(maybeNode, maybeAppearing);
|
|
_this2.onTransitionEnd(enterTimeout, function() {
|
|
_this2.safeSetState({
|
|
status: ENTERED
|
|
}, function() {
|
|
_this2.props.onEntered(maybeNode, maybeAppearing);
|
|
});
|
|
});
|
|
});
|
|
};
|
|
_proto.performExit = function performExit() {
|
|
var _this3 = this;
|
|
var exit = this.props.exit;
|
|
var timeouts = this.getTimeouts();
|
|
var maybeNode = this.props.nodeRef ? void 0 : import_react_dom.default.findDOMNode(this);
|
|
if (!exit || config_default.disabled) {
|
|
this.safeSetState({
|
|
status: EXITED
|
|
}, function() {
|
|
_this3.props.onExited(maybeNode);
|
|
});
|
|
return;
|
|
}
|
|
this.props.onExit(maybeNode);
|
|
this.safeSetState({
|
|
status: EXITING
|
|
}, function() {
|
|
_this3.props.onExiting(maybeNode);
|
|
_this3.onTransitionEnd(timeouts.exit, function() {
|
|
_this3.safeSetState({
|
|
status: EXITED
|
|
}, function() {
|
|
_this3.props.onExited(maybeNode);
|
|
});
|
|
});
|
|
});
|
|
};
|
|
_proto.cancelNextCallback = function cancelNextCallback() {
|
|
if (this.nextCallback !== null) {
|
|
this.nextCallback.cancel();
|
|
this.nextCallback = null;
|
|
}
|
|
};
|
|
_proto.safeSetState = function safeSetState(nextState, callback) {
|
|
callback = this.setNextCallback(callback);
|
|
this.setState(nextState, callback);
|
|
};
|
|
_proto.setNextCallback = function setNextCallback(callback) {
|
|
var _this4 = this;
|
|
var active = true;
|
|
this.nextCallback = function(event) {
|
|
if (active) {
|
|
active = false;
|
|
_this4.nextCallback = null;
|
|
callback(event);
|
|
}
|
|
};
|
|
this.nextCallback.cancel = function() {
|
|
active = false;
|
|
};
|
|
return this.nextCallback;
|
|
};
|
|
_proto.onTransitionEnd = function onTransitionEnd(timeout2, handler) {
|
|
this.setNextCallback(handler);
|
|
var node2 = this.props.nodeRef ? this.props.nodeRef.current : import_react_dom.default.findDOMNode(this);
|
|
var doesNotHaveTimeoutOrListener = timeout2 == null && !this.props.addEndListener;
|
|
if (!node2 || doesNotHaveTimeoutOrListener) {
|
|
setTimeout(this.nextCallback, 0);
|
|
return;
|
|
}
|
|
if (this.props.addEndListener) {
|
|
var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node2, this.nextCallback], maybeNode = _ref3[0], maybeNextCallback = _ref3[1];
|
|
this.props.addEndListener(maybeNode, maybeNextCallback);
|
|
}
|
|
if (timeout2 != null) {
|
|
setTimeout(this.nextCallback, timeout2);
|
|
}
|
|
};
|
|
_proto.render = function render() {
|
|
var status = this.state.status;
|
|
if (status === UNMOUNTED) {
|
|
return null;
|
|
}
|
|
var _this$props = this.props, children = _this$props.children, _in = _this$props.in, _mountOnEnter = _this$props.mountOnEnter, _unmountOnExit = _this$props.unmountOnExit, _appear = _this$props.appear, _enter = _this$props.enter, _exit = _this$props.exit, _timeout = _this$props.timeout, _addEndListener = _this$props.addEndListener, _onEnter = _this$props.onEnter, _onEntering = _this$props.onEntering, _onEntered = _this$props.onEntered, _onExit = _this$props.onExit, _onExiting = _this$props.onExiting, _onExited = _this$props.onExited, _nodeRef = _this$props.nodeRef, childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
|
|
return (
|
|
// allows for nested Transitions
|
|
/* @__PURE__ */ import_react6.default.createElement(TransitionGroupContext_default.Provider, {
|
|
value: null
|
|
}, typeof children === "function" ? children(status, childProps) : import_react6.default.cloneElement(import_react6.default.Children.only(children), childProps))
|
|
);
|
|
};
|
|
return Transition2;
|
|
})(import_react6.default.Component);
|
|
Transition.contextType = TransitionGroupContext_default;
|
|
Transition.propTypes = true ? {
|
|
/**
|
|
* A React reference to DOM element that need to transition:
|
|
* https://stackoverflow.com/a/51127130/4671932
|
|
*
|
|
* - When `nodeRef` prop is used, `node` is not passed to callback functions
|
|
* (e.g. `onEnter`) because user already has direct access to the node.
|
|
* - When changing `key` prop of `Transition` in a `TransitionGroup` a new
|
|
* `nodeRef` need to be provided to `Transition` with changed `key` prop
|
|
* (see
|
|
* [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
|
|
*/
|
|
nodeRef: import_prop_types10.default.shape({
|
|
current: typeof Element === "undefined" ? import_prop_types10.default.any : function(propValue, key, componentName, location, propFullName, secret) {
|
|
var value = propValue[key];
|
|
return import_prop_types10.default.instanceOf(value && "ownerDocument" in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);
|
|
}
|
|
}),
|
|
/**
|
|
* A `function` child can be used instead of a React element. This function is
|
|
* called with the current transition status (`'entering'`, `'entered'`,
|
|
* `'exiting'`, `'exited'`), which can be used to apply context
|
|
* specific props to a component.
|
|
*
|
|
* ```jsx
|
|
* <Transition in={this.state.in} timeout={150}>
|
|
* {state => (
|
|
* <MyComponent className={`fade fade-${state}`} />
|
|
* )}
|
|
* </Transition>
|
|
* ```
|
|
*/
|
|
children: import_prop_types10.default.oneOfType([import_prop_types10.default.func.isRequired, import_prop_types10.default.element.isRequired]).isRequired,
|
|
/**
|
|
* Show the component; triggers the enter or exit states
|
|
*/
|
|
in: import_prop_types10.default.bool,
|
|
/**
|
|
* By default the child component is mounted immediately along with
|
|
* the parent `Transition` component. If you want to "lazy mount" the component on the
|
|
* first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
|
|
* mounted, even on "exited", unless you also specify `unmountOnExit`.
|
|
*/
|
|
mountOnEnter: import_prop_types10.default.bool,
|
|
/**
|
|
* By default the child component stays mounted after it reaches the `'exited'` state.
|
|
* Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
|
|
*/
|
|
unmountOnExit: import_prop_types10.default.bool,
|
|
/**
|
|
* By default the child component does not perform the enter transition when
|
|
* it first mounts, regardless of the value of `in`. If you want this
|
|
* behavior, set both `appear` and `in` to `true`.
|
|
*
|
|
* > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
|
|
* > only adds an additional enter transition. However, in the
|
|
* > `<CSSTransition>` component that first enter transition does result in
|
|
* > additional `.appear-*` classes, that way you can choose to style it
|
|
* > differently.
|
|
*/
|
|
appear: import_prop_types10.default.bool,
|
|
/**
|
|
* Enable or disable enter transitions.
|
|
*/
|
|
enter: import_prop_types10.default.bool,
|
|
/**
|
|
* Enable or disable exit transitions.
|
|
*/
|
|
exit: import_prop_types10.default.bool,
|
|
/**
|
|
* The duration of the transition, in milliseconds.
|
|
* Required unless `addEndListener` is provided.
|
|
*
|
|
* You may specify a single timeout for all transitions:
|
|
*
|
|
* ```jsx
|
|
* timeout={500}
|
|
* ```
|
|
*
|
|
* or individually:
|
|
*
|
|
* ```jsx
|
|
* timeout={{
|
|
* appear: 500,
|
|
* enter: 300,
|
|
* exit: 500,
|
|
* }}
|
|
* ```
|
|
*
|
|
* - `appear` defaults to the value of `enter`
|
|
* - `enter` defaults to `0`
|
|
* - `exit` defaults to `0`
|
|
*
|
|
* @type {number | { enter?: number, exit?: number, appear?: number }}
|
|
*/
|
|
timeout: function timeout(props) {
|
|
var pt = timeoutsShape;
|
|
if (!props.addEndListener) pt = pt.isRequired;
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
args[_key - 1] = arguments[_key];
|
|
}
|
|
return pt.apply(void 0, [props].concat(args));
|
|
},
|
|
/**
|
|
* Add a custom transition end trigger. Called with the transitioning
|
|
* DOM node and a `done` callback. Allows for more fine grained transition end
|
|
* logic. Timeouts are still used as a fallback if provided.
|
|
*
|
|
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
|
|
*
|
|
* ```jsx
|
|
* addEndListener={(node, done) => {
|
|
* // use the css transitionend event to mark the finish of a transition
|
|
* node.addEventListener('transitionend', done, false);
|
|
* }}
|
|
* ```
|
|
*/
|
|
addEndListener: import_prop_types10.default.func,
|
|
/**
|
|
* Callback fired before the "entering" status is applied. An extra parameter
|
|
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
|
|
*
|
|
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
|
|
*
|
|
* @type Function(node: HtmlElement, isAppearing: bool) -> void
|
|
*/
|
|
onEnter: import_prop_types10.default.func,
|
|
/**
|
|
* Callback fired after the "entering" status is applied. An extra parameter
|
|
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
|
|
*
|
|
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
|
|
*
|
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
*/
|
|
onEntering: import_prop_types10.default.func,
|
|
/**
|
|
* Callback fired after the "entered" status is applied. An extra parameter
|
|
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
|
|
*
|
|
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
|
|
*
|
|
* @type Function(node: HtmlElement, isAppearing: bool) -> void
|
|
*/
|
|
onEntered: import_prop_types10.default.func,
|
|
/**
|
|
* Callback fired before the "exiting" status is applied.
|
|
*
|
|
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
|
|
*
|
|
* @type Function(node: HtmlElement) -> void
|
|
*/
|
|
onExit: import_prop_types10.default.func,
|
|
/**
|
|
* Callback fired after the "exiting" status is applied.
|
|
*
|
|
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
|
|
*
|
|
* @type Function(node: HtmlElement) -> void
|
|
*/
|
|
onExiting: import_prop_types10.default.func,
|
|
/**
|
|
* Callback fired after the "exited" status is applied.
|
|
*
|
|
* **Note**: when `nodeRef` prop is passed, `node` is not passed
|
|
*
|
|
* @type Function(node: HtmlElement) -> void
|
|
*/
|
|
onExited: import_prop_types10.default.func
|
|
} : {};
|
|
function noop() {
|
|
}
|
|
Transition.defaultProps = {
|
|
in: false,
|
|
mountOnEnter: false,
|
|
unmountOnExit: false,
|
|
appear: false,
|
|
enter: true,
|
|
exit: true,
|
|
onEnter: noop,
|
|
onEntering: noop,
|
|
onEntered: noop,
|
|
onExit: noop,
|
|
onExiting: noop,
|
|
onExited: noop
|
|
};
|
|
Transition.UNMOUNTED = UNMOUNTED;
|
|
Transition.EXITED = EXITED;
|
|
Transition.ENTERING = ENTERING;
|
|
Transition.ENTERED = ENTERED;
|
|
Transition.EXITING = EXITING;
|
|
var Transition_default = Transition;
|
|
|
|
// node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
|
function _assertThisInitialized(e) {
|
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
return e;
|
|
}
|
|
|
|
// node_modules/react-transition-group/esm/TransitionGroup.js
|
|
var import_prop_types11 = __toESM(require_prop_types());
|
|
var import_react8 = __toESM(require_react());
|
|
|
|
// node_modules/react-transition-group/esm/utils/ChildMapping.js
|
|
var import_react7 = __toESM(require_react());
|
|
function getChildMapping(children, mapFn) {
|
|
var mapper = function mapper2(child) {
|
|
return mapFn && (0, import_react7.isValidElement)(child) ? mapFn(child) : child;
|
|
};
|
|
var result = /* @__PURE__ */ Object.create(null);
|
|
if (children) import_react7.Children.map(children, function(c) {
|
|
return c;
|
|
}).forEach(function(child) {
|
|
result[child.key] = mapper(child);
|
|
});
|
|
return result;
|
|
}
|
|
function mergeChildMappings(prev2, next2) {
|
|
prev2 = prev2 || {};
|
|
next2 = next2 || {};
|
|
function getValueForKey(key) {
|
|
return key in next2 ? next2[key] : prev2[key];
|
|
}
|
|
var nextKeysPending = /* @__PURE__ */ Object.create(null);
|
|
var pendingKeys = [];
|
|
for (var prevKey in prev2) {
|
|
if (prevKey in next2) {
|
|
if (pendingKeys.length) {
|
|
nextKeysPending[prevKey] = pendingKeys;
|
|
pendingKeys = [];
|
|
}
|
|
} else {
|
|
pendingKeys.push(prevKey);
|
|
}
|
|
}
|
|
var i;
|
|
var childMapping = {};
|
|
for (var nextKey in next2) {
|
|
if (nextKeysPending[nextKey]) {
|
|
for (i = 0; i < nextKeysPending[nextKey].length; i++) {
|
|
var pendingNextKey = nextKeysPending[nextKey][i];
|
|
childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
|
|
}
|
|
}
|
|
childMapping[nextKey] = getValueForKey(nextKey);
|
|
}
|
|
for (i = 0; i < pendingKeys.length; i++) {
|
|
childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
|
|
}
|
|
return childMapping;
|
|
}
|
|
function getProp(child, prop, props) {
|
|
return props[prop] != null ? props[prop] : child.props[prop];
|
|
}
|
|
function getInitialChildMapping(props, onExited) {
|
|
return getChildMapping(props.children, function(child) {
|
|
return (0, import_react7.cloneElement)(child, {
|
|
onExited: onExited.bind(null, child),
|
|
in: true,
|
|
appear: getProp(child, "appear", props),
|
|
enter: getProp(child, "enter", props),
|
|
exit: getProp(child, "exit", props)
|
|
});
|
|
});
|
|
}
|
|
function getNextChildMapping(nextProps, prevChildMapping, onExited) {
|
|
var nextChildMapping = getChildMapping(nextProps.children);
|
|
var children = mergeChildMappings(prevChildMapping, nextChildMapping);
|
|
Object.keys(children).forEach(function(key) {
|
|
var child = children[key];
|
|
if (!(0, import_react7.isValidElement)(child)) return;
|
|
var hasPrev = key in prevChildMapping;
|
|
var hasNext = key in nextChildMapping;
|
|
var prevChild = prevChildMapping[key];
|
|
var isLeaving = (0, import_react7.isValidElement)(prevChild) && !prevChild.props.in;
|
|
if (hasNext && (!hasPrev || isLeaving)) {
|
|
children[key] = (0, import_react7.cloneElement)(child, {
|
|
onExited: onExited.bind(null, child),
|
|
in: true,
|
|
exit: getProp(child, "exit", nextProps),
|
|
enter: getProp(child, "enter", nextProps)
|
|
});
|
|
} else if (!hasNext && hasPrev && !isLeaving) {
|
|
children[key] = (0, import_react7.cloneElement)(child, {
|
|
in: false
|
|
});
|
|
} else if (hasNext && hasPrev && (0, import_react7.isValidElement)(prevChild)) {
|
|
children[key] = (0, import_react7.cloneElement)(child, {
|
|
onExited: onExited.bind(null, child),
|
|
in: prevChild.props.in,
|
|
exit: getProp(child, "exit", nextProps),
|
|
enter: getProp(child, "enter", nextProps)
|
|
});
|
|
}
|
|
});
|
|
return children;
|
|
}
|
|
|
|
// node_modules/react-transition-group/esm/TransitionGroup.js
|
|
var values2 = Object.values || function(obj) {
|
|
return Object.keys(obj).map(function(k) {
|
|
return obj[k];
|
|
});
|
|
};
|
|
var defaultProps = {
|
|
component: "div",
|
|
childFactory: function childFactory(child) {
|
|
return child;
|
|
}
|
|
};
|
|
var TransitionGroup = /* @__PURE__ */ (function(_React$Component) {
|
|
_inheritsLoose(TransitionGroup2, _React$Component);
|
|
function TransitionGroup2(props, context) {
|
|
var _this;
|
|
_this = _React$Component.call(this, props, context) || this;
|
|
var handleExited = _this.handleExited.bind(_assertThisInitialized(_this));
|
|
_this.state = {
|
|
contextValue: {
|
|
isMounting: true
|
|
},
|
|
handleExited,
|
|
firstRender: true
|
|
};
|
|
return _this;
|
|
}
|
|
var _proto = TransitionGroup2.prototype;
|
|
_proto.componentDidMount = function componentDidMount() {
|
|
this.mounted = true;
|
|
this.setState({
|
|
contextValue: {
|
|
isMounting: false
|
|
}
|
|
});
|
|
};
|
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
this.mounted = false;
|
|
};
|
|
TransitionGroup2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
|
|
var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender;
|
|
return {
|
|
children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
|
|
firstRender: false
|
|
};
|
|
};
|
|
_proto.handleExited = function handleExited(child, node2) {
|
|
var currentChildMapping = getChildMapping(this.props.children);
|
|
if (child.key in currentChildMapping) return;
|
|
if (child.props.onExited) {
|
|
child.props.onExited(node2);
|
|
}
|
|
if (this.mounted) {
|
|
this.setState(function(state) {
|
|
var children = _extends({}, state.children);
|
|
delete children[child.key];
|
|
return {
|
|
children
|
|
};
|
|
});
|
|
}
|
|
};
|
|
_proto.render = function render() {
|
|
var _this$props = this.props, Component = _this$props.component, childFactory2 = _this$props.childFactory, props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
|
|
var contextValue = this.state.contextValue;
|
|
var children = values2(this.state.children).map(childFactory2);
|
|
delete props.appear;
|
|
delete props.enter;
|
|
delete props.exit;
|
|
if (Component === null) {
|
|
return /* @__PURE__ */ import_react8.default.createElement(TransitionGroupContext_default.Provider, {
|
|
value: contextValue
|
|
}, children);
|
|
}
|
|
return /* @__PURE__ */ import_react8.default.createElement(TransitionGroupContext_default.Provider, {
|
|
value: contextValue
|
|
}, /* @__PURE__ */ import_react8.default.createElement(Component, props, children));
|
|
};
|
|
return TransitionGroup2;
|
|
})(import_react8.default.Component);
|
|
TransitionGroup.propTypes = true ? {
|
|
/**
|
|
* `<TransitionGroup>` renders a `<div>` by default. You can change this
|
|
* behavior by providing a `component` prop.
|
|
* If you use React v16+ and would like to avoid a wrapping `<div>` element
|
|
* you can pass in `component={null}`. This is useful if the wrapping div
|
|
* borks your css styles.
|
|
*/
|
|
component: import_prop_types11.default.any,
|
|
/**
|
|
* A set of `<Transition>` components, that are toggled `in` and out as they
|
|
* leave. the `<TransitionGroup>` will inject specific transition props, so
|
|
* remember to spread them through if you are wrapping the `<Transition>` as
|
|
* with our `<Fade>` example.
|
|
*
|
|
* While this component is meant for multiple `Transition` or `CSSTransition`
|
|
* children, sometimes you may want to have a single transition child with
|
|
* content that you want to be transitioned out and in when you change it
|
|
* (e.g. routes, images etc.) In that case you can change the `key` prop of
|
|
* the transition child as you change its content, this will cause
|
|
* `TransitionGroup` to transition the child out and back in.
|
|
*/
|
|
children: import_prop_types11.default.node,
|
|
/**
|
|
* A convenience prop that enables or disables appear animations
|
|
* for all children. Note that specifying this will override any defaults set
|
|
* on individual children Transitions.
|
|
*/
|
|
appear: import_prop_types11.default.bool,
|
|
/**
|
|
* A convenience prop that enables or disables enter animations
|
|
* for all children. Note that specifying this will override any defaults set
|
|
* on individual children Transitions.
|
|
*/
|
|
enter: import_prop_types11.default.bool,
|
|
/**
|
|
* A convenience prop that enables or disables exit animations
|
|
* for all children. Note that specifying this will override any defaults set
|
|
* on individual children Transitions.
|
|
*/
|
|
exit: import_prop_types11.default.bool,
|
|
/**
|
|
* You may need to apply reactive updates to a child as it is exiting.
|
|
* This is generally done by using `cloneElement` however in the case of an exiting
|
|
* child the element has already been removed and not accessible to the consumer.
|
|
*
|
|
* If you do need to update a child as it leaves you can provide a `childFactory`
|
|
* to wrap every child, even the ones that are leaving.
|
|
*
|
|
* @type Function(child: ReactElement) -> ReactElement
|
|
*/
|
|
childFactory: import_prop_types11.default.func
|
|
} : {};
|
|
TransitionGroup.defaultProps = defaultProps;
|
|
var TransitionGroup_default = TransitionGroup;
|
|
|
|
// node_modules/@mui/utils/esm/useTimeout/useTimeout.js
|
|
var Timeout = class _Timeout {
|
|
constructor() {
|
|
__publicField(this, "currentId", null);
|
|
__publicField(this, "clear", () => {
|
|
if (this.currentId !== null) {
|
|
clearTimeout(this.currentId);
|
|
this.currentId = null;
|
|
}
|
|
});
|
|
__publicField(this, "disposeEffect", () => {
|
|
return this.clear;
|
|
});
|
|
}
|
|
static create() {
|
|
return new _Timeout();
|
|
}
|
|
/**
|
|
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
*/
|
|
start(delay, fn) {
|
|
this.clear();
|
|
this.currentId = setTimeout(() => {
|
|
this.currentId = null;
|
|
fn();
|
|
}, delay);
|
|
}
|
|
};
|
|
function useTimeout() {
|
|
const timeout2 = useLazyRef(Timeout.create).current;
|
|
useOnMount(timeout2.disposeEffect);
|
|
return timeout2;
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/ButtonBase/Ripple.js
|
|
var React30 = __toESM(require_react(), 1);
|
|
var import_prop_types12 = __toESM(require_prop_types(), 1);
|
|
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
|
|
function Ripple(props) {
|
|
const {
|
|
className,
|
|
classes,
|
|
pulsate = false,
|
|
rippleX,
|
|
rippleY,
|
|
rippleSize,
|
|
in: inProp,
|
|
onExited,
|
|
timeout: timeout2
|
|
} = props;
|
|
const [leaving, setLeaving] = React30.useState(false);
|
|
const rippleClassName = clsx_default(className, classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);
|
|
const rippleStyles = {
|
|
width: rippleSize,
|
|
height: rippleSize,
|
|
top: -(rippleSize / 2) + rippleY,
|
|
left: -(rippleSize / 2) + rippleX
|
|
};
|
|
const childClassName = clsx_default(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);
|
|
if (!inProp && !leaving) {
|
|
setLeaving(true);
|
|
}
|
|
React30.useEffect(() => {
|
|
if (!inProp && onExited != null) {
|
|
const timeoutId = setTimeout(onExited, timeout2);
|
|
return () => {
|
|
clearTimeout(timeoutId);
|
|
};
|
|
}
|
|
return void 0;
|
|
}, [onExited, inProp, timeout2]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", {
|
|
className: rippleClassName,
|
|
style: rippleStyles,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", {
|
|
className: childClassName
|
|
})
|
|
});
|
|
}
|
|
true ? Ripple.propTypes = {
|
|
/**
|
|
* Override or extend the styles applied to the component.
|
|
*/
|
|
classes: import_prop_types12.default.object.isRequired,
|
|
className: import_prop_types12.default.string,
|
|
/**
|
|
* @ignore - injected from TransitionGroup
|
|
*/
|
|
in: import_prop_types12.default.bool,
|
|
/**
|
|
* @ignore - injected from TransitionGroup
|
|
*/
|
|
onExited: import_prop_types12.default.func,
|
|
/**
|
|
* If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.
|
|
*/
|
|
pulsate: import_prop_types12.default.bool,
|
|
/**
|
|
* Diameter of the ripple.
|
|
*/
|
|
rippleSize: import_prop_types12.default.number,
|
|
/**
|
|
* Horizontal position of the ripple center.
|
|
*/
|
|
rippleX: import_prop_types12.default.number,
|
|
/**
|
|
* Vertical position of the ripple center.
|
|
*/
|
|
rippleY: import_prop_types12.default.number,
|
|
/**
|
|
* exit delay
|
|
*/
|
|
timeout: import_prop_types12.default.number.isRequired
|
|
} : void 0;
|
|
var Ripple_default = Ripple;
|
|
|
|
// node_modules/@mui/material/esm/ButtonBase/touchRippleClasses.js
|
|
var touchRippleClasses = generateUtilityClasses("MuiTouchRipple", ["root", "ripple", "rippleVisible", "ripplePulsate", "child", "childLeaving", "childPulsate"]);
|
|
var touchRippleClasses_default = touchRippleClasses;
|
|
|
|
// node_modules/@mui/material/esm/ButtonBase/TouchRipple.js
|
|
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
|
|
var DURATION = 550;
|
|
var DELAY_RIPPLE = 80;
|
|
var enterKeyframe = keyframes`
|
|
0% {
|
|
transform: scale(0);
|
|
opacity: 0.1;
|
|
}
|
|
|
|
100% {
|
|
transform: scale(1);
|
|
opacity: 0.3;
|
|
}
|
|
`;
|
|
var exitKeyframe = keyframes`
|
|
0% {
|
|
opacity: 1;
|
|
}
|
|
|
|
100% {
|
|
opacity: 0;
|
|
}
|
|
`;
|
|
var pulsateKeyframe = keyframes`
|
|
0% {
|
|
transform: scale(1);
|
|
}
|
|
|
|
50% {
|
|
transform: scale(0.92);
|
|
}
|
|
|
|
100% {
|
|
transform: scale(1);
|
|
}
|
|
`;
|
|
var TouchRippleRoot = styled_default("span", {
|
|
name: "MuiTouchRipple",
|
|
slot: "Root"
|
|
})({
|
|
overflow: "hidden",
|
|
pointerEvents: "none",
|
|
position: "absolute",
|
|
zIndex: 0,
|
|
top: 0,
|
|
right: 0,
|
|
bottom: 0,
|
|
left: 0,
|
|
borderRadius: "inherit"
|
|
});
|
|
var TouchRippleRipple = styled_default(Ripple_default, {
|
|
name: "MuiTouchRipple",
|
|
slot: "Ripple"
|
|
})`
|
|
opacity: 0;
|
|
position: absolute;
|
|
|
|
&.${touchRippleClasses_default.rippleVisible} {
|
|
opacity: 0.3;
|
|
transform: scale(1);
|
|
animation-name: ${enterKeyframe};
|
|
animation-duration: ${DURATION}ms;
|
|
animation-timing-function: ${({
|
|
theme
|
|
}) => theme.transitions.easing.easeInOut};
|
|
}
|
|
|
|
&.${touchRippleClasses_default.ripplePulsate} {
|
|
animation-duration: ${({
|
|
theme
|
|
}) => theme.transitions.duration.shorter}ms;
|
|
}
|
|
|
|
& .${touchRippleClasses_default.child} {
|
|
opacity: 1;
|
|
display: block;
|
|
width: 100%;
|
|
height: 100%;
|
|
border-radius: 50%;
|
|
background-color: currentColor;
|
|
}
|
|
|
|
& .${touchRippleClasses_default.childLeaving} {
|
|
opacity: 0;
|
|
animation-name: ${exitKeyframe};
|
|
animation-duration: ${DURATION}ms;
|
|
animation-timing-function: ${({
|
|
theme
|
|
}) => theme.transitions.easing.easeInOut};
|
|
}
|
|
|
|
& .${touchRippleClasses_default.childPulsate} {
|
|
position: absolute;
|
|
/* @noflip */
|
|
left: 0px;
|
|
top: 0;
|
|
animation-name: ${pulsateKeyframe};
|
|
animation-duration: 2500ms;
|
|
animation-timing-function: ${({
|
|
theme
|
|
}) => theme.transitions.easing.easeInOut};
|
|
animation-iteration-count: infinite;
|
|
animation-delay: 200ms;
|
|
}
|
|
`;
|
|
var TouchRipple = /* @__PURE__ */ React31.forwardRef(function TouchRipple2(inProps, ref) {
|
|
const props = useDefaultProps2({
|
|
props: inProps,
|
|
name: "MuiTouchRipple"
|
|
});
|
|
const _a = props, {
|
|
center: centerProp = false,
|
|
classes = {},
|
|
className
|
|
} = _a, other = __objRest(_a, [
|
|
"center",
|
|
"classes",
|
|
"className"
|
|
]);
|
|
const [ripples, setRipples] = React31.useState([]);
|
|
const nextKey = React31.useRef(0);
|
|
const rippleCallback = React31.useRef(null);
|
|
React31.useEffect(() => {
|
|
if (rippleCallback.current) {
|
|
rippleCallback.current();
|
|
rippleCallback.current = null;
|
|
}
|
|
}, [ripples]);
|
|
const ignoringMouseDown = React31.useRef(false);
|
|
const startTimer = useTimeout();
|
|
const startTimerCommit = React31.useRef(null);
|
|
const container = React31.useRef(null);
|
|
const startCommit = React31.useCallback((params) => {
|
|
const {
|
|
pulsate: pulsate2,
|
|
rippleX,
|
|
rippleY,
|
|
rippleSize,
|
|
cb
|
|
} = params;
|
|
setRipples((oldRipples) => [...oldRipples, /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TouchRippleRipple, {
|
|
classes: {
|
|
ripple: clsx_default(classes.ripple, touchRippleClasses_default.ripple),
|
|
rippleVisible: clsx_default(classes.rippleVisible, touchRippleClasses_default.rippleVisible),
|
|
ripplePulsate: clsx_default(classes.ripplePulsate, touchRippleClasses_default.ripplePulsate),
|
|
child: clsx_default(classes.child, touchRippleClasses_default.child),
|
|
childLeaving: clsx_default(classes.childLeaving, touchRippleClasses_default.childLeaving),
|
|
childPulsate: clsx_default(classes.childPulsate, touchRippleClasses_default.childPulsate)
|
|
},
|
|
timeout: DURATION,
|
|
pulsate: pulsate2,
|
|
rippleX,
|
|
rippleY,
|
|
rippleSize
|
|
}, nextKey.current)]);
|
|
nextKey.current += 1;
|
|
rippleCallback.current = cb;
|
|
}, [classes]);
|
|
const start = React31.useCallback((event = {}, options = {}, cb = () => {
|
|
}) => {
|
|
const {
|
|
pulsate: pulsate2 = false,
|
|
center = centerProp || options.pulsate,
|
|
fakeElement = false
|
|
// For test purposes
|
|
} = options;
|
|
if ((event == null ? void 0 : event.type) === "mousedown" && ignoringMouseDown.current) {
|
|
ignoringMouseDown.current = false;
|
|
return;
|
|
}
|
|
if ((event == null ? void 0 : event.type) === "touchstart") {
|
|
ignoringMouseDown.current = true;
|
|
}
|
|
const element = fakeElement ? null : container.current;
|
|
const rect = element ? element.getBoundingClientRect() : {
|
|
width: 0,
|
|
height: 0,
|
|
left: 0,
|
|
top: 0
|
|
};
|
|
let rippleX;
|
|
let rippleY;
|
|
let rippleSize;
|
|
if (center || event === void 0 || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
|
|
rippleX = Math.round(rect.width / 2);
|
|
rippleY = Math.round(rect.height / 2);
|
|
} else {
|
|
const {
|
|
clientX,
|
|
clientY
|
|
} = event.touches && event.touches.length > 0 ? event.touches[0] : event;
|
|
rippleX = Math.round(clientX - rect.left);
|
|
rippleY = Math.round(clientY - rect.top);
|
|
}
|
|
if (center) {
|
|
rippleSize = Math.sqrt((2 * rect.width ** 2 + rect.height ** 2) / 3);
|
|
if (rippleSize % 2 === 0) {
|
|
rippleSize += 1;
|
|
}
|
|
} else {
|
|
const sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;
|
|
const sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;
|
|
rippleSize = Math.sqrt(sizeX ** 2 + sizeY ** 2);
|
|
}
|
|
if (event == null ? void 0 : event.touches) {
|
|
if (startTimerCommit.current === null) {
|
|
startTimerCommit.current = () => {
|
|
startCommit({
|
|
pulsate: pulsate2,
|
|
rippleX,
|
|
rippleY,
|
|
rippleSize,
|
|
cb
|
|
});
|
|
};
|
|
startTimer.start(DELAY_RIPPLE, () => {
|
|
if (startTimerCommit.current) {
|
|
startTimerCommit.current();
|
|
startTimerCommit.current = null;
|
|
}
|
|
});
|
|
}
|
|
} else {
|
|
startCommit({
|
|
pulsate: pulsate2,
|
|
rippleX,
|
|
rippleY,
|
|
rippleSize,
|
|
cb
|
|
});
|
|
}
|
|
}, [centerProp, startCommit, startTimer]);
|
|
const pulsate = React31.useCallback(() => {
|
|
start({}, {
|
|
pulsate: true
|
|
});
|
|
}, [start]);
|
|
const stop = React31.useCallback((event, cb) => {
|
|
startTimer.clear();
|
|
if ((event == null ? void 0 : event.type) === "touchend" && startTimerCommit.current) {
|
|
startTimerCommit.current();
|
|
startTimerCommit.current = null;
|
|
startTimer.start(0, () => {
|
|
stop(event, cb);
|
|
});
|
|
return;
|
|
}
|
|
startTimerCommit.current = null;
|
|
setRipples((oldRipples) => {
|
|
if (oldRipples.length > 0) {
|
|
return oldRipples.slice(1);
|
|
}
|
|
return oldRipples;
|
|
});
|
|
rippleCallback.current = cb;
|
|
}, [startTimer]);
|
|
React31.useImperativeHandle(ref, () => ({
|
|
pulsate,
|
|
start,
|
|
stop
|
|
}), [pulsate, start, stop]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TouchRippleRoot, __spreadProps(__spreadValues({
|
|
className: clsx_default(touchRippleClasses_default.root, classes.root, className),
|
|
ref: container
|
|
}, other), {
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TransitionGroup_default, {
|
|
component: null,
|
|
exit: true,
|
|
children: ripples
|
|
})
|
|
}));
|
|
});
|
|
true ? TouchRipple.propTypes = {
|
|
/**
|
|
* If `true`, the ripple starts at the center of the component
|
|
* rather than at the point of interaction.
|
|
*/
|
|
center: import_prop_types13.default.bool,
|
|
/**
|
|
* Override or extend the styles applied to the component.
|
|
*/
|
|
classes: import_prop_types13.default.object,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
className: import_prop_types13.default.string
|
|
} : void 0;
|
|
var TouchRipple_default = TouchRipple;
|
|
|
|
// node_modules/@mui/material/esm/ButtonBase/buttonBaseClasses.js
|
|
function getButtonBaseUtilityClass(slot) {
|
|
return generateUtilityClass("MuiButtonBase", slot);
|
|
}
|
|
var buttonBaseClasses = generateUtilityClasses("MuiButtonBase", ["root", "disabled", "focusVisible"]);
|
|
var buttonBaseClasses_default = buttonBaseClasses;
|
|
|
|
// node_modules/@mui/material/esm/ButtonBase/ButtonBase.js
|
|
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
|
|
var useUtilityClasses3 = (ownerState) => {
|
|
const {
|
|
disabled,
|
|
focusVisible,
|
|
focusVisibleClassName,
|
|
classes
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", disabled && "disabled", focusVisible && "focusVisible"]
|
|
};
|
|
const composedClasses = composeClasses(slots, getButtonBaseUtilityClass, classes);
|
|
if (focusVisible && focusVisibleClassName) {
|
|
composedClasses.root += ` ${focusVisibleClassName}`;
|
|
}
|
|
return composedClasses;
|
|
};
|
|
var ButtonBaseRoot = styled_default("button", {
|
|
name: "MuiButtonBase",
|
|
slot: "Root"
|
|
})({
|
|
display: "inline-flex",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
position: "relative",
|
|
boxSizing: "border-box",
|
|
WebkitTapHighlightColor: "transparent",
|
|
backgroundColor: "transparent",
|
|
// Reset default value
|
|
// We disable the focus ring for mouse, touch and keyboard users.
|
|
outline: 0,
|
|
border: 0,
|
|
margin: 0,
|
|
// Remove the margin in Safari
|
|
borderRadius: 0,
|
|
padding: 0,
|
|
// Remove the padding in Firefox
|
|
cursor: "pointer",
|
|
userSelect: "none",
|
|
verticalAlign: "middle",
|
|
MozAppearance: "none",
|
|
// Reset
|
|
WebkitAppearance: "none",
|
|
// Reset
|
|
textDecoration: "none",
|
|
// So we take precedent over the style of a native <a /> element.
|
|
color: "inherit",
|
|
"&::-moz-focus-inner": {
|
|
borderStyle: "none"
|
|
// Remove Firefox dotted outline.
|
|
},
|
|
[`&.${buttonBaseClasses_default.disabled}`]: {
|
|
pointerEvents: "none",
|
|
// Disable link interactions
|
|
cursor: "default"
|
|
},
|
|
"@media print": {
|
|
colorAdjust: "exact"
|
|
}
|
|
});
|
|
var ButtonBase = /* @__PURE__ */ React32.forwardRef(function ButtonBase2(inProps, ref) {
|
|
const props = useDefaultProps2({
|
|
props: inProps,
|
|
name: "MuiButtonBase"
|
|
});
|
|
const _a = props, {
|
|
action,
|
|
centerRipple = false,
|
|
children,
|
|
className,
|
|
component = "button",
|
|
disabled = false,
|
|
disableRipple = false,
|
|
disableTouchRipple = false,
|
|
focusRipple = false,
|
|
focusVisibleClassName,
|
|
LinkComponent = "a",
|
|
onBlur,
|
|
onClick,
|
|
onContextMenu,
|
|
onDragLeave,
|
|
onFocus,
|
|
onFocusVisible,
|
|
onKeyDown,
|
|
onKeyUp,
|
|
onMouseDown,
|
|
onMouseLeave,
|
|
onMouseUp,
|
|
onTouchEnd,
|
|
onTouchMove,
|
|
onTouchStart,
|
|
tabIndex = 0,
|
|
TouchRippleProps,
|
|
touchRippleRef,
|
|
type
|
|
} = _a, other = __objRest(_a, [
|
|
"action",
|
|
"centerRipple",
|
|
"children",
|
|
"className",
|
|
"component",
|
|
"disabled",
|
|
"disableRipple",
|
|
"disableTouchRipple",
|
|
"focusRipple",
|
|
"focusVisibleClassName",
|
|
"LinkComponent",
|
|
"onBlur",
|
|
"onClick",
|
|
"onContextMenu",
|
|
"onDragLeave",
|
|
"onFocus",
|
|
"onFocusVisible",
|
|
"onKeyDown",
|
|
"onKeyUp",
|
|
"onMouseDown",
|
|
"onMouseLeave",
|
|
"onMouseUp",
|
|
"onTouchEnd",
|
|
"onTouchMove",
|
|
"onTouchStart",
|
|
"tabIndex",
|
|
"TouchRippleProps",
|
|
"touchRippleRef",
|
|
"type"
|
|
]);
|
|
const buttonRef = React32.useRef(null);
|
|
const ripple = useLazyRipple();
|
|
const handleRippleRef = useForkRef_default(ripple.ref, touchRippleRef);
|
|
const [focusVisible, setFocusVisible] = React32.useState(false);
|
|
if (disabled && focusVisible) {
|
|
setFocusVisible(false);
|
|
}
|
|
React32.useImperativeHandle(action, () => ({
|
|
focusVisible: () => {
|
|
setFocusVisible(true);
|
|
buttonRef.current.focus();
|
|
}
|
|
}), []);
|
|
const enableTouchRipple = ripple.shouldMount && !disableRipple && !disabled;
|
|
React32.useEffect(() => {
|
|
if (focusVisible && focusRipple && !disableRipple) {
|
|
ripple.pulsate();
|
|
}
|
|
}, [disableRipple, focusRipple, focusVisible, ripple]);
|
|
const handleMouseDown = useRippleHandler(ripple, "start", onMouseDown, disableTouchRipple);
|
|
const handleContextMenu = useRippleHandler(ripple, "stop", onContextMenu, disableTouchRipple);
|
|
const handleDragLeave = useRippleHandler(ripple, "stop", onDragLeave, disableTouchRipple);
|
|
const handleMouseUp = useRippleHandler(ripple, "stop", onMouseUp, disableTouchRipple);
|
|
const handleMouseLeave = useRippleHandler(ripple, "stop", (event) => {
|
|
if (focusVisible) {
|
|
event.preventDefault();
|
|
}
|
|
if (onMouseLeave) {
|
|
onMouseLeave(event);
|
|
}
|
|
}, disableTouchRipple);
|
|
const handleTouchStart = useRippleHandler(ripple, "start", onTouchStart, disableTouchRipple);
|
|
const handleTouchEnd = useRippleHandler(ripple, "stop", onTouchEnd, disableTouchRipple);
|
|
const handleTouchMove = useRippleHandler(ripple, "stop", onTouchMove, disableTouchRipple);
|
|
const handleBlur = useRippleHandler(ripple, "stop", (event) => {
|
|
if (!isFocusVisible(event.target)) {
|
|
setFocusVisible(false);
|
|
}
|
|
if (onBlur) {
|
|
onBlur(event);
|
|
}
|
|
}, false);
|
|
const handleFocus = useEventCallback_default2((event) => {
|
|
if (!buttonRef.current) {
|
|
buttonRef.current = event.currentTarget;
|
|
}
|
|
if (isFocusVisible(event.target)) {
|
|
setFocusVisible(true);
|
|
if (onFocusVisible) {
|
|
onFocusVisible(event);
|
|
}
|
|
}
|
|
if (onFocus) {
|
|
onFocus(event);
|
|
}
|
|
});
|
|
const isNonNativeButton = () => {
|
|
const button = buttonRef.current;
|
|
if (!button) {
|
|
return component && component !== "button";
|
|
}
|
|
if (button.tagName === "BUTTON") {
|
|
return false;
|
|
}
|
|
return !(button.tagName === "A" && button.href);
|
|
};
|
|
const handleKeyDown = useEventCallback_default2((event) => {
|
|
if (focusRipple && !event.repeat && focusVisible && event.key === " ") {
|
|
ripple.stop(event, () => {
|
|
ripple.start(event);
|
|
});
|
|
}
|
|
if (event.target === event.currentTarget && isNonNativeButton() && event.key === " ") {
|
|
event.preventDefault();
|
|
}
|
|
if (onKeyDown) {
|
|
onKeyDown(event);
|
|
}
|
|
if (event.target === event.currentTarget && isNonNativeButton() && event.key === "Enter" && !disabled) {
|
|
event.preventDefault();
|
|
if (onClick) {
|
|
onClick(event);
|
|
}
|
|
}
|
|
});
|
|
const handleKeyUp = useEventCallback_default2((event) => {
|
|
if (focusRipple && event.key === " " && focusVisible && !event.defaultPrevented) {
|
|
ripple.stop(event, () => {
|
|
ripple.pulsate(event);
|
|
});
|
|
}
|
|
if (onKeyUp) {
|
|
onKeyUp(event);
|
|
}
|
|
if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === " " && !event.defaultPrevented && !disabled) {
|
|
onClick(event);
|
|
}
|
|
});
|
|
let ComponentProp = component;
|
|
if (ComponentProp === "button" && (other.href || other.to)) {
|
|
ComponentProp = LinkComponent;
|
|
}
|
|
const buttonProps = {};
|
|
if (ComponentProp === "button") {
|
|
const hasFormAttributes = !!other.formAction;
|
|
buttonProps.type = type === void 0 && !hasFormAttributes ? "button" : type;
|
|
buttonProps.disabled = disabled;
|
|
} else {
|
|
if (!other.href && !other.to) {
|
|
buttonProps.role = "button";
|
|
}
|
|
if (disabled) {
|
|
buttonProps["aria-disabled"] = disabled;
|
|
}
|
|
}
|
|
const handleRef = useForkRef_default(ref, buttonRef);
|
|
const ownerState = __spreadProps(__spreadValues({}, props), {
|
|
centerRipple,
|
|
component,
|
|
disabled,
|
|
disableRipple,
|
|
disableTouchRipple,
|
|
focusRipple,
|
|
tabIndex,
|
|
focusVisible
|
|
});
|
|
const classes = useUtilityClasses3(ownerState);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(ButtonBaseRoot, __spreadProps(__spreadValues(__spreadValues({
|
|
as: ComponentProp,
|
|
className: clsx_default(classes.root, className),
|
|
ownerState,
|
|
onBlur: handleBlur,
|
|
onClick,
|
|
onContextMenu: handleContextMenu,
|
|
onFocus: handleFocus,
|
|
onKeyDown: handleKeyDown,
|
|
onKeyUp: handleKeyUp,
|
|
onMouseDown: handleMouseDown,
|
|
onMouseLeave: handleMouseLeave,
|
|
onMouseUp: handleMouseUp,
|
|
onDragLeave: handleDragLeave,
|
|
onTouchEnd: handleTouchEnd,
|
|
onTouchMove: handleTouchMove,
|
|
onTouchStart: handleTouchStart,
|
|
ref: handleRef,
|
|
tabIndex: disabled ? -1 : tabIndex,
|
|
type
|
|
}, buttonProps), other), {
|
|
children: [children, enableTouchRipple ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TouchRipple_default, __spreadValues({
|
|
ref: handleRippleRef,
|
|
center: centerRipple
|
|
}, TouchRippleProps)) : null]
|
|
}));
|
|
});
|
|
function useRippleHandler(ripple, rippleAction, eventCallback, skipRippleAction = false) {
|
|
return useEventCallback_default2((event) => {
|
|
if (eventCallback) {
|
|
eventCallback(event);
|
|
}
|
|
if (!skipRippleAction) {
|
|
ripple[rippleAction](event);
|
|
}
|
|
return true;
|
|
});
|
|
}
|
|
true ? ButtonBase.propTypes = {
|
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
/**
|
|
* A ref for imperative actions.
|
|
* It currently only supports `focusVisible()` action.
|
|
*/
|
|
action: refType_default,
|
|
/**
|
|
* If `true`, the ripples are centered.
|
|
* They won't start at the cursor interaction position.
|
|
* @default false
|
|
*/
|
|
centerRipple: import_prop_types14.default.bool,
|
|
/**
|
|
* The content of the component.
|
|
*/
|
|
children: import_prop_types14.default.node,
|
|
/**
|
|
* Override or extend the styles applied to the component.
|
|
*/
|
|
classes: import_prop_types14.default.object,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
className: import_prop_types14.default.string,
|
|
/**
|
|
* The component used for the root node.
|
|
* Either a string to use a HTML element or a component.
|
|
*/
|
|
component: elementTypeAcceptingRef_default,
|
|
/**
|
|
* If `true`, the component is disabled.
|
|
* @default false
|
|
*/
|
|
disabled: import_prop_types14.default.bool,
|
|
/**
|
|
* If `true`, the ripple effect is disabled.
|
|
*
|
|
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
|
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
|
* @default false
|
|
*/
|
|
disableRipple: import_prop_types14.default.bool,
|
|
/**
|
|
* If `true`, the touch ripple effect is disabled.
|
|
* @default false
|
|
*/
|
|
disableTouchRipple: import_prop_types14.default.bool,
|
|
/**
|
|
* If `true`, the base button will have a keyboard focus ripple.
|
|
* @default false
|
|
*/
|
|
focusRipple: import_prop_types14.default.bool,
|
|
/**
|
|
* This prop can help identify which element has keyboard focus.
|
|
* The class name will be applied when the element gains the focus through keyboard interaction.
|
|
* It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
|
|
* The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
|
|
* A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
|
|
* if needed.
|
|
*/
|
|
focusVisibleClassName: import_prop_types14.default.string,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
formAction: import_prop_types14.default.oneOfType([import_prop_types14.default.func, import_prop_types14.default.string]),
|
|
/**
|
|
* @ignore
|
|
*/
|
|
href: import_prop_types14.default.any,
|
|
/**
|
|
* The component used to render a link when the `href` prop is provided.
|
|
* @default 'a'
|
|
*/
|
|
LinkComponent: import_prop_types14.default.elementType,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onBlur: import_prop_types14.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onClick: import_prop_types14.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onContextMenu: import_prop_types14.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onDragLeave: import_prop_types14.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onFocus: import_prop_types14.default.func,
|
|
/**
|
|
* Callback fired when the component is focused with a keyboard.
|
|
* We trigger a `onFocus` callback too.
|
|
*/
|
|
onFocusVisible: import_prop_types14.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onKeyDown: import_prop_types14.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onKeyUp: import_prop_types14.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onMouseDown: import_prop_types14.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onMouseLeave: import_prop_types14.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onMouseUp: import_prop_types14.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onTouchEnd: import_prop_types14.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onTouchMove: import_prop_types14.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onTouchStart: import_prop_types14.default.func,
|
|
/**
|
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
*/
|
|
sx: import_prop_types14.default.oneOfType([import_prop_types14.default.arrayOf(import_prop_types14.default.oneOfType([import_prop_types14.default.func, import_prop_types14.default.object, import_prop_types14.default.bool])), import_prop_types14.default.func, import_prop_types14.default.object]),
|
|
/**
|
|
* @default 0
|
|
*/
|
|
tabIndex: import_prop_types14.default.number,
|
|
/**
|
|
* Props applied to the `TouchRipple` element.
|
|
*/
|
|
TouchRippleProps: import_prop_types14.default.object,
|
|
/**
|
|
* A ref that points to the `TouchRipple` element.
|
|
*/
|
|
touchRippleRef: import_prop_types14.default.oneOfType([import_prop_types14.default.func, import_prop_types14.default.shape({
|
|
current: import_prop_types14.default.shape({
|
|
pulsate: import_prop_types14.default.func.isRequired,
|
|
start: import_prop_types14.default.func.isRequired,
|
|
stop: import_prop_types14.default.func.isRequired
|
|
})
|
|
})]),
|
|
/**
|
|
* @ignore
|
|
*/
|
|
type: import_prop_types14.default.oneOfType([import_prop_types14.default.oneOf(["button", "reset", "submit"]), import_prop_types14.default.string])
|
|
} : void 0;
|
|
var ButtonBase_default = ButtonBase;
|
|
|
|
// node_modules/@mui/material/esm/CircularProgress/CircularProgress.js
|
|
var React33 = __toESM(require_react(), 1);
|
|
var import_prop_types15 = __toESM(require_prop_types(), 1);
|
|
|
|
// node_modules/@mui/material/esm/CircularProgress/circularProgressClasses.js
|
|
function getCircularProgressUtilityClass(slot) {
|
|
return generateUtilityClass("MuiCircularProgress", slot);
|
|
}
|
|
var circularProgressClasses = generateUtilityClasses("MuiCircularProgress", ["root", "determinate", "indeterminate", "colorPrimary", "colorSecondary", "svg", "track", "circle", "circleDeterminate", "circleIndeterminate", "circleDisableShrink"]);
|
|
|
|
// node_modules/@mui/material/esm/CircularProgress/CircularProgress.js
|
|
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
|
|
var SIZE = 44;
|
|
var circularRotateKeyframe = keyframes`
|
|
0% {
|
|
transform: rotate(0deg);
|
|
}
|
|
|
|
100% {
|
|
transform: rotate(360deg);
|
|
}
|
|
`;
|
|
var circularDashKeyframe = keyframes`
|
|
0% {
|
|
stroke-dasharray: 1px, 200px;
|
|
stroke-dashoffset: 0;
|
|
}
|
|
|
|
50% {
|
|
stroke-dasharray: 100px, 200px;
|
|
stroke-dashoffset: -15px;
|
|
}
|
|
|
|
100% {
|
|
stroke-dasharray: 1px, 200px;
|
|
stroke-dashoffset: -126px;
|
|
}
|
|
`;
|
|
var rotateAnimation = typeof circularRotateKeyframe !== "string" ? css`
|
|
animation: ${circularRotateKeyframe} 1.4s linear infinite;
|
|
` : null;
|
|
var dashAnimation = typeof circularDashKeyframe !== "string" ? css`
|
|
animation: ${circularDashKeyframe} 1.4s ease-in-out infinite;
|
|
` : null;
|
|
var useUtilityClasses4 = (ownerState) => {
|
|
const {
|
|
classes,
|
|
variant,
|
|
color: color2,
|
|
disableShrink
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", variant, `color${capitalize_default(color2)}`],
|
|
svg: ["svg"],
|
|
track: ["track"],
|
|
circle: ["circle", `circle${capitalize_default(variant)}`, disableShrink && "circleDisableShrink"]
|
|
};
|
|
return composeClasses(slots, getCircularProgressUtilityClass, classes);
|
|
};
|
|
var CircularProgressRoot = styled_default("span", {
|
|
name: "MuiCircularProgress",
|
|
slot: "Root",
|
|
overridesResolver: (props, styles) => {
|
|
const {
|
|
ownerState
|
|
} = props;
|
|
return [styles.root, styles[ownerState.variant], styles[`color${capitalize_default(ownerState.color)}`]];
|
|
}
|
|
})(memoTheme_default(({
|
|
theme
|
|
}) => ({
|
|
display: "inline-block",
|
|
variants: [{
|
|
props: {
|
|
variant: "determinate"
|
|
},
|
|
style: {
|
|
transition: theme.transitions.create("transform")
|
|
}
|
|
}, {
|
|
props: {
|
|
variant: "indeterminate"
|
|
},
|
|
style: rotateAnimation || {
|
|
animation: `${circularRotateKeyframe} 1.4s linear infinite`
|
|
}
|
|
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color2]) => ({
|
|
props: {
|
|
color: color2
|
|
},
|
|
style: {
|
|
color: (theme.vars || theme).palette[color2].main
|
|
}
|
|
}))]
|
|
})));
|
|
var CircularProgressSVG = styled_default("svg", {
|
|
name: "MuiCircularProgress",
|
|
slot: "Svg"
|
|
})({
|
|
display: "block"
|
|
// Keeps the progress centered
|
|
});
|
|
var CircularProgressCircle = styled_default("circle", {
|
|
name: "MuiCircularProgress",
|
|
slot: "Circle",
|
|
overridesResolver: (props, styles) => {
|
|
const {
|
|
ownerState
|
|
} = props;
|
|
return [styles.circle, styles[`circle${capitalize_default(ownerState.variant)}`], ownerState.disableShrink && styles.circleDisableShrink];
|
|
}
|
|
})(memoTheme_default(({
|
|
theme
|
|
}) => ({
|
|
stroke: "currentColor",
|
|
variants: [{
|
|
props: {
|
|
variant: "determinate"
|
|
},
|
|
style: {
|
|
transition: theme.transitions.create("stroke-dashoffset")
|
|
}
|
|
}, {
|
|
props: {
|
|
variant: "indeterminate"
|
|
},
|
|
style: {
|
|
// Some default value that looks fine waiting for the animation to kicks in.
|
|
strokeDasharray: "80px, 200px",
|
|
strokeDashoffset: 0
|
|
// Add the unit to fix a Edge 16 and below bug.
|
|
}
|
|
}, {
|
|
props: ({
|
|
ownerState
|
|
}) => ownerState.variant === "indeterminate" && !ownerState.disableShrink,
|
|
style: dashAnimation || {
|
|
// At runtime for Pigment CSS, `bufferAnimation` will be null and the generated keyframe will be used.
|
|
animation: `${circularDashKeyframe} 1.4s ease-in-out infinite`
|
|
}
|
|
}]
|
|
})));
|
|
var CircularProgressTrack = styled_default("circle", {
|
|
name: "MuiCircularProgress",
|
|
slot: "Track"
|
|
})(memoTheme_default(({
|
|
theme
|
|
}) => ({
|
|
stroke: "currentColor",
|
|
opacity: (theme.vars || theme).palette.action.activatedOpacity
|
|
})));
|
|
var CircularProgress = /* @__PURE__ */ React33.forwardRef(function CircularProgress2(inProps, ref) {
|
|
const props = useDefaultProps2({
|
|
props: inProps,
|
|
name: "MuiCircularProgress"
|
|
});
|
|
const _a = props, {
|
|
className,
|
|
color: color2 = "primary",
|
|
disableShrink = false,
|
|
enableTrackSlot = false,
|
|
size = 40,
|
|
style: style3,
|
|
thickness = 3.6,
|
|
value = 0,
|
|
variant = "indeterminate"
|
|
} = _a, other = __objRest(_a, [
|
|
"className",
|
|
"color",
|
|
"disableShrink",
|
|
"enableTrackSlot",
|
|
"size",
|
|
"style",
|
|
"thickness",
|
|
"value",
|
|
"variant"
|
|
]);
|
|
const ownerState = __spreadProps(__spreadValues({}, props), {
|
|
color: color2,
|
|
disableShrink,
|
|
size,
|
|
thickness,
|
|
value,
|
|
variant,
|
|
enableTrackSlot
|
|
});
|
|
const classes = useUtilityClasses4(ownerState);
|
|
const circleStyle = {};
|
|
const rootStyle = {};
|
|
const rootProps = {};
|
|
if (variant === "determinate") {
|
|
const circumference = 2 * Math.PI * ((SIZE - thickness) / 2);
|
|
circleStyle.strokeDasharray = circumference.toFixed(3);
|
|
rootProps["aria-valuenow"] = Math.round(value);
|
|
circleStyle.strokeDashoffset = `${((100 - value) / 100 * circumference).toFixed(3)}px`;
|
|
rootStyle.transform = "rotate(-90deg)";
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CircularProgressRoot, __spreadProps(__spreadValues(__spreadValues({
|
|
className: clsx_default(classes.root, className),
|
|
style: __spreadValues(__spreadValues({
|
|
width: size,
|
|
height: size
|
|
}, rootStyle), style3),
|
|
ownerState,
|
|
ref,
|
|
role: "progressbar"
|
|
}, rootProps), other), {
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(CircularProgressSVG, {
|
|
className: classes.svg,
|
|
ownerState,
|
|
viewBox: `${SIZE / 2} ${SIZE / 2} ${SIZE} ${SIZE}`,
|
|
children: [enableTrackSlot ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CircularProgressTrack, {
|
|
className: classes.track,
|
|
ownerState,
|
|
cx: SIZE,
|
|
cy: SIZE,
|
|
r: (SIZE - thickness) / 2,
|
|
fill: "none",
|
|
strokeWidth: thickness,
|
|
"aria-hidden": "true"
|
|
}) : null, /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CircularProgressCircle, {
|
|
className: classes.circle,
|
|
style: circleStyle,
|
|
ownerState,
|
|
cx: SIZE,
|
|
cy: SIZE,
|
|
r: (SIZE - thickness) / 2,
|
|
fill: "none",
|
|
strokeWidth: thickness
|
|
})]
|
|
})
|
|
}));
|
|
});
|
|
true ? CircularProgress.propTypes = {
|
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
/**
|
|
* Override or extend the styles applied to the component.
|
|
*/
|
|
classes: import_prop_types15.default.object,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
className: import_prop_types15.default.string,
|
|
/**
|
|
* The color of the component.
|
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
* @default 'primary'
|
|
*/
|
|
color: import_prop_types15.default.oneOfType([import_prop_types15.default.oneOf(["inherit", "primary", "secondary", "error", "info", "success", "warning"]), import_prop_types15.default.string]),
|
|
/**
|
|
* If `true`, the shrink animation is disabled.
|
|
* This only works if variant is `indeterminate`.
|
|
* @default false
|
|
*/
|
|
disableShrink: chainPropTypes(import_prop_types15.default.bool, (props) => {
|
|
if (props.disableShrink && props.variant && props.variant !== "indeterminate") {
|
|
return new Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect.");
|
|
}
|
|
return null;
|
|
}),
|
|
/**
|
|
* If `true`, a track circle slot is mounted to show a subtle background for the progress.
|
|
* The `size` and `thickness` apply to the track slot to be consistent with the progress circle.
|
|
* @default false
|
|
*/
|
|
enableTrackSlot: import_prop_types15.default.bool,
|
|
/**
|
|
* The size of the component.
|
|
* If using a number, the pixel unit is assumed.
|
|
* If using a string, you need to provide the CSS unit, for example '3rem'.
|
|
* @default 40
|
|
*/
|
|
size: import_prop_types15.default.oneOfType([import_prop_types15.default.number, import_prop_types15.default.string]),
|
|
/**
|
|
* @ignore
|
|
*/
|
|
style: import_prop_types15.default.object,
|
|
/**
|
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
*/
|
|
sx: import_prop_types15.default.oneOfType([import_prop_types15.default.arrayOf(import_prop_types15.default.oneOfType([import_prop_types15.default.func, import_prop_types15.default.object, import_prop_types15.default.bool])), import_prop_types15.default.func, import_prop_types15.default.object]),
|
|
/**
|
|
* The thickness of the circle.
|
|
* @default 3.6
|
|
*/
|
|
thickness: import_prop_types15.default.number,
|
|
/**
|
|
* The value of the progress indicator for the determinate variant.
|
|
* Value between 0 and 100.
|
|
* @default 0
|
|
*/
|
|
value: import_prop_types15.default.number,
|
|
/**
|
|
* The variant to use.
|
|
* Use indeterminate when there is no progress value.
|
|
* @default 'indeterminate'
|
|
*/
|
|
variant: import_prop_types15.default.oneOf(["determinate", "indeterminate"])
|
|
} : void 0;
|
|
var CircularProgress_default = CircularProgress;
|
|
|
|
// node_modules/@mui/material/esm/IconButton/iconButtonClasses.js
|
|
function getIconButtonUtilityClass(slot) {
|
|
return generateUtilityClass("MuiIconButton", slot);
|
|
}
|
|
var iconButtonClasses = generateUtilityClasses("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorError", "colorInfo", "colorSuccess", "colorWarning", "edgeStart", "edgeEnd", "sizeSmall", "sizeMedium", "sizeLarge", "loading", "loadingIndicator", "loadingWrapper"]);
|
|
var iconButtonClasses_default = iconButtonClasses;
|
|
|
|
// node_modules/@mui/material/esm/IconButton/IconButton.js
|
|
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
|
|
var useUtilityClasses5 = (ownerState) => {
|
|
const {
|
|
classes,
|
|
disabled,
|
|
color: color2,
|
|
edge,
|
|
size,
|
|
loading
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", loading && "loading", disabled && "disabled", color2 !== "default" && `color${capitalize_default(color2)}`, edge && `edge${capitalize_default(edge)}`, `size${capitalize_default(size)}`],
|
|
loadingIndicator: ["loadingIndicator"],
|
|
loadingWrapper: ["loadingWrapper"]
|
|
};
|
|
return composeClasses(slots, getIconButtonUtilityClass, classes);
|
|
};
|
|
var IconButtonRoot = styled_default(ButtonBase_default, {
|
|
name: "MuiIconButton",
|
|
slot: "Root",
|
|
overridesResolver: (props, styles) => {
|
|
const {
|
|
ownerState
|
|
} = props;
|
|
return [styles.root, ownerState.loading && styles.loading, ownerState.color !== "default" && styles[`color${capitalize_default(ownerState.color)}`], ownerState.edge && styles[`edge${capitalize_default(ownerState.edge)}`], styles[`size${capitalize_default(ownerState.size)}`]];
|
|
}
|
|
})(memoTheme_default(({
|
|
theme
|
|
}) => ({
|
|
textAlign: "center",
|
|
flex: "0 0 auto",
|
|
fontSize: theme.typography.pxToRem(24),
|
|
padding: 8,
|
|
borderRadius: "50%",
|
|
color: (theme.vars || theme).palette.action.active,
|
|
transition: theme.transitions.create("background-color", {
|
|
duration: theme.transitions.duration.shortest
|
|
}),
|
|
variants: [{
|
|
props: (props) => !props.disableRipple,
|
|
style: {
|
|
"--IconButton-hoverBg": theme.alpha((theme.vars || theme).palette.action.active, (theme.vars || theme).palette.action.hoverOpacity),
|
|
"&:hover": {
|
|
backgroundColor: "var(--IconButton-hoverBg)",
|
|
// Reset on touch devices, it doesn't add specificity
|
|
"@media (hover: none)": {
|
|
backgroundColor: "transparent"
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
props: {
|
|
edge: "start"
|
|
},
|
|
style: {
|
|
marginLeft: -12
|
|
}
|
|
}, {
|
|
props: {
|
|
edge: "start",
|
|
size: "small"
|
|
},
|
|
style: {
|
|
marginLeft: -3
|
|
}
|
|
}, {
|
|
props: {
|
|
edge: "end"
|
|
},
|
|
style: {
|
|
marginRight: -12
|
|
}
|
|
}, {
|
|
props: {
|
|
edge: "end",
|
|
size: "small"
|
|
},
|
|
style: {
|
|
marginRight: -3
|
|
}
|
|
}]
|
|
})), memoTheme_default(({
|
|
theme
|
|
}) => ({
|
|
variants: [{
|
|
props: {
|
|
color: "inherit"
|
|
},
|
|
style: {
|
|
color: "inherit"
|
|
}
|
|
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color2]) => ({
|
|
props: {
|
|
color: color2
|
|
},
|
|
style: {
|
|
color: (theme.vars || theme).palette[color2].main
|
|
}
|
|
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color2]) => ({
|
|
props: {
|
|
color: color2
|
|
},
|
|
style: {
|
|
"--IconButton-hoverBg": theme.alpha((theme.vars || theme).palette[color2].main, (theme.vars || theme).palette.action.hoverOpacity)
|
|
}
|
|
})), {
|
|
props: {
|
|
size: "small"
|
|
},
|
|
style: {
|
|
padding: 5,
|
|
fontSize: theme.typography.pxToRem(18)
|
|
}
|
|
}, {
|
|
props: {
|
|
size: "large"
|
|
},
|
|
style: {
|
|
padding: 12,
|
|
fontSize: theme.typography.pxToRem(28)
|
|
}
|
|
}],
|
|
[`&.${iconButtonClasses_default.disabled}`]: {
|
|
backgroundColor: "transparent",
|
|
color: (theme.vars || theme).palette.action.disabled
|
|
},
|
|
[`&.${iconButtonClasses_default.loading}`]: {
|
|
color: "transparent"
|
|
}
|
|
})));
|
|
var IconButtonLoadingIndicator = styled_default("span", {
|
|
name: "MuiIconButton",
|
|
slot: "LoadingIndicator"
|
|
})(({
|
|
theme
|
|
}) => ({
|
|
display: "none",
|
|
position: "absolute",
|
|
visibility: "visible",
|
|
top: "50%",
|
|
left: "50%",
|
|
transform: "translate(-50%, -50%)",
|
|
color: (theme.vars || theme).palette.action.disabled,
|
|
variants: [{
|
|
props: {
|
|
loading: true
|
|
},
|
|
style: {
|
|
display: "flex"
|
|
}
|
|
}]
|
|
}));
|
|
var IconButton = /* @__PURE__ */ React34.forwardRef(function IconButton2(inProps, ref) {
|
|
const props = useDefaultProps2({
|
|
props: inProps,
|
|
name: "MuiIconButton"
|
|
});
|
|
const _a = props, {
|
|
edge = false,
|
|
children,
|
|
className,
|
|
color: color2 = "default",
|
|
disabled = false,
|
|
disableFocusRipple = false,
|
|
size = "medium",
|
|
id: idProp,
|
|
loading = null,
|
|
loadingIndicator: loadingIndicatorProp
|
|
} = _a, other = __objRest(_a, [
|
|
"edge",
|
|
"children",
|
|
"className",
|
|
"color",
|
|
"disabled",
|
|
"disableFocusRipple",
|
|
"size",
|
|
"id",
|
|
"loading",
|
|
"loadingIndicator"
|
|
]);
|
|
const loadingId = useId_default(idProp);
|
|
const loadingIndicator = loadingIndicatorProp != null ? loadingIndicatorProp : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CircularProgress_default, {
|
|
"aria-labelledby": loadingId,
|
|
color: "inherit",
|
|
size: 16
|
|
});
|
|
const ownerState = __spreadProps(__spreadValues({}, props), {
|
|
edge,
|
|
color: color2,
|
|
disabled,
|
|
disableFocusRipple,
|
|
loading,
|
|
loadingIndicator,
|
|
size
|
|
});
|
|
const classes = useUtilityClasses5(ownerState);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(IconButtonRoot, __spreadProps(__spreadValues({
|
|
id: loading ? loadingId : idProp,
|
|
className: clsx_default(classes.root, className),
|
|
centerRipple: true,
|
|
focusRipple: !disableFocusRipple,
|
|
disabled: disabled || loading,
|
|
ref
|
|
}, other), {
|
|
ownerState,
|
|
children: [typeof loading === "boolean" && // use plain HTML span to minimize the runtime overhead
|
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", {
|
|
className: classes.loadingWrapper,
|
|
style: {
|
|
display: "contents"
|
|
},
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconButtonLoadingIndicator, {
|
|
className: classes.loadingIndicator,
|
|
ownerState,
|
|
children: loading && loadingIndicator
|
|
})
|
|
}), children]
|
|
}));
|
|
});
|
|
true ? IconButton.propTypes = {
|
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
/**
|
|
* The icon to display.
|
|
*/
|
|
children: chainPropTypes(import_prop_types16.default.node, (props) => {
|
|
const found = React34.Children.toArray(props.children).some((child) => /* @__PURE__ */ React34.isValidElement(child) && child.props.onClick);
|
|
if (found) {
|
|
return new Error(["MUI: You are providing an onClick event listener to a child of a button element.", "Prefer applying it to the IconButton directly.", "This guarantees that the whole <button> will be responsive to click events."].join("\n"));
|
|
}
|
|
return null;
|
|
}),
|
|
/**
|
|
* Override or extend the styles applied to the component.
|
|
*/
|
|
classes: import_prop_types16.default.object,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
className: import_prop_types16.default.string,
|
|
/**
|
|
* The color of the component.
|
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
* @default 'default'
|
|
*/
|
|
color: import_prop_types16.default.oneOfType([import_prop_types16.default.oneOf(["inherit", "default", "primary", "secondary", "error", "info", "success", "warning"]), import_prop_types16.default.string]),
|
|
/**
|
|
* If `true`, the component is disabled.
|
|
* @default false
|
|
*/
|
|
disabled: import_prop_types16.default.bool,
|
|
/**
|
|
* If `true`, the keyboard focus ripple is disabled.
|
|
* @default false
|
|
*/
|
|
disableFocusRipple: import_prop_types16.default.bool,
|
|
/**
|
|
* If `true`, the ripple effect is disabled.
|
|
*
|
|
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
|
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
|
* @default false
|
|
*/
|
|
disableRipple: import_prop_types16.default.bool,
|
|
/**
|
|
* If given, uses a negative margin to counteract the padding on one
|
|
* side (this is often helpful for aligning the left or right
|
|
* side of the icon with content above or below, without ruining the border
|
|
* size and shape).
|
|
* @default false
|
|
*/
|
|
edge: import_prop_types16.default.oneOf(["end", "start", false]),
|
|
/**
|
|
* @ignore
|
|
*/
|
|
id: import_prop_types16.default.string,
|
|
/**
|
|
* If `true`, the loading indicator is visible and the button is disabled.
|
|
* If `true | false`, the loading wrapper is always rendered before the children to prevent [Google Translation Crash](https://github.com/mui/material-ui/issues/27853).
|
|
* @default null
|
|
*/
|
|
loading: import_prop_types16.default.bool,
|
|
/**
|
|
* Element placed before the children if the button is in loading state.
|
|
* The node should contain an element with `role="progressbar"` with an accessible name.
|
|
* By default, it renders a `CircularProgress` that is labeled by the button itself.
|
|
* @default <CircularProgress color="inherit" size={16} />
|
|
*/
|
|
loadingIndicator: import_prop_types16.default.node,
|
|
/**
|
|
* The size of the component.
|
|
* `small` is equivalent to the dense button styling.
|
|
* @default 'medium'
|
|
*/
|
|
size: import_prop_types16.default.oneOfType([import_prop_types16.default.oneOf(["small", "medium", "large"]), import_prop_types16.default.string]),
|
|
/**
|
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
*/
|
|
sx: import_prop_types16.default.oneOfType([import_prop_types16.default.arrayOf(import_prop_types16.default.oneOfType([import_prop_types16.default.func, import_prop_types16.default.object, import_prop_types16.default.bool])), import_prop_types16.default.func, import_prop_types16.default.object])
|
|
} : void 0;
|
|
var IconButton_default = IconButton;
|
|
|
|
// node_modules/@mui/material/esm/internal/svg-icons/SuccessOutlined.js
|
|
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
|
|
var SuccessOutlined_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", {
|
|
d: "M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"
|
|
}), "SuccessOutlined");
|
|
|
|
// node_modules/@mui/material/esm/internal/svg-icons/ReportProblemOutlined.js
|
|
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
|
|
var ReportProblemOutlined_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", {
|
|
d: "M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"
|
|
}), "ReportProblemOutlined");
|
|
|
|
// node_modules/@mui/material/esm/internal/svg-icons/ErrorOutline.js
|
|
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
|
|
var ErrorOutline_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", {
|
|
d: "M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
|
}), "ErrorOutline");
|
|
|
|
// node_modules/@mui/material/esm/internal/svg-icons/InfoOutlined.js
|
|
var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
|
|
var InfoOutlined_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", {
|
|
d: "M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
}), "InfoOutlined");
|
|
|
|
// node_modules/@mui/material/esm/internal/svg-icons/Close.js
|
|
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
|
|
var Close_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", {
|
|
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
}), "Close");
|
|
|
|
// node_modules/@mui/material/esm/Alert/Alert.js
|
|
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
|
|
var useUtilityClasses6 = (ownerState) => {
|
|
const {
|
|
variant,
|
|
color: color2,
|
|
severity,
|
|
classes
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", `color${capitalize_default(color2 || severity)}`, `${variant}${capitalize_default(color2 || severity)}`, `${variant}`],
|
|
icon: ["icon"],
|
|
message: ["message"],
|
|
action: ["action"]
|
|
};
|
|
return composeClasses(slots, getAlertUtilityClass, classes);
|
|
};
|
|
var AlertRoot = styled_default(Paper_default, {
|
|
name: "MuiAlert",
|
|
slot: "Root",
|
|
overridesResolver: (props, styles) => {
|
|
const {
|
|
ownerState
|
|
} = props;
|
|
return [styles.root, styles[ownerState.variant], styles[`${ownerState.variant}${capitalize_default(ownerState.color || ownerState.severity)}`]];
|
|
}
|
|
})(memoTheme_default(({
|
|
theme
|
|
}) => {
|
|
const getColor = theme.palette.mode === "light" ? theme.darken : theme.lighten;
|
|
const getBackgroundColor = theme.palette.mode === "light" ? theme.lighten : theme.darken;
|
|
return __spreadProps(__spreadValues({}, theme.typography.body2), {
|
|
backgroundColor: "transparent",
|
|
display: "flex",
|
|
padding: "6px 16px",
|
|
variants: [...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(["light"])).map(([color2]) => ({
|
|
props: {
|
|
colorSeverity: color2,
|
|
variant: "standard"
|
|
},
|
|
style: {
|
|
color: theme.vars ? theme.vars.palette.Alert[`${color2}Color`] : getColor(theme.palette[color2].light, 0.6),
|
|
backgroundColor: theme.vars ? theme.vars.palette.Alert[`${color2}StandardBg`] : getBackgroundColor(theme.palette[color2].light, 0.9),
|
|
[`& .${alertClasses_default.icon}`]: theme.vars ? {
|
|
color: theme.vars.palette.Alert[`${color2}IconColor`]
|
|
} : {
|
|
color: theme.palette[color2].main
|
|
}
|
|
}
|
|
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(["light"])).map(([color2]) => ({
|
|
props: {
|
|
colorSeverity: color2,
|
|
variant: "outlined"
|
|
},
|
|
style: {
|
|
color: theme.vars ? theme.vars.palette.Alert[`${color2}Color`] : getColor(theme.palette[color2].light, 0.6),
|
|
border: `1px solid ${(theme.vars || theme).palette[color2].light}`,
|
|
[`& .${alertClasses_default.icon}`]: theme.vars ? {
|
|
color: theme.vars.palette.Alert[`${color2}IconColor`]
|
|
} : {
|
|
color: theme.palette[color2].main
|
|
}
|
|
}
|
|
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(["dark"])).map(([color2]) => ({
|
|
props: {
|
|
colorSeverity: color2,
|
|
variant: "filled"
|
|
},
|
|
style: __spreadValues({
|
|
fontWeight: theme.typography.fontWeightMedium
|
|
}, theme.vars ? {
|
|
color: theme.vars.palette.Alert[`${color2}FilledColor`],
|
|
backgroundColor: theme.vars.palette.Alert[`${color2}FilledBg`]
|
|
} : {
|
|
backgroundColor: theme.palette.mode === "dark" ? theme.palette[color2].dark : theme.palette[color2].main,
|
|
color: theme.palette.getContrastText(theme.palette[color2].main)
|
|
})
|
|
}))]
|
|
});
|
|
}));
|
|
var AlertIcon = styled_default("div", {
|
|
name: "MuiAlert",
|
|
slot: "Icon"
|
|
})({
|
|
marginRight: 12,
|
|
padding: "7px 0",
|
|
display: "flex",
|
|
fontSize: 22,
|
|
opacity: 0.9
|
|
});
|
|
var AlertMessage = styled_default("div", {
|
|
name: "MuiAlert",
|
|
slot: "Message"
|
|
})({
|
|
padding: "8px 0",
|
|
minWidth: 0,
|
|
overflow: "auto"
|
|
});
|
|
var AlertAction = styled_default("div", {
|
|
name: "MuiAlert",
|
|
slot: "Action"
|
|
})({
|
|
display: "flex",
|
|
alignItems: "flex-start",
|
|
padding: "4px 0 0 16px",
|
|
marginLeft: "auto",
|
|
marginRight: -8
|
|
});
|
|
var defaultIconMapping = {
|
|
success: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SuccessOutlined_default, {
|
|
fontSize: "inherit"
|
|
}),
|
|
warning: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ReportProblemOutlined_default, {
|
|
fontSize: "inherit"
|
|
}),
|
|
error: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ErrorOutline_default, {
|
|
fontSize: "inherit"
|
|
}),
|
|
info: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(InfoOutlined_default, {
|
|
fontSize: "inherit"
|
|
})
|
|
};
|
|
var Alert = /* @__PURE__ */ React35.forwardRef(function Alert2(inProps, ref) {
|
|
const props = useDefaultProps2({
|
|
props: inProps,
|
|
name: "MuiAlert"
|
|
});
|
|
const _a = props, {
|
|
action,
|
|
children,
|
|
className,
|
|
closeText = "Close",
|
|
color: color2,
|
|
components = {},
|
|
componentsProps = {},
|
|
icon,
|
|
iconMapping = defaultIconMapping,
|
|
onClose,
|
|
role = "alert",
|
|
severity = "success",
|
|
slotProps = {},
|
|
slots = {},
|
|
variant = "standard"
|
|
} = _a, other = __objRest(_a, [
|
|
"action",
|
|
"children",
|
|
"className",
|
|
"closeText",
|
|
"color",
|
|
"components",
|
|
"componentsProps",
|
|
"icon",
|
|
"iconMapping",
|
|
"onClose",
|
|
"role",
|
|
"severity",
|
|
"slotProps",
|
|
"slots",
|
|
"variant"
|
|
]);
|
|
const ownerState = __spreadProps(__spreadValues({}, props), {
|
|
color: color2,
|
|
severity,
|
|
variant,
|
|
colorSeverity: color2 || severity
|
|
});
|
|
const classes = useUtilityClasses6(ownerState);
|
|
const externalForwardedProps = {
|
|
slots: __spreadValues({
|
|
closeButton: components.CloseButton,
|
|
closeIcon: components.CloseIcon
|
|
}, slots),
|
|
slotProps: __spreadValues(__spreadValues({}, componentsProps), slotProps)
|
|
};
|
|
const [RootSlot, rootSlotProps] = useSlot("root", {
|
|
ref,
|
|
shouldForwardComponentProp: true,
|
|
className: clsx_default(classes.root, className),
|
|
elementType: AlertRoot,
|
|
externalForwardedProps: __spreadValues(__spreadValues({}, externalForwardedProps), other),
|
|
ownerState,
|
|
additionalProps: {
|
|
role,
|
|
elevation: 0
|
|
}
|
|
});
|
|
const [IconSlot, iconSlotProps] = useSlot("icon", {
|
|
className: classes.icon,
|
|
elementType: AlertIcon,
|
|
externalForwardedProps,
|
|
ownerState
|
|
});
|
|
const [MessageSlot, messageSlotProps] = useSlot("message", {
|
|
className: classes.message,
|
|
elementType: AlertMessage,
|
|
externalForwardedProps,
|
|
ownerState
|
|
});
|
|
const [ActionSlot, actionSlotProps] = useSlot("action", {
|
|
className: classes.action,
|
|
elementType: AlertAction,
|
|
externalForwardedProps,
|
|
ownerState
|
|
});
|
|
const [CloseButtonSlot, closeButtonProps] = useSlot("closeButton", {
|
|
elementType: IconButton_default,
|
|
externalForwardedProps,
|
|
ownerState
|
|
});
|
|
const [CloseIconSlot, closeIconProps] = useSlot("closeIcon", {
|
|
elementType: Close_default,
|
|
externalForwardedProps,
|
|
ownerState
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(RootSlot, __spreadProps(__spreadValues({}, rootSlotProps), {
|
|
children: [icon !== false ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(IconSlot, __spreadProps(__spreadValues({}, iconSlotProps), {
|
|
children: icon || iconMapping[severity] || defaultIconMapping[severity]
|
|
})) : null, /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MessageSlot, __spreadProps(__spreadValues({}, messageSlotProps), {
|
|
children
|
|
})), action != null ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ActionSlot, __spreadProps(__spreadValues({}, actionSlotProps), {
|
|
children: action
|
|
})) : null, action == null && onClose ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ActionSlot, __spreadProps(__spreadValues({}, actionSlotProps), {
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CloseButtonSlot, __spreadProps(__spreadValues({
|
|
size: "small",
|
|
"aria-label": closeText,
|
|
title: closeText,
|
|
color: "inherit",
|
|
onClick: onClose
|
|
}, closeButtonProps), {
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CloseIconSlot, __spreadValues({
|
|
fontSize: "small"
|
|
}, closeIconProps))
|
|
}))
|
|
})) : null]
|
|
}));
|
|
});
|
|
true ? Alert.propTypes = {
|
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
/**
|
|
* The action to display. It renders after the message, at the end of the alert.
|
|
*/
|
|
action: import_prop_types17.default.node,
|
|
/**
|
|
* The content of the component.
|
|
*/
|
|
children: import_prop_types17.default.node,
|
|
/**
|
|
* Override or extend the styles applied to the component.
|
|
*/
|
|
classes: import_prop_types17.default.object,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
className: import_prop_types17.default.string,
|
|
/**
|
|
* Override the default label for the *close popup* icon button.
|
|
*
|
|
* For localization purposes, you can use the provided [translations](https://mui.com/material-ui/guides/localization/).
|
|
* @default 'Close'
|
|
*/
|
|
closeText: import_prop_types17.default.string,
|
|
/**
|
|
* The color of the component. Unless provided, the value is taken from the `severity` prop.
|
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
*/
|
|
color: import_prop_types17.default.oneOfType([import_prop_types17.default.oneOf(["error", "info", "success", "warning"]), import_prop_types17.default.string]),
|
|
/**
|
|
* The components used for each slot inside.
|
|
*
|
|
* @deprecated use the `slots` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
*
|
|
* @default {}
|
|
*/
|
|
components: import_prop_types17.default.shape({
|
|
CloseButton: import_prop_types17.default.elementType,
|
|
CloseIcon: import_prop_types17.default.elementType
|
|
}),
|
|
/**
|
|
* The extra props for the slot components.
|
|
* You can override the existing props or add new ones.
|
|
*
|
|
* @deprecated use the `slotProps` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
*
|
|
* @default {}
|
|
*/
|
|
componentsProps: import_prop_types17.default.shape({
|
|
closeButton: import_prop_types17.default.object,
|
|
closeIcon: import_prop_types17.default.object
|
|
}),
|
|
/**
|
|
* Override the icon displayed before the children.
|
|
* Unless provided, the icon is mapped to the value of the `severity` prop.
|
|
* Set to `false` to remove the `icon`.
|
|
*/
|
|
icon: import_prop_types17.default.node,
|
|
/**
|
|
* The component maps the `severity` prop to a range of different icons,
|
|
* for instance success to `<SuccessOutlined>`.
|
|
* If you wish to change this mapping, you can provide your own.
|
|
* Alternatively, you can use the `icon` prop to override the icon displayed.
|
|
*/
|
|
iconMapping: import_prop_types17.default.shape({
|
|
error: import_prop_types17.default.node,
|
|
info: import_prop_types17.default.node,
|
|
success: import_prop_types17.default.node,
|
|
warning: import_prop_types17.default.node
|
|
}),
|
|
/**
|
|
* Callback fired when the component requests to be closed.
|
|
* When provided and no `action` prop is set, a close icon button is displayed that triggers the callback when clicked.
|
|
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
*/
|
|
onClose: import_prop_types17.default.func,
|
|
/**
|
|
* The ARIA role attribute of the element.
|
|
* @default 'alert'
|
|
*/
|
|
role: import_prop_types17.default.string,
|
|
/**
|
|
* The severity of the alert. This defines the color and icon used.
|
|
* @default 'success'
|
|
*/
|
|
severity: import_prop_types17.default.oneOfType([import_prop_types17.default.oneOf(["error", "info", "success", "warning"]), import_prop_types17.default.string]),
|
|
/**
|
|
* The props used for each slot inside.
|
|
* @default {}
|
|
*/
|
|
slotProps: import_prop_types17.default.shape({
|
|
action: import_prop_types17.default.oneOfType([import_prop_types17.default.func, import_prop_types17.default.object]),
|
|
closeButton: import_prop_types17.default.oneOfType([import_prop_types17.default.func, import_prop_types17.default.object]),
|
|
closeIcon: import_prop_types17.default.oneOfType([import_prop_types17.default.func, import_prop_types17.default.object]),
|
|
icon: import_prop_types17.default.oneOfType([import_prop_types17.default.func, import_prop_types17.default.object]),
|
|
message: import_prop_types17.default.oneOfType([import_prop_types17.default.func, import_prop_types17.default.object]),
|
|
root: import_prop_types17.default.oneOfType([import_prop_types17.default.func, import_prop_types17.default.object])
|
|
}),
|
|
/**
|
|
* The components used for each slot inside.
|
|
* @default {}
|
|
*/
|
|
slots: import_prop_types17.default.shape({
|
|
action: import_prop_types17.default.elementType,
|
|
closeButton: import_prop_types17.default.elementType,
|
|
closeIcon: import_prop_types17.default.elementType,
|
|
icon: import_prop_types17.default.elementType,
|
|
message: import_prop_types17.default.elementType,
|
|
root: import_prop_types17.default.elementType
|
|
}),
|
|
/**
|
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
*/
|
|
sx: import_prop_types17.default.oneOfType([import_prop_types17.default.arrayOf(import_prop_types17.default.oneOfType([import_prop_types17.default.func, import_prop_types17.default.object, import_prop_types17.default.bool])), import_prop_types17.default.func, import_prop_types17.default.object]),
|
|
/**
|
|
* The variant to use.
|
|
* @default 'standard'
|
|
*/
|
|
variant: import_prop_types17.default.oneOfType([import_prop_types17.default.oneOf(["filled", "outlined", "standard"]), import_prop_types17.default.string])
|
|
} : void 0;
|
|
var Alert_default = Alert;
|
|
|
|
// node_modules/@mui/material/esm/Typography/Typography.js
|
|
var React36 = __toESM(require_react(), 1);
|
|
var import_prop_types18 = __toESM(require_prop_types(), 1);
|
|
|
|
// node_modules/@mui/material/esm/Typography/typographyClasses.js
|
|
function getTypographyUtilityClass(slot) {
|
|
return generateUtilityClass("MuiTypography", slot);
|
|
}
|
|
var typographyClasses = generateUtilityClasses("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
|
|
|
|
// node_modules/@mui/material/esm/Typography/Typography.js
|
|
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
|
|
var v6Colors = {
|
|
primary: true,
|
|
secondary: true,
|
|
error: true,
|
|
info: true,
|
|
success: true,
|
|
warning: true,
|
|
textPrimary: true,
|
|
textSecondary: true,
|
|
textDisabled: true
|
|
};
|
|
var extendSxProp2 = internal_createExtendSxProp();
|
|
var useUtilityClasses7 = (ownerState) => {
|
|
const {
|
|
align,
|
|
gutterBottom,
|
|
noWrap,
|
|
paragraph,
|
|
variant,
|
|
classes
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", variant, ownerState.align !== "inherit" && `align${capitalize_default(align)}`, gutterBottom && "gutterBottom", noWrap && "noWrap", paragraph && "paragraph"]
|
|
};
|
|
return composeClasses(slots, getTypographyUtilityClass, classes);
|
|
};
|
|
var TypographyRoot = styled_default("span", {
|
|
name: "MuiTypography",
|
|
slot: "Root",
|
|
overridesResolver: (props, styles) => {
|
|
const {
|
|
ownerState
|
|
} = props;
|
|
return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== "inherit" && styles[`align${capitalize_default(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom, ownerState.paragraph && styles.paragraph];
|
|
}
|
|
})(memoTheme_default(({
|
|
theme
|
|
}) => {
|
|
var _a;
|
|
return {
|
|
margin: 0,
|
|
variants: [{
|
|
props: {
|
|
variant: "inherit"
|
|
},
|
|
style: {
|
|
// Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
|
|
font: "inherit",
|
|
lineHeight: "inherit",
|
|
letterSpacing: "inherit"
|
|
}
|
|
}, ...Object.entries(theme.typography).filter(([variant, value]) => variant !== "inherit" && value && typeof value === "object").map(([variant, value]) => ({
|
|
props: {
|
|
variant
|
|
},
|
|
style: value
|
|
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color2]) => ({
|
|
props: {
|
|
color: color2
|
|
},
|
|
style: {
|
|
color: (theme.vars || theme).palette[color2].main
|
|
}
|
|
})), ...Object.entries(((_a = theme.palette) == null ? void 0 : _a.text) || {}).filter(([, value]) => typeof value === "string").map(([color2]) => ({
|
|
props: {
|
|
color: `text${capitalize_default(color2)}`
|
|
},
|
|
style: {
|
|
color: (theme.vars || theme).palette.text[color2]
|
|
}
|
|
})), {
|
|
props: ({
|
|
ownerState
|
|
}) => ownerState.align !== "inherit",
|
|
style: {
|
|
textAlign: "var(--Typography-textAlign)"
|
|
}
|
|
}, {
|
|
props: ({
|
|
ownerState
|
|
}) => ownerState.noWrap,
|
|
style: {
|
|
overflow: "hidden",
|
|
textOverflow: "ellipsis",
|
|
whiteSpace: "nowrap"
|
|
}
|
|
}, {
|
|
props: ({
|
|
ownerState
|
|
}) => ownerState.gutterBottom,
|
|
style: {
|
|
marginBottom: "0.35em"
|
|
}
|
|
}, {
|
|
props: ({
|
|
ownerState
|
|
}) => ownerState.paragraph,
|
|
style: {
|
|
marginBottom: 16
|
|
}
|
|
}]
|
|
};
|
|
}));
|
|
var defaultVariantMapping = {
|
|
h1: "h1",
|
|
h2: "h2",
|
|
h3: "h3",
|
|
h4: "h4",
|
|
h5: "h5",
|
|
h6: "h6",
|
|
subtitle1: "h6",
|
|
subtitle2: "h6",
|
|
body1: "p",
|
|
body2: "p",
|
|
inherit: "p"
|
|
};
|
|
var Typography = /* @__PURE__ */ React36.forwardRef(function Typography2(inProps, ref) {
|
|
const _a = useDefaultProps2({
|
|
props: inProps,
|
|
name: "MuiTypography"
|
|
}), {
|
|
color: color2
|
|
} = _a, themeProps = __objRest(_a, [
|
|
"color"
|
|
]);
|
|
const isSxColor = !v6Colors[color2];
|
|
const props = extendSxProp2(__spreadValues(__spreadValues({}, themeProps), isSxColor && {
|
|
color: color2
|
|
}));
|
|
const _b = props, {
|
|
align = "inherit",
|
|
className,
|
|
component,
|
|
gutterBottom = false,
|
|
noWrap = false,
|
|
paragraph = false,
|
|
variant = "body1",
|
|
variantMapping = defaultVariantMapping
|
|
} = _b, other = __objRest(_b, [
|
|
"align",
|
|
"className",
|
|
"component",
|
|
"gutterBottom",
|
|
"noWrap",
|
|
"paragraph",
|
|
"variant",
|
|
"variantMapping"
|
|
]);
|
|
const ownerState = __spreadProps(__spreadValues({}, props), {
|
|
align,
|
|
color: color2,
|
|
className,
|
|
component,
|
|
gutterBottom,
|
|
noWrap,
|
|
paragraph,
|
|
variant,
|
|
variantMapping
|
|
});
|
|
const Component = component || (paragraph ? "p" : variantMapping[variant] || defaultVariantMapping[variant]) || "span";
|
|
const classes = useUtilityClasses7(ownerState);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TypographyRoot, __spreadProps(__spreadValues({
|
|
as: Component,
|
|
ref,
|
|
className: clsx_default(classes.root, className)
|
|
}, other), {
|
|
ownerState,
|
|
style: __spreadValues(__spreadValues({}, align !== "inherit" && {
|
|
"--Typography-textAlign": align
|
|
}), other.style)
|
|
}));
|
|
});
|
|
true ? Typography.propTypes = {
|
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
/**
|
|
* Set the text-align on the component.
|
|
* @default 'inherit'
|
|
*/
|
|
align: import_prop_types18.default.oneOf(["center", "inherit", "justify", "left", "right"]),
|
|
/**
|
|
* The content of the component.
|
|
*/
|
|
children: import_prop_types18.default.node,
|
|
/**
|
|
* Override or extend the styles applied to the component.
|
|
*/
|
|
classes: import_prop_types18.default.object,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
className: import_prop_types18.default.string,
|
|
/**
|
|
* The color of the component.
|
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
*/
|
|
color: import_prop_types18.default.oneOfType([import_prop_types18.default.oneOf(["primary", "secondary", "success", "error", "info", "warning", "textPrimary", "textSecondary", "textDisabled"]), import_prop_types18.default.string]),
|
|
/**
|
|
* The component used for the root node.
|
|
* Either a string to use a HTML element or a component.
|
|
*/
|
|
component: import_prop_types18.default.elementType,
|
|
/**
|
|
* If `true`, the text will have a bottom margin.
|
|
* @default false
|
|
*/
|
|
gutterBottom: import_prop_types18.default.bool,
|
|
/**
|
|
* If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
|
|
*
|
|
* Note that text overflow can only happen with block or inline-block level elements
|
|
* (the element needs to have a width in order to overflow).
|
|
* @default false
|
|
*/
|
|
noWrap: import_prop_types18.default.bool,
|
|
/**
|
|
* If `true`, the element will be a paragraph element.
|
|
* @default false
|
|
* @deprecated Use the `component` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
*/
|
|
paragraph: import_prop_types18.default.bool,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
style: import_prop_types18.default.object,
|
|
/**
|
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
*/
|
|
sx: import_prop_types18.default.oneOfType([import_prop_types18.default.arrayOf(import_prop_types18.default.oneOfType([import_prop_types18.default.func, import_prop_types18.default.object, import_prop_types18.default.bool])), import_prop_types18.default.func, import_prop_types18.default.object]),
|
|
/**
|
|
* Applies the theme typography styles.
|
|
* @default 'body1'
|
|
*/
|
|
variant: import_prop_types18.default.oneOfType([import_prop_types18.default.oneOf(["body1", "body2", "button", "caption", "h1", "h2", "h3", "h4", "h5", "h6", "inherit", "overline", "subtitle1", "subtitle2"]), import_prop_types18.default.string]),
|
|
/**
|
|
* The component maps the variant prop to a range of different HTML element types.
|
|
* For instance, subtitle1 to `<h6>`.
|
|
* If you wish to change that mapping, you can provide your own.
|
|
* Alternatively, you can use the `component` prop.
|
|
* @default {
|
|
* h1: 'h1',
|
|
* h2: 'h2',
|
|
* h3: 'h3',
|
|
* h4: 'h4',
|
|
* h5: 'h5',
|
|
* h6: 'h6',
|
|
* subtitle1: 'h6',
|
|
* subtitle2: 'h6',
|
|
* body1: 'p',
|
|
* body2: 'p',
|
|
* inherit: 'p',
|
|
* }
|
|
*/
|
|
variantMapping: import_prop_types18.default.object
|
|
} : void 0;
|
|
var Typography_default = Typography;
|
|
|
|
// node_modules/@mui/utils/esm/useSlotProps/useSlotProps.js
|
|
function useSlotProps(parameters) {
|
|
var _b;
|
|
const _a = parameters, {
|
|
elementType,
|
|
externalSlotProps,
|
|
ownerState,
|
|
skipResolvingSlotProps = false
|
|
} = _a, other = __objRest(_a, [
|
|
"elementType",
|
|
"externalSlotProps",
|
|
"ownerState",
|
|
"skipResolvingSlotProps"
|
|
]);
|
|
const resolvedComponentsProps = skipResolvingSlotProps ? {} : resolveComponentProps_default(externalSlotProps, ownerState);
|
|
const {
|
|
props: mergedProps,
|
|
internalRef
|
|
} = mergeSlotProps_default(__spreadProps(__spreadValues({}, other), {
|
|
externalSlotProps: resolvedComponentsProps
|
|
}));
|
|
const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, (_b = parameters.additionalProps) == null ? void 0 : _b.ref);
|
|
const props = appendOwnerState_default(elementType, __spreadProps(__spreadValues({}, mergedProps), {
|
|
ref
|
|
}), ownerState);
|
|
return props;
|
|
}
|
|
var useSlotProps_default = useSlotProps;
|
|
|
|
// node_modules/@mui/x-internals/warning/warning.mjs
|
|
var warnedOnceCache = /* @__PURE__ */ new Set();
|
|
function warnOnce(message, gravity = "warning") {
|
|
if (false) {
|
|
return;
|
|
}
|
|
const cleanMessage = Array.isArray(message) ? message.join("\n") : message;
|
|
if (!warnedOnceCache.has(cleanMessage)) {
|
|
warnedOnceCache.add(cleanMessage);
|
|
if (gravity === "error") {
|
|
console.error(cleanMessage);
|
|
} else {
|
|
console.warn(cleanMessage);
|
|
}
|
|
}
|
|
}
|
|
|
|
// node_modules/@mui/x-tree-view/RichTreeView/richTreeViewClasses.mjs
|
|
function getRichTreeViewUtilityClass(slot) {
|
|
return generateUtilityClass("MuiRichTreeView", slot);
|
|
}
|
|
var richTreeViewClasses = generateUtilityClasses("MuiRichTreeView", ["root", "item", "itemContent", "itemGroupTransition", "itemIconContainer", "itemLabel", "itemCheckbox", "itemLabelInput"]);
|
|
|
|
// node_modules/@mui/material/esm/styles/useThemeProps.js
|
|
function useThemeProps2({
|
|
props,
|
|
name
|
|
}) {
|
|
return useThemeProps({
|
|
props,
|
|
name,
|
|
defaultTheme: defaultTheme_default,
|
|
themeId: identifier_default
|
|
});
|
|
}
|
|
|
|
// node_modules/@mui/x-tree-view/internals/zero-styled/index.mjs
|
|
function createUseThemeProps(name) {
|
|
return useThemeProps2;
|
|
}
|
|
|
|
// node_modules/@mui/x-tree-view/internals/TreeViewProvider/TreeViewProvider.mjs
|
|
var React40 = __toESM(require_react(), 1);
|
|
|
|
// node_modules/@base-ui/utils/esm/empty.js
|
|
var EMPTY_ARRAY = Object.freeze([]);
|
|
var EMPTY_OBJECT = Object.freeze({});
|
|
|
|
// node_modules/@mui/x-tree-view/internals/TreeViewProvider/TreeViewContext.mjs
|
|
var React37 = __toESM(require_react(), 1);
|
|
var TreeViewContext = /* @__PURE__ */ React37.createContext(null);
|
|
if (true) TreeViewContext.displayName = "TreeViewContext";
|
|
var useTreeViewContext = () => {
|
|
const context = React37.useContext(TreeViewContext);
|
|
if (context == null) {
|
|
throw new Error(["MUI X: Could not find the Tree View context.", "It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.", "This can also happen if you are bundling multiple versions of the Tree View."].join("\n"));
|
|
}
|
|
return context;
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/TreeViewProvider/TreeViewStyleContext.mjs
|
|
var React38 = __toESM(require_react(), 1);
|
|
var TreeViewStyleContext = /* @__PURE__ */ React38.createContext({
|
|
classes: {},
|
|
slots: {},
|
|
slotProps: {}
|
|
});
|
|
if (true) TreeViewStyleContext.displayName = "TreeViewStyleContext";
|
|
var useTreeViewStyleContext = () => {
|
|
return React38.useContext(TreeViewStyleContext);
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/TreeViewProvider/useTreeViewBuildContext.mjs
|
|
var React39 = __toESM(require_react(), 1);
|
|
var useTreeViewBuildContext = (parameters) => {
|
|
const {
|
|
store,
|
|
apiRef,
|
|
rootRef
|
|
} = parameters;
|
|
const publicAPI = useRefWithInit(() => store.buildPublicAPI()).current;
|
|
initializeInputApiRef(publicAPI, apiRef);
|
|
const runItemPlugins = React39.useCallback((itemPluginProps) => {
|
|
let finalRootRef = null;
|
|
let finalContentRef = null;
|
|
const pluginPropEnhancers = [];
|
|
const pluginPropEnhancersNames = {};
|
|
store.itemPluginManager.listPlugins().forEach((itemPlugin) => {
|
|
const itemPluginResponse = itemPlugin({
|
|
props: itemPluginProps,
|
|
rootRef: finalRootRef,
|
|
contentRef: finalContentRef
|
|
});
|
|
if (itemPluginResponse == null ? void 0 : itemPluginResponse.rootRef) {
|
|
finalRootRef = itemPluginResponse.rootRef;
|
|
}
|
|
if (itemPluginResponse == null ? void 0 : itemPluginResponse.contentRef) {
|
|
finalContentRef = itemPluginResponse.contentRef;
|
|
}
|
|
if (itemPluginResponse == null ? void 0 : itemPluginResponse.propsEnhancers) {
|
|
pluginPropEnhancers.push(itemPluginResponse.propsEnhancers);
|
|
Object.keys(itemPluginResponse.propsEnhancers).forEach((propsEnhancerName) => {
|
|
pluginPropEnhancersNames[propsEnhancerName] = true;
|
|
});
|
|
}
|
|
});
|
|
const resolvePropsEnhancer = (currentSlotName) => (currentSlotParams) => {
|
|
const enhancedProps = {};
|
|
pluginPropEnhancers.forEach((propsEnhancersForCurrentPlugin) => {
|
|
const propsEnhancerForCurrentPluginAndSlot = propsEnhancersForCurrentPlugin[currentSlotName];
|
|
if (propsEnhancerForCurrentPluginAndSlot != null) {
|
|
Object.assign(enhancedProps, propsEnhancerForCurrentPluginAndSlot(currentSlotParams));
|
|
}
|
|
});
|
|
return enhancedProps;
|
|
};
|
|
const propsEnhancers = Object.fromEntries(Object.keys(pluginPropEnhancersNames).map((propEnhancerName) => [propEnhancerName, resolvePropsEnhancer(propEnhancerName)]));
|
|
return {
|
|
contentRef: finalContentRef,
|
|
rootRef: finalRootRef,
|
|
propsEnhancers
|
|
};
|
|
}, [store]);
|
|
const wrapItem = React39.useCallback(({
|
|
itemId,
|
|
children,
|
|
idAttribute
|
|
}) => {
|
|
let finalChildren = children;
|
|
const itemsWrapper = store.itemPluginManager.listWrappers();
|
|
for (let i = itemsWrapper.length - 1; i >= 0; i -= 1) {
|
|
const itemWrapper = itemsWrapper[i];
|
|
finalChildren = itemWrapper({
|
|
store,
|
|
itemId,
|
|
children: finalChildren,
|
|
idAttribute
|
|
});
|
|
}
|
|
return finalChildren;
|
|
}, [store]);
|
|
return React39.useMemo(() => ({
|
|
runItemPlugins,
|
|
wrapItem,
|
|
publicAPI,
|
|
store,
|
|
rootRef
|
|
}), [runItemPlugins, wrapItem, publicAPI, store, rootRef]);
|
|
};
|
|
function initializeInputApiRef(publicAPI, apiRef) {
|
|
if (apiRef != null && apiRef.current !== publicAPI) {
|
|
apiRef.current = publicAPI;
|
|
}
|
|
}
|
|
|
|
// node_modules/@mui/x-tree-view/internals/TreeViewProvider/TreeViewProvider.mjs
|
|
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
|
|
function TreeViewProvider(props) {
|
|
const {
|
|
store,
|
|
apiRef,
|
|
rootRef,
|
|
classes = EMPTY_OBJECT,
|
|
slots = EMPTY_OBJECT,
|
|
slotProps = EMPTY_OBJECT,
|
|
children
|
|
} = props;
|
|
const contextValue = useTreeViewBuildContext({
|
|
store,
|
|
apiRef,
|
|
rootRef
|
|
});
|
|
const styleContextValue = React40.useMemo(() => ({
|
|
classes,
|
|
slots: {
|
|
collapseIcon: slots.collapseIcon,
|
|
expandIcon: slots.expandIcon,
|
|
endIcon: slots.endIcon
|
|
},
|
|
slotProps: {
|
|
collapseIcon: slotProps.collapseIcon,
|
|
expandIcon: slotProps.expandIcon,
|
|
endIcon: slotProps.endIcon
|
|
}
|
|
}), [classes, slots.collapseIcon, slots.expandIcon, slots.endIcon, slotProps.collapseIcon, slotProps.expandIcon, slotProps.endIcon]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TreeViewContext.Provider, {
|
|
value: contextValue,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TreeViewStyleContext.Provider, {
|
|
value: styleContextValue,
|
|
children
|
|
})
|
|
});
|
|
}
|
|
|
|
// node_modules/@mui/x-tree-view/internals/components/RichTreeViewItems.mjs
|
|
var React51 = __toESM(require_react(), 1);
|
|
|
|
// node_modules/@mui/x-internals/fastObjectShallowCompare/fastObjectShallowCompare.mjs
|
|
var is = Object.is;
|
|
function fastObjectShallowCompare(a, b) {
|
|
if (a === b) {
|
|
return true;
|
|
}
|
|
if (!(a instanceof Object) || !(b instanceof Object)) {
|
|
return false;
|
|
}
|
|
let aLength = 0;
|
|
let bLength = 0;
|
|
for (const key in a) {
|
|
aLength += 1;
|
|
if (!is(a[key], b[key])) {
|
|
return false;
|
|
}
|
|
if (!(key in b)) {
|
|
return false;
|
|
}
|
|
}
|
|
for (const _ in b) {
|
|
bLength += 1;
|
|
}
|
|
return aLength === bLength;
|
|
}
|
|
|
|
// node_modules/@mui/x-tree-view/TreeItem/TreeItem.mjs
|
|
var React50 = __toESM(require_react(), 1);
|
|
var import_prop_types25 = __toESM(require_prop_types(), 1);
|
|
|
|
// node_modules/@mui/material/esm/Collapse/Collapse.js
|
|
var React41 = __toESM(require_react(), 1);
|
|
var import_prop_types19 = __toESM(require_prop_types(), 1);
|
|
|
|
// node_modules/@mui/material/esm/transitions/utils.js
|
|
function normalizedTransitionCallback(nodeRef, callback) {
|
|
return (maybeIsAppearing) => {
|
|
if (callback) {
|
|
const node2 = nodeRef.current;
|
|
if (maybeIsAppearing === void 0) {
|
|
callback(node2);
|
|
} else {
|
|
callback(node2, maybeIsAppearing);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
function getTransitionProps(props, options) {
|
|
var _a, _b;
|
|
const {
|
|
timeout: timeout2,
|
|
easing: easing2,
|
|
style: style3 = {}
|
|
} = props;
|
|
return {
|
|
duration: (_a = style3.transitionDuration) != null ? _a : typeof timeout2 === "number" ? timeout2 : timeout2[options.mode] || 0,
|
|
easing: (_b = style3.transitionTimingFunction) != null ? _b : typeof easing2 === "object" ? easing2[options.mode] : easing2,
|
|
delay: style3.transitionDelay
|
|
};
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/Collapse/collapseClasses.js
|
|
function getCollapseUtilityClass(slot) {
|
|
return generateUtilityClass("MuiCollapse", slot);
|
|
}
|
|
var collapseClasses = generateUtilityClasses("MuiCollapse", ["root", "horizontal", "vertical", "entered", "hidden", "wrapper", "wrapperInner"]);
|
|
|
|
// node_modules/@mui/material/esm/Collapse/Collapse.js
|
|
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
|
|
var useUtilityClasses8 = (ownerState) => {
|
|
const {
|
|
orientation,
|
|
classes
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", orientation],
|
|
entered: ["entered"],
|
|
hidden: ["hidden"],
|
|
wrapper: ["wrapper", orientation],
|
|
wrapperInner: ["wrapperInner", orientation]
|
|
};
|
|
return composeClasses(slots, getCollapseUtilityClass, classes);
|
|
};
|
|
var CollapseRoot = styled_default("div", {
|
|
name: "MuiCollapse",
|
|
slot: "Root",
|
|
overridesResolver: (props, styles) => {
|
|
const {
|
|
ownerState
|
|
} = props;
|
|
return [styles.root, styles[ownerState.orientation], ownerState.state === "entered" && styles.entered, ownerState.state === "exited" && !ownerState.in && ownerState.collapsedSize === "0px" && styles.hidden];
|
|
}
|
|
})(memoTheme_default(({
|
|
theme
|
|
}) => ({
|
|
height: 0,
|
|
overflow: "hidden",
|
|
transition: theme.transitions.create("height"),
|
|
variants: [{
|
|
props: {
|
|
orientation: "horizontal"
|
|
},
|
|
style: {
|
|
height: "auto",
|
|
width: 0,
|
|
transition: theme.transitions.create("width")
|
|
}
|
|
}, {
|
|
props: {
|
|
state: "entered"
|
|
},
|
|
style: {
|
|
height: "auto",
|
|
overflow: "visible"
|
|
}
|
|
}, {
|
|
props: {
|
|
state: "entered",
|
|
orientation: "horizontal"
|
|
},
|
|
style: {
|
|
width: "auto"
|
|
}
|
|
}, {
|
|
props: ({
|
|
ownerState
|
|
}) => ownerState.state === "exited" && !ownerState.in && ownerState.collapsedSize === "0px",
|
|
style: {
|
|
visibility: "hidden"
|
|
}
|
|
}]
|
|
})));
|
|
var CollapseWrapper = styled_default("div", {
|
|
name: "MuiCollapse",
|
|
slot: "Wrapper"
|
|
})({
|
|
// Hack to get children with a negative margin to not falsify the height computation.
|
|
display: "flex",
|
|
width: "100%",
|
|
variants: [{
|
|
props: {
|
|
orientation: "horizontal"
|
|
},
|
|
style: {
|
|
width: "auto",
|
|
height: "100%"
|
|
}
|
|
}]
|
|
});
|
|
var CollapseWrapperInner = styled_default("div", {
|
|
name: "MuiCollapse",
|
|
slot: "WrapperInner"
|
|
})({
|
|
width: "100%",
|
|
variants: [{
|
|
props: {
|
|
orientation: "horizontal"
|
|
},
|
|
style: {
|
|
width: "auto",
|
|
height: "100%"
|
|
}
|
|
}]
|
|
});
|
|
var Collapse = /* @__PURE__ */ React41.forwardRef(function Collapse2(inProps, ref) {
|
|
const props = useDefaultProps2({
|
|
props: inProps,
|
|
name: "MuiCollapse"
|
|
});
|
|
const _a = props, {
|
|
addEndListener,
|
|
children,
|
|
className,
|
|
collapsedSize: collapsedSizeProp = "0px",
|
|
component,
|
|
easing: easing2,
|
|
in: inProp,
|
|
onEnter,
|
|
onEntered,
|
|
onEntering,
|
|
onExit,
|
|
onExited,
|
|
onExiting,
|
|
orientation = "vertical",
|
|
slots = {},
|
|
slotProps = {},
|
|
style: style3,
|
|
timeout: timeout2 = duration.standard,
|
|
TransitionComponent: TransitionComponent = Transition_default
|
|
} = _a, other = __objRest(_a, [
|
|
"addEndListener",
|
|
"children",
|
|
"className",
|
|
"collapsedSize",
|
|
"component",
|
|
"easing",
|
|
"in",
|
|
"onEnter",
|
|
"onEntered",
|
|
"onEntering",
|
|
"onExit",
|
|
"onExited",
|
|
"onExiting",
|
|
"orientation",
|
|
"slots",
|
|
"slotProps",
|
|
"style",
|
|
"timeout",
|
|
// eslint-disable-next-line react/prop-types
|
|
"TransitionComponent"
|
|
]);
|
|
const ownerState = __spreadProps(__spreadValues({}, props), {
|
|
orientation,
|
|
collapsedSize: collapsedSizeProp
|
|
});
|
|
const classes = useUtilityClasses8(ownerState);
|
|
const theme = useTheme4();
|
|
const timer = useTimeout();
|
|
const wrapperRef = React41.useRef(null);
|
|
const autoTransitionDuration = React41.useRef();
|
|
const collapsedSize = typeof collapsedSizeProp === "number" ? `${collapsedSizeProp}px` : collapsedSizeProp;
|
|
const isHorizontal = orientation === "horizontal";
|
|
const size = isHorizontal ? "width" : "height";
|
|
const nodeRef = React41.useRef(null);
|
|
const handleRef = useForkRef_default(ref, nodeRef);
|
|
const getWrapperSize = () => wrapperRef.current ? wrapperRef.current[isHorizontal ? "clientWidth" : "clientHeight"] : 0;
|
|
const handleEnter = normalizedTransitionCallback(nodeRef, (node2, isAppearing) => {
|
|
if (wrapperRef.current && isHorizontal) {
|
|
wrapperRef.current.style.position = "absolute";
|
|
}
|
|
node2.style[size] = collapsedSize;
|
|
if (onEnter) {
|
|
onEnter(node2, isAppearing);
|
|
}
|
|
});
|
|
const handleEntering = normalizedTransitionCallback(nodeRef, (node2, isAppearing) => {
|
|
const wrapperSize = getWrapperSize();
|
|
if (wrapperRef.current && isHorizontal) {
|
|
wrapperRef.current.style.position = "";
|
|
}
|
|
const {
|
|
duration: transitionDuration,
|
|
easing: transitionTimingFunction
|
|
} = getTransitionProps({
|
|
style: style3,
|
|
timeout: timeout2,
|
|
easing: easing2
|
|
}, {
|
|
mode: "enter"
|
|
});
|
|
if (timeout2 === "auto") {
|
|
const duration2 = theme.transitions.getAutoHeightDuration(wrapperSize);
|
|
node2.style.transitionDuration = `${duration2}ms`;
|
|
autoTransitionDuration.current = duration2;
|
|
} else {
|
|
node2.style.transitionDuration = typeof transitionDuration === "string" ? transitionDuration : `${transitionDuration}ms`;
|
|
}
|
|
node2.style[size] = `${wrapperSize}px`;
|
|
node2.style.transitionTimingFunction = transitionTimingFunction;
|
|
if (onEntering) {
|
|
onEntering(node2, isAppearing);
|
|
}
|
|
});
|
|
const handleEntered = normalizedTransitionCallback(nodeRef, (node2, isAppearing) => {
|
|
node2.style[size] = "auto";
|
|
if (onEntered) {
|
|
onEntered(node2, isAppearing);
|
|
}
|
|
});
|
|
const handleExit = normalizedTransitionCallback(nodeRef, (node2) => {
|
|
node2.style[size] = `${getWrapperSize()}px`;
|
|
if (onExit) {
|
|
onExit(node2);
|
|
}
|
|
});
|
|
const handleExited = normalizedTransitionCallback(nodeRef, onExited);
|
|
const handleExiting = normalizedTransitionCallback(nodeRef, (node2) => {
|
|
const wrapperSize = getWrapperSize();
|
|
const {
|
|
duration: transitionDuration,
|
|
easing: transitionTimingFunction
|
|
} = getTransitionProps({
|
|
style: style3,
|
|
timeout: timeout2,
|
|
easing: easing2
|
|
}, {
|
|
mode: "exit"
|
|
});
|
|
if (timeout2 === "auto") {
|
|
const duration2 = theme.transitions.getAutoHeightDuration(wrapperSize);
|
|
node2.style.transitionDuration = `${duration2}ms`;
|
|
autoTransitionDuration.current = duration2;
|
|
} else {
|
|
node2.style.transitionDuration = typeof transitionDuration === "string" ? transitionDuration : `${transitionDuration}ms`;
|
|
}
|
|
node2.style[size] = collapsedSize;
|
|
node2.style.transitionTimingFunction = transitionTimingFunction;
|
|
if (onExiting) {
|
|
onExiting(node2);
|
|
}
|
|
});
|
|
const handleAddEndListener = (next2) => {
|
|
if (timeout2 === "auto") {
|
|
timer.start(autoTransitionDuration.current || 0, next2);
|
|
}
|
|
if (addEndListener) {
|
|
addEndListener(nodeRef.current, next2);
|
|
}
|
|
};
|
|
const externalForwardedProps = {
|
|
slots,
|
|
slotProps,
|
|
component
|
|
};
|
|
const [RootSlot, rootSlotProps] = useSlot("root", {
|
|
ref: handleRef,
|
|
className: clsx_default(classes.root, className),
|
|
elementType: CollapseRoot,
|
|
externalForwardedProps,
|
|
ownerState,
|
|
additionalProps: {
|
|
style: __spreadValues({
|
|
[isHorizontal ? "minWidth" : "minHeight"]: collapsedSize
|
|
}, style3)
|
|
}
|
|
});
|
|
const [WrapperSlot, wrapperSlotProps] = useSlot("wrapper", {
|
|
ref: wrapperRef,
|
|
className: classes.wrapper,
|
|
elementType: CollapseWrapper,
|
|
externalForwardedProps,
|
|
ownerState
|
|
});
|
|
const [WrapperInnerSlot, wrapperInnerSlotProps] = useSlot("wrapperInner", {
|
|
className: classes.wrapperInner,
|
|
elementType: CollapseWrapperInner,
|
|
externalForwardedProps,
|
|
ownerState
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TransitionComponent, __spreadProps(__spreadValues({
|
|
in: inProp,
|
|
onEnter: handleEnter,
|
|
onEntered: handleEntered,
|
|
onEntering: handleEntering,
|
|
onExit: handleExit,
|
|
onExited: handleExited,
|
|
onExiting: handleExiting,
|
|
addEndListener: handleAddEndListener,
|
|
nodeRef,
|
|
timeout: timeout2 === "auto" ? null : timeout2
|
|
}, other), {
|
|
children: (state, _b) => {
|
|
var _c = _b, {
|
|
ownerState: incomingOwnerState
|
|
} = _c, restChildProps = __objRest(_c, [
|
|
"ownerState"
|
|
]);
|
|
const stateOwnerState = __spreadProps(__spreadValues({}, ownerState), {
|
|
state
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(RootSlot, __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, rootSlotProps), {
|
|
className: clsx_default(rootSlotProps.className, {
|
|
"entered": classes.entered,
|
|
"exited": !inProp && collapsedSize === "0px" && classes.hidden
|
|
}[state]),
|
|
ownerState: stateOwnerState
|
|
}), restChildProps), {
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(WrapperSlot, __spreadProps(__spreadValues({}, wrapperSlotProps), {
|
|
ownerState: stateOwnerState,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(WrapperInnerSlot, __spreadProps(__spreadValues({}, wrapperInnerSlotProps), {
|
|
ownerState: stateOwnerState,
|
|
children
|
|
}))
|
|
}))
|
|
}));
|
|
}
|
|
}));
|
|
});
|
|
true ? Collapse.propTypes = {
|
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
/**
|
|
* Add a custom transition end trigger. Called with the transitioning DOM
|
|
* node and a done callback. Allows for more fine grained transition end
|
|
* logic. Note: Timeouts are still used as a fallback if provided.
|
|
*/
|
|
addEndListener: import_prop_types19.default.func,
|
|
/**
|
|
* The content node to be collapsed.
|
|
*/
|
|
children: import_prop_types19.default.node,
|
|
/**
|
|
* Override or extend the styles applied to the component.
|
|
*/
|
|
classes: import_prop_types19.default.object,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
className: import_prop_types19.default.string,
|
|
/**
|
|
* The width (horizontal) or height (vertical) of the container when collapsed.
|
|
* @default '0px'
|
|
*/
|
|
collapsedSize: import_prop_types19.default.oneOfType([import_prop_types19.default.number, import_prop_types19.default.string]),
|
|
/**
|
|
* The component used for the root node.
|
|
* Either a string to use a HTML element or a component.
|
|
*/
|
|
component: elementTypeAcceptingRef_default,
|
|
/**
|
|
* The transition timing function.
|
|
* You may specify a single easing or a object containing enter and exit values.
|
|
*/
|
|
easing: import_prop_types19.default.oneOfType([import_prop_types19.default.shape({
|
|
enter: import_prop_types19.default.string,
|
|
exit: import_prop_types19.default.string
|
|
}), import_prop_types19.default.string]),
|
|
/**
|
|
* If `true`, the component will transition in.
|
|
*/
|
|
in: import_prop_types19.default.bool,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onEnter: import_prop_types19.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onEntered: import_prop_types19.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onEntering: import_prop_types19.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onExit: import_prop_types19.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onExited: import_prop_types19.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onExiting: import_prop_types19.default.func,
|
|
/**
|
|
* The transition orientation.
|
|
* @default 'vertical'
|
|
*/
|
|
orientation: import_prop_types19.default.oneOf(["horizontal", "vertical"]),
|
|
/**
|
|
* The props used for each slot inside.
|
|
* @default {}
|
|
*/
|
|
slotProps: import_prop_types19.default.shape({
|
|
root: import_prop_types19.default.oneOfType([import_prop_types19.default.func, import_prop_types19.default.object]),
|
|
wrapper: import_prop_types19.default.oneOfType([import_prop_types19.default.func, import_prop_types19.default.object]),
|
|
wrapperInner: import_prop_types19.default.oneOfType([import_prop_types19.default.func, import_prop_types19.default.object])
|
|
}),
|
|
/**
|
|
* The components used for each slot inside.
|
|
* @default {}
|
|
*/
|
|
slots: import_prop_types19.default.shape({
|
|
root: import_prop_types19.default.elementType,
|
|
wrapper: import_prop_types19.default.elementType,
|
|
wrapperInner: import_prop_types19.default.elementType
|
|
}),
|
|
/**
|
|
* @ignore
|
|
*/
|
|
style: import_prop_types19.default.object,
|
|
/**
|
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
*/
|
|
sx: import_prop_types19.default.oneOfType([import_prop_types19.default.arrayOf(import_prop_types19.default.oneOfType([import_prop_types19.default.func, import_prop_types19.default.object, import_prop_types19.default.bool])), import_prop_types19.default.func, import_prop_types19.default.object]),
|
|
/**
|
|
* The duration for the transition, in milliseconds.
|
|
* You may specify a single timeout for all transitions, or individually with an object.
|
|
*
|
|
* Set to 'auto' to automatically calculate transition time based on height.
|
|
* @default duration.standard
|
|
*/
|
|
timeout: import_prop_types19.default.oneOfType([import_prop_types19.default.oneOf(["auto"]), import_prop_types19.default.number, import_prop_types19.default.shape({
|
|
appear: import_prop_types19.default.number,
|
|
enter: import_prop_types19.default.number,
|
|
exit: import_prop_types19.default.number
|
|
})])
|
|
} : void 0;
|
|
if (Collapse) {
|
|
Collapse.muiSupportAuto = true;
|
|
}
|
|
var Collapse_default = Collapse;
|
|
|
|
// node_modules/@mui/material/esm/Checkbox/Checkbox.js
|
|
var React45 = __toESM(require_react(), 1);
|
|
var import_prop_types21 = __toESM(require_prop_types(), 1);
|
|
|
|
// node_modules/@mui/material/esm/internal/SwitchBase.js
|
|
var React44 = __toESM(require_react(), 1);
|
|
var import_prop_types20 = __toESM(require_prop_types(), 1);
|
|
|
|
// node_modules/@mui/material/esm/FormControl/useFormControl.js
|
|
var React43 = __toESM(require_react(), 1);
|
|
|
|
// node_modules/@mui/material/esm/FormControl/FormControlContext.js
|
|
var React42 = __toESM(require_react(), 1);
|
|
var FormControlContext = /* @__PURE__ */ React42.createContext(void 0);
|
|
if (true) {
|
|
FormControlContext.displayName = "FormControlContext";
|
|
}
|
|
var FormControlContext_default = FormControlContext;
|
|
|
|
// node_modules/@mui/material/esm/FormControl/useFormControl.js
|
|
function useFormControl() {
|
|
return React43.useContext(FormControlContext_default);
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/internal/switchBaseClasses.js
|
|
function getSwitchBaseUtilityClass(slot) {
|
|
return generateUtilityClass("PrivateSwitchBase", slot);
|
|
}
|
|
var switchBaseClasses = generateUtilityClasses("PrivateSwitchBase", ["root", "checked", "disabled", "input", "edgeStart", "edgeEnd"]);
|
|
|
|
// node_modules/@mui/material/esm/internal/SwitchBase.js
|
|
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
|
|
var useUtilityClasses9 = (ownerState) => {
|
|
const {
|
|
classes,
|
|
checked,
|
|
disabled,
|
|
edge
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", checked && "checked", disabled && "disabled", edge && `edge${capitalize_default(edge)}`],
|
|
input: ["input"]
|
|
};
|
|
return composeClasses(slots, getSwitchBaseUtilityClass, classes);
|
|
};
|
|
var SwitchBaseRoot = styled_default(ButtonBase_default, {
|
|
name: "MuiSwitchBase"
|
|
})({
|
|
padding: 9,
|
|
borderRadius: "50%",
|
|
variants: [{
|
|
props: {
|
|
edge: "start",
|
|
size: "small"
|
|
},
|
|
style: {
|
|
marginLeft: -3
|
|
}
|
|
}, {
|
|
props: ({
|
|
edge,
|
|
ownerState
|
|
}) => edge === "start" && ownerState.size !== "small",
|
|
style: {
|
|
marginLeft: -12
|
|
}
|
|
}, {
|
|
props: {
|
|
edge: "end",
|
|
size: "small"
|
|
},
|
|
style: {
|
|
marginRight: -3
|
|
}
|
|
}, {
|
|
props: ({
|
|
edge,
|
|
ownerState
|
|
}) => edge === "end" && ownerState.size !== "small",
|
|
style: {
|
|
marginRight: -12
|
|
}
|
|
}]
|
|
});
|
|
var SwitchBaseInput = styled_default("input", {
|
|
name: "MuiSwitchBase",
|
|
shouldForwardProp: rootShouldForwardProp_default
|
|
})({
|
|
cursor: "inherit",
|
|
position: "absolute",
|
|
opacity: 0,
|
|
width: "100%",
|
|
height: "100%",
|
|
top: 0,
|
|
left: 0,
|
|
margin: 0,
|
|
padding: 0,
|
|
zIndex: 1
|
|
});
|
|
var SwitchBase = /* @__PURE__ */ React44.forwardRef(function SwitchBase2(props, ref) {
|
|
const _a = props, {
|
|
autoFocus,
|
|
checked: checkedProp,
|
|
checkedIcon,
|
|
defaultChecked,
|
|
disabled: disabledProp,
|
|
disableFocusRipple = false,
|
|
edge = false,
|
|
icon,
|
|
id,
|
|
inputProps,
|
|
inputRef,
|
|
name,
|
|
onBlur,
|
|
onChange,
|
|
onFocus,
|
|
readOnly,
|
|
required = false,
|
|
tabIndex,
|
|
type,
|
|
value,
|
|
slots = {},
|
|
slotProps = {}
|
|
} = _a, other = __objRest(_a, [
|
|
"autoFocus",
|
|
"checked",
|
|
"checkedIcon",
|
|
"defaultChecked",
|
|
"disabled",
|
|
"disableFocusRipple",
|
|
"edge",
|
|
"icon",
|
|
"id",
|
|
"inputProps",
|
|
"inputRef",
|
|
"name",
|
|
"onBlur",
|
|
"onChange",
|
|
"onFocus",
|
|
"readOnly",
|
|
"required",
|
|
"tabIndex",
|
|
"type",
|
|
"value",
|
|
"slots",
|
|
"slotProps"
|
|
]);
|
|
const [checked, setCheckedState] = useControlled_default({
|
|
controlled: checkedProp,
|
|
default: Boolean(defaultChecked),
|
|
name: "SwitchBase",
|
|
state: "checked"
|
|
});
|
|
const muiFormControl = useFormControl();
|
|
const handleFocus = (event) => {
|
|
if (onFocus) {
|
|
onFocus(event);
|
|
}
|
|
if (muiFormControl && muiFormControl.onFocus) {
|
|
muiFormControl.onFocus(event);
|
|
}
|
|
};
|
|
const handleBlur = (event) => {
|
|
if (onBlur) {
|
|
onBlur(event);
|
|
}
|
|
if (muiFormControl && muiFormControl.onBlur) {
|
|
muiFormControl.onBlur(event);
|
|
}
|
|
};
|
|
const handleInputChange = (event) => {
|
|
if (event.nativeEvent.defaultPrevented || readOnly) {
|
|
return;
|
|
}
|
|
const newChecked = event.target.checked;
|
|
setCheckedState(newChecked);
|
|
if (onChange) {
|
|
onChange(event, newChecked);
|
|
}
|
|
};
|
|
let disabled = disabledProp;
|
|
if (muiFormControl) {
|
|
if (typeof disabled === "undefined") {
|
|
disabled = muiFormControl.disabled;
|
|
}
|
|
}
|
|
const hasLabelFor = type === "checkbox" || type === "radio";
|
|
const ownerState = __spreadProps(__spreadValues({}, props), {
|
|
checked,
|
|
disabled,
|
|
disableFocusRipple,
|
|
edge
|
|
});
|
|
const classes = useUtilityClasses9(ownerState);
|
|
const externalForwardedProps = {
|
|
slots,
|
|
slotProps: __spreadValues({
|
|
input: inputProps
|
|
}, slotProps)
|
|
};
|
|
const [RootSlot, rootSlotProps] = useSlot("root", {
|
|
ref,
|
|
elementType: SwitchBaseRoot,
|
|
className: classes.root,
|
|
shouldForwardComponentProp: true,
|
|
externalForwardedProps: __spreadValues(__spreadProps(__spreadValues({}, externalForwardedProps), {
|
|
component: "span"
|
|
}), other),
|
|
getSlotProps: (handlers) => __spreadProps(__spreadValues({}, handlers), {
|
|
onFocus: (event) => {
|
|
var _a2;
|
|
(_a2 = handlers.onFocus) == null ? void 0 : _a2.call(handlers, event);
|
|
handleFocus(event);
|
|
},
|
|
onBlur: (event) => {
|
|
var _a2;
|
|
(_a2 = handlers.onBlur) == null ? void 0 : _a2.call(handlers, event);
|
|
handleBlur(event);
|
|
}
|
|
}),
|
|
ownerState,
|
|
additionalProps: {
|
|
centerRipple: true,
|
|
focusRipple: !disableFocusRipple,
|
|
role: void 0,
|
|
tabIndex: null
|
|
}
|
|
});
|
|
const [InputSlot, inputSlotProps] = useSlot("input", {
|
|
ref: inputRef,
|
|
elementType: SwitchBaseInput,
|
|
className: classes.input,
|
|
externalForwardedProps,
|
|
getSlotProps: (handlers) => __spreadProps(__spreadValues({}, handlers), {
|
|
onChange: (event) => {
|
|
var _a2;
|
|
(_a2 = handlers.onChange) == null ? void 0 : _a2.call(handlers, event);
|
|
handleInputChange(event);
|
|
}
|
|
}),
|
|
ownerState,
|
|
additionalProps: __spreadValues({
|
|
autoFocus,
|
|
checked: checkedProp,
|
|
defaultChecked,
|
|
disabled,
|
|
id: hasLabelFor ? id : void 0,
|
|
name,
|
|
readOnly,
|
|
required,
|
|
tabIndex,
|
|
type
|
|
}, type === "checkbox" && value === void 0 ? {} : {
|
|
value
|
|
})
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(RootSlot, __spreadProps(__spreadValues({}, rootSlotProps), {
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(InputSlot, __spreadValues({}, inputSlotProps)), checked ? checkedIcon : icon]
|
|
}));
|
|
});
|
|
true ? SwitchBase.propTypes = {
|
|
/**
|
|
* If `true`, the `input` element is focused during the first mount.
|
|
*/
|
|
autoFocus: import_prop_types20.default.bool,
|
|
/**
|
|
* If `true`, the component is checked.
|
|
*/
|
|
checked: import_prop_types20.default.bool,
|
|
/**
|
|
* The icon to display when the component is checked.
|
|
*/
|
|
checkedIcon: import_prop_types20.default.node.isRequired,
|
|
/**
|
|
* Override or extend the styles applied to the component.
|
|
*/
|
|
classes: import_prop_types20.default.object,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
className: import_prop_types20.default.string,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
defaultChecked: import_prop_types20.default.bool,
|
|
/**
|
|
* If `true`, the component is disabled.
|
|
*/
|
|
disabled: import_prop_types20.default.bool,
|
|
/**
|
|
* If `true`, the keyboard focus ripple is disabled.
|
|
* @default false
|
|
*/
|
|
disableFocusRipple: import_prop_types20.default.bool,
|
|
/**
|
|
* If given, uses a negative margin to counteract the padding on one
|
|
* side (this is often helpful for aligning the left or right
|
|
* side of the icon with content above or below, without ruining the border
|
|
* size and shape).
|
|
* @default false
|
|
*/
|
|
edge: import_prop_types20.default.oneOf(["end", "start", false]),
|
|
/**
|
|
* The icon to display when the component is unchecked.
|
|
*/
|
|
icon: import_prop_types20.default.node.isRequired,
|
|
/**
|
|
* The id of the `input` element.
|
|
*/
|
|
id: import_prop_types20.default.string,
|
|
/**
|
|
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#attributes) applied to the `input` element.
|
|
*/
|
|
inputProps: import_prop_types20.default.object,
|
|
/**
|
|
* Pass a ref to the `input` element.
|
|
*/
|
|
inputRef: refType_default,
|
|
/*
|
|
* @ignore
|
|
*/
|
|
name: import_prop_types20.default.string,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onBlur: import_prop_types20.default.func,
|
|
/**
|
|
* Callback fired when the state is changed.
|
|
*
|
|
* @param {object} event The event source of the callback.
|
|
* You can pull out the new checked state by accessing `event.target.checked` (boolean).
|
|
*/
|
|
onChange: import_prop_types20.default.func,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
onFocus: import_prop_types20.default.func,
|
|
/**
|
|
* It prevents the user from changing the value of the field
|
|
* (not from interacting with the field).
|
|
*/
|
|
readOnly: import_prop_types20.default.bool,
|
|
/**
|
|
* If `true`, the `input` element is required.
|
|
*/
|
|
required: import_prop_types20.default.bool,
|
|
/**
|
|
* The props used for each slot inside.
|
|
* @default {}
|
|
*/
|
|
slotProps: import_prop_types20.default.shape({
|
|
input: import_prop_types20.default.oneOfType([import_prop_types20.default.func, import_prop_types20.default.object]),
|
|
root: import_prop_types20.default.oneOfType([import_prop_types20.default.func, import_prop_types20.default.object])
|
|
}),
|
|
/**
|
|
* The components used for each slot inside.
|
|
* @default {}
|
|
*/
|
|
slots: import_prop_types20.default.shape({
|
|
input: import_prop_types20.default.elementType,
|
|
root: import_prop_types20.default.elementType
|
|
}),
|
|
/**
|
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
*/
|
|
sx: import_prop_types20.default.object,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
tabIndex: import_prop_types20.default.oneOfType([import_prop_types20.default.number, import_prop_types20.default.string]),
|
|
/**
|
|
* The input component prop `type`.
|
|
*/
|
|
type: import_prop_types20.default.string.isRequired,
|
|
/**
|
|
* The value of the component.
|
|
*/
|
|
value: import_prop_types20.default.any
|
|
} : void 0;
|
|
var SwitchBase_default = SwitchBase;
|
|
|
|
// node_modules/@mui/material/esm/internal/svg-icons/CheckBoxOutlineBlank.js
|
|
var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
|
|
var CheckBoxOutlineBlank_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", {
|
|
d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
|
|
}), "CheckBoxOutlineBlank");
|
|
|
|
// node_modules/@mui/material/esm/internal/svg-icons/CheckBox.js
|
|
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
|
|
var CheckBox_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("path", {
|
|
d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
|
}), "CheckBox");
|
|
|
|
// node_modules/@mui/material/esm/internal/svg-icons/IndeterminateCheckBox.js
|
|
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
|
|
var IndeterminateCheckBox_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("path", {
|
|
d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"
|
|
}), "IndeterminateCheckBox");
|
|
|
|
// node_modules/@mui/material/esm/Checkbox/checkboxClasses.js
|
|
function getCheckboxUtilityClass(slot) {
|
|
return generateUtilityClass("MuiCheckbox", slot);
|
|
}
|
|
var checkboxClasses = generateUtilityClasses("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "colorPrimary", "colorSecondary", "sizeSmall", "sizeMedium"]);
|
|
var checkboxClasses_default = checkboxClasses;
|
|
|
|
// node_modules/@mui/material/esm/Checkbox/Checkbox.js
|
|
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
|
|
var useUtilityClasses10 = (ownerState) => {
|
|
const {
|
|
classes,
|
|
indeterminate,
|
|
color: color2,
|
|
size
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", indeterminate && "indeterminate", `color${capitalize_default(color2)}`, `size${capitalize_default(size)}`]
|
|
};
|
|
const composedClasses = composeClasses(slots, getCheckboxUtilityClass, classes);
|
|
return __spreadValues(__spreadValues({}, classes), composedClasses);
|
|
};
|
|
var CheckboxRoot = styled_default(SwitchBase_default, {
|
|
shouldForwardProp: (prop) => rootShouldForwardProp_default(prop) || prop === "classes",
|
|
name: "MuiCheckbox",
|
|
slot: "Root",
|
|
overridesResolver: (props, styles) => {
|
|
const {
|
|
ownerState
|
|
} = props;
|
|
return [styles.root, ownerState.indeterminate && styles.indeterminate, styles[`size${capitalize_default(ownerState.size)}`], ownerState.color !== "default" && styles[`color${capitalize_default(ownerState.color)}`]];
|
|
}
|
|
})(memoTheme_default(({
|
|
theme
|
|
}) => ({
|
|
color: (theme.vars || theme).palette.text.secondary,
|
|
variants: [{
|
|
props: {
|
|
color: "default",
|
|
disableRipple: false
|
|
},
|
|
style: {
|
|
"&:hover": {
|
|
backgroundColor: theme.alpha((theme.vars || theme).palette.action.active, (theme.vars || theme).palette.action.hoverOpacity)
|
|
}
|
|
}
|
|
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color2]) => ({
|
|
props: {
|
|
color: color2,
|
|
disableRipple: false
|
|
},
|
|
style: {
|
|
"&:hover": {
|
|
backgroundColor: theme.alpha((theme.vars || theme).palette[color2].main, (theme.vars || theme).palette.action.hoverOpacity)
|
|
}
|
|
}
|
|
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color2]) => ({
|
|
props: {
|
|
color: color2
|
|
},
|
|
style: {
|
|
[`&.${checkboxClasses_default.checked}, &.${checkboxClasses_default.indeterminate}`]: {
|
|
color: (theme.vars || theme).palette[color2].main
|
|
},
|
|
[`&.${checkboxClasses_default.disabled}`]: {
|
|
color: (theme.vars || theme).palette.action.disabled
|
|
}
|
|
}
|
|
})), {
|
|
// Should be last to override other colors
|
|
props: {
|
|
disableRipple: false
|
|
},
|
|
style: {
|
|
// Reset on touch devices, it doesn't add specificity
|
|
"&:hover": {
|
|
"@media (hover: none)": {
|
|
backgroundColor: "transparent"
|
|
}
|
|
}
|
|
}
|
|
}]
|
|
})));
|
|
var defaultCheckedIcon = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CheckBox_default, {});
|
|
var defaultIcon = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CheckBoxOutlineBlank_default, {});
|
|
var defaultIndeterminateIcon = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IndeterminateCheckBox_default, {});
|
|
var Checkbox = /* @__PURE__ */ React45.forwardRef(function Checkbox2(inProps, ref) {
|
|
var _b, _c, _d;
|
|
const props = useDefaultProps2({
|
|
props: inProps,
|
|
name: "MuiCheckbox"
|
|
});
|
|
const _a = props, {
|
|
checkedIcon = defaultCheckedIcon,
|
|
color: color2 = "primary",
|
|
icon: iconProp = defaultIcon,
|
|
indeterminate = false,
|
|
indeterminateIcon: indeterminateIconProp = defaultIndeterminateIcon,
|
|
inputProps,
|
|
size = "medium",
|
|
disableRipple = false,
|
|
className,
|
|
slots = {},
|
|
slotProps = {}
|
|
} = _a, other = __objRest(_a, [
|
|
"checkedIcon",
|
|
"color",
|
|
"icon",
|
|
"indeterminate",
|
|
"indeterminateIcon",
|
|
"inputProps",
|
|
"size",
|
|
"disableRipple",
|
|
"className",
|
|
"slots",
|
|
"slotProps"
|
|
]);
|
|
const icon = indeterminate ? indeterminateIconProp : iconProp;
|
|
const indeterminateIcon = indeterminate ? indeterminateIconProp : checkedIcon;
|
|
const ownerState = __spreadProps(__spreadValues({}, props), {
|
|
disableRipple,
|
|
color: color2,
|
|
indeterminate,
|
|
size
|
|
});
|
|
const classes = useUtilityClasses10(ownerState);
|
|
const externalInputProps = (_b = slotProps.input) != null ? _b : inputProps;
|
|
const [RootSlot, rootSlotProps] = useSlot("root", {
|
|
ref,
|
|
elementType: CheckboxRoot,
|
|
className: clsx_default(classes.root, className),
|
|
shouldForwardComponentProp: true,
|
|
externalForwardedProps: __spreadValues({
|
|
slots,
|
|
slotProps
|
|
}, other),
|
|
ownerState,
|
|
additionalProps: {
|
|
type: "checkbox",
|
|
icon: /* @__PURE__ */ React45.cloneElement(icon, {
|
|
fontSize: (_c = icon.props.fontSize) != null ? _c : size
|
|
}),
|
|
checkedIcon: /* @__PURE__ */ React45.cloneElement(indeterminateIcon, {
|
|
fontSize: (_d = indeterminateIcon.props.fontSize) != null ? _d : size
|
|
}),
|
|
disableRipple,
|
|
slots,
|
|
slotProps: {
|
|
input: mergeSlotProps2(typeof externalInputProps === "function" ? externalInputProps(ownerState) : externalInputProps, {
|
|
"data-indeterminate": indeterminate,
|
|
"aria-checked": indeterminate ? "mixed" : void 0
|
|
})
|
|
}
|
|
}
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(RootSlot, __spreadProps(__spreadValues({}, rootSlotProps), {
|
|
classes
|
|
}));
|
|
});
|
|
true ? Checkbox.propTypes = {
|
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
/**
|
|
* If `true`, the component is checked.
|
|
*/
|
|
checked: import_prop_types21.default.bool,
|
|
/**
|
|
* The icon to display when the component is checked.
|
|
* @default <CheckBoxIcon />
|
|
*/
|
|
checkedIcon: import_prop_types21.default.node,
|
|
/**
|
|
* Override or extend the styles applied to the component.
|
|
*/
|
|
classes: import_prop_types21.default.object,
|
|
/**
|
|
* @ignore
|
|
*/
|
|
className: import_prop_types21.default.string,
|
|
/**
|
|
* The color of the component.
|
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
* @default 'primary'
|
|
*/
|
|
color: import_prop_types21.default.oneOfType([import_prop_types21.default.oneOf(["default", "primary", "secondary", "error", "info", "success", "warning"]), import_prop_types21.default.string]),
|
|
/**
|
|
* The default checked state. Use when the component is not controlled.
|
|
*/
|
|
defaultChecked: import_prop_types21.default.bool,
|
|
/**
|
|
* If `true`, the component is disabled.
|
|
* @default false
|
|
*/
|
|
disabled: import_prop_types21.default.bool,
|
|
/**
|
|
* If `true`, the ripple effect is disabled.
|
|
* @default false
|
|
*/
|
|
disableRipple: import_prop_types21.default.bool,
|
|
/**
|
|
* The icon to display when the component is unchecked.
|
|
* @default <CheckBoxOutlineBlankIcon />
|
|
*/
|
|
icon: import_prop_types21.default.node,
|
|
/**
|
|
* The id of the `input` element.
|
|
*/
|
|
id: import_prop_types21.default.string,
|
|
/**
|
|
* If `true`, the component appears indeterminate.
|
|
* This does not set the native input element to indeterminate due
|
|
* to inconsistent behavior across browsers.
|
|
* However, we set a `data-indeterminate` attribute on the `input`.
|
|
* @default false
|
|
*/
|
|
indeterminate: import_prop_types21.default.bool,
|
|
/**
|
|
* The icon to display when the component is indeterminate.
|
|
* @default <IndeterminateCheckBoxIcon />
|
|
*/
|
|
indeterminateIcon: import_prop_types21.default.node,
|
|
/**
|
|
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#attributes) applied to the `input` element.
|
|
* @deprecated Use `slotProps.input` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
*/
|
|
inputProps: import_prop_types21.default.object,
|
|
/**
|
|
* Callback fired when the state is changed.
|
|
*
|
|
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
* You can pull out the new checked state by accessing `event.target.checked` (boolean).
|
|
*/
|
|
onChange: import_prop_types21.default.func,
|
|
/**
|
|
* If `true`, the `input` element is required.
|
|
* @default false
|
|
*/
|
|
required: import_prop_types21.default.bool,
|
|
/**
|
|
* The size of the component.
|
|
* `small` is equivalent to the dense checkbox styling.
|
|
* @default 'medium'
|
|
*/
|
|
size: import_prop_types21.default.oneOfType([import_prop_types21.default.oneOf(["medium", "small"]), import_prop_types21.default.string]),
|
|
/**
|
|
* The props used for each slot inside.
|
|
* @default {}
|
|
*/
|
|
slotProps: import_prop_types21.default.shape({
|
|
input: import_prop_types21.default.oneOfType([import_prop_types21.default.func, import_prop_types21.default.object]),
|
|
root: import_prop_types21.default.oneOfType([import_prop_types21.default.func, import_prop_types21.default.object])
|
|
}),
|
|
/**
|
|
* The components used for each slot inside.
|
|
* @default {}
|
|
*/
|
|
slots: import_prop_types21.default.shape({
|
|
input: import_prop_types21.default.elementType,
|
|
root: import_prop_types21.default.elementType
|
|
}),
|
|
/**
|
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
*/
|
|
sx: import_prop_types21.default.oneOfType([import_prop_types21.default.arrayOf(import_prop_types21.default.oneOfType([import_prop_types21.default.func, import_prop_types21.default.object, import_prop_types21.default.bool])), import_prop_types21.default.func, import_prop_types21.default.object]),
|
|
/**
|
|
* The value of the component. The DOM API casts this to a string.
|
|
* The browser uses "on" as the default value.
|
|
*/
|
|
value: import_prop_types21.default.any
|
|
} : void 0;
|
|
var Checkbox_default = Checkbox;
|
|
|
|
// node_modules/@mui/x-tree-view/useTreeItem/useTreeItem.mjs
|
|
var React47 = __toESM(require_react(), 1);
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/items/utils.mjs
|
|
var TREE_VIEW_ROOT_PARENT_ID = "__TREE_VIEW_ROOT_PARENT_ID__";
|
|
var buildSiblingIndexes = (siblings) => {
|
|
const siblingsIndexLookup = {};
|
|
siblings.forEach((childId, index) => {
|
|
siblingsIndexLookup[childId] = index;
|
|
});
|
|
return siblingsIndexLookup;
|
|
};
|
|
var isItemDisabled = (itemMetaLookup, itemId) => {
|
|
if (itemId == null) {
|
|
return false;
|
|
}
|
|
let itemMeta = itemMetaLookup[itemId];
|
|
if (!itemMeta) {
|
|
return false;
|
|
}
|
|
if (itemMeta.disabled) {
|
|
return true;
|
|
}
|
|
while (itemMeta.parentId != null) {
|
|
itemMeta = itemMetaLookup[itemMeta.parentId];
|
|
if (!itemMeta) {
|
|
return false;
|
|
}
|
|
if (itemMeta.disabled) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
function buildItemsLookups(parameters) {
|
|
const {
|
|
storeParameters,
|
|
items,
|
|
parentId,
|
|
depth,
|
|
isItemExpandable,
|
|
otherItemsMetaLookup
|
|
} = parameters;
|
|
const metaLookup = {};
|
|
const modelLookup = {};
|
|
const orderedChildrenIds = [];
|
|
const itemsChildren = [];
|
|
const processItem = (item) => {
|
|
const id = storeParameters.getItemId ? storeParameters.getItemId(item) : item.id;
|
|
checkId({
|
|
id,
|
|
parentId,
|
|
item,
|
|
itemMetaLookup: otherItemsMetaLookup,
|
|
siblingsMetaLookup: metaLookup
|
|
});
|
|
const label = storeParameters.getItemLabel ? storeParameters.getItemLabel(item) : item.label;
|
|
if (label == null) {
|
|
throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.", "An item was provided without label in the `items` prop:", JSON.stringify(item)].join("\n"));
|
|
}
|
|
const children = (storeParameters.getItemChildren ? storeParameters.getItemChildren(item) : item.children) || [];
|
|
itemsChildren.push({
|
|
id,
|
|
children
|
|
});
|
|
modelLookup[id] = item;
|
|
metaLookup[id] = {
|
|
id,
|
|
label,
|
|
parentId,
|
|
idAttribute: void 0,
|
|
expandable: isItemExpandable(item, children),
|
|
disabled: storeParameters.isItemDisabled ? storeParameters.isItemDisabled(item) : false,
|
|
selectable: storeParameters.isItemSelectionDisabled ? !storeParameters.isItemSelectionDisabled(item) : true,
|
|
depth
|
|
};
|
|
orderedChildrenIds.push(id);
|
|
};
|
|
for (const item of items) {
|
|
processItem(item);
|
|
}
|
|
return {
|
|
metaLookup,
|
|
modelLookup,
|
|
orderedChildrenIds,
|
|
childrenIndexes: buildSiblingIndexes(orderedChildrenIds),
|
|
itemsChildren
|
|
};
|
|
}
|
|
function checkId({
|
|
id,
|
|
parentId,
|
|
item,
|
|
itemMetaLookup,
|
|
siblingsMetaLookup
|
|
}) {
|
|
if (id == null) {
|
|
throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", "An item was provided without id in the `items` prop:", JSON.stringify(item)].join("\n"));
|
|
}
|
|
if (siblingsMetaLookup[id] != null || // Ignore items with the same parent id, because it's the same item from the previous generation.
|
|
itemMetaLookup[id] != null && itemMetaLookup[id].parentId !== parentId) {
|
|
throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", `Two items were provided with the same id in the \`items\` prop: "${id}"`].join("\n"));
|
|
}
|
|
}
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/items/selectors.mjs
|
|
var EMPTY_CHILDREN = [];
|
|
var itemsSelectors = {
|
|
/**
|
|
* Gets the DOM structure of the Tree View.
|
|
*/
|
|
domStructure: createSelector((state) => state.domStructure),
|
|
/**
|
|
* Checks whether the disabled items are focusable.
|
|
*/
|
|
disabledItemFocusable: createSelector((state) => state.disabledItemsFocusable),
|
|
/**
|
|
* Gets the meta-information of all items.
|
|
*/
|
|
itemMetaLookup: createSelector((state) => state.itemMetaLookup),
|
|
/**
|
|
* Gets the ordered children ids of all items.
|
|
*/
|
|
itemOrderedChildrenIdsLookup: createSelector((state) => state.itemOrderedChildrenIdsLookup),
|
|
/**
|
|
* Gets the meta-information of an item.
|
|
*/
|
|
itemMeta: createSelector((state, itemId) => {
|
|
var _a;
|
|
return (_a = state.itemMetaLookup[itemId != null ? itemId : TREE_VIEW_ROOT_PARENT_ID]) != null ? _a : null;
|
|
}),
|
|
/**
|
|
* Gets the ordered children ids of an item.
|
|
*/
|
|
itemOrderedChildrenIds: createSelector((state, itemId) => {
|
|
var _a;
|
|
return (_a = state.itemOrderedChildrenIdsLookup[itemId != null ? itemId : TREE_VIEW_ROOT_PARENT_ID]) != null ? _a : EMPTY_CHILDREN;
|
|
}),
|
|
/**
|
|
* Gets the model of an item.
|
|
*/
|
|
itemModel: createSelector((state, itemId) => state.itemModelLookup[itemId]),
|
|
/**
|
|
* Checks whether an item is disabled.
|
|
*/
|
|
isItemDisabled: createSelector((state, itemId) => isItemDisabled(state.itemMetaLookup, itemId)),
|
|
/**
|
|
* Gets the index of an item in its parent's children.
|
|
*/
|
|
itemIndex: createSelector((state, itemId) => {
|
|
var _a;
|
|
const itemMeta = state.itemMetaLookup[itemId];
|
|
if (itemMeta == null) {
|
|
return -1;
|
|
}
|
|
const parentIndexes = state.itemChildrenIndexesLookup[(_a = itemMeta.parentId) != null ? _a : TREE_VIEW_ROOT_PARENT_ID];
|
|
return parentIndexes[itemMeta.id];
|
|
}),
|
|
/**
|
|
* Gets the id of an item's parent.
|
|
*/
|
|
itemParentId: createSelector((state, itemId) => {
|
|
var _a, _b;
|
|
return (_b = (_a = state.itemMetaLookup[itemId]) == null ? void 0 : _a.parentId) != null ? _b : null;
|
|
}),
|
|
/**
|
|
* Gets the depth of an item (items at the root level have a depth of 0).
|
|
*/
|
|
itemDepth: createSelector((state, itemId) => {
|
|
var _a, _b;
|
|
return (_b = (_a = state.itemMetaLookup[itemId]) == null ? void 0 : _a.depth) != null ? _b : 0;
|
|
}),
|
|
/**
|
|
* Checks whether an item can be focused.
|
|
*/
|
|
canItemBeFocused: createSelector((state, itemId) => state.disabledItemsFocusable || state.itemModelLookup[itemId] != null && !isItemDisabled(state.itemMetaLookup, itemId)),
|
|
/**
|
|
* Gets the identation between an item and its children.
|
|
*/
|
|
itemChildrenIndentation: createSelector((state) => state.itemChildrenIndentation)
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/id/selectors.mjs
|
|
var treeIdSelector = createSelector((state) => {
|
|
var _a;
|
|
return (_a = state.providedTreeId) != null ? _a : state.treeId;
|
|
});
|
|
var idSelectors = {
|
|
/**
|
|
* Get the id attribute of the tree view.
|
|
*/
|
|
treeId: treeIdSelector,
|
|
/**
|
|
* Generate the id attribute (i.e.: the `id` attribute passed to the DOM element) of a Tree Item.
|
|
* If the user explicitly defined an id attribute, it will be returned.
|
|
* Otherwise, the method creates a unique id for the item based on the Tree View id attribute and the item `itemId`
|
|
*/
|
|
treeItemIdAttribute: createSelector(treeIdSelector, (treeId, itemId, providedIdAttribute) => {
|
|
if (providedIdAttribute != null) {
|
|
return providedIdAttribute;
|
|
}
|
|
return `${treeId != null ? treeId : ""}-${itemId}`;
|
|
})
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/items/TreeViewItemsPlugin.mjs
|
|
var TreeViewItemsPlugin = class {
|
|
// We can't type `store`, otherwise we get the following TS error:
|
|
// 'items' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
|
|
constructor(store) {
|
|
/**
|
|
* Get the item with the given id.
|
|
* When used in the Simple Tree View, it returns an object with the `id` and `label` properties.
|
|
* @param {TreeViewItemId} itemId The id of the item to retrieve.
|
|
* @returns {R} The item with the given id.
|
|
*/
|
|
__publicField(this, "getItem", (itemId) => itemsSelectors.itemModel(this.store.state, itemId));
|
|
/**
|
|
* Get all the items in the same format as provided by `props.items`.
|
|
* @returns {R[]} The items in the tree.
|
|
*/
|
|
__publicField(this, "getItemTree", () => {
|
|
const getItemFromItemId = (itemId) => {
|
|
const item = itemsSelectors.itemModel(this.store.state, itemId);
|
|
const itemToMutate = _extends({}, item);
|
|
const newChildren = itemsSelectors.itemOrderedChildrenIds(this.store.state, itemId);
|
|
if (newChildren.length > 0) {
|
|
itemToMutate.children = newChildren.map(getItemFromItemId);
|
|
} else {
|
|
delete itemToMutate.children;
|
|
}
|
|
return itemToMutate;
|
|
};
|
|
return itemsSelectors.itemOrderedChildrenIds(this.store.state, null).map(getItemFromItemId);
|
|
});
|
|
/**
|
|
* Get the ids of a given item's children.
|
|
* Those ids are returned in the order they should be rendered.
|
|
* To get the root items, pass `null` as the `itemId`.
|
|
* @param {TreeViewItemId | null} itemId The id of the item to get the children of.
|
|
* @returns {TreeViewItemId[]} The ids of the item's children.
|
|
*/
|
|
__publicField(this, "getItemOrderedChildrenIds", (itemId) => itemsSelectors.itemOrderedChildrenIds(this.store.state, itemId));
|
|
/** * Get the id of the parent item.
|
|
* @param {TreeViewItemId} itemId The id of the item to whose parentId we want to retrieve.
|
|
* @returns {TreeViewItemId | null} The id of the parent item.
|
|
*/
|
|
__publicField(this, "getParentId", (itemId) => {
|
|
const itemMeta = itemsSelectors.itemMeta(this.store.state, itemId);
|
|
return (itemMeta == null ? void 0 : itemMeta.parentId) || null;
|
|
});
|
|
/**
|
|
* Toggle the disabled state of the item with the given id.
|
|
* @param {object} parameters The params of the method.
|
|
* @param {TreeViewItemId } parameters.itemId The id of the item to get the children of.
|
|
* @param {boolean } parameters.shouldBeDisabled true if the item should be disabled.
|
|
*/
|
|
__publicField(this, "setIsItemDisabled", ({
|
|
itemId,
|
|
shouldBeDisabled
|
|
}) => {
|
|
if (!this.store.state.itemMetaLookup[itemId]) {
|
|
return;
|
|
}
|
|
const itemMetaLookup = _extends({}, this.store.state.itemMetaLookup);
|
|
itemMetaLookup[itemId] = _extends({}, itemMetaLookup[itemId], {
|
|
disabled: shouldBeDisabled != null ? shouldBeDisabled : !itemMetaLookup[itemId].disabled
|
|
});
|
|
this.store.set("itemMetaLookup", itemMetaLookup);
|
|
});
|
|
__publicField(this, "buildPublicAPI", () => {
|
|
return {
|
|
getItem: this.getItem,
|
|
getItemDOMElement: this.getItemDOMElement,
|
|
getItemOrderedChildrenIds: this.getItemOrderedChildrenIds,
|
|
getItemTree: this.getItemTree,
|
|
getParentId: this.getParentId,
|
|
setIsItemDisabled: this.setIsItemDisabled
|
|
};
|
|
});
|
|
/**
|
|
* Get the DOM element of the item with the given id.
|
|
* @param {TreeViewItemId} itemId The id of the item to get the DOM element of.
|
|
* @returns {HTMLElement | null} The DOM element of the item with the given id.
|
|
*/
|
|
__publicField(this, "getItemDOMElement", (itemId) => {
|
|
const itemMeta = itemsSelectors.itemMeta(this.store.state, itemId);
|
|
if (itemMeta == null) {
|
|
return null;
|
|
}
|
|
const idAttribute = idSelectors.treeItemIdAttribute(this.store.state, itemId, itemMeta.idAttribute);
|
|
return document.getElementById(idAttribute);
|
|
});
|
|
/**
|
|
* Add an array of items to the tree.
|
|
* @param {SetItemChildrenParameters<R>} args The items to add to the tree and information about their ancestors.
|
|
*/
|
|
__publicField(this, "setItemChildren", ({
|
|
items,
|
|
parentId,
|
|
getChildrenCount
|
|
}) => {
|
|
const parentIdWithDefault = parentId != null ? parentId : TREE_VIEW_ROOT_PARENT_ID;
|
|
const parentDepth = parentId == null ? -1 : itemsSelectors.itemDepth(this.store.state, parentId);
|
|
const {
|
|
metaLookup,
|
|
modelLookup,
|
|
orderedChildrenIds,
|
|
childrenIndexes
|
|
} = buildItemsLookups({
|
|
storeParameters: this.store.parameters,
|
|
items,
|
|
parentId,
|
|
depth: parentDepth + 1,
|
|
isItemExpandable: getChildrenCount ? (item) => getChildrenCount(item) !== 0 : () => false,
|
|
otherItemsMetaLookup: itemsSelectors.itemMetaLookup(this.store.state)
|
|
});
|
|
this.store.update({
|
|
itemModelLookup: _extends({}, this.store.state.itemModelLookup, modelLookup),
|
|
itemMetaLookup: _extends({}, this.store.state.itemMetaLookup, metaLookup),
|
|
itemOrderedChildrenIdsLookup: _extends({}, this.store.state.itemOrderedChildrenIdsLookup, {
|
|
[parentIdWithDefault]: orderedChildrenIds
|
|
}),
|
|
itemChildrenIndexesLookup: _extends({}, this.store.state.itemChildrenIndexesLookup, {
|
|
[parentIdWithDefault]: childrenIndexes
|
|
})
|
|
});
|
|
});
|
|
/**
|
|
* Remove the children of an item.
|
|
* @param {TreeViewItemId | null} parentId The id of the item to remove the children of.
|
|
*/
|
|
__publicField(this, "removeChildren", (parentId) => {
|
|
const itemMetaLookup = this.store.state.itemMetaLookup;
|
|
const newMetaMap = Object.keys(itemMetaLookup).reduce((acc, key) => {
|
|
const item = itemMetaLookup[key];
|
|
if (item.parentId === parentId) {
|
|
return acc;
|
|
}
|
|
return _extends({}, acc, {
|
|
[item.id]: item
|
|
});
|
|
}, {});
|
|
const newItemOrderedChildrenIdsLookup = _extends({}, this.store.state.itemOrderedChildrenIdsLookup);
|
|
const newItemChildrenIndexesLookup = _extends({}, this.store.state.itemChildrenIndexesLookup);
|
|
const cleanId = parentId != null ? parentId : TREE_VIEW_ROOT_PARENT_ID;
|
|
delete newItemChildrenIndexesLookup[cleanId];
|
|
delete newItemOrderedChildrenIdsLookup[cleanId];
|
|
this.store.update({
|
|
itemMetaLookup: newMetaMap,
|
|
itemOrderedChildrenIdsLookup: newItemOrderedChildrenIdsLookup,
|
|
itemChildrenIndexesLookup: newItemChildrenIndexesLookup
|
|
});
|
|
});
|
|
/**
|
|
* Callback fired when the `content` slot of a given Tree Item is clicked.
|
|
* @param {React.MouseEvent} event The DOM event that triggered the change.
|
|
* @param {TreeViewItemId} itemId The id of the item being clicked.
|
|
*/
|
|
__publicField(this, "handleItemClick", (event, itemId) => {
|
|
var _a, _b;
|
|
(_b = (_a = this.store.parameters).onItemClick) == null ? void 0 : _b.call(_a, event, itemId);
|
|
});
|
|
this.store = store;
|
|
}
|
|
};
|
|
/**
|
|
* Determines if the items state should be rebuilt based on the new and previous parameters.
|
|
*/
|
|
__publicField(TreeViewItemsPlugin, "shouldRebuildItemsState", (newParameters, previousParameters) => {
|
|
return ["items", "isItemDisabled", "isItemSelectionDisabled", "getItemId", "getItemLabel", "getItemChildren"].some((key) => {
|
|
const typedKey = key;
|
|
return newParameters[typedKey] !== previousParameters[typedKey];
|
|
});
|
|
});
|
|
/**
|
|
* Builds the state properties derived from the `items` prop.
|
|
*/
|
|
__publicField(TreeViewItemsPlugin, "buildItemsStateIfNeeded", (parameters) => {
|
|
const itemMetaLookup = {};
|
|
const itemModelLookup = {};
|
|
const itemOrderedChildrenIdsLookup = {};
|
|
const itemChildrenIndexesLookup = {};
|
|
function processSiblings(items, parentId, depth) {
|
|
const parentIdWithDefault = parentId != null ? parentId : TREE_VIEW_ROOT_PARENT_ID;
|
|
const {
|
|
metaLookup,
|
|
modelLookup,
|
|
orderedChildrenIds,
|
|
childrenIndexes,
|
|
itemsChildren
|
|
} = buildItemsLookups({
|
|
storeParameters: parameters,
|
|
items,
|
|
parentId,
|
|
depth,
|
|
isItemExpandable: (item, children) => !!children && children.length > 0,
|
|
otherItemsMetaLookup: itemMetaLookup
|
|
});
|
|
Object.assign(itemMetaLookup, metaLookup);
|
|
Object.assign(itemModelLookup, modelLookup);
|
|
itemOrderedChildrenIdsLookup[parentIdWithDefault] = orderedChildrenIds;
|
|
itemChildrenIndexesLookup[parentIdWithDefault] = childrenIndexes;
|
|
for (const item of itemsChildren) {
|
|
processSiblings(item.children || [], item.id, depth + 1);
|
|
}
|
|
}
|
|
processSiblings(parameters.items, null, 0);
|
|
return {
|
|
itemMetaLookup,
|
|
itemModelLookup,
|
|
itemOrderedChildrenIdsLookup,
|
|
itemChildrenIndexesLookup
|
|
};
|
|
});
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/expansion/selectors.mjs
|
|
var expandedItemMapSelector = createSelectorMemoized((state) => state.expandedItems, (expandedItems) => {
|
|
const expandedItemsMap = /* @__PURE__ */ new Map();
|
|
expandedItems.forEach((id) => {
|
|
expandedItemsMap.set(id, true);
|
|
});
|
|
return expandedItemsMap;
|
|
});
|
|
var expansionSelectors = {
|
|
/**
|
|
* Gets the expanded items as provided to the component.
|
|
*/
|
|
expandedItemsRaw: createSelector((state) => state.expandedItems),
|
|
/**
|
|
* Gets the expanded items as a Map.
|
|
*/
|
|
expandedItemsMap: expandedItemMapSelector,
|
|
/**
|
|
* Gets the items to render as a flat list (the descendants of an expanded item are listed as siblings of the item).
|
|
*/
|
|
flatList: createSelectorMemoized(itemsSelectors.itemOrderedChildrenIdsLookup, expandedItemMapSelector, (itemOrderedChildrenIds, expandedItemsMap) => {
|
|
var _a;
|
|
function appendChildren(itemId) {
|
|
if (!expandedItemsMap.has(itemId)) {
|
|
return [itemId];
|
|
}
|
|
const itemsWithDescendants = [itemId];
|
|
const children = itemOrderedChildrenIds[itemId] || [];
|
|
for (const childId of children) {
|
|
itemsWithDescendants.push(...appendChildren(childId));
|
|
}
|
|
return itemsWithDescendants;
|
|
}
|
|
return ((_a = itemOrderedChildrenIds[TREE_VIEW_ROOT_PARENT_ID]) != null ? _a : []).flatMap(appendChildren);
|
|
}),
|
|
/**
|
|
* Gets the slot that triggers the item's expansion when clicked.
|
|
*/
|
|
triggerSlot: createSelector((state) => state.expansionTrigger),
|
|
/**
|
|
* Checks whether an item is expanded.
|
|
*/
|
|
isItemExpanded: createSelector(expandedItemMapSelector, (expandedItemsMap, itemId) => expandedItemsMap.has(itemId)),
|
|
/**
|
|
* Checks whether an item is expandable.
|
|
*/
|
|
isItemExpandable: createSelector(itemsSelectors.itemMeta, (itemMeta, _itemId) => {
|
|
var _a;
|
|
return (_a = itemMeta == null ? void 0 : itemMeta.expandable) != null ? _a : false;
|
|
})
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/selection/selectors.mjs
|
|
var selectedItemsSelector = createSelectorMemoized((state) => state.selectedItems, (selectedItemsRaw) => {
|
|
if (Array.isArray(selectedItemsRaw)) {
|
|
return selectedItemsRaw;
|
|
}
|
|
if (selectedItemsRaw != null) {
|
|
return [selectedItemsRaw];
|
|
}
|
|
return [];
|
|
});
|
|
var selectedItemsMapSelector = createSelectorMemoized(selectedItemsSelector, (selectedItems) => {
|
|
const selectedItemsMap = /* @__PURE__ */ new Map();
|
|
selectedItems.forEach((id) => {
|
|
selectedItemsMap.set(id, true);
|
|
});
|
|
return selectedItemsMap;
|
|
});
|
|
var isItemSelectableSelector = createSelector((state, itemId) => {
|
|
var _a, _b;
|
|
return (_b = (_a = state.itemMetaLookup[itemId]) == null ? void 0 : _a.selectable) != null ? _b : true;
|
|
});
|
|
var selectionSelectors = {
|
|
/**
|
|
* Gets the selected items as provided to the component.
|
|
*/
|
|
selectedItemsRaw: createSelector((state) => state.selectedItems),
|
|
/**
|
|
* Gets the selected items as an array.
|
|
*/
|
|
selectedItems: selectedItemsSelector,
|
|
/**
|
|
* Gets the selected items as a Map.
|
|
*/
|
|
selectedItemsMap: selectedItemsMapSelector,
|
|
/**
|
|
* Checks whether selection is enabled.
|
|
*/
|
|
enabled: createSelector((state) => !state.disableSelection),
|
|
/**
|
|
* Checks whether multi selection is enabled.
|
|
*/
|
|
isMultiSelectEnabled: createSelector((state) => state.multiSelect),
|
|
/**
|
|
* Checks whether checkbox selection is enabled.
|
|
*/
|
|
isCheckboxSelectionEnabled: createSelector((state) => state.checkboxSelection),
|
|
/**
|
|
* Gets the selection propagation rules.
|
|
*/
|
|
propagationRules: createSelector((state) => state.selectionPropagation),
|
|
/**
|
|
* Checks whether an item is selected.
|
|
*/
|
|
isItemSelected: createSelector(selectedItemsMapSelector, (selectedItemsMap, itemId) => selectedItemsMap.has(itemId)),
|
|
/**
|
|
* Checks whether the selection feature is enabled for an item.
|
|
* Returns `true` when selection is enabled on the Tree View and the item is selectable (even if the item is disabled).
|
|
*/
|
|
isFeatureEnabledForItem: createSelector(isItemSelectableSelector, (state) => !state.disableSelection, (isItemSelectable, isSelectionEnabled, _itemId) => isSelectionEnabled && isItemSelectable),
|
|
/**
|
|
* Checks whether an item can be selected (if selection is enabled, if the item is not disabled, and if the item is selectable).
|
|
*/
|
|
canItemBeSelected: createSelector(itemsSelectors.isItemDisabled, isItemSelectableSelector, (state) => !state.disableSelection, (isItemDisabled2, isItemSelectable, isSelectionEnabled, _itemId) => isSelectionEnabled && !isItemDisabled2 && isItemSelectable),
|
|
/**
|
|
* Checks whether an item is selectable based on the `isItemSelectionDisabled` prop.
|
|
*/
|
|
isItemSelectable: isItemSelectableSelector
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/focus/selectors.mjs
|
|
var defaultFocusableItemIdSelector = createSelectorMemoized(selectionSelectors.selectedItems, expansionSelectors.expandedItemsMap, itemsSelectors.itemMetaLookup, itemsSelectors.disabledItemFocusable, (state) => itemsSelectors.itemOrderedChildrenIds(state, null), (selectedItems, expandedItemsMap, itemMetaLookup, disabledItemsFocusable, orderedRootItemIds) => {
|
|
const firstSelectedItem = selectedItems.find((itemId) => {
|
|
if (!disabledItemsFocusable && isItemDisabled(itemMetaLookup, itemId)) {
|
|
return false;
|
|
}
|
|
const itemMeta = itemMetaLookup[itemId];
|
|
return itemMeta && (itemMeta.parentId == null || expandedItemsMap.has(itemMeta.parentId));
|
|
});
|
|
if (firstSelectedItem != null) {
|
|
return firstSelectedItem;
|
|
}
|
|
const firstNavigableItem = orderedRootItemIds.find((itemId) => disabledItemsFocusable || !isItemDisabled(itemMetaLookup, itemId));
|
|
if (firstNavigableItem != null) {
|
|
return firstNavigableItem;
|
|
}
|
|
return null;
|
|
});
|
|
var focusSelectors = {
|
|
/**
|
|
* Gets the item that should be sequentially focusable (usually with the Tab key).
|
|
* At any point in time, there is a single item that can be sequentially focused in the Tree View.
|
|
* This item is the first selected item (that is both visible and navigable), if any, or the first navigable item if no item is selected.
|
|
*/
|
|
defaultFocusableItemId: defaultFocusableItemIdSelector,
|
|
/**
|
|
* Checks whether an item is the default focusable item.
|
|
*/
|
|
isItemTheDefaultFocusableItem: createSelector(defaultFocusableItemIdSelector, (defaultFocusableItemId, itemId) => defaultFocusableItemId === itemId),
|
|
/**
|
|
* Gets the id of the item that is currently focused.
|
|
*/
|
|
focusedItemId: createSelector((state) => state.focusedItemId),
|
|
/**
|
|
* Checks whether an item is focused.
|
|
*/
|
|
isItemFocused: createSelector((state, itemId) => state.focusedItemId === itemId)
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/lazyLoading/selectors.mjs
|
|
var lazyLoadingSelectors = {
|
|
/**
|
|
* Checks if the lazy loaded state is empty.
|
|
*/
|
|
isEmpty: createSelector((state) => {
|
|
if (state.lazyLoadedItems == null) {
|
|
return true;
|
|
}
|
|
return Object.keys(state.lazyLoadedItems.loading).length === 0 && Object.keys(state.lazyLoadedItems.errors).length === 0;
|
|
}),
|
|
/**
|
|
* Checks whether an item is loading.
|
|
*/
|
|
isItemLoading: createSelector((state, itemId) => {
|
|
var _a, _b;
|
|
return (_b = (_a = state.lazyLoadedItems) == null ? void 0 : _a.loading[itemId != null ? itemId : TREE_VIEW_ROOT_PARENT_ID]) != null ? _b : false;
|
|
}),
|
|
/**
|
|
* Checks whether an item has errors.
|
|
*/
|
|
itemHasError: createSelector((state, itemId) => {
|
|
var _a;
|
|
return !!((_a = state.lazyLoadedItems) == null ? void 0 : _a.errors[itemId != null ? itemId : TREE_VIEW_ROOT_PARENT_ID]);
|
|
}),
|
|
/**
|
|
* Get an item error.
|
|
*/
|
|
itemError: createSelector((state, itemId) => {
|
|
var _a;
|
|
return (_a = state.lazyLoadedItems) == null ? void 0 : _a.errors[itemId != null ? itemId : TREE_VIEW_ROOT_PARENT_ID];
|
|
})
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/labelEditing/selectors.mjs
|
|
var labelSelectors = {
|
|
/**
|
|
* Checks whether an item is editable.
|
|
*/
|
|
isItemEditable: createSelector((state) => state.isItemEditable, itemsSelectors.itemModel, (isItemEditable, itemModel, _itemId) => {
|
|
if (!itemModel || isItemEditable == null) {
|
|
return false;
|
|
}
|
|
if (typeof isItemEditable === "boolean") {
|
|
return isItemEditable;
|
|
}
|
|
return isItemEditable(itemModel);
|
|
}),
|
|
/**
|
|
* Checks whether an item is being edited.
|
|
*/
|
|
isItemBeingEdited: createSelector((state, itemId) => itemId == null ? false : state.editedItemId === itemId),
|
|
/**
|
|
* Checks whether any item is being edited.
|
|
*/
|
|
isAnyItemBeingEdited: createSelector((state) => !!state.editedItemId)
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/hooks/useTreeItemUtils/useTreeItemUtils.mjs
|
|
var itemHasChildren = (reactChildren) => {
|
|
if (Array.isArray(reactChildren)) {
|
|
return reactChildren.length > 0 && reactChildren.some(itemHasChildren);
|
|
}
|
|
return Boolean(reactChildren);
|
|
};
|
|
var useTreeItemUtils = ({
|
|
itemId,
|
|
children
|
|
}) => {
|
|
const {
|
|
store,
|
|
publicAPI
|
|
} = useTreeViewContext();
|
|
const isItemExpandable = useStore(store, expansionSelectors.isItemExpandable, itemId);
|
|
const isLoading = useStore(store, lazyLoadingSelectors.isItemLoading, itemId);
|
|
const hasError = useStore(store, lazyLoadingSelectors.itemHasError, itemId);
|
|
const isExpandable = itemHasChildren(children) || isItemExpandable;
|
|
const isExpanded = useStore(store, expansionSelectors.isItemExpanded, itemId);
|
|
const isFocused = useStore(store, focusSelectors.isItemFocused, itemId);
|
|
const isSelected = useStore(store, selectionSelectors.isItemSelected, itemId);
|
|
const isDisabled = useStore(store, itemsSelectors.isItemDisabled, itemId);
|
|
const isEditing = useStore(store, labelSelectors.isItemBeingEdited, itemId);
|
|
const isEditable = useStore(store, labelSelectors.isItemEditable, itemId);
|
|
const status = {
|
|
expandable: isExpandable,
|
|
expanded: isExpanded,
|
|
focused: isFocused,
|
|
selected: isSelected,
|
|
disabled: isDisabled,
|
|
editing: isEditing,
|
|
editable: isEditable,
|
|
loading: isLoading,
|
|
error: hasError
|
|
};
|
|
const handleExpansion = (event) => {
|
|
if (status.disabled) {
|
|
return;
|
|
}
|
|
if (!status.focused) {
|
|
store.focus.focusItem(event, itemId);
|
|
}
|
|
const multiple = selectionSelectors.isMultiSelectEnabled(store.state) && (event.shiftKey || event.ctrlKey || event.metaKey);
|
|
if (status.expandable && !(multiple && expansionSelectors.isItemExpanded(store.state, itemId))) {
|
|
store.expansion.setItemExpansion({
|
|
event,
|
|
itemId
|
|
});
|
|
}
|
|
};
|
|
const handleSelection = (event) => {
|
|
if (!selectionSelectors.canItemBeSelected(store.state, itemId)) {
|
|
return;
|
|
}
|
|
if (!status.focused && !status.editing) {
|
|
store.focus.focusItem(event, itemId);
|
|
}
|
|
const multiple = selectionSelectors.isMultiSelectEnabled(store.state) && (event.shiftKey || event.ctrlKey || event.metaKey);
|
|
if (multiple) {
|
|
if (event.shiftKey) {
|
|
store.selection.expandSelectionRange(event, itemId);
|
|
} else {
|
|
store.selection.setItemSelection({
|
|
event,
|
|
itemId,
|
|
keepExistingSelection: true
|
|
});
|
|
}
|
|
} else {
|
|
store.selection.setItemSelection({
|
|
event,
|
|
itemId,
|
|
shouldBeSelected: true
|
|
});
|
|
}
|
|
};
|
|
const handleCheckboxSelection = (event) => {
|
|
const hasShift = event.nativeEvent.shiftKey;
|
|
const isMultiSelectEnabled = selectionSelectors.isMultiSelectEnabled(store.state);
|
|
if (isMultiSelectEnabled && hasShift) {
|
|
store.selection.expandSelectionRange(event, itemId);
|
|
} else {
|
|
store.selection.setItemSelection({
|
|
event,
|
|
itemId,
|
|
keepExistingSelection: isMultiSelectEnabled,
|
|
shouldBeSelected: event.target.checked
|
|
});
|
|
}
|
|
};
|
|
const toggleItemEditing = () => {
|
|
if (!store.labelEditing) {
|
|
return;
|
|
}
|
|
if (isEditing) {
|
|
store.labelEditing.setEditedItem(null);
|
|
} else {
|
|
store.labelEditing.setEditedItem(itemId);
|
|
}
|
|
};
|
|
const handleSaveItemLabel = (event, newLabel) => {
|
|
if (!store.labelEditing) {
|
|
return;
|
|
}
|
|
if (labelSelectors.isItemBeingEdited(store.state, itemId)) {
|
|
store.labelEditing.updateItemLabel(itemId, newLabel);
|
|
toggleItemEditing();
|
|
store.focus.focusItem(event, itemId);
|
|
}
|
|
};
|
|
const handleCancelItemLabelEditing = (event) => {
|
|
if (!store.labelEditing) {
|
|
return;
|
|
}
|
|
if (labelSelectors.isItemBeingEdited(store.state, itemId)) {
|
|
toggleItemEditing();
|
|
store.focus.focusItem(event, itemId);
|
|
}
|
|
};
|
|
const interactions = {
|
|
handleExpansion,
|
|
handleSelection,
|
|
handleCheckboxSelection,
|
|
toggleItemEditing,
|
|
handleSaveItemLabel,
|
|
handleCancelItemLabelEditing
|
|
};
|
|
return {
|
|
interactions,
|
|
status,
|
|
publicAPI
|
|
};
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/TreeViewItemDepthContext/TreeViewItemDepthContext.mjs
|
|
var React46 = __toESM(require_react(), 1);
|
|
var TreeViewItemDepthContext = /* @__PURE__ */ React46.createContext(() => -1);
|
|
if (true) TreeViewItemDepthContext.displayName = "TreeViewItemDepthContext";
|
|
|
|
// node_modules/@mui/x-tree-view/internals/utils/tree.mjs
|
|
var getLastNavigableItemInArray = (state, items) => {
|
|
let itemIndex = items.length - 1;
|
|
while (itemIndex >= 0 && !itemsSelectors.canItemBeFocused(state, items[itemIndex])) {
|
|
itemIndex -= 1;
|
|
}
|
|
if (itemIndex === -1) {
|
|
return void 0;
|
|
}
|
|
return items[itemIndex];
|
|
};
|
|
var getPreviousNavigableItem = (state, itemId) => {
|
|
const itemMeta = itemsSelectors.itemMeta(state, itemId);
|
|
if (!itemMeta) {
|
|
return null;
|
|
}
|
|
const siblings = itemsSelectors.itemOrderedChildrenIds(state, itemMeta.parentId);
|
|
const itemIndex = itemsSelectors.itemIndex(state, itemId);
|
|
if (itemIndex === 0) {
|
|
return itemMeta.parentId;
|
|
}
|
|
let previousNavigableSiblingIndex = itemIndex - 1;
|
|
while (!itemsSelectors.canItemBeFocused(state, siblings[previousNavigableSiblingIndex]) && previousNavigableSiblingIndex >= 0) {
|
|
previousNavigableSiblingIndex -= 1;
|
|
}
|
|
if (previousNavigableSiblingIndex === -1) {
|
|
if (itemMeta.parentId == null) {
|
|
return null;
|
|
}
|
|
return getPreviousNavigableItem(state, itemMeta.parentId);
|
|
}
|
|
let currentItemId = siblings[previousNavigableSiblingIndex];
|
|
let lastNavigableChild = getLastNavigableItemInArray(state, itemsSelectors.itemOrderedChildrenIds(state, currentItemId));
|
|
while (expansionSelectors.isItemExpanded(state, currentItemId) && lastNavigableChild != null) {
|
|
currentItemId = lastNavigableChild;
|
|
lastNavigableChild = getLastNavigableItemInArray(state, itemsSelectors.itemOrderedChildrenIds(state, currentItemId));
|
|
}
|
|
return currentItemId;
|
|
};
|
|
var getNextNavigableItem = (state, itemId) => {
|
|
if (expansionSelectors.isItemExpanded(state, itemId)) {
|
|
const firstNavigableChild = itemsSelectors.itemOrderedChildrenIds(state, itemId).find((childId) => itemsSelectors.canItemBeFocused(state, childId));
|
|
if (firstNavigableChild != null) {
|
|
return firstNavigableChild;
|
|
}
|
|
}
|
|
let itemMeta = itemsSelectors.itemMeta(state, itemId);
|
|
while (itemMeta != null) {
|
|
const siblings = itemsSelectors.itemOrderedChildrenIds(state, itemMeta.parentId);
|
|
const currentItemIndex = itemsSelectors.itemIndex(state, itemMeta.id);
|
|
if (currentItemIndex < siblings.length - 1) {
|
|
let nextItemIndex = currentItemIndex + 1;
|
|
while (!itemsSelectors.canItemBeFocused(state, siblings[nextItemIndex]) && nextItemIndex < siblings.length - 1) {
|
|
nextItemIndex += 1;
|
|
}
|
|
if (itemsSelectors.canItemBeFocused(state, siblings[nextItemIndex])) {
|
|
return siblings[nextItemIndex];
|
|
}
|
|
}
|
|
itemMeta = itemsSelectors.itemMeta(state, itemMeta.parentId);
|
|
}
|
|
return null;
|
|
};
|
|
var getLastNavigableItem = (state) => {
|
|
let itemId = null;
|
|
while (itemId == null || expansionSelectors.isItemExpanded(state, itemId)) {
|
|
const children = itemsSelectors.itemOrderedChildrenIds(state, itemId);
|
|
const lastNavigableChild = getLastNavigableItemInArray(state, children);
|
|
if (lastNavigableChild == null) {
|
|
return itemId;
|
|
}
|
|
itemId = lastNavigableChild;
|
|
}
|
|
return itemId;
|
|
};
|
|
var getFirstNavigableItem = (state) => itemsSelectors.itemOrderedChildrenIds(state, null).find((itemId) => itemsSelectors.canItemBeFocused(state, itemId));
|
|
var findOrderInTremauxTree = (state, itemAId, itemBId) => {
|
|
if (itemAId === itemBId) {
|
|
return [itemAId, itemBId];
|
|
}
|
|
const itemMetaA = itemsSelectors.itemMeta(state, itemAId);
|
|
const itemMetaB = itemsSelectors.itemMeta(state, itemBId);
|
|
if (!itemMetaA || !itemMetaB) {
|
|
return [itemAId, itemBId];
|
|
}
|
|
if (itemMetaA.parentId === itemMetaB.id || itemMetaB.parentId === itemMetaA.id) {
|
|
return itemMetaB.parentId === itemMetaA.id ? [itemMetaA.id, itemMetaB.id] : [itemMetaB.id, itemMetaA.id];
|
|
}
|
|
const aFamily = [itemMetaA.id];
|
|
const bFamily = [itemMetaB.id];
|
|
let aAncestor = itemMetaA.parentId;
|
|
let bAncestor = itemMetaB.parentId;
|
|
let aAncestorIsCommon = bFamily.indexOf(aAncestor) !== -1;
|
|
let bAncestorIsCommon = aFamily.indexOf(bAncestor) !== -1;
|
|
let continueA = true;
|
|
let continueB = true;
|
|
while (!bAncestorIsCommon && !aAncestorIsCommon) {
|
|
if (continueA) {
|
|
aFamily.push(aAncestor);
|
|
aAncestorIsCommon = bFamily.indexOf(aAncestor) !== -1;
|
|
continueA = aAncestor !== null;
|
|
if (!aAncestorIsCommon && continueA) {
|
|
aAncestor = itemsSelectors.itemParentId(state, aAncestor);
|
|
}
|
|
}
|
|
if (continueB && !aAncestorIsCommon) {
|
|
bFamily.push(bAncestor);
|
|
bAncestorIsCommon = aFamily.indexOf(bAncestor) !== -1;
|
|
continueB = bAncestor !== null;
|
|
if (!bAncestorIsCommon && continueB) {
|
|
bAncestor = itemsSelectors.itemParentId(state, bAncestor);
|
|
}
|
|
}
|
|
}
|
|
const commonAncestor = aAncestorIsCommon ? aAncestor : bAncestor;
|
|
const ancestorFamily = itemsSelectors.itemOrderedChildrenIds(state, commonAncestor);
|
|
const aSide = aFamily[aFamily.indexOf(commonAncestor) - 1];
|
|
const bSide = bFamily[bFamily.indexOf(commonAncestor) - 1];
|
|
return ancestorFamily.indexOf(aSide) < ancestorFamily.indexOf(bSide) ? [itemAId, itemBId] : [itemBId, itemAId];
|
|
};
|
|
var getNonDisabledItemsInRange = (state, itemAId, itemBId) => {
|
|
const getNextItem = (itemId) => {
|
|
if (expansionSelectors.isItemExpandable(state, itemId) && expansionSelectors.isItemExpanded(state, itemId)) {
|
|
return itemsSelectors.itemOrderedChildrenIds(state, itemId)[0];
|
|
}
|
|
let itemMeta = itemsSelectors.itemMeta(state, itemId);
|
|
while (itemMeta != null) {
|
|
const siblings = itemsSelectors.itemOrderedChildrenIds(state, itemMeta.parentId);
|
|
const currentItemIndex = itemsSelectors.itemIndex(state, itemMeta.id);
|
|
if (currentItemIndex < siblings.length - 1) {
|
|
return siblings[currentItemIndex + 1];
|
|
}
|
|
itemMeta = itemMeta.parentId ? itemsSelectors.itemMeta(state, itemMeta.parentId) : null;
|
|
}
|
|
throw new Error("Invalid range");
|
|
};
|
|
const [first, last] = findOrderInTremauxTree(state, itemAId, itemBId);
|
|
const items = [first];
|
|
let current = first;
|
|
while (current !== last) {
|
|
current = getNextItem(current);
|
|
if (!itemsSelectors.isItemDisabled(state, current)) {
|
|
items.push(current);
|
|
}
|
|
}
|
|
return items;
|
|
};
|
|
var getAllNavigableItems = (state) => {
|
|
let item = getFirstNavigableItem(state);
|
|
const navigableItems = [];
|
|
while (item != null) {
|
|
navigableItems.push(item);
|
|
item = getNextNavigableItem(state, item);
|
|
}
|
|
return navigableItems;
|
|
};
|
|
var isTargetInDescendants = (target, itemRoot) => {
|
|
return itemRoot !== target.closest('*[role="treeitem"]');
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/expansion/TreeViewExpansionPlugin.mjs
|
|
var TreeViewExpansionPlugin = class {
|
|
// We can't type `store`, otherwise we get the following TS error:
|
|
// 'expansion' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
|
|
constructor(store) {
|
|
__publicField(this, "setExpandedItems", (event, value) => {
|
|
var _a, _b;
|
|
if (this.store.parameters.expandedItems === void 0) {
|
|
this.store.set("expandedItems", value);
|
|
}
|
|
(_b = (_a = this.store.parameters).onExpandedItemsChange) == null ? void 0 : _b.call(_a, event, value);
|
|
});
|
|
/**
|
|
* Check if an item is expanded.
|
|
* @param {TreeViewItemId} itemId The id of the item to check.
|
|
* @returns {boolean} `true` if the item is expanded, `false` otherwise.
|
|
*/
|
|
__publicField(this, "isItemExpanded", (itemId) => expansionSelectors.isItemExpanded(this.store.state, itemId));
|
|
__publicField(this, "buildPublicAPI", () => {
|
|
return {
|
|
isItemExpanded: this.isItemExpanded,
|
|
setItemExpansion: this.setItemExpansion
|
|
};
|
|
});
|
|
/**
|
|
* Change the expansion status of a given item.
|
|
* @param {object} parameters The parameters of the method.
|
|
* @param {TreeViewItemId} parameters.itemId The id of the item to expand of collapse.
|
|
* @param {React.SyntheticEvent} parameters.event The DOM event that triggered the change.
|
|
* @param {boolean} parameters.shouldBeExpanded If `true` the item will be expanded. If `false` the item will be collapsed. If not defined, the item's expansion status will be the toggled.
|
|
*/
|
|
__publicField(this, "setItemExpansion", ({
|
|
itemId,
|
|
event = null,
|
|
shouldBeExpanded
|
|
}) => {
|
|
const isExpandedBefore = expansionSelectors.isItemExpanded(this.store.state, itemId);
|
|
const cleanShouldBeExpanded = shouldBeExpanded != null ? shouldBeExpanded : !isExpandedBefore;
|
|
if (isExpandedBefore === cleanShouldBeExpanded) {
|
|
return;
|
|
}
|
|
const eventParameters = {
|
|
isExpansionPrevented: false,
|
|
shouldBeExpanded: cleanShouldBeExpanded,
|
|
itemId
|
|
};
|
|
this.store.publishEvent("beforeItemToggleExpansion", eventParameters, event);
|
|
if (eventParameters.isExpansionPrevented) {
|
|
return;
|
|
}
|
|
this.applyItemExpansion({
|
|
itemId,
|
|
event,
|
|
shouldBeExpanded: cleanShouldBeExpanded
|
|
});
|
|
});
|
|
/**
|
|
* Apply the new expansion status of a given item.
|
|
* Is used by the `setItemExpansion` method and by the `useTreeViewLazyLoading` plugin.
|
|
* Unlike `setItemExpansion`, this method does not trigger the lazy loading.
|
|
* @param {object} parameters The parameters of the method.
|
|
* @param {TreeViewItemId} parameters.itemId The id of the item to expand of collapse.
|
|
* @param {React.SyntheticEvent | null} parameters.event The DOM event that triggered the change.
|
|
* @param {boolean} parameters.shouldBeExpanded If `true` the item will be expanded. If `false` the item will be collapsed.
|
|
*/
|
|
__publicField(this, "applyItemExpansion", ({
|
|
itemId,
|
|
event,
|
|
shouldBeExpanded
|
|
}) => {
|
|
var _a, _b;
|
|
const oldExpanded = expansionSelectors.expandedItemsRaw(this.store.state);
|
|
let newExpanded;
|
|
if (shouldBeExpanded) {
|
|
newExpanded = [itemId].concat(oldExpanded);
|
|
} else {
|
|
newExpanded = oldExpanded.filter((id) => id !== itemId);
|
|
}
|
|
(_b = (_a = this.store.parameters).onItemExpansionToggle) == null ? void 0 : _b.call(_a, event, itemId, shouldBeExpanded);
|
|
this.setExpandedItems(event, newExpanded);
|
|
});
|
|
/**
|
|
* Expand all the siblings (i.e.: the items that have the same parent) of a given item.
|
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
* @param {TreeViewItemId} itemId The id of the item whose siblings will be expanded.
|
|
*/
|
|
__publicField(this, "expandAllSiblings", (event, itemId) => {
|
|
const itemMeta = itemsSelectors.itemMeta(this.store.state, itemId);
|
|
if (itemMeta == null) {
|
|
return;
|
|
}
|
|
const siblings = itemsSelectors.itemOrderedChildrenIds(this.store.state, itemMeta.parentId);
|
|
const diff = siblings.filter((child) => expansionSelectors.isItemExpandable(this.store.state, child) && !expansionSelectors.isItemExpanded(this.store.state, child));
|
|
const newExpanded = expansionSelectors.expandedItemsRaw(this.store.state).concat(diff);
|
|
if (diff.length > 0) {
|
|
if (this.store.parameters.onItemExpansionToggle) {
|
|
diff.forEach((newlyExpandedItemId) => {
|
|
this.store.parameters.onItemExpansionToggle(event, newlyExpandedItemId, true);
|
|
});
|
|
}
|
|
this.setExpandedItems(event, newExpanded);
|
|
}
|
|
});
|
|
/**
|
|
* Mark a list of items as expandable.
|
|
* @param {TreeViewItemId[]} items The ids of the items to mark as expandable.
|
|
*/
|
|
__publicField(this, "addExpandableItems", (items) => {
|
|
const newItemMetaLookup = _extends({}, this.store.state.itemMetaLookup);
|
|
for (const itemId of items) {
|
|
newItemMetaLookup[itemId] = _extends({}, newItemMetaLookup[itemId], {
|
|
expandable: true
|
|
});
|
|
}
|
|
this.store.set("itemMetaLookup", newItemMetaLookup);
|
|
});
|
|
this.store = store;
|
|
}
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/focus/TreeViewFocusPlugin.mjs
|
|
var TreeViewFocusPlugin = class {
|
|
// We can't type `store`, otherwise we get the following TS error:
|
|
// 'focus' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
|
|
constructor(store) {
|
|
__publicField(this, "setFocusedItemId", (itemId) => {
|
|
const focusedItemId = focusSelectors.focusedItemId(this.store.state);
|
|
if (focusedItemId === itemId) {
|
|
return;
|
|
}
|
|
this.store.set("focusedItemId", itemId);
|
|
});
|
|
__publicField(this, "applyItemFocus", (event, itemId) => {
|
|
var _a, _b, _c;
|
|
(_a = this.store.items.getItemDOMElement(itemId)) == null ? void 0 : _a.focus();
|
|
this.setFocusedItemId(itemId);
|
|
(_c = (_b = this.store.parameters).onItemFocus) == null ? void 0 : _c.call(_b, event, itemId);
|
|
});
|
|
__publicField(this, "buildPublicAPI", () => {
|
|
return {
|
|
focusItem: this.focusItem
|
|
};
|
|
});
|
|
/**
|
|
* Focus the item with the given id.
|
|
*
|
|
* If the item is the child of a collapsed item, then this method will do nothing.
|
|
* Make sure to expand the ancestors of the item before calling this method if needed.
|
|
* @param {React.SyntheticEvent | null} event The DOM event that triggered the change.
|
|
* @param {TreeViewItemId} itemId The id of the item to focus.
|
|
*/
|
|
__publicField(this, "focusItem", (event, itemId) => {
|
|
const itemMeta = itemsSelectors.itemMeta(this.store.state, itemId);
|
|
const isItemVisible = itemMeta && (itemMeta.parentId == null || expansionSelectors.isItemExpanded(this.store.state, itemMeta.parentId));
|
|
if (isItemVisible) {
|
|
this.applyItemFocus(event, itemId);
|
|
}
|
|
});
|
|
/**
|
|
* Remove the focus from the currently focused item (both from the internal state and the DOM).
|
|
*/
|
|
__publicField(this, "removeFocusedItem", () => {
|
|
const focusedItemId = focusSelectors.focusedItemId(this.store.state);
|
|
if (focusedItemId == null) {
|
|
return;
|
|
}
|
|
const itemMeta = itemsSelectors.itemMeta(this.store.state, focusedItemId);
|
|
if (itemMeta) {
|
|
const itemElement = this.store.items.getItemDOMElement(focusedItemId);
|
|
if (itemElement) {
|
|
itemElement.blur();
|
|
}
|
|
}
|
|
this.setFocusedItemId(null);
|
|
});
|
|
/**
|
|
* Event handler to fire when the `root` slot of the Tree View is focused.
|
|
* @param {React.MouseEvent} event The DOM event that triggered the change.
|
|
*/
|
|
__publicField(this, "handleRootFocus", (event) => {
|
|
if (event.defaultMuiPrevented) {
|
|
return;
|
|
}
|
|
const defaultFocusableItemId = focusSelectors.defaultFocusableItemId(this.store.state);
|
|
if (event.target === event.currentTarget && defaultFocusableItemId != null) {
|
|
this.applyItemFocus(event, defaultFocusableItemId);
|
|
}
|
|
});
|
|
/**
|
|
* Event handler to fire when the `root` slot of the Tree View is blurred.
|
|
* @param {React.MouseEvent} event The DOM event that triggered the change.
|
|
*/
|
|
__publicField(this, "handleRootBlur", (event) => {
|
|
if (event.defaultMuiPrevented) {
|
|
return;
|
|
}
|
|
this.setFocusedItemId(null);
|
|
});
|
|
this.store = store;
|
|
let previousState = store.state;
|
|
this.store.subscribe((newState) => {
|
|
var _a, _b;
|
|
if (newState.itemMetaLookup === previousState.itemMetaLookup) {
|
|
previousState = newState;
|
|
return;
|
|
}
|
|
const focusedItemId = focusSelectors.focusedItemId(newState);
|
|
if (focusedItemId == null || itemsSelectors.itemMeta(newState, focusedItemId)) {
|
|
previousState = newState;
|
|
return;
|
|
}
|
|
const checkItemInNewTree = (itemId) => itemId == null || !itemsSelectors.itemMeta(newState, itemId) ? null : itemId;
|
|
const itemToFocusId = (_b = (_a = checkItemInNewTree(getNextNavigableItem(previousState, focusedItemId))) != null ? _a : checkItemInNewTree(getPreviousNavigableItem(previousState, focusedItemId))) != null ? _b : getFirstNavigableItem(newState);
|
|
if (itemToFocusId == null) {
|
|
this.setFocusedItemId(null);
|
|
} else {
|
|
this.applyItemFocus(null, itemToFocusId);
|
|
}
|
|
previousState = newState;
|
|
});
|
|
}
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/selection/itemPlugin.mjs
|
|
var selectorCheckboxSelectionStatus = createSelector((state, itemId) => {
|
|
if (selectionSelectors.isItemSelected(state, itemId)) {
|
|
return "checked";
|
|
}
|
|
let hasSelectedDescendant = false;
|
|
let hasUnSelectedDescendant = false;
|
|
const traverseDescendants = (itemToTraverseId) => {
|
|
if (itemToTraverseId !== itemId) {
|
|
if (selectionSelectors.isItemSelected(state, itemToTraverseId)) {
|
|
hasSelectedDescendant = true;
|
|
} else {
|
|
hasUnSelectedDescendant = true;
|
|
}
|
|
}
|
|
itemsSelectors.itemOrderedChildrenIds(state, itemToTraverseId).forEach(traverseDescendants);
|
|
};
|
|
traverseDescendants(itemId);
|
|
const shouldSelectBasedOnDescendants = selectionSelectors.propagationRules(state).parents;
|
|
if (shouldSelectBasedOnDescendants) {
|
|
if (hasSelectedDescendant && hasUnSelectedDescendant) {
|
|
return "indeterminate";
|
|
}
|
|
if (hasSelectedDescendant && !hasUnSelectedDescendant) {
|
|
return "checked";
|
|
}
|
|
return "empty";
|
|
}
|
|
if (hasSelectedDescendant) {
|
|
return "indeterminate";
|
|
}
|
|
return "empty";
|
|
});
|
|
var useSelectionItemPlugin = ({
|
|
props
|
|
}) => {
|
|
const {
|
|
itemId
|
|
} = props;
|
|
const {
|
|
store
|
|
} = useTreeViewContext();
|
|
const isCheckboxSelectionEnabled = useStore(store, selectionSelectors.isCheckboxSelectionEnabled);
|
|
const isFeatureEnabledForItem = useStore(store, selectionSelectors.isFeatureEnabledForItem, itemId);
|
|
const canItemBeSelected = useStore(store, selectionSelectors.canItemBeSelected, itemId);
|
|
const selectionStatus = useStore(store, selectorCheckboxSelectionStatus, itemId);
|
|
return {
|
|
propsEnhancers: {
|
|
root: () => {
|
|
let ariaChecked;
|
|
if (selectionStatus === "checked") {
|
|
ariaChecked = true;
|
|
} else if (selectionStatus === "indeterminate") {
|
|
ariaChecked = "mixed";
|
|
} else if (!canItemBeSelected) {
|
|
ariaChecked = void 0;
|
|
} else {
|
|
ariaChecked = false;
|
|
}
|
|
return {
|
|
"aria-checked": ariaChecked
|
|
};
|
|
},
|
|
checkbox: ({
|
|
externalEventHandlers,
|
|
interactions
|
|
}) => {
|
|
const handleChange = (event) => {
|
|
var _a;
|
|
(_a = externalEventHandlers.onChange) == null ? void 0 : _a.call(externalEventHandlers, event);
|
|
if (event.defaultMuiPrevented) {
|
|
return;
|
|
}
|
|
if (!selectionSelectors.canItemBeSelected(store.state, itemId)) {
|
|
return;
|
|
}
|
|
interactions.handleCheckboxSelection(event);
|
|
};
|
|
return {
|
|
tabIndex: -1,
|
|
onChange: handleChange,
|
|
visible: isCheckboxSelectionEnabled && isFeatureEnabledForItem,
|
|
disabled: !canItemBeSelected,
|
|
checked: selectionStatus === "checked",
|
|
indeterminate: selectionStatus === "indeterminate"
|
|
};
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/selection/TreeViewSelectionPlugin.mjs
|
|
var TreeViewSelectionPlugin = class {
|
|
// We can't type `store`, otherwise we get the following TS error:
|
|
// 'selection' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
|
|
constructor(store) {
|
|
__publicField(this, "lastSelectedItem", null);
|
|
__publicField(this, "lastSelectedRange", {});
|
|
__publicField(this, "setSelectedItems", (event, newModel, additionalItemsToPropagate) => {
|
|
const {
|
|
selectionPropagation = EMPTY_OBJECT,
|
|
selectedItems,
|
|
onItemSelectionToggle,
|
|
onSelectedItemsChange
|
|
} = this.store.parameters;
|
|
const oldModel = selectionSelectors.selectedItemsRaw(this.store.state);
|
|
let cleanModel;
|
|
const isMultiSelectEnabled = selectionSelectors.isMultiSelectEnabled(this.store.state);
|
|
if (isMultiSelectEnabled && (selectionPropagation.descendants || selectionPropagation.parents)) {
|
|
cleanModel = propagateSelection({
|
|
store: this.store,
|
|
selectionPropagation,
|
|
newModel,
|
|
oldModel,
|
|
additionalItemsToPropagate
|
|
});
|
|
} else {
|
|
cleanModel = newModel;
|
|
}
|
|
if (onItemSelectionToggle) {
|
|
if (isMultiSelectEnabled) {
|
|
const changes = getAddedAndRemovedItems({
|
|
store: this.store,
|
|
newModel: cleanModel,
|
|
oldModel
|
|
});
|
|
if (onItemSelectionToggle) {
|
|
changes.added.forEach((itemId) => {
|
|
onItemSelectionToggle(event, itemId, true);
|
|
});
|
|
changes.removed.forEach((itemId) => {
|
|
onItemSelectionToggle(event, itemId, false);
|
|
});
|
|
}
|
|
} else if (cleanModel !== oldModel) {
|
|
if (oldModel != null) {
|
|
onItemSelectionToggle(event, oldModel, false);
|
|
}
|
|
if (cleanModel != null) {
|
|
onItemSelectionToggle(event, cleanModel, true);
|
|
}
|
|
}
|
|
}
|
|
if (selectedItems === void 0) {
|
|
this.store.set("selectedItems", cleanModel);
|
|
}
|
|
onSelectedItemsChange == null ? void 0 : onSelectedItemsChange(event, cleanModel);
|
|
});
|
|
__publicField(this, "selectRange", (event, [start, end]) => {
|
|
const isMultiSelectEnabled = selectionSelectors.isMultiSelectEnabled(this.store.state);
|
|
if (!isMultiSelectEnabled) {
|
|
return;
|
|
}
|
|
let newSelectedItems = selectionSelectors.selectedItems(this.store.state).slice();
|
|
if (Object.keys(this.lastSelectedRange).length > 0) {
|
|
newSelectedItems = newSelectedItems.filter((id) => !this.lastSelectedRange[id]);
|
|
}
|
|
const selectedItemsLookup = getLookupFromArray(newSelectedItems);
|
|
const range = getNonDisabledItemsInRange(this.store.state, start, end).filter((id) => selectionSelectors.isItemSelectable(this.store.state, id));
|
|
const itemsToAddToModel = range.filter((id) => !selectedItemsLookup[id]);
|
|
newSelectedItems = newSelectedItems.concat(itemsToAddToModel);
|
|
this.setSelectedItems(event, newSelectedItems);
|
|
this.lastSelectedRange = getLookupFromArray(range);
|
|
});
|
|
__publicField(this, "buildPublicAPI", () => {
|
|
return {
|
|
setItemSelection: this.setItemSelection
|
|
};
|
|
});
|
|
/**
|
|
* Select or deselect an item.
|
|
* @param {object} parameters The parameters of the method.
|
|
* @param {TreeViewItemId} parameters.itemId The id of the item to select or deselect.
|
|
* @param {React.SyntheticEvent} parameters.event The DOM event that triggered the change.
|
|
* @param {boolean} parameters.keepExistingSelection If `true`, the other already selected items will remain selected, otherwise, they will be deselected. This parameter is only relevant when `multiSelect` is `true`
|
|
* @param {boolean | undefined} parameters.shouldBeSelected If `true` the item will be selected. If `false` the item will be deselected. If not defined, the item's selection status will be toggled.
|
|
*/
|
|
__publicField(this, "setItemSelection", ({
|
|
itemId,
|
|
event = null,
|
|
keepExistingSelection = false,
|
|
shouldBeSelected
|
|
}) => {
|
|
if (!selectionSelectors.enabled(this.store.state)) {
|
|
return;
|
|
}
|
|
let newSelected;
|
|
const isMultiSelectEnabled = selectionSelectors.isMultiSelectEnabled(this.store.state);
|
|
if (keepExistingSelection) {
|
|
const oldSelected = selectionSelectors.selectedItems(this.store.state);
|
|
const isSelectedBefore = selectionSelectors.isItemSelected(this.store.state, itemId);
|
|
if (isSelectedBefore && (shouldBeSelected === false || shouldBeSelected == null)) {
|
|
newSelected = oldSelected.filter((id) => id !== itemId);
|
|
} else if (!isSelectedBefore && (shouldBeSelected === true || shouldBeSelected == null)) {
|
|
newSelected = [itemId].concat(oldSelected);
|
|
} else {
|
|
newSelected = oldSelected;
|
|
}
|
|
} else {
|
|
if (shouldBeSelected === false || shouldBeSelected == null && selectionSelectors.isItemSelected(this.store.state, itemId)) {
|
|
newSelected = isMultiSelectEnabled ? [] : null;
|
|
} else {
|
|
newSelected = isMultiSelectEnabled ? [itemId] : itemId;
|
|
}
|
|
}
|
|
this.setSelectedItems(
|
|
event,
|
|
newSelected,
|
|
// If shouldBeSelected === selectionSelectors.isItemSelected(store, itemId), we still want to propagate the select.
|
|
// This is useful when the element is in an indeterminate state.
|
|
[itemId]
|
|
);
|
|
this.lastSelectedItem = itemId;
|
|
this.lastSelectedRange = {};
|
|
});
|
|
/**
|
|
* Select all the navigable items in the tree.
|
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
*/
|
|
__publicField(this, "selectAllNavigableItems", (event) => {
|
|
const isMultiSelectEnabled = selectionSelectors.isMultiSelectEnabled(this.store.state);
|
|
if (!isMultiSelectEnabled) {
|
|
return;
|
|
}
|
|
const navigableItems = getAllNavigableItems(this.store.state);
|
|
this.setSelectedItems(event, navigableItems);
|
|
this.lastSelectedRange = getLookupFromArray(navigableItems);
|
|
});
|
|
/**
|
|
* Expand the current selection range up to the given item.
|
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
* @param {TreeViewItemId} itemId The id of the item to expand the selection to.
|
|
*/
|
|
__publicField(this, "expandSelectionRange", (event, itemId) => {
|
|
if (this.lastSelectedItem != null) {
|
|
const [start, end] = findOrderInTremauxTree(this.store.state, itemId, this.lastSelectedItem);
|
|
this.selectRange(event, [start, end]);
|
|
}
|
|
});
|
|
/**
|
|
* Expand the current selection range from the first navigable item to the given item.
|
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
* @param {TreeViewItemId} itemId The id of the item up to which the selection range should be expanded.
|
|
*/
|
|
__publicField(this, "selectRangeFromStartToItem", (event, itemId) => {
|
|
this.selectRange(event, [getFirstNavigableItem(this.store.state), itemId]);
|
|
});
|
|
/**
|
|
* Expand the current selection range from the given item to the last navigable item.
|
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
* @param {TreeViewItemId} itemId The id of the item from which the selection range should be expanded.
|
|
*/
|
|
__publicField(this, "selectRangeFromItemToEnd", (event, itemId) => {
|
|
this.selectRange(event, [itemId, getLastNavigableItem(this.store.state)]);
|
|
});
|
|
/**
|
|
* Update the selection when navigating with ArrowUp / ArrowDown keys.
|
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
* @param {TreeViewItemId} currentItemId The id of the active item before the keyboard navigation.
|
|
* @param {TreeViewItemId} nextItemId The id of the active item after the keyboard navigation.
|
|
*/
|
|
__publicField(this, "selectItemFromArrowNavigation", (event, currentItem, nextItem) => {
|
|
const isMultiSelectEnabled = selectionSelectors.isMultiSelectEnabled(this.store.state);
|
|
if (!isMultiSelectEnabled) {
|
|
return;
|
|
}
|
|
let newSelectedItems = selectionSelectors.selectedItems(this.store.state).slice();
|
|
if (Object.keys(this.lastSelectedRange).length === 0) {
|
|
newSelectedItems.push(nextItem);
|
|
this.lastSelectedRange = {
|
|
[currentItem]: true,
|
|
[nextItem]: true
|
|
};
|
|
} else {
|
|
if (!this.lastSelectedRange[currentItem]) {
|
|
this.lastSelectedRange = {};
|
|
}
|
|
if (this.lastSelectedRange[nextItem]) {
|
|
newSelectedItems = newSelectedItems.filter((id) => id !== currentItem);
|
|
delete this.lastSelectedRange[currentItem];
|
|
} else {
|
|
newSelectedItems.push(nextItem);
|
|
this.lastSelectedRange[nextItem] = true;
|
|
}
|
|
}
|
|
this.setSelectedItems(event, newSelectedItems);
|
|
});
|
|
this.store = store;
|
|
store.itemPluginManager.register(useSelectionItemPlugin, null);
|
|
}
|
|
};
|
|
function propagateSelection({
|
|
store,
|
|
selectionPropagation,
|
|
newModel,
|
|
oldModel,
|
|
additionalItemsToPropagate
|
|
}) {
|
|
if (!selectionPropagation.descendants && !selectionPropagation.parents) {
|
|
return newModel;
|
|
}
|
|
let shouldRegenerateModel = false;
|
|
const newModelLookup = getLookupFromArray(newModel);
|
|
const changes = getAddedAndRemovedItems({
|
|
store,
|
|
newModel,
|
|
oldModel
|
|
});
|
|
additionalItemsToPropagate == null ? void 0 : additionalItemsToPropagate.forEach((itemId) => {
|
|
if (newModelLookup[itemId]) {
|
|
if (!changes.added.includes(itemId)) {
|
|
changes.added.push(itemId);
|
|
}
|
|
} else if (!changes.removed.includes(itemId)) {
|
|
changes.removed.push(itemId);
|
|
}
|
|
});
|
|
changes.added.forEach((addedItemId) => {
|
|
if (selectionPropagation.descendants) {
|
|
const selectDescendants = (itemId) => {
|
|
if (itemId !== addedItemId) {
|
|
shouldRegenerateModel = true;
|
|
newModelLookup[itemId] = true;
|
|
}
|
|
itemsSelectors.itemOrderedChildrenIds(store.state, itemId).forEach(selectDescendants);
|
|
};
|
|
selectDescendants(addedItemId);
|
|
}
|
|
if (selectionPropagation.parents) {
|
|
const checkAllDescendantsSelected = (itemId) => {
|
|
if (!newModelLookup[itemId]) {
|
|
return false;
|
|
}
|
|
const children = itemsSelectors.itemOrderedChildrenIds(store.state, itemId);
|
|
return children.every(checkAllDescendantsSelected);
|
|
};
|
|
const selectParents = (itemId) => {
|
|
const parentId = itemsSelectors.itemParentId(store.state, itemId);
|
|
if (parentId == null) {
|
|
return;
|
|
}
|
|
const siblings = itemsSelectors.itemOrderedChildrenIds(store.state, parentId);
|
|
if (siblings.every(checkAllDescendantsSelected)) {
|
|
shouldRegenerateModel = true;
|
|
newModelLookup[parentId] = true;
|
|
selectParents(parentId);
|
|
}
|
|
};
|
|
selectParents(addedItemId);
|
|
}
|
|
});
|
|
changes.removed.forEach((removedItemId) => {
|
|
if (selectionPropagation.parents) {
|
|
let parentId = itemsSelectors.itemParentId(store.state, removedItemId);
|
|
while (parentId != null) {
|
|
if (newModelLookup[parentId]) {
|
|
shouldRegenerateModel = true;
|
|
delete newModelLookup[parentId];
|
|
}
|
|
parentId = itemsSelectors.itemParentId(store.state, parentId);
|
|
}
|
|
}
|
|
if (selectionPropagation.descendants) {
|
|
const deSelectDescendants = (itemId) => {
|
|
if (itemId !== removedItemId) {
|
|
shouldRegenerateModel = true;
|
|
delete newModelLookup[itemId];
|
|
}
|
|
itemsSelectors.itemOrderedChildrenIds(store.state, itemId).forEach(deSelectDescendants);
|
|
};
|
|
deSelectDescendants(removedItemId);
|
|
}
|
|
});
|
|
return shouldRegenerateModel ? Object.keys(newModelLookup) : newModel;
|
|
}
|
|
function getAddedAndRemovedItems({
|
|
store,
|
|
oldModel,
|
|
newModel
|
|
}) {
|
|
const newModelMap = /* @__PURE__ */ new Map();
|
|
newModel.forEach((id) => {
|
|
newModelMap.set(id, true);
|
|
});
|
|
return {
|
|
added: newModel.filter((itemId) => !selectionSelectors.isItemSelected(store.state, itemId)),
|
|
removed: oldModel.filter((itemId) => !newModelMap.has(itemId))
|
|
};
|
|
}
|
|
function getLookupFromArray(array) {
|
|
const lookup = {};
|
|
array.forEach((itemId) => {
|
|
lookup[itemId] = true;
|
|
});
|
|
return lookup;
|
|
}
|
|
|
|
// node_modules/@mui/x-tree-view/useTreeItem/useTreeItem.mjs
|
|
var depthSelector = (state, itemId, depthContext) => {
|
|
if (typeof depthContext === "function") {
|
|
return depthContext(state, itemId);
|
|
}
|
|
return depthContext;
|
|
};
|
|
var useTreeItem = (parameters) => {
|
|
const {
|
|
runItemPlugins,
|
|
publicAPI,
|
|
store
|
|
} = useTreeViewContext();
|
|
const depthContext = React47.useContext(TreeViewItemDepthContext);
|
|
const depth = useStore(store, depthSelector, parameters.itemId, depthContext);
|
|
const {
|
|
id,
|
|
itemId,
|
|
label,
|
|
children,
|
|
rootRef
|
|
} = parameters;
|
|
const {
|
|
rootRef: pluginRootRef,
|
|
contentRef,
|
|
propsEnhancers
|
|
} = runItemPlugins(parameters);
|
|
const {
|
|
interactions,
|
|
status
|
|
} = useTreeItemUtils({
|
|
itemId,
|
|
children
|
|
});
|
|
const rootRefObject = React47.useRef(null);
|
|
const contentRefObject = React47.useRef(null);
|
|
const handleRootRef = useMergedRefs(rootRef, pluginRootRef, rootRefObject);
|
|
const handleContentRef = useMergedRefs(contentRef, contentRefObject);
|
|
const checkboxRef = React47.useRef(null);
|
|
const isCheckboxSelectionEnabled = useStore(store, selectionSelectors.isCheckboxSelectionEnabled);
|
|
const idAttribute = useStore(store, idSelectors.treeItemIdAttribute, itemId, id);
|
|
const shouldBeAccessibleWithTab = useStore(store, focusSelectors.isItemTheDefaultFocusableItem, itemId);
|
|
const sharedPropsEnhancerParams = {
|
|
rootRefObject,
|
|
contentRefObject,
|
|
interactions
|
|
};
|
|
const createRootHandleFocus = (otherHandlers) => (event) => {
|
|
var _a;
|
|
(_a = otherHandlers.onFocus) == null ? void 0 : _a.call(otherHandlers, event);
|
|
if (event.defaultMuiPrevented) {
|
|
return;
|
|
}
|
|
if (!status.focused && itemsSelectors.canItemBeFocused(store.state, itemId) && event.currentTarget === event.target) {
|
|
store.focus.focusItem(event, itemId);
|
|
}
|
|
};
|
|
const createRootHandleBlur = (otherHandlers) => (event) => {
|
|
var _a, _b, _c, _d, _e;
|
|
(_a = otherHandlers.onBlur) == null ? void 0 : _a.call(otherHandlers, event);
|
|
if (event.defaultMuiPrevented) {
|
|
return;
|
|
}
|
|
const rootElement = store.items.getItemDOMElement(itemId);
|
|
if (status.editing || // we can exit the editing state by clicking outside the input (within the Tree Item) or by pressing Enter or Escape -> we don't want to remove the focused item from the state in these cases
|
|
// we can also exit the editing state by clicking on the root itself -> want to remove the focused item from the state in this case
|
|
event.relatedTarget && isTargetInDescendants(event.relatedTarget, rootElement) && (event.target && ((_c = (_b = event.target) == null ? void 0 : _b.dataset) == null ? void 0 : _c.element) === "labelInput" && isTargetInDescendants(event.target, rootElement) || ((_e = (_d = event.relatedTarget) == null ? void 0 : _d.dataset) == null ? void 0 : _e.element) === "labelInput")) {
|
|
return;
|
|
}
|
|
store.focus.removeFocusedItem();
|
|
};
|
|
const createRootHandleKeyDown = (otherHandlers) => (event) => {
|
|
var _a, _b, _c;
|
|
(_a = otherHandlers.onKeyDown) == null ? void 0 : _a.call(otherHandlers, event);
|
|
if (event.defaultMuiPrevented || ((_c = (_b = event.target) == null ? void 0 : _b.dataset) == null ? void 0 : _c.element) === "labelInput") {
|
|
return;
|
|
}
|
|
store.keyboardNavigation.handleItemKeyDown(event, itemId);
|
|
};
|
|
const createLabelHandleDoubleClick = (otherHandlers) => (event) => {
|
|
var _a;
|
|
(_a = otherHandlers.onDoubleClick) == null ? void 0 : _a.call(otherHandlers, event);
|
|
if (event.defaultMuiPrevented) {
|
|
return;
|
|
}
|
|
interactions.toggleItemEditing();
|
|
};
|
|
const createContentHandleClick = (otherHandlers) => (event) => {
|
|
var _a, _b;
|
|
(_a = otherHandlers.onClick) == null ? void 0 : _a.call(otherHandlers, event);
|
|
store.items.handleItemClick(event, itemId);
|
|
if (event.defaultMuiPrevented || ((_b = checkboxRef.current) == null ? void 0 : _b.contains(event.target))) {
|
|
return;
|
|
}
|
|
if (expansionSelectors.triggerSlot(store.state) === "content") {
|
|
interactions.handleExpansion(event);
|
|
}
|
|
if (!isCheckboxSelectionEnabled) {
|
|
interactions.handleSelection(event);
|
|
}
|
|
};
|
|
const createContentHandleMouseDown = (otherHandlers) => (event) => {
|
|
var _a;
|
|
(_a = otherHandlers.onMouseDown) == null ? void 0 : _a.call(otherHandlers, event);
|
|
if (event.defaultMuiPrevented) {
|
|
return;
|
|
}
|
|
if (event.shiftKey || event.ctrlKey || event.metaKey || status.disabled) {
|
|
event.preventDefault();
|
|
}
|
|
};
|
|
const createIconContainerHandleClick = (otherHandlers) => (event) => {
|
|
var _a;
|
|
(_a = otherHandlers.onClick) == null ? void 0 : _a.call(otherHandlers, event);
|
|
if (event.defaultMuiPrevented) {
|
|
return;
|
|
}
|
|
if (expansionSelectors.triggerSlot(store.state) === "iconContainer") {
|
|
interactions.handleExpansion(event);
|
|
}
|
|
};
|
|
const getContextProviderProps = () => ({
|
|
itemId,
|
|
id
|
|
});
|
|
const getRootProps = (externalProps = {}) => {
|
|
var _a, _b, _c;
|
|
const externalEventHandlers = _extends({}, extractEventHandlers_default(parameters), extractEventHandlers_default(externalProps));
|
|
const props = _extends({}, externalEventHandlers, {
|
|
ref: handleRootRef,
|
|
role: "treeitem",
|
|
tabIndex: shouldBeAccessibleWithTab ? 0 : -1,
|
|
id: idAttribute,
|
|
"aria-expanded": status.expandable ? status.expanded : void 0,
|
|
"aria-disabled": status.disabled || void 0
|
|
}, externalProps, {
|
|
style: _extends({}, (_a = externalProps.style) != null ? _a : {}, {
|
|
"--TreeView-itemDepth": depth
|
|
}),
|
|
onFocus: createRootHandleFocus(externalEventHandlers),
|
|
onBlur: createRootHandleBlur(externalEventHandlers),
|
|
onKeyDown: createRootHandleKeyDown(externalEventHandlers)
|
|
});
|
|
const enhancedRootProps = (_c = (_b = propsEnhancers.root) == null ? void 0 : _b.call(propsEnhancers, _extends({}, sharedPropsEnhancerParams, {
|
|
externalEventHandlers
|
|
}))) != null ? _c : {};
|
|
return _extends({}, props, enhancedRootProps);
|
|
};
|
|
const getContentProps = (externalProps = {}) => {
|
|
var _a, _b;
|
|
const externalEventHandlers = extractEventHandlers_default(externalProps);
|
|
const props = _extends({}, externalEventHandlers, externalProps, {
|
|
ref: handleContentRef,
|
|
onClick: createContentHandleClick(externalEventHandlers),
|
|
onMouseDown: createContentHandleMouseDown(externalEventHandlers),
|
|
status
|
|
});
|
|
["expanded", "selected", "focused", "disabled", "editing", "editable"].forEach((key) => {
|
|
if (status[key]) {
|
|
props[`data-${key}`] = "";
|
|
}
|
|
});
|
|
const enhancedContentProps = (_b = (_a = propsEnhancers.content) == null ? void 0 : _a.call(propsEnhancers, _extends({}, sharedPropsEnhancerParams, {
|
|
externalEventHandlers
|
|
}))) != null ? _b : {};
|
|
return _extends({}, props, enhancedContentProps);
|
|
};
|
|
const getCheckboxProps = (externalProps = {}) => {
|
|
var _a, _b;
|
|
const externalEventHandlers = extractEventHandlers_default(externalProps);
|
|
const props = _extends({}, externalEventHandlers, {
|
|
ref: checkboxRef,
|
|
"aria-hidden": true
|
|
}, externalProps);
|
|
const enhancedCheckboxProps = (_b = (_a = propsEnhancers.checkbox) == null ? void 0 : _a.call(propsEnhancers, _extends({}, sharedPropsEnhancerParams, {
|
|
externalEventHandlers
|
|
}))) != null ? _b : {};
|
|
return _extends({}, props, enhancedCheckboxProps);
|
|
};
|
|
const getLabelProps = (externalProps = {}) => {
|
|
var _a, _b;
|
|
const externalEventHandlers = _extends({}, extractEventHandlers_default(externalProps));
|
|
const props = _extends({}, externalEventHandlers, {
|
|
children: label
|
|
}, externalProps, {
|
|
onDoubleClick: createLabelHandleDoubleClick(externalEventHandlers)
|
|
});
|
|
const enhancedLabelProps = (_b = (_a = propsEnhancers.label) == null ? void 0 : _a.call(propsEnhancers, _extends({}, sharedPropsEnhancerParams, {
|
|
externalEventHandlers
|
|
}))) != null ? _b : {};
|
|
return _extends({}, enhancedLabelProps, props);
|
|
};
|
|
const getLabelInputProps = (externalProps = {}) => {
|
|
var _a, _b;
|
|
const externalEventHandlers = extractEventHandlers_default(externalProps);
|
|
const enhancedLabelInputProps = (_b = (_a = propsEnhancers.labelInput) == null ? void 0 : _a.call(propsEnhancers, _extends({}, sharedPropsEnhancerParams, {
|
|
externalEventHandlers
|
|
}))) != null ? _b : {};
|
|
return _extends({}, externalProps, enhancedLabelInputProps);
|
|
};
|
|
const getIconContainerProps = (externalProps = {}) => {
|
|
const externalEventHandlers = extractEventHandlers_default(externalProps);
|
|
return _extends({}, externalEventHandlers, externalProps, {
|
|
onClick: createIconContainerHandleClick(externalEventHandlers)
|
|
});
|
|
};
|
|
const getErrorContainerProps = (externalProps = {}) => {
|
|
const externalEventHandlers = extractEventHandlers_default(externalProps);
|
|
return _extends({}, externalEventHandlers, externalProps);
|
|
};
|
|
const getLoadingContainerProps = (externalProps = {}) => {
|
|
const externalEventHandlers = extractEventHandlers_default(externalProps);
|
|
return _extends({
|
|
size: "12px",
|
|
thickness: 6
|
|
}, externalEventHandlers, externalProps);
|
|
};
|
|
const getGroupTransitionProps = (externalProps = {}) => {
|
|
const externalEventHandlers = extractEventHandlers_default(externalProps);
|
|
const response = _extends({}, externalEventHandlers, {
|
|
unmountOnExit: true,
|
|
component: "ul",
|
|
role: "group",
|
|
in: status.expanded,
|
|
children
|
|
}, externalProps);
|
|
return response;
|
|
};
|
|
const getDragAndDropOverlayProps = (externalProps = {}) => {
|
|
var _a, _b;
|
|
const externalEventHandlers = extractEventHandlers_default(externalProps);
|
|
const enhancedDragAndDropOverlayProps = (_b = (_a = propsEnhancers.dragAndDropOverlay) == null ? void 0 : _a.call(propsEnhancers, _extends({}, sharedPropsEnhancerParams, {
|
|
externalEventHandlers
|
|
}))) != null ? _b : {};
|
|
return _extends({}, externalProps, enhancedDragAndDropOverlayProps);
|
|
};
|
|
return {
|
|
getContextProviderProps,
|
|
getRootProps,
|
|
getContentProps,
|
|
getGroupTransitionProps,
|
|
getIconContainerProps,
|
|
getCheckboxProps,
|
|
getLabelProps,
|
|
getLabelInputProps,
|
|
getDragAndDropOverlayProps,
|
|
getErrorContainerProps,
|
|
getLoadingContainerProps,
|
|
rootRef: handleRootRef,
|
|
status,
|
|
publicAPI
|
|
};
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/TreeItem/treeItemClasses.mjs
|
|
function getTreeItemUtilityClass(slot) {
|
|
return generateUtilityClass("MuiTreeItem", slot);
|
|
}
|
|
var treeItemClasses = generateUtilityClasses("MuiTreeItem", [
|
|
"root",
|
|
"content",
|
|
"groupTransition",
|
|
"iconContainer",
|
|
"label",
|
|
"checkbox",
|
|
"labelInput",
|
|
"dragAndDropOverlay",
|
|
"errorIcon",
|
|
"loadingIcon",
|
|
// State classes, will be replaced by data-attrs in the next major
|
|
"expanded",
|
|
"selected",
|
|
"focused",
|
|
"disabled",
|
|
"editable",
|
|
"editing"
|
|
]);
|
|
|
|
// node_modules/@mui/x-tree-view/TreeItemIcon/TreeItemIcon.mjs
|
|
var React48 = __toESM(require_react(), 1);
|
|
var import_prop_types22 = __toESM(require_prop_types(), 1);
|
|
|
|
// node_modules/@mui/x-tree-view/icons/icons.mjs
|
|
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
|
|
var TreeViewExpandIcon = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", {
|
|
d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
|
|
}), "TreeViewExpandIcon");
|
|
var TreeViewCollapseIcon = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", {
|
|
d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
|
|
}), "TreeViewCollapseIcon");
|
|
|
|
// node_modules/@mui/x-tree-view/TreeItemIcon/TreeItemIcon.mjs
|
|
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
|
|
var _excluded = ["ownerState"];
|
|
function pickIcon(treeItemIcon, treeViewIcon, fallback) {
|
|
if (treeItemIcon !== void 0) {
|
|
return treeItemIcon;
|
|
}
|
|
if (treeViewIcon !== void 0) {
|
|
return treeViewIcon;
|
|
}
|
|
return fallback;
|
|
}
|
|
function TreeItemIcon(props) {
|
|
const {
|
|
slots: slotsFromTreeItem,
|
|
slotProps: slotPropsFromTreeItem,
|
|
status
|
|
} = props;
|
|
const {
|
|
slots: slotsFromTreeView,
|
|
slotProps: slotPropsFromTreeView
|
|
} = useTreeViewStyleContext();
|
|
const slots = {
|
|
collapseIcon: pickIcon(slotsFromTreeItem == null ? void 0 : slotsFromTreeItem.collapseIcon, slotsFromTreeView.collapseIcon, TreeViewCollapseIcon),
|
|
expandIcon: pickIcon(slotsFromTreeItem == null ? void 0 : slotsFromTreeItem.expandIcon, slotsFromTreeView.expandIcon, TreeViewExpandIcon),
|
|
endIcon: pickIcon(slotsFromTreeItem == null ? void 0 : slotsFromTreeItem.endIcon, slotsFromTreeView.endIcon),
|
|
icon: slotsFromTreeItem == null ? void 0 : slotsFromTreeItem.icon
|
|
};
|
|
let iconName;
|
|
if (slots == null ? void 0 : slots.icon) {
|
|
iconName = "icon";
|
|
} else if (status.expandable) {
|
|
if (status.expanded) {
|
|
iconName = "collapseIcon";
|
|
} else {
|
|
iconName = "expandIcon";
|
|
}
|
|
} else {
|
|
iconName = "endIcon";
|
|
}
|
|
const Icon = slots[iconName];
|
|
const _useSlotProps = useSlotProps_default({
|
|
elementType: Icon,
|
|
externalSlotProps: (tempOwnerState) => _extends({}, resolveComponentProps_default(slotPropsFromTreeView[iconName], tempOwnerState), resolveComponentProps_default(slotPropsFromTreeItem == null ? void 0 : slotPropsFromTreeItem[iconName], tempOwnerState)),
|
|
// TODO: Add proper ownerState
|
|
ownerState: {}
|
|
}), iconProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded);
|
|
if (!Icon) {
|
|
return null;
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, _extends({}, iconProps));
|
|
}
|
|
true ? TreeItemIcon.propTypes = {
|
|
// ----------------------------- Warning --------------------------------
|
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
// ----------------------------------------------------------------------
|
|
/**
|
|
* The props used for each component slot.
|
|
* @default {}
|
|
*/
|
|
slotProps: import_prop_types22.default.object,
|
|
/**
|
|
* Overridable component slots.
|
|
* @default {}
|
|
*/
|
|
slots: import_prop_types22.default.object,
|
|
status: import_prop_types22.default.shape({
|
|
disabled: import_prop_types22.default.bool.isRequired,
|
|
editable: import_prop_types22.default.bool.isRequired,
|
|
editing: import_prop_types22.default.bool.isRequired,
|
|
error: import_prop_types22.default.bool.isRequired,
|
|
expandable: import_prop_types22.default.bool.isRequired,
|
|
expanded: import_prop_types22.default.bool.isRequired,
|
|
focused: import_prop_types22.default.bool.isRequired,
|
|
loading: import_prop_types22.default.bool.isRequired,
|
|
selected: import_prop_types22.default.bool.isRequired
|
|
}).isRequired
|
|
} : void 0;
|
|
|
|
// node_modules/@mui/x-tree-view/TreeItemDragAndDropOverlay/TreeItemDragAndDropOverlay.mjs
|
|
var import_prop_types23 = __toESM(require_prop_types(), 1);
|
|
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
|
|
var TreeItemDragAndDropOverlayRoot = styled_default("div", {
|
|
name: "MuiTreeItemDragAndDropOverlay",
|
|
slot: "Root",
|
|
shouldForwardProp: (prop) => shouldForwardProp(prop) && prop !== "action"
|
|
})(({
|
|
theme
|
|
}) => ({
|
|
position: "absolute",
|
|
left: 0,
|
|
display: "flex",
|
|
top: 0,
|
|
bottom: 0,
|
|
right: 0,
|
|
pointerEvents: "none",
|
|
variants: [{
|
|
props: {
|
|
action: "make-child"
|
|
},
|
|
style: {
|
|
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
|
|
borderRadius: theme.shape.borderRadius,
|
|
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.darkChannel} / ${theme.vars.palette.action.focusOpacity})` : alpha(theme.palette.primary.dark, theme.palette.action.focusOpacity)
|
|
}
|
|
}, {
|
|
props: {
|
|
action: "reorder-above"
|
|
},
|
|
style: {
|
|
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
|
|
borderTop: `1px solid ${(theme.vars || theme).palette.action.active}`
|
|
}
|
|
}, {
|
|
props: {
|
|
action: "reorder-below"
|
|
},
|
|
style: {
|
|
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
|
|
borderBottom: `1px solid ${(theme.vars || theme).palette.action.active}`
|
|
}
|
|
}, {
|
|
props: {
|
|
action: "move-to-parent"
|
|
},
|
|
style: {
|
|
marginLeft: "calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",
|
|
borderBottom: `1px solid ${(theme.vars || theme).palette.action.active}`
|
|
}
|
|
}]
|
|
}));
|
|
function TreeItemDragAndDropOverlay(props) {
|
|
if (props.action == null) {
|
|
return null;
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TreeItemDragAndDropOverlayRoot, _extends({}, props));
|
|
}
|
|
true ? TreeItemDragAndDropOverlay.propTypes = {
|
|
// ----------------------------- Warning --------------------------------
|
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
// ----------------------------------------------------------------------
|
|
action: import_prop_types23.default.oneOf(["make-child", "move-to-parent", "reorder-above", "reorder-below"]),
|
|
style: import_prop_types23.default.object
|
|
} : void 0;
|
|
|
|
// node_modules/@mui/x-tree-view/TreeItemProvider/TreeItemProvider.mjs
|
|
var React49 = __toESM(require_react(), 1);
|
|
var import_prop_types24 = __toESM(require_prop_types(), 1);
|
|
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
|
|
function TreeItemProvider(props) {
|
|
const {
|
|
children,
|
|
itemId,
|
|
id
|
|
} = props;
|
|
const {
|
|
wrapItem,
|
|
store
|
|
} = useTreeViewContext();
|
|
const idAttribute = useStore(store, idSelectors.treeItemIdAttribute, itemId, id);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(React49.Fragment, {
|
|
children: wrapItem({
|
|
children,
|
|
itemId,
|
|
store,
|
|
idAttribute
|
|
})
|
|
});
|
|
}
|
|
true ? TreeItemProvider.propTypes = {
|
|
// ----------------------------- Warning --------------------------------
|
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
// ----------------------------------------------------------------------
|
|
children: import_prop_types24.default.node,
|
|
id: import_prop_types24.default.string,
|
|
itemId: import_prop_types24.default.string.isRequired
|
|
} : void 0;
|
|
|
|
// node_modules/@mui/x-tree-view/TreeItemLabelInput/TreeItemLabelInput.mjs
|
|
var TreeItemLabelInput = styled_default("input", {
|
|
name: "MuiTreeItem",
|
|
slot: "LabelInput"
|
|
})(({
|
|
theme
|
|
}) => _extends({}, theme.typography.body1, {
|
|
width: "100%",
|
|
backgroundColor: (theme.vars || theme).palette.background.paper,
|
|
borderRadius: theme.shape.borderRadius,
|
|
border: "none",
|
|
padding: "0 2px",
|
|
boxSizing: "border-box",
|
|
"&:focus": {
|
|
outline: `1px solid ${(theme.vars || theme).palette.primary.main}`
|
|
}
|
|
}));
|
|
|
|
// node_modules/@mui/x-tree-view/TreeItem/TreeItem.mjs
|
|
var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
|
|
var _excluded2 = ["visible"];
|
|
var _excluded22 = ["id", "itemId", "label", "disabled", "disableSelection", "children", "slots", "slotProps", "classes"];
|
|
var useThemeProps3 = createUseThemeProps("MuiTreeItem");
|
|
var TreeItemRoot = styled_default("li", {
|
|
name: "MuiTreeItem",
|
|
slot: "Root"
|
|
})({
|
|
listStyle: "none",
|
|
margin: 0,
|
|
padding: 0,
|
|
outline: 0
|
|
});
|
|
var TreeItemContent = styled_default("div", {
|
|
name: "MuiTreeItem",
|
|
slot: "Content",
|
|
shouldForwardProp: (prop) => shouldForwardProp(prop) && prop !== "status"
|
|
})(({
|
|
theme
|
|
}) => ({
|
|
padding: theme.spacing(0.5, 1),
|
|
paddingLeft: `calc(${theme.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`,
|
|
borderRadius: theme.shape.borderRadius,
|
|
width: "100%",
|
|
boxSizing: "border-box",
|
|
// prevent width + padding to overflow
|
|
position: "relative",
|
|
display: "flex",
|
|
alignItems: "center",
|
|
gap: theme.spacing(1),
|
|
cursor: "pointer",
|
|
WebkitTapHighlightColor: "transparent",
|
|
"&:hover": {
|
|
backgroundColor: (theme.vars || theme).palette.action.hover,
|
|
// Reset on touch devices, it doesn't add specificity
|
|
"@media (hover: none)": {
|
|
backgroundColor: "transparent"
|
|
}
|
|
},
|
|
"&[data-disabled]": {
|
|
opacity: (theme.vars || theme).palette.action.disabledOpacity,
|
|
backgroundColor: "transparent",
|
|
cursor: "auto"
|
|
},
|
|
"&[data-focused]": {
|
|
backgroundColor: (theme.vars || theme).palette.action.focus
|
|
},
|
|
"&[data-selected]": {
|
|
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity),
|
|
"&:hover": {
|
|
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.hoverOpacity}))` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity),
|
|
// Reset on touch devices, it doesn't add specificity
|
|
"@media (hover: none)": {
|
|
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity)
|
|
}
|
|
}
|
|
},
|
|
"&[data-selected][data-focused]": {
|
|
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.focusOpacity}))` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
|
|
}
|
|
}));
|
|
var TreeItemLabel = styled_default("div", {
|
|
name: "MuiTreeItem",
|
|
slot: "Label",
|
|
shouldForwardProp: (prop) => shouldForwardProp(prop) && prop !== "editable"
|
|
})(({
|
|
theme
|
|
}) => _extends({
|
|
width: "100%",
|
|
boxSizing: "border-box",
|
|
// prevent width + padding to overflow
|
|
// fixes overflow - see https://github.com/mui/material-ui/issues/27372
|
|
minWidth: 0,
|
|
position: "relative",
|
|
overflow: "hidden"
|
|
}, theme.typography.body1, {
|
|
variants: [{
|
|
props: ({
|
|
editable
|
|
}) => editable,
|
|
style: {
|
|
paddingLeft: "2px"
|
|
}
|
|
}]
|
|
}));
|
|
var TreeItemIconContainer = styled_default("div", {
|
|
name: "MuiTreeItem",
|
|
slot: "IconContainer"
|
|
})({
|
|
width: 16,
|
|
display: "flex",
|
|
flexShrink: 0,
|
|
justifyContent: "center",
|
|
position: "relative",
|
|
cursor: "inherit",
|
|
"& svg": {
|
|
fontSize: 18
|
|
}
|
|
});
|
|
var TreeItemGroupTransition = styled_default(Collapse_default, {
|
|
name: "MuiTreeItem",
|
|
slot: "GroupTransition",
|
|
overridesResolver: (props, styles) => styles.groupTransition
|
|
})({
|
|
margin: 0,
|
|
padding: 0
|
|
});
|
|
var TreeItemErrorContainer = styled_default("div", {
|
|
name: "MuiTreeItem",
|
|
slot: "ErrorIcon"
|
|
})({
|
|
position: "absolute",
|
|
right: -3,
|
|
width: 7,
|
|
height: 7,
|
|
borderRadius: "50%",
|
|
backgroundColor: "red"
|
|
});
|
|
var TreeItemLoadingContainer = styled_default(CircularProgress_default, {
|
|
name: "MuiTreeItem",
|
|
slot: "LoadingIcon"
|
|
})({
|
|
color: "text.primary"
|
|
});
|
|
var TreeItemCheckbox = styled_default(/* @__PURE__ */ React50.forwardRef((props, ref) => {
|
|
const {
|
|
visible
|
|
} = props, other = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
if (!visible) {
|
|
return null;
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Checkbox_default, _extends({}, other, {
|
|
ref
|
|
}));
|
|
}), {
|
|
name: "MuiTreeItem",
|
|
slot: "Checkbox"
|
|
})({
|
|
padding: 0
|
|
});
|
|
if (true) TreeItemCheckbox.displayName = "TreeItemCheckbox";
|
|
var useUtilityClasses11 = (classesProp) => {
|
|
const {
|
|
classes: classesFromTreeView
|
|
} = useTreeViewStyleContext();
|
|
const classes = _extends({}, classesProp, {
|
|
root: clsx_default(classesProp == null ? void 0 : classesProp.root, classesFromTreeView.root),
|
|
content: clsx_default(classesProp == null ? void 0 : classesProp.content, classesFromTreeView.itemContent),
|
|
iconContainer: clsx_default(classesProp == null ? void 0 : classesProp.iconContainer, classesFromTreeView.itemIconContainer),
|
|
checkbox: clsx_default(classesProp == null ? void 0 : classesProp.checkbox, classesFromTreeView.itemCheckbox),
|
|
label: clsx_default(classesProp == null ? void 0 : classesProp.label, classesFromTreeView.itemLabel),
|
|
groupTransition: clsx_default(classesProp == null ? void 0 : classesProp.groupTransition, classesFromTreeView.itemGroupTransition),
|
|
labelInput: clsx_default(classesProp == null ? void 0 : classesProp.labelInput, classesFromTreeView.itemLabelInput),
|
|
dragAndDropOverlay: clsx_default(classesProp == null ? void 0 : classesProp.dragAndDropOverlay, classesFromTreeView.itemDragAndDropOverlay),
|
|
errorIcon: clsx_default(classesProp == null ? void 0 : classesProp.errorIcon, classesFromTreeView.itemErrorIcon),
|
|
loadingIcon: clsx_default(classesProp == null ? void 0 : classesProp.loadingIcon, classesFromTreeView.itemLoadingIcon)
|
|
});
|
|
const slots = {
|
|
root: ["root"],
|
|
content: ["content"],
|
|
iconContainer: ["iconContainer"],
|
|
checkbox: ["checkbox"],
|
|
label: ["label"],
|
|
groupTransition: ["groupTransition"],
|
|
labelInput: ["labelInput"],
|
|
dragAndDropOverlay: ["dragAndDropOverlay"],
|
|
errorIcon: ["errorIcon"],
|
|
loadingIcon: ["loadingIcon"],
|
|
expanded: ["expanded"],
|
|
editing: ["editing"],
|
|
editable: ["editable"],
|
|
selected: ["selected"],
|
|
focused: ["focused"],
|
|
disabled: ["disabled"]
|
|
};
|
|
return composeClasses(slots, getTreeItemUtilityClass, classes);
|
|
};
|
|
var TreeItem = /* @__PURE__ */ React50.forwardRef(function TreeItem2(inProps, forwardedRef) {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
const props = useThemeProps3({
|
|
props: inProps,
|
|
name: "MuiTreeItem"
|
|
});
|
|
const {
|
|
id,
|
|
itemId,
|
|
label,
|
|
disabled,
|
|
disableSelection,
|
|
children,
|
|
slots = {},
|
|
slotProps = {},
|
|
classes: classesProp
|
|
} = props, other = _objectWithoutPropertiesLoose(props, _excluded22);
|
|
const {
|
|
getContextProviderProps,
|
|
getRootProps,
|
|
getContentProps,
|
|
getIconContainerProps,
|
|
getCheckboxProps,
|
|
getLabelProps,
|
|
getGroupTransitionProps,
|
|
getLabelInputProps,
|
|
getDragAndDropOverlayProps,
|
|
getErrorContainerProps,
|
|
getLoadingContainerProps,
|
|
status
|
|
} = useTreeItem({
|
|
id,
|
|
itemId,
|
|
children,
|
|
label,
|
|
disabled,
|
|
disableSelection
|
|
});
|
|
const classes = useUtilityClasses11(classesProp);
|
|
const Root = (_a = slots.root) != null ? _a : TreeItemRoot;
|
|
const rootProps = useSlotProps_default({
|
|
elementType: Root,
|
|
getSlotProps: getRootProps,
|
|
externalForwardedProps: other,
|
|
externalSlotProps: slotProps.root,
|
|
additionalProps: {
|
|
ref: forwardedRef
|
|
},
|
|
ownerState: {},
|
|
className: classes.root
|
|
});
|
|
const Content = (_b = slots.content) != null ? _b : TreeItemContent;
|
|
const contentProps = useSlotProps_default({
|
|
elementType: Content,
|
|
getSlotProps: getContentProps,
|
|
externalSlotProps: slotProps.content,
|
|
ownerState: {},
|
|
className: clsx_default(classes.content, status.expanded && classes.expanded, status.selected && classes.selected, status.focused && classes.focused, status.disabled && classes.disabled, status.editing && classes.editing, status.editable && classes.editable)
|
|
});
|
|
const IconContainer = (_c = slots.iconContainer) != null ? _c : TreeItemIconContainer;
|
|
const iconContainerProps = useSlotProps_default({
|
|
elementType: IconContainer,
|
|
getSlotProps: getIconContainerProps,
|
|
externalSlotProps: slotProps.iconContainer,
|
|
ownerState: {},
|
|
className: classes.iconContainer
|
|
});
|
|
const Label = (_d = slots.label) != null ? _d : TreeItemLabel;
|
|
const labelProps = useSlotProps_default({
|
|
elementType: Label,
|
|
getSlotProps: getLabelProps,
|
|
externalSlotProps: slotProps.label,
|
|
ownerState: {},
|
|
className: classes.label
|
|
});
|
|
const Checkbox3 = (_e = slots.checkbox) != null ? _e : TreeItemCheckbox;
|
|
const checkboxProps = useSlotProps_default({
|
|
elementType: Checkbox3,
|
|
getSlotProps: getCheckboxProps,
|
|
externalSlotProps: slotProps.checkbox,
|
|
ownerState: {},
|
|
className: classes.checkbox
|
|
});
|
|
const GroupTransition = (_f = slots.groupTransition) != null ? _f : void 0;
|
|
const groupTransitionProps = useSlotProps_default({
|
|
elementType: GroupTransition,
|
|
getSlotProps: getGroupTransitionProps,
|
|
externalSlotProps: slotProps.groupTransition,
|
|
ownerState: {},
|
|
className: classes.groupTransition
|
|
});
|
|
const LabelInput = (_g = slots.labelInput) != null ? _g : TreeItemLabelInput;
|
|
const labelInputProps = useSlotProps_default({
|
|
elementType: LabelInput,
|
|
getSlotProps: getLabelInputProps,
|
|
externalSlotProps: slotProps.labelInput,
|
|
ownerState: {},
|
|
className: classes.labelInput
|
|
});
|
|
const DragAndDropOverlay = (_h = slots.dragAndDropOverlay) != null ? _h : TreeItemDragAndDropOverlay;
|
|
const dragAndDropOverlayProps = useSlotProps_default({
|
|
elementType: DragAndDropOverlay,
|
|
getSlotProps: getDragAndDropOverlayProps,
|
|
externalSlotProps: slotProps.dragAndDropOverlay,
|
|
ownerState: {},
|
|
className: classes.dragAndDropOverlay
|
|
});
|
|
const ErrorIcon = (_i = slots.errorIcon) != null ? _i : TreeItemErrorContainer;
|
|
const errorContainerProps = useSlotProps_default({
|
|
elementType: ErrorIcon,
|
|
getSlotProps: getErrorContainerProps,
|
|
externalSlotProps: slotProps.errorIcon,
|
|
ownerState: {},
|
|
className: classes.errorIcon
|
|
});
|
|
const LoadingIcon = (_j = slots.loadingIcon) != null ? _j : TreeItemLoadingContainer;
|
|
const loadingContainerProps = useSlotProps_default({
|
|
elementType: LoadingIcon,
|
|
getSlotProps: getLoadingContainerProps,
|
|
externalSlotProps: slotProps.loadingIcon,
|
|
ownerState: {},
|
|
className: classes.loadingIcon
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TreeItemProvider, _extends({}, getContextProviderProps(), {
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Root, _extends({}, rootProps, {
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Content, _extends({}, contentProps, {
|
|
children: [/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(IconContainer, _extends({}, iconContainerProps, {
|
|
children: [status.error && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ErrorIcon, _extends({}, errorContainerProps)), status.loading ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LoadingIcon, _extends({}, loadingContainerProps)) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TreeItemIcon, {
|
|
status,
|
|
slots,
|
|
slotProps
|
|
})]
|
|
})), /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Checkbox3, _extends({}, checkboxProps)), status.editing ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LabelInput, _extends({}, labelInputProps)) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Label, _extends({}, labelProps)), /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DragAndDropOverlay, _extends({}, dragAndDropOverlayProps))]
|
|
})), children && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TreeItemGroupTransition, _extends({
|
|
as: GroupTransition
|
|
}, groupTransitionProps))]
|
|
}))
|
|
}));
|
|
});
|
|
if (true) TreeItem.displayName = "TreeItem";
|
|
true ? TreeItem.propTypes = {
|
|
// ----------------------------- Warning --------------------------------
|
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
// ----------------------------------------------------------------------
|
|
/**
|
|
* The content of the component.
|
|
*/
|
|
children: import_prop_types25.default.any,
|
|
/**
|
|
* Override or extend the styles applied to the component.
|
|
*/
|
|
classes: import_prop_types25.default.object,
|
|
className: import_prop_types25.default.string,
|
|
/**
|
|
* If `true`, the item is disabled.
|
|
* @default false
|
|
*/
|
|
disabled: import_prop_types25.default.bool,
|
|
/**
|
|
* If `true`, the item cannot be selected.
|
|
* @default false
|
|
*/
|
|
disableSelection: import_prop_types25.default.bool,
|
|
/**
|
|
* The id attribute of the item. If not provided, it will be generated.
|
|
*/
|
|
id: import_prop_types25.default.string,
|
|
/**
|
|
* The id of the item.
|
|
* Must be unique.
|
|
*/
|
|
itemId: import_prop_types25.default.string.isRequired,
|
|
/**
|
|
* The label of the item.
|
|
*/
|
|
label: import_prop_types25.default.node,
|
|
/**
|
|
* Callback fired when the item root is blurred.
|
|
*/
|
|
onBlur: import_prop_types25.default.func,
|
|
/**
|
|
* This prop isn't supported.
|
|
* Use the `onItemFocus` callback on the tree if you need to monitor an item's focus.
|
|
*/
|
|
onFocus: unsupportedProp,
|
|
/**
|
|
* Callback fired when a key is pressed on the keyboard and the tree is in focus.
|
|
*/
|
|
onKeyDown: import_prop_types25.default.func,
|
|
/**
|
|
* The props used for each component slot.
|
|
* @default {}
|
|
*/
|
|
slotProps: import_prop_types25.default.object,
|
|
/**
|
|
* Overridable component slots.
|
|
* @default {}
|
|
*/
|
|
slots: import_prop_types25.default.object,
|
|
/**
|
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
*/
|
|
sx: import_prop_types25.default.oneOfType([import_prop_types25.default.arrayOf(import_prop_types25.default.oneOfType([import_prop_types25.default.func, import_prop_types25.default.object, import_prop_types25.default.bool])), import_prop_types25.default.func, import_prop_types25.default.object])
|
|
} : void 0;
|
|
|
|
// node_modules/@mui/x-tree-view/internals/components/RichTreeViewItems.mjs
|
|
var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
|
|
var _excluded3 = ["ownerState"];
|
|
var RichTreeViewItemsContext = /* @__PURE__ */ React51.createContext(null);
|
|
if (true) RichTreeViewItemsContext.displayName = "RichTreeViewItemsContext";
|
|
var selectorNoChildren = () => EMPTY_ARRAY;
|
|
var selectorChildrenIdsNull = (state) => itemsSelectors.itemOrderedChildrenIds(state, null);
|
|
var WrappedTreeItem = /* @__PURE__ */ React51.memo(function WrappedTreeItem2({
|
|
itemSlot,
|
|
itemSlotProps,
|
|
itemId,
|
|
skipChildren
|
|
}) {
|
|
const renderItemForRichTreeView = React51.useContext(RichTreeViewItemsContext);
|
|
const {
|
|
store
|
|
} = useTreeViewContext();
|
|
const itemMeta = useStore(store, itemsSelectors.itemMeta, itemId);
|
|
const children = useStore(store, skipChildren ? selectorNoChildren : itemsSelectors.itemOrderedChildrenIds, itemId);
|
|
const Item = itemSlot != null ? itemSlot : TreeItem;
|
|
const _useSlotProps = useSlotProps_default({
|
|
elementType: Item,
|
|
externalSlotProps: itemSlotProps,
|
|
additionalProps: {
|
|
label: itemMeta == null ? void 0 : itemMeta.label,
|
|
id: itemMeta == null ? void 0 : itemMeta.idAttribute,
|
|
itemId
|
|
},
|
|
ownerState: {
|
|
itemId,
|
|
label: itemMeta == null ? void 0 : itemMeta.label
|
|
}
|
|
}), itemProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded3);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Item, _extends({}, itemProps, {
|
|
children: children == null ? void 0 : children.map(renderItemForRichTreeView)
|
|
}));
|
|
}, fastObjectShallowCompare);
|
|
if (true) WrappedTreeItem.displayName = "WrappedTreeItem";
|
|
function RichTreeViewItems(props) {
|
|
const {
|
|
slots,
|
|
slotProps
|
|
} = props;
|
|
const {
|
|
store
|
|
} = useTreeViewContext();
|
|
const itemSlot = slots == null ? void 0 : slots.item;
|
|
const itemSlotProps = slotProps == null ? void 0 : slotProps.item;
|
|
const domStructure = useStore(store, itemsSelectors.domStructure);
|
|
const items = useStore(store, domStructure === "flat" ? expansionSelectors.flatList : selectorChildrenIdsNull);
|
|
const skipChildren = domStructure === "flat";
|
|
const renderItem = React51.useCallback((itemId) => {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WrappedTreeItem, {
|
|
itemSlot,
|
|
itemSlotProps,
|
|
itemId,
|
|
skipChildren
|
|
}, itemId);
|
|
}, [itemSlot, itemSlotProps, skipChildren]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RichTreeViewItemsContext.Provider, {
|
|
value: renderItem,
|
|
children: items.map(renderItem)
|
|
});
|
|
}
|
|
|
|
// node_modules/@mui/x-tree-view/internals/hooks/useTreeViewRootProps.mjs
|
|
function useTreeViewRootProps(store, forwardedProps, ref) {
|
|
const treeId = useStore(store, idSelectors.treeId);
|
|
const itemChildrenIndentation = useStore(store, itemsSelectors.itemChildrenIndentation);
|
|
const isMultiSelectEnabled = useStore(store, selectionSelectors.isMultiSelectEnabled);
|
|
return (otherHandlers) => _extends({
|
|
ref,
|
|
role: "tree",
|
|
id: treeId,
|
|
"aria-multiselectable": isMultiSelectEnabled
|
|
}, forwardedProps, otherHandlers, {
|
|
style: _extends({}, forwardedProps.style, {
|
|
"--TreeView-itemChildrenIndentation": typeof itemChildrenIndentation === "number" ? `${itemChildrenIndentation}px` : itemChildrenIndentation
|
|
}),
|
|
onFocus: (event) => {
|
|
var _a;
|
|
(_a = otherHandlers.onFocus) == null ? void 0 : _a.call(otherHandlers, event);
|
|
store.focus.handleRootFocus(event);
|
|
},
|
|
onBlur: (event) => {
|
|
var _a;
|
|
(_a = otherHandlers.onBlur) == null ? void 0 : _a.call(otherHandlers, event);
|
|
store.focus.handleRootBlur(event);
|
|
}
|
|
});
|
|
}
|
|
|
|
// node_modules/@mui/x-tree-view/RichTreeView/useExtractRichTreeViewParameters.mjs
|
|
var React52 = __toESM(require_react(), 1);
|
|
var _excluded4 = ["apiRef", "slots", "slotProps", "disabledItemsFocusable", "items", "isItemDisabled", "isItemSelectionDisabled", "getItemLabel", "getItemChildren", "getItemId", "onItemClick", "itemChildrenIndentation", "id", "expandedItems", "defaultExpandedItems", "onExpandedItemsChange", "onItemExpansionToggle", "expansionTrigger", "disableSelection", "selectedItems", "defaultSelectedItems", "multiSelect", "checkboxSelection", "selectionPropagation", "onSelectedItemsChange", "onItemSelectionToggle", "onItemFocus", "onItemLabelChange", "isItemEditable"];
|
|
function useExtractRichTreeViewParameters(props) {
|
|
const {
|
|
// Props for Provider
|
|
apiRef,
|
|
slots,
|
|
slotProps,
|
|
// Shared parameters
|
|
disabledItemsFocusable,
|
|
items,
|
|
isItemDisabled: isItemDisabled2,
|
|
isItemSelectionDisabled,
|
|
getItemLabel,
|
|
getItemChildren,
|
|
getItemId,
|
|
onItemClick,
|
|
itemChildrenIndentation,
|
|
id,
|
|
expandedItems,
|
|
defaultExpandedItems,
|
|
onExpandedItemsChange,
|
|
onItemExpansionToggle,
|
|
expansionTrigger,
|
|
disableSelection,
|
|
selectedItems,
|
|
defaultSelectedItems,
|
|
multiSelect,
|
|
checkboxSelection,
|
|
selectionPropagation,
|
|
onSelectedItemsChange,
|
|
onItemSelectionToggle,
|
|
onItemFocus,
|
|
// RichTreeViewStore parameters
|
|
onItemLabelChange,
|
|
isItemEditable
|
|
// Forwarded props
|
|
} = props, forwardedProps = _objectWithoutPropertiesLoose(props, _excluded4);
|
|
const parameters = React52.useMemo(() => ({
|
|
// Shared parameters
|
|
disabledItemsFocusable,
|
|
items,
|
|
isItemDisabled: isItemDisabled2,
|
|
isItemSelectionDisabled,
|
|
getItemLabel,
|
|
getItemChildren,
|
|
getItemId,
|
|
onItemClick,
|
|
itemChildrenIndentation,
|
|
id,
|
|
expandedItems,
|
|
defaultExpandedItems,
|
|
onExpandedItemsChange,
|
|
onItemExpansionToggle,
|
|
expansionTrigger,
|
|
disableSelection,
|
|
selectedItems,
|
|
defaultSelectedItems,
|
|
multiSelect,
|
|
checkboxSelection,
|
|
selectionPropagation,
|
|
onSelectedItemsChange,
|
|
onItemSelectionToggle,
|
|
onItemFocus,
|
|
// RichTreeViewStore parameters
|
|
onItemLabelChange,
|
|
isItemEditable
|
|
}), [
|
|
// Shared parameters
|
|
disabledItemsFocusable,
|
|
items,
|
|
isItemDisabled2,
|
|
isItemSelectionDisabled,
|
|
getItemLabel,
|
|
getItemChildren,
|
|
getItemId,
|
|
onItemClick,
|
|
itemChildrenIndentation,
|
|
id,
|
|
expandedItems,
|
|
defaultExpandedItems,
|
|
onExpandedItemsChange,
|
|
onItemExpansionToggle,
|
|
expansionTrigger,
|
|
disableSelection,
|
|
selectedItems,
|
|
defaultSelectedItems,
|
|
multiSelect,
|
|
checkboxSelection,
|
|
selectionPropagation,
|
|
onSelectedItemsChange,
|
|
onItemSelectionToggle,
|
|
onItemFocus,
|
|
// RichTreeViewStore parameters
|
|
onItemLabelChange,
|
|
isItemEditable
|
|
]);
|
|
return {
|
|
apiRef,
|
|
slots,
|
|
slotProps,
|
|
parameters,
|
|
forwardedProps
|
|
};
|
|
}
|
|
|
|
// node_modules/@base-ui/utils/esm/useIsoLayoutEffect.js
|
|
var React53 = __toESM(require_react(), 1);
|
|
var noop2 = () => {
|
|
};
|
|
var useIsoLayoutEffect = typeof document !== "undefined" ? React53.useLayoutEffect : noop2;
|
|
|
|
// node_modules/@base-ui/utils/esm/useOnMount.js
|
|
var React54 = __toESM(require_react(), 1);
|
|
var EMPTY2 = [];
|
|
function useOnMount2(fn) {
|
|
React54.useEffect(fn, EMPTY2);
|
|
}
|
|
|
|
// node_modules/@mui/x-tree-view/internals/hooks/useTreeViewStore.mjs
|
|
function useTreeViewStore(StoreClass, parameters) {
|
|
const isRtl = useRtl();
|
|
const store = useRefWithInit(() => new StoreClass(_extends({}, parameters, {
|
|
isRtl
|
|
}))).current;
|
|
useIsoLayoutEffect(() => store.updateStateFromParameters(_extends({}, parameters, {
|
|
isRtl
|
|
})), [store, isRtl, parameters]);
|
|
useOnMount2(store.disposeEffect);
|
|
return store;
|
|
}
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/labelEditing/itemPlugin.mjs
|
|
var React55 = __toESM(require_react(), 1);
|
|
var useLabelEditingItemPlugin = ({
|
|
props
|
|
}) => {
|
|
const {
|
|
store
|
|
} = useTreeViewContext();
|
|
const {
|
|
label,
|
|
itemId
|
|
} = props;
|
|
const [labelInputValue, setLabelInputValue] = React55.useState(label);
|
|
const isItemEditable = useStore(store, labelSelectors.isItemEditable, itemId);
|
|
const isItemBeingEdited = useStore(store, labelSelectors.isItemBeingEdited, itemId);
|
|
React55.useEffect(() => {
|
|
if (!isItemBeingEdited) {
|
|
setLabelInputValue(label);
|
|
}
|
|
}, [isItemBeingEdited, label]);
|
|
return {
|
|
propsEnhancers: {
|
|
label: () => ({
|
|
editable: isItemEditable
|
|
}),
|
|
labelInput: ({
|
|
externalEventHandlers,
|
|
interactions
|
|
}) => {
|
|
if (!isItemEditable) {
|
|
return {};
|
|
}
|
|
const handleKeydown = (event) => {
|
|
var _a;
|
|
(_a = externalEventHandlers.onKeyDown) == null ? void 0 : _a.call(externalEventHandlers, event);
|
|
if (event.defaultMuiPrevented) {
|
|
return;
|
|
}
|
|
const target = event.target;
|
|
if (event.key === "Enter" && target.value) {
|
|
interactions.handleSaveItemLabel(event, target.value);
|
|
} else if (event.key === "Escape") {
|
|
interactions.handleCancelItemLabelEditing(event);
|
|
}
|
|
};
|
|
const handleBlur = (event) => {
|
|
var _a;
|
|
(_a = externalEventHandlers.onBlur) == null ? void 0 : _a.call(externalEventHandlers, event);
|
|
if (event.defaultMuiPrevented) {
|
|
return;
|
|
}
|
|
if (event.target.value) {
|
|
interactions.handleSaveItemLabel(event, event.target.value);
|
|
}
|
|
};
|
|
const handleInputChange = (event) => {
|
|
var _a;
|
|
(_a = externalEventHandlers.onChange) == null ? void 0 : _a.call(externalEventHandlers, event);
|
|
setLabelInputValue(event.target.value);
|
|
};
|
|
return {
|
|
value: labelInputValue != null ? labelInputValue : "",
|
|
"data-element": "labelInput",
|
|
onChange: handleInputChange,
|
|
onKeyDown: handleKeydown,
|
|
onBlur: handleBlur,
|
|
autoFocus: true,
|
|
type: "text"
|
|
};
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/labelEditing/TreeViewLabelEditingPlugin.mjs
|
|
var TreeViewLabelEditingPlugin = class {
|
|
constructor(store) {
|
|
__publicField(this, "buildPublicAPI", () => {
|
|
return {
|
|
setEditedItem: this.setEditedItem,
|
|
updateItemLabel: this.updateItemLabel
|
|
};
|
|
});
|
|
/**
|
|
* Set which item is currently being edited.
|
|
* You can pass `null` to exit editing mode.
|
|
* @param {TreeViewItemId | null} itemId The id of the item to edit, or `null` to exit editing mode.
|
|
*/
|
|
__publicField(this, "setEditedItem", (itemId) => {
|
|
if (itemId !== null && !labelSelectors.isItemEditable(this.store.state, itemId)) {
|
|
return;
|
|
}
|
|
this.store.set("editedItemId", itemId);
|
|
});
|
|
/**
|
|
* Used to update the label of an item.
|
|
* @param {TreeViewItemId} itemId The id of the item to update the label of.
|
|
* @param {string} label The new label of the item.
|
|
*/
|
|
__publicField(this, "updateItemLabel", (itemId, label) => {
|
|
if (!label) {
|
|
throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "The label of an item cannot be empty.", itemId].join("\n"));
|
|
}
|
|
const item = this.store.state.itemMetaLookup[itemId];
|
|
if (item.label === label) {
|
|
return;
|
|
}
|
|
this.store.set("itemMetaLookup", _extends({}, this.store.state.itemMetaLookup, {
|
|
[itemId]: _extends({}, item, {
|
|
label
|
|
})
|
|
}));
|
|
if (this.store.parameters.onItemLabelChange) {
|
|
this.store.parameters.onItemLabelChange(itemId, label);
|
|
}
|
|
});
|
|
this.store = store;
|
|
store.itemPluginManager.register(useLabelEditingItemPlugin, null);
|
|
}
|
|
};
|
|
|
|
// node_modules/@mui/x-internals/EventManager/EventManager.mjs
|
|
var EventManager = class {
|
|
constructor() {
|
|
__publicField(this, "maxListeners", 20);
|
|
__publicField(this, "warnOnce", false);
|
|
__publicField(this, "events", {});
|
|
}
|
|
on(eventName, listener, options = {}) {
|
|
let collection = this.events[eventName];
|
|
if (!collection) {
|
|
collection = {
|
|
highPriority: /* @__PURE__ */ new Map(),
|
|
regular: /* @__PURE__ */ new Map()
|
|
};
|
|
this.events[eventName] = collection;
|
|
}
|
|
if (options.isFirst) {
|
|
collection.highPriority.set(listener, true);
|
|
} else {
|
|
collection.regular.set(listener, true);
|
|
}
|
|
if (true) {
|
|
const collectionSize = collection.highPriority.size + collection.regular.size;
|
|
if (collectionSize > this.maxListeners && !this.warnOnce) {
|
|
this.warnOnce = true;
|
|
console.warn([`Possible EventEmitter memory leak detected. ${collectionSize} ${eventName} listeners added.`].join("\n"));
|
|
}
|
|
}
|
|
}
|
|
removeListener(eventName, listener) {
|
|
if (this.events[eventName]) {
|
|
this.events[eventName].regular.delete(listener);
|
|
this.events[eventName].highPriority.delete(listener);
|
|
}
|
|
}
|
|
removeAllListeners() {
|
|
this.events = {};
|
|
}
|
|
emit(eventName, ...args) {
|
|
const collection = this.events[eventName];
|
|
if (!collection) {
|
|
return;
|
|
}
|
|
const highPriorityListeners = Array.from(collection.highPriority.keys());
|
|
const regularListeners = Array.from(collection.regular.keys());
|
|
for (let i = highPriorityListeners.length - 1; i >= 0; i -= 1) {
|
|
const listener = highPriorityListeners[i];
|
|
if (collection.highPriority.has(listener)) {
|
|
listener.apply(this, args);
|
|
}
|
|
}
|
|
for (let i = 0; i < regularListeners.length; i += 1) {
|
|
const listener = regularListeners[i];
|
|
if (collection.regular.has(listener)) {
|
|
listener.apply(this, args);
|
|
}
|
|
}
|
|
}
|
|
once(eventName, listener) {
|
|
const that = this;
|
|
this.on(eventName, function oneTimeListener(...args) {
|
|
that.removeListener(eventName, oneTimeListener);
|
|
listener.apply(that, args);
|
|
});
|
|
}
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/expansion/utils.mjs
|
|
var getExpansionTrigger = ({
|
|
isItemEditable,
|
|
expansionTrigger
|
|
}) => {
|
|
if (expansionTrigger) {
|
|
return expansionTrigger;
|
|
}
|
|
if (isItemEditable) {
|
|
return "iconContainer";
|
|
}
|
|
return "content";
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/MinimalTreeViewStore/MinimalTreeViewStore.utils.mjs
|
|
function deriveStateFromParameters(parameters) {
|
|
var _a, _b, _c, _d, _e, _f;
|
|
return {
|
|
disabledItemsFocusable: (_a = parameters.disabledItemsFocusable) != null ? _a : false,
|
|
domStructure: "nested",
|
|
itemChildrenIndentation: (_b = parameters.itemChildrenIndentation) != null ? _b : "12px",
|
|
providedTreeId: parameters.id,
|
|
// TODO: Fix
|
|
expansionTrigger: getExpansionTrigger({
|
|
isItemEditable: parameters.isItemEditable,
|
|
expansionTrigger: parameters.expansionTrigger
|
|
}),
|
|
disableSelection: (_c = parameters.disableSelection) != null ? _c : false,
|
|
multiSelect: (_d = parameters.multiSelect) != null ? _d : false,
|
|
checkboxSelection: (_e = parameters.checkboxSelection) != null ? _e : false,
|
|
selectionPropagation: (_f = parameters.selectionPropagation) != null ? _f : EMPTY_OBJECT
|
|
};
|
|
}
|
|
function applyModelInitialValue(controlledValue, defaultValue, fallback) {
|
|
if (controlledValue !== void 0) {
|
|
return controlledValue;
|
|
}
|
|
if (defaultValue !== void 0) {
|
|
return defaultValue;
|
|
}
|
|
return fallback;
|
|
}
|
|
function createMinimalInitialState(parameters) {
|
|
return _extends({
|
|
treeId: void 0,
|
|
focusedItemId: null
|
|
}, deriveStateFromParameters(parameters), TreeViewItemsPlugin.buildItemsStateIfNeeded(parameters), {
|
|
expandedItems: applyModelInitialValue(parameters.expandedItems, parameters.defaultExpandedItems, []),
|
|
selectedItems: applyModelInitialValue(parameters.selectedItems, parameters.defaultSelectedItems, parameters.multiSelect ? EMPTY_ARRAY : null)
|
|
});
|
|
}
|
|
var globalTreeViewDefaultId = 0;
|
|
var createTreeViewDefaultId = () => {
|
|
globalTreeViewDefaultId += 1;
|
|
return `mui-tree-view-${globalTreeViewDefaultId}`;
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/MinimalTreeViewStore/TimeoutManager.mjs
|
|
var TimeoutManager = class {
|
|
constructor() {
|
|
__publicField(this, "timeoutIds", /* @__PURE__ */ (() => /* @__PURE__ */ new Map())());
|
|
__publicField(this, "intervalIds", /* @__PURE__ */ (() => /* @__PURE__ */ new Map())());
|
|
__publicField(this, "startTimeout", (key, delay, fn) => {
|
|
this.clearTimeout(key);
|
|
const id = setTimeout(() => {
|
|
this.timeoutIds.delete(key);
|
|
fn();
|
|
}, delay);
|
|
this.timeoutIds.set(key, id);
|
|
});
|
|
__publicField(this, "startInterval", (key, delay, fn) => {
|
|
this.clearTimeout(key);
|
|
const id = setInterval(fn, delay);
|
|
this.intervalIds.set(key, id);
|
|
});
|
|
__publicField(this, "clearTimeout", (key) => {
|
|
const id = this.timeoutIds.get(key);
|
|
if (id != null) {
|
|
clearTimeout(id);
|
|
this.timeoutIds.delete(key);
|
|
}
|
|
});
|
|
__publicField(this, "clearInterval", (key) => {
|
|
const id = this.intervalIds.get(key);
|
|
if (id != null) {
|
|
clearInterval(id);
|
|
this.intervalIds.delete(key);
|
|
}
|
|
});
|
|
__publicField(this, "clearAll", () => {
|
|
this.timeoutIds.forEach(clearTimeout);
|
|
this.timeoutIds.clear();
|
|
this.intervalIds.forEach(clearInterval);
|
|
this.intervalIds.clear();
|
|
});
|
|
}
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/plugins/keyboardNavigation/TreeViewKeyboardNavigationPlugin.mjs
|
|
var TYPEAHEAD_TIMEOUT = 500;
|
|
var TreeViewKeyboardNavigationPlugin = class {
|
|
// We can't type `store`, otherwise we get the following TS error:
|
|
// 'keyboardNavigation' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
|
|
constructor(store) {
|
|
__publicField(this, "typeaheadQuery", "");
|
|
__publicField(this, "canToggleItemSelection", (itemId) => selectionSelectors.canItemBeSelected(this.store.state, itemId));
|
|
__publicField(this, "canToggleItemExpansion", (itemId) => {
|
|
return !itemsSelectors.isItemDisabled(this.store.state, itemId) && expansionSelectors.isItemExpandable(this.store.state, itemId);
|
|
});
|
|
__publicField(this, "getFirstItemMatchingTypeaheadQuery", (itemId, newKey) => {
|
|
const getNextItem = (itemIdToCheck) => {
|
|
const nextItemId = getNextNavigableItem(this.store.state, itemIdToCheck);
|
|
if (nextItemId === null) {
|
|
return getFirstNavigableItem(this.store.state);
|
|
}
|
|
return nextItemId;
|
|
};
|
|
const getNextMatchingItemId = (query) => {
|
|
let matchingItemId = null;
|
|
const checkedItems = {};
|
|
let currentItemId = query.length > 1 ? itemId : getNextItem(itemId);
|
|
while (matchingItemId == null && !checkedItems[currentItemId]) {
|
|
const itemLabel = this.labelMap[currentItemId];
|
|
if (itemLabel == null ? void 0 : itemLabel.startsWith(query)) {
|
|
matchingItemId = currentItemId;
|
|
} else {
|
|
checkedItems[currentItemId] = true;
|
|
currentItemId = getNextItem(currentItemId);
|
|
}
|
|
}
|
|
return matchingItemId;
|
|
};
|
|
const cleanNewKey = newKey.toLowerCase();
|
|
const concatenatedQuery = `${this.typeaheadQuery}${cleanNewKey}`;
|
|
const concatenatedQueryMatchingItemId = getNextMatchingItemId(concatenatedQuery);
|
|
if (concatenatedQueryMatchingItemId != null) {
|
|
this.typeaheadQuery = concatenatedQuery;
|
|
return concatenatedQueryMatchingItemId;
|
|
}
|
|
const newKeyMatchingItemId = getNextMatchingItemId(cleanNewKey);
|
|
if (newKeyMatchingItemId != null) {
|
|
this.typeaheadQuery = cleanNewKey;
|
|
return newKeyMatchingItemId;
|
|
}
|
|
this.typeaheadQuery = "";
|
|
return null;
|
|
});
|
|
/**
|
|
* Updates the `labelMap` to add/remove the first character of some item's labels.
|
|
* This map is used to navigate the tree using type-ahead search.
|
|
* This method is only used by the `useTreeViewJSXItems` plugin, otherwise the updates are handled internally.
|
|
* @param {(map: TreeViewLabelMap) => TreeViewLabelMap} updater The function to update the map.
|
|
*/
|
|
__publicField(this, "updateLabelMap", (callback) => {
|
|
this.labelMap = callback(this.labelMap);
|
|
});
|
|
// ARIA specification: https://www.w3.org/WAI/ARIA/apg/patterns/treeview/#keyboardinteraction
|
|
/**
|
|
* Callback fired when a key is pressed on an item.
|
|
* Handles all the keyboard navigation logic.
|
|
* @param {React.KeyboardEvent<HTMLElement> & TreeViewCancellableEvent} event The keyboard event that triggered the callback.
|
|
* @param {TreeViewItemId} itemId The id of the item that the event was triggered on.
|
|
*/
|
|
__publicField(this, "handleItemKeyDown", (event, itemId) => __async(this, null, function* () {
|
|
var _a;
|
|
if (event.defaultMuiPrevented) {
|
|
return;
|
|
}
|
|
if (event.altKey || isTargetInDescendants(event.target, event.currentTarget)) {
|
|
return;
|
|
}
|
|
const ctrlPressed = event.ctrlKey || event.metaKey;
|
|
const key = event.key;
|
|
const isMultiSelectEnabled = selectionSelectors.isMultiSelectEnabled(this.store.state);
|
|
switch (true) {
|
|
// Select the item when pressing "Space"
|
|
case (key === " " && this.canToggleItemSelection(itemId)): {
|
|
event.preventDefault();
|
|
if (isMultiSelectEnabled && event.shiftKey) {
|
|
this.store.selection.expandSelectionRange(event, itemId);
|
|
} else {
|
|
this.store.selection.setItemSelection({
|
|
event,
|
|
itemId,
|
|
keepExistingSelection: isMultiSelectEnabled,
|
|
shouldBeSelected: void 0
|
|
});
|
|
}
|
|
break;
|
|
}
|
|
// If the focused item has children, we expand it.
|
|
// If the focused item has no children, we select it.
|
|
case key === "Enter": {
|
|
if (((_a = this.store.labelEditing) == null ? void 0 : _a.setEditedItem) && labelSelectors.isItemEditable(this.store.state, itemId) && !labelSelectors.isItemBeingEdited(this.store.state, itemId)) {
|
|
this.store.labelEditing.setEditedItem(itemId);
|
|
} else if (this.canToggleItemExpansion(itemId)) {
|
|
this.store.expansion.setItemExpansion({
|
|
event,
|
|
itemId
|
|
});
|
|
event.preventDefault();
|
|
} else if (this.canToggleItemSelection(itemId)) {
|
|
if (isMultiSelectEnabled) {
|
|
event.preventDefault();
|
|
this.store.selection.setItemSelection({
|
|
event,
|
|
itemId,
|
|
keepExistingSelection: true
|
|
});
|
|
} else if (!selectionSelectors.isItemSelected(this.store.state, itemId)) {
|
|
this.store.selection.setItemSelection({
|
|
event,
|
|
itemId
|
|
});
|
|
event.preventDefault();
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
// Focus the next focusable item
|
|
case key === "ArrowDown": {
|
|
const nextItem = getNextNavigableItem(this.store.state, itemId);
|
|
if (nextItem) {
|
|
event.preventDefault();
|
|
this.store.focus.focusItem(event, nextItem);
|
|
if (isMultiSelectEnabled && event.shiftKey && this.canToggleItemSelection(nextItem)) {
|
|
this.store.selection.selectItemFromArrowNavigation(event, itemId, nextItem);
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
// Focuses the previous focusable item
|
|
case key === "ArrowUp": {
|
|
const previousItem = getPreviousNavigableItem(this.store.state, itemId);
|
|
if (previousItem) {
|
|
event.preventDefault();
|
|
this.store.focus.focusItem(event, previousItem);
|
|
if (isMultiSelectEnabled && event.shiftKey && this.canToggleItemSelection(previousItem)) {
|
|
this.store.selection.selectItemFromArrowNavigation(event, itemId, previousItem);
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
// If the focused item is expanded, we move the focus to its first child
|
|
// If the focused item is collapsed and has children, we expand it
|
|
case (key === "ArrowRight" && !this.store.parameters.isRtl || key === "ArrowLeft" && this.store.parameters.isRtl): {
|
|
if (ctrlPressed) {
|
|
return;
|
|
}
|
|
if (expansionSelectors.isItemExpanded(this.store.state, itemId)) {
|
|
const nextItemId = getNextNavigableItem(this.store.state, itemId);
|
|
if (nextItemId) {
|
|
this.store.focus.focusItem(event, nextItemId);
|
|
event.preventDefault();
|
|
}
|
|
} else if (this.canToggleItemExpansion(itemId)) {
|
|
this.store.expansion.setItemExpansion({
|
|
event,
|
|
itemId
|
|
});
|
|
event.preventDefault();
|
|
}
|
|
break;
|
|
}
|
|
// If the focused item is expanded, we collapse it
|
|
// If the focused item is collapsed and has a parent, we move the focus to this parent
|
|
case (key === "ArrowLeft" && !this.store.parameters.isRtl || key === "ArrowRight" && this.store.parameters.isRtl): {
|
|
if (ctrlPressed) {
|
|
return;
|
|
}
|
|
if (this.canToggleItemExpansion(itemId) && expansionSelectors.isItemExpanded(this.store.state, itemId)) {
|
|
this.store.expansion.setItemExpansion({
|
|
event,
|
|
itemId
|
|
});
|
|
event.preventDefault();
|
|
} else {
|
|
const parent = itemsSelectors.itemParentId(this.store.state, itemId);
|
|
if (parent) {
|
|
this.store.focus.focusItem(event, parent);
|
|
event.preventDefault();
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
// Focuses the first item in the tree
|
|
case key === "Home": {
|
|
if (this.canToggleItemSelection(itemId) && isMultiSelectEnabled && ctrlPressed && event.shiftKey) {
|
|
this.store.selection.selectRangeFromStartToItem(event, itemId);
|
|
} else {
|
|
this.store.focus.focusItem(event, getFirstNavigableItem(this.store.state));
|
|
}
|
|
event.preventDefault();
|
|
break;
|
|
}
|
|
// Focuses the last item in the tree
|
|
case key === "End": {
|
|
if (this.canToggleItemSelection(itemId) && isMultiSelectEnabled && ctrlPressed && event.shiftKey) {
|
|
this.store.selection.selectRangeFromItemToEnd(event, itemId);
|
|
} else {
|
|
this.store.focus.focusItem(event, getLastNavigableItem(this.store.state));
|
|
}
|
|
event.preventDefault();
|
|
break;
|
|
}
|
|
// Expand all siblings that are at the same level as the focused item
|
|
case key === "*": {
|
|
this.store.expansion.expandAllSiblings(event, itemId);
|
|
event.preventDefault();
|
|
break;
|
|
}
|
|
// Multi select behavior when pressing Ctrl + a
|
|
// Selects all the items
|
|
case (String.fromCharCode(event.keyCode) === "A" && ctrlPressed && isMultiSelectEnabled && selectionSelectors.enabled(this.store.state)): {
|
|
this.store.selection.selectAllNavigableItems(event);
|
|
event.preventDefault();
|
|
break;
|
|
}
|
|
// Type-ahead
|
|
case (!ctrlPressed && !event.shiftKey && isPrintableKey(key)): {
|
|
this.store.timeoutManager.clearTimeout("typeahead");
|
|
const matchingItem = this.getFirstItemMatchingTypeaheadQuery(itemId, key);
|
|
if (matchingItem != null) {
|
|
this.store.focus.focusItem(event, matchingItem);
|
|
event.preventDefault();
|
|
} else {
|
|
this.typeaheadQuery = "";
|
|
}
|
|
this.store.timeoutManager.startTimeout("typeahead", TYPEAHEAD_TIMEOUT, () => {
|
|
this.typeaheadQuery = "";
|
|
});
|
|
break;
|
|
}
|
|
}
|
|
}));
|
|
this.store = store;
|
|
this.labelMap = createLabelMapFromItemMetaLookup(itemsSelectors.itemMetaLookup(this.store.state));
|
|
this.store.registerStoreEffect(itemsSelectors.itemMetaLookup, (_, itemMetaLookup) => {
|
|
if (this.store.shouldIgnoreItemsStateUpdate()) {
|
|
return;
|
|
}
|
|
this.labelMap = createLabelMapFromItemMetaLookup(itemMetaLookup);
|
|
});
|
|
}
|
|
};
|
|
function isPrintableKey(string) {
|
|
return !!string && string.length === 1 && !!string.match(/\S/);
|
|
}
|
|
function createLabelMapFromItemMetaLookup(itemMetaLookup) {
|
|
const labelMap = {};
|
|
const processItem = (item) => {
|
|
labelMap[item.id] = item.label.toLowerCase();
|
|
};
|
|
Object.values(itemMetaLookup).forEach(processItem);
|
|
return labelMap;
|
|
}
|
|
|
|
// node_modules/@mui/x-tree-view/internals/MinimalTreeViewStore/TreeViewItemPluginManager.mjs
|
|
var TreeViewItemPluginManager = class {
|
|
constructor() {
|
|
__publicField(this, "itemPlugins", []);
|
|
__publicField(this, "itemWrappers", []);
|
|
__publicField(this, "register", (plugin, wrapItem) => {
|
|
this.itemPlugins.push(plugin);
|
|
if (wrapItem) {
|
|
this.itemWrappers.push(wrapItem);
|
|
}
|
|
});
|
|
__publicField(this, "listPlugins", () => this.itemPlugins);
|
|
__publicField(this, "listWrappers", () => this.itemWrappers);
|
|
}
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/MinimalTreeViewStore/MinimalTreeViewStore.mjs
|
|
var MinimalTreeViewStore = class extends Store {
|
|
constructor(parameters, instanceName, mapper) {
|
|
const minimalInitialState = createMinimalInitialState(parameters);
|
|
const initialState = mapper.getInitialState(minimalInitialState, parameters);
|
|
super(initialState);
|
|
__publicField(this, "initialParameters", null);
|
|
__publicField(this, "eventManager", (() => new EventManager())());
|
|
__publicField(this, "timeoutManager", (() => new TimeoutManager())());
|
|
__publicField(this, "itemPluginManager", (() => new TreeViewItemPluginManager())());
|
|
/**
|
|
* Returns a cleanup function that need to be called when the store is destroyed.
|
|
*/
|
|
__publicField(this, "disposeEffect", () => {
|
|
return this.timeoutManager.clearAll;
|
|
});
|
|
/**
|
|
* Whether updates based on `props.items` change should be ignored.
|
|
*/
|
|
__publicField(this, "shouldIgnoreItemsStateUpdate", () => {
|
|
return this.mapper.shouldIgnoreItemsStateUpdate(this.parameters);
|
|
});
|
|
/**
|
|
* Registers an effect to be run when the value returned by the selector changes.
|
|
*/
|
|
__publicField(this, "registerStoreEffect", (selector, effect) => {
|
|
let previousValue = selector(this.state);
|
|
this.subscribe((state) => {
|
|
const nextValue = selector(state);
|
|
if (nextValue !== previousValue) {
|
|
effect(previousValue, nextValue);
|
|
previousValue = nextValue;
|
|
}
|
|
});
|
|
});
|
|
/**
|
|
* Publishes an event to all its subscribers.
|
|
*/
|
|
__publicField(this, "publishEvent", (name, params, event) => {
|
|
if (isSyntheticEvent(event) && event.isPropagationStopped()) {
|
|
return;
|
|
}
|
|
this.eventManager.emit(name, params, event);
|
|
});
|
|
/**
|
|
* Subscribe to an event emitted by the store.
|
|
* For now, the subscription is only removed when the store is destroyed.
|
|
*/
|
|
__publicField(this, "subscribeEvent", (eventName, handler) => {
|
|
this.eventManager.on(eventName, handler);
|
|
});
|
|
this.parameters = parameters;
|
|
this.instanceName = instanceName;
|
|
this.mapper = mapper;
|
|
this.items = new TreeViewItemsPlugin(this);
|
|
this.focus = new TreeViewFocusPlugin(this);
|
|
this.expansion = new TreeViewExpansionPlugin(this);
|
|
this.selection = new TreeViewSelectionPlugin(this);
|
|
this.keyboardNavigation = new TreeViewKeyboardNavigationPlugin(this);
|
|
if (true) {
|
|
this.initialParameters = parameters;
|
|
}
|
|
}
|
|
/**
|
|
* Builds an object containing the method that should be exposed publicly by the Tree View components.
|
|
*/
|
|
buildPublicAPI() {
|
|
return _extends({}, this.items.buildPublicAPI(), this.focus.buildPublicAPI(), this.expansion.buildPublicAPI(), this.selection.buildPublicAPI());
|
|
}
|
|
/**
|
|
* Updates the state of the Tree View based on the new parameters provided to the root component.
|
|
*/
|
|
updateStateFromParameters(parameters) {
|
|
const updateModel = (mutableNewState, controlledProp, defaultProp) => {
|
|
var _a, _b;
|
|
if (parameters[controlledProp] !== void 0) {
|
|
mutableNewState[controlledProp] = parameters[controlledProp];
|
|
}
|
|
if (true) {
|
|
const defaultValue = parameters[defaultProp];
|
|
const isControlled = parameters[controlledProp] !== void 0;
|
|
const initialDefaultValue = (_a = this.initialParameters) == null ? void 0 : _a[defaultProp];
|
|
const initialIsControlled = ((_b = this.initialParameters) == null ? void 0 : _b[controlledProp]) !== void 0;
|
|
if (initialIsControlled !== isControlled) {
|
|
warnOnce([`MUI X Tree View: A component is changing the ${initialIsControlled ? "" : "un"}controlled ${controlledProp} state of ${this.instanceName} to be ${initialIsControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${controlledProp} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"], "error");
|
|
} else if (JSON.stringify(initialDefaultValue) !== JSON.stringify(defaultValue)) {
|
|
warnOnce([`MUI X Tree View: A component is changing the default ${controlledProp} state of an uncontrolled ${this.instanceName} after being initialized. `, `To suppress this warning opt to use a controlled ${this.instanceName}.`], "error");
|
|
}
|
|
}
|
|
};
|
|
const newMinimalState = deriveStateFromParameters(parameters);
|
|
updateModel(newMinimalState, "expandedItems", "defaultExpandedItems");
|
|
updateModel(newMinimalState, "selectedItems", "defaultSelectedItems");
|
|
if (this.state.providedTreeId !== parameters.id || this.state.treeId === void 0) {
|
|
newMinimalState.treeId = createTreeViewDefaultId();
|
|
}
|
|
if (!this.mapper.shouldIgnoreItemsStateUpdate(parameters) && TreeViewItemsPlugin.shouldRebuildItemsState(parameters, this.parameters)) {
|
|
Object.assign(newMinimalState, TreeViewItemsPlugin.buildItemsStateIfNeeded(parameters));
|
|
}
|
|
const newState = this.mapper.updateStateFromParameters(newMinimalState, parameters, updateModel);
|
|
this.update(newState);
|
|
this.parameters = parameters;
|
|
}
|
|
};
|
|
function isSyntheticEvent(event) {
|
|
return (event == null ? void 0 : event.isPropagationStopped) !== void 0;
|
|
}
|
|
|
|
// node_modules/@mui/x-tree-view/internals/RichTreeViewStore/RichTreeViewStore.utils.mjs
|
|
var deriveStateFromParameters2 = (parameters) => {
|
|
var _a;
|
|
return {
|
|
isItemEditable: (_a = parameters.isItemEditable) != null ? _a : false
|
|
};
|
|
};
|
|
var parametersToStateMapper = {
|
|
getInitialState: (minimalInitialState, parameters) => _extends({}, minimalInitialState, deriveStateFromParameters2(parameters), {
|
|
editedItemId: null,
|
|
lazyLoadedItems: null
|
|
}),
|
|
updateStateFromParameters: (newMinimalState, parameters) => {
|
|
const newState = _extends({}, newMinimalState, deriveStateFromParameters2(parameters));
|
|
return newState;
|
|
},
|
|
shouldIgnoreItemsStateUpdate: () => false
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/internals/RichTreeViewStore/RichTreeViewStore.mjs
|
|
var ExtendableRichTreeViewStore = class extends MinimalTreeViewStore {
|
|
constructor() {
|
|
super(...arguments);
|
|
__publicField(this, "labelEditing", (() => new TreeViewLabelEditingPlugin(this))());
|
|
}
|
|
buildPublicAPI() {
|
|
return _extends({}, super.buildPublicAPI(), this.labelEditing.buildPublicAPI());
|
|
}
|
|
};
|
|
/**
|
|
* Mapper of the RichTreeViewStore.
|
|
* Can be used by classes extending the RichTreeViewStore to create their own mapper.
|
|
*/
|
|
__publicField(ExtendableRichTreeViewStore, "rawMapper", /* @__PURE__ */ (() => parametersToStateMapper)());
|
|
var RichTreeViewStore = class extends ExtendableRichTreeViewStore {
|
|
constructor(parameters) {
|
|
super(parameters, "RichTreeView", parametersToStateMapper);
|
|
}
|
|
};
|
|
|
|
// node_modules/@mui/x-tree-view/RichTreeView/RichTreeView.mjs
|
|
var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
|
|
var useThemeProps4 = createUseThemeProps("MuiRichTreeView");
|
|
var useUtilityClasses12 = (ownerState) => {
|
|
const {
|
|
classes
|
|
} = ownerState;
|
|
return React56.useMemo(() => {
|
|
const slots = {
|
|
root: ["root"],
|
|
item: ["item"],
|
|
itemContent: ["itemContent"],
|
|
itemGroupTransition: ["itemGroupTransition"],
|
|
itemIconContainer: ["itemIconContainer"],
|
|
itemLabel: ["itemLabel"],
|
|
itemLabelInput: ["itemLabelInput"],
|
|
itemCheckbox: ["itemCheckbox"]
|
|
// itemDragAndDropOverlay: ['itemDragAndDropOverlay'], => feature not available on this component
|
|
// itemErrorIcon: ['itemErrorIcon'], => feature not available on this component
|
|
};
|
|
return composeClasses(slots, getRichTreeViewUtilityClass, classes);
|
|
}, [classes]);
|
|
};
|
|
var RichTreeViewRoot = styled_default("ul", {
|
|
name: "MuiRichTreeView",
|
|
slot: "Root"
|
|
})({
|
|
padding: 0,
|
|
margin: 0,
|
|
listStyle: "none",
|
|
outline: 0,
|
|
position: "relative"
|
|
});
|
|
var RichTreeView = /* @__PURE__ */ React56.forwardRef(function RichTreeView2(inProps, forwardedRef) {
|
|
var _a;
|
|
const props = useThemeProps4({
|
|
props: inProps,
|
|
name: "MuiRichTreeView"
|
|
});
|
|
if (true) {
|
|
if (props.children != null) {
|
|
warnOnce(["MUI X: The Rich Tree View component does not support JSX children.", "If you want to add items, you need to use the `items` prop.", "Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/items/."]);
|
|
}
|
|
}
|
|
const {
|
|
slots,
|
|
slotProps,
|
|
apiRef,
|
|
parameters,
|
|
forwardedProps
|
|
} = useExtractRichTreeViewParameters(props);
|
|
const store = useTreeViewStore(RichTreeViewStore, parameters);
|
|
const ref = React56.useRef(null);
|
|
const handleRef = useMergedRefs(forwardedRef, ref);
|
|
const getRootProps = useTreeViewRootProps(store, forwardedProps, handleRef);
|
|
const classes = useUtilityClasses12(props);
|
|
const isLoading = useStore(store, lazyLoadingSelectors.isItemLoading, null);
|
|
const error = useStore(store, lazyLoadingSelectors.itemError, null);
|
|
const Root = (_a = slots == null ? void 0 : slots.root) != null ? _a : RichTreeViewRoot;
|
|
const rootProps = useSlotProps_default({
|
|
elementType: Root,
|
|
externalSlotProps: slotProps == null ? void 0 : slotProps.root,
|
|
className: classes.root,
|
|
getSlotProps: getRootProps,
|
|
ownerState: props
|
|
});
|
|
if (isLoading) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Typography_default, {
|
|
children: "Loading..."
|
|
});
|
|
}
|
|
if (error) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Alert_default, {
|
|
severity: "error",
|
|
children: error.message
|
|
});
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TreeViewProvider, {
|
|
store,
|
|
classes,
|
|
slots,
|
|
slotProps,
|
|
apiRef,
|
|
rootRef: ref,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TreeViewItemDepthContext.Provider, {
|
|
value: itemsSelectors.itemDepth,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Root, _extends({}, rootProps, {
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RichTreeViewItems, {
|
|
slots,
|
|
slotProps
|
|
})
|
|
}))
|
|
})
|
|
});
|
|
});
|
|
if (true) RichTreeView.displayName = "RichTreeView";
|
|
true ? RichTreeView.propTypes = {
|
|
// ----------------------------- Warning --------------------------------
|
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
// ----------------------------------------------------------------------
|
|
/**
|
|
* The ref object that allows Tree View manipulation. Can be instantiated with `useRichTreeViewApiRef()`.
|
|
*/
|
|
apiRef: import_prop_types26.default.shape({
|
|
current: import_prop_types26.default.shape({
|
|
focusItem: import_prop_types26.default.func,
|
|
getItem: import_prop_types26.default.func,
|
|
getItemDOMElement: import_prop_types26.default.func,
|
|
getItemOrderedChildrenIds: import_prop_types26.default.func,
|
|
getItemTree: import_prop_types26.default.func,
|
|
getParentId: import_prop_types26.default.func,
|
|
isItemExpanded: import_prop_types26.default.func,
|
|
setEditedItem: import_prop_types26.default.func,
|
|
setIsItemDisabled: import_prop_types26.default.func,
|
|
setItemExpansion: import_prop_types26.default.func,
|
|
setItemSelection: import_prop_types26.default.func,
|
|
updateItemLabel: import_prop_types26.default.func
|
|
})
|
|
}),
|
|
/**
|
|
* Whether the Tree View renders a checkbox at the left of its label that allows selecting it.
|
|
* @default false
|
|
*/
|
|
checkboxSelection: import_prop_types26.default.bool,
|
|
/**
|
|
* Override or extend the styles applied to the component.
|
|
*/
|
|
classes: import_prop_types26.default.object,
|
|
className: import_prop_types26.default.string,
|
|
/**
|
|
* Expanded item ids.
|
|
* Used when the item's expansion is not controlled.
|
|
* @default []
|
|
*/
|
|
defaultExpandedItems: import_prop_types26.default.arrayOf(import_prop_types26.default.string),
|
|
/**
|
|
* Selected item ids. (Uncontrolled)
|
|
* When `multiSelect` is true this takes an array of strings; when false (default) a string.
|
|
* @default []
|
|
*/
|
|
defaultSelectedItems: import_prop_types26.default.any,
|
|
/**
|
|
* Whether the items should be focusable when disabled.
|
|
* @default false
|
|
*/
|
|
disabledItemsFocusable: import_prop_types26.default.bool,
|
|
/**
|
|
* Whether selection is disabled.
|
|
* @default false
|
|
*/
|
|
disableSelection: import_prop_types26.default.bool,
|
|
/**
|
|
* Expanded item ids.
|
|
* Used when the item's expansion is controlled.
|
|
*/
|
|
expandedItems: import_prop_types26.default.arrayOf(import_prop_types26.default.string),
|
|
/**
|
|
* The slot that triggers the item's expansion when clicked.
|
|
* @default 'content'
|
|
*/
|
|
expansionTrigger: import_prop_types26.default.oneOf(["content", "iconContainer"]),
|
|
/**
|
|
* Used to determine the children of a given item.
|
|
*
|
|
* @template R
|
|
* @param {R} item The item to check.
|
|
* @returns {R[]} The children of the item.
|
|
* @default (item) => item.children
|
|
*/
|
|
getItemChildren: import_prop_types26.default.func,
|
|
/**
|
|
* Used to determine the id of a given item.
|
|
*
|
|
* @template R
|
|
* @param {R} item The item to check.
|
|
* @returns {TreeViewItemId} The id of the item.
|
|
* @default (item) => item.id
|
|
*/
|
|
getItemId: import_prop_types26.default.func,
|
|
/**
|
|
* Used to determine the string label for a given item.
|
|
*
|
|
* @template R
|
|
* @param {R} item The item to check.
|
|
* @returns {string} The label of the item.
|
|
* @default (item) => item.label
|
|
*/
|
|
getItemLabel: import_prop_types26.default.func,
|
|
/**
|
|
* This prop is used to help implement the accessibility logic.
|
|
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
*/
|
|
id: import_prop_types26.default.string,
|
|
/**
|
|
* Used to determine if a given item should be disabled.
|
|
* @template R
|
|
* @param {R} item The item to check.
|
|
* @returns {boolean} `true` if the item should be disabled.
|
|
*/
|
|
isItemDisabled: import_prop_types26.default.func,
|
|
/**
|
|
* Determine if a given item can be edited.
|
|
* @template R
|
|
* @param {R} item The item to check.
|
|
* @returns {boolean} `true` if the item can be edited.
|
|
* @default () => false
|
|
*/
|
|
isItemEditable: import_prop_types26.default.oneOfType([import_prop_types26.default.func, import_prop_types26.default.bool]),
|
|
/**
|
|
* Used to determine if a given item should have selection disabled.
|
|
* @template R
|
|
* @param {R} item The item to check.
|
|
* @returns {boolean} `true` if the item should have selection disabled.
|
|
*/
|
|
isItemSelectionDisabled: import_prop_types26.default.func,
|
|
/**
|
|
* Horizontal indentation between an item and its children.
|
|
* Examples: 24, "24px", "2rem", "2em".
|
|
* @default 12px
|
|
*/
|
|
itemChildrenIndentation: import_prop_types26.default.oneOfType([import_prop_types26.default.number, import_prop_types26.default.string]),
|
|
items: import_prop_types26.default.array.isRequired,
|
|
/**
|
|
* Whether multiple items can be selected.
|
|
* @default false
|
|
*/
|
|
multiSelect: import_prop_types26.default.bool,
|
|
/**
|
|
* Callback fired when Tree Items are expanded/collapsed.
|
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemExpansion()` method.
|
|
* @param {TreeViewItemId[]} itemIds The ids of the expanded items.
|
|
*/
|
|
onExpandedItemsChange: import_prop_types26.default.func,
|
|
/**
|
|
* Callback fired when the `content` slot of a given Tree Item is clicked.
|
|
* @param {React.MouseEvent} event The DOM event that triggered the change.
|
|
* @param {TreeViewItemId} itemId The id of the focused item.
|
|
*/
|
|
onItemClick: import_prop_types26.default.func,
|
|
/**
|
|
* Callback fired when a Tree Item is expanded or collapsed.
|
|
* @param {React.SyntheticEvent | null} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemExpansion()` method.
|
|
* @param {TreeViewItemId} itemId The itemId of the modified item.
|
|
* @param {boolean} isExpanded `true` if the item has just been expanded, `false` if it has just been collapsed.
|
|
*/
|
|
onItemExpansionToggle: import_prop_types26.default.func,
|
|
/**
|
|
* Callback fired when a given Tree Item is focused.
|
|
* @param {React.SyntheticEvent | null} event The DOM event that triggered the change. **Warning**: This is a generic event not a focus event.
|
|
* @param {TreeViewItemId} itemId The id of the focused item.
|
|
*/
|
|
onItemFocus: import_prop_types26.default.func,
|
|
/**
|
|
* Callback fired when the label of an item changes.
|
|
* @param {TreeViewItemId} itemId The id of the item that was edited.
|
|
* @param {string} newLabel The new label of the items.
|
|
*/
|
|
onItemLabelChange: import_prop_types26.default.func,
|
|
/**
|
|
* Callback fired when a Tree Item is selected or deselected.
|
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemSelection()` method.
|
|
* @param {TreeViewItemId} itemId The itemId of the modified item.
|
|
* @param {boolean} isSelected `true` if the item has just been selected, `false` if it has just been deselected.
|
|
*/
|
|
onItemSelectionToggle: import_prop_types26.default.func,
|
|
/**
|
|
* Callback fired when Tree Items are selected/deselected.
|
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemSelection()` method.
|
|
* @param {TreeViewItemId[] | TreeViewItemId} itemIds The ids of the selected items.
|
|
* When `multiSelect` is `true`, this is an array of strings; when false (default) a string.
|
|
*/
|
|
onSelectedItemsChange: import_prop_types26.default.func,
|
|
/**
|
|
* Selected item ids. (Controlled)
|
|
* When `multiSelect` is true this takes an array of strings; when false (default) a string.
|
|
*/
|
|
selectedItems: import_prop_types26.default.any,
|
|
/**
|
|
* When `selectionPropagation.descendants` is set to `true`.
|
|
*
|
|
* - Selecting a parent selects all its descendants automatically.
|
|
* - Deselecting a parent deselects all its descendants automatically.
|
|
*
|
|
* When `selectionPropagation.parents` is set to `true`.
|
|
*
|
|
* - Selecting all the descendants of a parent selects the parent automatically.
|
|
* - Deselecting a descendant of a selected parent deselects the parent automatically.
|
|
*
|
|
* Only works when `multiSelect` is `true`.
|
|
* On the <SimpleTreeView />, only the expanded items are considered (since the collapsed item are not passed to the Tree View component at all)
|
|
*
|
|
* @default { parents: false, descendants: false }
|
|
*/
|
|
selectionPropagation: import_prop_types26.default.shape({
|
|
descendants: import_prop_types26.default.bool,
|
|
parents: import_prop_types26.default.bool
|
|
}),
|
|
/**
|
|
* The props used for each component slot.
|
|
* @default {}
|
|
*/
|
|
slotProps: import_prop_types26.default.object,
|
|
/**
|
|
* Overridable component slots.
|
|
* @default {}
|
|
*/
|
|
slots: import_prop_types26.default.object,
|
|
/**
|
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
*/
|
|
sx: import_prop_types26.default.oneOfType([import_prop_types26.default.arrayOf(import_prop_types26.default.oneOfType([import_prop_types26.default.func, import_prop_types26.default.object, import_prop_types26.default.bool])), import_prop_types26.default.func, import_prop_types26.default.object])
|
|
} : void 0;
|
|
|
|
// node_modules/@mui/icons-material/esm/FolderRounded.js
|
|
var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
|
|
var FolderRounded_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", {
|
|
d: "M10.59 4.59C10.21 4.21 9.7 4 9.17 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"
|
|
}), "FolderRounded");
|
|
|
|
// node_modules/@mui/icons-material/esm/InsertDriveFile.js
|
|
var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
|
|
var InsertDriveFile_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", {
|
|
d: "M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z"
|
|
}), "InsertDriveFile");
|
|
|
|
// node_modules/@mui/material/esm/Box/Box.js
|
|
var import_prop_types27 = __toESM(require_prop_types(), 1);
|
|
|
|
// node_modules/@mui/material/esm/Box/boxClasses.js
|
|
var boxClasses = generateUtilityClasses("MuiBox", ["root"]);
|
|
var boxClasses_default = boxClasses;
|
|
|
|
// node_modules/@mui/material/esm/Box/Box.js
|
|
var defaultTheme2 = createTheme2();
|
|
var Box = createBox({
|
|
themeId: identifier_default,
|
|
defaultTheme: defaultTheme2,
|
|
defaultClassName: boxClasses_default.root,
|
|
generateClassName: ClassNameGenerator_default.generate
|
|
});
|
|
true ? Box.propTypes = {
|
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
/**
|
|
* @ignore
|
|
*/
|
|
children: import_prop_types27.default.node,
|
|
/**
|
|
* The component used for the root node.
|
|
* Either a string to use a HTML element or a component.
|
|
*/
|
|
component: import_prop_types27.default.elementType,
|
|
/**
|
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
*/
|
|
sx: import_prop_types27.default.oneOfType([import_prop_types27.default.arrayOf(import_prop_types27.default.oneOfType([import_prop_types27.default.func, import_prop_types27.default.object, import_prop_types27.default.bool])), import_prop_types27.default.func, import_prop_types27.default.object])
|
|
} : void 0;
|
|
var Box_default = Box;
|
|
|
|
// src/utils/index.ts
|
|
function hex(buf) {
|
|
const b = new Uint8Array(buf);
|
|
let s = "";
|
|
for (let i = 0; i < b.length; i++) s += b[i].toString(16).padStart(2, "0");
|
|
return s;
|
|
}
|
|
function digest(algo, data) {
|
|
return __async(this, null, function* () {
|
|
const ab = data.buffer.slice(
|
|
data.byteOffset,
|
|
data.byteOffset + data.byteLength
|
|
);
|
|
const d = yield crypto.subtle.digest(algo, ab);
|
|
return hex(d);
|
|
});
|
|
}
|
|
function calculateGitBlobSha(content) {
|
|
return __async(this, null, function* () {
|
|
const header = new TextEncoder().encode(`blob ${content.length}\0`);
|
|
const combined = new Uint8Array(header.length + content.length);
|
|
combined.set(header);
|
|
combined.set(content, header.length);
|
|
return digest("SHA-1", combined);
|
|
});
|
|
}
|
|
function calculateFileSha(content) {
|
|
return __async(this, null, function* () {
|
|
const data = content instanceof ArrayBuffer ? new Uint8Array(content) : content;
|
|
return calculateGitBlobSha(data);
|
|
});
|
|
}
|
|
function calculateTextSha(text) {
|
|
return __async(this, null, function* () {
|
|
const encoder = new TextEncoder();
|
|
const data = encoder.encode(text);
|
|
return calculateGitBlobSha(data);
|
|
});
|
|
}
|
|
var FlowershowError = class extends Error {
|
|
constructor(message) {
|
|
super(message);
|
|
this.name = "FlowershowError";
|
|
}
|
|
};
|
|
function isPlainTextExtension(ext) {
|
|
return ["md", "mdx", "json", "yaml", "yml", "css"].includes(ext);
|
|
}
|
|
function createSiteNotice(message, siteUrl) {
|
|
const frag = document.createDocumentFragment();
|
|
frag.append(document.createTextNode(`\u2705 ${message} `));
|
|
if (siteUrl) {
|
|
const a = document.createElement("a");
|
|
a.href = siteUrl;
|
|
a.textContent = "View site \u2192";
|
|
a.target = "_blank";
|
|
a.rel = "noopener noreferrer";
|
|
frag.append(a);
|
|
}
|
|
return frag;
|
|
}
|
|
|
|
// src/components/PublishStatusModal.tsx
|
|
var import_jsx_runtime37 = __toESM(require_jsx_runtime());
|
|
function buildFileTree(items) {
|
|
const nodeMap = /* @__PURE__ */ new Map();
|
|
items.forEach((item) => {
|
|
const path = item instanceof import_obsidian.TFile ? item.path : item;
|
|
const parts = path.split("/");
|
|
parts.forEach((part, i) => {
|
|
const currentPath = parts.slice(0, i + 1).join("/");
|
|
const parentPath = parts.slice(0, i).join("/");
|
|
const isLastPart = i === parts.length - 1;
|
|
if (!nodeMap.has(currentPath)) {
|
|
nodeMap.set(currentPath, {
|
|
id: currentPath,
|
|
label: part,
|
|
children: [],
|
|
nodeType: isLastPart ? "file" : "folder"
|
|
// ✅ set nodeType
|
|
});
|
|
}
|
|
const currentNode = nodeMap.get(currentPath);
|
|
if (i > 0) {
|
|
const parentNode = nodeMap.get(parentPath);
|
|
if (parentNode) {
|
|
if (!parentNode.children) parentNode.children = [];
|
|
if (!parentNode.children.some((child) => child.id === currentPath)) {
|
|
parentNode.children.push(currentNode);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
const rootNodes = Array.from(nodeMap.values()).filter(
|
|
(node2) => !node2.id.includes("/")
|
|
);
|
|
const sortNodes = (nodes) => nodes.sort((a, b) => a.label.localeCompare(b.label)).map((node2) => __spreadProps(__spreadValues({}, node2), {
|
|
children: node2.children && node2.children.length > 0 ? sortNodes(
|
|
node2.children
|
|
) : void 0
|
|
}));
|
|
return sortNodes(rootNodes);
|
|
}
|
|
var Section = ({
|
|
title,
|
|
count,
|
|
items,
|
|
buttonText,
|
|
loading = false,
|
|
disabled = false,
|
|
onButtonClick,
|
|
selectedItems = [],
|
|
onSelectionChange,
|
|
defaultCollapsed = false
|
|
}) => {
|
|
const [isCollapsed, setIsCollapsed] = React57.useState(defaultCollapsed);
|
|
const fileTree = React57.useMemo(() => buildFileTree(items), [items]);
|
|
const fileIdSet = React57.useMemo(() => {
|
|
const set = /* @__PURE__ */ new Set();
|
|
const visit = (nodes) => {
|
|
for (const n of nodes) {
|
|
if (n.nodeType === "file") {
|
|
set.add(String(n.id));
|
|
}
|
|
if (n.children && n.children.length) {
|
|
visit(n.children);
|
|
}
|
|
}
|
|
};
|
|
visit(fileTree);
|
|
return set;
|
|
}, [fileTree]);
|
|
const selectedFileItems = React57.useMemo(
|
|
() => (selectedItems || []).filter((id) => fileIdSet.has(String(id))),
|
|
[selectedItems, fileIdSet]
|
|
);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "header-container", style: { marginBottom: "8px" }, children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
"div",
|
|
{
|
|
className: "title-container",
|
|
style: {
|
|
display: "flex",
|
|
alignItems: "center",
|
|
justifyContent: "space-between",
|
|
cursor: "pointer"
|
|
},
|
|
onClick: () => setIsCollapsed(!isCollapsed),
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
"h3",
|
|
{
|
|
style: {
|
|
fontSize: "1em",
|
|
margin: 0,
|
|
display: "flex",
|
|
alignItems: "center",
|
|
gap: "4px"
|
|
},
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { style: { fontSize: "0.8em" }, children: isCollapsed ? "\u25B6" : "\u25BC" }),
|
|
title,
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "count", children: [
|
|
"(",
|
|
count,
|
|
" files)"
|
|
] })
|
|
]
|
|
}
|
|
),
|
|
buttonText && onButtonClick && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
"button",
|
|
{
|
|
style: { cursor: loading ? "default" : "pointer" },
|
|
onClick: (e) => __async(null, null, function* () {
|
|
e.stopPropagation();
|
|
const button = e.currentTarget;
|
|
button.disabled = true;
|
|
yield onButtonClick();
|
|
button.disabled = false;
|
|
}),
|
|
disabled: loading || selectedFileItems.length === 0,
|
|
children: `${buttonText} (${selectedFileItems.length})`
|
|
}
|
|
)
|
|
]
|
|
}
|
|
),
|
|
!isCollapsed && (loading ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { style: { padding: "0 10px", color: "var(--text-muted)" }, children: "Loading..." }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
RichTreeView,
|
|
{
|
|
"aria-label": `${title} files`,
|
|
items: fileTree,
|
|
multiSelect: true,
|
|
checkboxSelection: true,
|
|
disableSelection: loading,
|
|
selectedItems: selectedFileItems,
|
|
onSelectedItemsChange: (_, ids) => {
|
|
const filesOnly = ids.filter(
|
|
(id) => fileIdSet.has(String(id))
|
|
);
|
|
onSelectionChange == null ? void 0 : onSelectionChange(filesOnly);
|
|
},
|
|
selectionPropagation: { descendants: true, parents: true },
|
|
itemChildrenIndentation: 16,
|
|
slots: { item: CustomTreeItem },
|
|
sx: { flexGrow: 1, maxWidth: "100%", color: "var(--text-normal)" }
|
|
}
|
|
))
|
|
] });
|
|
};
|
|
var _PublishStatusModal = class _PublishStatusModal extends import_obsidian.Modal {
|
|
constructor(props) {
|
|
super(props.app);
|
|
this.root = null;
|
|
this.props = props;
|
|
}
|
|
static updateCache(status, siteId) {
|
|
_PublishStatusModal.cachedStatus = status;
|
|
_PublishStatusModal.cachedSiteId = siteId;
|
|
}
|
|
static clearCache() {
|
|
_PublishStatusModal.cachedStatus = null;
|
|
_PublishStatusModal.cachedSiteId = null;
|
|
}
|
|
onOpen() {
|
|
const container = this.contentEl.createDiv();
|
|
container.addClass("publish-status-view");
|
|
this.root = (0, import_client.createRoot)(container);
|
|
this.root.render(
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
PublishStatusModalContent,
|
|
__spreadProps(__spreadValues({}, this.props), {
|
|
onClose: () => this.close(),
|
|
initialStatus: _PublishStatusModal.cachedStatus,
|
|
initialSiteId: _PublishStatusModal.cachedSiteId,
|
|
onStatusUpdate: _PublishStatusModal.updateCache
|
|
})
|
|
)
|
|
);
|
|
}
|
|
onClose() {
|
|
if (this.root) {
|
|
this.root.unmount();
|
|
}
|
|
}
|
|
};
|
|
// Cache publish status across modal open/close cycles
|
|
_PublishStatusModal.cachedStatus = null;
|
|
_PublishStatusModal.cachedSiteId = null;
|
|
var PublishStatusModal = _PublishStatusModal;
|
|
var PublishStatusModalContent = ({
|
|
publisher,
|
|
onClose,
|
|
initialStatus,
|
|
initialSiteId,
|
|
onStatusUpdate
|
|
}) => {
|
|
const [publishStatus, setPublishStatus] = React57.useState(initialStatus);
|
|
const [publishStatusResponseStatus, setPublishStatusResponseStatus] = React57.useState(
|
|
initialStatus ? "success" : "loading"
|
|
);
|
|
const [siteId, setSiteId] = React57.useState(initialSiteId);
|
|
const [selectedBySection, setSelectedBySection] = React57.useState({
|
|
Changed: [],
|
|
New: [],
|
|
Deleted: [],
|
|
Unchanged: []
|
|
});
|
|
const [isPublishing, setIsPublishing] = React57.useState(false);
|
|
const isDisabled = publishStatusResponseStatus === "loading" || isPublishing;
|
|
const { unchangedFiles, changedFiles, newFiles, deletedFiles } = publishStatus || {
|
|
unchangedFiles: [],
|
|
changedFiles: [],
|
|
newFiles: [],
|
|
deletedFiles: []
|
|
};
|
|
const isLoading = !publishStatus;
|
|
const fetchStatus = (isInitialLoad = false) => __async(null, null, function* () {
|
|
setPublishStatusResponseStatus("loading");
|
|
try {
|
|
const id = yield publisher.getSiteId();
|
|
setSiteId(id);
|
|
const status = yield publisher.getPublishStatus();
|
|
setPublishStatus(status);
|
|
setPublishStatusResponseStatus("success");
|
|
onStatusUpdate(status, id);
|
|
} catch (e) {
|
|
setPublishStatusResponseStatus("error");
|
|
console.error("Failed to fetch publish status", e);
|
|
}
|
|
});
|
|
React57.useEffect(() => {
|
|
fetchStatus(true);
|
|
}, []);
|
|
const refreshStatus = () => __async(null, null, function* () {
|
|
yield fetchStatus();
|
|
});
|
|
const handlePublishOperation = (operation, action) => __async(null, null, function* () {
|
|
setIsPublishing(true);
|
|
try {
|
|
const result = yield action();
|
|
const frag = document.createDocumentFragment();
|
|
frag.append(
|
|
document.createTextNode(
|
|
`\u2705 ${operation === "publish" ? "Published" : "Unpublished"} ${result.filesPublished} files. `
|
|
)
|
|
);
|
|
if (result.siteUrl) {
|
|
const a = document.createElement("a");
|
|
a.href = result.siteUrl;
|
|
a.textContent = "View site";
|
|
a.target = "_blank";
|
|
a.rel = "noopener noreferrer";
|
|
frag.append(a);
|
|
}
|
|
new import_obsidian.Notice(frag, 8e3);
|
|
} catch (e) {
|
|
if (e instanceof FlowershowError) {
|
|
new import_obsidian.Notice(`\u274C Couldn't ${operation} files: ${e.message}`);
|
|
} else {
|
|
new import_obsidian.Notice(
|
|
`\u274C Couldn't ${operation} files. See console errors for more info.`
|
|
);
|
|
}
|
|
console.error(e);
|
|
} finally {
|
|
setIsPublishing(false);
|
|
}
|
|
yield fetchStatus();
|
|
});
|
|
const publishSelectedNewFiles = () => __async(null, null, function* () {
|
|
const selectedIds = selectedBySection.New;
|
|
const files = mapIdsToTFiles(newFiles, selectedIds);
|
|
yield handlePublishOperation(
|
|
"publish",
|
|
() => publisher.publishBatch({ filesToPublish: files })
|
|
);
|
|
});
|
|
const publishSelectedChangedFiles = () => __async(null, null, function* () {
|
|
const selectedIds = selectedBySection.Changed;
|
|
const files = mapIdsToTFiles(changedFiles, selectedIds);
|
|
yield handlePublishOperation(
|
|
"publish",
|
|
() => publisher.publishBatch({ filesToPublish: files })
|
|
);
|
|
});
|
|
const unpublishSelectedDeletedFiles = () => __async(null, null, function* () {
|
|
const paths = selectedBySection.Deleted;
|
|
yield handlePublishOperation(
|
|
"unpublish",
|
|
() => publisher.publishBatch({ filesToDelete: paths })
|
|
);
|
|
});
|
|
const unpublishSelectedUnchangedFiles = () => __async(null, null, function* () {
|
|
const paths = selectedBySection.Unchanged;
|
|
yield handlePublishOperation(
|
|
"unpublish",
|
|
() => publisher.publishBatch({ filesToDelete: paths })
|
|
);
|
|
});
|
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
"div",
|
|
{
|
|
className: "publish-header",
|
|
style: {
|
|
display: "flex",
|
|
flexWrap: "nowrap",
|
|
justifyContent: "space-between",
|
|
alignItems: "center",
|
|
marginBottom: "20px",
|
|
padding: "10px",
|
|
borderBottom: "1px solid var(--background-modifier-border)",
|
|
maxWidth: "100%",
|
|
gap: "12px"
|
|
},
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { style: { flexGrow: 1, minWidth: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
"p",
|
|
{
|
|
className: "publish-header-text",
|
|
style: {
|
|
margin: "0",
|
|
whiteSpace: "nowrap",
|
|
overflow: "hidden",
|
|
textOverflow: "ellipsis"
|
|
},
|
|
children: [
|
|
"Publishing to",
|
|
" ",
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
"a",
|
|
{
|
|
href: siteId ? `${API_URL}/site/${siteId}/settings` : `${API_URL}/`,
|
|
style: {
|
|
color: "var(--text-accent)",
|
|
textDecoration: "none"
|
|
},
|
|
children: publisher.getSiteName()
|
|
}
|
|
)
|
|
]
|
|
}
|
|
) }),
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
"button",
|
|
{
|
|
onClick: () => __async(null, null, function* () {
|
|
if (!publishStatus) return;
|
|
const filesToPublish = [
|
|
...publishStatus.changedFiles,
|
|
...publishStatus.newFiles
|
|
];
|
|
const filesToDelete = publishStatus.deletedFiles;
|
|
if (!filesToDelete.length && !filesToPublish.length) {
|
|
new import_obsidian.Notice("\u274C Nothing new to publish or delete.");
|
|
return;
|
|
}
|
|
yield handlePublishOperation(
|
|
"publish",
|
|
() => publisher.publishBatch({
|
|
filesToPublish,
|
|
filesToDelete
|
|
})
|
|
);
|
|
}),
|
|
disabled: isDisabled,
|
|
style: {
|
|
marginRight: "8px",
|
|
cursor: isDisabled ? "default" : "pointer"
|
|
},
|
|
children: "Publish All"
|
|
}
|
|
),
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
"button",
|
|
{
|
|
title: "Refresh",
|
|
className: "clickable-icon",
|
|
onClick: refreshStatus,
|
|
disabled: isDisabled,
|
|
style: {
|
|
cursor: isDisabled ? "default" : "pointer"
|
|
},
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
"svg",
|
|
{
|
|
xmlns: "http://www.w3.org/2000/svg",
|
|
width: "20",
|
|
height: "20",
|
|
viewBox: "0 0 24 24",
|
|
fill: "none",
|
|
stroke: "currentColor",
|
|
strokeWidth: "2",
|
|
strokeLinecap: "round",
|
|
strokeLinejoin: "round",
|
|
className: "svg-icon lucide-refresh-cw",
|
|
style: {
|
|
animation: isDisabled ? "spin 1s linear infinite" : "none"
|
|
},
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { d: "M21 3v5h-5" }),
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { d: "M3 21v-5h5" })
|
|
]
|
|
}
|
|
)
|
|
}
|
|
)
|
|
] })
|
|
]
|
|
}
|
|
),
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { style: { opacity: isLoading ? 0.7 : 1 }, children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
Section,
|
|
{
|
|
title: "Changed",
|
|
count: changedFiles.length,
|
|
items: changedFiles,
|
|
buttonText: "Update selected files",
|
|
loading: isLoading,
|
|
onButtonClick: publishSelectedChangedFiles,
|
|
selectedItems: selectedBySection.Changed,
|
|
onSelectionChange: (ids) => {
|
|
setSelectedBySection((s) => __spreadProps(__spreadValues({}, s), { Changed: ids }));
|
|
}
|
|
}
|
|
),
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
Section,
|
|
{
|
|
title: "New",
|
|
count: newFiles.length,
|
|
items: newFiles,
|
|
buttonText: "Publish selected files",
|
|
loading: isLoading,
|
|
onButtonClick: publishSelectedNewFiles,
|
|
selectedItems: selectedBySection.New,
|
|
onSelectionChange: (ids) => setSelectedBySection((s) => __spreadProps(__spreadValues({}, s), { New: ids }))
|
|
}
|
|
),
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
Section,
|
|
{
|
|
title: "Deleted",
|
|
count: deletedFiles.length,
|
|
items: deletedFiles,
|
|
buttonText: "Unpublish selected files",
|
|
loading: isLoading,
|
|
onButtonClick: unpublishSelectedDeletedFiles,
|
|
selectedItems: selectedBySection.Deleted,
|
|
onSelectionChange: (ids) => setSelectedBySection((s) => __spreadProps(__spreadValues({}, s), { Deleted: ids }))
|
|
}
|
|
),
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
Section,
|
|
{
|
|
title: "Unchanged (select to unpublish)",
|
|
count: unchangedFiles.length,
|
|
items: unchangedFiles,
|
|
buttonText: "Unpublish selected files",
|
|
loading: isLoading,
|
|
onButtonClick: unpublishSelectedUnchangedFiles,
|
|
selectedItems: selectedBySection.Unchanged,
|
|
onSelectionChange: (ids) => setSelectedBySection((s) => __spreadProps(__spreadValues({}, s), { Unchanged: ids })),
|
|
defaultCollapsed: true
|
|
}
|
|
)
|
|
] })
|
|
] });
|
|
};
|
|
var CustomTreeItem = React57.forwardRef(function CustomTreeItem2(props, ref) {
|
|
const _a = props, { id, itemId, label, disabled, children } = _a, other = __objRest(_a, ["id", "itemId", "label", "disabled", "children"]);
|
|
const {
|
|
getContextProviderProps,
|
|
getRootProps,
|
|
getContentProps,
|
|
getIconContainerProps,
|
|
getCheckboxProps,
|
|
getLabelProps,
|
|
getGroupTransitionProps,
|
|
getDragAndDropOverlayProps,
|
|
status
|
|
} = useTreeItem({ id, itemId, label, disabled, rootRef: ref });
|
|
let IconComp = InsertDriveFile_default;
|
|
if (status.expandable) {
|
|
IconComp = FolderRounded_default;
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TreeItemProvider, __spreadProps(__spreadValues({}, getContextProviderProps()), { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(TreeItemRoot, __spreadProps(__spreadValues({}, getRootProps(other)), { children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(TreeItemContent, __spreadProps(__spreadValues({}, getContentProps()), { children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TreeItemIconContainer, __spreadProps(__spreadValues({}, getIconContainerProps()), { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TreeItemIcon, { status }) })),
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Box_default, { sx: { flexGrow: 1, display: "flex", gap: 1 }, children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TreeItemCheckbox, __spreadValues({}, getCheckboxProps())),
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(IconComp, { fontSize: "small" }),
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TreeItemLabel, __spreadValues({}, getLabelProps()))
|
|
] }),
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TreeItemDragAndDropOverlay, __spreadValues({}, getDragAndDropOverlayProps()))
|
|
] })),
|
|
children ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TreeItemGroupTransition, __spreadProps(__spreadValues({}, getGroupTransitionProps()), { children })) : null
|
|
] })) }));
|
|
});
|
|
function mapIdsToTFiles(pool, ids) {
|
|
const byPath = new Map(pool.map((f) => [f.path, f]));
|
|
return ids.map((id) => byPath.get(id)).filter((v) => !!v);
|
|
}
|
|
|
|
// src/constants.ts
|
|
var flowershowIcon = `<path fill="currentColor" d="M53.333 72.292V55.795c11.494-2.963 20-13.366 20-25.795V10C63.291 10 54.548 15.561 50 23.77 45.452 15.561 36.712 10 26.667 10v20c0 12.429 8.509 22.832 20 25.795v16.497L20 45.625v3.334c0 7.363 2.988 14.029 7.813 18.854L50 90l22.188-22.188C77.012 62.988 80 56.322 80 48.959v-3.334L53.333 72.292zm13.334-54.479V30c0 8.691-5.573 16.107-13.334 18.861V36.667c0-8.691 5.573-16.106 13.334-18.854zM33.333 30V17.813c7.761 2.748 13.334 10.163 13.334 18.854v12.194C38.906 46.107 33.333 38.691 33.333 30z"/>`;
|
|
|
|
// src/Publisher.ts
|
|
var import_obsidian4 = require("obsidian");
|
|
|
|
// src/FlowershowClient.ts
|
|
var import_obsidian2 = require("obsidian");
|
|
var FlowershowClient = class {
|
|
constructor(apiUrl, token2) {
|
|
this.apiUrl = apiUrl.replace(/\/$/, "");
|
|
this.token = token2;
|
|
}
|
|
/**
|
|
* Make an authenticated API request
|
|
*/
|
|
apiRequest(_0) {
|
|
return __async(this, arguments, function* (endpoint, options = {}) {
|
|
const url = `${this.apiUrl}${endpoint}`;
|
|
const headers = __spreadProps(__spreadValues({}, options.headers), {
|
|
Authorization: `Bearer ${this.token}`,
|
|
"X-Flowershow-Plugin-Version": "4.1.2"
|
|
});
|
|
return (0, import_obsidian2.requestUrl)({
|
|
url,
|
|
method: options.method,
|
|
headers,
|
|
body: options.body,
|
|
throw: false
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
* Get user info (to validate token)
|
|
*/
|
|
getUserInfo() {
|
|
return __async(this, null, function* () {
|
|
const response = yield this.apiRequest("/api/user");
|
|
if (response.status >= 300) {
|
|
let error = {};
|
|
try {
|
|
error = response.json;
|
|
} catch (_) {
|
|
}
|
|
throw new Error(
|
|
error.message || `Failed to get user info: ${response.status}`
|
|
);
|
|
}
|
|
return response.json;
|
|
});
|
|
}
|
|
/**
|
|
* Create a new site or get existing site by name
|
|
*/
|
|
createSite(projectName, overwrite = false) {
|
|
return __async(this, null, function* () {
|
|
const response = yield this.apiRequest("/api/sites", {
|
|
method: "POST",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify({ projectName, overwrite })
|
|
});
|
|
if (response.status >= 300) {
|
|
let error = {};
|
|
try {
|
|
error = response.json;
|
|
} catch (_) {
|
|
}
|
|
throw new Error(
|
|
error.message || `Failed to create site: ${response.status}`
|
|
);
|
|
}
|
|
return response.json;
|
|
});
|
|
}
|
|
/**
|
|
* Get a site by name
|
|
*/
|
|
getSiteByName(username, siteName) {
|
|
return __async(this, null, function* () {
|
|
const response = yield this.apiRequest(
|
|
`/api/sites/${username}/${siteName}`
|
|
);
|
|
if (response.status === 404) {
|
|
return null;
|
|
}
|
|
if (response.status >= 300) {
|
|
let error = {};
|
|
try {
|
|
error = response.json;
|
|
} catch (_) {
|
|
}
|
|
throw new Error(
|
|
error.message || `Failed to fetch site: ${response.status}`
|
|
);
|
|
}
|
|
return response.json;
|
|
});
|
|
}
|
|
/**
|
|
* Sync files with the server
|
|
* Compares local files with existing files and returns upload URLs for changed files
|
|
* @param dryRun If true, only returns what would happen without making changes
|
|
*/
|
|
syncFiles(siteId, files, dryRun = false) {
|
|
return __async(this, null, function* () {
|
|
const url = `/api/sites/id/${siteId}/sync${dryRun ? "?dryRun=true" : ""}`;
|
|
const response = yield this.apiRequest(url, {
|
|
method: "POST",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify({ files })
|
|
});
|
|
if (response.status >= 300) {
|
|
let error = {};
|
|
try {
|
|
error = response.json;
|
|
} catch (_) {
|
|
}
|
|
throw new Error(
|
|
error.message || `Failed to sync files: ${response.status}`
|
|
);
|
|
}
|
|
return response.json;
|
|
});
|
|
}
|
|
/**
|
|
* Upload a file directly to R2 using presigned URL
|
|
*/
|
|
uploadToR2(uploadUrl, content, contentType, publishId) {
|
|
return __async(this, null, function* () {
|
|
const buffer = content instanceof Uint8Array ? content.buffer.slice(
|
|
content.byteOffset,
|
|
content.byteOffset + content.byteLength
|
|
) : content;
|
|
const headers = { "Content-Type": contentType };
|
|
if (publishId) {
|
|
headers["x-amz-meta-publish-id"] = publishId;
|
|
}
|
|
const response = yield (0, import_obsidian2.requestUrl)({
|
|
url: uploadUrl,
|
|
method: "PUT",
|
|
body: buffer,
|
|
headers,
|
|
throw: false
|
|
});
|
|
if (response.status >= 300) {
|
|
throw new Error(`Failed to upload file: ${response.status}`);
|
|
}
|
|
return true;
|
|
});
|
|
}
|
|
/**
|
|
* Get site processing status
|
|
*/
|
|
getSiteStatus(siteId) {
|
|
return __async(this, null, function* () {
|
|
const response = yield this.apiRequest(`/api/sites/id/${siteId}/status`);
|
|
if (response.status >= 300) {
|
|
let error = {};
|
|
try {
|
|
error = response.json;
|
|
} catch (_) {
|
|
}
|
|
throw new Error(
|
|
error.message || `Failed to get site status: ${response.status}`
|
|
);
|
|
}
|
|
return response.json;
|
|
});
|
|
}
|
|
/**
|
|
* Get all sites for the user
|
|
*/
|
|
getSites() {
|
|
return __async(this, null, function* () {
|
|
const response = yield this.apiRequest("/api/sites");
|
|
if (response.status >= 300) {
|
|
let error = {};
|
|
try {
|
|
error = response.json;
|
|
} catch (_) {
|
|
}
|
|
throw new Error(
|
|
error.message || `Failed to fetch sites: ${response.status}`
|
|
);
|
|
}
|
|
return response.json;
|
|
});
|
|
}
|
|
/**
|
|
* Publish specific files without affecting other files
|
|
* Use this when you want to publish only selected files
|
|
* @param siteId - Site ID
|
|
* @param files - Array of file metadata to publish
|
|
* @returns Upload URLs for the specified files
|
|
*/
|
|
publishFiles(siteId, files) {
|
|
return __async(this, null, function* () {
|
|
const response = yield this.apiRequest(`/api/sites/id/${siteId}/files`, {
|
|
method: "POST",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify({ files })
|
|
});
|
|
if (response.status >= 300) {
|
|
let error = {};
|
|
try {
|
|
error = response.json;
|
|
} catch (_) {
|
|
}
|
|
throw new Error(
|
|
error.message || `Failed to publish files: ${response.status}`
|
|
);
|
|
}
|
|
return response.json;
|
|
});
|
|
}
|
|
/**
|
|
* Delete/unpublish specific files from the site
|
|
* @param siteId - Site ID
|
|
* @param paths - Array of file paths to delete
|
|
* @returns List of deleted and not found files
|
|
*/
|
|
deleteFiles(siteId, paths) {
|
|
return __async(this, null, function* () {
|
|
const response = yield this.apiRequest(`/api/sites/id/${siteId}/files`, {
|
|
method: "DELETE",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify({ paths })
|
|
});
|
|
if (response.status >= 300) {
|
|
let error = {};
|
|
try {
|
|
error = response.json;
|
|
} catch (_) {
|
|
}
|
|
throw new Error(
|
|
error.message || `Failed to delete files: ${response.status}`
|
|
);
|
|
}
|
|
return response.json;
|
|
});
|
|
}
|
|
};
|
|
|
|
// src/utils/publisherHelpers.ts
|
|
var import_obsidian3 = require("obsidian");
|
|
function normalizePath(path, rootDir) {
|
|
let normalizedPath = path.replace(/\\/g, "/").replace(/^\/+/, "");
|
|
if (rootDir) {
|
|
const rootDirNormalized = rootDir.replace(/\\/g, "/").replace(/^\/+|\/+$/g, "");
|
|
if (normalizedPath.startsWith(rootDirNormalized + "/")) {
|
|
normalizedPath = normalizedPath.slice(rootDirNormalized.length + 1);
|
|
} else if (normalizedPath === rootDirNormalized) {
|
|
normalizedPath = "";
|
|
}
|
|
}
|
|
return normalizedPath;
|
|
}
|
|
function isWithinRootDir(path, rootDir) {
|
|
if (!rootDir) {
|
|
return true;
|
|
}
|
|
const rootDirNormalized = rootDir.replace(/\\/g, "/").replace(/^\/+|\/+$/g, "");
|
|
const pathNormalized = path.replace(/\\/g, "/").replace(/^\/+/, "");
|
|
return pathNormalized.startsWith(rootDirNormalized + "/") || pathNormalized === rootDirNormalized;
|
|
}
|
|
function matchesExcludePatterns(path, excludePatterns) {
|
|
if (!excludePatterns || excludePatterns.length === 0) {
|
|
return false;
|
|
}
|
|
return excludePatterns.some((pattern) => {
|
|
try {
|
|
const regex = new RegExp(pattern);
|
|
return regex.test(path);
|
|
} catch (e) {
|
|
console.error(`Invalid regex pattern: ${pattern}`, e);
|
|
return false;
|
|
}
|
|
});
|
|
}
|
|
function hasPublishFalse(file, app) {
|
|
var _a;
|
|
if (file.extension !== "md" && file.extension !== "mdx") {
|
|
return false;
|
|
}
|
|
const cachedFile = app.metadataCache.getCache(file.path);
|
|
return ((_a = cachedFile == null ? void 0 : cachedFile.frontmatter) == null ? void 0 : _a["publish"]) === false;
|
|
}
|
|
function shouldSkipFile(file, app, rootDir, excludePatterns) {
|
|
return !isWithinRootDir(file.path, rootDir) || matchesExcludePatterns(file.path, excludePatterns) || hasPublishFalse(file, app);
|
|
}
|
|
function validatePublishFrontmatter(frontMatter) {
|
|
if (frontMatter && frontMatter["publish"] === false) {
|
|
new import_obsidian3.Notice("Note is marked as not publishable.");
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function normalizeRootDir(rootDir) {
|
|
return rootDir.replace(/\\/g, "/").replace(/^\/+|\/+$/g, "");
|
|
}
|
|
function stripRootDirPrefix(path, rootDirNormalized) {
|
|
const p = path.replace(/\\/g, "/");
|
|
if (p.startsWith(`${rootDirNormalized}/`)) {
|
|
return p.slice(rootDirNormalized.length + 1);
|
|
}
|
|
if (p === rootDirNormalized) {
|
|
return "";
|
|
}
|
|
return path;
|
|
}
|
|
function rewriteWikilinks(content, rootDir) {
|
|
if (!rootDir) return content;
|
|
const root = normalizeRootDir(rootDir);
|
|
return content.replace(
|
|
new RegExp("(?<!!)(\\[\\[)([^\\]#|]+?)(#[^\\]|]*)?(\\|[^\\]]*)?\\]\\]", "g"),
|
|
(_match, open, path, anchor, alias) => {
|
|
const rewritten = stripRootDirPrefix(path.trim(), root);
|
|
return `${open}${rewritten}${anchor != null ? anchor : ""}${alias != null ? alias : ""}]]`;
|
|
}
|
|
);
|
|
}
|
|
function rewriteEmbeds(content, rootDir) {
|
|
if (!rootDir) return content;
|
|
const root = normalizeRootDir(rootDir);
|
|
return content.replace(
|
|
/!\[\[([^\]#|]+?)(#[^\]|]*)?(\|[^\]]*)?\]\]/g,
|
|
(_match, path, anchor, alias) => {
|
|
const rewritten = stripRootDirPrefix(path.trim(), root);
|
|
return `![[${rewritten}${anchor != null ? anchor : ""}${alias != null ? alias : ""}]]`;
|
|
}
|
|
);
|
|
}
|
|
function rewriteMarkdownLinks(content, rootDir) {
|
|
if (!rootDir) return content;
|
|
const root = normalizeRootDir(rootDir);
|
|
return content.replace(
|
|
/\[([^\]]*)\]\(([^)#\s]+?)(#[^)]*)?\)/g,
|
|
(_match, text, url, anchor) => {
|
|
if (/^(https?:\/\/|ftp:\/\/|\/\/|\/|#|[a-z][a-z0-9+.-]*:)/i.test(url)) return _match;
|
|
const rewritten = stripRootDirPrefix(url, root);
|
|
return `[${text}](${rewritten}${anchor != null ? anchor : ""})`;
|
|
}
|
|
);
|
|
}
|
|
function rewriteFrontmatterPaths(content, rootDir) {
|
|
if (!rootDir) return content;
|
|
const root = normalizeRootDir(rootDir);
|
|
const fmMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
if (!fmMatch) return content;
|
|
const fmBlock = fmMatch[0];
|
|
const rewrittenBlock = fmBlock.replace(
|
|
/^([a-zA-Z_][a-zA-Z0-9_-]*:\s+)(["']?)([^\n"']+)\2$/gm,
|
|
(match2, key, quote, value) => {
|
|
const rewritten = stripRootDirPrefix(value, root);
|
|
if (rewritten === value) return match2;
|
|
return `${key}${quote}${rewritten}${quote}`;
|
|
}
|
|
);
|
|
return content.replace(fmBlock, () => rewrittenBlock);
|
|
}
|
|
function rewriteRootDirPaths(content, rootDir) {
|
|
if (!rootDir) return content;
|
|
let result = content;
|
|
result = rewriteFrontmatterPaths(result, rootDir);
|
|
result = rewriteWikilinks(result, rootDir);
|
|
result = rewriteEmbeds(result, rootDir);
|
|
result = rewriteMarkdownLinks(result, rootDir);
|
|
result = rewriteBaseQueryPaths(result, rootDir);
|
|
return result;
|
|
}
|
|
function rewriteBaseQueryPaths(content, rootDir) {
|
|
if (!rootDir) return content;
|
|
const root = normalizeRootDir(rootDir);
|
|
return content.replace(
|
|
/(```base\n)([\s\S]*?)(\n```)/g,
|
|
(_match, open, body, close) => {
|
|
const rewrittenBody = body.replace(
|
|
/("([^"]+)"|'([^']+)')/g,
|
|
(qmatch, _full, dq, sq) => {
|
|
var _a;
|
|
const inner = (_a = dq != null ? dq : sq) != null ? _a : "";
|
|
const rewritten = stripRootDirPrefix(inner, root);
|
|
if (rewritten === inner) return qmatch;
|
|
return dq !== void 0 ? `"${rewritten}"` : `'${rewritten}'`;
|
|
}
|
|
);
|
|
return `${open}${rewrittenBody}${close}`;
|
|
}
|
|
);
|
|
}
|
|
|
|
// src/Publisher.ts
|
|
var Publisher = class {
|
|
constructor(app, settings) {
|
|
this.siteId = null;
|
|
this.username = null;
|
|
this.app = app;
|
|
this.settings = settings;
|
|
this.client = new FlowershowClient(API_URL, this.settings.flowershowToken);
|
|
}
|
|
/** Get site name, defaulting to vault name if not set */
|
|
getSiteName() {
|
|
return this.settings.siteName || this.app.vault.getName();
|
|
}
|
|
/** Get username */
|
|
getUsername() {
|
|
return __async(this, null, function* () {
|
|
if (this.username) {
|
|
return this.username;
|
|
}
|
|
const userInfo = yield this.client.getUserInfo();
|
|
this.username = userInfo.username;
|
|
return this.username;
|
|
});
|
|
}
|
|
/** Get site ID (may return null if site hasn't been created yet) */
|
|
getSiteId() {
|
|
return __async(this, null, function* () {
|
|
if (this.siteId) {
|
|
return this.siteId;
|
|
}
|
|
const username = yield this.getUsername();
|
|
const existingSite = yield this.client.getSiteByName(
|
|
username,
|
|
this.getSiteName()
|
|
);
|
|
if (existingSite) {
|
|
this.siteId = existingSite.site.id;
|
|
return this.siteId;
|
|
}
|
|
return null;
|
|
});
|
|
}
|
|
/** Get or create the site */
|
|
ensureSite() {
|
|
return __async(this, null, function* () {
|
|
const existingSiteId = yield this.getSiteId();
|
|
if (existingSiteId) {
|
|
return existingSiteId;
|
|
}
|
|
const { site } = yield this.client.createSite(this.getSiteName());
|
|
this.siteId = site.id;
|
|
return this.siteId;
|
|
});
|
|
}
|
|
getTextContent(file) {
|
|
return __async(this, null, function* () {
|
|
const text = yield this.app.vault.cachedRead(file);
|
|
return rewriteRootDirPaths(text, this.settings.rootDir);
|
|
});
|
|
}
|
|
/**
|
|
* Publish note and optionally its embeds
|
|
* @returns Site URL and publish status
|
|
*/
|
|
publishSingleNoteWithEmbeds(file, withEmbeds = true) {
|
|
return __async(this, null, function* () {
|
|
var _a;
|
|
const cachedFile = this.app.metadataCache.getCache(file.path);
|
|
if (!cachedFile) {
|
|
throw new FlowershowError(`Note file ${file.path} not found!`);
|
|
}
|
|
const frontmatter = cachedFile.frontmatter;
|
|
if (frontmatter && !validatePublishFrontmatter(frontmatter)) {
|
|
throw new FlowershowError("Can't publish note with `publish: false`");
|
|
}
|
|
const filesToPublish = [file];
|
|
if (withEmbeds) {
|
|
const uniqueEmbeds = /* @__PURE__ */ new Map();
|
|
const markdown = yield this.app.vault.read(file);
|
|
(_a = cachedFile.embeds) == null ? void 0 : _a.forEach((embed) => {
|
|
const embedTFile = this.app.metadataCache.getFirstLinkpathDest(
|
|
embed.link,
|
|
markdown
|
|
);
|
|
if (embedTFile && !uniqueEmbeds.has(embedTFile.path)) {
|
|
uniqueEmbeds.set(embedTFile.path, embedTFile);
|
|
}
|
|
});
|
|
filesToPublish.push(...uniqueEmbeds.values());
|
|
}
|
|
return yield this.publishBatch({
|
|
filesToPublish
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
* Publish multiple files
|
|
*/
|
|
publishBatch(opts) {
|
|
return __async(this, null, function* () {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
if (!((_a = opts.filesToPublish) == null ? void 0 : _a.length) && !((_b = opts.filesToDelete) == null ? void 0 : _b.length)) {
|
|
throw new FlowershowError("No files to delete or publish provided");
|
|
}
|
|
const totalPublish = (_d = (_c = opts.filesToPublish) == null ? void 0 : _c.length) != null ? _d : 0;
|
|
const totalDelete = (_f = (_e = opts.filesToDelete) == null ? void 0 : _e.length) != null ? _f : 0;
|
|
const total = totalPublish + totalDelete;
|
|
let done = 0;
|
|
const label = totalPublish > 0 ? "Publishing" : "Unpublishing";
|
|
const progress = new import_obsidian4.Notice(`\u231B ${label} (0/${total})...`, 0);
|
|
try {
|
|
const siteId = yield this.ensureSite();
|
|
if (opts.filesToDelete && opts.filesToDelete.length > 0) {
|
|
const normalizedPathsToDelete = opts.filesToDelete.map(
|
|
(path) => normalizePath(path, this.settings.rootDir)
|
|
);
|
|
const deleteResult = yield this.client.deleteFiles(
|
|
siteId,
|
|
normalizedPathsToDelete
|
|
);
|
|
if (deleteResult.notFound.length > 0) {
|
|
throw new FlowershowError(
|
|
`Failed to delete ${deleteResult.notFound.length} file(s): ${deleteResult.notFound.join(
|
|
", "
|
|
)}. Files not found on server.`
|
|
);
|
|
}
|
|
done += totalDelete;
|
|
progress.setMessage(`\u231B ${label} (${done}/${total})...`);
|
|
}
|
|
if (opts.filesToPublish && opts.filesToPublish.length > 0) {
|
|
const fileMetadata = [];
|
|
const filesToProcess = opts.filesToPublish;
|
|
for (const file of filesToProcess) {
|
|
const normalizedPath = normalizePath(
|
|
file.path,
|
|
this.settings.rootDir
|
|
);
|
|
let sha;
|
|
if (isPlainTextExtension(file.extension)) {
|
|
const text = yield this.getTextContent(file);
|
|
sha = yield calculateTextSha(text);
|
|
} else {
|
|
const bytes = yield this.app.vault.readBinary(file);
|
|
sha = yield calculateFileSha(bytes);
|
|
}
|
|
fileMetadata.push({
|
|
path: normalizedPath,
|
|
size: file.stat.size,
|
|
sha
|
|
});
|
|
}
|
|
const publishResult = yield this.client.publishFiles(
|
|
siteId,
|
|
fileMetadata
|
|
);
|
|
for (const uploadInfo of publishResult.files) {
|
|
const file = filesToProcess.find(
|
|
(f) => normalizePath(f.path, this.settings.rootDir) === uploadInfo.path
|
|
);
|
|
if (!file) continue;
|
|
let content;
|
|
if (isPlainTextExtension(file.extension)) {
|
|
const text = yield this.getTextContent(file);
|
|
content = new TextEncoder().encode(text);
|
|
} else {
|
|
const bytes = yield this.app.vault.readBinary(file);
|
|
content = bytes;
|
|
}
|
|
yield this.client.uploadToR2(
|
|
uploadInfo.uploadUrl,
|
|
content,
|
|
uploadInfo.contentType,
|
|
publishResult.publishId
|
|
);
|
|
done++;
|
|
progress.setMessage(`\u231B ${label} (${done}/${total})...`);
|
|
}
|
|
}
|
|
progress.hide();
|
|
const username = yield this.getUsername();
|
|
const site = yield this.client.getSiteByName(
|
|
username,
|
|
this.getSiteName()
|
|
);
|
|
const siteUrl = (site == null ? void 0 : site.site.url) || "";
|
|
return {
|
|
siteUrl,
|
|
filesPublished: (((_g = opts.filesToPublish) == null ? void 0 : _g.length) || 0) + (((_h = opts.filesToDelete) == null ? void 0 : _h.length) || 0)
|
|
};
|
|
} catch (error) {
|
|
progress.hide();
|
|
throw error;
|
|
}
|
|
});
|
|
}
|
|
/** Get publish status */
|
|
getPublishStatus() {
|
|
return __async(this, null, function* () {
|
|
const unchangedFiles = [];
|
|
const changedFiles = [];
|
|
const deletedFiles = [];
|
|
const newFiles = [];
|
|
const username = yield this.getUsername();
|
|
const existingSite = yield this.client.getSiteByName(
|
|
username,
|
|
this.getSiteName()
|
|
);
|
|
if (!existingSite) {
|
|
const localFiles = this.app.vault.getFiles();
|
|
for (const file of localFiles) {
|
|
if (!shouldSkipFile(
|
|
file,
|
|
this.app,
|
|
this.settings.rootDir,
|
|
this.settings.excludePatterns
|
|
)) {
|
|
newFiles.push(file);
|
|
}
|
|
}
|
|
return { unchangedFiles, changedFiles, deletedFiles, newFiles };
|
|
}
|
|
const siteId = existingSite.site.id;
|
|
this.siteId = siteId;
|
|
try {
|
|
const localFiles = this.app.vault.getFiles();
|
|
const fileMetadata = [];
|
|
for (const file of localFiles) {
|
|
if (shouldSkipFile(
|
|
file,
|
|
this.app,
|
|
this.settings.rootDir,
|
|
this.settings.excludePatterns
|
|
)) {
|
|
continue;
|
|
}
|
|
const normalizedPath = normalizePath(file.path, this.settings.rootDir);
|
|
let sha;
|
|
if (isPlainTextExtension(file.extension)) {
|
|
const text = yield this.getTextContent(file);
|
|
sha = yield calculateTextSha(text);
|
|
} else {
|
|
const bytes = yield this.app.vault.readBinary(file);
|
|
sha = yield calculateFileSha(bytes);
|
|
}
|
|
fileMetadata.push({
|
|
path: normalizedPath,
|
|
size: file.stat.size,
|
|
sha
|
|
});
|
|
}
|
|
const syncResult = yield this.client.syncFiles(
|
|
siteId,
|
|
fileMetadata,
|
|
true
|
|
);
|
|
for (const file of localFiles) {
|
|
if (shouldSkipFile(
|
|
file,
|
|
this.app,
|
|
this.settings.rootDir,
|
|
this.settings.excludePatterns
|
|
)) {
|
|
continue;
|
|
}
|
|
const normalizedPath = normalizePath(file.path, this.settings.rootDir);
|
|
if (syncResult.unchanged.includes(normalizedPath)) {
|
|
unchangedFiles.push(file);
|
|
} else if (syncResult.toUpdate.some((u) => u.path === normalizedPath)) {
|
|
changedFiles.push(file);
|
|
} else if (syncResult.toUpload.some((u) => u.path === normalizedPath)) {
|
|
newFiles.push(file);
|
|
}
|
|
}
|
|
deletedFiles.push(...syncResult.deleted);
|
|
} catch (error) {
|
|
console.error("Error getting publish status:", error);
|
|
const errorLocalFiles = this.app.vault.getFiles();
|
|
for (const file of errorLocalFiles) {
|
|
if (!shouldSkipFile(
|
|
file,
|
|
this.app,
|
|
this.settings.rootDir,
|
|
this.settings.excludePatterns
|
|
)) {
|
|
newFiles.push(file);
|
|
}
|
|
}
|
|
}
|
|
return { unchangedFiles, changedFiles, deletedFiles, newFiles };
|
|
});
|
|
}
|
|
};
|
|
|
|
// src/SettingView.ts
|
|
var import_obsidian5 = require("obsidian");
|
|
var SettingView = class {
|
|
constructor(settingsRootElement, publisher, settings, saveSettings) {
|
|
this.debouncedSaveAndUpdate = (0, import_obsidian5.debounce)(
|
|
this.saveSiteSettingsAndUpdateEnv,
|
|
500,
|
|
true
|
|
);
|
|
this.publisher = publisher;
|
|
this.settingsRootElement = settingsRootElement;
|
|
this.settingsRootElement.classList.add("dg-settings");
|
|
this.settings = settings;
|
|
this.saveSettings = saveSettings;
|
|
}
|
|
initialize() {
|
|
this.settingsRootElement.empty();
|
|
const linkDiv = this.settingsRootElement.createEl("div");
|
|
linkDiv.createEl("a", {
|
|
text: "Sign up for Flowershow \u2192",
|
|
href: "https://cloud.flowershow.app/login?utm_source=obsidian&utm_medium=referral"
|
|
});
|
|
linkDiv.setCssProps({ padding: "15px 0" });
|
|
const authHeader = this.settingsRootElement.createEl("h2", {
|
|
text: "Authentication"
|
|
});
|
|
this.initializeTokenSetting();
|
|
this.initializeSiteNameSetting();
|
|
const publishHeader = this.settingsRootElement.createEl("h2", {
|
|
text: "Publishing Settings"
|
|
});
|
|
this.initializeRootDirSetting();
|
|
this.initializeExcludePatternsSetting();
|
|
}
|
|
saveSiteSettingsAndUpdateEnv(metadataCache, settings, saveSettings) {
|
|
return __async(this, null, function* () {
|
|
let updateFailed = false;
|
|
try {
|
|
yield saveSettings();
|
|
} catch (e) {
|
|
new import_obsidian5.Notice(
|
|
"Failed to update settings. Make sure you have an internet connection."
|
|
);
|
|
updateFailed = true;
|
|
}
|
|
if (!updateFailed) {
|
|
yield saveSettings();
|
|
}
|
|
});
|
|
}
|
|
initializeTokenSetting() {
|
|
const desc = document.createDocumentFragment();
|
|
desc.createEl("span", void 0, (span) => {
|
|
span.appendText(
|
|
"Your Flowershow Personal Access Token (PAT). You can generate one "
|
|
);
|
|
span.createEl("a", void 0, (link) => {
|
|
link.href = "https://cloud.flowershow.app/tokens?utm_source=obsidian&utm_medium=referral";
|
|
link.innerText = "here!";
|
|
});
|
|
span.createEl("br");
|
|
span.createEl("br");
|
|
span.appendText("The token should start with ");
|
|
span.createEl("code", { text: "fs_pat_" });
|
|
});
|
|
new import_obsidian5.Setting(this.settingsRootElement).setName("Flowershow PAT Token").setDesc(desc).addText(
|
|
(text) => text.setPlaceholder("fs_pat_...").setValue(this.settings.flowershowToken).onChange((value) => __async(this, null, function* () {
|
|
this.settings.flowershowToken = value;
|
|
yield this.saveSettings();
|
|
}))
|
|
);
|
|
}
|
|
initializeSiteNameSetting() {
|
|
new import_obsidian5.Setting(this.settingsRootElement).setName("Site Name").setDesc(
|
|
"Name of your Flowershow site (will be created if it doesn't exist)"
|
|
).addText(
|
|
(text) => text.setPlaceholder("my-notes").setValue(this.settings.siteName).onChange((value) => __async(this, null, function* () {
|
|
this.settings.siteName = value;
|
|
yield this.saveSettings();
|
|
}))
|
|
);
|
|
}
|
|
initializeRootDirSetting() {
|
|
new import_obsidian5.Setting(this.settingsRootElement).setName("Root Directory").setDesc(
|
|
"Publish only files within this folder. Leave empty to publish entire vault."
|
|
).addText(
|
|
(text) => text.setPlaceholder("my-folder").setValue(this.settings.rootDir).onChange((value) => __async(this, null, function* () {
|
|
const normalized = value.trim().replace(/^\/+|\/+$/g, "");
|
|
this.settings.rootDir = normalized;
|
|
yield this.saveSettings();
|
|
}))
|
|
);
|
|
}
|
|
initializeExcludePatternsSetting() {
|
|
const settingContainer = this.settingsRootElement.createDiv(
|
|
"exclude-patterns-container"
|
|
);
|
|
new import_obsidian5.Setting(settingContainer).setName("Exclude Patterns").setDesc(
|
|
"Regex patterns to exclude files and folders from publishing. One pattern per line. Patterns match against the full path from vault root."
|
|
).addTextArea((textarea) => {
|
|
textarea.setPlaceholder("^\\.git/\n^node_modules/\n\\.DS_Store$").setValue(this.settings.excludePatterns.join("\n")).onChange((value) => __async(this, null, function* () {
|
|
const patterns = value.split("\n").filter((pattern) => pattern.trim() !== "");
|
|
this.settings.excludePatterns = patterns;
|
|
yield this.saveSettings();
|
|
}));
|
|
textarea.inputEl.rows = 4;
|
|
textarea.inputEl.style.width = "100%";
|
|
});
|
|
const helpText = settingContainer.createEl("div", {
|
|
cls: "setting-item-description"
|
|
});
|
|
helpText.innerHTML = `
|
|
<strong>Note:</strong> Patterns match against full paths from vault root.<br>
|
|
Examples:<br>
|
|
\u2022 <code>^private/</code> - Exclude the "private" folder at vault root<br>
|
|
\u2022 <code>^blog/drafts/</code> - Exclude "drafts" folder inside "blog" folder<br>
|
|
\u2022 <code>\\.excalidraw\\.md$</code> - Exclude all Excalidraw files<br>
|
|
\u2022 <code>\\.tmp$</code> - Exclude all .tmp files anywhere in vault
|
|
`;
|
|
}
|
|
};
|
|
|
|
// main.ts
|
|
var Flowershow = class extends import_obsidian6.Plugin {
|
|
constructor(app, manifest) {
|
|
super(app, manifest);
|
|
this.startupAnalytics = [];
|
|
this.loadTimestamp = Date.now();
|
|
this.lastLogTimestamp = this.loadTimestamp;
|
|
this.startupAnalytics = [];
|
|
}
|
|
onload() {
|
|
return __async(this, null, function* () {
|
|
this.logStartupEvent("Plugin Constructor ready, starting onload()");
|
|
yield this.loadSettings();
|
|
if (import_obsidian6.Platform.isDesktop) {
|
|
this.statusBarItem = this.addStatusBarItem();
|
|
this.statusBarItem.addClass("mod-clickable");
|
|
this.statusBarItem.createEl("span", { text: "\u{1F490}" });
|
|
this.statusBarItem.addEventListener("click", () => {
|
|
this.openPublishStatusModal();
|
|
});
|
|
}
|
|
this.publisher = new Publisher(this.app, this.settings);
|
|
this.addSettingTab(new FlowershowSettingTab(this.app, this));
|
|
yield this.addCommands();
|
|
(0, import_obsidian6.addIcon)("flowershow-icon", flowershowIcon);
|
|
this.addRibbonIcon(
|
|
"flowershow-icon",
|
|
"Publish with Flowershow",
|
|
() => __async(this, null, function* () {
|
|
this.openPublishStatusModal();
|
|
})
|
|
);
|
|
});
|
|
}
|
|
onunload() {
|
|
if (this.statusBarItem) {
|
|
this.statusBarItem.remove();
|
|
}
|
|
}
|
|
loadSettings() {
|
|
return __async(this, null, function* () {
|
|
this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData());
|
|
});
|
|
}
|
|
saveSettings() {
|
|
return __async(this, null, function* () {
|
|
yield this.saveData(this.settings);
|
|
this.publisher = new Publisher(this.app, this.settings);
|
|
this.publishStatusModal = null;
|
|
});
|
|
}
|
|
addCommands() {
|
|
return __async(this, null, function* () {
|
|
this.addCommand({
|
|
id: "publish-single-note",
|
|
name: "Publish single note (with embeds)",
|
|
checkCallback: (checking) => {
|
|
if (checking) {
|
|
const currentFile = this.app.workspace.getActiveFile();
|
|
return !!currentFile && currentFile.extension === "md";
|
|
}
|
|
this.publishSingleNote();
|
|
}
|
|
});
|
|
this.addCommand({
|
|
id: "publish-all-files",
|
|
name: "Publish all",
|
|
checkCallback: (checking) => {
|
|
if (checking) {
|
|
return true;
|
|
}
|
|
this.publishAllFiles();
|
|
}
|
|
});
|
|
});
|
|
}
|
|
/** Publish single note and its embeds */
|
|
// TODO make sure that embeds in frontmatter are published too!
|
|
publishSingleNote() {
|
|
return __async(this, null, function* () {
|
|
try {
|
|
const currentFile = this.app.workspace.getActiveFile();
|
|
if (!currentFile) {
|
|
new import_obsidian6.Notice("No file is open. Open a note and try again.");
|
|
return;
|
|
}
|
|
if (currentFile.extension !== "md") {
|
|
new import_obsidian6.Notice(
|
|
"This isn't a Markdown file. Open a .md note and try again."
|
|
);
|
|
return;
|
|
}
|
|
new import_obsidian6.Notice("\u231B Publishing note...");
|
|
const result = yield this.publisher.publishSingleNoteWithEmbeds(
|
|
currentFile
|
|
);
|
|
const frag = createSiteNotice(
|
|
`Published ${result.filesPublished} file(s).`,
|
|
result.siteUrl
|
|
);
|
|
new import_obsidian6.Notice(frag, 8e3);
|
|
} catch (e) {
|
|
console.error(e);
|
|
if (e instanceof FlowershowError) {
|
|
new import_obsidian6.Notice(`\u274C Can't publish note: ${e.message}`);
|
|
} else {
|
|
new import_obsidian6.Notice(`\u274C Can't publish note.`);
|
|
}
|
|
throw e;
|
|
}
|
|
});
|
|
}
|
|
// Publish new or changed files, and unpublish deleted files
|
|
publishAllFiles() {
|
|
return __async(this, null, function* () {
|
|
try {
|
|
const { changedFiles, deletedFiles, newFiles } = yield this.publisher.getPublishStatus();
|
|
const filesToDelete = deletedFiles;
|
|
const filesToPublish = changedFiles.concat(newFiles);
|
|
if (!filesToDelete.length && !filesToPublish.length) {
|
|
new import_obsidian6.Notice("\u274C Nothing new to publish or delete.");
|
|
return;
|
|
}
|
|
const result = yield this.publisher.publishBatch({
|
|
filesToPublish,
|
|
filesToDelete
|
|
});
|
|
const frag = createSiteNotice(
|
|
`Published ${result.filesPublished} file(s).`,
|
|
result.siteUrl
|
|
);
|
|
new import_obsidian6.Notice(frag, 8e3);
|
|
} catch (e) {
|
|
console.error(e);
|
|
if (e instanceof FlowershowError) {
|
|
new import_obsidian6.Notice(`\u274C Can't publish notes: ${e.message}`);
|
|
} else {
|
|
new import_obsidian6.Notice(
|
|
"\u274C Can't publish notes. Check console errors for more info."
|
|
);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
openPublishStatusModal() {
|
|
if (!this.publishStatusModal) {
|
|
this.publishStatusModal = new PublishStatusModal({
|
|
app: this.app,
|
|
publisher: this.publisher,
|
|
settings: this.settings
|
|
});
|
|
}
|
|
this.publishStatusModal.open();
|
|
}
|
|
logStartupEvent(message) {
|
|
const timestamp = Date.now();
|
|
this.startupAnalytics.push(
|
|
`${message}
|
|
Total: ${timestamp - this.loadTimestamp}ms Delta: ${timestamp - this.lastLogTimestamp}ms
|
|
`
|
|
);
|
|
this.lastLogTimestamp = timestamp;
|
|
}
|
|
// private showUpdateModalIfNeeded() {
|
|
// // Show modal if user hasn't seen any version yet (new user or upgrading from pre-4.0)
|
|
// if (
|
|
// !this.settings.lastSeenVersion ||
|
|
// this.settings.lastSeenVersion < "4.0.0"
|
|
// ) {
|
|
// const modal = new UpdateModal(this.app, async () => {
|
|
// // Save current version after modal is closed
|
|
// this.settings.lastSeenVersion = this.manifest.version;
|
|
// await this.saveSettings();
|
|
// });
|
|
// modal.open();
|
|
// }
|
|
// }
|
|
};
|
|
var FlowershowSettingTab = class extends import_obsidian6.PluginSettingTab {
|
|
constructor(app, plugin) {
|
|
super(app, plugin);
|
|
this.plugin = plugin;
|
|
}
|
|
display() {
|
|
const { containerEl } = this;
|
|
containerEl.empty();
|
|
const settingView = new SettingView(
|
|
containerEl,
|
|
this.plugin.publisher,
|
|
this.plugin.settings,
|
|
() => __async(this, null, function* () {
|
|
yield this.plugin.saveSettings();
|
|
})
|
|
);
|
|
settingView.initialize();
|
|
}
|
|
};
|
|
/*! Bundled license information:
|
|
|
|
react/cjs/react.development.js:
|
|
(**
|
|
* @license React
|
|
* react.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.
|
|
*)
|
|
|
|
scheduler/cjs/scheduler.development.js:
|
|
(**
|
|
* @license React
|
|
* scheduler.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.
|
|
*)
|
|
|
|
react-dom/cjs/react-dom.development.js:
|
|
(**
|
|
* @license React
|
|
* react-dom.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.
|
|
*)
|
|
|
|
react-dom/cjs/react-dom-client.development.js:
|
|
(**
|
|
* @license React
|
|
* react-dom-client.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.
|
|
*)
|
|
|
|
react-is/cjs/react-is.development.js:
|
|
react-is/cjs/react-is.development.js:
|
|
(** @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.
|
|
*)
|
|
|
|
object-assign/index.js:
|
|
(*
|
|
object-assign
|
|
(c) Sindre Sorhus
|
|
@license MIT
|
|
*)
|
|
|
|
use-sync-external-store/cjs/use-sync-external-store-shim.development.js:
|
|
(**
|
|
* @license React
|
|
* use-sync-external-store-shim.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-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js:
|
|
(**
|
|
* @license React
|
|
* use-sync-external-store-shim/with-selector.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.
|
|
*)
|
|
|
|
react-is/cjs/react-is.development.js:
|
|
(**
|
|
* @license React
|
|
* react-is.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.
|
|
*)
|
|
|
|
react/cjs/react-jsx-runtime.development.js:
|
|
(**
|
|
* @license React
|
|
* react-jsx-runtime.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.
|
|
*)
|
|
|
|
@mui/styled-engine/esm/index.js:
|
|
(**
|
|
* @mui/styled-engine v7.3.10
|
|
*
|
|
* @license MIT
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*)
|
|
|
|
@mui/system/esm/index.js:
|
|
(**
|
|
* @mui/system v7.3.11
|
|
*
|
|
* @license MIT
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*)
|
|
|
|
@mui/material/esm/index.js:
|
|
(**
|
|
* @mui/material v7.3.11
|
|
*
|
|
* @license MIT
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*)
|
|
*/
|
|
|
|
/* nosourcemap */ |